| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Judge.Commons;
- using Core.StlMes.Client.Judge.Controls;
- using CoreFS.CA06;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.Judge.Forms
- {
- public partial class ZcColligateJudgeFrm : FrmBase
- {
- private QcmZcColligateJudgeApplyCtrl _zcJudgeApplyCtrl;
- private QcmZcJudgeCtrl _zcJudgeCtrl;
- private QcmZcPassApplyCtrl _zcPassApply;
- private QcmZcAllChemPhyCtrl _zcAllChemPhyCtrl;
- private QcmZcPassFlowCtrl _zcPassFlowCtrl;
- private Dal _d;
- public ZcColligateJudgeFrm()
- {
- InitializeComponent();
- IsLoadUserView = true;
- }
- private void labelDateTimePicker1_CheckBox_CheckedChanged(object sender, EventArgs e)
- {
- labelDateTimePicker2.DateTimePicker.Enabled = labelDateTimePicker1.Checked;
- }
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- if (_zcAllChemPhyCtrl == null) return;
- _zcAllChemPhyCtrl.SetChemPhyResultError();
- ultraLabel2.Appearance.BackColor = labelComboBox2.BackColor;
- ultraLabel3.Appearance.BackColor = labelComboBox2.BackColor;
- }
- // private string processCode = "";
- private string passInfo = "";
- private DataTable _dtPline = null;
- private void SteelMakingColligateJudgeFrm_Load(object sender, EventArgs e)
- {
- passInfo = CustomInfo;
- _zcJudgeApplyCtrl = new QcmZcColligateJudgeApplyCtrl(splitContainer3.Panel1, ob, JudgeType.SteelMakingColligate,UserInfo);
- _zcJudgeApplyCtrl.UltraGrid1.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False;
- _zcJudgeApplyCtrl.UltraGrid1.AfterRowActivate += gpJudgeApplyCtrl_AfterRowActivate;
- _zcAllChemPhyCtrl = new QcmZcAllChemPhyCtrl(ultraExpandableGroupBoxPanel2, ob, _zcJudgeApplyCtrl.UltraGrid1, "", "zcJudge");
- _zcJudgeCtrl = new QcmZcJudgeCtrl(ultraTabPageControl6, ob);
- _zcJudgeCtrl.EntityGrid1.StyleGrid.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False;
- _zcJudgeCtrl.EntityGrid1.StyleGrid.DisplayLayout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.False;
- _zcPassApply = new QcmZcPassApplyCtrl(splitContainer2.Panel1, ob, UserInfo.GetDeptid());
- _zcPassApply.UltraGrid1.AfterRowActivate += gpPassApply_AfterRowActivate;
- _zcPassFlowCtrl = new QcmZcPassFlowCtrl(splitContainer2.Panel2, ob);
- _d = new Dal(ob);
- dataTable1.Clear();
- dataTable1.Rows.Add("00", "编制中");
- dataTable1.Rows.Add("10", "已下发");
- dataTable1.Rows.Add("20", "生产中");
- dataTable1.Rows.Add("30", "已生产");
- dataTable1.Rows.Add("40", "关闭");
- _dtPline = _d.GetTableByXmlId("JudgeBaseInfo.Query", new object[] { new string[] { "D", "E", "F", "G", "H" } });
- DataTable dtDeptPline = _d.GetTableByXmlId("JdgComBasePline.getPlineByDept", new object[] { this.ValidDataPurviewIds });
- for (int i = _dtPline.Rows.Count - 1; i >= 0; i--)
- {
- if (dtDeptPline.Select("plinecode = '" + _dtPline.Rows[i]["plinecode"].ToString() + "'").Length == 0)
- {
- _dtPline.Rows[i].Delete();
- }
- }
- _dtPline.AcceptChanges();
- string strPlineNames = string.Join(",", _dtPline.Rows.Cast<DataRow>().Select(a => a["plineName"].ToString()).ToArray());
- string strPineCodes = string.Join(",", _dtPline.Rows.Cast<DataRow>().Select(a => a["plineCode"].ToString()).ToArray());
- ultraTextEditor1.Text = strPlineNames;
- ultraTextEditor1.Tag = strPineCodes;
- ultraTextEditor2.Text = strPlineNames;
- ultraTextEditor2.Tag = strPineCodes;
- ClsBaseInfo.FillComBaseInfo(labelComboBox2.ComboBox, "407407", ob, false);
- //判定结果只显示内控合格和不合格。 40740101内控合格 40740102内控不合格
- DataTable dt = (DataTable)labelComboBox2.ComboBox.DataSource;
- DataRow dr = dt.NewRow();
- dr["BASECODE"] = "1";
- dr["BASENAME"] = "已判";
- dt.Rows.InsertAt(dr, 0);
- dr = dt.NewRow();
- dr["BASECODE"] = "0";
- dr["BASENAME"] = "未判";
- dt.Rows.InsertAt(dr, 0);
- dt.AcceptChanges();
- ClsBaseInfo.SetComboItemHeight(labelComboBox2.ComboBox);
- DataTable dtCmb2 = (DataTable)labelComboBox2.ComboBox.DataSource;
- dtCmb2.DefaultView.RowFilter = "BASECODE IN ('0', '1', '40740701', '40740704', '40740709')";
- labelComboBox2.ComboBox.DropDownListWidth = -1;
- ClsBaseInfo.FillComBaseInfo(labelComboBox3.ComboBox, "407407", ob, false);
- ClsBaseInfo.SetComboItemHeight(labelComboBox3.ComboBox);
- labelDateTimePicker1.DateTimePicker.Value = DateTime.Now.Date.AddDays(-3);
- labelDateTimePicker2.DateTimePicker.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
- labelDateTimePicker4.Checked = true;
- labelDateTimePicker4.DateTimePicker.Value = DateTime.Now.Date.AddDays(-3);
- labelDateTimePicker3.DateTimePicker.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
- labelDateTimePicker6.Checked = true;
- labelDateTimePicker6.DateTimePicker.Value = DateTime.Now.Date.AddDays(-3);
- labelDateTimePicker5.DateTimePicker.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
- ultraComboEditor3.SelectedIndex = 0;
- labelComboBox1.Checked = true;
- labelComboBox1.ComboBox.SelectedIndex = 1;
- if (passInfo.Contains("Quality") || passInfo.Contains("Urgent"))
- {
- ultraTabControl2.Tabs[1].Visible = false;
- if (passInfo.Contains("Quality"))
- {
- labelComboBox2.ComboBox.Items[3].CheckState = CheckState.Checked;
- labelComboBox2.Checked = true;
- }
- if (passInfo.Contains("Urgent"))
- {
- labelComboBox2.ComboBox.Items[0].CheckState = CheckState.Checked;
- labelComboBox2.Checked = true;
- }
- }
- else
- {
- labelComboBox2.Checked = true;
- labelComboBox2.ComboBox.Items[0].CheckState = CheckState.Checked;
- }
- }
- void gpPassApply_AfterRowActivate(object sender, EventArgs e)
- {
- try
- {
- this.Cursor = Cursors.WaitCursor;
- var row = _zcPassApply.UltraGrid1.ActiveRow;
- _zcPassFlowCtrl.Query(row.GetValue("passApplyNo"));
- }
- finally
- {
- this.Cursor = Cursors.Default;
- }
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- base.ToolBar_Click(sender, ToolbarKey);
- switch (ToolbarKey)
- {
- case "Query":
- Query();
- break;
- case "Judge":
- Judge();
- break;
- case "PassApply":
- PassApply();
- break;
- case "DeletePassApply":
- DeletePassApply();
- break;
- case "DeleteJudge":
- DeleteJudge();
- break;
- case "ReviewGpCertificate":
- ReviewGpCertificate();
- break;
- case "UpdateMemo":
- UpdateMemo();
- break;
- case "FoldQuery":
- FoldQuery();
- break;
- case "RefreshZbs":
- RefreshZbs("0");
- break;
- case "RefreshZbsJG":
- RefreshZbs("1");
- break;
- case "ZbsLock":
- UpdateZbsLock();
- break;
- case "RefreshCraft":
- RefreshCraft();
- break;
- case "CopyZgData":
- CopyZgData();
- break;
- case "CopyRclData":
- CopyRclData();
- break;
- case "BatchDownload":
- BatchDownload();
- break;
- case "Export":
- if (ultraTabControl2.ActiveTab.Index == 0)
- {
- GridHelper.ulGridToExcel(_zcJudgeApplyCtrl.UltraGrid1, "成品判定信息");
- }
- else if (ultraTabControl2.ActiveTab.Index == 1)
- {
- GridHelper.ulGridToExcel(_zcJudgeCtrl.EntityGrid1, "成品判定记录");
- }
- else if (ultraTabControl2.ActiveTab.Index == 2)
- {
- GridHelper.ulGridToExcel(_zcJudgeApplyCtrl.UltraGrid1, "放行记录");
- }
- break;
- }
- }
- private void BatchDownload()
- {
- var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
- if (chkRows.Count() == 0)
- {
- MessageUtil.ShowWarning("请选择需要导出的记录!");
- return;
- }
- WaitingForm2 wf = new WaitingForm2("文件检索中....");
- List<string> judgeStoveNos = new List<string>();
- List<string> pathList = new List<string>();
- string key = _zcAllChemPhyCtrl.ultraTabControl1.ActiveTab.Key;
- string key1 = "";
- switch (key)
- {
- case "A":
- key1 = _zcAllChemPhyCtrl.ZgChemPhyLgCtrl.ultraTabControl2.ActiveTab.Key;
- break;
- case "D":
- key1 = _zcAllChemPhyCtrl.ZgChemPhyZgCtrl.ultraTabControl2.ActiveTab.Key;
- break;
- case "E":
- key1 = _zcAllChemPhyCtrl.ZgChemPhyDbkCtrl.ultraTabControl2.ActiveTab.Key;
- break;
- case "F":
- key1 = _zcAllChemPhyCtrl.ZgChemPhyRclCtrl.ultraTabControl2.ActiveTab.Key;
- break;
- case "G":
- key1 = _zcAllChemPhyCtrl.ZgChemPhyJgxCtrl.ultraTabControl2.ActiveTab.Key;
- break;
- case "H":
- key1 = _zcAllChemPhyCtrl.ZgChemPhyJgCtrl.ultraTabControl2.ActiveTab.Key;
- break;
- }
- foreach (var row in chkRows)
- {
- DataTable dt = null;
- switch (key1)
- {
- case "water":
-
- if (key == "G")
- {
- dt = _d.GetTableByXmlId("JdgMchWatergageResult.getInfo", row.GetValue("judgeStoveNo"), row.GetValue("batchNo"));
- }
- else
- {
- dt = _d.GetTableByXmlId("JdgMchWatergageResult.getZgInfo", row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), key);
- }
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- pathList.Add(row.GetValue("judgeStoveNo") + "_" + row.GetValue("batchNo") + ";" + dt.Rows[i]["REPORTPATH"].ToString2());
- }
- break;
- case "finalCheck":
- dt = _d.GetTableByXmlId("JdgMchFinalChekResult.getInfo", row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), key);
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- pathList.Add(row.GetValue("judgeStoveNo") + "_" + row.GetValue("batchNo") + ";" + dt.Rows[i]["REPORTPATH"].ToString2());
- }
- break;
- case "jgDetect":
- dt = _d.GetTableByXmlId("JdgCouplingInSpectionResult.Query", row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), row.GetValue("proOrderId"));
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- pathList.Add(row.GetValue("judgeStoveNo") + "_" + row.GetValue("batchNo") + ";" + dt.Rows[i]["REPORTPATH"].ToString2());
- }
- break;
- case "detec":
- CoreClientParam ccp = _d.Set("com.steering.pss.judge.Bll.BllZcColligateJudge.getDetectInfo",
- row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), key, "");
- if (ccp.ReturnInfo.ToString2() != "")
- {
- MessageUtil.ShowWarning(ccp.ReturnInfo.ToString2());
- return;
- }
- dt = JsonHelper.toTable(ccp.ReturnObject.ToString2());
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- pathList.Add(row.GetValue("judgeStoveNo") + "_" + row.GetValue("batchNo") + ";" + dt.Rows[i]["REPORTPATH"].ToString2());
- }
- break;
- default:
- dt = _d.GetTableByXmlId("QcmZgJugdeApplyDAL.getReportPath", row.GetValue("judgeStoveNo"), row.GetValue("batchNo"));
- for(int i = 0 ; i<dt.Rows.Count ;i++){
- pathList.Add(row.GetValue("judgeStoveNo") + "_" + row.GetValue("batchNo") + ";" + dt.Rows[i][0].ToString2());
- }
- break;
- }
- }
- wf.Close();
- dlgOrderAskDown down = new dlgOrderAskDown(this.ob, pathList, "2", judgeStoveNos);
- down.DeleteButton.Visible = false;
- down.ShowDialog();
- //打开下载后的文件夹
- if (down.Pic != "")
- System.Diagnostics.Process.Start("Explorer.exe", down.Pic);
- }
- private void CopyZgData()
- {
- var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
- if (chkRows.Count() == 0)
- {
- MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
- return;
- }
- string applyCode = "";
- string judgeStoveNo = "";
- string batchNo = "";
- foreach (var row in chkRows)
- {
- string lotNo = row.GetValue("lotNo");
- judgeStoveNo = row.GetValue("judgeStoveNo");
- batchNo = row.GetValue("batchNo");
- applyCode = row.GetValue("jugdeApplyCode");
- var result = _d.Set("com.steering.pss.judge.Bll.BllRolledTubeColligateJudge.CopyZgJhyData",
- applyCode, judgeStoveNo, batchNo, null);
- if (result.ReturnInfo.ToString2() != "")
- {
- MessageUtil.ShowWarning(result.ReturnInfo);
- return;
- }
- }
- MessageUtil.ShowTips("复制成功!");
- Relocate(applyCode, judgeStoveNo, batchNo);
- }
- private void UpdateZbsLock()
- {
- var row = _zcJudgeApplyCtrl.UltraGrid1.ActiveRow;
- if (row == null)
- {
- MessageUtil.ShowWarning("请选择申请判定记录!");
- return;
- }
- string judgeStoveNo = row.GetValue("judgeStoveNo");
- string batchNo = row.GetValue("batchNo");
- string applyCode = row.GetValue("jugdeApplyCode");
- string zbsLockFlag = row.GetValue("zbsLockFlag").Equals("1")?"0":"1";
- var result = _d.Set("com.steering.pss.judge.Bll.BllCreateZbsInfo.UpdateZbsLock",
- applyCode, judgeStoveNo, batchNo, zbsLockFlag);
- if (result.ReturnInfo.ToString2() != "")
- {
- MessageUtil.ShowWarning(result.ReturnInfo);
- return;
- }
- if ("0".Equals(zbsLockFlag))
- {
- MessageUtil.ShowTips("解锁成功!");
- }else{
- MessageUtil.ShowTips("锁定成功!");
- }
- Query();
- }
- private void CopyRclData()
- {
- var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
- if (chkRows.Count() == 0)
- {
- MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
- return;
- }
- string applyCode = "";
- string judgeStoveNo = "";
- string batchNo = "";
- foreach (var row in chkRows)
- {
- string lotNo = row.GetValue("lotNo");
- judgeStoveNo = row.GetValue("judgeStoveNo");
- batchNo = row.GetValue("batchNo");
- applyCode = row.GetValue("jugdeApplyCode");
- var result = _d.Set("com.steering.pss.judge.Bll.BllRolledTubeColligateJudge.CopyRclJhyData",
- applyCode, judgeStoveNo, batchNo, "");
- if (result.ReturnInfo.ToString2() != "")
- {
- MessageUtil.ShowWarning(result.ReturnInfo);
- return;
- }
- }
- MessageUtil.ShowTips("复制成功!");
- Relocate(applyCode, judgeStoveNo, batchNo);
- }
- private void UpdateMemo()
- {
- if (_zcJudgeApplyCtrl.UltraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowWarning("没有需要修改的记录!");
- return;
- }
- var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
- if (chkRows.Count() == 0)
- {
- if (_zcJudgeApplyCtrl.UltraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1);
- }
- else
- {
- MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
- }
- return;
- }
- string judgeApplyCode = "";
- string judgeStoveNo = "";
- string batchNo = "";
- List<string[]> parms = new List<string[]>();
- foreach (var row in chkRows)
- {
- judgeApplyCode = row.GetValue("jugdeApplyCode");
- judgeStoveNo = row.GetValue("judgeStoveNo");
- batchNo = row.GetValue("batchNo");
- parms.Add(new string[] { judgeApplyCode, judgeStoveNo, batchNo, row.GetValue("processCode"), row.GetValue("memo"), row.GetValue("judgeMemo") });
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认修改备注?") == System.Windows.Forms.DialogResult.No)
- {
- return;
- }
- var ccp = _d.Set("com.steering.pss.judge.Bll.BllZcColligateJudge.UpdateMemo", parms);
- if (ccp.ReturnInfo != "")
- {
- MessageUtil.ShowError(ccp.ReturnInfo);
- return;
- }
- else
- {
- MessageUtil.ShowTips("操作成功!");
- }
- Relocate(judgeApplyCode, judgeStoveNo, batchNo);
- }
- private void DeleteJudge()
- {
- var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
- if (_zcJudgeApplyCtrl.UltraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowWarning("没有需要撤销的记录!");
- return;
- }
- if (chkRows.Count() == 0)
- {
- MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
- return;
- }
- string judgeApplyCode = "";
- string judgeStoveNo = "";
- string bathcNo = "";
- bool deleteJudgeTiped = false;
- foreach (var row in chkRows)
- {
- judgeApplyCode = row.GetValue("jugdeApplyCode");
- judgeStoveNo = row.GetValue("judgeStoveNo");
- bathcNo = row.GetValue("batchNo");
- DataRow drGpApply = _d.GetRowByXmlId("QcmZgJugdeApplyDAL.QueryByBatchNo", row.GetValue("jugdeApplyCode"),
- row.GetValue("judgeStoveNo"), row.GetValue("batchNo"));
- DataRow drPassApply = _d.GetRowByXmlId("JdgQcmZcPassApplyDAL.queryByBatchNo", row.GetValue("jugdeApplyCode"),
- row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), row.GetValue("processCode"));
- if (drGpApply != null && drGpApply["judgeResultCode"].ToString() == "40740704"
- && drPassApply != null && drPassApply["TYPE"].ToString() == "0")
- {
- if (drPassApply["auditResult"].ToString() == "407502" || drPassApply["auditResult"].ToString() == "407503")
- {
- deleteJudgeTiped = true;
- if (MessageUtil.ShowYesNoAndQuestion("炉号" + judgeStoveNo + " 放行处置结果为让步接收,是否确认撤销判定?") == System.Windows.Forms.DialogResult.No)
- {
- return;
- }
- }
- }
- }
- if (deleteJudgeTiped == false)
- {
- if (MessageUtil.ShowYesNoAndQuestion("是否确认进行撤销判定?") == System.Windows.Forms.DialogResult.No)
- {
- return;
- }
- }
- List<string> judgeStoveNos = new List<string>();
- foreach (var row in chkRows)
- {
- if (judgeStoveNos.Contains(row.GetValue("judgeStoveNo"))) continue;
- judgeStoveNos.Add(row.GetValue("judgeStoveNo"));
- var ccp = _d.Set("com.steering.pss.judge.Bll.BllZcColligateJudge.deleteJudge", row.GetValue("jugdeApplyCode"),
- row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), row.GetValue("processCode"), UserInfo.GetUserName());
- if (ccp.ReturnInfo != "")
- {
- MessageUtil.ShowWarning(ccp.ReturnInfo);
- return;
- }
- }
- MessageUtil.ShowTips("操作成功!");
- Relocate(judgeApplyCode, judgeStoveNo, bathcNo);
- }
- private void DeletePassApply()
- {
- var chkRows = _zcPassApply.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
- if (chkRows.Count() == 0)
- {
- MessageUtil.ShowWarning("请选择一行记录");
- return;
- }
- List<string> passApplyNos = new List<string>();
- string passApplyNo = "";
- string passApplySeq = "";
- foreach (var row in chkRows)
- {
- DataRow drPassApply = _d.GetRowByXmlId("JdgQcmZcPassApplyDAL.queryByPassApplyNo", row.GetValue("passApplyNo"));
- if (drPassApply == null)
- {
- MessageUtil.ShowWarning("此炉号不需要删除放行申请单!");
- return;
- }
- if (drPassApply["type"].ToString() == "0")
- {
- DataRow drZgJudgeApply = _d.GetRowByXmlId("QcmZgJugdeApplyDAL.QueryByBatchNo", row.GetValue("jugdeApplyCode"),
- row.GetValue("judgeStoveNo"), row.GetValue("batchNo"));
- if (drZgJudgeApply["judgeTolresultCode"].ToString() != "40740704" && drZgJudgeApply["judgeTolresultCode"].ToString() != "40740708")
- {
- MessageUtil.ShowWarning("只能删除判定不合格状态的放行申请单!", _zcJudgeApplyCtrl.UltraGrid1, row);
- return;
- }
- if (drZgJudgeApply["auditTolresult"].ToString() == "407504" || drZgJudgeApply["auditTolresult"].ToString() == "407505"
- || drZgJudgeApply["auditTolresult"].ToString() == "407506")
- {
- MessageUtil.ShowWarning("此炉号已退回炼钢,不能删除!", _zcJudgeApplyCtrl.UltraGrid1, row);
- return;
- }
- }
- else
- {
- if (drPassApply["auditResult"].ToString() == "1")
- {
- MessageUtil.ShowWarning("此炉号已经通过紧急放行,不能删除申请放行单!");
- return;
- }
- }
- passApplyNos.Add(row.GetValue("PassApplyNo"));
- passApplyNo = row.GetValue("PassApplyNo");
- passApplySeq = row.GetValue("passApplySeq");
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认删除申请放行?") == System.Windows.Forms.DialogResult.No)
- {
- return;
- }
- var ccp = _d.Set("com.steering.pss.judge.Bll.BllZcColligatePassApply.delete", passApplyNos, UserInfo.GetUserName());
- if (ccp.ReturnInfo != "")
- {
- MessageUtil.ShowError(ccp.ReturnInfo);
- return;
- }
- else
- {
- MessageUtil.ShowTips("操作成功!");
- }
- Query();
- var rowRelocate = _zcPassApply.UltraGrid1.Rows.Where(a => a.GetValue("PassApplyNo") == passApplyNo
- && a.GetValue("passApplySeq") == passApplySeq).FirstOrDefault();
- if (rowRelocate != null)
- {
- rowRelocate.Activate();
- }
- }
- private void PassApply()
- {
- if (_zcJudgeApplyCtrl.UltraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowWarning("没有需要放行申请的记录!");
- return;
- }
- var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
- if (chkRows.Count() == 0)
- {
- if (_zcJudgeApplyCtrl.UltraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1);
- }
- else
- {
- MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
- }
- return;
- }
- List<string[]> parms = new List<string[]>();
- string judgeApplyCode = "";
- string judgeStoveNo = "";
- string batchNo = "";
- foreach (var row in chkRows)
- {
- judgeApplyCode = row.GetValue("jugdeApplyCode");
- judgeStoveNo = row.GetValue("judgeStoveNo");
- batchNo = row.GetValue("batchNo");
- DataRow drZgJudgeApply = _d.GetRowByXmlId("QcmZgJugdeApplyDAL.QueryByBatchNo", row.GetValue("jugdeApplyCode"),
- row.GetValue("judgeStoveNo"), row.GetValue("batchNo"));
- if (passInfo == "Quality")
- {
- if (drZgJudgeApply["judgeTolresultCode"].ToString() != "40740704" && drZgJudgeApply["judgeTolresultCode"].ToString() != "40740708")
- {
- MessageUtil.ShowWarning("只有判定不合格的记录,才能申请质量放行!", _zcJudgeApplyCtrl.UltraGrid1, row);
- return;
- }
- }
- else if (passInfo == "Urgent")
- {
- if (drZgJudgeApply["judgeTolresultCode"].ToString() != "")
- {
- MessageUtil.ShowWarning("只有未判定的记录,才能申请紧急放行!", _zcJudgeApplyCtrl.UltraGrid1, row);
- return;
- }
- }
- DataRow drPassApply = _d.GetRowByXmlId("JdgQcmZcPassApplyDAL.queryByBatchNo", row.GetValue("jugdeApplyCode"),
- row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), row.GetValue("processCode"));
- if (drPassApply != null)
- {
- MessageUtil.ShowWarning("该记录已生成放行申请单,不能重复生成!", _zcJudgeApplyCtrl.UltraGrid1, row);
- return;
- }
- string[] parm = new string[] { judgeApplyCode, judgeStoveNo, batchNo, row.GetValue("processCode") };
- parms.Add(parm);
- }
- PopupSubmit popupSubmit = new PopupSubmit("是否确认放行申请?", true, "请输入放行申请原因!");
- if (popupSubmit.ShowDialog() != System.Windows.Forms.DialogResult.Yes)
- {
- return;
- }
- string passType = passInfo == "Quality" ? "0" : "1";
- var ccp = _d.Set("com.steering.pss.judge.Bll.BllZcColligateJudge.passApply", parms,
- UserInfo.GetUserName(), UserInfo.GetDeptid(), UserInfo.GetDepartment(), popupSubmit.TxtAudit.Text.Trim(), passType);
- if (ccp.ReturnInfo != "")
- {
- MessageUtil.ShowError(ccp.ReturnInfo);
- return;
- }
- else
- {
- MessageUtil.ShowTips("操作成功!");
- }
- Relocate(judgeApplyCode, judgeStoveNo, batchNo);
- }
- private void Judge()
- {
- var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
- if (_zcJudgeApplyCtrl.UltraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowWarning("没有需要判定的记录!");
- return;
- }
- if (chkRows.Count() == 0)
- {
- MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
- return;
- }
- if (chkRows.Count() > 1)
- {
- MessageUtil.ShowWarning("只允许勾选一条记录进行判定!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
- return;
- }
- string judgeApplyCode = "";
- string judgeStoveNo = "";
- string batchNo = "";
- string processCode = "";
- string oldJudgeTolResult = "";
- foreach (var row in chkRows)
- {
- judgeApplyCode = row.GetValue("jugdeApplyCode");
- judgeStoveNo = row.GetValue("judgeStoveNo");
- batchNo = row.GetValue("batchNo");
- processCode = row.GetValue("processCode");
- DataRow drZgJudgeApply = _d.GetRowByXmlId("QcmZgJugdeApplyDAL.QueryByBatchNo", row.GetValue("jugdeApplyCode"),
- row.GetValue("judgeStoveNo"), row.GetValue("batchNo"));
- oldJudgeTolResult = drZgJudgeApply["judgeTolresultCode"].ToString();
- if (drZgJudgeApply["judgeResultCode"].ToString() == "" && drZgJudgeApply["isAllScrap"].ToString() != "4")
- {
- DataRow drProcess = _d.GetRowByXmlId("JdgComBaseProcess.Query", drZgJudgeApply["processCode"].ToString());
- string processDesc = drProcess["processDesc"].ToString();
- MessageUtil.ShowWarning("末工序" + processDesc + "还未进行综合判定,不能操作成品判定!", _zcJudgeApplyCtrl.UltraGrid1, row);
- return;
- }
- if (drZgJudgeApply["isAllScrap"].ToString() != "4" && drZgJudgeApply["judgeTolresultCode"].ToString() != "40740709")
- {
- if (drZgJudgeApply["instockFlag"].ToString() == "1")
- {
- MessageUtil.ShowWarning("该炉批已缴库,不能操作成品判定!", _zcJudgeApplyCtrl.UltraGrid1, row);
- return;
- }
- }
- DataRow drExistJudge = _d.GetRowByXmlId("QcmZgJugdeApplyDAL.existJudgeQualifiedZc", row.GetValue("jugdeApplyCode"),
- row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), row.GetValue("processCode"));
- if (drExistJudge["judgeTolresultCode"].ToString() == "40740701" || drExistJudge["judgeTolresultCode"].ToString() == "40740702"
- || drExistJudge["judgeTolresultCode"].ToString() == "40740706") //如果已经判定则不判。 AND T.JUDGE_RESULT_CODE IN ('40740701', '40740702')
- {
- MessageUtil.ShowWarning("该记录已经" + drExistJudge["judgeTolresult"].ToString() + ",不允许重复判定!", _zcJudgeApplyCtrl.UltraGrid1, row);
- return;
- }
- if ((!string.IsNullOrWhiteSpace(drExistJudge["lengthType"].ToString()) && !drExistJudge["lengthType"].ToString().Equals("0"))
- || !row.GetValue("lengthType").Equals("正尺")) // 判断是否包含长短尺
- {
- if (MessageUtil.ShowYesNoAndQuestion("该记录包含长短尺,请确认是否继续?") == System.Windows.Forms.DialogResult.No)
- {
- return;
- }
- }
- CoreClientParam ccpDetect = _d.Set("com.steering.pss.judge.Bll.BllRolledTubeColligateJudge.checkDetect", row.GetValue("jugdeApplyCode"),
- row.GetValue("judgeStoveNo"), row.GetValue("batchNo"));
- if (ccpDetect.ReturnInfo.ToString2() != "")
- {
- MessageUtil.ShowWarning(ccpDetect.ReturnInfo.ToString2());
- return;
- }
- else
- {
- if (ccpDetect.ReturnObject.ToString2() != "")
- {
- if (MessageUtil.ShowYesNoAndQuestion(ccpDetect.ReturnObject.ToString2() + "\r\n是否继续判定?") == System.Windows.Forms.DialogResult.No)
- {
- return;
- }
- }
- }
- //有放行申请单的不允许判定。
- DataRow drPassApply = _d.GetRowByXmlId("JdgQcmZcPassApplyDAL.queryByBatchNo", row.GetValue("jugdeApplyCode"),
- row.GetValue("judgeStoveNo"), row.GetValue("batchNo"));
- if (drPassApply != null)
- {
- if (drPassApply["TYPE"].ToString() == "0")
- {
- if (drPassApply["auditResult"].ToString() == "")
- {
- MessageUtil.ShowWarning("该炉号处于放行审核状态,不允许判定!", _zcJudgeApplyCtrl.UltraGrid1, row);
- return;
- }
- if (drPassApply["auditResult"].ToString() == "407504")
- {
- MessageUtil.ShowWarning("该炉号放行处置结果为降级/改判,请操作撤销判定!", _zcJudgeApplyCtrl.UltraGrid1, row);
- return;
- }
- if (drPassApply["auditResult"].ToString() == "407505")
- {
- MessageUtil.ShowWarning("该炉号放行处置结果为报废,请操作撤销判定!", _zcJudgeApplyCtrl.UltraGrid1, row);
- return;
- }
- if (drPassApply["auditResult"].ToString() == "407506")
- {
- MessageUtil.ShowWarning("该炉号放行处置结果为返工,请操作撤销判定!", _zcJudgeApplyCtrl.UltraGrid1, row);
- return;
- }
- }
- }
- }
- string zbsFlag = "";
- if (processCode == "D" || processCode == "E" || oldJudgeTolResult == "40740709")
- {
- zbsFlag = "1";
- if (MessageUtil.ShowYesNoAndQuestion("是否确认进行判定?") == System.Windows.Forms.DialogResult.No)
- {
- return;
- }
- }
- else
- {
- ZbsChoiceFrm zbsChoice = new ZbsChoiceFrm();
- if (zbsChoice.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- zbsFlag = zbsChoice.ZbsFlag;
- }
- else
- {
- return;
- }
- }
- List<string> judgeStoveNos = new List<string>();
- foreach (var row in chkRows)
- {
- if (judgeStoveNos.Contains(row.GetValue("judgeStoveNo"))) continue;
- judgeStoveNos.Add(row.GetValue("judgeStoveNo"));
- //人工修改利库炉号判定结果
- List<string> checkDetailJsons = RolledTubeColligateJudgeFrm.GetCheckDetailsJsons(_zcAllChemPhyCtrl);
- var ccp = _d.Set("com.steering.pss.judge.Bll.BllZcColligateJudge.judge", row.GetValue("jugdeApplyCode"),
- row.GetValue("judgeStoveNo"), row.GetValue("batchNo"), row.GetValue("processCode"), UserInfo.GetUserName(), UserInfo.GetUserOrderText(),
- UserInfo.GetUserGroupText(), row.GetValue("memo"), row.GetValue("judgeMemo"), zbsFlag, checkDetailJsons);
- if (ccp.ReturnInfo != "")
- {
- MessageUtil.ShowWarning(ccp.ReturnInfo);
- return;
- }
- }
- MessageUtil.ShowTips("判定成功!");
- Relocate(judgeApplyCode, judgeStoveNo, batchNo);
- }
- private void ReviewGpCertificate()
- {
- try
- {
- this.Cursor = Cursors.WaitCursor;
- var row = _zcJudgeApplyCtrl.UltraGrid1.ActiveRow;
- if (row == null)
- {
- MessageUtil.ShowWarning("请选择一行记录!");
- return;
- }
- string judgeApplyCode = row.Cells["jugdeApplyCode"].Value.ToString();
- string judgeApplySeq = row.Cells["jugdeApplySqe"].Value.ToString();
- string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString();
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepGpCertificate.cpt&_bypagesize__=false" + "&JUGDE_APPLY_CODE="
- + judgeApplyCode + judgeApplySeq + "&JUDGE_STOVE_NO=" + judgeStoveNo;
- FrmOrderRepExcel fBug = new FrmOrderRepExcel(ob, strurl);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.WindowState = FormWindowState.Maximized;
- fBug.Text = "管坯判定书";
- fBug.Show();
- }
- finally
- {
- this.Cursor = Cursors.Default;
- }
- }
- private void Relocate(string judgeApplyCode, string judgeStoveNo, string batchNo)
- {
- if (_gpApplyQuery)
- {
- Query();
- var rowJudgeApply = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("jugdeApplyCode") == judgeApplyCode
- && a.GetValue("judgeStoveNo") == judgeStoveNo && a.GetValue("batchNo") == batchNo).FirstOrDefault();
- if (rowJudgeApply != null)
- {
- rowJudgeApply.Activate();
- }
- }
- else
- {
- //ultraTextEditor2_EditorButtonClick(null, null);
- //var rowSteelMaking = _meltingStoveNoCtrl.UltraGrid1.Rows.Where(a => a.GetValue("stoveNo") == stoveNo).FirstOrDefault();
- //if (rowSteelMaking != null)
- //{
- // rowSteelMaking.Activate();
- //}
- }
- }
- private void ClearData()
- {
- _zcJudgeApplyCtrl.Clear();
- _zcAllChemPhyCtrl.ClearChemPhyData();
- }
- private bool _gpApplyQuery = true;
- private void Query()
- {
- try
- {
- this.Cursor = Cursors.WaitCursor;
- ClearData();
- //测试代码
- //_d.Set("com.steering.pss.judge.Bll.BllCreateZbsInfo.Test", "084897", "26001", "001", "G", "796A250A209A0022E053AC10026C9519004001");
- //现货测试
- //_d.Set("com.steering.pss.judge.Bll.BllCreateZbsInfo.saveSpotInfo", "194430", "09001", "001", "D", "8741E3DC0CA001A4E053AC10026B1844001001");
- string timeType = ultraComboEditor3.Value.ToString2();
- string timeB = labelDateTimePicker1.Checked ? labelDateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
- string timeE = labelDateTimePicker1.Checked ? labelDateTimePicker2.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
- string[] judgeStates;
- if (labelComboBox2.ComboBox.Value == null || !labelComboBox2.Checked)
- {
- judgeStates = new string[0];
- }
- else
- {
- judgeStates = ((List<object>)labelComboBox2.ComboBox.Value).Select(a => a.ToString()).ToArray();
- }
- string stoveNo = labelTextBox1.Checked ? labelTextBox1.Text.Trim() : "";
- string judgeStoveNo = labelTextBox4.Checked ? labelTextBox4.Text.Trim() : "";
- string lotNo = labelTextBox1.Checked ? labelTextBox1.Text.Trim() : "";
- string orderMngNo = labelTextBox10.Checked ? labelTextBox10.Text.Trim() : "";
- string[] plines = ultraTextEditor1.Tag.ToString2().Split(',');
- string judgeCondition = labelComboBox1.Checked ? labelComboBox1.SelecteValue.ToString2() : "";
- string[] judgeType;
- if (labelComboBox4.ComboBox.Value == null || !labelComboBox4.Checked)
- {
- judgeType = new string[0];
- }
- else
- {
- judgeType = ((List<object>)labelComboBox4.ComboBox.Value).Select(a => a.ToString()).ToArray();
- }
- switch (ultraTabControl2.SelectedTab.Text)
- {
- case "综合判定":
- _gpApplyQuery = true;
- _zcJudgeApplyCtrl.QueryZcColligate(lotNo, judgeStoveNo, judgeStates, timeB, timeE, plines, orderMngNo, timeType, judgeCondition, judgeType);
- break;
- case "判定记录":
- string batchNo2 = labelTextBox3.Checked ? labelTextBox3.Text.Trim() : "";
- string judgeStoveNo2 = labelTextBox7.Checked ? labelTextBox7.Text.Trim() : "";
- string judgeResult = labelComboBox3.Checked ? labelComboBox3.SelecteValue.ToString2() : "";
- string timeBegin = labelDateTimePicker4.Checked ? labelDateTimePicker4.DateTimePicker.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
- string timeEnd = labelDateTimePicker3.Checked ? labelDateTimePicker3.DateTimePicker.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
- string[] plines2 = ultraTextEditor2.Tag.ToString2().Split(',');
- _zcJudgeCtrl.Query(batchNo2, judgeStoveNo2, judgeResult, timeBegin, timeEnd, plines2);
- break;
- case "不合格评审记录":
- string batchNo3 = labelTextBox5.Checked ? labelTextBox5.Text.Trim() : "";
- string judgeStoveNo3 = labelTextBox6.Checked ? labelTextBox6.Text.Trim() : "";
- string timeB3 = labelDateTimePicker6.Checked ? labelDateTimePicker6.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
- string timeE3 = labelDateTimePicker6.Checked ? labelDateTimePicker5.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
- string validflag = labelCheckBox1.Checked ? "0" : "1";
- //_zgJudgeApplyDtlCtrl2.Clear();
- _zcPassFlowCtrl.Clear();
- _zcPassApply.AllQuery(judgeStoveNo3, batchNo3, timeB3, timeE3, passInfo, validflag);
- break;
- }
- }
- finally
- {
- this.Cursor = Cursors.Default;
- }
- }
- void gpJudgeApplyCtrl_AfterRowActivate(object sender, EventArgs e)
- {
- try
- {
- this.Cursor = Cursors.WaitCursor;
- _zcAllChemPhyCtrl.UltraTabControl2_SelectedTabChanged(null, null);
- }
- finally
- {
- this.Cursor = Cursors.Default;
- }
- }
- public string[] GetChemJudgeStoveNos(string matNo, string curProcess)
- {
- if (curProcess.ToCharArray()[0] < 'D')
- {
- DataRow drTrack = _d.GetRowByXmlId("JdgMatBcQcmTrack.getByMatNoFirstRow", matNo, "D");
- return new string[] { drTrack["judgeStoveNo"].ToString(), "A" };
- }
- else
- {
- DataRow drTrack = _d.GetRowByXmlId("JdgMatBcQcmTrack.getByMatNoFirstRow", matNo, curProcess);
- if (drTrack != null)
- {
- DataRow drJudge = _d.GetRowByXmlId("JdgQcmBcJudge.getByJudgeId", drTrack["jugdeConvicted"].ToString());
- if (drJudge["chemResult"].ToString() != "")
- {
- return new string[] { drTrack["judgeStoveNo"].ToString(), curProcess };
- }
- else
- {
- curProcess = ((char)(curProcess.ToCharArray()[0] - 1)).ToString();
- return GetChemJudgeStoveNos(matNo, curProcess);
- }
- }
- else
- {
- curProcess = ((char)(curProcess.ToCharArray()[0] - 1)).ToString();
- return GetChemJudgeStoveNos(matNo, curProcess);
- }
- }
- }
- private void labelDateTimePicker4_CheckBox_CheckedChanged(object sender, EventArgs e)
- {
- labelDateTimePicker3.DateTimePicker.Enabled = labelDateTimePicker4.Checked;
- }
- private void ultraTabControl2_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
- {
- if (toolMenu == null || toolMenu.Toolbars.Count == 0) return;
- switch (ultraTabControl2.ActiveTab.Index)
- {
- case 0:
- if (this.toolMenu.Toolbars[0].Tools.Exists("Judge")) this.toolMenu.Toolbars[0].Tools["Judge"].SharedProps.Visible = true;
- if (this.toolMenu.Toolbars[0].Tools.Exists("PassApply")) this.toolMenu.Toolbars[0].Tools["PassApply"].SharedProps.Visible = true;
- if (this.toolMenu.Toolbars[0].Tools.Exists("UrgentPassApply")) this.toolMenu.Toolbars[0].Tools["UrgentPassApply"].SharedProps.Visible = true;
- if (this.toolMenu.Toolbars[0].Tools.Exists("DeletePassApply")) this.toolMenu.Toolbars[0].Tools["DeletePassApply"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("DeleteJudge")) this.toolMenu.Toolbars[0].Tools["DeleteJudge"].SharedProps.Visible = true;
- if (this.toolMenu.Toolbars[0].Tools.Exists("UpdateMemo")) this.toolMenu.Toolbars[0].Tools["UpdateMemo"].SharedProps.Visible = true;
- if (this.toolMenu.Toolbars[0].Tools.Exists("Export")) this.toolMenu.Toolbars[0].Tools["Export"].SharedProps.Visible = true;
- if (this.toolMenu.Toolbars[0].Tools.Exists("RefreshZbs")) this.toolMenu.Toolbars[0].Tools["RefreshZbs"].SharedProps.Visible = true;
- if (this.toolMenu.Toolbars[0].Tools.Exists("RefreshCraft")) this.toolMenu.Toolbars[0].Tools["RefreshCraft"].SharedProps.Visible = true;
- if (this.toolMenu.Toolbars[0].Tools.Exists("FoldQuery")) this.toolMenu.Toolbars[0].Tools["FoldQuery"].SharedProps.Visible = true;
- if (this.toolMenu.Toolbars[0].Tools.Exists("ReviewGpCertificate")) this.toolMenu.Toolbars[0].Tools["ReviewGpCertificate"].SharedProps.Visible = true;
- break;
- case 1:
- if (this.toolMenu.Toolbars[0].Tools.Exists("Judge")) this.toolMenu.Toolbars[0].Tools["Judge"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("PassApply")) this.toolMenu.Toolbars[0].Tools["PassApply"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("UrgentPassApply")) this.toolMenu.Toolbars[0].Tools["UrgentPassApply"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("DeletePassApply")) this.toolMenu.Toolbars[0].Tools["DeletePassApply"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("DeleteJudge")) this.toolMenu.Toolbars[0].Tools["DeleteJudge"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("UpdateMemo")) this.toolMenu.Toolbars[0].Tools["UpdateMemo"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("Export")) this.toolMenu.Toolbars[0].Tools["Export"].SharedProps.Visible = true;
- if (this.toolMenu.Toolbars[0].Tools.Exists("RefreshZbs")) this.toolMenu.Toolbars[0].Tools["RefreshZbs"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("RefreshCraft")) this.toolMenu.Toolbars[0].Tools["RefreshCraft"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("FoldQuery")) this.toolMenu.Toolbars[0].Tools["FoldQuery"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("ReviewGpCertificate")) this.toolMenu.Toolbars[0].Tools["ReviewGpCertificate"].SharedProps.Visible = false;
- break;
- case 2:
- if (this.toolMenu.Toolbars[0].Tools.Exists("Judge")) this.toolMenu.Toolbars[0].Tools["Judge"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("PassApply")) this.toolMenu.Toolbars[0].Tools["PassApply"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("UrgentPassApply")) this.toolMenu.Toolbars[0].Tools["UrgentPassApply"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("DeletePassApply")) this.toolMenu.Toolbars[0].Tools["DeletePassApply"].SharedProps.Visible = true;
- if (this.toolMenu.Toolbars[0].Tools.Exists("DeleteJudge")) this.toolMenu.Toolbars[0].Tools["DeleteJudge"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("UpdateMemo")) this.toolMenu.Toolbars[0].Tools["UpdateMemo"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("Export")) this.toolMenu.Toolbars[0].Tools["Export"].SharedProps.Visible = true;
- if (this.toolMenu.Toolbars[0].Tools.Exists("RefreshZbs")) this.toolMenu.Toolbars[0].Tools["RefreshZbs"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("RefreshCraft")) this.toolMenu.Toolbars[0].Tools["RefreshCraft"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("FoldQuery")) this.toolMenu.Toolbars[0].Tools["FoldQuery"].SharedProps.Visible = false;
- if (this.toolMenu.Toolbars[0].Tools.Exists("ReviewGpCertificate")) this.toolMenu.Toolbars[0].Tools["ReviewGpCertificate"].SharedProps.Visible = false;
- break;
- }
- }
- private void SteelMakingColligateJudgeFrm_Shown(object sender, EventArgs e)
- {
- ultraTabControl2_SelectedTabChanged(null, null);
- FoldQuery();
- }
- private void labelDateTimePicker6_CheckBox_CheckedChanged(object sender, EventArgs e)
- {
- labelDateTimePicker5.DateTimeEnabled = labelDateTimePicker6.Checked;
- }
- private void labelTextBox4_TextBox_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyData == Keys.Enter)
- {
- Query();
- }
- }
- private void labelTextBox6_TextBox_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyData == Keys.Enter)
- {
- Query();
- }
- }
- private void labelTextBox7_TextBox_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyData == Keys.Enter)
- {
- Query();
- }
- }
- private void ultraExpandableGroupBox2_ExpandedStateChanged(object sender, EventArgs e)
- {
- if (!ultraExpandableGroupBox2.Expanded)
- {
- ultraExpandableGroupBox2.Dock = DockStyle.Bottom;
- splitContainer3.Panel1.Controls.Add(ultraExpandableGroupBox2);
- ultraExpandableGroupBox2.BringToFront();
- splitContainer3.Panel2Collapsed = true;
- }
- else
- {
- ultraExpandableGroupBox2.Dock = DockStyle.Fill;
- splitContainer3.Panel2.Controls.Add(ultraExpandableGroupBox2);
- splitContainer3.Panel2Collapsed = false;
- }
- }
- private void FoldQuery()
- {
- if (!this.toolMenu.Toolbars[0].Tools.Exists("FoldQuery")) return;
- panel2.Visible = !panel2.Visible;
- if (panel2.Visible)
- {
- this.toolMenu.Toolbars[0].Tools["FoldQuery"].SharedProps.Caption = "折叠查询区域";
- }
- else
- {
- this.toolMenu.Toolbars[0].Tools["FoldQuery"].SharedProps.Caption = "展开查询区域";
- }
- }
- private void RefreshZbs(string flag)
- {
- WaitingForm2 wf = new WaitingForm2("正在刷新,请稍后....");
- try
- {
- var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
- string processCode = "";
- if (chkRows.Count() == 0)
- {
- MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
- return;
- }
- else
- {
- processCode = chkRows.FirstOrDefault().GetValue("processCode");
- }
- string zbsFlag = "";//空表示不修改质保书打印方式
- foreach (var row in chkRows)
- {
- string judgeApplyCode = row.GetValue("jugdeApplyCode");
- string judgeStoveNo = row.GetValue("judgeStoveNo");
- string batchNo = row.GetValue("batchNo");
- CoreClientParam ccp = _d.Set("com.steering.pss.judge.Bll.BllCreateZbsInfo.Create", judgeApplyCode, judgeStoveNo, batchNo, zbsFlag, flag);
- if (ccp.ReturnInfo.ToString2() != "")
- {
- MessageUtil.ShowWarning("炉号:" + judgeStoveNo + "批号:" + batchNo + " " + ccp.ReturnInfo);
- return;
- }
- }
- }
- finally
- {
- wf.Close();
- }
- MessageUtil.ShowTips("刷新成功!");
- }
- private void RefreshCraft()
- {
- WaitingForm2 wf = new WaitingForm2("正在刷新,请稍后....");
- try
- {
- var chkRows = _zcJudgeApplyCtrl.UltraGrid1.Rows.Where(a => a.GetValue("Chk") == "True");
- string processCode = "";
- if (chkRows.Count() == 0)
- {
- MessageUtil.ShowWarning("请选择申请判定记录!", _zcJudgeApplyCtrl.UltraGrid1, _zcJudgeApplyCtrl.UltraGrid1.ActiveRow.Cells["Chk"]);
- return;
- }
- else
- {
- processCode = chkRows.FirstOrDefault().GetValue("processCode");
- }
- foreach (var row in chkRows)
- {
- string judgeApplyCode = row.GetValue("jugdeApplyCode");
- string judgeStoveNo = row.GetValue("judgeStoveNo");
- string batchNo = row.GetValue("batchNo");
- CoreClientParam ccp = _d.Set("com.steering.pss.judge.Bll.BllZcColligateJudge.refreshCraft", judgeApplyCode, judgeStoveNo, batchNo);
- if (ccp.ReturnInfo.ToString2() != "")
- {
- MessageUtil.ShowWarning("炉号:" + judgeStoveNo + "批号:" + batchNo + " " + ccp.ReturnInfo);
- return;
- }
- }
- }
- finally
- {
- wf.Close();
- }
- MessageUtil.ShowTips("获取成功!");
- }
- private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- ChoicePlineFrm frm = new ChoicePlineFrm(_dtPline, ultraTextEditor1.Tag.ToString2(), _d.Ob);
- if (frm.ShowDialog() == DialogResult.OK)
- {
- ultraTextEditor1.Text = frm.ChoicePlineName;
- ultraTextEditor1.Tag = frm.ChoicePlineCode;
- }
- }
- private void ultraTextEditor2_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- ChoicePlineFrm frm = new ChoicePlineFrm(_dtPline, ultraTextEditor2.Tag.ToString2(), _d.Ob);
- if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- ultraTextEditor2.Text = frm.ChoicePlineName;
- ultraTextEditor2.Tag = frm.ChoicePlineCode;
- }
- }
- }
- }
|