| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- 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<QcmGpJudgeChangeEntity>(ultraGrid2.DisplayLayout.Bands[0]);
- qcmJhyCtrl = new QcmJhyElementsCtrl(splitContainer1.Panel2,ob, JudgeType.SteelMakingChem);
- _d = new Dal(ob);
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- 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;
- }
- }
- /// <summary>
- /// 管坯判定书打印
- /// </summary>
- 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();
- }
- /// <summary>
- /// 查询
- /// </summary>
- 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<QcmGpJudgeChangeEntity> listSource = EntityHelper.GetData<QcmGpJudgeChangeEntity>(
- "Core.LgMes.Server.Stuffmanage.FrmGpExaminJudge.doQueryData", new object[] { parmList,this.CustomInfo }, this.ob);
- QcmGpJudgeChangeEntitybindingSource.DataSource = listSource;
- }
- /// <summary>
- /// 审批通过
- /// </summary>
- 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);
- }
- }
- }
- /// <summary>
- /// 审批不通过
- /// </summary>
- 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);
- }
- }
- }
- /// <summary>
- /// 撤销审批
- /// </summary>
- 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<QcmJhyElementsEntity> listSource = EntityHelper.GetData<QcmJhyElementsEntity>(
- //"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;
- }
- }
- }
|