UIK030010.cs 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  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. namespace Core.LZMes.Client.UIK
  12. {
  13. public partial class UIK030010 : FrmBase
  14. {
  15. public UIK030010()
  16. {
  17. InitializeComponent();
  18. }
  19. public override void ToolBar_Click(object sender, string ToolbarKey)
  20. {
  21. switch (ToolbarKey)
  22. {
  23. case "Query":
  24. this.DoQuery();
  25. break;
  26. case "Insert":
  27. this.DoInsert();
  28. break;
  29. case "Update":
  30. this.DoUpdate();
  31. break;
  32. }
  33. }
  34. private void DoQuery()
  35. {
  36. if (this.ultraCalendarENDTIME.Enabled == false && this.ultraCalendarSTRATTIME.Enabled == false)
  37. {
  38. this.ultraCalendarENDTIME.Text = "";
  39. this.ultraCalendarSTRATTIME.Text = "";
  40. }
  41. try
  42. {
  43. string mc_id = this.ultraTextMC_ID.Text.ToString();
  44. string starttiem = this.ultraCalendarSTRATTIME.Text.ToString();
  45. string endtime = this.ultraCalendarENDTIME.Text.ToString();
  46. bool flag = false;
  47. CoreClientParam ccp = new CoreClientParam();
  48. DataTable dt = new DataTable();
  49. if (mc_id == "" && starttiem == "" && endtime == "" && this.ultraCheckAll.Checked == false)
  50. {
  51. MessageBox.Show("请选择查询条件!");
  52. }
  53. else
  54. {
  55. if (this.ultraCheckAll.Checked)
  56. {
  57. this.ultraCheckAll.Checked = false;
  58. ccp.ServerName = "UIK.UIK03.UIK030010";
  59. ccp.MethodName = "DoQuery";
  60. ccp.ServerParams = new object[] { mc_id, starttiem, endtime, flag };
  61. ccp.SourceDataTable = dt;
  62. //dt = this.dataSet1.Tables[0];
  63. //ccp.SourceDataTable = dt;
  64. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  65. this.ultraGrid1.DataSource = dt;
  66. //Console.WriteLine(this.dataSet1.Tables[0].ToString());
  67. if (dt.Rows.Count <= 0)
  68. {
  69. MessageBox.Show("暂无记录!");
  70. }
  71. this.ultraCalendarENDTIME.Enabled = false;
  72. this.ultraCalendarSTRATTIME.Enabled = false;
  73. return;
  74. }
  75. else
  76. {
  77. flag = true;
  78. if (this.ultraTextMC_ID.Text != "" || this.ultraCheckEditor1.Checked == true)
  79. {
  80. if (this.ultraTextMC_ID.Text == "")
  81. {
  82. this.ultraTextMC_ID.Clear();
  83. this.ultraCheckEditor1.Checked = false;
  84. this.ultraCheckAll.Checked = false;
  85. ccp.ServerName = "UIK.UIK03.UIK030010";
  86. ccp.MethodName = "DoQuery";
  87. ccp.ServerParams = new object[] { mc_id, starttiem, endtime, flag };
  88. ccp.SourceDataTable = dt;
  89. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  90. this.ultraGrid1.DataSource = dt;
  91. if (dt.Rows.Count <= 0)
  92. {
  93. MessageBox.Show("该时间内没有入库信息!");
  94. }
  95. this.ultraCalendarENDTIME.Enabled = false;
  96. this.ultraCalendarSTRATTIME.Enabled = false;
  97. return;
  98. }
  99. if (this.ultraCheckEditor1.Checked == false)
  100. {
  101. this.ultraTextMC_ID.Clear();
  102. this.ultraCheckAll.Checked = false;
  103. ccp.ServerName = "UIK.UIK03.UIK030010";
  104. ccp.MethodName = "DoQuery";
  105. ccp.ServerParams = new object[] { mc_id, starttiem, endtime, flag };
  106. ccp.SourceDataTable = dt;
  107. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  108. this.ultraGrid1.DataSource = dt;
  109. if (dt.Rows.Count <= 0)
  110. {
  111. MessageBox.Show("该设备信息不存在!");
  112. }
  113. this.ultraCalendarENDTIME.Enabled = false;
  114. this.ultraCalendarSTRATTIME.Enabled = false;
  115. return;
  116. }
  117. if (this.ultraTextMC_ID.Text != "" && this.ultraCheckEditor1.Checked == true)
  118. {
  119. this.ultraTextMC_ID.Clear();
  120. this.ultraCheckEditor1.Checked = false;
  121. this.ultraCheckAll.Checked = false;
  122. ccp.ServerName = "UIK.UIK03.UIK030010";
  123. ccp.MethodName = "DoQuery";
  124. ccp.ServerParams = new object[] { mc_id, starttiem, endtime, flag };
  125. ccp.SourceDataTable = dt;
  126. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  127. this.ultraGrid1.DataSource = dt;
  128. if (dt.Rows.Count <= 0)
  129. {
  130. MessageBox.Show("记录不存在,请查证后查询!");
  131. }
  132. this.ultraCalendarENDTIME.Enabled = false;
  133. this.ultraCalendarSTRATTIME.Enabled = false;
  134. return;
  135. }
  136. }
  137. }
  138. }
  139. }
  140. catch (Exception Ex)
  141. {
  142. MessageBox.Show(Ex.ToString());
  143. }
  144. }
  145. private void ultraCheckAll_CheckedChanged(object sender, EventArgs e)
  146. {
  147. try
  148. {
  149. if (this.ultraCheckAll.Checked)
  150. {
  151. this.ultraTextMC_ID.Enabled = false;
  152. this.ultraCalendarSTRATTIME.Enabled = false;
  153. this.ultraCalendarENDTIME.Enabled = false;
  154. }
  155. if (!this.ultraCheckAll.Checked)
  156. {
  157. this.ultraTextMC_ID.Enabled = true;
  158. this.ultraCalendarSTRATTIME.Enabled = false;
  159. this.ultraCalendarENDTIME.Enabled = false;
  160. }
  161. }
  162. catch (Exception Ex)
  163. {
  164. MessageBox.Show(Ex.ToString());
  165. }
  166. }
  167. private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e)
  168. {
  169. if (this.ultraCheckEditor1.Checked)
  170. {
  171. this.ultraCalendarENDTIME.Enabled = true;
  172. this.ultraCalendarSTRATTIME.Enabled = true;
  173. }
  174. if (!this.ultraCheckEditor1.Checked)
  175. {
  176. this.ultraCalendarENDTIME.Enabled = false;
  177. this.ultraCalendarSTRATTIME.Enabled = false;
  178. this.ultraCalendarSTRATTIME.Text = "";
  179. this.ultraCalendarENDTIME.Text = "";
  180. }
  181. }
  182. private void UIK030010_Load(object sender, EventArgs e)
  183. {
  184. this.ultraCalendarENDTIME.Enabled = false;
  185. this.ultraCalendarSTRATTIME.Enabled = false;
  186. this.ultraCalendarMC_IN_DTIME.Text = "";
  187. this.ultraCalendarMC_USE_TIME.Text = "";
  188. this.ultraCalendarMC_CHANGTIME.Text = "";
  189. this.ultraCalendarMC_CHECKTIME.Text = "";
  190. }
  191. private void DoUpdate()
  192. {
  193. if (MessageBox.Show("您确认要修改?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
  194. {
  195. try
  196. {
  197. Infragistics.Win.UltraWinGrid.UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  198. if (ugr.Cells["SELECT_ITEM"].Text.ToString() == "True")
  199. {
  200. string mcid,reg_intime, IMC_NAME, IMC_MODEL, IMC_SPEC, IMC_FACTORY, IMC_IN_DTIME, IMC_PRICE, IMC_CARE_SECTOR, IMC_NOM_CAP, IMC_UNIT, IMC_TAI, IMC_ACT, IMC_MFACTUR_UNITS, IMC_USE_YEAR, IMC_USE_TIME, IMC_INSTAL_LOCAL, IREG_IN_ID, IMC_STAT, IMAIN_MC_NAME, IMC_INSTAL_COUNT, IREQ_SPAR_COUNT, IREA_STO_CONUT, IMC_CHECKREASON, IMC_CHANGTIME, IMC_CHECKCYCLE, IMC_CHECKTIME, IMC_CHANGCYCLE,IAREA;
  201. mcid = ugr.Cells["MC_ID"].Value.ToString();
  202. reg_intime = ugr.Cells["REG_IN_DTIME"].Value.ToString();
  203. this.ultraTextMCID2.Enabled = false;
  204. IMC_NAME = this.ultraTextMC_NAME.Text;
  205. IMC_MODEL = this.ultraTextMC_MODEL.Text;
  206. IMC_SPEC = this.ultraTextMC_SPEC.Text;
  207. IMC_FACTORY = this.ultraTextMC_FACTORY.Text;
  208. IMC_IN_DTIME = this.ultraCalendarMC_IN_DTIME.Text;
  209. IMC_USE_TIME = this.ultraCalendarMC_USE_TIME.Text;
  210. IMC_PRICE = this.ultraTextMC_PRICE.Text;
  211. IMC_CARE_SECTOR = this.ultraTextMC_CARE_SECTOR.Text;
  212. IMC_NOM_CAP = this.ultraTextMC_NOM_CAP.Text;
  213. IMC_UNIT = this.ultraTextMC_UNIT.Text;
  214. IMC_ACT = this.ultraTextMC_ACT.Text;
  215. IMC_TAI = this.ultraTextMC_TAI.Text;
  216. IMC_MFACTUR_UNITS = this.ultraTextMC_MFACTUR_UNITS.Text;
  217. IMC_USE_YEAR = this.ultraTextMC_USE_YEAR.Text;
  218. IMC_INSTAL_LOCAL = this.ultraTextMC_INSTAL_LOCAL.Text;
  219. IREG_IN_ID = this.ultraTextREG_IN_ID.Text;
  220. IMC_STAT = this.ultraComboMC_STAT.Text;
  221. IMAIN_MC_NAME = this.ultraTextMAIN_MC_NAME.Text;
  222. IMC_INSTAL_COUNT = this.ultraTextMC_INSTAL_COUNT.Text;
  223. IREQ_SPAR_COUNT = this.ultraTextREQ_SPAR_COUNT.Text;
  224. IREA_STO_CONUT = this.ultraTextREA_STO_CONUT.Text;
  225. IMC_CHECKREASON = this.ultraTextMC_CHECKREASON.Text;
  226. IMC_CHANGTIME = this.ultraCalendarMC_CHANGTIME.Text;
  227. IMC_CHECKCYCLE = this.ultraTextMC_CHECKCYCLE.Text;
  228. IMC_CHECKTIME = this.ultraCalendarMC_CHECKTIME.Text;
  229. IMC_CHANGCYCLE = this.ultraTextMC_CHANGCYCLE.Text;
  230. IAREA = this.ultraTextAREA.Text;
  231. CoreClientParam ccp2 = new CoreClientParam();
  232. ccp2.ServerName = "UIK.UIK03.UIK030010";
  233. ccp2.MethodName = "DoUpdate";
  234. ccp2.ServerParams = new object[] { IMC_NAME, IMC_MODEL, IMC_SPEC, IMC_FACTORY, IMC_IN_DTIME, IMC_PRICE, IMC_CARE_SECTOR, IMC_NOM_CAP, IMC_UNIT, IMC_TAI, IMC_ACT, IMC_MFACTUR_UNITS, IMC_USE_YEAR, IMC_USE_TIME, IMC_INSTAL_LOCAL, IREG_IN_ID, reg_intime, IMC_STAT, IMAIN_MC_NAME, IMC_INSTAL_COUNT, IREQ_SPAR_COUNT, IREA_STO_CONUT, IMC_CHECKREASON, IMC_CHANGTIME, IMC_CHECKCYCLE, IMC_CHECKTIME, IMC_CHANGCYCLE, IAREA };
  235. ccp2 = this.ExecuteNonQuery(ccp2, CoreInvokeType.Internal);
  236. if (0 != ccp2.ReturnCode)
  237. {
  238. MessageBox.Show("修改失败!");
  239. }
  240. else
  241. {
  242. MessageBox.Show("修改成功!");
  243. this.ultraTextMCID2.Enabled = true;
  244. this.ultraTextMCID2.Clear();
  245. this.ultraTextMC_NAME.Clear();
  246. this.ultraTextMC_MODEL.Clear();
  247. this.ultraTextMC_SPEC.Clear();
  248. this.ultraTextMC_FACTORY.Clear();
  249. this.ultraCalendarMC_IN_DTIME.Text = "";
  250. this.ultraCalendarMC_USE_TIME.Text = "";
  251. this.ultraTextMC_PRICE.Clear();
  252. this.ultraTextMC_CARE_SECTOR.Clear();
  253. this.ultraTextMC_NOM_CAP.Clear();
  254. this.ultraTextMC_UNIT.Clear();
  255. this.ultraTextMC_ACT.Clear();
  256. this.ultraTextMC_TAI.Clear();
  257. this.ultraTextMC_MFACTUR_UNITS.Clear();
  258. this.ultraTextMC_USE_YEAR.Clear();
  259. this.ultraTextMC_INSTAL_LOCAL.Clear();
  260. this.ultraTextREG_IN_ID.Clear();
  261. this.ultraComboMC_STAT.Clear();
  262. this.ultraTextMAIN_MC_NAME.Clear();
  263. this.ultraTextMC_INSTAL_COUNT.Clear();
  264. this.ultraTextREQ_SPAR_COUNT.Clear();
  265. this.ultraTextREA_STO_CONUT.Clear();
  266. this.ultraTextMC_CHECKREASON.Clear();
  267. this.ultraCalendarMC_CHANGTIME.Text = "";
  268. this.ultraTextMC_CHECKCYCLE.Clear();
  269. this.ultraCalendarMC_CHECKTIME.Text = "";
  270. this.ultraTextMC_CHANGCYCLE.Clear();
  271. this.ultraTextAREA.Clear();
  272. }
  273. }
  274. else
  275. {
  276. MessageBox.Show("请选择修改行!");
  277. }
  278. }
  279. catch (Exception Ex)
  280. {
  281. MessageBox.Show(Ex.ToString());
  282. }
  283. }
  284. }
  285. private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  286. {
  287. if (e.Cell.Column.Key == "SELECT_ITEM")
  288. {
  289. if (e.Cell.Text == "True")
  290. {
  291. string mcid, IREG_IN_DTIME;
  292. ultraTextMCID2.Text = e.Cell.Row.Cells["MC_ID"].Text;
  293. // string mcid, IMC_NAME, IMC_MODEL, IMC_SPEC, IMC_FACTORY, IMC_IN_DTIME, IMC_PRICE, IMC_CARE_SECTOR, IMC_NOM_CAP, IMC_UNIT, IMC_TAI, IMC_ACT, IMC_MFACTUR_UNITS, IMC_USE_YEAR, IMC_USE_TIME, IMC_INSTAL_LOCAL, IREG_IN_ID, IREG_IN_DTIME, IMC_STAT;
  294. this.ultraTextMCID2.Text = e.Cell.Row.Cells["MC_ID"].Text;
  295. mcid = e.Cell.Row.Cells["MC_ID"].Text;
  296. IREG_IN_DTIME = e.Cell.Row.Cells["REG_IN_DTIME"].Text;
  297. this.ultraTextMCID2.Enabled = false;
  298. DataTable dt = new DataTable();
  299. CoreClientParam ccp = new CoreClientParam();
  300. ccp.ServerName = "UIK.UIK03.UIK030010";
  301. ccp.MethodName = "DoSelect";
  302. ccp.ServerParams = new object[] { IREG_IN_DTIME };
  303. ccp.SourceDataTable = dt;
  304. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  305. foreach (DataRow dr in dt.Rows)
  306. {
  307. this.ultraTextMC_NAME.Text = dr["MC_NAME"].ToString();
  308. this.ultraTextMC_MODEL.Text = dr["MC_MODEL"].ToString();
  309. this.ultraTextMC_SPEC.Text = dr["MC_SPEC"].ToString();
  310. this.ultraTextMC_FACTORY.Text = dr["MC_FACTORY"].ToString();
  311. this.ultraCalendarMC_IN_DTIME.Text = dr["MC_IN_DTIME"].ToString();
  312. this.ultraCalendarMC_USE_TIME.Text = dr["MC_USE_TIME"].ToString();
  313. this.ultraTextMC_PRICE.Text = dr["MC_PRICE"].ToString();
  314. this.ultraTextMC_CARE_SECTOR.Text = dr["MC_CARE_SECTOR"].ToString();
  315. this.ultraTextMC_NOM_CAP.Text = dr["MC_NOM_CAP"].ToString();
  316. this.ultraTextMC_UNIT.Text = dr["MC_UNIT"].ToString();
  317. this.ultraTextMC_ACT.Text = dr["MC_ACT"].ToString();
  318. this.ultraTextMC_TAI.Text = dr["MC_TAI"].ToString();
  319. this.ultraTextMC_MFACTUR_UNITS.Text = dr["MC_MFACTUR_UNITS"].ToString();
  320. this.ultraTextMC_USE_YEAR.Text = dr["MC_USE_YEAR"].ToString();
  321. this.ultraTextMC_INSTAL_LOCAL.Text = dr["MC_INSTAL_LOCAL"].ToString();
  322. this.ultraTextREG_IN_ID.Text = dr["REG_IN_ID"].ToString();
  323. this.ultraComboMC_STAT.Text = dr["MC_STAT"].ToString();
  324. this.ultraTextMAIN_MC_NAME.Text = dr["MAIN_MC_NAME"].ToString();
  325. this.ultraTextMC_INSTAL_COUNT.Text = dr["MC_INSTAL_COUNT"].ToString();
  326. this.ultraTextREQ_SPAR_COUNT.Text = dr["REQ_SPAR_COUNT"].ToString();
  327. this.ultraTextREA_STO_CONUT.Text = dr["REA_STO_CONUT"].ToString();
  328. this.ultraTextMC_CHECKREASON.Text = dr["MC_CHECKREASON"].ToString();
  329. this.ultraCalendarMC_CHANGTIME.Text = dr["MC_CHANGTIME"].ToString();
  330. this.ultraTextMC_CHECKCYCLE.Text = dr["MC_CHECKCYCLE"].ToString();
  331. this.ultraCalendarMC_CHECKTIME.Text = dr["MC_CHECKTIME"].ToString();
  332. this.ultraTextMC_CHANGCYCLE.Text = dr["MC_CHANGCYCLE"].ToString();
  333. this.ultraTextAREA.Text = dr["AREA"].ToString();
  334. }
  335. }
  336. else
  337. {
  338. this.ultraTextMCID2.Enabled = true;
  339. this.ultraTextMCID2.Clear();
  340. this.ultraTextMC_NAME.Clear();
  341. this.ultraTextMC_MODEL.Clear();
  342. this.ultraTextMC_SPEC.Clear();
  343. this.ultraTextMC_FACTORY.Clear();
  344. this.ultraCalendarMC_IN_DTIME.Text = "";
  345. this.ultraCalendarMC_USE_TIME.Text = "";
  346. this.ultraTextMC_PRICE.Clear();
  347. this.ultraTextMC_CARE_SECTOR.Clear();
  348. this.ultraTextMC_NOM_CAP.Clear();
  349. this.ultraTextMC_UNIT.Clear();
  350. this.ultraTextMC_ACT.Clear();
  351. this.ultraTextMC_TAI.Clear();
  352. this.ultraTextMC_MFACTUR_UNITS.Clear();
  353. this.ultraTextMC_USE_YEAR.Clear();
  354. this.ultraTextMC_INSTAL_LOCAL.Clear();
  355. this.ultraTextREG_IN_ID.Clear();
  356. this.ultraComboMC_STAT.Clear();
  357. this.ultraTextMAIN_MC_NAME.Clear();
  358. this.ultraTextMC_INSTAL_COUNT.Clear();
  359. this.ultraTextREQ_SPAR_COUNT.Clear();
  360. this.ultraTextREA_STO_CONUT.Clear();
  361. this.ultraTextMC_CHECKREASON.Clear();
  362. this.ultraCalendarMC_CHANGTIME.Text = "";
  363. this.ultraTextMC_CHECKCYCLE.Clear();
  364. this.ultraCalendarMC_CHECKTIME.Text = "";
  365. this.ultraTextMC_CHANGCYCLE.Clear();
  366. this.ultraTextAREA.Clear();
  367. }
  368. }
  369. }
  370. private void DoInsert()
  371. {
  372. if (MessageBox.Show("您确认要插入新的入库信息吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
  373. {
  374. string mcid, IMC_NAME, IMC_MODEL, IMC_SPEC, IMC_FACTORY, IMC_IN_DTIME, IMC_PRICE, IMC_CARE_SECTOR, IMC_NOM_CAP, IMC_UNIT, IMC_TAI, IMC_ACT, IMC_MFACTUR_UNITS, IMC_USE_YEAR, IMC_USE_TIME, IMC_INSTAL_LOCAL, IREG_IN_ID, IREG_IN_DTIME, IMC_STAT, IMAIN_MC_NAME, IMC_INSTAL_COUNT, IREQ_SPAR_COUNT, IREA_STO_CONUT, IMC_CHECKREASON, IMC_CHANGTIME, IMC_CHECKCYCLE, IMC_CHECKTIME, IMC_CHANGCYCLE, IAREA;
  375. mcid = this.ultraTextMCID2.Text;
  376. IMC_NAME = this.ultraTextMC_NAME.Text;
  377. IMC_MODEL = this.ultraTextMC_MODEL.Text;
  378. IMC_SPEC = this.ultraTextMC_SPEC.Text;
  379. IMC_FACTORY = this.ultraTextMC_FACTORY.Text;
  380. IMC_IN_DTIME = this.ultraCalendarMC_IN_DTIME.Text;
  381. IMC_USE_TIME = this.ultraCalendarMC_USE_TIME.Text;
  382. IREG_IN_DTIME = DateTime.Now.ToString();
  383. IMC_PRICE = this.ultraTextMC_PRICE.Text;
  384. IMC_CARE_SECTOR = this.ultraTextMC_CARE_SECTOR.Text;
  385. IMC_NOM_CAP = this.ultraTextMC_NOM_CAP.Text;
  386. IMC_UNIT = this.ultraTextMC_UNIT.Text;
  387. IMC_ACT = this.ultraTextMC_ACT.Text;
  388. IMC_TAI = this.ultraTextMC_TAI.Text;
  389. IMC_MFACTUR_UNITS = this.ultraTextMC_MFACTUR_UNITS.Text;
  390. IMC_USE_YEAR = this.ultraTextMC_USE_YEAR.Text;
  391. IMC_INSTAL_LOCAL = this.ultraTextMC_INSTAL_LOCAL.Text;
  392. IREG_IN_ID = this.ultraTextREG_IN_ID.Text;
  393. IMC_STAT = this.ultraComboMC_STAT.Text;
  394. IAREA = this.ultraTextAREA.Text;
  395. DataTable dt = new DataTable();
  396. CoreClientParam ccp = new CoreClientParam();
  397. IMAIN_MC_NAME = this.ultraTextMAIN_MC_NAME.Text;
  398. IMC_INSTAL_COUNT = this.ultraTextMC_INSTAL_COUNT.Text;
  399. IREQ_SPAR_COUNT = this.ultraTextREQ_SPAR_COUNT.Text;
  400. IREA_STO_CONUT = this.ultraTextREA_STO_CONUT.Text;
  401. IMC_CHECKREASON = this.ultraTextMC_CHECKREASON.Text;
  402. IMC_CHANGTIME = this.ultraCalendarMC_CHANGTIME.Text;
  403. IMC_CHECKCYCLE = this.ultraTextMC_CHECKCYCLE.Text;
  404. IMC_CHECKTIME = this.ultraCalendarMC_CHECKTIME.Text;
  405. IMC_CHANGCYCLE = this.ultraTextMC_CHANGCYCLE.Text;
  406. ccp.ServerName = "UIK.UIK03.UIK030010";
  407. ccp.MethodName = "DoSelect";
  408. ccp.ServerParams = new object[] { IREG_IN_DTIME };
  409. ccp.SourceDataTable = dt;
  410. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  411. if (dt.Rows.Count > 0)
  412. {
  413. MessageBox.Show("该时间下设备已经录入,请重新输入");
  414. }
  415. else
  416. {
  417. CoreClientParam ccp2 = new CoreClientParam();
  418. ccp2.ServerName = "UIK.UIK03.UIK030010";
  419. ccp2.MethodName = "DoInsert";
  420. ccp2.ServerParams = new object[] { mcid, IMC_NAME, IMC_MODEL, IMC_SPEC, IMC_FACTORY, IMC_IN_DTIME, IMC_PRICE, IMC_CARE_SECTOR, IMC_NOM_CAP, IMC_UNIT, IMC_TAI, IMC_ACT, IMC_MFACTUR_UNITS, IMC_USE_YEAR, IMC_USE_TIME, IMC_INSTAL_LOCAL, IREG_IN_ID, IREG_IN_DTIME, IMC_STAT, IMAIN_MC_NAME, IMC_INSTAL_COUNT, IREQ_SPAR_COUNT, IREA_STO_CONUT, IMC_CHECKREASON, IMC_CHANGTIME, IMC_CHECKCYCLE, IMC_CHECKTIME, IMC_CHANGCYCLE, IAREA };
  421. ccp2 = this.ExecuteNonQuery(ccp2, CoreInvokeType.Internal);
  422. if (0 != ccp2.ReturnCode)
  423. {
  424. MessageBox.Show("添加失败!");
  425. }
  426. else
  427. {
  428. MessageBox.Show("添加成功!");
  429. this.ultraTextMCID2.Enabled = true;
  430. this.ultraTextMCID2.Clear();
  431. this.ultraTextMC_NAME.Clear();
  432. this.ultraTextMC_MODEL.Clear();
  433. this.ultraTextMC_SPEC.Clear();
  434. this.ultraTextMC_FACTORY.Clear();
  435. this.ultraCalendarMC_IN_DTIME.Text = "";
  436. this.ultraCalendarMC_USE_TIME.Text = "";
  437. this.ultraTextMC_PRICE.Clear();
  438. this.ultraTextMC_CARE_SECTOR.Clear();
  439. this.ultraTextMC_NOM_CAP.Clear();
  440. this.ultraTextMC_UNIT.Clear();
  441. this.ultraTextMC_ACT.Clear();
  442. this.ultraTextMC_TAI.Clear();
  443. this.ultraTextMC_MFACTUR_UNITS.Clear();
  444. this.ultraTextMC_USE_YEAR.Clear();
  445. this.ultraTextMC_INSTAL_LOCAL.Clear();
  446. this.ultraTextREG_IN_ID.Clear();
  447. this.ultraComboMC_STAT.Clear();
  448. this.ultraTextMAIN_MC_NAME.Clear();
  449. this.ultraTextMC_INSTAL_COUNT.Clear();
  450. this.ultraTextREQ_SPAR_COUNT.Clear();
  451. this.ultraTextREA_STO_CONUT.Clear();
  452. this.ultraTextMC_CHECKREASON.Clear();
  453. this.ultraCalendarMC_CHANGTIME.Text = "";
  454. this.ultraTextMC_CHECKCYCLE.Clear();
  455. this.ultraCalendarMC_CHECKTIME.Text = "";
  456. this.ultraTextMC_CHANGCYCLE.Clear();
  457. this.ultraTextAREA.Clear();
  458. }
  459. }
  460. }
  461. }
  462. //private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  463. //{
  464. // try
  465. // {
  466. // Infragistics.Win.UltraWinGrid.UltraGridRow ugr = this.ultraGrid1.ActiveRow;
  467. // if (ugr.Cells["SELECT_ITEM"].Value.ToString() == "True")
  468. // {
  469. // string mcid, IMC_NAME, IMC_MODEL, IMC_SPEC, IMC_FACTORY, IMC_IN_DTIME, IMC_PRICE, IMC_CARE_SECTOR, IMC_NOM_CAP, IMC_UNIT, IMC_TAI, IMC_ACT, IMC_MFACTUR_UNITS, IMC_USE_YEAR, IMC_USE_TIME, IMC_INSTAL_LOCAL, IREG_IN_ID, IREG_IN_DTIME, IMC_STAT;
  470. // this.ultraTextMCID2.Text = ugr.Cells["MC_ID"].Value.ToString();
  471. // mcid = ugr.Cells["MC_ID"].Value.ToString();
  472. // this.ultraTextMCID2.Enabled = false;
  473. // DataTable dt = new DataTable();
  474. // CoreClientParam ccp = new CoreClientParam();
  475. // ccp.ServerName = "UIK.UIK03.UIK030010";
  476. // ccp.MethodName = "DoSelect";
  477. // ccp.ServerParams = new object[] { mcid };
  478. // ccp.SourceDataTable = dt;
  479. // this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  480. // foreach (DataRow dr in dt.Rows)
  481. // {
  482. // this.ultraTextMC_NAME.Text = dr["MC_NAME"].ToString();
  483. // this.ultraTextMC_MODEL.Text = dr["MC_MODEL"].ToString();
  484. // this.ultraTextMC_SPEC.Text = dr["MC_SPEC"].ToString();
  485. // this.ultraTextMC_FACTORY.Text = dr["MC_FACTORY"].ToString();
  486. // this.ultraCalendarMC_IN_DTIME.Text = dr["MC_IN_DTIME"].ToString();
  487. // this.ultraCalendarMC_USE_TIME.Text = dr["MC_USE_TIME"].ToString();
  488. // this.ultraCalendarREG_IN_DTIME.Text = dr["REG_IN_DTIME"].ToString();
  489. // this.ultraTextMC_PRICE.Text = dr["MC_PRICE"].ToString();
  490. // this.ultraTextMC_CARE_SECTOR.Text = dr["MC_CARE_SECTOR"].ToString();
  491. // this.ultraTextMC_NOM_CAP.Text = dr["MC_NOM_CAP"].ToString();
  492. // this.ultraTextMC_UNIT.Text = dr["MC_UNIT"].ToString();
  493. // this.ultraTextMC_ACT.Text = dr["MC_ACT"].ToString();
  494. // this.ultraTextMC_TAI.Text = dr["MC_TAI"].ToString();
  495. // this.ultraTextMC_MFACTUR_UNITS.Text = dr["MC_MFACTUR_UNITS"].ToString();
  496. // this.ultraTextMC_USE_YEAR.Text = dr["MC_USE_YEAR"].ToString();
  497. // this.ultraTextMC_INSTAL_LOCAL.Text = dr["MC_INSTAL_LOCAL"].ToString();
  498. // this.ultraTextREG_IN_ID.Text = dr["REG_IN_ID"].ToString();
  499. // this.ultraComboMC_STAT.Text = dr["MC_STAT"].ToString();
  500. // }
  501. // if (mcid != "")
  502. // {
  503. // MessageBox.Show("在编辑区修改单元格!");
  504. // }
  505. // //IMC_NAME = this.ultraTextMC_NAME.Text;
  506. // //IMC_MODEL = this.ultraTextMC_MODEL.Text;
  507. // //IMC_SPEC = this.ultraTextMC_SPEC.Text;
  508. // //IMC_FACTORY = this.ultraTextMC_FACTORY.Text;
  509. // //IMC_IN_DTIME = this.ultraCalendarMC_IN_DTIME.Text;
  510. // //IMC_USE_TIME = this.ultraCalendarMC_USE_TIME.Text;
  511. // //IREG_IN_DTIME = this.ultraCalendarREG_IN_DTIME.Text;
  512. // //IMC_PRICE = this.ultraTextMC_PRICE.Text;
  513. // //IMC_CARE_SECTOR = this.ultraTextMC_CARE_SECTOR.Text;
  514. // //IMC_NOM_CAP = this.ultraTextMC_NOM_CAP.Text;
  515. // //IMC_UNIT = this.ultraTextMC_UNIT.Text;
  516. // //IMC_ACT = this.ultraTextMC_ACT.Text;
  517. // //IMC_TAI = this.ultraTextMC_TAI.Text;
  518. // //IMC_MFACTUR_UNITS = this.ultraTextMC_MFACTUR_UNITS.Text;
  519. // //IMC_USE_YEAR = this.ultraTextMC_USE_YEAR.Text;
  520. // //IMC_INSTAL_LOCAL = this.ultraTextMC_INSTAL_LOCAL.Text;
  521. // //IREG_IN_ID = this.ultraTextREG_IN_ID.Text;
  522. // //IMC_STAT = this.ultraComboMC_STAT.Text;
  523. // //CoreClientParam ccp2 = new CoreClientParam();
  524. // //ccp2.ServerName = "UIK.UIK03.UIK030010";
  525. // //ccp2.MethodName = "DoUpdate";
  526. // //ccp2.ServerParams = new object[] { mcid, IMC_NAME, IMC_MODEL, IMC_SPEC, IMC_FACTORY, IMC_IN_DTIME, IMC_PRICE, IMC_CARE_SECTOR, IMC_NOM_CAP, IMC_UNIT, IMC_TAI, IMC_ACT, IMC_MFACTUR_UNITS, IMC_USE_YEAR, IMC_USE_TIME, IMC_INSTAL_LOCAL, IREG_IN_ID, IREG_IN_DTIME, IMC_STAT };
  527. // //ccp2 = this.ExecuteNonQuery(ccp2, CoreInvokeType.Internal);
  528. // //if (0 != ccp2.ReturnCode)
  529. // //{
  530. // // MessageBox.Show("修改失败!");
  531. // //}
  532. // //else
  533. // //{
  534. // // MessageBox.Show("修改成功!");
  535. // //}
  536. // }
  537. // else
  538. // {
  539. // MessageBox.Show("请选择修改行!");
  540. // }
  541. // }
  542. // catch (Exception Ex)
  543. // {
  544. // MessageBox.Show(Ex.ToString());
  545. // }
  546. //}
  547. }
  548. }