(function() {
    BemsWebApplication.FmsDrawingHistoryViewModel = function(data) {
            this.SiteId = ko.observable();
            this.DrawingId = ko.observable();
            this.HistoryId = ko.observable();
            this.RevisionNo = ko.observable();
            this.FileId = ko.observable();
            this.Description = ko.observable();
            this.UpdatedDate = ko.observable();
            this.UpdatedUserId = ko.observable();
            if(data)
                this.fromJS(data);
    };

    $.extend(BemsWebApplication.FmsDrawingHistoryViewModel.prototype, {
        toJS: function() {
            return {
                SiteId: this.SiteId(),
                DrawingId: this.DrawingId(),
                HistoryId: this.HistoryId(),
                RevisionNo: this.RevisionNo(),
                FileId: this.FileId(),
                Description: this.Description(),
                UpdatedDate: this.UpdatedDate(),
                UpdatedUserId: this.UpdatedUserId(),
            };
        },

        fromJS: function(data) {
            if(data) {
                this.SiteId(data.SiteId);
                this.DrawingId(data.DrawingId);
                this.HistoryId(data.HistoryId);
                this.RevisionNo(data.RevisionNo);
                this.FileId(data.FileId);
                this.Description(data.Description);
                this.UpdatedDate(data.UpdatedDate);
                this.UpdatedUserId(data.UpdatedUserId);

            }
        }
    });
})();