using Core.Mes.Client.Comm.Format; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.YdmBcPipeManage.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.YdmBcPipeManage { public partial class FrmOfflineZg : FrmBase { public FrmOfflineZg(OpeBase ob, string[] valid) { this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; InitializeComponent(); _ob = ob; _valid = valid; } private string[] plineCode = null; private string[] _valid = null; private void FrmOfflineZg_Load(object sender, EventArgs e) { EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]); plineCode = BaseMethod.getPCodePline(_valid, _ob); doQueryMilPlan(); } OpeBase _ob; /// /// 重写基类方法 /// /// /// private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { switch (e.Tool.Key) { case "DoQuery": doQueryMilPlan(); break; case"DoOffline": doOffline(); break; case"DoBack": doBack(); break; case "Close": this.Close(); break; } } /// /// 查询可离线数据 /// private void doQueryMilPlan() { string lotNo = ""; string judgeNo = ""; if(chkLotNo.Checked && this.txtLotNo.Text.Trim() != "") { lotNo = this.txtLotNo.Text.Trim(); } if(this.chkFurnace.Checked && this.txtFurnace.Text != "") { judgeNo = this.txtFurnace.Text.Trim(); } List listSource = EntityHelper.GetData( "com.steering.ydm.bc.FrmFilpOutStorage.doQueryMilPlan", new object[] { lotNo, judgeNo,plineCode }, _ob); milPlanEntityBindingSource.DataSource = listSource; } /// /// 离线 /// private void doOffline() { this.ultraGrid1.UpdateData(); UltraGridRow uRow = this.ultraGrid1.ActiveRow; if (uRow == null) return; if (cmbProcess.Text == "") { MessageUtil.ShowTips("离线时请选择离线工序点!"); return; } MilPlanEntity milPlanTity = (MilPlanEntity)uRow.ListObject; if (!StringUtil.IsInt(milPlanTity.LxCount.ToString2())) { MessageUtil.ShowTips("离线支数请输入整数!"); return; } string milPlanEntity = JSONFormat.Format(milPlanTity); DataTable ds = getStoreNo(milPlanTity.PlineCode,_ob); if (ds == null) { MessageUtil.ShowTips("无轧管在线库基础信息,请维护!"); return; } ArrayList parmList = new ArrayList(); parmList.Add(UserInfo.GetUserName()); parmList.Add(UserInfo.GetDeptid()); parmList.Add(UserInfo.GetDepartment()); parmList.Add(UserInfo.GetUserOrder()); parmList.Add(UserInfo.GetUserGroup()); parmList.Add(ds.Rows[0]["STORAGE_NO"].ToString()); parmList.Add(ds.Rows[0]["STORAGE_NO"].ToString() + "10101"); parmList.Add(ds.Rows[0]["STORAGE_TYPE_NO"].ToString()); parmList.Add(ds.Rows[0]["STORAGE_TYPE_NAME"].ToString()); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.ydm.bc.FrmFilpOutStorage"; ccp.MethodName = "doOffline"; ccp.ServerParams = new object[] { milPlanEntity, parmList, this.cmbProcess.Value.ToString2() }; ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("离线成功!")) { doQueryMilPlan(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 查询仓库信息 /// /// /// private DataTable getStoreNo(string plineCode,OpeBase ob) { DataTable ds = ServerHelper.GetData("com.steering.ydm.bc.FrmFilpOutStorage.doQueryStoreNo", new object[] { plineCode }, ob); if (ds.Rows.Count > 0) { return ds; } else { return null; } } /// /// 撤销离线 /// private void doBack() { } private void chkLotNo_CheckedChanged(object sender, EventArgs e) { this.txtLotNo.Enabled = this.chkLotNo.Checked; } private void chkFurnace_CheckedChanged(object sender, EventArgs e) { this.txtFurnace.Enabled = this.chkFurnace.Checked; } } }