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(ultraGrid1.DisplayLayout.Bands[0]); InitColums(); } string stOutCode = "800808";//出库代码 string stOutName = "改判出库"; string stInCode = "800706";//入库代码 string stInName = "改判入库"; /// /// 绑定列 /// 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; } } /// /// 审核不通过 /// private void NoexamineData() { this.ultraGrid1.UpdateData(); ArrayList parm = new ArrayList(); int m = 0; IQueryable 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); } } } /// /// 审核通过 /// private void examineData() { this.ultraGrid1.UpdateData(); ArrayList parm = new ArrayList(); int m = 0; IQueryable 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); } } } /// /// 提交改判 /// 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); } } } /// /// 查询改判实绩 /// 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 listSource = EntityHelper.GetData( "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(); } } } }