125584f34b6adfc3c92486bbb6a73b84ef084c2a.svn-base 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. (function () {
  2. BemsWebApplication.CmUserLoginHistoryViewModel = function (data) {
  3. this.SiteId = ko.observable();
  4. this.UserId = ko.observable();
  5. this.LoginHistoryId = ko.observable();
  6. this.Type = ko.observable();
  7. this.TraceTime = ko.observable();
  8. this.IpAddress = ko.observable();
  9. if (data)
  10. this.fromJS(data);
  11. };
  12. $.extend(BemsWebApplication.CmUserLoginHistoryViewModel.prototype, {
  13. toJS: function () {
  14. return {
  15. SiteId: this.SiteId(),
  16. UserId: this.UserId(),
  17. LoginHistoryId: this.LoginHistoryId(),
  18. Type: this.Type(),
  19. TraceTime: this.TraceTime(),
  20. IpAddress: this.IpAddress(),
  21. };
  22. },
  23. fromJS: function (data) {
  24. if (data) {
  25. this.SiteId(data.SiteId);
  26. this.UserId(data.UserId);
  27. this.LoginHistoryId(data.LoginHistoryId);
  28. this.Type(data.Type);
  29. this.TraceTime(data.TraceTime);
  30. this.IpAddress(data.IpAddress);
  31. }
  32. }
  33. });
  34. })();