| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351 |
- 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.ZGMil.Entity;
- using CoreFS.CA06;
- 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.ZGMil.Signature
- {
- public partial class FrmQueryProcess : FrmBase
- {
- public FrmQueryProcess()
- {
- InitializeComponent();
- }
- private void FrmQueryProcess_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<PortMilBatchSampleResultEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PortMilBatchSampleResultEntity>(ultraGrid2.DisplayLayout.Bands[0]);
- InitCloum();
- }
- private void InitCloum()
- {
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("0", "合格");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("1", "热区剔除");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("2", "冷区剔除");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("3", "下线");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("4", "返线");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("5", "留样");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("6", "委外废");
- this.ultraGrid2.DisplayLayout.ValueLists[0].ValueListItems.Add("0", "合格");
- this.ultraGrid2.DisplayLayout.ValueLists[0].ValueListItems.Add("1", "热区剔除");
- this.ultraGrid2.DisplayLayout.ValueLists[0].ValueListItems.Add("2", "冷区剔除");
- this.ultraGrid2.DisplayLayout.ValueLists[0].ValueListItems.Add("3", "下线");
- this.ultraGrid2.DisplayLayout.ValueLists[0].ValueListItems.Add("4", "返线");
- this.ultraGrid2.DisplayLayout.ValueLists[0].ValueListItems.Add("5", "留样");
- this.ultraGrid2.DisplayLayout.ValueLists[0].ValueListItems.Add("6", "委外废");
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- QueryJugeNoProcess();
- break;
- case"updateStatus":
- updateStatus();
- break;
- case"updateStatusBack":
- updateStatusBack();
- break;
- case "updateLen":
- updateLen();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
-
- /// <summary>
- /// 剔除回退
- /// </summary>
- private void updateStatusBack()
- {
- this.ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null)
- {
- MessageUtil.ShowTips("请选择需要剔除回退的信息!");
- return;
- }
- if (uRow.Cells["Status"].Value.ToString() != "2" && uRow.Cells["OpProcess"].Value.ToString() != "交库")
- {
- MessageUtil.ShowTips("请选择剔除管并且是在交库点剔除的管进行剔除回退!");
- return;
- }
- PortMilBatchSampleResultEntity portMilBatchSlample = (PortMilBatchSampleResultEntity)uRow.ListObject;
- string portSlampleEntity = JSONFormat.Format(portMilBatchSlample);
-
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
- ccp.MethodName = "updateStatusBack";
- ccp.ServerParams = new object[] { portSlampleEntity};
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("回退成功!"))
- {
- QueryJugeNoProcess();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 剔除
- /// </summary>
- private void updateStatus()
- {
- this.ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if(uRow == null)
- {
- MessageUtil.ShowTips("请选择需要剔除的信息!");
- return;
- }
- if (uRow.Cells["Status"].Value.ToString() != "0")
- {
- MessageUtil.ShowTips("请选择合格管进行剔除!");
- return;
- }
- PortMilBatchSampleResultEntity portMilBatchSlample = (PortMilBatchSampleResultEntity)uRow.ListObject;
- string portSlampleEntity = JSONFormat.Format(portMilBatchSlample);
- string plnId = this.ultraGrid2.ActiveRow.Cells["PlanId"].Value.ToString();
- string jugeNo = this.ultraGrid2.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
- string staus = this.ultraGrid2.ActiveRow.Cells["Status"].Value.ToString();
- string colUser = this.UserInfo.GetUserName();
- string colGrop = this.UserInfo.GetUserGroup();
- string colOrder = this.UserInfo.GetUserOrder();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
- ccp.MethodName = "updateStatus";
- ccp.ServerParams = new object[] { portSlampleEntity, colUser, colGrop, colOrder };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("剔除成功!"))
- {
- QueryJugeNoProcess();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 修改长度
- /// </summary>
- private void updateLen()
- {
- this.ultraGrid1.UpdateData();
- int m = 0;
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请勾选需要修改长度的信息!");
- return;
- }
- ArrayList parm = new ArrayList();
- foreach (UltraGridRow uRow in checkMagRows)
- {
- if (uRow.Cells["InstoreFlag"].Text == "已入库")
- {
- m = m + 1;
- }
- PortMilBatchSampleResultEntity portMilBatchSlample = (PortMilBatchSampleResultEntity)uRow.ListObject;
- string portSlampleEntity = JSONFormat.Format(portMilBatchSlample);
- parm.Add(portSlampleEntity);
- }
- //if (m > 0)
- //{
- // MessageUtil.ShowTips("已入库的钢管不允许进行长度修改!");
- // return;
- //}
-
-
- //portMilBatchSlample.ActCount = decimal.Parse(this.TxtActCount.Text.Trim());
- //portMilBatchSlample.OrderLength = decimal.Parse(this.TxtActLen.Text.Trim());
-
- string plnId = this.ultraGrid2.ActiveRow.Cells["PlanId"].Value.ToString();
- string jugeNo = this.ultraGrid2.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
- string staus = this.ultraGrid2.ActiveRow.Cells["Status"].Value.ToString();
- string colUser = this.UserInfo.GetUserName();
- string colGrop = this.UserInfo.GetUserGroup();
- string colOrder = this.UserInfo.GetUserOrder();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.signature.FrmInOnlineStore";
- ccp.MethodName = "updateLen";
- ccp.ServerParams = new object[] { parm, colUser, colGrop, colOrder };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- QueryJugeNoProcess();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 查询炉信息
- /// </summary>
- private void QueryJugeNoProcess()
- {
- string jugeNo = "";
- string lotNo = "";
- NativeMethodNew na = new NativeMethodNew(this.ob);
- string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
- if (this.txtJugeNo.Text.Trim() == "")
- {
- MessageUtil.ShowTips("请输入炉号查询!");
- return;
- }
- else
- {
- jugeNo = this.txtJugeNo.Text.Trim();
- }
- if (this.chkLotNo.Checked && this.txtLotNo.Text.Trim() != "")
- {
- lotNo = this.txtLotNo.Text.Trim();
- }
- ArrayList list = new ArrayList();
- list.Add(jugeNo);
- list.Add(lotNo);
- list.Add(plinCode);
- this.PortMilBatchSampleResultEntitybindingSource.Clear();
- List<PortMilBatchSampleResultEntity> listSource = EntityHelper.GetData<PortMilBatchSampleResultEntity>(
- "com.steering.mes.signature.FrmInOnlineStore.doQueryJugeNoProcess", new object[] { list }, this.ob);
- PortMilBatchSampleResultEntity1bindingSource.DataSource = listSource;
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void QueryProcess(string planId,string jugeNo,string staus)
- {
-
- //NativeMethodNew na = new NativeMethodNew(this.ob);
- //string plinCode = na.GetPCode(this.UserInfo.GetDepartment());
- //if (this.chkJugeHeatNo.Checked && this.txtJugeNo.Text.Trim() != "")
- //{
- // jugeNo = this.txtJugeNo.Text.Trim();
- //}
- //else
- //{
- // MessageUtil.ShowTips("请输入炉号查询!");
- // return;
- //}
- //if (this.chkLotNo.Checked && this.txtLotNo.Text.Trim() != "")
- //{
- // lotNo = this.txtLotNo.Text.Trim();
- //}
- ArrayList list = new ArrayList();
- list.Add(planId);
- list.Add(jugeNo);
- list.Add(staus);
- this.PortMilBatchSampleResultEntitybindingSource.Clear();
- List<PortMilBatchSampleResultEntity> listSource = EntityHelper.GetData<PortMilBatchSampleResultEntity>(
- "com.steering.mes.signature.FrmInOnlineStore.doQueryProcess", new object[] { list }, this.ob);
- PortMilBatchSampleResultEntitybindingSource.DataSource = listSource;
- }
- private void chkJugeHeatNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtJugeNo.Enabled = this.chkJugeHeatNo.Checked;
- }
- private void chkLotNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtLotNo.Enabled = this.chkLotNo.Checked;
- }
- private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
- {
- QueryProcess(this.ultraGrid2.ActiveRow.Cells["PlanId"].Value.ToString(), this.ultraGrid2.ActiveRow.Cells["JudgeStoveNo"].Value.ToString(), this.ultraGrid2.ActiveRow.Cells["Status"].Value.ToString());
- }
- private void ultraGrid1_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
- {
- foreach (UltraGridRow uRow in ultraGrid1.Selected.Rows)
- {
- if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
- {
- uRow.Cells["CHK"].Value = true;
- }
- }
- }
- public static void setGridCopyActColumn(UltraGrid ugrid, KeyEventArgs e, params string[] strs)
- {
- if (e.Control && e.KeyCode == Keys.A)
- {
- if (ugrid != null && ugrid.ActiveRow != null)
- {
- UltraGridRow ugr = ugrid.ActiveRow;
- foreach (string colName in strs)
- {
- if (ugrid.ActiveCell.Column.Key == null)
- {
- return;
- }
- if (ugrid.ActiveCell.Column.Key.Equals(colName))
- {
- if (ugr.Cells[colName].Activation != Activation.AllowEdit)
- {
- return;
- }
- ugrid.UpdateData();
- ArrayList list = new ArrayList();
- IQueryable<UltraGridRow> checkRows = ugrid.Rows.AsQueryable().Where("CHK = 'True' ");
- if (checkRows.Count() == 0)
- {
- return;
- }
- foreach (UltraGridRow uRow in checkRows)
- {
- if (uRow != ugr && uRow.Cells[colName].Activation == Activation.AllowEdit)
- {
- uRow.Cells[colName].Value = ugr.Cells[colName].Value;
- }
- }
- }
- }
- }
- }
- }
- private void ultraGrid1_KeyUp(object sender, KeyEventArgs e)
- {
- setGridCopyActColumn(ultraGrid1, e, "OrderLength");
- }
- }
- }
|