using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Format; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.YdmStuffManage.Entity; using CoreFS.CA06; using Infragistics.Win.UltraWinEditors; 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.YdmStuffManage { public partial class FrmGpExaminJudge : FrmBase { private QcmJhyElementsCtrl qcmJhyCtrl; private Dal _d; public FrmGpExaminJudge() { InitializeComponent(); } private void FrmGpExaminJudge_Load(object sender, EventArgs e) { EntityHelper.ShowGridCaption(ultraGrid2.DisplayLayout.Bands[0]); qcmJhyCtrl = new QcmJhyElementsCtrl(splitContainer1.Panel2,ob, JudgeType.SteelMakingChem); _d = new Dal(ob); } /// /// 重写基类方法 /// /// /// public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": if (!CheckQuery()) return; doQueryData(); break; case "ApplyJudgePass": applyJudgePass(); break; case "ApplyJudgeNoPass": applyJudgeNoPass(); break; case "cancelApplyJudge": cancelApplyJudge(); break; case"Print": printData(); break; case "Export": GridHelper.ulGridToExcel(ultraGrid2, "管坯审批信息"); break; case "Close": close(); break; } } /// /// 管坯判定书打印 /// private void printData() { UltraGridRow uRow = this.ultraGrid2.ActiveRow; if (uRow == null) { return; } if(!uRow.Cells["AgreeFlag"].Text.Equals("终审通过")) { MessageUtil.ShowTips("未终审通过的不允许打印!"); return; } string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepGpCertificateGaiPan.cpt&format=pdf&JUDGE_ID=" + uRow.Cells["JudgeId"].Text + "&JUDGE_STOVE_NO_GP=" + uRow.Cells["JudgeStoveNoGp"].Text + "&PRO_PLAN_ID=" + uRow.Cells["ProPlanId"].Text + "&GX_PLAN_NO=" + uRow.Cells["GxPlanNo"].Text; ; FrmExcel fre = new FrmExcel(this.ob, strurl); fre.AutoSize = true; fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fre.WindowState = FormWindowState.Maximized; fre.Show(); } /// /// 查询 /// private void doQueryData() { string stoveNo = ""; string judgeNo = ""; string judgeNoJudge = ""; qcmJhyCtrl.ClearData(); if (chkStoveNo.Checked && txtStoveNo.Text.Trim() != "") { stoveNo = this.txtStoveNo.Text.Trim(); } if (chkjudgeNo.Checked && txtjudgeNo.Text.Trim() != "") { judgeNo = this.txtjudgeNo.Text.Trim(); } if (chkjudgeNo1.Checked && txtjudgeNo1.Text.Trim() != "") { judgeNoJudge = this.txtjudgeNo1.Text.Trim(); } ArrayList parmList = new ArrayList(); parmList.Add(stoveNo); parmList.Add(judgeNo); parmList.Add(judgeNoJudge); parmList.Add(this.ultraOptionSet2.CheckedItem.DataValue.ToString()); List listSource = EntityHelper.GetData( "Core.LgMes.Server.Stuffmanage.FrmGpExaminJudge.doQueryData", new object[] { parmList,this.CustomInfo }, this.ob); QcmGpJudgeChangeEntitybindingSource.DataSource = listSource; } /// /// 审批通过 /// private void applyJudgePass() { UltraGridRow uRow = this.ultraGrid2.ActiveRow; if (uRow == null) { return; } QcmGpJudgeChangeEntity qcmGpJudgeTity = (QcmGpJudgeChangeEntity)uRow.ListObject; string qcmGpJudgeEntity = JSONFormat.Format(qcmGpJudgeTity); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "Core.LgMes.Server.Stuffmanage.FrmGpExaminJudge"; ccp.MethodName = "applyJudgePass"; ccp.ServerParams = new object[] { qcmGpJudgeEntity,this.UserInfo.GetUserName() }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("审批通过!")) { doQueryData(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 审批不通过 /// private void applyJudgeNoPass() { UltraGridRow uRow = this.ultraGrid2.ActiveRow; if (uRow == null) { return; } QcmGpJudgeChangeEntity qcmGpJudgeTity = (QcmGpJudgeChangeEntity)uRow.ListObject; if (qcmGpJudgeTity.AgreeMemo.Equals("")) { MessageUtil.ShowTips("审批不通过,请填写审批说明!"); return; } string qcmGpJudgeEntity = JSONFormat.Format(qcmGpJudgeTity); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "Core.LgMes.Server.Stuffmanage.FrmGpExaminJudge"; ccp.MethodName = "applyJudgeNoPass"; ccp.ServerParams = new object[] { qcmGpJudgeEntity,UserInfo.GetUserName() }; ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { if (ccp.ReturnInfo.Equals("审批不通过成功!")) { doQueryData(); MessageUtil.ShowTips(ccp.ReturnInfo); } else { MessageUtil.ShowTips(ccp.ReturnInfo); } } } /// /// 撤销审批 /// private void cancelApplyJudge() { } private void close() { this.Close(); } private bool CheckQuery() { if (this.chkStoveNo.Checked && string.IsNullOrEmpty(this.txtStoveNo.Text.Trim())) { MessageBox.Show("请输入熔炼炉号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return false; } if (this.chkjudgeNo.Checked && string.IsNullOrEmpty(this.txtjudgeNo.Text.Trim())) { MessageBox.Show("请输入判定炉号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return false; } return true; } private void chkStoveNo_CheckedChanged(object sender, EventArgs e) { this.txtStoveNo.Enabled = this.chkStoveNo.Checked; } private void chkjudgeNo_CheckedChanged(object sender, EventArgs e) { this.txtjudgeNo.Enabled = this.chkjudgeNo.Checked; } private void txtMemo_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { UltraTextEditor textEditor = (UltraTextEditor)sender; PopupTextBox popupText = new PopupTextBox(textEditor.Text, 500); if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK) { textEditor.Text = popupText.TextInfo.Trim(); } this.ultraGrid2.ActiveCell.Value = textEditor.Text; this.ultraGrid2.ActiveRow.Update(); } private void ultraGrid2_AfterRowActivate(object sender, EventArgs e) { UltraGridRow uRow = this.ultraGrid2.ActiveRow; if (uRow == null) return; // List listSource = EntityHelper.GetData( //"Core.LgMes.Server.Stuffmanage.FrmGpExaminJudge.doQueryQcmJhy", new object[] { uRow.Cells["StoveNo"].Text }, this.ob); // QcmJhyElementsEntitybindingSource.DataSource = listSource; DataTable dtCraftCic = _d.GetTableByXmlId("JdgPlnOrderZgS.queryCraftCicByZgProPlanId", new object[] { uRow.Cells["ProPlanId"].Text + uRow.Cells["GxPlanNo"].Text }); qcmJhyCtrl.QueryCraftResultByStoveNo(uRow.Cells["StoveNo"].Text, uRow.Cells["JudgeStoveNo"].Text, dtCraftCic,"A",uRow.Cells["Cic"].Text); } private void chkjudgeNo1_CheckedChanged(object sender, EventArgs e) { this.txtjudgeNo1.Enabled = this.chkjudgeNo1.Checked; } } }