860fccc38e456ef75980d7db29ec776959031df7.svn-base 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. 
  2. (function () {
  3. BemsWebApplication.FmsBudgetDetailExecution2ViewModel = function (data) {
  4. this.SiteId = ko.observable();
  5. this.Year = ko.observable();
  6. this.BudgetClassId = ko.observable();
  7. this.RootBudgetClassId = ko.observable();
  8. this.ParentBudgetClassId = ko.observable();
  9. this.RootBudgetName = ko.observable();
  10. this.ParentBudgetName = ko.observable();
  11. this.MonthlyBudget = ko.observable();
  12. this.MonthlyExecution = ko.observable();
  13. this.Month = ko.observable();
  14. this.YearlyBudget = ko.observable();
  15. this.YearlyExecution = ko.observable();
  16. this.Depth = ko.observable();
  17. this.Name = ko.observable();
  18. this.BudgetSeq = ko.observable();
  19. if (data)
  20. this.fromJS(data);
  21. };
  22. $.extend(BemsWebApplication.FmsBudgetDetailExecution2ViewModel.prototype, {
  23. toJS: function () {
  24. return {
  25. SiteId: this.SiteId(),
  26. Year: this.Year(),
  27. BudgetClassId: this.BudgetClassId(),
  28. RootBudgetClassId: this.RootBudgetClassId(),
  29. ParentBudgetClassId: this.ParentBudgetClassId(),
  30. RootBudgetName: this.RootBudgetName(),
  31. ParentBudgetName: this.ParentBudgetName(),
  32. MonthlyExecution: this.MonthlyExecution(),
  33. Month: this.Month(),
  34. YearlyBudget: this.YearlyBudget(),
  35. MonthlyBudget: this.MonthlyBudget(),
  36. YearlyExecution: this.YearlyExecution(),
  37. Depth: this.Depth(),
  38. Name: this.Name(),
  39. BudgetSeq: this.BudgetSeq(),
  40. };
  41. },
  42. fromJS: function (data) {
  43. if (data) {
  44. this.SiteId(data.SiteId);
  45. this.Year(data.Year);
  46. this.BudgetClassId(data.BudgetClassId);
  47. this.RootBudgetClassId(data.RootBudgetClassId);
  48. this.ParentBudgetClassId(data.ParentBudgetClassId);
  49. this.RootBudgetName(data.RootBudgetName);
  50. this.ParentBudgetName(data.ParentBudgetName);
  51. this.MonthlyExecution(data.MonthlyExecution);
  52. this.Month(data.Month);
  53. this.YearlyBudget(data.YearlyBudget);
  54. this.MonthlyBudget(data.MonthlyBudget);
  55. this.YearlyExecution(data.YearlyExecution);
  56. this.Depth(data.Depth);
  57. this.Name(data.Name);
  58. this.BudgetSeq(data.BudgetSeq);
  59. }
  60. }
  61. });
  62. })();