f76d60a9401c209fd65619d8a7d189f2a1090ed0.svn-base 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. (function() {
  2. BemsWebApplication.FmsWorkDailyRecordTemplateViewModel = function(data) {
  3. this.SiteId = ko.observable();
  4. this.BusinessFieldId = ko.observable();
  5. this.TemplateId = ko.observable();
  6. this.TemplateName = ko.observable();
  7. this.StartDate = ko.observable();
  8. this.IsUse = ko.observable();
  9. this.SortOrderNo = ko.observable();
  10. this.InsertedDate = ko.observable();
  11. this.InsertedUserId = ko.observable();
  12. this.UpdatedDate = ko.observable();
  13. this.UpdatedUserId = ko.observable();
  14. if(data)
  15. this.fromJS(data);
  16. };
  17. $.extend(BemsWebApplication.FmsWorkDailyRecordTemplateViewModel.prototype, {
  18. toJS: function() {
  19. return {
  20. SiteId: this.SiteId(),
  21. BusinessFieldId: this.BusinessFieldId(),
  22. TemplateId: this.TemplateId(),
  23. TemplateName: this.TemplateName(),
  24. StartDate: this.StartDate(),
  25. IsUse: this.IsUse(),
  26. SortOrderNo: this.SortOrderNo(),
  27. InsertedDate: this.InsertedDate(),
  28. InsertedUserId: this.InsertedUserId(),
  29. UpdatedDate: this.UpdatedDate(),
  30. UpdatedUserId: this.UpdatedUserId(),
  31. };
  32. },
  33. fromJS: function(data) {
  34. if(data) {
  35. this.SiteId(data.SiteId);
  36. this.BusinessFieldId(data.BusinessFieldId);
  37. this.TemplateId(data.TemplateId);
  38. this.TemplateName(data.TemplateName);
  39. this.StartDate(data.StartDate);
  40. this.IsUse(data.IsUse);
  41. this.SortOrderNo(data.SortOrderNo);
  42. this.InsertedDate(data.InsertedDate);
  43. this.InsertedUserId(data.InsertedUserId);
  44. this.UpdatedDate(data.UpdatedDate);
  45. this.UpdatedUserId(data.UpdatedUserId);
  46. }
  47. }
  48. });
  49. })();