| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- 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;
- using CoreFS.CA06;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.YdmPipeManage.Entity;
- using System.Collections;
- using Core.StlMes.Client.YdmPipeManage.Tool;
- using Infragistics.Win.UltraWinGrid;
- using Core.Mes.Client.Comm.Server;
- namespace Core.StlMes.Client.YdmPipeManage
- {
- public partial class FrmExamineJudge : FrmBase
- {
- public FrmExamineJudge()
- {
- InitializeComponent();
- }
- private void FrmExamineJudge_Load(object sender, EventArgs e)
- {
- this.TextStoveNo.Enabled = false;
- EntityHelper.ShowGridCaption<QcmZgJudgeChangeEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- InitColums();
- }
- string stOutCode = "800808";//出库代码
- string stOutName = "改判出库";
- string stInCode = "800706";//入库代码
- string stInName = "改判入库";
- /// <summary>
- /// 绑定列
- /// </summary>
- private void InitColums()
- {
-
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- QueryData();
- break;
- case"submit":
- submitData();
- break;
- case "examineData":
- examineData();
- break;
- case "NoexamineData":
- NoexamineData();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 审核不通过
- /// </summary>
- private void NoexamineData()
- {
- this.ultraGrid1.UpdateData();
- ArrayList parm = new ArrayList();
- int m = 0;
- IQueryable<UltraGridRow> checkRows = ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkRows.Count() == 0)
- {
- MessageUtil.ShowWarning("请选择需要操作的记录!");
- return;
- }
- foreach (UltraGridRow row in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(row.Cells["CHK"].Text) == true)
- {
- if (row.Cells["AgreeMemo"].Text == "")
- {
- m++;
- }
- }
- }
- if (m > 0)
- {
- MessageUtil.ShowWarning("审批不通过,必须写审批说明!");
- return;
- }
- foreach (UltraGridRow uRow in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- ArrayList list = new ArrayList();
-
- list.Add(uRow.Cells["JudgeId"].Text);
- list.Add(uRow.Cells["AgreeMemo"].Text);
- list.Add(this.UserInfo.GetUserName());
- parm.Add(list);
- }
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmExamineJudge";
- ccp.MethodName = "noExamineData";
- ccp.ServerParams = new object[] { parm };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("审批成功!"))
- {
- QueryData();
- MessageUtil.ShowTips("审批成功!");
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 审核通过
- /// </summary>
- private void examineData()
- {
- this.ultraGrid1.UpdateData();
- ArrayList parm = new ArrayList();
- int m = 0;
- IQueryable<UltraGridRow> checkRows = ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkRows.Count() == 0)
- {
- MessageUtil.ShowWarning("请选择需要操作的记录!");
- return;
- }
- string manNo = ClsBaseInfo.GetDepartIdBySectionId(UserInfo.GetDeptid(), this.ob);
- string manName = ClsBaseInfo.GetDepartBySectionId(UserInfo.GetDeptid(), this.ob);
- foreach (UltraGridRow uRow in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- ArrayList list = new ArrayList();
- list.Add(uRow.Cells["JudgeId"].Text);
- list.Add(uRow.Cells["AgreeMemo"].Text);
- list.Add(this.UserInfo.GetUserName());
- list.Add(manNo);//部门ID
- list.Add(manName);//部门
- list.Add(this.UserInfo.GetDeptid());
- list.Add(this.UserInfo.GetDepartment());
- list.Add(stOutCode);//7
- list.Add(stOutName);
- list.Add("OP");
- list.Add(uRow.Cells["judgeStoveNoOld"].Text);
- list.Add(uRow.Cells["batchNoOld"].Text);
-
- list.Add(uRow.Cells["produccode"].Text);//12
- list.Add(uRow.Cells["producname"].Text);
- list.Add(uRow.Cells["steelcode"].Text);
- list.Add(uRow.Cells["steelname"].Text);
- list.Add(uRow.Cells["specCode"].Text);
- list.Add(uRow.Cells["specName"].Text);
- list.Add(uRow.Cells["modelCode"].Text);
- list.Add(uRow.Cells["modelDesc"].Text);
- list.Add(uRow.Cells["stdStyle"].Text);
- list.Add(uRow.Cells["stdStyleDesc"].Text);
- list.Add(uRow.Cells["materialNo"].Text);
- list.Add(uRow.Cells["materialName"].Text);//23
- list.Add(stInCode);
- list.Add(stInName);
- list.Add("IP");
- parm.Add(list);
- }
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmExamineJudge";
- ccp.MethodName = "examineData1";
- ccp.ServerParams = new object[] { parm,this.CustomInfo };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("审批成功!"))
- {
- QueryData();
- MessageUtil.ShowTips("审批成功!");
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 提交改判
- /// </summary>
- private void submitData()
- {
- this.ultraGrid1.UpdateData();
- ArrayList parm = new ArrayList();
- int m = 0;
- foreach (UltraGridRow row in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(row.Cells["CHK"].Text) == true)
- {
- m++;
- }
- }
- if (m < 1)
- {
- MessageUtil.ShowTips("请选择需要提交改判的数据!");
- return;
- }
- foreach (UltraGridRow uRow in ultraGrid1.Rows)
- {
- if(Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- ArrayList list = new ArrayList();
- list.Add(uRow.Cells["JudgeId"].Text);
- list.Add(uRow.Cells["SubmitMemo"].Text);
- list.Add(this.UserInfo.GetUserName());
- parm.Add(list);
- }
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmExamineJudge";
- ccp.MethodName = "submitGpData";
- ccp.ServerParams = new object[] { parm };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("提交改判成功!"))
- {
- QueryData();
- MessageUtil.ShowTips("提交改判成功!");
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 查询改判实绩
- /// </summary>
- private void QueryData()
- {
- string heatNo = "";
- string start = "";
- string end = "";
- ArrayList list = new ArrayList();
- if (ChcStoveNo.Checked)
- {
- if (this.TextStoveNo.Text == "")
- {
- MessageUtil.ShowTips("请输入炉号!");
- return;
- }
- else
- {
- heatNo = this.TextStoveNo.Text;
- }
- }
- if (createTimeCheck.Checked)
- {
- start = startTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- end = endTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- }
-
-
- list.Add(heatNo);
- string[] arr = BaseMethod.InitPermissions(this.ValidDataPurviewIds, ob);
- List<QcmZgJudgeChangeEntity> listSource = EntityHelper.GetData<QcmZgJudgeChangeEntity>(
- "com.steering.pss.ydm.pipemanage.FrmExamineJudge.getGpData", new object[] { list, arr, this.CustomInfo, start, end }, this.ob);
- QcmZgJudgeChangeEntitybindingSource1.DataSource = listSource;
- }
- private void ChcStoveNo_CheckedChanged(object sender, EventArgs e)
- {
- this.TextStoveNo.Enabled = this.ChcStoveNo.Checked;
- }
- private void ultraGrid1_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
- {
- foreach (UltraGridRow uRow in ultraGrid1.Selected.Rows)
- {
- if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
- {
- uRow.Cells["CHK"].Value = true;
- }
- }
- }
- private void TextStoveNo_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue == 13)
- {
- QueryData();
- }
- }
- }
- }
|