| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905 |
- using com.steering.mes.mcp.entity;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.CollarMaterial;
- using Core.StlMes.Client.Mcp.Common;
- using Core.StlMes.Client.Mcp.Control;
- using Core.StlMes.Client.Mcp.Entity;
- using CoreFS.CA06;
- using Infragistics.Win;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.Mcp.Coupling
- {
- public partial class FrmCouplingAppl : FrmBase
- {
- private string[] arr = null;
- private string departm = "";//获取部门ID
- private string[] plineCode = null;//获取产线代码
- private string cutGx = "";//交库工序
- public FrmCouplingAppl()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
- private void FrmCouplingAppl_Load(object sender, EventArgs e)
- {
- DateTime now = DateTime.Now;
- DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
- DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
- this.StartTime.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
- this.EndTime.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
- EntityHelper.ShowGridCaption<CouplingMatMEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<CouplingMatMEntity1>(ultraGrid2.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<Core.StlMes.Client.Mcp.Entity.QcmZgJugdeApplyEntity>(ultraGrid3.DisplayLayout.Bands[0]);
- ultraGrid2.DisplayLayout.Bands[0].Columns["isFlag"].Header.Caption = "前工序是否紧急放行";
- this.IsLoadUserView = true;
- arr = this.ValidDataPurviewIds;
- //departm = UserInfo.GetDeptid();
- //plineCode = McpBaseHelper.GetPCodePline(departm, this.ob);
- ////获取交库工序
- //DataTable dt3 = ServerHelper.GetData("com.steering.mes.mcp.common.PlanService.getQueryGX", new object[] { "700313" }, this.ob);
- //if (dt3.Rows.Count > 0)
- //{
- // cutGx = dt3.Rows[0]["BASECODE"].ToString();
- //}
- //PipeManageClass.BindComBaseInfo(cmbStroage, this.ob);
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "DoQuery":
- if (ultraTabControl1.SelectedTab.Index == 0)
- {
- QuerySinglePlan();
- }
- else if (ultraTabControl1.SelectedTab.Index == 1)
- {
- QueryZgJugdeApply();
- }
- break;
- //case "MatQuery":
- // DoMatQuery();//材料查询
- // break;
- case "DoDecision":
- DoDecision();//申请判定
- break;
- case "cancelDoDecision":
- cancelDoDecision();//撤销申请判定
- break;
- case "UpdateProWgt":
- updateProWgt();
- break;
- case "DoUpdate":
- DoUpdate();//库位修改
- break;
- case "DoDelete":
- DoDelete();
- break;
- case "DoBeside"://结炉
- DoBeside();
- break;
- case "UndoBeside"://撤销结炉
- UndoBeside();
- break;
- case "DoClose":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 查询送判数据
- /// </summary>
- private void QueryZgJugdeApply()
- {
- string Woid = "";
- string jugeNo = "";
- string startTim = "";
- string endTim = "";
- ArrayList list = new ArrayList();
- if (this.chkwoId.Checked && this.txtWoId.Text.Trim() != "")
- {
- Woid = this.txtWoId.Text.Trim();
- }
- if (this.chkJuNo.Checked && this.txtJudgeStoveNO.Text.Trim() != "")
- {
- jugeNo = this.txtJudgeStoveNO.Text.Trim();
- }
- if (chkTim2.Checked)
- {
- if (DateTime.Parse(this.StartTime.Value.ToString()) > DateTime.Parse(EndTime.Value.ToString()))
- {
- MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
- return;
- }
- else
- {
- startTim = this.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- endTim = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- }
- }
- list.Add(startTim);
- list.Add(endTim);
- list.Add(jugeNo);
- list.Add(this.ultraOptionSet1.CheckedItem.DataValue.ToString());
- list.Add(Woid);
- QcmZgJudgebindingSource1.Clear();
- List<Core.StlMes.Client.Mcp.Entity.QcmZgJugdeApplyEntity> listSource = EntityHelper.GetData<Core.StlMes.Client.Mcp.Entity.QcmZgJugdeApplyEntity>(
- "com.steering.mes.mcp.coup.FrmCouplingAppl.QueryZgJugdeApply", new object[] { list, arr }, this.ob);
- QcmZgJudgebindingSource1.DataSource = listSource;
- // WriteTextToGrid();
- }
- /// <summary>
- /// 回报过磅重量
- /// </summary>
- private void updateProWgt()
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid2.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null)
- {
- MessageUtil.ShowTips("请选择需要回报过磅重量的炉信息!");
- return;
- }
- if (!StringUtil.IsDouble(uRow.Cells["ProWt"].Value.ToString3()))
- {
- MessageUtil.ShowTips("过磅重量应输入数字!");
- return;
- }
- if (Double.Parse(uRow.Cells["ProWt"].Value.ToString3()) <= 0)
- {
- MessageUtil.ShowTips("请输入正确的过磅重量!");
- return;
- }
- ArrayList list = new ArrayList();
- list.Add(uRow.Cells["JudgeStoveNo"].Value.ToString());
- list.Add(uRow.Cells["ProWt"].Value.ToString3());
- list.Add(uRow.Cells["BelongCode"].Value.ToString());
- ArrayList ArrList = new ArrayList();
- IQueryable<UltraGridRow> checkMags = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMags.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要回报过磅重量的炉信息!");
- }
- else
- {
- foreach (UltraGridRow urg in checkMags)
- {
- ArrayList arrList = new ArrayList();
- if (!StringUtil.IsDouble(urg.Cells["ProWt"].Value.ToString3()))
- {
- MessageUtil.ShowTips("过磅重量应输入数字!");
- return;
- }
- if (Double.Parse(urg.Cells["ProWt"].Value.ToString3()) < 0)
- {
- MessageUtil.ShowTips("请输入正确的过磅重量!");
- return;
- }
- arrList.Add(urg.Cells["JudgeStoveNo"].Value.ToString());
- arrList.Add(urg.Cells["ProWt"].Value.ToString3());
- arrList.Add(urg.Cells["BelongCode"].Value.ToString());
- arrList.Add(urg.Cells["BatchNo"].Value.ToString());
- arrList.Add(urg.Cells["JgOrderno"].Value.ToString());
- ArrList.Add(arrList);
- }
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.coup.FrmCouplingAppl";
- ccp.MethodName = "updateProWgt";
- ccp.ServerParams = new object[] { list, ArrList };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("回报成功!"))
- {
- QuerySinglePlan();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 撤销申请判定
- /// </summary>
- private void cancelDoDecision()
- {
- this.ultraGrid2.UpdateData();
- UltraGridRow uRow = this.ultraGrid2.ActiveRow;
- if (uRow == null) return;
- string plinCode = uRow.Cells["PlineCode"].Text.ToString();
- IQueryable<UltraGridRow> checkMags = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMags.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要撤销送判的炉批信息!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMags)
- {
- string valueFlag = "";
- string instock = "";
- string processDesc = "";
- DataTable dtPln = ServerHelper.GetData("com.steering.mes.mcp.coup.FrmCouplingAppl.SelectValueFlag",
- new object[] { row.Cells["DeterNo"].Value.ToString(), row.Cells["DeterNoSeq"].Value.ToString(),
- row.Cells["JudgeStoveNo"].Value.ToString(),row.Cells["BatchNo"].Value.ToString(),
- plinCode },
- this.ob);
- if (dtPln.Rows.Count > 0)
- {
- valueFlag = dtPln.Rows[0]["VALIDFLAG"].ToString();
- instock = dtPln.Rows[0]["INSTOCK_FLAG"].ToString();
- }
- if (!valueFlag.Equals("00") && !valueFlag.Equals("10"))
- {
- MessageUtil.ShowTips("该炉批已不是初始状态/撤判状态,不允许撤销申请判定!");
- return;
- }
- if (instock.Equals("1"))
- {
- MessageUtil.ShowTips("质保部已经接收不允许撤销!");
- return;
- }
- CouplingMatMEntity1 matBcEntity = (CouplingMatMEntity1)row.ListObject;
- if (matBcEntity.DeterNo.Equals(""))
- {
- MessageUtil.ShowTips("炉批未送判,不允许撤销申请判定!");
- return;
- }
- string matEntity = JSONFormat.Format(matBcEntity);
- parmList.Add(matEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.coup.FrmCouplingAppl";
- ccp.MethodName = "cancelDoDecision";
- ccp.ServerParams = new object[] { parmList };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销成功!"))
- {
- string applyCode = ccp.ReturnObject.ToString();
- QuerySinglePlan();
- //this.txtMemo.Text = "";
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 库位修改
- /// </summary>
- private void DoUpdate()
- {
- //ultraGrid3.UpdateData();
- //UltraGridRow urg = ultraGrid3.ActiveRow;
- //if (urg == null) { MessageUtil.ShowTips("无库存信息!"); return; }
- //int addCount = 0;
- //ArrayList list = new ArrayList();
- //string date = DateTime.Now.ToString();
- //foreach (UltraGridRow uRow in ultraGrid3.Rows)
- //{
- // if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- // {
- // addCount += 1;
- // if (uRow.Cells["KEP_NO"].Text.Trim() == "")
- // {
- // MessageUtil.ShowTips("框号不能为空!");
- // return;
- // }
- // if (uRow.Cells["STORAGE_NO"].Text.Trim() == "")
- // {
- // MessageUtil.ShowTips("库位不能空!");
- // return;
- // }
- // ArrayList list1 = new ArrayList();
- // list1.Add(uRow.Cells["MAT_NO"].Value.ToString());
- // list1.Add(uRow.Cells["ZY_PLAN_ID"].Value.ToString());
- // list1.Add(uRow.Cells["RESULT_NO"].Value.ToString());
- // list1.Add(uRow.Cells["KEP_NO"].Value.ToString());
- // list1.Add(uRow.Cells["STORAGE_NO"].Value.ToString());
- // list1.Add(this.UserInfo.GetUserName());
- // list1.Add(date);
- // list.Add(list1);
- // }
- //}
- // if (addCount == 0) { MessageUtil.ShowTips("请选择接箍库存信息!"); return; }
- if (MessageUtil.ShowYesNoAndQuestion("是否修改位置?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- try
- {
- this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
- if (Constant.WaitingForm == null)
- {
- Constant.WaitingForm = new WaitingForm();
- }
- Constant.WaitingForm.ShowToUser = true;
- Constant.WaitingForm.Show();
- Constant.WaitingForm.Update();
- ccp.ServerName = "com.steering.mes.mcp.coup.FrmInLibrary";
- ccp.MethodName = "updateLibraryResult";
- // ccp.ServerParams = new object[] { list};
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- catch (Exception ex)
- {
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("修改位置成功!"))
- {
- QuerySinglePlan();
- }
- }
- /// <summary>
- /// 材料查询
- /// </summary>
- private void DoMatQuery()
- {
- string woId = "";
- string judgeStoveNo = "";
- string plnNo = "";
- #region 条件
-
- if (chkwoId.Checked && string.IsNullOrEmpty(txtWoId.Text.Trim()))
- {
- MessageUtil.ShowTips("请输入工单号!");
- return;
- }
- else
- {
- woId = txtWoId.Text.ToString().Trim();
- }
- //if (chkPlnNo.Checked && string.IsNullOrEmpty(txtPlnNo.Text.Trim()))
- //{
- // MessageUtil.ShowTips("请输入炉次计划号!");
- // return;
- //}
- //else
- //{
- // plnNo = txtPlnNo.Text.ToString().Trim();
- //}
- if (chkJuNo.Checked && string.IsNullOrEmpty(txtJudgeStoveNO.Text.Trim()))
- {
- MessageUtil.ShowTips("请输入炉号!");
- return;
- }
- else
- {
- judgeStoveNo = txtJudgeStoveNO.Text.ToString().Trim();
- }
- #endregion
- ArrayList list = new ArrayList();
- list.Add(woId);
- list.Add(plnNo);
- list.Add(judgeStoveNo);
- DataTable dt = ServerHelper.GetData("com.steering.mes.mcp.coup.FrmInLibrary.doQueryMatNo", new object[] { list, plineCode[0].ToString() }, this.ob);
- // GridHelper.CopyDataToDatatable(ref dt, ref dateMat, true);
- }
- private void QuerySinglePlan()
- {
- string Woid = "";
- string jugeNo = "";
- string startTim = "";
- string endTim = "";
- ArrayList list = new ArrayList();
- if (this.chkwoId.Checked && this.txtWoId.Text.Trim() != "")
- {
- Woid = this.txtWoId.Text.Trim();
- }
- if (this.chkJuNo.Checked && this.txtJudgeStoveNO.Text.Trim() != "")
- {
- jugeNo = this.txtJudgeStoveNO.Text.Trim();
- }
- if (chkTim2.Checked)
- {
- if (DateTime.Parse(this.StartTime.Value.ToString()) > DateTime.Parse(EndTime.Value.ToString()))
- {
- MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
- return;
- }
- else
- {
- startTim = this.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- endTim = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- }
- }
- list.Add(startTim);
- list.Add(endTim);
- list.Add(jugeNo);
- list.Add(this.ultraOptionSet1.CheckedItem.DataValue.ToString());
- list.Add(Woid);
- CouplingMatMbindingSource.Clear();
- List<CouplingMatMEntity> listSource = EntityHelper.GetData<CouplingMatMEntity>(
- "com.steering.mes.mcp.coup.FrmCouplingAppl.doQueryMat", new object[] { list, arr }, this.ob);
- CouplingMatMbindingSource.DataSource = listSource;
- }
- /// <summary>
- /// 编辑区Gird
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- string woid = "";
- string judgeNo = "";
- UltraGridRow urg = ultraGrid1.ActiveRow;
- if (urg == null)
- {
- return;
- }
- else
- {
- woid = urg.Cells["WoId"].Value.ToString();
- judgeNo = urg.Cells["JudgeStoveNo"].Value.ToString();
- }
- ultraGrid1.UpdateData();
- if (urg.Cells["ProWt"].Text != "")
- {
- string count = "";
- DataTable dtHtt = ServerHelper.GetData("com.steering.mes.mcp.coup.FrmCouplingAppl.doQueryJudgeBathCount",
- new object[] { woid, judgeNo, this.ultraOptionSet1.CheckedItem.DataValue.ToString() },
- this.ob); //热处理类型
- if (dtHtt.Rows.Count > 0)
- {
- count =
- (Convert.ToDouble(urg.Cells["ProWt"].Text.ToString()) /
- Convert.ToDouble(urg.Cells["ProNum"].Text.ToString())).ToString("f6");
- }
- foreach (UltraGridRow row in this.ultraGrid2.Rows)
- {
- // row.Cells["PonderGrossWt"].Value = (Convert.ToDouble(count) * Convert.ToInt32(dtHtt.Rows[i]["COUNT"].ToString())).ToString("f3");
- row.Cells["ProWt"].Value =
- (Convert.ToDouble(count) * Convert.ToInt32(row.Cells["ProNum"].Text.ToString())).ToString("f3");
- row.Cells["CHK"].Value = "True";
- row.Update();
- }
- }
- }
- private void DoDecision()
- {
- this.ultraGrid2.UpdateData();
- UltraGridRow uRow = this.ultraGrid2.ActiveRow;
- UltraGridRow sRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) return;
- if (sRow == null) return;
- string PlinCode = sRow.Cells["PlineCode"].Value.ToString();
- string judgeNo = sRow.Cells["JudgeStoveNo"].Value.ToString();
- string batchNo = uRow.Cells["BatchNo"].Value.ToString();
- IQueryable<UltraGridRow> checkMags = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMags.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要送判的炉批信息!");
- return;
- }
-
- //UltraGridRow uug = this.ultraGrid2.ActiveRow;
- //if (uug != null)
- //{
- // foreach (UltraGridRow row in checkMags)
- // {
- // if(row.Cells["IsFlag"].Text == "是")
- // {
- // MessageUtil.ShowTips("前工序有紧急放行但未判定或判定不合格,不允许申请判定!");
- // return;
- // }
- // }
-
- //}
- //if (sRow.Cells["Target"].Text.Equals("A"))
- //{
- // if (double.Parse(sRow.Cells["PonderGrossWt"].Text.ToString3()) <= 0)
- // {
- // MessageUtil.ShowTips("A字头必须回报过磅重量!");
- // return;
- // }
- //}
- //if (PlinCode.Equals("C018"))
- //{
- // DataTable dtwt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryWt",
- // new object[] { sRow.Cells["JudgeStoveNo"].Value.ToString(), sRow.Cells["ActCount"].Value.ToString() },
- // this.ob);
- // if (dtwt.Rows.Count > 0)
- // {
- // if (dtwt.Rows[0]["PONDER_GROSS_WT"].Equals("0"))
- // {
- // MessageUtil.ShowTips("必须回报过磅重量!");
- // return;
- // }
- // }
- //}
- //else
- //{
- // if (sRow.Cells["Target"].Text.Equals("A"))
- // {
- // DataTable dtwt = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmVrpApplyNew.getQueryWt",
- // new object[] { sRow.Cells["JudgeStoveNo"].Value.ToString(), sRow.Cells["ActCount"].Value.ToString() },
- // this.ob);
- // if (dtwt.Rows.Count > 0)
- // {
- // //if (dtwt.Rows[0]["PONDER_GROSS_WT"].Equals("0"))
- // //{
- // // MessageUtil.ShowTips("必须回报过磅重量!");
- // // return;
- // //}
- // }
- // }
- //}
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMags)
- {
- CouplingMatMEntity1 matBcEntity = (CouplingMatMEntity1)row.ListObject;
- if (!matBcEntity.DeterNo.Equals(""))
- {
- MessageUtil.ShowTips("炉批已进行送判,不允许重复送判!");
- return;
- }
- string matEntity = JSONFormat.Format(matBcEntity);
- parmList.Add(matEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.coup.FrmCouplingAppl";
- ccp.MethodName = "doDecision";
- ccp.ServerParams = new object[] { parmList,UserInfo.GetUserName() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("申请判定成功!"))
- {
- QuerySinglePlan();
- MessageUtil.ShowTips("申请判定成功!");
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// ultraGrid2 触发事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (row == null)
- {
- //List<CouplingComInfoEntity> listSource = new List<Entity.CouplingComInfoEntity>();
- //CouplingComInfoEntity.DataSource = listSource;
- //GridHelper.RefreshAndAutoSize(ultraGrid3);
- }
- else
- {
- //List<CouplingComInfoEntity> listSource = EntityHelper.GetData<CouplingComInfoEntity>
- // ("com.steering.mes.mcp.coup.FrmInLibrary.doQueryInfoResult", new object[] { row.Cells["ZY_PLAN_ID"].Text.ToString(), row.Cells["WO_ID"].Text.ToString() }, this.ob);
- //CouplingComInfoEntity.DataSource = listSource;
- //GridHelper.RefreshAndAutoSize(ultraGrid3);
- }
- }
- /// <summary>
- /// 删除交库实绩
- /// </summary>
- private void DoDelete()
- {
- //ultraGrid3.UpdateData();
- //UltraGridRow urg = ultraGrid3.ActiveRow;
- //if (urg == null) { MessageUtil.ShowTips("无交库信息!"); return; }
- //int addCount = 0;
- //ArrayList list = new ArrayList();
- //foreach (UltraGridRow uRow in ultraGrid3.Rows)
- //{
- // if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- // {
- // addCount += 1;
- // ArrayList list1 = new ArrayList();
- // list1.Add(uRow.Cells["DEAL_ORDE"].Value.ToString());
- // list1.Add(uRow.Cells["WO_ID"].Value.ToString());
- // list1.Add(uRow.Cells["ZY_PLAN_ID"].Value.ToString());
- // list1.Add(uRow.Cells["JUDGE_STOVE_NO"].Value.ToString());
- // list1.Add(uRow.Cells["BATCH_NO"].Value.ToString());
- // list1.Add(this.UserInfo.GetUserName());
- // list1.Add(this.UserInfo.GetUserOrder());
- // list1.Add(this.UserInfo.GetUserGroup());
- // list1.Add(cutGx);
- // list1.Add(uRow.Cells["PIECES"].Value.ToString());
- // list1.Add(uRow.Cells["RESULT_NO"].Value.ToString());
- // list.Add(list1);
- // }
- //}
- //if (addCount == 0) { MessageUtil.ShowTips("请选择要删除的交库信息!"); return; }
- //if (MessageUtil.ShowYesNoAndQuestion("是否删除交库信息?") == DialogResult.No)
- //{
- // return;
- //}
- CoreClientParam ccp = new CoreClientParam();
- try
- {
- this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
- if (Constant.WaitingForm == null)
- {
- Constant.WaitingForm = new WaitingForm();
- }
- Constant.WaitingForm.ShowToUser = true;
- Constant.WaitingForm.Show();
- Constant.WaitingForm.Update();
- ccp.ServerName = "com.steering.mes.mcp.coup.FrmInLibrary";
- ccp.MethodName = "deleteLibraryResult";
- // ccp.ServerParams = new object[] { list };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- catch (Exception ex)
- {
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("撤销交库成功!"))
- {
- QuerySinglePlan();
- }
- }
- /// <summary>
- /// 结炉
- /// </summary>
- private void DoBeside()
- {
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null)
- {
- MessageUtil.ShowTips("请选择需要结炉的工单号!");
- return;
- }
- string zYgNo = uRow.Cells["ZY_PLAN_ID"].Value.ToString();
- string woId = uRow.Cells["WO_ID"].Value.ToString();
- ArrayList list = new ArrayList();
- list.Add(zYgNo);
- list.Add(woId);
- list.Add(cutGx);
- if (MessageUtil.ShowYesNoAndQuestion("是否结炉?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.coup.FrmInLibrary";
- ccp.MethodName = "doBeside";
- ccp.ServerParams = new object[] { list };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("结炉成功!"))
- {
- QuerySinglePlan();
- }
- }
- }
- /// <summary>
- /// 撤销结炉
- /// </summary>
- private void UndoBeside()
- {
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null)
- {
- MessageUtil.ShowTips("请选择需要撤销结炉的工单号!");
- return;
- }
- string zYgNo = uRow.Cells["ZY_PLAN_ID"].Value.ToString();
- string woId = uRow.Cells["WO_ID"].Value.ToString();
- ArrayList list = new ArrayList();
- list.Add(zYgNo);
- list.Add(woId);
- list.Add(cutGx);
- if (MessageUtil.ShowYesNoAndQuestion("是否撤销结炉?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.coup.FrmInLibrary";
- ccp.MethodName = "undoBeside";
- ccp.ServerParams = new object[] { list };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("撤销结炉成功!"))
- {
- QuerySinglePlan();
- }
- }
- }
- private void chkStarts_CheckedChanged(object sender, EventArgs e)
- {
- if (chkJuNo.Checked) { txtJudgeStoveNO.Enabled = true; } else { txtJudgeStoveNO.Enabled = false; }
- // if (chkPlnNo.Checked) { txtPlnNo.Enabled = true; } else { txtPlnNo.Enabled = false; }
- if (chkwoId.Checked) { txtWoId.Enabled = true; } else { txtWoId.Enabled = false; }
- }
- private void FrmInLibrary_Shown(object sender, EventArgs e)
- {
- if (toolMenu.Toolbars[0].Tools.Exists("DoQuery")) { toolMenu.Toolbars[0].Tools["DoQuery"].InstanceProps.Visible = DefaultableBoolean.True; }
- if (toolMenu.Toolbars[0].Tools.Exists("MatQuery")) { toolMenu.Toolbars[0].Tools["MatQuery"].InstanceProps.Visible = DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("DoSave")) { toolMenu.Toolbars[0].Tools["DoSave"].InstanceProps.Visible = DefaultableBoolean.True; }
- if (toolMenu.Toolbars[0].Tools.Exists("DoUpdate")) { toolMenu.Toolbars[0].Tools["DoUpdate"].InstanceProps.Visible = DefaultableBoolean.False; }
- if (toolMenu.Toolbars[0].Tools.Exists("DoDelete")) { toolMenu.Toolbars[0].Tools["DoDelete"].InstanceProps.Visible = DefaultableBoolean.True; }
- if (toolMenu.Toolbars[0].Tools.Exists("DoBeside")) { toolMenu.Toolbars[0].Tools["DoBeside"].InstanceProps.Visible = DefaultableBoolean.True; }
- if (toolMenu.Toolbars[0].Tools.Exists("UndoBeside")) { toolMenu.Toolbars[0].Tools["UndoBeside"].InstanceProps.Visible = DefaultableBoolean.True; }
- }
- private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
- {
- if (toolMenu == null) return;
- if (ultraTabControl1.SelectedTab.Index == 0)
- {
- chkTim2.Text = "入库日期";
- }
- else if (ultraTabControl1.SelectedTab.Index == 1)
- {
- chkTim2.Text = "送判日期";
- }
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null)
- {
- return;
- }
- doQueryJudgeBath(uRow.Cells["WoId"].Text, uRow.Cells["JudgeStoveNo"].Text, uRow.Cells["DeterNo"].Text);
-
- }
- /// <summary>
- /// 查询炉批信息
- /// </summary>
- private void doQueryJudgeBath(string woid, string judgeNo, string jugdeApplyCode)
- {
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null)
- {
- return;
- }
- List<CouplingMatMEntity1> listSource = EntityHelper.GetData<CouplingMatMEntity1>(
- "com.steering.mes.mcp.coup.FrmCouplingAppl.doQueryJudgeBath", new object[] { woid, judgeNo, jugdeApplyCode, this.ultraOptionSet1.CheckedItem.DataValue.ToString() }, this.ob);
- CouplingMatMbindingSource1.DataSource = listSource;
- foreach (UltraGridRow row in this.ultraGrid2.Rows)
- {
- row.Cells["CHK"].Value = "True";
- row.Update();
- }
- List<Core.StlMes.Client.Mcp.Entity.QcmZgJugdeApplyEntity> listSource1 = EntityHelper.GetData<Core.StlMes.Client.Mcp.Entity.QcmZgJugdeApplyEntity>(
- "com.steering.mes.mcp.coup.FrmCouplingAppl.doQueryQcmZgApplyData", new object[] { uRow.Cells["JudgeStoveNo"].Text }, this.ob);
- if(listSource1.Count>0)
- {
- ultraGrid2.DisplayLayout.Bands[0].Columns["isFlag"].Header.Caption = "前工序是否紧急放行";
- foreach (UltraGridRow row in this.ultraGrid2.Rows)
- {
- row.Cells["isFlag"].Value = "是";
- }
- }
- else
- {
- ultraGrid2.DisplayLayout.Bands[0].Columns["isFlag"].Header.Caption = "前工序是否紧急放行";
- foreach (UltraGridRow row in this.ultraGrid2.Rows)
- {
- row.Cells["isFlag"].Value = "否";
- }
- }
- }
- private void ultraGrid3_ClickCellButton(object sender, CellEventArgs e)
- {
- this.ultraGrid3.UpdateData();
- if (e.Cell.Column.Key == "JugdeApplyCode")
- {
- string jugdeApplyCode = ultraGrid3.ActiveRow.Cells["JugdeApplyCode"].Value.ToString();
- string judgeStoveNo = ultraGrid3.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
- string ordenNo = ultraGrid3.ActiveRow.Cells["ProOrderNo"].Value.ToString();
- FrmQcmAddAsk orderZg = new FrmQcmAddAsk(jugdeApplyCode, judgeStoveNo, ordenNo, this.ob);
- orderZg.ShowDialog();
- }
- }
- private void ultraGrid1_ClickCellButton(object sender, CellEventArgs e)
- {
- this.ultraGrid1.UpdateData();
- IQueryable<UltraGridRow> checkMags = this.ultraGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
- foreach (UltraGridRow row in checkMags)
- {
- CouplingMatMEntity1 matBcEntity = (CouplingMatMEntity1)row.ListObject;
- if (!matBcEntity.DeterNo.Equals(""))
- {
- MessageUtil.ShowTips("炉批已进行送判,不允许修改重量!");
- return;
- }
- }
- if (e.Cell.Column.Key == "ProWt")
- {
- string jugdeApplyCode = ultraGrid1.ActiveRow.Cells["CodeJg"].Value.ToString();
- string woId = ultraGrid1.ActiveRow.Cells["WoId"].Value.ToString();
- string piece = ultraGrid1.ActiveRow.Cells["ProNum"].Value.ToString();
- FrmQcmJgWt orderZg = new FrmQcmJgWt(jugdeApplyCode,woId, this.ob);
- orderZg.ShowDialog();
- ComMscJgEntity slmEntity = orderZg.SlmEntity;
- if (slmEntity==null)
- {
- return;
- }
- QuerySinglePlan();
- //e.Cell.Row.Cells["ProWt"].Value = Convert.ToDecimal((Convert.ToDouble(slmEntity.WeightJg)/1000) * int.Parse(piece));
- ultraGrid1_CellChange(null, null);
- }
- }
- }
- }
|