frmStorageDefine.cs 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242
  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 Core.Mes.Client.Comm.Server;
  11. using System.Collections;
  12. using Core.Mes.Client.Comm.Control;
  13. using Infragistics.Win.UltraWinGrid;
  14. using Core.Mes.Client.Comm.Tool;
  15. using Infragistics.Win;
  16. namespace Core.StlMes.Client.YdmBase
  17. {
  18. public partial class frmStorageDefine : FrmBase
  19. {
  20. private string cmb_staskENo = "";//作业单位编码
  21. public frmStorageDefine()
  22. {
  23. InitializeComponent();
  24. }
  25. bool isvalid = false;
  26. /// <summary>
  27. /// 重写基类方法
  28. /// </summary>
  29. /// <param name="sender"></param>
  30. /// <param name="ToolbarKey"></param>
  31. public override void ToolBar_Click(object sender, string ToolbarKey)
  32. {
  33. switch (ToolbarKey)
  34. {
  35. case "Query":
  36. this.doQuery();
  37. break;
  38. case "Add":
  39. this.doAdd();
  40. break;
  41. case "Update":
  42. this.doUpdate();
  43. break;
  44. case "Delete":
  45. this.doDelete();
  46. break;
  47. case "Resume":
  48. DoResume();
  49. break;
  50. case "Refresh":
  51. DoRefresh();
  52. break;
  53. case "Export":
  54. DoExportGridData();
  55. break;
  56. case "Close":
  57. this.Close();
  58. break;
  59. }
  60. }
  61. /// <summary>
  62. /// 导出
  63. /// </summary>
  64. private void DoExportGridData()
  65. {
  66. GridHelper.ulGridToExcel(gdStorage, this.Text);
  67. }
  68. /// <summary>
  69. /// 删除
  70. /// </summary>
  71. private void doDelete()
  72. {
  73. UltraGridRow row = this.gdStorage.ActiveRow;
  74. if (row == null || row.Index < 0)
  75. {
  76. MessageBox.Show("请选择需要作废的数据行!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  77. return;
  78. }
  79. //库号编码
  80. string storageCode = txt_NO01.Text + txt_NO02.Text + txt_NO03.Text;
  81. if (gdStorage.ActiveRow.Cells["VALIDFLAG"].Value.ToString() == "无效")
  82. {
  83. MessageBox.Show("选择的数据已经作废!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  84. return;
  85. }
  86. string storeN0 = this.gdStorage.ActiveRow.Cells["STORAGE_NO"].Text.ToString();
  87. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmStorageDefineSur.getStoreLocation", new object[] { storeN0 }, this.ob);
  88. if (int.Parse(dt.Rows[0][0].ToString())> 0)
  89. {
  90. MessageBox.Show("库位基础信息中已引用该库号,不允许作废该数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  91. return;
  92. }
  93. else
  94. {
  95. DataTable dt1 = ServerHelper.GetData("com.steering.pss.ydm.base.YdmStorageDefineSur.getButTressData", new object[] { storeN0 }, this.ob);
  96. if (int.Parse(dt1.Rows[0][0].ToString()) > 0)
  97. {
  98. MessageBox.Show("此库号已放置物品,不允许作废该数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  99. return;
  100. }
  101. }
  102. if (MessageBox.Show("是否确认作废数据!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  103. {
  104. return;
  105. }
  106. ArrayList parm = new ArrayList();
  107. parm.Add(storageCode);
  108. CoreClientParam ccp = new CoreClientParam();
  109. ccp.ServerName = "com.steering.pss.ydm.base.YdmStorageDefineSur";
  110. ccp.MethodName = "storageCancelUpdate";
  111. ccp.ServerParams = new object[] { parm };
  112. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  113. if (ccp.ReturnCode == -1) return;
  114. MessageBox.Show("操作成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  115. doQuery();
  116. YdmBaseClass.Postioning(gdStorage, "STORAGE_NO", storageCode);
  117. }
  118. /// <summary>
  119. /// 恢复
  120. /// </summary>
  121. private void DoResume()
  122. {
  123. UltraGridRow row = this.gdStorage.ActiveRow;
  124. if (row == null || row.Index < 0)
  125. {
  126. MessageBox.Show("请选择需要恢复的数据行!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  127. return;
  128. }
  129. //库号编码
  130. string storageCode = txt_NO01.Text + txt_NO02.Text + txt_NO03.Text;
  131. if (gdStorage.ActiveRow.Cells["VALIDFLAG"].Value.ToString() == "有效")
  132. {
  133. MessageBox.Show("选择的数据已经有效!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  134. return;
  135. }
  136. if (MessageBox.Show("是否确认恢复数据!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
  137. {
  138. return;
  139. }
  140. ArrayList parm = new ArrayList();
  141. parm.Add(storageCode);
  142. CoreClientParam ccp = new CoreClientParam();
  143. ccp.ServerName = "com.steering.pss.ydm.base.YdmStorageDefineSur";
  144. ccp.MethodName = "storageResume";
  145. ccp.ServerParams = new object[] { parm };
  146. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  147. if (ccp.ReturnCode == -1) return;
  148. MessageBox.Show("操作成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  149. doQuery();
  150. YdmBaseClass.Postioning(gdStorage, "STORAGE_NO", storageCode);
  151. }
  152. /// <summary>
  153. /// 修改
  154. /// </summary>
  155. private void doUpdate()
  156. {
  157. string memo = "";
  158. string storageType = "";
  159. string storageTypeName = "";
  160. string storageClassCode = "";
  161. string storageClassName = "";
  162. string addressCode = "";
  163. string addressName = "";
  164. string taskUnitCode = "";
  165. string taskUnitName = "";
  166. string upSectionCode = "";
  167. string upSectionName = "";
  168. string upDepartmentCode = "";
  169. string upDepartmentName = "";
  170. string Xaxis = "";
  171. string Yaxis = "";
  172. string groupCode = "";
  173. string groupName = "";
  174. string isCarUser = "";
  175. string isCarUserBill = "";
  176. string isLoading = "";
  177. string isUnloading = "";
  178. string seamArea = "";
  179. UltraGridRow ugr = gdStorage.ActiveRow;
  180. if (ugr == null)
  181. {
  182. MessageBox.Show("请选择你要修改的记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  183. return;
  184. }
  185. if (ugr.Cells["VALIDFLAG"].Value.ToString() == "无效")
  186. {
  187. MessageBox.Show("数据无效,无法修改", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  188. return;
  189. }
  190. //库号编码
  191. string storageCode = txt_NO01.Text.Trim() + txt_NO02.Text.Trim() + txt_NO03.Text.Trim();
  192. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmStorageDefineSur.storageRepeatCode", new Object[] { storageCode }, this.ob);
  193. string repeat = dt.Rows[0][0].ToString();
  194. if (repeat == "0")
  195. {
  196. MessageBox.Show("您修改的库号'" + storageCode + "'还未入系统!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  197. return;
  198. }
  199. //库号描述
  200. string storageName = txt_stonameE.Text.Trim();
  201. //仓库类型
  202. if (cmb_stoSty.Text == "")
  203. {
  204. MessageBox.Show("请选择仓库类型!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  205. return;
  206. }
  207. else
  208. {
  209. storageType = cmb_stoSty.Value.ToString().Trim();
  210. storageTypeName = cmb_stoSty.Text.Trim();
  211. }
  212. //仓库类别
  213. if (cmb_stoClass.Text == "")
  214. {
  215. MessageBox.Show("请选择仓库类别!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  216. return;
  217. }
  218. else
  219. {
  220. storageClassCode = cmb_stoClass.Value.ToString().Trim();
  221. storageClassName = cmb_stoClass.Text.Trim();
  222. }
  223. //地址编码
  224. if (cmb_adressNo.Text == "")
  225. {
  226. MessageBox.Show("请选择地址编码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  227. return;
  228. }
  229. else
  230. {
  231. addressCode = cmb_adressNo.Value.ToString().Trim();
  232. addressName= cmb_adressNo.Text.Trim();
  233. }
  234. //作业科室
  235. if (this.cmb_ksNo.Text == "")
  236. {
  237. MessageBox.Show("请选择作业科室!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  238. return;
  239. }
  240. else
  241. {
  242. taskUnitCode = cmb_ksNo.Value.ToString();
  243. taskUnitName = cmb_ksNo.Text.Trim();
  244. }
  245. //作业单位
  246. if (this.cmb_taskNo.Text == "")
  247. {
  248. MessageBox.Show("请选择作业单位!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  249. return;
  250. }
  251. else
  252. {
  253. upSectionCode = this.cmb_taskNo.Value.ToString();
  254. upSectionName = cmb_taskNo.Text.Trim();
  255. }
  256. //管理分组
  257. if (this.GroupName.Text == "")
  258. {
  259. MessageBox.Show("请选择仓库分组!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  260. return;
  261. }
  262. else
  263. {
  264. groupCode = this.GroupName.Value.ToString();
  265. groupName = GroupName.Text.Trim();
  266. }
  267. //上级部门
  268. if (cmd_DapartNO.Text == "")
  269. {
  270. MessageBox.Show("请选择部门!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  271. return;
  272. }
  273. else
  274. {
  275. upDepartmentCode = cmd_DapartNO.Value.ToString().Trim();
  276. upDepartmentName = cmd_DapartNO.Text.Trim();
  277. }
  278. //X坐标轴
  279. if (txt_x.Text == "")
  280. {
  281. MessageBox.Show("请输入X坐标轴!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  282. return;
  283. }
  284. else
  285. {
  286. Xaxis = txt_x.Text.Trim();
  287. }
  288. //Y坐标轴
  289. if (txt_y.Text == "")
  290. {
  291. MessageBox.Show("请输入Y坐标轴!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  292. return;
  293. }
  294. else
  295. {
  296. Yaxis = txt_y.Text.Trim();
  297. }
  298. memo = txt_memo.Text.Trim();
  299. string Virtualflag = "";
  300. if (chk_Virtual.Checked)
  301. {
  302. Virtualflag = "1";
  303. }
  304. else
  305. {
  306. Virtualflag = "0";
  307. }
  308. ArrayList parm = new ArrayList();
  309. ArrayList list = new ArrayList();
  310. if (!this.cmb_stoSty.Text.Trim().Equals(this.gdStorage.ActiveRow.Cells["STORAGE_ATTR_NAME"].Text.ToString()))
  311. {
  312. MessageBox.Show("仓库类型不允许修改!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  313. return;
  314. }
  315. if (!this.cmb_stoClass.Text.Trim().Equals(this.gdStorage.ActiveRow.Cells["STORAGE_TYPE_NAME"].Text.ToString()))
  316. {
  317. MessageBox.Show("仓库类别不允许修改!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  318. return;
  319. }
  320. if (!this.cmb_adressNo.Text.Trim().Equals(this.gdStorage.ActiveRow.Cells["STORAGE_ADDR_NAME"].Text.ToString()))
  321. {
  322. MessageBox.Show("仓库地址编码不允许修改!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  323. return;
  324. }
  325. if (!storageCode.Equals(this.gdStorage.ActiveRow.Cells["STORAGE_NO"].Text.ToString()))
  326. {
  327. MessageBox.Show("仓库库号不允许修改!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
  328. return;
  329. }
  330. bool bol = this.chk_Virtual.Checked;
  331. if (bol.ToString().ToLower() != (this.gdStorage.ActiveRow.Cells["DUMMY_FLAG"].Value.ToString().ToLower()))
  332. {
  333. MessageBox.Show("仓库是否虚拟不允许修改!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  334. return;
  335. }
  336. isCarUser = this.isCarUser.Text;
  337. if (isCarUser == "")
  338. {
  339. isCarUser = "0";
  340. }
  341. else
  342. {
  343. isCarUser = this.isCarUser.Value.ToString2();
  344. }
  345. isCarUserBill = this.isCarUserBill.Text;
  346. if (isCarUserBill == "")
  347. {
  348. isCarUserBill = "0";
  349. }
  350. else
  351. {
  352. isCarUserBill = this.isCarUserBill.Value.ToString2();
  353. }
  354. isLoading = this.ultraIsLoading.Text;
  355. if (isLoading == "")
  356. {
  357. isLoading = "0";
  358. }else
  359. {
  360. isLoading = this.ultraIsLoading.Value.ToString2();
  361. }
  362. isUnloading = this.ultraIsUnloading.Text;
  363. if (isUnloading == "")
  364. {
  365. isUnloading = "0";
  366. }
  367. else
  368. {
  369. isUnloading = this.ultraIsUnloading.Value.ToString2();
  370. }
  371. seamArea = this.SEAMAREA.Text;
  372. if (seamArea == "")
  373. {
  374. seamArea = "0";
  375. }
  376. else
  377. {
  378. seamArea = this.SEAMAREA.Value.ToString2();
  379. }
  380. parm.Add(storageName);
  381. parm.Add(storageType);
  382. parm.Add(storageTypeName);
  383. parm.Add(storageClassCode);
  384. parm.Add(storageClassName);
  385. //创建一个序号。
  386. //int index_seq = GetMaxSeq();
  387. //parm.Add(index_seq);
  388. parm.Add(addressCode);
  389. parm.Add(addressName);
  390. parm.Add(taskUnitCode);
  391. parm.Add(taskUnitName);
  392. parm.Add(upDepartmentCode);
  393. parm.Add(upDepartmentName);
  394. parm.Add(Xaxis);
  395. parm.Add(Yaxis);
  396. parm.Add(memo);
  397. parm.Add(Virtualflag);
  398. //parm.Add(Effectiveflag);
  399. parm.Add(this.UserInfo.GetUserName());
  400. parm.Add(upSectionCode);
  401. parm.Add(upSectionName);
  402. parm.Add(groupCode);
  403. parm.Add(groupName);
  404. parm.Add(isCarUser);
  405. parm.Add(isCarUserBill);
  406. parm.Add(isLoading);
  407. parm.Add(isUnloading);
  408. parm.Add(seamArea);
  409. if (storageCode.Equals(this.gdStorage.ActiveRow.Cells["STORAGE_NO"].Text.ToString()))
  410. {
  411. parm.Add(storageCode);
  412. }
  413. else
  414. {
  415. MessageBox.Show("库号不允许修改!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  416. return;
  417. }
  418. if (MessageBox.Show("是否确认修改?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  419. {
  420. return;
  421. }
  422. CoreClientParam ccp = new CoreClientParam();
  423. ccp.ServerName = "com.steering.pss.ydm.base.YdmStorageDefineSur";
  424. ccp.MethodName = "storageCodeUpdate";
  425. ccp.ServerParams = new object[] { parm };
  426. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  427. if (ccp.ReturnCode == -1)
  428. {
  429. return;
  430. }
  431. else
  432. {
  433. list.Add(taskUnitCode);
  434. list.Add(taskUnitName);
  435. list.Add(upSectionCode);
  436. list.Add(upSectionName);
  437. list.Add(this.UserInfo.GetUserName());
  438. list.Add(storageCode);
  439. ccp.ServerName = "com.steering.pss.ydm.base.YdmStorageDefineSur";
  440. ccp.MethodName = "storageCodeUpdateLaction";
  441. ccp.ServerParams = new object[] { list };
  442. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  443. if (ccp.ReturnCode == -1)
  444. {
  445. return;
  446. }
  447. else
  448. {
  449. MessageBox.Show("修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  450. doQuery();
  451. YdmBaseClass.Postioning(gdStorage, "STORAGE_NO", storageCode);
  452. }
  453. }
  454. }
  455. /// <summary>
  456. /// 新增
  457. /// </summary>
  458. private void doAdd()
  459. {
  460. string memo = "";
  461. string storageType = "";
  462. string storageTypeName = "";
  463. string storageClassCode = "";
  464. string storageClassName = "";
  465. string addressCode = "";
  466. string addressName = "";
  467. string taskUnitCode = "";
  468. string taskUnitName = "";
  469. string upSectionCode = "";
  470. string upSectionName = "";
  471. string upDepartmentCode = "";
  472. string upDepartmentName = "";
  473. string Xaxis = "";
  474. string Yaxis = "";
  475. string storageName = "";
  476. string groupCode = "";
  477. string groupName = "";
  478. //库号编码
  479. if (this.txt_NO03.Text == "")
  480. {
  481. MessageBox.Show("请输入该库的临时编号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  482. return;
  483. }
  484. string storageCode = txt_NO01.Text.Trim() + txt_NO02.Text.Trim() + txt_NO03.Text.Trim();
  485. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmStorageDefineSur.storageRepeatCode", new Object[] { storageCode }, this.ob);
  486. string repeat = dt.Rows[0][0].ToString();
  487. if (repeat == "1")
  488. {
  489. MessageBox.Show("输入的库号编码重复!,请重新选库", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  490. //cmb_stoSty.Text = "";
  491. //cmb_adressNo.Text = "";
  492. return;
  493. }
  494. //库号描述
  495. if (txt_stonameE.Text == "")
  496. {
  497. MessageBox.Show("请输入仓库描述!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  498. return;
  499. }
  500. else
  501. {
  502. storageName = txt_stonameE.Text.Trim();
  503. }
  504. //仓库类型
  505. if (cmb_stoSty.Text == "")
  506. {
  507. MessageBox.Show("请选择仓库类型!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  508. return;
  509. }
  510. else
  511. {
  512. storageType = cmb_stoSty.Value.ToString().Trim();
  513. storageTypeName = cmb_stoSty.Text.Trim();
  514. }
  515. //仓库类别
  516. if (cmb_stoClass.Text == "")
  517. {
  518. MessageBox.Show("请选择仓库类别!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  519. return;
  520. }
  521. else
  522. {
  523. storageClassCode = cmb_stoClass.Value.ToString().Trim();
  524. storageClassName = cmb_stoClass.Text.Trim();
  525. }
  526. //管理分组
  527. if (this.GroupName.Text == "")
  528. {
  529. MessageBox.Show("请选择仓库组!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  530. return;
  531. }
  532. else
  533. {
  534. groupCode = this.GroupName.Value.ToString();
  535. groupName = GroupName.Text.Trim();
  536. }
  537. //地址编码
  538. if (cmb_adressNo.Text == "")
  539. {
  540. MessageBox.Show("请选择地址编码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  541. return;
  542. }
  543. else
  544. {
  545. addressCode = cmb_adressNo.Value.ToString().Trim();
  546. addressName = cmb_adressNo.Text.Trim();
  547. }
  548. //作业科室
  549. if (cmb_ksNo.Text == "")
  550. {
  551. MessageBox.Show("请选择作业科室!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  552. return;
  553. }
  554. else
  555. {
  556. taskUnitCode = cmb_ksNo.Value.ToString();
  557. taskUnitName = cmb_ksNo.Text.Trim();
  558. }
  559. //作业单位
  560. if (cmb_taskNo.Text == "")
  561. {
  562. MessageBox.Show("请选择作业单位!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  563. return;
  564. //upSectionCode = "";
  565. //upSectionName = "";
  566. }else
  567. {
  568. upSectionCode = cmb_taskNo.Value.ToString();
  569. upSectionName = cmb_taskNo.Text.Trim();
  570. }
  571. //上级部门
  572. if (cmd_DapartNO.Text == "")
  573. {
  574. MessageBox.Show("请选择上级部门!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  575. return;
  576. //upDepartmentCode = "";
  577. //upDepartmentName = "";
  578. }
  579. else
  580. {
  581. upDepartmentCode = cmd_DapartNO.Value.ToString().Trim();
  582. upDepartmentName = cmd_DapartNO.Text.Trim();
  583. }
  584. //X坐标轴
  585. if (txt_x.Text == "")
  586. {
  587. MessageBox.Show("请输入X坐标轴!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  588. return;
  589. }
  590. else
  591. {
  592. if (StringUtil.IsNumber(txt_x.Text.Trim()))
  593. {
  594. Xaxis = txt_x.Text.Trim();
  595. }
  596. else
  597. {
  598. MessageBox.Show("X坐标需为全数字!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  599. return;
  600. }
  601. }
  602. //Y坐标轴
  603. if (txt_y.Text == "")
  604. {
  605. MessageBox.Show("请输入Y坐标轴!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  606. return;
  607. }
  608. else
  609. {
  610. if (StringUtil.IsNumber(txt_y.Text.Trim()))
  611. {
  612. Yaxis = txt_y.Text.Trim();
  613. }
  614. else
  615. {
  616. MessageBox.Show("Y坐标需为全数字!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  617. return;
  618. }
  619. }
  620. memo = txt_memo.Text.Trim();
  621. string Virtualflag = "";
  622. if (chk_Virtual.Checked)
  623. {
  624. Virtualflag = "1";
  625. }
  626. else
  627. {
  628. Virtualflag = "0";
  629. }
  630. string carUser = this.isCarUser.Text.Trim();
  631. if (carUser == "")
  632. {
  633. carUser = "0";
  634. }
  635. else
  636. {
  637. carUser = this.isCarUser.Value.ToString2();
  638. }
  639. string carUserBill = this.isCarUserBill.Text.Trim();
  640. if (carUserBill == "")
  641. {
  642. carUserBill = "0";
  643. }
  644. else
  645. {
  646. carUserBill = this.isCarUserBill.Value.ToString2();
  647. }
  648. //string gradeText = cmbGZType.Text.Trim();
  649. ArrayList parm = new ArrayList();
  650. parm.Add(storageCode);
  651. parm.Add(storageName);
  652. parm.Add(storageType);
  653. parm.Add(storageTypeName);
  654. parm.Add(storageClassCode);
  655. parm.Add(storageClassName);
  656. //创建一个序号。
  657. //int index_seq = GetMaxSeq();
  658. //parm.Add(index_seq);
  659. parm.Add(addressCode);
  660. parm.Add(addressName);
  661. parm.Add(taskUnitCode);
  662. parm.Add(taskUnitName);
  663. parm.Add(upDepartmentCode);
  664. parm.Add(upDepartmentName);
  665. parm.Add(Xaxis);
  666. parm.Add(Yaxis);
  667. parm.Add(memo);
  668. parm.Add(Virtualflag);
  669. parm.Add(this.UserInfo.GetUserName());
  670. parm.Add(upSectionCode);
  671. parm.Add(upSectionName);
  672. parm.Add(groupCode);
  673. parm.Add(groupName);
  674. parm.Add(carUser);
  675. parm.Add(carUserBill);
  676. parm.Add(this.SEAMAREA.Value.ToString2());
  677. CoreClientParam ccp = new CoreClientParam();
  678. ccp.ServerName = "com.steering.pss.ydm.base.YdmStorageDefineSur";
  679. ccp.MethodName = "storageCodeAdd";
  680. ccp.ServerParams = new object[] { parm };
  681. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  682. if (ccp.ReturnCode == -1) return;
  683. MessageBox.Show("增加成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  684. doQuery();
  685. YdmBaseClass.Postioning(gdStorage, "STORAGE_NO", storageCode);
  686. }
  687. /// <summary>
  688. /// 查询
  689. /// </summary>
  690. private void doQuery()
  691. {
  692. string departMent = this.UserInfo.GetDepartment();
  693. //库存编码
  694. string storage = "";
  695. if (chk_stono.Checked)
  696. {
  697. if (txt_stonameQ.Text == "")
  698. {
  699. MessageBox.Show("请输入库位编码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  700. return;
  701. }
  702. else
  703. {
  704. storage = txt_stonameQ.Text;
  705. }
  706. }
  707. //作业科室
  708. string unit = "";
  709. if (ultraCheckEditor2.Checked)
  710. {
  711. if (cmb_department.Text == "")
  712. {
  713. MessageBox.Show("请输入作业科室!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  714. return;
  715. unit = "";
  716. }
  717. else
  718. {
  719. unit = this.cmb_department.Value.ToString().Trim(); //cbm_staskQ.SelectedNode.Tag.ToString().Trim();//ultraComboEditor1.Value.ToString().Trim()
  720. }
  721. }
  722. //是否包含有效
  723. if (ultraCheckEditor1.Checked)
  724. {
  725. isvalid = true;
  726. }
  727. string[] arr = YdmBaseClass.BaseSection(this.ValidDataPurviewIds, this.ob);
  728. string titleName = txt_stonameQ.Text.Trim();
  729. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmStorageDefineSur.storageName", new Object[] { storage, unit, isvalid, departMent, arr }, this.ob);
  730. gdStorage.DataSource = dt;
  731. YdmBaseClass.SetGridRowColor(gdStorage);
  732. YdmBaseClass.SetColAutoSizeExceptMemo(gdStorage);
  733. }
  734. /// <summary>
  735. /// 刷新
  736. /// </summary>
  737. private void DoRefresh()
  738. {
  739. BindStorage();
  740. AddressCodeBind();
  741. StorageClass();
  742. //getDepartMent();
  743. getDepartMent1();
  744. getDepartMent2();
  745. getMaxDepart();
  746. //QueryTree();
  747. }
  748. private void getDepartMent()
  749. {
  750. //string[] arr = this.ValidDataPurviewIds;
  751. DataTable dt = new DataTable();
  752. string flag = "0";
  753. string userName = this.UserInfo.GetUserName();
  754. string departMent = ClsBaseInfo.GetDepartBySectionId(UserInfo.GetDeptid(), this.ob);
  755. if (userName.Equals("admin"))
  756. {
  757. dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmBaseQuery.departQuery", new object[] { departMent, flag }, this.ob);
  758. if (dt.Rows.Count > 0)
  759. {
  760. cmb_department.DataSource = dt;
  761. cmb_department.DisplayMember = "DEPARTNAME";
  762. cmb_department.ValueMember = "DEPARTID";
  763. this.cmb_department.SelectedIndex = -1;
  764. }
  765. }
  766. else
  767. {
  768. flag = "1";
  769. dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmBaseQuery.departQuery", new object[] { departMent, flag }, this.ob);
  770. if (dt.Rows.Count > 0)
  771. {
  772. cmb_department.DataSource = dt;
  773. cmb_department.DisplayMember = "DEPARTNAME";
  774. cmb_department.ValueMember = "DEPARTID";
  775. this.cmb_department.SelectedIndex = 0;
  776. }
  777. }
  778. }
  779. private void getDepartMent1()
  780. {
  781. DataTable dt = new DataTable();
  782. string flag = "0";
  783. string userName = this.UserInfo.GetUserName();
  784. string departMent = ClsBaseInfo.GetDepartBySectionId(UserInfo.GetDeptid(), this.ob);
  785. if (userName.Equals("admin"))
  786. {
  787. dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmBaseQuery.departQuery", new object[] { departMent, flag }, this.ob);
  788. if (dt.Rows.Count > 0)
  789. {
  790. cmb_taskNo.DataSource = dt;
  791. cmb_taskNo.DisplayMember = "DEPARTNAME";
  792. cmb_taskNo.ValueMember = "DEPARTID";
  793. }
  794. }
  795. else
  796. {
  797. flag = "1";
  798. dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmBaseQuery.departQuery", new object[] { departMent, flag }, this.ob);
  799. if (dt.Rows.Count > 0)
  800. {
  801. cmb_taskNo.DataSource = dt;
  802. cmb_taskNo.DisplayMember = "DEPARTNAME";
  803. cmb_taskNo.ValueMember = "DEPARTID";
  804. this.cmb_taskNo.SelectedIndex = 0;
  805. }
  806. }
  807. }
  808. private void getDepartMent2()
  809. {
  810. DataTable dt = new DataTable();
  811. string flag = "0";
  812. string userName = this.UserInfo.GetUserName();
  813. string departMent = ClsBaseInfo.GetDepartBySectionId(UserInfo.GetDeptid(), this.ob);
  814. dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmBaseQuery.departQuery", new object[] { departMent, flag }, this.ob);
  815. if (dt.Rows.Count > 0)
  816. {
  817. cmd_DapartNO.DataSource = dt;
  818. cmd_DapartNO.DisplayMember = "DEPARTNAME";
  819. cmd_DapartNO.ValueMember = "DEPARTID";
  820. }
  821. }
  822. /// <summary>
  823. /// 初始化
  824. /// </summary>
  825. /// <param name="sender"></param>
  826. /// <param name="e"></param>
  827. private void frmStorageDefine_Load(object sender, EventArgs e)
  828. {
  829. BindStorage();
  830. AddressCodeBind();
  831. StorageClass();
  832. // QueryTree();
  833. //getDepartMent();
  834. getMaxDepart();
  835. getDepartMent1();
  836. getDepartMent2();
  837. getGroupStoage();
  838. //cbm_staskQ.Text=this.UserInfo.GetDepartment();
  839. //treeSelect(cbm_staskQ.Text);
  840. this.ultraCheckEditor1.Visible = false;
  841. this.cmb_department.Enabled = false;
  842. YdmBaseClass.InitSection(cmb_department,this.ValidDataPurviewIds,this.ob);
  843. YdmBaseClass.InitSection(cmb_ksNo, this.ValidDataPurviewIds, this.ob);
  844. }
  845. /// <summary>
  846. /// 加载作业科室
  847. /// </summary>
  848. private void getMaxDepart()
  849. {
  850. string[] arr = this.ValidDataPurviewIds;
  851. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmStorageDefineSur.getMaxDepartMent", new object[] { arr }, this.ob);
  852. if (dt.Rows.Count > 0)
  853. {
  854. cmb_ksNo.DataSource = dt;
  855. cmb_ksNo.DisplayMember = "DEPARTNAME";
  856. cmb_ksNo.ValueMember = "DEPARTID";
  857. }
  858. }
  859. /// <summary>
  860. /// 管理分组
  861. /// </summary>
  862. private void getGroupStoage()
  863. {
  864. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmStorageDefineSur.getGroupStoage", new object[] { "8019" }, this.ob);
  865. if (dt.Rows.Count > 0)
  866. {
  867. GroupName.DataSource = dt;
  868. GroupName.DisplayMember = "BASENAME";
  869. GroupName.ValueMember = "BASECODE";
  870. }
  871. }
  872. //刷新Tree
  873. public void QueryTree()
  874. {
  875. //this.cmb_staskE.Nodes.Clear();
  876. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmBaseQuery.departQuery", null, this.ob);
  877. //树控件递归绑定方法。
  878. //Bind_Tv(dt, cbm_staskQ.Nodes, null, "DEPARTID", "PID", "DEPARTNAME");
  879. //YdmBaseClass.MakeTree(dt, "PID", null, "DEPARTID", "DEPARTNAME", cbm_staskQ.Nodes,-1);
  880. //YdmBaseClass.MakeTree(dt, "PID", null, "DEPARTID", "DEPARTNAME", cmb_staskE.Nodes, -1);
  881. }
  882. /// <summary>
  883. /// 绑定仓库类型
  884. /// </summary>
  885. private void BindStorage()
  886. {
  887. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmBaseQuery.storageBind", null, this.ob);
  888. cmb_stoSty.DataSource = dt;
  889. cmb_stoSty.DisplayMember = "BASENAME";
  890. cmb_stoSty.ValueMember = "BASECODE";
  891. }
  892. /// <summary>
  893. /// 绑定地址编码
  894. /// </summary>
  895. private void AddressCodeBind()
  896. {
  897. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmBaseQuery.addressCodeBind", null, this.ob);
  898. cmb_adressNo.DataSource = dt;
  899. cmb_adressNo.DisplayMember = "BASENAME";
  900. cmb_adressNo.ValueMember = "BASECODE";
  901. }
  902. /// <summary>
  903. /// 绑定仓库类别
  904. /// </summary>
  905. private void StorageClass()
  906. {
  907. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmBaseQuery.storageClass", null, this.ob);
  908. cmb_stoClass.DataSource = dt;
  909. cmb_stoClass.DisplayMember = "BASENAME";
  910. cmb_stoClass.ValueMember = "BASECODE";
  911. }
  912. private void ultraTextEditor4_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  913. {
  914. //string strl = txt_NO01.Text.Trim() + txt_NO02.Text.Trim();
  915. //DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmBaseQuery.storageEendCode", new object[]{strl}, this.ob);
  916. //if (dt.Rows.Count == 0)
  917. //{
  918. // txt_NO03.Text = "1";
  919. //}
  920. //else
  921. //{
  922. // txt_NO03.Text = dt.Rows[0][0].ToString();
  923. //}
  924. //if (txt_NO03.Text == "9")
  925. //{
  926. // txt_NO03.Text = "A";
  927. //}
  928. //else
  929. //{
  930. // string iCode = txt_NO03.Text;
  931. // char eCode = Convert.ToChar(iCode);
  932. // try
  933. // {
  934. // txt_NO03.Text = Convert.ToString((char)((int)eCode + 1));
  935. // //txt_stonameE.Text = cmb_stoSty.Text.Trim()+ cmb_adressNo.Text.Trim() + txt_NO03.Text + "号仓库";
  936. // }
  937. // catch { }
  938. //}
  939. }
  940. private void gdStorage_AfterRowActivate(object sender, EventArgs e)
  941. {
  942. if (gdStorage.Rows.Count == 0)
  943. {
  944. return;
  945. }
  946. if (gdStorage.ActiveRow != null)
  947. {
  948. txt_NO01.Text = gdStorage.ActiveRow.Cells["STORAGE_NO"].Value.ToString().Substring(0, 1).ToString();
  949. txt_NO02.Text = gdStorage.ActiveRow.Cells["STORAGE_NO"].Value.ToString().Substring(1, 2).ToString();
  950. txt_NO03.Text = gdStorage.ActiveRow.Cells["STORAGE_NO"].Value.ToString().Substring(3).ToString();
  951. cmb_adressNo.Text = gdStorage.ActiveRow.Cells["STORAGE_ADDR_NAME"].Value.ToString();
  952. cmb_stoSty.Text = gdStorage.ActiveRow.Cells["STORAGE_ATTR_NAME"].Value.ToString();
  953. cmb_stoClass.Text = gdStorage.ActiveRow.Cells["STORAGE_TYPE_NAME"].Value.ToString();
  954. //treeSelect(gdStorage.ActiveRow.Cells["MANAGEMENT_NAME"].Value == null ? "" : gdStorage.ActiveRow.Cells["MANAGEMENT_NAME"].Value.ToString());
  955. this.cmb_ksNo.Text = gdStorage.ActiveRow.Cells["MANAGEMENT_NAME"].Value.ToString();
  956. this.cmb_taskNo.Text = gdStorage.ActiveRow.Cells["DEPARTMENT_DESC"].Value.ToString();
  957. //cmb_staskE.SelectedNode.Tag = gdStorage.ActiveRow.Cells["MANAGEMENT_NO"].Value.ToString();
  958. this.cmd_DapartNO.Text = gdStorage.ActiveRow.Cells["HL_MANAGEMENT_NAME"].Value.ToString();
  959. txt_x.Text = gdStorage.ActiveRow.Cells["X_COORDINATE"].Value.ToString();
  960. txt_y.Text = gdStorage.ActiveRow.Cells["Y_COORDINATE"].Value.ToString();
  961. txt_memo.Text = gdStorage.ActiveRow.Cells["MEMO"].Value.ToString();
  962. txt_stonameE.Text = gdStorage.ActiveRow.Cells["STORAGE_NAME"].Value.ToString();
  963. GroupName.Text = gdStorage.ActiveRow.Cells["STOCK_GROUP_NAME"].Value.ToString();
  964. if (gdStorage.ActiveRow.Cells["DUMMY_FLAG"].Value.ToString().ToUpper() == "TRUE")
  965. {
  966. chk_Virtual.Checked = true;
  967. }
  968. else
  969. {
  970. chk_Virtual.Checked = false;
  971. }
  972. this.isCarUser.Text = gdStorage.ActiveRow.Cells["IS_CAR_TAKING"].Value.ToString();
  973. this.isCarUserBill.Text = gdStorage.ActiveRow.Cells["IS_CAR_TAKING_BILL"].Value.ToString();
  974. this.ultraIsLoading.Text = gdStorage.ActiveRow.Cells["IS_CRANE_LOADING"].Value.ToString();
  975. this.ultraIsUnloading.Text = gdStorage.ActiveRow.Cells["IS_CRANE_UNLOADING"].Value.ToString();
  976. this.SEAMAREA.Text = gdStorage.ActiveRow.Cells["SEAM_AREA"].Value.ToString();
  977. //DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmBaseQuery.getSuperior", new object[] { gdStorage.ActiveRow.Cells["MANAGEMENT_NO"].Value.ToString() }, this.ob);
  978. //cmd_DapartNO.DataSource = dt;
  979. //cmd_DapartNO.DisplayMember = "REMARK";
  980. //cmd_DapartNO.ValueMember = "PID";
  981. //cmd_DapartNO.SelectedIndex = 0;
  982. //cmd_DapartNO.Text = gdStorage.ActiveRow.Cells["HL_MANAGEMENT_NAME"].Text.ToString();
  983. }
  984. }
  985. //展开下拉列表树节点
  986. //public void treeSelect(string Name)
  987. //{
  988. // if (!string.IsNullOrEmpty(Name))
  989. // {
  990. // for (int e = 0; e < this.cmb_staskE.Nodes.Count; e++)
  991. // {
  992. // cmb_staskE.Nodes[e].Collapse();
  993. // //combelonCity = "";
  994. // //展开一级节点 LX 修改
  995. // if (this.cmb_staskE.Nodes[e].Text.Equals(Name) || this.cmb_staskE.Nodes[e].Tag.Equals(Name))
  996. // {
  997. // this.cmb_staskE.Nodes[e].Expand();
  998. // this.cmb_staskE.Nodes[e].ExpandAll();
  999. // cmb_staskE.Text = this.cmb_staskE.Nodes[e].Text.ToString();
  1000. // cmb_staskENo = this.cmb_staskE.Nodes[e].Tag.ToString();
  1001. // //combleTo = this.cmb_staskE.Nodes[e].ToolTipText;
  1002. // return;
  1003. // }
  1004. // //展开二级节点
  1005. // for (int w = 0; w < this.cmb_staskE.Nodes[e].Nodes.Count; w++)
  1006. // {
  1007. // if (this.cmb_staskE.Nodes[e].Nodes[w].Text.Equals(Name) || this.cmb_staskE.Nodes[e].Nodes[w].Tag.Equals(Name))
  1008. // {
  1009. // this.cmb_staskE.Nodes[e].Expand();
  1010. // this.cmb_staskE.Nodes[e].Nodes[w].ExpandAll();
  1011. // cmb_staskE.Text = this.cmb_staskE.Nodes[e].Nodes[w].Text.ToString();
  1012. // cmb_staskENo = this.cmb_staskE.Nodes[e].Nodes[w].Tag.ToString();
  1013. // //combleTo = this.cmb_staskE.Nodes[e].Nodes[w].ToolTipText;
  1014. // return;
  1015. // }
  1016. // }
  1017. // //展开三级子节点
  1018. // for (int w = 0; w < this.cmb_staskE.Nodes[e].Nodes.Count; w++)
  1019. // {
  1020. // for (int r = 0; r < this.cmb_staskE.Nodes[e].Nodes[w].Nodes.Count; r++)
  1021. // {
  1022. // if (this.cmb_staskE.Nodes[e].Nodes[w].Nodes[r].Text.Equals(Name) || this.cmb_staskE.Nodes[e].Nodes[w].Nodes[r].Tag.Equals(Name))
  1023. // {
  1024. // this.cmb_staskE.Nodes[e].Expand();
  1025. // this.cmb_staskE.Nodes[e].Nodes[w].Expand();
  1026. // this.cmb_staskE.Nodes[e].Nodes[w].Nodes[r].ExpandAll();
  1027. // cmb_staskE.Text = this.cmb_staskE.Nodes[e].Nodes[w].Nodes[r].Text.ToString();
  1028. // cmb_staskENo = this.cmb_staskE.Nodes[e].Nodes[w].Nodes[r].Tag.ToString();
  1029. // //combleTo = this.cmb_staskE.Nodes[e].Nodes[w].Nodes[r].ToolTipText;
  1030. // return;
  1031. // }
  1032. // }
  1033. // }
  1034. // //展开四级子节点
  1035. // for (int w = 0; w < this.cmb_staskE.Nodes[e].Nodes.Count; w++)
  1036. // {
  1037. // for (int r = 0; r < this.cmb_staskE.Nodes[e].Nodes[w].Nodes.Count; r++)
  1038. // {
  1039. // for (int x = 0; x < this.cmb_staskE.Nodes[e].Nodes[w].Nodes[r].Nodes.Count; x++)
  1040. // {
  1041. // if (this.cmb_staskE.Nodes[e].Nodes[w].Nodes[r].Nodes[x].Text.Equals(Name) || this.cmb_staskE.Nodes[e].Nodes[w].Nodes[r].Nodes[x].Tag.Equals(Name))
  1042. // {
  1043. // this.cmb_staskE.Nodes[e].Expand();
  1044. // this.cmb_staskE.Nodes[e].Nodes[w].Expand();
  1045. // this.cmb_staskE.Nodes[e].Nodes[w].Nodes[r].Expand();
  1046. // this.cmb_staskE.Nodes[e].Nodes[w].Nodes[r].Nodes[x].ExpandAll();
  1047. // cmb_staskE.Text = this.cmb_staskE.Nodes[e].Nodes[w].Nodes[r].Nodes[x].Text.ToString();
  1048. // cmb_staskENo = this.cmb_staskE.Nodes[e].Nodes[w].Nodes[r].Nodes[x].Tag.ToString();
  1049. // //combleTo = this.cmb_staskE.Nodes[e].Nodes[w].Nodes[r].Nodes[x].ToolTipText;
  1050. // return;
  1051. // }
  1052. // }
  1053. // }
  1054. // }
  1055. // }
  1056. // }
  1057. //}
  1058. private void chk_stono_CheckedChanged(object sender, EventArgs e)
  1059. {
  1060. this.txt_stonameQ.Enabled = this.chk_stono.Checked;
  1061. }
  1062. private void cmb_stoSty_ValueChanged(object sender, EventArgs e)
  1063. {
  1064. string strSty = "";
  1065. if (cmb_stoSty.Text != "")
  1066. strSty = cmb_stoSty.Value.ToString();
  1067. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmBaseQuery.getStorageMemo", new object[] { strSty }, this.ob);
  1068. if (dt.Rows.Count == 0)
  1069. {
  1070. return;
  1071. }
  1072. txt_NO01.Text = dt.Rows[0]["MEMO"].ToString();
  1073. //if (cmb_stoSty.Text != "" && cmb_adressNo.Text != "")
  1074. //{
  1075. //txt_stonameE.Text = cmb_stoSty.Text.Trim() + cmb_adressNo.Text.Trim() + txt_NO03.Text.Trim() + "号仓库";
  1076. //}
  1077. }
  1078. private void cmb_adressNo_ValueChanged(object sender, EventArgs e)
  1079. {
  1080. string strSty = "";
  1081. if (cmb_adressNo.Text != "")
  1082. strSty = cmb_adressNo.Value.ToString();
  1083. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmBaseQuery.getStorageMemo", new object[] { strSty }, this.ob);
  1084. if (dt.Rows.Count == 0)
  1085. {
  1086. return;
  1087. }
  1088. txt_NO02.Text = dt.Rows[0]["MEMO"].ToString();
  1089. //txt_stonameE.Text = cmb_stoSty.Text.Trim() + cmb_adressNo.Text.Trim() + txt_NO03.Text.Trim() + "号仓库";
  1090. }
  1091. private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e)
  1092. {
  1093. if (ultraCheckEditor1.Checked)
  1094. isvalid = true;
  1095. else
  1096. isvalid = false;
  1097. }
  1098. //private void txt_NO03_TextChanged(object sender, EventArgs e)
  1099. //{
  1100. // txt_stonameE.Text = cmb_stoSty.Text.Trim()+ cmb_adressNo.Text.Trim() + txt_NO03.Text + "号仓库";
  1101. //}
  1102. /// <summary>
  1103. /// 上级单位根据选择的作业单位查找
  1104. /// </summary>
  1105. /// <param name="sender"></param>
  1106. /// <param name="e"></param>
  1107. private void cmb_staskE_DropDownClosed(object sender, EventArgs e)
  1108. {
  1109. //treeSelect(cmb_staskE.Text.Trim());
  1110. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmBaseQuery.getSuperior", new object[] { cmb_staskENo }, this.ob);
  1111. cmd_DapartNO.DataSource = dt;
  1112. cmd_DapartNO.DisplayMember = "REMARK";
  1113. cmd_DapartNO.ValueMember = "PID";
  1114. cmd_DapartNO.SelectedIndex = 0;
  1115. }
  1116. /// <summary>
  1117. /// 判断Y轴坐标是否输入格式正确
  1118. /// </summary>
  1119. /// <param name="sender"></param>
  1120. /// <param name="e"></param>
  1121. private void txt_y_TextChanged(object sender, EventArgs e)
  1122. {
  1123. bool bt = StringUtil.IsNumber(this.txt_x.Text);
  1124. if (!bt)
  1125. {
  1126. MessageBox.Show("X坐标需为全数字!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1127. return;
  1128. }
  1129. }
  1130. private void cmb_taskNo_ValueChanged(object sender, EventArgs e)
  1131. {
  1132. if (this.cmb_taskNo.Text != "")
  1133. {
  1134. string value = this.cmb_taskNo.Value.ToString();
  1135. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.YdmStorageDefineSur.departMentKs", new object[] { value }, this.ob);
  1136. //if (dt.Rows.Count > 0)
  1137. //{
  1138. this.cmb_ksNo.DataSource = dt;
  1139. this.cmb_ksNo.ValueMember = "DEPARTID";
  1140. this.cmb_ksNo.DisplayMember = "DEPARTNAME";
  1141. this.cmb_ksNo.SelectedIndex = -1;
  1142. if (gdStorage.Rows.Count > 0)
  1143. {
  1144. this.cmb_ksNo.Text = this.gdStorage.ActiveRow.Cells["MANAGEMENT_NAME"].Value.ToString();
  1145. }
  1146. //}
  1147. }
  1148. }
  1149. private void frmStorageDefine_Shown(object sender, EventArgs e)
  1150. {
  1151. //toolMenu.Toolbars[0].Tools["Resume"].InstanceProps.Visible = DefaultableBoolean.False;
  1152. }
  1153. private void ultraCheckEditor2_CheckedChanged(object sender, EventArgs e)
  1154. {
  1155. cmb_department.Enabled = this.ultraCheckEditor2.Checked;
  1156. }
  1157. //private void txt_NO03_ValueChanged(object sender, EventArgs e)
  1158. //{
  1159. // txt_stonameE.Text = cmb_stoSty.Text.Trim() + cmb_adressNo.Text.Trim() + txt_NO03.Text.Trim() + "号仓库";
  1160. //}
  1161. }
  1162. }