| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413 |
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Lims.Data.PipeAndOutdec.封装类.实体类;
- 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.Lims.Data.PipeAndOutdec
- {
- public partial class FrmAddPhy : FrmBase
- {
- private OpeBase _ob;
- private string _checkNo = "";
- public FrmAddPhy(OpeBase ob, string checkNo)
- {
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- InitializeComponent();
- _ob = ob;
- _checkNo = checkNo;
- }
- private void FrmAddPhy_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<PipeCheckconsignBaseinfoEntity>(this.ultraGrid5.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PipeCheckconsignDetailEntity>(this.ultraGrid1.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<PipeCheckconsignPhydetailEntity>(this.ultraGrid2.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<CraftOrdDesignStdPicEntity>(this.ultraGrid3.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<CraftOrdDesignStdPicEntity>(this.ultraGrid4.DisplayLayout.Bands[0]);
- doQuery();
- }
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key)
- {
- case"AddPhyMax":
- addPhyMax();
- break;
- case"DeletePhyMax":
- deletePhyMax();
- break;
- case "Add":
- addPhy();
- break;
- case"Delete":
- detePhy();
- break;
- case"UpdateRcl":
- updateRcl();
- break;
- case "UpdateTsRemark":
- updateTsRemark();
- break;
- case "Close":
- CloseForm();
- break;
- }
- }
-
-
- /// <summary>
- /// 加载数据
- /// </summary>
- private void doQuery()
- {
- List<PipeCheckconsignBaseinfoEntity> listSource = EntityHelper.GetData<PipeCheckconsignBaseinfoEntity>("com.steering.lims.data.pipe.FrmCheckConsignQuery.doQueryCheckNo", new object[] { _checkNo }, _ob);
- pipeCheckconsignBaseinfoEntityBindingSource.DataSource = listSource;
- }
- /// <summary>
- /// 新增试样组
- /// </summary>
- private void addPhyMax()
- {
- this.ultraGrid3.UpdateData();
- this.ultraGrid1.UpdateData();
- UltraGridRow mRow = this.ultraGrid5.ActiveRow;
- if (mRow == null) return;
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) return;
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid3.Rows.AsQueryable().Where(a => a.GetValue("CHK") == "True");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择新增的试样组!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMagRows)
- {
- CraftOrdDesignStdPicEntity craftPic = (CraftOrdDesignStdPicEntity)row.ListObject;
- string craftPicEntity = JSONFormat.Format(craftPic);
- parmList.Add(craftPicEntity);
- }
- PipeCheckconsignBaseinfoEntity pipeBase = (PipeCheckconsignBaseinfoEntity)mRow.ListObject;
- string pipeBaseEntity = JSONFormat.Format(pipeBase);
- PipeCheckconsignDetailEntity pipeDetailTity = (PipeCheckconsignDetailEntity)uRow.ListObject;
- string pipeDetailEntity = JSONFormat.Format(pipeDetailTity);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.lims.data.pipe.FrmCheckConsignQuery";
- ccp.MethodName = "addPhyMax";
- ccp.ServerParams = new object[] {pipeBaseEntity, pipeDetailEntity, parmList };
- ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("新增成功!"))
- {
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 增加检验项
- /// </summary>
- private void addPhy()
- {
- this.ultraGrid4.UpdateData();
- this.ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) return;
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid4.Rows.AsQueryable().Where(a => a.GetValue("CHK") == "True");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择新增的检验项!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach(UltraGridRow row in checkMagRows)
- {
- CraftOrdDesignStdPicEntity craftPic = (CraftOrdDesignStdPicEntity)row.ListObject;
- string craftPicEntity = JSONFormat.Format(craftPic);
- parmList.Add(craftPicEntity);
- }
- PipeCheckconsignDetailEntity pipeDetailTity = (PipeCheckconsignDetailEntity)uRow.ListObject;
- string pipeDetailEntity = JSONFormat.Format(pipeDetailTity);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.lims.data.pipe.FrmCheckConsignQuery";
- ccp.MethodName = "addPhy";
- ccp.ServerParams = new object[] { pipeDetailEntity, parmList };
- ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("新增成功!"))
- {
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 删除检验项
- /// </summary>
- private void detePhy()
- {
- this.ultraGrid2.UpdateData();
- this.ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) return;
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid2.Rows.AsQueryable().Where(a => a.GetValue("CHK") == "True");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择删除的检验项!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMagRows)
- {
- PipeCheckconsignPhydetailEntity phyTity = (PipeCheckconsignPhydetailEntity)row.ListObject;
- string phyEntity = JSONFormat.Format(phyTity);
- parmList.Add(phyEntity);
- }
- PipeCheckconsignDetailEntity pipeDetailTity = (PipeCheckconsignDetailEntity)uRow.ListObject;
- string pipeDetailEntity = JSONFormat.Format(pipeDetailTity);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.lims.data.pipe.FrmCheckConsignQuery";
- ccp.MethodName = "detePhy";
- ccp.ServerParams = new object[] { pipeDetailEntity,parmList };
- ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 删除试样组
- /// </summary>
- private void deletePhyMax()
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid5.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- UltraGridRow uRow5 = this.ultraGrid5.ActiveRow;
- if (uRow == null || uRow5 == null) return;
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(a => a.GetValue("CHK") == "True");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择删除的试样组!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMagRows)
- {
- PipeCheckconsignDetailEntity phyTity = (PipeCheckconsignDetailEntity)row.ListObject;
- string phyEntity = JSONFormat.Format(phyTity);
- parmList.Add(phyEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.lims.data.pipe.FrmCheckConsignQuery";
- ccp.MethodName = "deletePhyMax";
- ccp.ServerParams = new object[] { parmList, uRow5.Cells["HeatNo"].Text, uRow5.Cells["CraftSource"].Text };
- ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 小样热处理
- /// </summary>
- private void updateRcl()
- {
- this.ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) return;
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(a => a.GetValue("CHK") == "True");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要热处理试样!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMagRows)
- {
- PipeCheckconsignDetailEntity phyTity = (PipeCheckconsignDetailEntity)row.ListObject;
- string phyEntity = JSONFormat.Format(phyTity);
- parmList.Add(phyEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.lims.data.pipe.FrmCheckConsignQuery";
- ccp.MethodName = "updateRcl";
- ccp.ServerParams = new object[] { parmList };
- ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 保存试样特殊要求备注
- /// </summary>
- private void updateTsRemark()
- {
- this.ultraGrid1.UpdateData();
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) return;
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(a => a.GetValue("CHK") == "True");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要保存的试样!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMagRows)
- {
- PipeCheckconsignDetailEntity phyTity = (PipeCheckconsignDetailEntity)row.ListObject;
- string phyEntity = JSONFormat.Format(phyTity);
- parmList.Add(phyEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.lims.data.pipe.FrmCheckConsignQuery";
- ccp.MethodName = "updateTsRemark";
- ccp.ServerParams = new object[] { parmList };
- ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- private void CloseForm()
- {
- this.Close();
- }
- private void ultraGrid5_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid5.ActiveRow;
- if (uRow == null) return;
- doQueryPhyMax(uRow);
- doQueryCraftFile(uRow);
- }
- /// <summary>
- /// 查询理化试样组信息
- /// </summary>
- private void doQueryCraftFile(UltraGridRow uRow)
- {
- PipeCheckconsignBaseinfoEntity baseTity = (PipeCheckconsignBaseinfoEntity)uRow.ListObject;
- string baseEntity = JSONFormat.Format(baseTity);
- List<CraftOrdDesignStdPicEntity> listSource = EntityHelper.GetData<CraftOrdDesignStdPicEntity>("com.steering.lims.data.pipe.FrmCheckConsignQuery.doQueryCraftFile", new object[] { baseEntity }, _ob);
- craftOrdDesignStdPicEntityBindingSource.DataSource = listSource;
- }
- /// <summary>
- /// 查询检验单下试样号、试样组信息
- /// </summary>
- /// <param name="uRow"></param>
- private void doQueryPhyMax(UltraGridRow uRow)
- {
- List<PipeCheckconsignDetailEntity> listSource = EntityHelper.GetData<PipeCheckconsignDetailEntity>("com.steering.lims.data.pipe.FrmCheckConsignQuery.doQuerySampleNo", new object[] { uRow.Cells["CheckNo"].Text }, _ob);
- pipeCheckconsignDetailEntityBindingSource.DataSource = listSource;
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow == null) return;
- doQueryPhy(uRow);
- }
- /// <summary>
- /// 查询检验项
- /// </summary>
- /// <param name="uRow"></param>
- private void doQueryPhy(UltraGridRow uRow)
- {
- List<PipeCheckconsignPhydetailEntity> listSource = EntityHelper.GetData<PipeCheckconsignPhydetailEntity>("com.steering.lims.data.pipe.FrmCheckConsignQuery.doQueryPhy", new object[] { uRow.Cells["CheckNo"].Text, uRow.Cells["SampleNo"].Text, uRow.Cells["PhyCodeMax"].Text }, _ob);
- pipeCheckconsignPhydetailEntityBindingSource.DataSource = listSource;
- }
- private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid3.ActiveRow;
- UltraGridRow row = this.ultraGrid5.ActiveRow;
- if (uRow == null || row == null) return;
- doQueryCraftFilePhy(uRow,row);
- }
- /// <summary>
- /// 查询工艺试样组理化项
- /// </summary>
- /// <param name="uRow"></param>
- private void doQueryCraftFilePhy(UltraGridRow uRow,UltraGridRow row)
- {
- List<CraftOrdDesignStdPicEntity> listSource = EntityHelper.GetData<CraftOrdDesignStdPicEntity>("com.steering.lims.data.pipe.FrmCheckConsignQuery.doQueryCraftFilePhy", new object[] { uRow.Cells["DesginKey"].Text, uRow.Cells["ProcessCode"].Text, uRow.Cells["PhyCodeMin"].Text, uRow.Cells["CraftSource"].Text, row.Cells["Pic"].Text,row.Cells["IndexSeq"].Text }, _ob);
- craftOrdDesignStdPicEntityBindingSource1.DataSource = listSource;
- }
- private void ultraGrid4_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
- {
- foreach (UltraGridRow uRow in ultraGrid4.Selected.Rows)
- {
- if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
- {
- uRow.Cells["CHK"].Value = true;
- }
- }
- }
- }
- }
|