| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- using System.Collections.Generic;
- using com.steering.mes.mcp.entity;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.Control.Entity;
- using Infragistics.Win.UltraWinGrid;
- using Core.StlMes.Client.Mcp.Control.Common;
- using System.Windows.Forms;
- using CoreFS.CA06;
- using System.Linq;
- using System;
- using System.Drawing;
- using Core.Mes.Client.Comm.Server;
- namespace Core.StlMes.Client.Mcp.Mch.Report
- {
- public partial class FrmUtReport : FrmReportBase
- {
- public FrmUtReport()
- {
- NeedCheck = true;
- InitializeComponent();
-
- }
- protected override void LoadView()
- {
- DataBindingSource.DataSource = typeof(HttCrackDetectionEtEntityPlus);
- EntityHelper.ShowGridCaption<HttCrackDetectionEtEntityPlus>(CrackDetectGrid.DisplayLayout.Bands[0]);
- ProductionInfo = new List<string> { "ReportNo", "MachineNo", "TestingNum", "TestingWt", "ManualFtestingNum", "FinalNum", "RejectNum", "EwasteReason" };
- ResultNoPara = new List<string> { "TestingType", "TestingGrade", "WallThickness", "TestingStandard", "NotchLength", "NotchWidth", "NotchDepth", "Memo" };
- SumList = new List<string> { "TestingNum", "TestingWt", "ManualFtestingNum", "FinalNum", "RejectNum", "EwasteWt" };
- }
- protected override void ResetColumns(UltraGridColumn Columns)
- {
- base.ResetColumns(Columns);
- if (Columns.Key == "TestingPosition")
- Columns.EditorComponent = ucePosition;
- if (Columns.Key == "ReportNo")
- Columns.EditorComponent = uceReportNo;
- }
- protected override void QuerySinglePlan()
- {
- DataBindingSource.DataSource = EntityHelper.GetData<HttCrackDetectionEtEntityPlus>(
- "com.steering.mes.mcp.Mch.FrmJgxReport.doQueryUtResult",
- GetQueryCondition(),
- ob);
- var dt =
- ServerHelper.GetData(
- "com.steering.mes.mcp.Mch.FrmJgxReport.getHttEntrustInfo",
- new object[] {}, ob);
- List<string> lst = new List<string>();
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- if (dt.Rows[i][0].ToString().Length > 6)
- {
- if( dt.Rows[i][0].ToString().Contains("-"))
- {
- string[] sArray = dt.Rows[i][0].ToString().Split('-');
- lst.Add(sArray[0]);
- }
- }
- else
- {
- // string[] sArray = s.Split('a')
- lst.Add(dt.Rows[i][0].ToString());
- }
-
- }
- if ((lst != null) && lst.Any())
- foreach (
- var ultraGridRow in
- CrackDetectGrid.Rows.Where(
- p => lst.Any(q => q == p.Cells["judgeStoveNo"].Value.ToString2())))
- ultraGridRow.Appearance.BackColor = Color.Red;
-
- }
- protected override void DoUpdate()
- {
- if (CrackDetectGrid.ActiveRow == null)
- {
- MessageBox.Show("请选择需求修改的实绩!");
- return;
- }
- HttCrackDetectionEtEntityPlus entity = CrackDetectGrid.ActiveRow.ListObject as HttCrackDetectionEtEntityPlus;
- using (CommonCrackParaUpdate CommonCrackParaUpdate = new CommonCrackParaUpdate(entity.ResultNo, ob))
- {
- if (CommonCrackParaUpdate.ShowDialog() == DialogResult.OK)
- {
- Query();
- }
- }
- // ConfrmFrim();
- // sendFrim();
- }
- protected override void Send()
- {
- SendFrim();
- }
- protected override void Confirm()
- {
- ConfrmFrim();
- //foreach (UltraGridRow p in CrackDetectGrid.Rows)
- //{
- // p.Appearance.BackColor = Color.Red;
- // // p.ultraGridRow.Cells["RecordDate"].Appearance.BackColor = Color.Red;
- //}
- }
- private void ConfrmFrim()
- {
- List<string> Lst = new List<string>();
- IQueryable<UltraGridRow> checkMagRows = this.CrackDetectGrid.Rows.AsQueryable().Where(" Chk = 'True'");
- if (checkMagRows.Count() > 0)
- {
- foreach (UltraGridRow p in checkMagRows)//Chk
- {
- HttCrackDetectionEtEntityPlus entity = p.ListObject as HttCrackDetectionEtEntityPlus;
- if (entity.FrimFlag == "已审核")
- {
- Lst.Add(entity.ResultNo.ToString());
- }
- else
- {
- MessageBox.Show("您的选择项有不是已审核的状态!", "提示!", MessageBoxButtons.OK);
- }
- }
- if (Lst.Count > 0)
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Mch.FrmJgxReport";
- ccp.MethodName = "doConfirmFrimResult";
- ccp.ServerParams = new object[] { Lst };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("批准成功!"))
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- Query();
- }
- }
-
- }
- private void SendFrim()
- {
- List<string> Lst = new List<string>();
- IQueryable<UltraGridRow> checkMagRows = this.CrackDetectGrid.Rows.AsQueryable().Where(" Chk = 'True'");
- if (checkMagRows.Count() > 0)
- {
- foreach (UltraGridRow p in checkMagRows)//Chk
- {
- HttCrackDetectionEtEntityPlus entity = p.ListObject as HttCrackDetectionEtEntityPlus;
- if (entity.FrimFlag == "未审核")
- {
- Lst.Add(entity.ResultNo.ToString());
- }
- else
- {
- MessageBox.Show("您的选择项有不是未审核的状态!", "提示!");
- }
- }
- if (Lst.Count > 0)
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Mch.FrmJgxReport";
- ccp.MethodName = "doSendFrimResult";
- ccp.ServerParams = new object[] { Lst };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("审核成功!"))
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- Query();
- }
- }
-
- }
- }
- }
|