using com.steering.pss.ydm.entity; using Core.Mes.Client.Comm.Format; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.YdmPipeManage.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.YdmPipeManage { public partial class FrmLikuSeq : FrmBase { OpeBase _ob; public string disOk = ""; MatZcMEntity2 matZcEntity = new MatZcMEntity2(); string _ordLnDivePk = ""; string _userName = ""; string _custom = ""; public FrmLikuSeq(OpeBase ob, MatZcMEntity matZctity,string ordLnDivePk,string userName,string custom) { this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; InitializeComponent(); _ob = ob; _ordLnDivePk = ordLnDivePk; _userName = userName; _custom = custom; matZcEntity.JudgeStoveNo = matZctity.JudgeStoveNo.ToString(); matZcEntity.BatchNo = matZctity.BatchNo.ToString(); matZcEntity.BatchGroudNo = matZctity.BatchGroudNo.ToString(); matZcEntity.ProductFlag = matZctity.ProductFlag; matZcEntity.MatStatus = matZctity.MatStatus; matZcEntity.ActLenMin = matZctity.ActLenMin; matZcEntity.ActLenMax = matZctity.ActLenMax; matZcEntity.BelongCode = matZctity.BelongCode; matZcEntity.JudgeResult = matZctity.JudgeResult; matZcEntity.FixNum = matZctity.FixNum.ToString2(); matZcEntity.Pipmemo = matZctity.Pipmemo; matZcEntity.StorageNo = matZctity.StorageNo; matZcEntity.LocationNo = matZctity.LocationNo; } /// /// 重写基类方法 /// /// /// private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { switch (e.Tool.Key) { case "OK": doFrim(); break; case "Close": this.Close(); break; } } private void doQuery(MatZcMEntity2 matZcEntity2) { string matZcTity = JSONFormat.Format(matZcEntity2); List listSource = EntityHelper.GetData( "com.steering.pss.ydm.pipemanage.FrmPipeMagement.doQuery", new object[] { matZcTity }, this._ob); matZcMEntity2BindingSource.DataSource = listSource; } /// /// 确认 /// private void doFrim() { this.ultraGrid1.UpdateData(); IQueryable checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'"); if (checkMagRows.Count() == 0) { return; } ArrayList parmList = new ArrayList(); foreach (UltraGridRow row in checkMagRows) { MatZcMEntity2 matZcTity = (MatZcMEntity2)row.ListObject; string matZcEntity = JSONFormat.Format(matZcTity); parmList.Add(matZcEntity); } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmPipeMagement"; ccp.MethodName = "seqLiku"; ccp.ServerParams = new object[] { parmList,_ordLnDivePk,_userName,_custom }; ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("利库成功!")) { disOk = "1"; this.Close(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } private void FrmLikuSeq_Load(object sender, EventArgs e) { EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); doQuery(matZcEntity); } private void ultraGrid1_CellChange(object sender, CellEventArgs e) { this.ultraGrid1.UpdateData(); if (e.Cell.Column.Key == "CHK") { IQueryable checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'"); if (checkMagRows.Count() == 0) { this.ultraLabel1.Text = ""; return; } int acount = 0; double len = 0.0; double wgt = 0.0; foreach (UltraGridRow row in checkMagRows) { acount = acount + int.Parse(row.Cells["ActCount"].Text); wgt = wgt + double.Parse(row.Cells["ActWeight"].Text); len = len + double.Parse(row.Cells["ActLen"].Text); } this.ultraLabel1.Text = "已选信息:" + acount.ToString3() + "支" + " " + wgt.ToString3() + "吨" + " " + len.ToString3() + "米"; } } } }