| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400 |
- 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.Forms;
- using CoreFS.CA06;
- using CoreFS.SA06;
- using Infragistics.Win;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Data;
- using System.Drawing;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.Judge.Controls
- {
- public partial class QcmZgColligateJudgeApplyCtrl : UserControl
- {
- private OpeBase _ob;
- private JudgeType _judgeType;
- private Dal _d;
- private string _passInfo;
- private string _processCode = "";
- private CoreUserInfo _UserInfo;
- public QcmZgColligateJudgeApplyCtrl(Control container, OpeBase ob, JudgeType judgeType, string passInfo,
- string processCode, CoreUserInfo UserInfo)
- {
- InitializeComponent();
- this._ob = ob;
- _passInfo = passInfo;
- _processCode = processCode;
- _UserInfo = UserInfo;
- _judgeType = judgeType;
- container.Controls.Add(this);
- this.Dock = DockStyle.Fill;
- this.BringToFront();
- _d = new Dal(ob);
- ClsBaseInfo.FillComBaseInfo(ultraComboEditor1, "407401", ob, false);
- //判定结果只显示内控合格和不合格。 40740101内控合格 40740102内控不合格
- DataTable dt = (DataTable)ultraComboEditor1.DataSource;
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- if (dt.Rows[i]["BASECODE"].ToString() != "40740101"
- && dt.Rows[i]["BASECODE"].ToString() != "40740102")
- {
- dt.Rows[i].Delete();
- }
- }
- dt.AcceptChanges();
- ClsBaseInfo.SetComboItemHeight(ultraComboEditor1);
- ClsBaseInfo.FillComBaseInfo(ultraComboEditor2, "407402", ob, false);
- ClsBaseInfo.FillComBaseInfo(ultraComboEditor3, "407407", ob, false);
- ClsBaseInfo.FillComBaseInfo(ultraComboEditor4, "407404", ob, false);
- ClsBaseInfo.FillComBaseInfo(ultraComboEditor5, "407406", ob, false);
- ClsBaseInfo.FillComBaseInfo(ultraComboEditor6, "4100", ob, false);
- if ("admin".Equals(_UserInfo.GetUserName()) && "屈松山".Equals(_UserInfo.GetUserName()) && !"宋丹".Equals(_UserInfo.GetUserName()))
- {
- ultraComboEditor6.Visible = true;
- ultraComboEditor5.Visible = true;
- }
- else {
- ultraComboEditor6.Visible = false;
- ultraComboEditor5.Visible = false;
- }
- ValueList lkFlag = new ValueList();
- lkFlag.ValueListItems.Add("0", "正常");
- lkFlag.ValueListItems.Add("1", "利库");
- lkFlag.ValueListItems.Add("2", "利库");
- lkFlag.ValueListItems.Add("3", "销售成品利库");
- ultraGrid1.DisplayLayout.Bands[0].Columns["lkFlag"].ValueList = lkFlag;
-
- if(_passInfo.Equals("XS")){
- ultraGrid1.DisplayLayout.Bands[0].Columns["Chk"].Header.CheckBoxVisibility = HeaderCheckBoxVisibility.Always;
- }
- //屏蔽接箍相关字段
- if (processCode != "H")
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["ifOutDetect"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["ifOutCoat"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["ifOutImpress"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["ifOutBlast"].Hidden = true;
- }
- else
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["chemResultName"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["phyResultName"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["specResultName"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["faceResultName"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["detectResultName"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["waterResultName"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["processResultName"].Hidden = true;
- }
- if (processCode == "D")
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["exitTemp"].Hidden = false;
- }
- else
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["exitTemp"].Hidden = true;
- }
- if (processCode == "G")
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["chemResultName"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["phyResultName"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["specResultName"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["faceResultName"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["detectResultName"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["waterResultName"].Hidden = true;
- ultraGrid1.DisplayLayout.Bands[0].Columns["processResultName"].Hidden = true;
- }
- }
- public void QueryBcColligate(string lotNo, string judgeStoveNo, string[] judgeStates, string timeType, string judgeTimeB,
- string judgeTimeE, string[] plines, string judgeCondition, string orderMngNo)
- {
- string orderNo = "";
- string orderSeq = "";
- string[] mngOrderNos = orderMngNo.Split('/');
- if (mngOrderNos.Length >= 2)
- {
- orderNo = mngOrderNos[0];
- orderSeq = mngOrderNos[1];
- }
- else if (mngOrderNos.Length >= 1)
- {
- orderNo = mngOrderNos[0];
- }
- DataTable dt = _d.GetTableByXmlId("QcmZgJugdeApplyDAL.QueryBcColligate", lotNo, judgeStoveNo, judgeStates.Length, judgeStates,
- judgeTimeB, judgeTimeE, plines.Length, plines, _processCode, judgeCondition, orderNo, orderSeq, timeType,"");
- GridHelper.CopyDataToDatatable(dt, dataTable1, true);
- GridHelper.CopyDataToDatatable(dt, dataTable2, true);
- GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "memo", "judgeMemo");
- for (int i = dataTable1.Rows.Count-1; i >= 0; i--)
- {
- DataRow row = dataTable1.Rows[i];
- row["actCount"] = dataTable2.Compute("sum(actCount)", " JUDGESTOVENO ='" + row["JUDGESTOVENO"].ToString() + "' and JUGDEAPPLYCODE ='" + row["JUGDEAPPLYCODE"].ToString() + "' and BATCHNO='" + row["BATCHNO"].ToString() + "'");
- row["actTheoryWeight"] = dataTable2.Compute("sum(actTheoryWeight)", " JUDGESTOVENO ='" + row["JUDGESTOVENO"].ToString() + "' and JUGDEAPPLYCODE ='" + row["JUGDEAPPLYCODE"].ToString() + "' and BATCHNO='" + row["BATCHNO"].ToString() + "'");
- if (dataTable1.Select(" JUDGESTOVENO ='" + row["JUDGESTOVENO"].ToString() + "' and JUGDEAPPLYCODE ='" + row["JUGDEAPPLYCODE"].ToString() + "' and BATCHNO='" + row["BATCHNO"].ToString()+"'").Length > 1)
- {
- dataTable1.Rows.Remove(row);
- }
- }
- foreach (UltraGridRow row in ultraGrid1.Rows)
- {
- row.Cells["deliveryStateName"].Activation = Activation.ActivateOnly;
- }
- }
- public void QueryBcQuality(string lotNo, string judgeStoveNo, string[] judgeStates, string judgeTimeB, string judgeTimeE,
- string[] plines, string processCode, string judgeCondition, string orderMngNo, string timeType)
- {
- _processCode = processCode;
- string orderNo = "";
- string orderSeq = "";
- string[] mngOrderNos = orderMngNo.Split('/');
- if (mngOrderNos.Length == 1)
- {
- orderNo = mngOrderNos[0];
- }
- else if (mngOrderNos.Length == 2)
- {
- orderNo = mngOrderNos[0];
- orderSeq = mngOrderNos[1];
- }
- DataTable dt = _d.GetTableByXmlId("QcmZgJugdeApplyDAL.QueryBcQuality", lotNo, judgeStoveNo, judgeStates.Length, judgeStates,
- judgeTimeB, judgeTimeE, plines.Length, plines, processCode, judgeCondition, orderNo, orderSeq, timeType);
- GridHelper.CopyDataToDatatable(dt, dataTable1, true);
- GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "memo", "judgeMemo");
- }
- public void QueryBcUrgent(string lotNo, string judgeStoveNo, string judgeState, string judgeTimeB,
- string judgeTimeE, string[] plines, string processCode, string judgeCondition,
- string orderNo, string orderSeq, string uTimeType)
- {
- _processCode = processCode;
- DataTable dt = _d.GetTableByXmlId("QcmZgJugdeApplyDAL.QueryBcUrgent", lotNo, judgeStoveNo, judgeState,
- judgeTimeB, judgeTimeE, plines.Length, plines, processCode,
- judgeCondition, orderNo, orderSeq, uTimeType);
- GridHelper.CopyDataToDatatable(dt, dataTable1, true);
- GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "memo", "judgeMemo");
- foreach (UltraGridRow row in ultraGrid1.Rows)
- {
- row.Cells["deliveryStateName"].Activation = Activation.ActivateOnly;
- }
- }
- public void Clear()
- {
- dataTable1.Clear();
- }
- private void ultraTextEditor2_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 2000);
- if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- ultraGrid1.ActiveCell.Value = popupText.TextInfo.Trim();
- ultraGrid1.ActiveRow.Update();
- }
- }
- private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- String oldDeliveryState = ultraGrid1.ActiveCell.Value.ToString();
- e.Cell.Row.Update();
- if (e.Cell.Row.Cells["Chk"].Value.ToString().ToUpper() == "TRUE")
- {
- e.Cell.Row.Cells["deliveryStateName"].Activation = Activation.AllowEdit;
- }
- else
- {
- e.Cell.Row.Cells["deliveryStateName"].Activation = Activation.ActivateOnly;
- }
- if (e.Cell.Column.Key == "deliveryStateName")
- {
- updateDeliveryStateName(oldDeliveryState);
- }
- if (e.Cell.Column.Key == "Chk" && _passInfo == "")
- {
- UltraGridRow chkRow = e.Cell.Row;
- foreach (UltraGridRow row in ultraGrid1.Rows)
- {
- if (row.Cells["Chk"].Value.ToString() == "True" && row != chkRow)
- {
- row.Cells["Chk"].Value = "False";
- row.Update();
- }
- }
- }
- }
- private void updateDeliveryStateName(String oldDeliveryState)
- {
- ultraGrid1.ActiveCell.Value.ToString();
- var row = ultraGrid1.ActiveRow;
- string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString();
- string batchNo = row.Cells["batchNo"].Value.ToString();
- String[] parm = new String[] { judgeStoveNo, batchNo, _processCode, ultraGrid1.ActiveCell.Value.ToString(), oldDeliveryState, _judgeType.ToString(), _UserInfo.GetUserName(), "id", "5" };
- ServerHelper.SetData("com.steering.pss.judge.Bll.BllZcColligateJudge.updateDeliveryStateZG", new object[] { parm }, _ob);
- ultraGrid1.ActiveRow.Update();
- }
- private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- try
- {
- this.Cursor = Cursors.WaitCursor;
- var row = ultraGrid1.ActiveRow;
- if (row == null)
- {
- MessageUtil.ShowWarning("请选择一行记录!");
- return;
- }
- string judgeApplyCode = row.Cells["jugdeApplyCode"].Value.ToString();
- string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString();
- string batchNo = row.Cells["batchNo"].Value.ToString();
- string passType = "0";
- if (ultraGrid1.ActiveCell.Column.Key == "urgentAuditResult")
- {
- passType = "1";
- }
- //string passType = passInfo == "Qu"
- DataRow drPassApply = _d.GetRowByXmlId("JdgQcmBcPassApplyDAL.queryByBatchNo", judgeApplyCode, judgeStoveNo, batchNo, _processCode, passType);
- if (drPassApply == null ||
- drPassApply["type"].ToString() == "0" && drPassApply["auditResult"].ToString() == "")
- {
- MessageUtil.ShowWarning("没有不合格品评审单可查看!");
- return;
- }
- else
- {
- //if (drPassApply["type"].ToString() == "1")
- //{
- // MessageUtil.ShowWarning("紧急放行!");
- // return;
- //}
- }
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepZGRejectDisposalList.cpt" + "&JUDGE_STOVE_NO=" + judgeStoveNo
- + "&BATCH_NO=" + batchNo + "&JUGDE_APPLY_CODE=" + judgeApplyCode + "&PROCESS_CODE=" + _processCode + "&TYPE=" + passType;
- 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 ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
- {
- Color red = Color.FromArgb(255, 106, 106);
- if (e.Row.GetValue("phyResultCode") == "40740202")
- {
- e.Row.Cells["phyResultName"].Appearance.BackColor = red;
- }
- if (e.Row.GetValue("chemResultCode") == "40740102")
- {
- e.Row.Cells["chemResultName"].Appearance.BackColor = red;
- }
- if (e.Row.GetValue("resultCode") == "40740704")
- {
- e.Row.Cells["resultName"].Appearance.BackColor = red;
- }
- }
- private void ultraTextEditor3_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- if (e.Button.Key.Equals("bj")) {
- //if (!"admin".Equals(_UserInfo.GetUserName()) && !"屈松山".Equals(_UserInfo.GetUserName()))
- //{
- // throw new Exception("您没有该权限!");
- //}
- PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 2000);
- if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- var row = ultraGrid1.ActiveRow;
- string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString();
- string batchNo = row.Cells["batchNo"].Value.ToString();
- String[] parm = new String[] { judgeStoveNo, batchNo, _processCode, popupText.TextInfo.Trim(), ultraGrid1.ActiveCell.Value.ToString(), _judgeType.ToString(), _UserInfo.GetUserName(), "id" ,"2"};
- ServerHelper.SetData("com.steering.pss.judge.Bll.BllZcColligateJudge.updateLotNoGroup", new object[] { parm }, _ob);
- ultraGrid1.ActiveCell.Value = popupText.TextInfo.Trim();
- ultraGrid1.ActiveRow.Update();
- }
- return;
- }
- LotNoGroupInfoQueryFrm frm = new LotNoGroupInfoQueryFrm(ultraGrid1.GetActiveRowValue("lotNo"), _d.Ob);
- frm.ShowDialog();
- }
- private void ultraTextEditor4_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- //if (!"admin".Equals(_UserInfo.GetUserName()) && !"屈松山".Equals(_UserInfo.GetUserName()))
- //{
- // throw new Exception("您没有该权限!");
- //}
- PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 2000);
- if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- var row = ultraGrid1.ActiveRow;
- string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString();
- string batchNo = row.Cells["batchNo"].Value.ToString();
- String[] parm = new String[] { judgeStoveNo, batchNo, _processCode, popupText.TextInfo.Trim(), ultraGrid1.ActiveCell.Value.ToString(), _judgeType.ToString(), _UserInfo.GetUserName(), "id" ,"1"};
- ServerHelper.SetData("com.steering.pss.judge.Bll.BllZcColligateJudge.updateLotNo", new object[] { parm }, _ob);
- ultraGrid1.ActiveCell.Value = popupText.TextInfo.Trim();
- ultraGrid1.ActiveRow.Update();
- }
- }
- private void ultraTextCic_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- if (!"admin".Equals(_UserInfo.GetUserName()) && !"屈松山".Equals(_UserInfo.GetUserName()) && !"宋丹".Equals(_UserInfo.GetUserName()))
- {
- throw new Exception("您没有该权限!");
- }
- PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 2000);
- if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- var row = ultraGrid1.ActiveRow;
- string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString();
- string batchNo = row.Cells["batchNo"].Value.ToString();
- String[] parm = new String[] { judgeStoveNo, batchNo, _processCode, popupText.TextInfo.Trim(), ultraGrid1.ActiveCell.Value.ToString(), _judgeType.ToString(), _UserInfo.GetUserName(), "id", "3" };
- ServerHelper.SetData("com.steering.pss.judge.Bll.BllZcColligateJudge.updateCic", new object[] { parm }, _ob);
- ultraGrid1.ActiveCell.Value = popupText.TextInfo.Trim();
- ultraGrid1.ActiveRow.Update();
- }
- }
- private void ultraTextPic_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- if (!"admin".Equals(_UserInfo.GetUserName()) && !"屈松山".Equals(_UserInfo.GetUserName()) && !"宋丹".Equals(_UserInfo.GetUserName()))
- {
- throw new Exception("您没有该权限!");
- }
- PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 40);
- if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- var row = ultraGrid1.ActiveRow;
- string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString();
- string batchNo = row.Cells["batchNo"].Value.ToString();
- String[] parm = new String[] { judgeStoveNo, batchNo, _processCode, popupText.TextInfo.Trim(), ultraGrid1.ActiveCell.Value.ToString(), _judgeType.ToString(), _UserInfo.GetUserName(), "id", "4" };
- ServerHelper.SetData("com.steering.pss.judge.Bll.BllZcColligateJudge.updatePic", new object[] { parm }, _ob);
- ultraGrid1.ActiveCell.Value = popupText.TextInfo.Trim();
- ultraGrid1.ActiveRow.Update();
- }
- }
- }
- }
|