FrmPopCopyBudgetData.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using com.hnshituo.pur.vo;
  11. using Core.Mes.Client.Comm.Tool;
  12. using CoreFS.CA06;
  13. using Pur.Entity;
  14. namespace Pur.Pop_upWindow
  15. {
  16. public partial class FrmPopCopyBudgetData : FrmPmsBase
  17. {
  18. public string Tips;
  19. private ArrayList list;
  20. public string isOrg="1";
  21. public FrmPopCopyBudgetData()
  22. {
  23. InitializeComponent();
  24. }
  25. public FrmPopCopyBudgetData(OpeBase Ob,ArrayList List)
  26. {
  27. InitializeComponent();
  28. this.ob = Ob;
  29. this.list = List;
  30. }
  31. public FrmPopCopyBudgetData(OpeBase Ob, ArrayList List,String isOrg1)
  32. {
  33. InitializeComponent();
  34. this.ob = Ob;
  35. this.list = List;
  36. this.isOrg = isOrg1;
  37. }
  38. private void FrmPopCopyBudgetData_Load(object sender, EventArgs e)
  39. {
  40. //初始化Tips
  41. Tips = "0";
  42. //加载年选择事件
  43. DataTable dt = new DataTable();
  44. dt.Columns.Add("YEAR", Type.GetType("System.Int32"));
  45. for (int i = DateTime.Now.AddYears(-1).Year; i <= DateTime.Now.AddYears(3).Year; i++)
  46. dt.Rows.Add(new object[] { i });
  47. txt_Year.DataSource = dt;
  48. txt_Year.ValueMember = "YEAR";
  49. txt_Year.DisplayMember = "YEAR";
  50. txt_Year.Value = DateTime.Now.Year.ToString();
  51. if (isOrg == "0")
  52. {
  53. this.Text = "油卡充值标准复制";
  54. lab_orgMsg.Text = "*源数据未维护充值标准的将自动过滤掉";
  55. }
  56. //备注
  57. txt_Text.Text = "copy data";
  58. }
  59. private void btn_Sure_Click(object sender, EventArgs e)
  60. {
  61. if (txt_Year.Text == "")
  62. {
  63. MessageUtil.ShowTips("未指定年份");
  64. txt_Year.Focus();
  65. return;
  66. }
  67. CoreResult re =new CoreResult();
  68. if (isOrg == "1")
  69. {
  70. re = this.execute<CoreResult>("com.hnshituo.pur.configure.service.ConfigureOrgBudgetService", "doCopy", new object[] { list, txt_Year.Value, txt_Text.Text });
  71. }
  72. else if (isOrg == "0")
  73. {
  74. re = this.execute<CoreResult>("com.hnshituo.pur.requireplan.service.OilBudgetService", "doCopy", new object[] { list, txt_Year.Value, txt_Text.Text });
  75. }
  76. else {
  77. MessageUtil.ShowTips("未知参数");
  78. return;
  79. }
  80. if (re.Resultcode == 0)
  81. {
  82. MessageUtil.ShowTips("复制成功");
  83. Tips = "1";
  84. this.Close();
  85. }
  86. else
  87. {
  88. if (MessageUtil.ShowYesNoAndQuestion("操作失败:" + re.Resultmsg) == DialogResult.Yes)
  89. {
  90. Tips = "0";
  91. this.Close();
  92. }
  93. }
  94. }
  95. private void btn_Cancel_Click(object sender, EventArgs e)
  96. {
  97. Tips = "0";
  98. this.Close();
  99. }
  100. }
  101. }