frmPipeAdjust.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  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.StlMes.Client.YdmPipeManage.Tool;
  11. using Core.StlMes.Client.YdmPipeManage.Controls;
  12. using Core.Mes.Client.Comm.Control;
  13. using System.Collections;
  14. using Core.Mes.Client.Comm.Server;
  15. using Core.StlMes.Client.YdmBase;
  16. using Infragistics.Win.UltraWinGrid;
  17. using Core.Mes.Client.Comm.Tool;
  18. using Infragistics.Win.UltraWinEditors;
  19. using Infragistics.Win;
  20. namespace Core.StlMes.Client.YdmPipeManage
  21. {
  22. public partial class frmPipeAdjust : FrmBase
  23. {
  24. public frmPipeAdjust()
  25. {
  26. this.IsLoadUserView = true;
  27. InitializeComponent();
  28. }
  29. private string strOutbound = "800603";//出库类型编码
  30. private string strInMemo = "";//入库简码
  31. /// <summary>
  32. /// 重写基类方法
  33. /// </summary>
  34. /// <param name="sender"></param>
  35. /// <param name="ToolbarKey"></param>
  36. public override void ToolBar_Click(object sender, string ToolbarKey)
  37. {
  38. switch (ToolbarKey)
  39. {
  40. case "Query":
  41. QueryData();
  42. break;
  43. case"Query1":
  44. QueryAdjustData();
  45. break;
  46. case "Add":
  47. AddData();
  48. break;
  49. case"updateYear":
  50. updateYear();
  51. break;
  52. case "Refresh":
  53. DoRefresh();
  54. break;
  55. case "Export":
  56. ExportData();
  57. break;
  58. case "Close":
  59. this.Close();
  60. break;
  61. }
  62. }
  63. /// <summary>
  64. /// 修改结转年月
  65. /// </summary>
  66. private void updateYear()
  67. {
  68. this.ultraGrid2.UpdateData();
  69. ArrayList list = new ArrayList();
  70. ArrayList parm = new ArrayList();
  71. UltraGridRow uRow = this.ultraGrid2.ActiveRow;
  72. string yearMoth = uRow.Cells["BAL_YEAR_MONTH"].Text.Substring(0, 4) + uRow.Cells["BAL_YEAR_MONTH"].Text.Substring(5, 2);
  73. string adjustDoc = uRow.Cells["STOCKTAKING_DOC"].Value.ToString();
  74. string heatNo = uRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
  75. string bacthNo = uRow.Cells["BATCH_NO"].Value.ToString();
  76. string bacthGroupNo = uRow.Cells["BATCH_GROUD_NO"].Value.ToString();
  77. //string moth = DateTime.Now.AddMonths(1).ToString("yyyyMM");
  78. string moth = DateTime.Parse(uRow.Cells["BAL_YEAR_MONTH"].Text).AddMonths(1).ToString("yyyyMM");
  79. string[] arr = BaseMethod.InitPermissions(this.ValidDataPurviewIds,ob);
  80. //parm.Add(heatNo);
  81. //parm.Add(bacthNo);
  82. //parm.Add(bacthGroupNo);
  83. parm.Add(moth);
  84. DataTable ds = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeAdjust.selectYearMoth", new object[] { parm, arr }, ob);
  85. if (int.Parse(ds.Rows[0]["ACOUNT"].ToString())>0)
  86. {
  87. MessageUtil.ShowTips("此炉【" + heatNo + "】已进行结转,不允许调整结转年月!");
  88. return;
  89. }
  90. string nowYearMoth = DateTime.Now.ToString("yyyyMM");
  91. //if (int.Parse(yearMoth) < int.Parse(nowYearMoth))
  92. //{
  93. // MessageUtil.ShowTips("修改的结转年月不能小于当月!");
  94. // return;
  95. //}
  96. list.Add(yearMoth);
  97. list.Add(yearMoth + "02 12:00:00");
  98. list.Add(adjustDoc);
  99. int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmPipeAdjust.updateYear", new object[] { list }, ob);
  100. if (count > 0)
  101. {
  102. QueryAdjustData();
  103. MessageUtil.ShowTips("修改成功");
  104. }
  105. }
  106. /// <summary>
  107. /// 查询调差实绩
  108. /// </summary>
  109. private void QueryAdjustData()
  110. {
  111. string heatNo = "";//炉号
  112. ArrayList list = new ArrayList();
  113. DataTable dt = new DataTable();
  114. if (this.checkHeatNo.Checked)
  115. {
  116. if (this.txt_heatNo.Text == "")
  117. {
  118. MessageBox.Show("请输入炉号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  119. return;
  120. }
  121. else
  122. {
  123. heatNo = this.txt_heatNo.Text.Trim();
  124. }
  125. }
  126. list.Add(heatNo);
  127. string[] arr = BaseMethod.InitPermissions(this.ValidDataPurviewIds, ob);
  128. string supplyUnit = this.CustomInfo;
  129. dt.Clear();
  130. dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeAdjust.getAdjustData", new object[] { list, arr, supplyUnit}, this.ob);
  131. GridHelper.CopyDataToDatatable(ref dt, ref dataTable2, true);
  132. }
  133. /// <summary>
  134. /// 查询库存信息
  135. /// </summary>
  136. private void QueryData()
  137. {
  138. string heatNo = "";//炉号
  139. string storgeNo = "";//库号
  140. string locationNo = "";//料位
  141. string supplyUnit = this.CustomInfo;
  142. ArrayList list = new ArrayList();
  143. DataTable dt = new DataTable();
  144. if (this.checkHeatNo.Checked)
  145. {
  146. if (this.txt_heatNo.Text == "")
  147. {
  148. MessageBox.Show("请输入炉号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  149. return;
  150. }
  151. else
  152. {
  153. heatNo = this.txt_heatNo.Text.Trim();
  154. }
  155. }
  156. if (this.checkStorgeNo.Checked)
  157. {
  158. if (this.cmbStorgeNo.Text == "")
  159. {
  160. MessageBox.Show("请选择仓库!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  161. return;
  162. }
  163. else
  164. {
  165. storgeNo = this.cmbStorgeNo.Value.ToString();
  166. }
  167. }
  168. list.Add(heatNo);
  169. list.Add(storgeNo);
  170. //string[] arr = BaseMethod.WarehousePermissions(CustomInfo, this.ValidDataPurviewIds, this.ob);
  171. string[] arr = BaseMethod.InitPermissions(this.ValidDataPurviewIds, ob);
  172. dt.Clear();
  173. dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeAdjust.getStorgeData", new object[] { list, arr ,supplyUnit}, this.ob);
  174. GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
  175. //YdmBaseClass.SetColAutoSizeExceptMemo(ultraGrid1);
  176. }
  177. /// <summary>
  178. /// 导出调差实绩
  179. /// </summary>
  180. private void ExportData()
  181. {
  182. GridHelper.ulGridToExcel(ultraGrid2, this.Text);
  183. }
  184. /// <summary>
  185. /// 新增调差实绩
  186. /// </summary>
  187. private void AddData()
  188. {
  189. //UltraGridRow row = this.ultraGrid1.ActiveRow;
  190. ArrayList parm = new ArrayList();
  191. int count = 0;
  192. int n = 0;
  193. int actCount = 0;
  194. //if (row == null || row.Index < -1)
  195. //{
  196. // MessageBox.Show("选择你所要操作的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  197. // return;
  198. //}
  199. foreach (UltraGridRow us in ultraGrid1.Rows)
  200. {
  201. if (Convert.ToBoolean(us.Cells["CHOOSE"].Text) == true)
  202. {
  203. n++;
  204. }
  205. }
  206. if (n < 1)
  207. {
  208. MessageBox.Show("请选择要操作的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  209. return;
  210. }
  211. if (n > 1)
  212. {
  213. MessageBox.Show("不允许多条记录同时进行调差!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  214. return;
  215. }
  216. this.ultraGrid1.UpdateData();
  217. foreach(UltraGridRow ugr in ultraGrid1.Rows )
  218. {
  219. if (Convert.ToBoolean(ugr.Cells["CHOOSE"].Text) == true)
  220. {
  221. if (!StringUtil.IsNumber(ugr.Cells["ADJ_WEIGHT"].Text.Trim()))
  222. {
  223. MessageBox.Show("调差重量只能是数字!","提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  224. return;
  225. }
  226. if (ugr.Cells["ADJ_WEIGHT"].Text == "" || ugr.Cells["REASON"].Text == "")
  227. {
  228. MessageBox.Show("调整重量和调整原因不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
  229. return;
  230. }
  231. if (Convert.ToDouble(ugr.Cells["TOTAL_WEIGHT"].Text) < Math.Abs(Convert.ToDouble(ugr.Cells["ADJ_WEIGHT"].Text)))
  232. {
  233. MessageBox.Show("调差重量不能超过实际重量!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
  234. return;
  235. }
  236. DataTable dd = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.CorePipeInTemp.getLockFlag", new object[] { ugr.Cells["JUDGE_STOVE_NO"].Text, ugr.Cells["BATCH_NO"].Text, ugr.Cells["BATCH_GROUD_NO"].Text }, ob);
  237. if (int.Parse(dd.Rows[0]["ACOUNT"].ToString()) > 0)
  238. {
  239. MessageUtil.ShowTips("炉号:" + ugr.Cells["JUDGE_STOVE_NO"].Text + "、批号:" + ugr.Cells["BATCH_NO"].Text + "的数据有被封锁的,不能调差!");
  240. return;
  241. }
  242. ArrayList parmlist = new ArrayList();
  243. actCount = int.Parse(ugr.Cells["TOTAL_COUNT"].Text.Trim());
  244. parmlist.Add(ugr.Cells["TOTAL_COUNT"].Text.Trim());//总支数
  245. parmlist.Add(ugr.Cells["JUDGE_STOVE_NO"].Text.Trim());
  246. parmlist.Add(ugr.Cells["BATCH_NO"].Text.Trim());
  247. parmlist.Add(ugr.Cells["BATCH_GROUD_NO"].Text.Trim());
  248. parmlist.Add("");
  249. parmlist.Add("");
  250. parmlist.Add(ugr.Cells["MEMO"].Text.Trim());
  251. parmlist.Add(ugr.Cells["MAT_STATUS"].Value.ToString());//材料状态
  252. parmlist.Add(ugr.Cells["PRODUCT_FLAG"].Value.ToString());//材料类别
  253. parmlist.Add(ugr.Cells["JUDGE_RESULT"].Text.Trim());//综合判定结果
  254. parmlist.Add(ugr.Cells["ADJ_WEIGHT"].Text.Trim());
  255. //parmlist.Add(ugr.Cells["REASON"].Value.ToString());
  256. parmlist.Add("");//调差原因代码
  257. parmlist.Add(this.UserInfo.GetUserGroup());
  258. parmlist.Add(this.UserInfo.GetUserOrder());
  259. parmlist.Add(this.UserInfo.GetUserName());
  260. parmlist.Add(this.UserInfo.GetDeptid());
  261. parmlist.Add(this.UserInfo.GetDepartment());
  262. parmlist.Add(ClsBaseInfo.GetDepartIdBySectionId(UserInfo.GetDeptid(), this.ob));
  263. parmlist.Add(ClsBaseInfo.GetDepartBySectionId(UserInfo.GetDeptid(), this.ob));
  264. parmlist.Add(strOutbound);
  265. ArrayList pram = new ArrayList();
  266. pram.Clear();
  267. pram.Add(DateTime.Now.ToString("yyyy/MM/dd"));
  268. pram.Add(strOutbound);
  269. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeAdjust.queryAdjustList", new object[] { pram }, ob);
  270. string str = "";
  271. if (dt.Rows.Count >= 1)
  272. {
  273. str = dt.Rows[0]["STOCKTAKING_DOC"].ToString();
  274. }
  275. DataTable dtMemo = PipeManageClass.getComTypeInfo(strOutbound, ob);
  276. if (dtMemo.Rows.Count >= 1)
  277. {
  278. strInMemo = dtMemo.Rows[0]["MEMO"].ToString();
  279. }
  280. parmlist.Add(strInMemo); //20
  281. parmlist.Add(ugr.Cells["REASON"].Text.Trim());
  282. parmlist.Add(ugr.Cells["TOTAL_WEIGHT"].Value.ToString());//总重量
  283. parmlist.Add(ugr.Cells["BELONG_CODE"].Value.ToString());
  284. parmlist.Add(ugr.Cells["BELONG_NAME"].Value.ToString());
  285. parmlist.Add(ugr.Cells["ORD_LN_DLY_PK"].Value.ToString());
  286. parmlist.Add(ugr.Cells["STORAGE_NO"].Value.ToString());
  287. parmlist.Add(ugr.Cells["MEMO"].Value.ToString());
  288. parmlist.Add(ugr.Cells["FINISHPRO_MOLD"].Value.ToString());
  289. parmlist.Add(ugr.Cells["IN_MOLD"].Value.ToString());
  290. parmlist.Add(ugr.Cells["SUPPLY_UNIT_CODE"].Value.ToString());
  291. parmlist.Add(ugr.Cells["SUPPLY_UNIT"].Value.ToString());
  292. parm.Add(parmlist);
  293. }
  294. }
  295. if (MessageUtil.ShowYesNoAndQuestion("是否确认调差?") == DialogResult.No) return;
  296. CoreClientParam ccp = new CoreClientParam();
  297. ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmPipeAdjust";
  298. ccp.MethodName = "addAdjustData";
  299. ccp.ServerParams = new object[] { parm };
  300. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  301. if (ccp.ReturnInfo.Equals("调差成功!"))
  302. {
  303. QueryData();
  304. YdmBaseClass.Postioning(this.ultraGrid1, "TOTAL_COUNT", actCount.ToString());
  305. MessageUtil.ShowTips(ccp.ReturnInfo);
  306. }
  307. else
  308. {
  309. MessageUtil.ShowTips(ccp.ReturnInfo);
  310. }
  311. }
  312. /// <summary>
  313. /// 刷新
  314. /// </summary>
  315. private void DoRefresh()
  316. {
  317. BaseMethod.InitStorage(this.cmbStorgeNo, CustomInfo, this.ValidDataPurviewIds, this.ob);
  318. }
  319. private void frmPipeAdjust_Load(object sender, EventArgs e)
  320. {
  321. txt_heatNo.Enabled = false;
  322. this.cmbStorgeNo.Enabled = false;
  323. BaseMethod.InitStorage(this.cmbStorgeNo, CustomInfo, this.ValidDataPurviewIds, this.ob);
  324. // InintAdjustReson();
  325. InitBindColumn();
  326. }
  327. private void InitBindColumn()
  328. {
  329. //材料状态
  330. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出等待");
  331. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料管理封锁");
  332. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料质量封锁");
  333. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料可编计划");
  334. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料已编计划");
  335. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150106", "材料为余材");
  336. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
  337. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
  338. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
  339. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
  340. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编提单");
  341. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编提单");
  342. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
  343. //材料类别
  344. this.ultraGrid1.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品");
  345. this.ultraGrid1.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品");
  346. this.ultraGrid1.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品");
  347. //DataTable ds = ClsLoad.GetValueListDataTable("8014", this.ob);
  348. //this.ultraGrid1.DisplayLayout.Bands[0].Columns["PRODUCT_FLAG"].ValueList = ClsLoad.GeneralValuelist(ref ds, "BASECODE", "BASENAME");
  349. //string [] arr = new string[3]{"801501","801502","801503"};
  350. //DataTable dt = ClsLoad.GetValueListDataTable(arr, this.ob);
  351. //this.ultraGrid1.DisplayLayout.Bands[0].Columns["MAT_STATUS"].ValueList = ClsLoad.GeneralValuelist(ref dt, "BASECODE", "BASENAME");
  352. }
  353. /// <summary>
  354. /// 获取调整原因
  355. /// </summary>
  356. UltraComboEditor uceReson = new UltraComboEditor();
  357. private void InintAdjustReson()
  358. {
  359. YdmBaseClass.InitComboEditor(uceReson, "com.steering.pss.ydm.pipemanage.FrmPipeAdjust.getAdjustReason", "BASECODE", this.ob, true);
  360. YdmBaseClass.BindColumn(uceReson,"REASON",this.Controls,this.ultraGrid1,0);
  361. }
  362. /// <summary>
  363. /// 单选框事件
  364. /// </summary>
  365. /// <param name="sender"></param>
  366. /// <param name="e"></param>
  367. private void checkHeatNo_CheckedChanged(object sender, EventArgs e)
  368. {
  369. txt_heatNo.Enabled = this.checkHeatNo.Checked;
  370. }
  371. private void checkStorgeNo_CheckedChanged(object sender, EventArgs e)
  372. {
  373. this.cmbStorgeNo.Enabled = this.checkStorgeNo.Checked;
  374. }
  375. /// <summary>
  376. /// 绑定料位号
  377. /// </summary>
  378. /// <param name="sender"></param>
  379. /// <param name="e"></param>
  380. private void cmbStorgeNo_TextChanged(object sender, EventArgs e)
  381. {
  382. ArrayList pram = new ArrayList();
  383. string strStorage = "";
  384. if (this.cmbStorgeNo.Value == null)
  385. {
  386. return;
  387. }
  388. else
  389. {
  390. strStorage = cmbStorgeNo.Value.ToString();
  391. }
  392. pram.Clear();
  393. pram.Add(strStorage);
  394. //PipeManageClass.BindLocationInfo(pram, this.cmbLocatonNo, ob);
  395. }
  396. /// <summary>
  397. /// 单击事件
  398. /// </summary>
  399. /// <param name="sender"></param>
  400. /// <param name="e"></param>
  401. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  402. {
  403. UltraGridRow uRow = this.ultraGrid1.ActiveRow;
  404. DataTable dt = new DataTable();
  405. ArrayList list = new ArrayList();
  406. string heatNo = uRow.Cells["JUDGE_STOVE_NO"].Text.ToString();//炉号
  407. string bacthNo = uRow.Cells["BATCH_NO"].Text.ToString();//批号
  408. string bacthGroupNo = uRow.Cells["BATCH_GROUD_NO"].Text.ToString();
  409. string lactionNo = uRow.Cells["LOCATION_NO"].Text.ToString();
  410. list.Add(heatNo);
  411. list.Add(bacthNo);
  412. list.Add(bacthGroupNo);
  413. list.Add(lactionNo);
  414. dt.Clear();
  415. dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeAdjust.getAdjustData", new object[] { list }, this.ob); //查询调差实绩
  416. GridHelper.CopyDataToDatatable(ref dt, ref dataTable2, true);
  417. GridHelper.RefreshAndAutoSize(this.ultraGrid2);
  418. }
  419. /// <summary>
  420. /// 生成调差单号
  421. /// </summary>
  422. /// <param name="sender"></param>
  423. /// <param name="e"></param>
  424. private void txtAdjustList_EditorButtonClick(object sender, EditorButtonEventArgs e)
  425. {
  426. ArrayList pram = new ArrayList();
  427. pram.Clear();
  428. pram.Add(DateTime.Now.ToString("yyyy/MM/dd"));
  429. pram.Add(strOutbound);
  430. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeAdjust.queryAdjustList", new object[] { pram }, ob);
  431. string str = "";
  432. if (dt.Rows.Count >= 1)
  433. {
  434. str = dt.Rows[0]["STOCKTAKING_DOC"].ToString();
  435. }
  436. DataTable dtMemo = PipeManageClass.getComTypeInfo(strOutbound, ob);
  437. if (dtMemo.Rows.Count >= 1)
  438. {
  439. strInMemo = dtMemo.Rows[0]["MEMO"].ToString();
  440. }
  441. //this.txtAdjustList.Text = PipeManageClass.NextNumber(str, strInMemo, "00001");
  442. }
  443. private void txt_heatNo_KeyDown(object sender, KeyEventArgs e)
  444. {
  445. if (e.KeyValue == 13)
  446. {
  447. QueryData();
  448. }
  449. }
  450. private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  451. {
  452. if (toolMenu == null) return;
  453. if (ultraTabControl1.SelectedTab.Key == "0")
  454. {
  455. if (toolMenu.Toolbars[0].Tools.Exists("Query1"))
  456. {
  457. toolMenu.Toolbars[0].Tools["Query1"].InstanceProps.Visible = DefaultableBoolean.False;
  458. }
  459. if (toolMenu.Toolbars[0].Tools.Exists("Export"))
  460. {
  461. toolMenu.Toolbars[0].Tools["Export"].InstanceProps.Visible = DefaultableBoolean.False;
  462. }
  463. if (toolMenu.Toolbars[0].Tools.Exists("Query"))
  464. {
  465. toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.True;
  466. }
  467. if (toolMenu.Toolbars[0].Tools.Exists("Add"))
  468. {
  469. toolMenu.Toolbars[0].Tools["Add"].InstanceProps.Visible = DefaultableBoolean.True;
  470. }
  471. if (toolMenu.Toolbars[0].Tools.Exists("updateYear"))
  472. {
  473. toolMenu.Toolbars[0].Tools["updateYear"].InstanceProps.Visible = DefaultableBoolean.False;
  474. }
  475. this.checkStorgeNo.Visible = true;
  476. this.cmbStorgeNo.Visible = true;
  477. }
  478. else if (ultraTabControl1.SelectedTab.Key == "1")
  479. {
  480. if (toolMenu.Toolbars[0].Tools.Exists("Query1"))
  481. {
  482. toolMenu.Toolbars[0].Tools["Query1"].InstanceProps.Visible = DefaultableBoolean.True;
  483. }
  484. if (toolMenu.Toolbars[0].Tools.Exists("Add"))
  485. {
  486. toolMenu.Toolbars[0].Tools["Add"].InstanceProps.Visible = DefaultableBoolean.False;
  487. }
  488. if(toolMenu.Toolbars[0].Tools.Exists("Export"))
  489. {
  490. toolMenu.Toolbars[0].Tools["Export"].InstanceProps.Visible = DefaultableBoolean.True;
  491. }
  492. if(toolMenu.Toolbars[0].Tools.Exists("Query"))
  493. {
  494. toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.False;
  495. }
  496. if (toolMenu.Toolbars[0].Tools.Exists("updateYear"))
  497. {
  498. toolMenu.Toolbars[0].Tools["updateYear"].InstanceProps.Visible = DefaultableBoolean.True;
  499. }
  500. this.checkStorgeNo.Visible = false;
  501. this.cmbStorgeNo.Visible = false;
  502. }
  503. }
  504. private void frmPipeAdjust_Shown(object sender, EventArgs e)
  505. {
  506. if (toolMenu.Toolbars[0].Tools.Exists("Query1"))
  507. {
  508. toolMenu.Toolbars[0].Tools["Query1"].InstanceProps.Visible = DefaultableBoolean.False;
  509. }
  510. if (toolMenu.Toolbars[0].Tools.Exists("Export"))
  511. {
  512. toolMenu.Toolbars[0].Tools["Export"].InstanceProps.Visible = DefaultableBoolean.False;
  513. }
  514. if (toolMenu.Toolbars[0].Tools.Exists("updateYear"))
  515. {
  516. toolMenu.Toolbars[0].Tools["updateYear"].InstanceProps.Visible = DefaultableBoolean.False;
  517. }
  518. }
  519. }
  520. }