(function() {
    BemsWebApplication.BemsAnalysisTypeViewModel = function(data) {
            this.SiteId = ko.observable();
            this.AnalysisType = ko.observable();
            this.Name = ko.observable();
            if(data)
                this.fromJS(data);
    };

    $.extend(BemsWebApplication.BemsAnalysisTypeViewModel.prototype, {
        toJS: function() {
            return {
                SiteId: this.SiteId(),
                AnalysisType: this.AnalysisType(),
                Name: this.Name(),
            };
        },

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

            }
        }
    });
})();