(function() {
    BemsWebApplication.FmsMaterialCodeReleaseTypeViewModel = function(data) {
            this.ReleaseTypeId = ko.observable();
            this.Name = ko.observable();
            this.Description = ko.observable();
            if(data)
                this.fromJS(data);
    };

    $.extend(BemsWebApplication.FmsMaterialCodeReleaseTypeViewModel.prototype, {
        toJS: function() {
            return {
                ReleaseTypeId: this.ReleaseTypeId(),
                Name: this.Name(),
                Description: this.Description(),
            };
        },

        fromJS: function(data) {
            if(data) {
                this.ReleaseTypeId(data.ReleaseTypeId);
                this.Name(data.Name);
                this.Description(data.Description);

            }
        }
    });
})();