(function () {
    BemsWebApplication.FmsMonthlyReportViewModel = function (data) {
        this.SiteId = ko.observable();
        this.MonthlyReportId = ko.observable();
        this.Name = ko.observable();
        this.Contents = ko.observable();
        this.RegisterUserId = ko.observable();
        this.AddDate = ko.observable();
        if (data)
            this.fromJS(data);
    };

    $.extend(BemsWebApplication.FmsMonthlyReportViewModel.prototype, {
        toJS: function () {
            return {
                SiteId: this.SiteId(),
                MonthlyReportId: this.MonthlyReportId(),
                Name: this.Name(),
                Contents: this.Contents(),
                RegisterUserId: this.RegisterUserId(),
                AddDate: this.AddDate(),

            };
        },

        fromJS: function (data) {
            if (data) {
                this.SiteId(data.SiteId);
                this.MonthlyReportId(data.MonthlyReportId);
                this.Name(data.Name);
                this.Contents(data.Contents);
                this.RegisterUserId(data.RegisterUserId);
                this.AddDate(data.AddDate);

            }
        }
    });
})();