using Core.Mes.Client.Comm.Format; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.PlnSaleOrd.炉计划.Entity; using CoreFS.CA06; using System; 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.PlnSaleOrd.炉计划.Tool { public partial class FrmNoOrderSentence : FrmBase { public string flag = ""; private OpeBase _ob; private MatBcMEntityEnd matBcEntity = new MatBcMEntityEnd(); public FrmNoOrderSentence(OpeBase ob,MatBcMEntityEnd matTity) { this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; InitializeComponent(); _ob = ob; matBcEntity = matTity; } private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { switch (e.Tool.Key) { case "DoFrim": doFrim(); break; case "Close": closeFrm(); break; } } private void closeFrm() { flag = "0"; this.Close(); } /// /// 确认 /// private void doFrim() { if(!checkData())return; matBcEntity.MaterialNo = this.TxtMaterial.Tag.ToString2(); matBcEntity.MaterialNamenew = this.TxtMaterial.Text.ToString2(); matBcEntity.Produccode = this.TxtProduc.Tag.ToString2(); matBcEntity.Producnamenew = this.TxtProduc.Text.ToString2(); matBcEntity.Steelcode = this.TxtSteelCode.Tag.ToString2(); matBcEntity.Steelnamenew = this.TxtSteelCode.Text.ToString2(); matBcEntity.SpecCode = this.TxtSpcName.Tag.ToString2(); matBcEntity.SpecNamenew = this.TxtSpcName.Text.ToString2(); matBcEntity.StdStyle = this.TxtStdStyle.Tag.ToString2(); matBcEntity.StdStyleDescnew = this.TxtStdStyle.Text.ToString2(); matBcEntity.ModelCode = this.TxtModel.Tag.ToString2(); matBcEntity.ModelDescnew = this.TxtModel.Text.ToString2(); string matEntity = JSONFormat.Format(matBcEntity); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmEndLibrary"; ccp.MethodName = "doFrim"; ccp.ServerParams = new object[] { matEntity }; ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("改判成功!")) { flag = "1"; this.Close(); } } } private bool checkData() { if(this.TxtMaterial.Text == "") { MessageUtil.ShowTips("请选择物料码!"); return false; } if(this.TxtSpcName.Text == "") { MessageUtil.ShowTips("请选择规格!"); return false; } if(this.TxtProduc.Text == "") { MessageUtil.ShowTips("请选择品名!"); return false; } if(this.TxtSteelCode.Text == "") { MessageUtil.ShowTips("请选择钢级!"); return false; } return true; } private void TxtMaterial_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.base.BaseOperations.getProcessMaterial", new object[] { }, _ob); dt.Columns["BASENAME"].Caption = "物料名称"; BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "BASENAME", "BASECODE"); baseInfo.Shown += new EventHandler((a, b) => { var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where( c => c.GetValue("BASECODE") == this.TxtMaterial.Tag.ToString2()).FirstOrDefault(); if (actRow != null) actRow.Activate(); }); if (baseInfo.ShowDialog() == System.Windows.Forms.DialogResult.OK) { TxtMaterial.Tag = baseInfo.ChoicedRow.GetValue("BASECODE"); TxtMaterial.Text = baseInfo.ChoicedRow.GetValue("BASENAME"); } } private void TxtProduc_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getProcduce", new object[] { }, _ob); dt.Columns["BASENAME"].Caption = "品名"; BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "BASENAME", "BASECODE"); baseInfo.Shown += new EventHandler((a, b) => { var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where( c => c.GetValue("BASECODE") == this.TxtProduc.Tag.ToString2()).FirstOrDefault(); if (actRow != null) actRow.Activate(); }); if (baseInfo.ShowDialog() == System.Windows.Forms.DialogResult.OK) { TxtProduc.Tag = baseInfo.ChoicedRow.GetValue("BASECODE"); TxtProduc.Text = baseInfo.ChoicedRow.GetValue("BASENAME"); } } private void TxtSteelCode_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getSteel", new object[] { }, _ob); dt.Columns["BASENAME"].Caption = "钢级"; BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "BASENAME", "BASECODE"); baseInfo.Shown += new EventHandler((a, b) => { var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where( c => c.GetValue("BASECODE") == this.TxtSteelCode.Tag.ToString2()).FirstOrDefault(); if (actRow != null) actRow.Activate(); }); if (baseInfo.ShowDialog() == System.Windows.Forms.DialogResult.OK) { TxtSteelCode.Tag = baseInfo.ChoicedRow.GetValue("BASECODE"); TxtSteelCode.Text = baseInfo.ChoicedRow.GetValue("BASENAME"); } } private void TxtSpcName_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getSpec", new object[] { }, _ob); dt.Columns["BASENAME"].Caption = "规格"; BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "BASENAME", "BASECODE"); baseInfo.Shown += new EventHandler((a, b) => { var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where( c => c.GetValue("BASECODE") == this.TxtSpcName.Tag.ToString2()).FirstOrDefault(); if (actRow != null) actRow.Activate(); }); if (baseInfo.ShowDialog() == System.Windows.Forms.DialogResult.OK) { TxtSpcName.Tag = baseInfo.ChoicedRow.GetValue("BASECODE"); TxtSpcName.Text = baseInfo.ChoicedRow.GetValue("BASENAME"); } } private void TxtModel_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getModel", new object[] { }, _ob); dt.Columns["BASENAME"].Caption = "扣型"; BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "BASENAME", "BASECODE"); baseInfo.Shown += new EventHandler((a, b) => { var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where( c => c.GetValue("BASECODE") == this.TxtModel.Tag.ToString2()).FirstOrDefault(); if (actRow != null) actRow.Activate(); }); if (baseInfo.ShowDialog() == System.Windows.Forms.DialogResult.OK) { TxtModel.Tag = baseInfo.ChoicedRow.GetValue("BASECODE"); TxtModel.Text = baseInfo.ChoicedRow.GetValue("BASENAME"); } } private void FrmNoOrderSentence_Load(object sender, EventArgs e) { StoveHelper.InitDropStdSty(TxtStdStyle, _ob); } } }