(function () { BemsWebApplication.CmUserViewModel = function (data) { this.SiteId = ko.observable(); this.UserId = ko.observable(); this.CompanyId = ko.observable(); this.DepartmentId = ko.observable(); this.PositionId = ko.observable(); this.BusinessFieldId = ko.observable(); this.UserGroupId = ko.observable(); this.Name = ko.observable(); this.Passwd = ko.observable(); this.Birthday = ko.observable(); this.Lunar = ko.observable(); this.StateId = ko.observable(); this.EmploymentType = ko.observable(); this.EmploymentStatus = ko.observable(); this.OfficePhoneNo = ko.observable(); this.HomePhoneNo = ko.observable(); this.MobilePhoneNo = ko.observable(); this.HomeZip1 = ko.observable(); this.HomeZip2 = ko.observable(); this.HomeAddress1 = ko.observable(); this.HomeAdderss2 = ko.observable(); this.Email = ko.observable(); this.EnterDate = ko.observable(); this.RetireDate = ko.observable(); this.Comment = ko.observable(); this.Rfcsn = ko.observable(); this.PasswordUpdatedDate = ko.observable(); //this.PhotoFileId = ko.observable(); this.IsBems = ko.observable(); this.IsUse = ko.observable(); this.Certificated = ko.observable(); this.IsScheduleUser = ko.observable(); this.IsSI = ko.observable(); this.IsMobile = ko.observable(); if (data) this.fromJS(data); }; $.extend(BemsWebApplication.CmUserViewModel.prototype, { toJS: function () { return { SiteId: this.SiteId(), UserId: this.UserId(), CompanyId: this.CompanyId(), DepartmentId: this.DepartmentId(), PositionId: this.PositionId(), BusinessFieldId: this.BusinessFieldId(), UserGroupId: this.UserGroupId(), Name: this.Name(), Passwd: this.Passwd(), Birthday: this.Birthday(), Lunar: this.Lunar(), StateId: this.StateId(), EmploymentType: this.EmploymentType(), EmploymentStatus: this.EmploymentStatus(), OfficePhoneNo: this.OfficePhoneNo(), HomePhoneNo: this.HomePhoneNo(), MobilePhoneNo: this.MobilePhoneNo(), HomeZip1: this.HomeZip1(), HomeZip2: this.HomeZip2(), HomeAddress1: this.HomeAddress1(), HomeAdderss2: this.HomeAdderss2(), Email: this.Email(), EnterDate: this.EnterDate(), RetireDate: this.RetireDate(), Comment: this.Comment(), Rfcsn: this.Rfcsn(), PasswordUpdatedDate: this.PasswordUpdatedDate(), //PhotoFileId: this.PhotoFileId(), IsBems: this.IsBems(), IsUse: this.IsUse(), Certificated: this.Certificated(), IsScheduleUser: this.IsScheduleUser(), IsSI: this.IsSI(), IsMobile: this.IsMobile(), }; }, fromJS: function (data) { if (data) { this.SiteId(data.SiteId); this.UserId(data.UserId); this.CompanyId(data.CompanyId); this.DepartmentId(data.DepartmentId); this.PositionId(data.PositionId); this.BusinessFieldId(data.BusinessFieldId); this.UserGroupId(data.UserGroupId); this.Name(data.Name); this.Passwd(data.Passwd); this.Birthday(data.Birthday); this.Lunar(data.Lunar); this.StateId(data.StateId); this.EmploymentType(data.EmploymentType); this.EmploymentStatus(data.EmploymentStatus); this.OfficePhoneNo(data.OfficePhoneNo); this.HomePhoneNo(data.HomePhoneNo); this.MobilePhoneNo(data.MobilePhoneNo); this.HomeZip1(data.HomeZip1); this.HomeZip2(data.HomeZip2); this.HomeAddress1(data.HomeAddress1); this.HomeAdderss2(data.HomeAdderss2); this.Email(data.Email); this.EnterDate(data.EnterDate); this.RetireDate(data.RetireDate); this.Comment(data.Comment); this.Rfcsn(data.Rfcsn); this.PasswordUpdatedDate(data.PasswordUpdatedDate); //this.PhotoFileId(data.PhotoFileId); this.IsBems(data.IsBems); this.IsUse(data.IsUse); this.Certificated(data.Certificated); this.IsScheduleUser(data.IsScheduleUser); this.IsSI(data.IsSI); this.IsMobile(data.IsMobile); } } }); })();