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

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

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

            }
        }
    });
})();