UIK040030.cs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using System.Collections;
  11. using Infragistics.Win.UltraWinGrid;
  12. namespace Core.LZMes.Client.UIK
  13. {
  14. public partial class UIK040030 : FrmBase
  15. {
  16. public UIK040030()
  17. {
  18. InitializeComponent();
  19. }
  20. #region "ToolBar Event"
  21. public override void ToolBar_Click(object sender, string ToolbarKey)
  22. {
  23. switch (ToolbarKey)
  24. {
  25. case "Query":
  26. this.DoQuery();
  27. break;
  28. case "Save":
  29. this.Save();
  30. this.DoQuery();
  31. break;
  32. case "Delete":
  33. this.doDelete();
  34. this.DoQuery();
  35. break;
  36. case "Export":
  37. this.DoExport();
  38. break;
  39. }
  40. }
  41. string strDtime = null;
  42. private void DoQuery()
  43. {
  44. try
  45. {
  46. //if (this.checkBox1.Checked)
  47. //{
  48. strDtime = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
  49. //}
  50. //else
  51. //{
  52. // //strDtime = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMM");//默认为当月
  53. // strDtime = "";
  54. //}
  55. this.dataSet1.Tables[0].Clear();
  56. ArrayList al = new ArrayList();
  57. al.Add("UIK040030_01.SELECT");
  58. al.Add(strDtime);
  59. al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));
  60. //al.Add(this.textArea.Text.ToString().Trim());
  61. //al.Add(this.textMainMc.Text.ToString().Trim());
  62. //al.Add(this.ComboGZYY.Text.ToString());
  63. //al.Add(strDtime);
  64. //al.Add(this.textBox1.Text.ToString());
  65. //al.Add(this.textBox1.Text.ToString());
  66. //al.Add(this.textBox1.Text.ToString());
  67. //al.Add(this.textBox1.Text.ToString());
  68. //al.Add(this.textBox1.Text.ToString());
  69. //al.Add(this.textBox1.Text.ToString());
  70. //if (this.ComboZRBM.Text.ToString()== "机械")
  71. //{
  72. // al.Add("True");
  73. //}
  74. //else
  75. //{
  76. // al.Add("");
  77. //}
  78. // if(this.ComboZRBM.Text.ToString() == "液压")
  79. //{
  80. // al.Add("True");
  81. //}
  82. // else
  83. // {
  84. // al.Add("");
  85. //}
  86. // if(this.ComboZRBM.Text.ToString() == "电气")
  87. // {
  88. // al.Add("True");
  89. // }
  90. // else
  91. // {
  92. // al.Add("");
  93. //}
  94. // if(this.ComboZRBM.Text.ToString() == "自动化")
  95. // {
  96. // al.Add("True");
  97. // }
  98. // else
  99. // {
  100. // al.Add("");
  101. //}
  102. // if(this.ComboZRBM.Text.ToString() == "操作")
  103. // {
  104. // al.Add("True");
  105. // }
  106. // else
  107. // {
  108. // al.Add("");
  109. //}
  110. // if (this.ComboZRBM.Text.ToString() == "外因")
  111. // {
  112. // al.Add("True");
  113. // }
  114. // else
  115. // {
  116. // al.Add("");
  117. //}
  118. // al.Add(this.comboBox1.SelectedValue.ToString());
  119. CoreClientParam ccp = new CoreClientParam();
  120. ccp.ServerName = "UIB.COM.ComDBQuery";
  121. ccp.MethodName = "doSimpleQuery";
  122. ccp.ServerParams = new object[] { al };
  123. ccp.SourceDataTable = this.dataSet1.Tables[0];
  124. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  125. }
  126. catch (Exception EX)
  127. {
  128. MessageBox.Show(EX.ToString());
  129. }
  130. }
  131. public void Save()
  132. {
  133. try
  134. {
  135. ArrayList list = null;
  136. int i = 0;
  137. string GZ_TIME_FR_Time = null;
  138. string GZ_TIME_TO_Time = null;
  139. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  140. {
  141. if (ugr.Cells["CHK"].Text.ToString() == "True")
  142. {
  143. if (ugr.Cells["SEQ_NO"].Text == "")//insert
  144. {
  145. i++;
  146. list = new ArrayList();
  147. //list.Add("UIK040030_01.INSERT");
  148. //list.Add(ugr.Cells["AREA"].Text.ToString());
  149. //list.Add(ugr.Cells["MC_ID"].Text.ToString());
  150. //list.Add(ugr.Cells["MC_NAME"].Text.ToString());
  151. //GZ_TIME_FR_Time = Convert.ToDateTime(ugr.Cells["GZ_TIME_FR"].Text.ToString()).ToString("yyyyMMdd");// string.Format("{0:yyyyMMdd}" , );
  152. //list.Add(GZ_TIME_FR_Time);
  153. //list.Add(ugr.Cells["GZ_TIME_FR"].Text.ToString());
  154. //GZ_TIME_TO_Time = Convert.ToDateTime(ugr.Cells["GZ_TIME_TO"].Text.ToString()).ToString("yyyyMMdd");//this.ultraDateTimeEditor3.DateTime.ToString("yyyyMMdd");//string.Format("{0:yyyyMMdd}", );
  155. //list.Add(GZ_TIME_TO_Time);
  156. // list.Add(ugr.Cells["GZ_TIME_TO"].Text.ToString());
  157. // list.Add(ugr.Cells["GZ_LRR"].Text.ToString());
  158. //list.Add(this.UserInfo.GetUserName().ToString());//录入人
  159. //list.Add(ugr.Cells["GZ_LR_SJ"].Text.ToString());
  160. //list.Add(ugr.Cells["GZ_YY"].Text.ToString());
  161. //list.Add(ugr.Cells["GZ_BM_JX"].Text.ToString());
  162. //list.Add(ugr.Cells["GZ_BM_YY"].Text.ToString());
  163. //list.Add(ugr.Cells["GZ_BM_DQ"].Text.ToString());
  164. //list.Add(ugr.Cells["GZ_BM_ZDH"].Text.ToString());
  165. //list.Add(ugr.Cells["GZ_BM_CZ"].Text.ToString());
  166. //list.Add(ugr.Cells["GZ_BM_WY"].Text.ToString());
  167. //list.Add(ugr.Cells["JX_ZRR"].Text.ToString());
  168. //list.Add(ugr.Cells["YY_ZRR"].Text.ToString());
  169. //list.Add(ugr.Cells["DQ_ZRR"].Text.ToString());
  170. //list.Add(ugr.Cells["ZDH_ZRR"].Text.ToString());
  171. //list.Add(ugr.Cells["CZ_ZRR"].Text.ToString());
  172. //list.Add(ugr.Cells["WY_ZRR"].Text.ToString());
  173. //list.Add(ugr.Cells["BZ"].Text.ToString());
  174. //list.Add(Convert.ToString(i));
  175. //list.Add(ugr.Cells["GZ_BM_ESY"].Text.ToString());
  176. //list.Add(ugr.Cells["GZ_BM_BY"].Text.ToString());
  177. //list.Add(ugr.Cells["ESY_ZRR"].Text.ToString());
  178. //list.Add(ugr.Cells["BY_ZRR"].Text.ToString());
  179. //list.Add(ugr.Cells["seq_no"].Text.ToString());
  180. list.Add("UIK040030_01.INSERT");
  181. list.Add(Convert.ToString(i));
  182. list.Add(ugr.Cells["GZ_TIME_FR"].Text.ToString());
  183. list.Add(ugr.Cells["BC"].Text.ToString());
  184. list.Add(ugr.Cells["GZ_TIME_TO"].Text.ToString());
  185. list.Add(ugr.Cells["YCSJ"].Text.ToString());
  186. list.Add(ugr.Cells["BZ"].Text.ToString());
  187. list.Add(ugr.Cells["GZYY_CJ1"].Text.ToString());
  188. list.Add(ugr.Cells["GZYY_CJ2"].Text.ToString());
  189. list.Add(ugr.Cells["GZYY_CJ3"].Text.ToString());
  190. list.Add(ugr.Cells["GZYY_CJ4"].Text.ToString());
  191. list.Add(ugr.Cells["GZYY_CJ5"].Text.ToString());
  192. list.Add(ugr.Cells["GZYY_CJ6"].Text.ToString());
  193. list.Add(ugr.Cells["GZYY_CJ7"].Text.ToString());
  194. list.Add(ugr.Cells["GZYY_CJ8"].Text.ToString());
  195. list.Add(ugr.Cells["GZYY_CJ9"].Text.ToString());
  196. list.Add(ugr.Cells["GZ_BM_YY1"].Text.ToString());
  197. list.Add(ugr.Cells["GZ_BM_YY2"].Text.ToString());
  198. list.Add(ugr.Cells["GZ_BM_JX1"].Text.ToString());
  199. list.Add(ugr.Cells["GZ_BM_JX2"].Text.ToString());
  200. list.Add(ugr.Cells["GZ_BM_JX3"].Text.ToString());
  201. list.Add(ugr.Cells["GZ_BM_JX4"].Text.ToString());
  202. list.Add(ugr.Cells["GZ_BM_JX5"].Text.ToString());
  203. list.Add(ugr.Cells["GZ_BM_JX6"].Text.ToString());
  204. list.Add(ugr.Cells["GZ_BM_CD1"].Text.ToString());
  205. list.Add(ugr.Cells["GZ_BM_CD2"].Text.ToString());
  206. list.Add(ugr.Cells["GZ_BM_CD3"].Text.ToString());
  207. list.Add(ugr.Cells["GZ_BM_ZDH1"].Text.ToString());
  208. list.Add(ugr.Cells["GZ_BM_ZDH2"].Text.ToString());
  209. list.Add(ugr.Cells["GZ_BM_ZDH3"].Text.ToString());
  210. list.Add(ugr.Cells["GZ_BM_ZDH4"].Text.ToString());
  211. list.Add(ugr.Cells["GZ_BM_ZDH5"].Text.ToString());
  212. list.Add(ugr.Cells["GZ_BM_ESY1"].Text.ToString());
  213. list.Add(ugr.Cells["GZ_BM_ESY2"].Text.ToString());
  214. list.Add(ugr.Cells["GZ_BM_EJ1"].Text.ToString());
  215. list.Add(ugr.Cells["GZ_BM_CJ1"].Text.ToString());
  216. list.Add(this.UserInfo.GetUserName().ToString());//录入人
  217. //list.Add(ugr.Cells["GZ_LR_SJ"].Text.ToString());
  218. CoreClientParam ccp = new CoreClientParam();
  219. ccp.ServerName = "UIB.COM.ComDBSave";
  220. ccp.ServerParams = new object[] { list };
  221. ccp.MethodName = "doXmlSave";
  222. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  223. }
  224. else//update
  225. {
  226. list = new ArrayList();
  227. list.Add("UIK040030_01.UPDATE");
  228. //list.Add(ugr.Cells["GZ_TIME_FR"].Text.ToString());
  229. //GZ_TIME_FR_Time = Convert.ToDateTime(ugr.Cells["GZ_TIME_FR"].Text.ToString()).ToString("yyyyMMdd");
  230. list.Add(ugr.Cells["GZ_TIME_FR"].Text.ToString());
  231. list.Add(ugr.Cells["BC"].Text.ToString());
  232. list.Add(ugr.Cells["GZ_TIME_TO"].Text.ToString());
  233. list.Add(ugr.Cells["YCSJ"].Text.ToString());
  234. //GZ_TIME_TO_Time = Convert.ToDateTime(ugr.Cells["GZ_TIME_TO"].Text.ToString()).ToString("yyyyMMdd");//this.ultraDateTimeEditor3.DateTime.ToString("yyyyMMdd");//string.Format("{0:yyyyMMdd}", );
  235. //list.Add(GZ_TIME_TO_Time);
  236. list.Add(ugr.Cells["BZ"].Text.ToString());
  237. //list.Add(ugr.Cells["GZ_TIME_FR"].Text.ToString());
  238. //list.Add(ugr.Cells["GZ_TIME_TO"].Text.ToString());
  239. //list.Add(ugr.Cells["GZ_LRR"].Text.ToString());
  240. //list.Add(ugr.Cells["GZ_LR_SJ"].Text.ToString());
  241. list.Add(ugr.Cells["GZYY_CJ1"].Text.ToString());
  242. list.Add(ugr.Cells["GZYY_CJ2"].Text.ToString());
  243. list.Add(ugr.Cells["GZYY_CJ3"].Text.ToString());
  244. list.Add(ugr.Cells["GZYY_CJ4"].Text.ToString());
  245. list.Add(ugr.Cells["GZYY_CJ5"].Text.ToString());
  246. list.Add(ugr.Cells["GZYY_CJ6"].Text.ToString());
  247. list.Add(ugr.Cells["GZYY_CJ7"].Text.ToString());
  248. list.Add(ugr.Cells["GZYY_CJ8"].Text.ToString());
  249. list.Add(ugr.Cells["GZYY_CJ9"].Text.ToString());
  250. list.Add(ugr.Cells["GZ_BM_YY1"].Text.ToString());
  251. list.Add(ugr.Cells["GZ_BM_YY2"].Text.ToString());
  252. list.Add(ugr.Cells["GZ_BM_JX1"].Text.ToString());
  253. list.Add(ugr.Cells["GZ_BM_JX2"].Text.ToString());
  254. list.Add(ugr.Cells["GZ_BM_JX3"].Text.ToString());
  255. list.Add(ugr.Cells["GZ_BM_JX4"].Text.ToString());
  256. list.Add(ugr.Cells["GZ_BM_JX5"].Text.ToString());
  257. list.Add(ugr.Cells["GZ_BM_JX6"].Text.ToString());
  258. list.Add(ugr.Cells["GZ_BM_CD1"].Text.ToString());
  259. list.Add(ugr.Cells["GZ_BM_CD2"].Text.ToString());
  260. list.Add(ugr.Cells["GZ_BM_CD3"].Text.ToString());
  261. list.Add(ugr.Cells["GZ_BM_ZDH1"].Text.ToString());
  262. list.Add(ugr.Cells["GZ_BM_ZDH2"].Text.ToString());
  263. list.Add(ugr.Cells["GZ_BM_ZDH3"].Text.ToString());
  264. list.Add(ugr.Cells["GZ_BM_ZDH4"].Text.ToString());
  265. list.Add(ugr.Cells["GZ_BM_ZDH5"].Text.ToString());
  266. list.Add(ugr.Cells["GZ_BM_ESY1"].Text.ToString());
  267. list.Add(ugr.Cells["GZ_BM_ESY2"].Text.ToString());
  268. list.Add(ugr.Cells["GZ_BM_EJ1"].Text.ToString());
  269. list.Add(ugr.Cells["GZ_BM_CJ1"].Text.ToString());
  270. list.Add(this.UserInfo.GetUserName().ToString());//录入人
  271. list.Add(ugr.Cells["SEQ_NO"].Text.ToString());
  272. CoreClientParam ccp = new CoreClientParam();
  273. ccp.ServerName = "UIB.COM.ComDBSave";
  274. ccp.ServerParams = new object[] { list };
  275. ccp.MethodName = "doXmlSave";
  276. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  277. }
  278. }
  279. }
  280. }
  281. catch (Exception ex)
  282. {
  283. }
  284. }
  285. public void doDelete()
  286. {
  287. try
  288. {
  289. if (MessageBox.Show("确定删除?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  290. return;
  291. ArrayList list = null;
  292. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  293. {
  294. if (ugr.Cells["CHK"].Text.ToString() == "True")
  295. {
  296. list = new ArrayList();
  297. list.Add("UIK040030_01.DELETE");
  298. list.Add(ugr.Cells["SEQ_NO"].Text.ToString());
  299. CoreClientParam ccp = new CoreClientParam();
  300. ccp.ServerName = "UIB.COM.ComDBSave";
  301. ccp.ServerParams = new object[] { list };
  302. ccp.MethodName = "doXmlSave";
  303. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  304. }
  305. }
  306. }
  307. catch (Exception ex)
  308. {
  309. }
  310. }
  311. private void DoExport()
  312. {
  313. try
  314. {
  315. if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
  316. {
  317. string fileName = this.saveFileDialog1.FileName;
  318. ultraGridExcelExporter1.Export(ultraGrid1, fileName);
  319. //System.Diagnostics.Process.Start(fileName);
  320. }
  321. }
  322. catch (Exception EX)
  323. {
  324. MessageBox.Show(EX.ToString());
  325. }
  326. }
  327. #endregion
  328. #region "Init"
  329. public void init()
  330. {
  331. string commCodeCd = "K04003,K04004";
  332. DataTable dt = new DataTable();
  333. CoreClientParam ccp = new CoreClientParam();
  334. ccp.ServerName = "UIB.COM.ComDBQuery";
  335. ccp.MethodName = "doSimpleQuery";
  336. ArrayList paramArray = new ArrayList();
  337. paramArray.Add("UIECOMM00_SELECT.COMM_CODE");
  338. paramArray.Add(commCodeCd);
  339. ccp.ServerParams = new object[] { paramArray };
  340. ccp.SourceDataTable = dt;
  341. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  342. //Core.LZMes.Client.UIE.UIE041.UIEBase.Init_ComboControl(this.ComboGZYY, ref dt, "K04003");
  343. //Core.LZMes.Client.UIE.UIE041.UIEBase.Init_ComboControl(this.ComboZRBM, ref dt, "K04004");
  344. }
  345. private void UIK040030_Load(object sender, EventArgs e)
  346. {
  347. init();
  348. //this.checkBox1.Checked = false;
  349. //this.ultraDateTimeEditor1.Enabled = false;
  350. }
  351. #endregion
  352. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  353. {
  354. try
  355. {
  356. //if (this.checkBox1.Checked)
  357. //{
  358. // this.ultraDateTimeEditor1.Enabled = true;
  359. //}
  360. //else
  361. //{
  362. // this.ultraDateTimeEditor1.Enabled = false;
  363. //}
  364. }
  365. catch (Exception ex)
  366. {
  367. }
  368. }
  369. }
  370. }