(function () {
    BemsWebApplication.FmsConstructionCodeTypeViewModel = function (data) {
        this.SiteId = ko.observable();
        this.ConstructionTypeId = ko.observable();
        this.Name = ko.observable();
        this.IsUse = ko.observable();
        if (data)
            this.fromJS(data);
    };

    $.extend(BemsWebApplication.FmsConstructionCodeTypeViewModel.prototype, {
        toJS: function () {
            return {
                SiteId: this.SiteId(),
                ConstructionTypeId: this.ConstructionTypeId(),
                Name: this.Name(),
                IsUse: this.IsUse(),
            };
        },

        fromJS: function (data) {
            if (data) {
                this.SiteId(data.SiteId);
                this.ConstructionTypeId(data.ConstructionTypeId);
                this.Name(data.Name);
                this.IsUse(data.IsUse);
            }
        }
    });
})();