RolledTubePhyPassApplyFrm.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using Core.StlMes.Client.Judge.Commons;
  5. using Core.StlMes.Client.Judge.Controls;
  6. using CoreFS.CA06;
  7. using Infragistics.Win.UltraWinGrid;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Data;
  11. using System.Linq;
  12. using System.Windows.Forms;
  13. namespace Core.StlMes.Client.Judge.Forms
  14. {
  15. public partial class RolledTubePhyPassApplyFrm : FrmBase
  16. {
  17. private QcmBcPhyJudgeCtrl _zgPhyJudgeCtrl;
  18. private QcmZcCheckconsignGroupCtrl _zcCheckconsignGroupCtrl;
  19. private QcmZgChemPhyCtrl _zgChemPhyCtrl;
  20. private Dal _d;
  21. public RolledTubePhyPassApplyFrm()
  22. {
  23. InitializeComponent();
  24. IsLoadUserView = true;
  25. this.isLoadStlye = true;
  26. }
  27. protected override void OnLoad(EventArgs e)
  28. {
  29. base.OnLoad(e);
  30. if (_zgChemPhyCtrl == null) return;
  31. _zgChemPhyCtrl.JhyPhyResultCtrl.UltraGrid1.DisplayLayout.Override.SupportDataErrorInfo = SupportDataErrorInfo.RowsAndCells;
  32. foreach (var tab in _zgChemPhyCtrl.UltraTabControl2.Tabs)
  33. {
  34. if (tab.Key == "002001007010")
  35. {
  36. QcmJhyElementsCtrl jhyElementsCtrl = (QcmJhyElementsCtrl)((SplitContainer)tab.TabPage.Controls[0]).Panel2.Controls[0];
  37. jhyElementsCtrl.UltraGrid1.DisplayLayout.Override.SupportDataErrorInfo = SupportDataErrorInfo.RowsAndCells;
  38. }
  39. else if (tab.Key == "002001007020" || tab.Key == "002001007013" || tab.Key == "002001007015" || tab.Key == "002001007014"
  40. || tab.Key == "002001007009")
  41. {
  42. QcmJhyPhyResultCtrl jhyPhyResultCtrl = (QcmJhyPhyResultCtrl)((SplitContainer)tab.TabPage.Controls[0]).Panel2.Controls[0];
  43. jhyPhyResultCtrl.UltraGrid1.DisplayLayout.Override.SupportDataErrorInfo = SupportDataErrorInfo.RowsAndCells;
  44. }
  45. }
  46. }
  47. private string _processCode = "";
  48. private void RolledTubeChemJudgeFrm_Load(object sender, EventArgs e)
  49. {
  50. _processCode = CustomInfo.Substring(0, 1);
  51. _zgPhyJudgeCtrl = new QcmBcPhyJudgeCtrl(panel2, ob);
  52. _zgPhyJudgeCtrl.UltraGrid1.AfterRowActivate += lgChemJudgeCtrl_AfterRowActivate;
  53. _zgPhyJudgeCtrl.BringToFront();
  54. _zgPhyJudgeCtrl.UltraGrid1.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False;
  55. dataTable1.Clear();
  56. dataTable1.Rows.Add("00", "编制中");
  57. dataTable1.Rows.Add("10", "已下发");
  58. dataTable1.Rows.Add("20", "生产中");
  59. dataTable1.Rows.Add("30", "已生产");
  60. dataTable1.Rows.Add("40", "关闭");
  61. _zcCheckconsignGroupCtrl = new QcmZcCheckconsignGroupCtrl(splitContainer1.Panel1, ob, JudgeType.RolledTubePhy,UserInfo);
  62. _zcCheckconsignGroupCtrl.UltraGrid1.AfterRowActivate += zcCheckconsignGroupCtrl_AfterRowActivate;
  63. if (_processCode != "F")
  64. {
  65. _zcCheckconsignGroupCtrl.UltraGrid1.DisplayLayout.Bands[0].Columns["lotNoGroup"].Hidden = true;
  66. }
  67. //_jhyPhySplineCtrl = new QcmJhyPhySplineCtrl(ultraTabPageControl3, ob);
  68. //_jhyPhySplineCtrl.UltraGrid1.AfterRowActivate += jhyPhySplineCtrl_AfterRowActivate;
  69. _zgChemPhyCtrl = new QcmZgChemPhyCtrl(ultraExpandableGroupBoxPanel2, ob, false, "phy", _processCode);
  70. _d = new Dal(ob);
  71. //labelDateTimePicker1.Checked = true;
  72. labelDateTimePicker1.Value = DateTime.Now.Date.AddDays(-3);
  73. labelDateTimePicker2.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  74. labelDateTimePicker5.Value = DateTime.Now.Date.AddDays(0).AddSeconds(1);
  75. labelDateTimePicker6.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  76. checkBox3.Checked = true;
  77. dateTimePicker1.Value = DateTime.Now.Date.AddDays(-3);
  78. dateTimePicker2.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  79. labelDateTimePicker4.Checked = true;
  80. labelDateTimePicker4.Value = DateTime.Now.Date.AddDays(-3);
  81. labelDateTimePicker3.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  82. JudgeBaseInfo.LoadPlineName(ultraComboEditor2, ob, true, "A");
  83. ClsBaseInfo.FillComBaseInfo(labelComboBox1.ComboBox, "407407", ob, false);
  84. //判定结果只显示内控合格和不合格。 40740101内控合格 40740102内控不合格
  85. DataTable dt = (DataTable)labelComboBox1.ComboBox.DataSource;
  86. DataRow dr = dt.NewRow();
  87. dr["BASECODE"] = "1";
  88. dr["BASENAME"] = "已判";
  89. dt.Rows.InsertAt(dr, 0);
  90. dr = dt.NewRow();
  91. dr["BASECODE"] = "0";
  92. dr["BASENAME"] = "未判";
  93. dt.Rows.InsertAt(dr, 0);
  94. dt.AcceptChanges();
  95. dt.DefaultView.RowFilter = "BASECODE IN ('0', '1')";
  96. labelComboBox1.Checked = true;
  97. labelComboBox1.ComboBox.SelectedIndex = 0;
  98. //ClsBaseInfo.SetComboItemHeight(labelComboBox1.ComboBox);
  99. ClsBaseInfo.FillComBaseInfo(labelComboBox3.ComboBox, "407407", ob, false);
  100. DataTable dtCmb3 = (DataTable)labelComboBox3.ComboBox.DataSource;
  101. dtCmb3.DefaultView.RowFilter = "BASECODE IN ('40740701', '40740704')";
  102. JudgeBaseInfo.LoadPlineName(labelComboBox2.ComboBox, ob, false, _processCode);
  103. labelComboBox2.ComboBox.DropDownListWidth = -1;
  104. string[] datePurviewIds = this.ValidDataPurviewIds;
  105. if (CustomInfo.Contains("WG"))
  106. {
  107. datePurviewIds = new string[] { "002001001001" };//计划科
  108. }
  109. DataTable dtPline = _d.GetTableByXmlId("JdgComBasePline.getPlineByDept", new object[] { datePurviewIds });
  110. DataTable cmb2Dt = (DataTable)labelComboBox2.ComboBox.DataSource;
  111. for (int i = cmb2Dt.Rows.Count - 1; i >= 0; i--)
  112. {
  113. if (dtPline.Select("plinecode = '" + cmb2Dt.Rows[i]["plinecode"].ToString() + "'").Length == 0)
  114. {
  115. cmb2Dt.Rows[i].Delete();
  116. }
  117. }
  118. foreach (var item in labelComboBox2.ComboBox.Items)
  119. {
  120. item.CheckState = CheckState.Checked;
  121. }
  122. JudgeBaseInfo.LoadPlineName(labelComboBox4.ComboBox, ob, false, _processCode);
  123. labelComboBox2.Checked = true;
  124. labelComboBox4.ComboBox.DropDownListWidth = -1;
  125. DataTable cmb4Dt = (DataTable)labelComboBox4.ComboBox.DataSource;
  126. for (int i = cmb4Dt.Rows.Count - 1; i >= 0; i--)
  127. {
  128. if (dtPline.Select("plinecode = '" + cmb4Dt.Rows[i]["plinecode"].ToString() + "'").Length == 0)
  129. {
  130. cmb4Dt.Rows[i].Delete();
  131. }
  132. }
  133. foreach (var item in labelComboBox4.ComboBox.Items)
  134. {
  135. item.CheckState = CheckState.Checked;
  136. }
  137. labelComboBox4.Checked = true;
  138. labelComboBox5.Checked = true;
  139. labelComboBox5.ComboBox.SelectedIndex = 2;
  140. //BindPhyItem();
  141. }
  142. private string _ordLnPk = "";
  143. void zcCheckconsignGroupCtrl_AfterRowActivate(object sender, EventArgs e)
  144. {
  145. if (_zcCheckconsignGroupCtrl.UltraGrid1.ActiveRow == null) return;
  146. string steelStandard = _zcCheckconsignGroupCtrl.UltraGrid1.ActiveRow.GetValue("steelStandrad");
  147. try
  148. {
  149. this.Cursor = Cursors.WaitCursor;
  150. var groupRow = _zcCheckconsignGroupCtrl.UltraGrid1.ActiveRow;
  151. DataTable dtConsign = _d.GetTableByXmlId("JdgQcmZcCheckconsign.queryAllByCheckNo", groupRow.GetValue("checkNo"));
  152. DataRow drPlnSaleOrd = _d.GetRowByXmlId("JdgPlnSaleOrd.getOrdLnPkByDlyPk", dtConsign.Rows[0]["ordLnDlyPk"].ToString());
  153. if (drPlnSaleOrd == null) return;
  154. string ordLnPk = drPlnSaleOrd["ordLnPk"].ToString();
  155. _ordLnPk = ordLnPk;
  156. _zgChemPhyCtrl.Query(_zgChemPhyCtrl.GetParm(dtConsign, null, null, "", true));
  157. }
  158. finally
  159. {
  160. this.Cursor = Cursors.Default;
  161. }
  162. }
  163. void meltingStoveNoCtrl_Click(object sender, EventArgs e)
  164. {
  165. //string stoveNo = _meltingStoveNoCtrl.UltraGrid1.GetActiveRowValue("StoveNo");
  166. //_stlIncisionCtrl.Query(stoveNo);
  167. }
  168. public override void ToolBar_Click(object sender, string ToolbarKey)
  169. {
  170. base.ToolBar_Click(sender, ToolbarKey);
  171. switch (ToolbarKey)
  172. {
  173. case "Query":
  174. Query();
  175. break;
  176. case "PassApply":
  177. PassApply();
  178. break;
  179. case "Export":
  180. GridHelper.ulGridToExcel(_zgPhyJudgeCtrl.UltraGrid1, "预判定记录");
  181. break;
  182. case "FoldQuery":
  183. FoldQuery();
  184. break;
  185. case "Close":
  186. this.Close();
  187. break;
  188. }
  189. }
  190. public void PassApply()
  191. {
  192. if (_zcCheckconsignGroupCtrl.UltraGrid1.ActiveRow == null)
  193. {
  194. MessageUtil.ShowWarning("没有需要放行申请的记录!");
  195. return;
  196. }
  197. if (_zgChemPhyCtrl.JhyPhySplineCtrl.UltraGrid1.ActiveRow == null)
  198. {
  199. MessageUtil.ShowWarning("没有需要放行申请的记录!");
  200. return;
  201. }
  202. string checkNo = _zcCheckconsignGroupCtrl.UltraGrid1.ActiveRow.GetValue("checkNo");
  203. var chkRows = _zgChemPhyCtrl.JhyPhySplineCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
  204. if (chkRows.Count() == 0)
  205. {
  206. if (_zgChemPhyCtrl.JhyPhySplineCtrl.UltraGrid1.ActiveRow == null)
  207. {
  208. MessageUtil.ShowWarning("请选择申请判定记录!", _zgChemPhyCtrl.JhyPhySplineCtrl.UltraGrid1);
  209. }
  210. else
  211. {
  212. MessageUtil.ShowWarning("请选择申请判定记录!", _zgChemPhyCtrl.JhyPhySplineCtrl.UltraGrid1, _zgChemPhyCtrl.JhyPhySplineCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
  213. }
  214. return;
  215. }
  216. List<string[]> parms = new List<string[]>();
  217. string judgeStoveNo = "";
  218. string batchNo = "";
  219. String processCode = CustomInfo;
  220. foreach (var row in chkRows)
  221. {
  222. judgeStoveNo = row.GetValue("judgeStoveNo");
  223. batchNo = row.GetValue("batchNo");
  224. DataRow drZgJudgeApply = _d.GetRowByXmlId("JdgQcmBcPassApplyDAL.QueryDetailIsPass",
  225. checkNo, row.GetValue("sampleNo"), row.GetValue("phyCodeMin"), row.GetValue("batchNo"));
  226. if (drZgJudgeApply["jfResult"].ToString() != "0" && drZgJudgeApply["nkResult"].ToString() != "0")
  227. {
  228. MessageUtil.ShowWarning("只有判定不合格的记录,才能申请质量放行!", _zgChemPhyCtrl.JhyPhySplineCtrl.UltraGrid1, row);
  229. return;
  230. }
  231. //DataRow drPassApply = _d.GetRowByXmlId("JdgQcmBcPassApplyDAL.queryByBatchNo", row.GetValue("jugdeApplyCode"),
  232. // row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), processCode);
  233. //if (drPassApply != null)
  234. //{
  235. // MessageUtil.ShowWarning("该记录已生成放行申请单,不能重复生成!", _zgChemPhyCtrl.JhyPhySplineCtrl.UltraGrid1, row);
  236. // return;
  237. //}
  238. string[] parm = new string[] { checkNo, row.GetValue("sampleNo"), row.GetValue("phyCodeMin"), row.GetValue("batchNo") };
  239. parms.Add(parm);
  240. }
  241. PopupSubmit popupSubmit = new PopupSubmit("是否确认放行申请?", true, "请输入放行申请原因!");
  242. if (popupSubmit.ShowDialog() != System.Windows.Forms.DialogResult.Yes)
  243. {
  244. return;
  245. }
  246. var ccp = _d.Set("com.steering.pss.judge.Bll.BllRolledTubeColligatePassApply.passApply", parms, processCode,
  247. UserInfo.GetUserName(), UserInfo.GetDeptid(), UserInfo.GetDepartment(), popupSubmit.TxtAudit.Text.Trim());
  248. if (ccp.ReturnInfo != "")
  249. {
  250. MessageUtil.ShowError(ccp.ReturnInfo);
  251. return;
  252. }
  253. else
  254. {
  255. MessageUtil.ShowTips("操作成功!");
  256. }
  257. UltraGridRow checkGroupRow = _zcCheckconsignGroupCtrl.UltraGrid1.ActiveRow;
  258. Relocate(checkNo);
  259. }
  260. private void Query()
  261. {
  262. try
  263. {
  264. this.Cursor = Cursors.WaitCursor;
  265. string judgeTimeB = labelDateTimePicker1.Checked ? labelDateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
  266. string judgeTimeE = labelDateTimePicker1.Checked ? labelDateTimePicker2.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
  267. string judgeTimeStart = labelDateTimePicker5.Checked ? labelDateTimePicker5.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
  268. string judgeTimeEnd = labelDateTimePicker5.Checked ? labelDateTimePicker6.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
  269. string judgeState = labelComboBox1.Checked ? labelComboBox1.ComboBox.Value.ToString2() : "";
  270. string lotNo = labelTextBox1.Checked ? labelTextBox1.Text.Trim() : "";
  271. string judgeStoveNo = labelTextBox4.Checked ? labelTextBox4.Text.Trim() : "";
  272. string[] plines;
  273. if (!labelComboBox2.Checked)
  274. {
  275. plines = new string[labelComboBox2.ComboBox.Items.Count];
  276. for (int i = 0; i < labelComboBox2.ComboBox.Items.Count; i++)
  277. {
  278. plines[i] = labelComboBox2.ComboBox.Items[i].DataValue.ToString2();
  279. }
  280. if (plines.Length == 0)
  281. {
  282. plines = new string[] { "1" };
  283. }
  284. }
  285. else if (labelComboBox2.ComboBox.Value == null)
  286. {
  287. plines = new string[] { "1" };
  288. }
  289. else
  290. {
  291. plines = ((List<object>)labelComboBox2.ComboBox.Value).Select(a => a.ToString()).ToArray();
  292. }
  293. string chemType = ultraOptionSet2.Value.ToString();
  294. string gpSource = ultraOptionSet3.Value.ToString2();
  295. string checkNo = labelTextBox5.Checked ? labelTextBox5.Text.Trim() : "";
  296. string isCheck = labelComboBox5.Checked ? labelComboBox5.SelecteValue.ToString2() : "";
  297. switch (ultraTabControl1.SelectedTab.Text)
  298. {
  299. case "理化判定":
  300. _zgChemPhyCtrl.ClearData(true);
  301. _zcCheckconsignGroupCtrl.Query(lotNo, judgeStoveNo, judgeState, judgeTimeB,
  302. judgeTimeE, plines, chemType, gpSource, _processCode, checkNo, isCheck, judgeTimeStart, judgeTimeEnd);
  303. break;
  304. case "判定记录":
  305. string batchNo2 = labelTextBox3.Checked ? labelTextBox3.Text.Trim() : "";
  306. string judgeStoveNo2 = labelTextBox2.Checked ? labelTextBox2.Text.Trim() : "";
  307. string judgeResult = labelComboBox3.Checked ? labelComboBox3.SelecteValue.ToString2() : "";
  308. string judgeTimeB2 = labelDateTimePicker4.Checked ? labelDateTimePicker4.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
  309. string judgeTimeE2 = labelDateTimePicker4.Checked ? labelDateTimePicker3.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
  310. string[] plines2;
  311. if (!labelComboBox4.Checked)
  312. {
  313. plines2 = new string[labelComboBox4.ComboBox.Items.Count];
  314. for (int i = 0; i < labelComboBox4.ComboBox.Items.Count; i++)
  315. {
  316. plines2[i] = labelComboBox4.ComboBox.Items[i].DataValue.ToString2();
  317. }
  318. if (plines2.Length == 0)
  319. {
  320. plines2 = new string[] { "1" };
  321. }
  322. }
  323. else if (labelComboBox4.ComboBox.Value == null)
  324. {
  325. plines2 = new string[] { "1" };
  326. }
  327. else
  328. {
  329. plines2 = ((List<object>)labelComboBox4.ComboBox.Value).Select(a => a.ToString()).ToArray();
  330. }
  331. QueryJudgeRecord(judgeStoveNo2, batchNo2, judgeTimeB2, judgeTimeE2, judgeResult, plines2);
  332. break;
  333. }
  334. }
  335. finally
  336. {
  337. this.Cursor = Cursors.Default;
  338. }
  339. }
  340. private void Relocate(string checkNo)
  341. {
  342. _zcCheckconsignGroupCtrl.UltraGrid1.BeginUpdate();
  343. Query();
  344. var reGroupRow = _zcCheckconsignGroupCtrl.UltraGrid1.Rows.Where(a => a.GetValue("checkNo") == checkNo).FirstOrDefault();
  345. if (reGroupRow != null)
  346. {
  347. reGroupRow.Activate();
  348. }
  349. _zcCheckconsignGroupCtrl.UltraGrid1.EndUpdate();
  350. }
  351. private void labelDateTimePicker1_CheckBox_CheckedChanged(object sender, EventArgs e)
  352. {
  353. labelDateTimePicker2.DateTimeEnabled = labelDateTimePicker1.Checked;
  354. }
  355. private void QueryJudgeRecord(string judgeStoveNo, string batchNo, string judgeTimeB, string judgeTimeE, string judgeResult, string[] plines)
  356. {
  357. _zgPhyJudgeCtrl.Query(judgeStoveNo, batchNo, judgeResult, judgeTimeB, judgeTimeE, plines, _processCode);
  358. }
  359. private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  360. {
  361. //PlnOrderZgFrm plnOrderZgFrm = new PlnOrderZgFrm(ultraTextEditor1.Text.Trim(), ob);
  362. //if (plnOrderZgFrm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  363. //{
  364. // ultraTextEditor1.Text = plnOrderZgFrm.ActiveProOrderNo;
  365. //}
  366. }
  367. private void ultraTextEditor2_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  368. {
  369. try
  370. {
  371. this.Cursor = Cursors.WaitCursor;
  372. string[] values;
  373. if (ultraComboEditor1.Value == null || !checkBox1.Checked)
  374. {
  375. values = new string[0];
  376. }
  377. else
  378. {
  379. values = ((List<object>)ultraComboEditor1.Value).Select(a => a.ToString()).ToArray();
  380. }
  381. //_jhyPhyResultCtrl.ClearData();
  382. string stoveNo = ultraTextEditor2.Text.Trim();
  383. string plineCode = checkBox2.Checked ? ultraComboEditor2.Value.ToString2() : "";
  384. string judgeState = ultraOptionSet1.Value.ToString2();
  385. string timeB = checkBox3.Checked ? dateTimePicker1.Value.ToString("yyy-MM-dd HH:mm:ss") : "";
  386. string timeE = checkBox3.Checked ? dateTimePicker2.Value.ToString("yyy-MM-dd HH:mm:ss") : "";
  387. }
  388. finally
  389. {
  390. this.Cursor = Cursors.Default;
  391. }
  392. }
  393. private void labelDateTimePicker4_CheckBox_CheckedChanged(object sender, EventArgs e)
  394. {
  395. labelDateTimePicker3.DateTimeEnabled = labelDateTimePicker4.Checked;
  396. }
  397. void lgChemJudgeCtrl_AfterRowActivate(object sender, EventArgs e)
  398. {
  399. }
  400. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  401. {
  402. ultraComboEditor1.Enabled = checkBox1.Checked;
  403. }
  404. private void checkBox3_CheckedChanged(object sender, EventArgs e)
  405. {
  406. dateTimePicker2.Enabled = dateTimePicker1.Enabled = checkBox3.Checked;
  407. }
  408. private void checkBox2_CheckedChanged(object sender, EventArgs e)
  409. {
  410. ultraComboEditor2.Enabled = checkBox2.Checked;
  411. }
  412. private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  413. {
  414. try
  415. {
  416. this.Cursor = Cursors.WaitCursor;
  417. if (toolMenu == null || toolMenu.Toolbars.Count == 0) return;
  418. if (ultraTabControl1.ActiveTab.Index == 0)
  419. {
  420. if (this.toolMenu.Toolbars[0].Tools.Exists("Judge")) this.toolMenu.Toolbars[0].Tools["Judge"].SharedProps.Visible = true;
  421. if (this.toolMenu.Toolbars[0].Tools.Exists("UpdateMemo")) this.toolMenu.Toolbars[0].Tools["UpdateMemo"].SharedProps.Visible = true;
  422. if (this.toolMenu.Toolbars[0].Tools.Exists("Delete")) this.toolMenu.Toolbars[0].Tools["Delete"].SharedProps.Visible = true;
  423. if (this.toolMenu.Toolbars[0].Tools.Exists("CyCles")) this.toolMenu.Toolbars[0].Tools["CyCles"].SharedProps.Visible = true;
  424. if (this.toolMenu.Toolbars[0].Tools.Exists("CancelCyCles")) this.toolMenu.Toolbars[0].Tools["CancelCyCles"].SharedProps.Visible = true;
  425. if (this.toolMenu.Toolbars[0].Tools.Exists("ApplyResample")) this.toolMenu.Toolbars[0].Tools["ApplyResample"].SharedProps.Visible = true;
  426. if (this.toolMenu.Toolbars[0].Tools.Exists("DeleteResample")) this.toolMenu.Toolbars[0].Tools["DeleteResample"].SharedProps.Visible = true;
  427. if (this.toolMenu.Toolbars[0].Tools.Exists("Export")) this.toolMenu.Toolbars[0].Tools["Export"].SharedProps.Visible = false;
  428. }
  429. else if (ultraTabControl1.ActiveTab.Index == 1)
  430. {
  431. if (this.toolMenu.Toolbars[0].Tools.Exists("Judge")) this.toolMenu.Toolbars[0].Tools["Judge"].SharedProps.Visible = false;
  432. if (this.toolMenu.Toolbars[0].Tools.Exists("UpdateMemo")) this.toolMenu.Toolbars[0].Tools["UpdateMemo"].SharedProps.Visible = false;
  433. if (this.toolMenu.Toolbars[0].Tools.Exists("Delete")) this.toolMenu.Toolbars[0].Tools["Delete"].SharedProps.Visible = false;
  434. if (this.toolMenu.Toolbars[0].Tools.Exists("CyCles")) this.toolMenu.Toolbars[0].Tools["CyCles"].SharedProps.Visible = false;
  435. if (this.toolMenu.Toolbars[0].Tools.Exists("CancelCyCles")) this.toolMenu.Toolbars[0].Tools["CancelCyCles"].SharedProps.Visible = false;
  436. if (this.toolMenu.Toolbars[0].Tools.Exists("ApplyResample")) this.toolMenu.Toolbars[0].Tools["ApplyResample"].SharedProps.Visible = false;
  437. if (this.toolMenu.Toolbars[0].Tools.Exists("DeleteResample")) this.toolMenu.Toolbars[0].Tools["DeleteResample"].SharedProps.Visible = false;
  438. if (this.toolMenu.Toolbars[0].Tools.Exists("Export")) this.toolMenu.Toolbars[0].Tools["Export"].SharedProps.Visible = true;
  439. }
  440. }
  441. finally
  442. {
  443. this.Cursor = Cursors.Default;
  444. }
  445. }
  446. private void ultraTabControl2_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  447. {
  448. try
  449. {
  450. this.Cursor = Cursors.WaitCursor;
  451. if (_zcCheckconsignGroupCtrl == null || _zcCheckconsignGroupCtrl.UltraGrid1 == null || _zcCheckconsignGroupCtrl.UltraGrid1.ActiveRow == null) return;
  452. var groupRow = _zcCheckconsignGroupCtrl.UltraGrid1.ActiveRow;
  453. DataTable consign = _d.GetTableByXmlId("JdgQcmZcCheckconsign.queryAllByCheckNo", groupRow.GetValue("checkNo"));
  454. string craftSource = consign.Rows[0]["craftSource"].ToString();
  455. _zgChemPhyCtrl.Query(_zgChemPhyCtrl.GetParm(consign, null, null, "", true));
  456. }
  457. finally
  458. {
  459. this.Cursor = Cursors.Default;
  460. }
  461. }
  462. private void labelTextBox4_TextBox_KeyDown(object sender, KeyEventArgs e)
  463. {
  464. if (e.KeyData == Keys.Enter)
  465. {
  466. Query();
  467. }
  468. }
  469. private void ultraTextEditor2_KeyDown(object sender, KeyEventArgs e)
  470. {
  471. if (e.KeyData == Keys.Enter)
  472. {
  473. ultraTextEditor2_EditorButtonClick(null, null);
  474. }
  475. }
  476. private void labelTextBox2_TextBox_KeyDown(object sender, KeyEventArgs e)
  477. {
  478. if (e.KeyData == Keys.Enter)
  479. {
  480. Query();
  481. }
  482. }
  483. private void ultraExpandableGroupBox2_ExpandedStateChanged(object sender, EventArgs e)
  484. {
  485. if (!ultraExpandableGroupBox2.Expanded)
  486. {
  487. ultraExpandableGroupBox2.Dock = DockStyle.Bottom;
  488. splitContainer1.Panel1.Controls.Add(ultraExpandableGroupBox2);
  489. ultraExpandableGroupBox2.BringToFront();
  490. splitContainer1.Panel2Collapsed = true;
  491. }
  492. else
  493. {
  494. ultraExpandableGroupBox2.Dock = DockStyle.Fill;
  495. splitContainer1.Panel2.Controls.Add(ultraExpandableGroupBox2);
  496. splitContainer1.Panel2Collapsed = false;
  497. }
  498. }
  499. private void RolledTubePhyJudgeFrm_Shown(object sender, EventArgs e)
  500. {
  501. ultraTabControl1_SelectedTabChanged(null, null);
  502. FoldQuery();
  503. }
  504. private void FoldQuery()
  505. {
  506. if (!this.toolMenu.Toolbars[0].Tools.Exists("FoldQuery")) return;
  507. panel1.Visible = !panel1.Visible;
  508. if (panel1.Visible)
  509. {
  510. this.toolMenu.Toolbars[0].Tools["FoldQuery"].SharedProps.Caption = "折叠查询区域";
  511. //this.splitContainer1.SplitterDistance += 67;
  512. }
  513. else
  514. {
  515. this.toolMenu.Toolbars[0].Tools["FoldQuery"].SharedProps.Caption = "展开查询区域";
  516. //this.splitContainer1.SplitterDistance -= 67;
  517. }
  518. }
  519. }
  520. }