| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Mcp.VRP.Entity;
- using CoreFS.CA06;
- 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.Mcp.VRP.Vrp
- {
- public partial class FrmBaoJianResult : FrmBase
- {
- public FrmBaoJianResult()
- {
- InitializeComponent();
- }
- private string Processcode = "";//参数
- private DataTable _dtPline = null;
- private void FrmBaoJianResult_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<BaoJiaoResultMainEntity>(ultraGrid1.DisplayLayout.Bands[0]);//中文注释替换字段名
- EntityHelper.ShowGridCaption<BaoJiaoResultDetailEntity>(ultraGrid2.DisplayLayout.Bands[0]);
- this.BeginTime.Value = System.DateTime.Now.AddDays(-1);//设置开始日期为前一天
- this.EndTime.Value = System.DateTime.Now.AddDays(0);//设置结束日期为当前日期
- Processcode = this.CustomInfo.ToString();//参数
- _dtPline = ServerHelper.GetData("com.steering.mes.mcp.Vrp.FrmBaoJianResult.doQueryPlineCode", new object[] { Processcode }, ob);
- }
- /// <summary>
- /// 设置条件参数的可选状态随选中按钮变化
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void checkBox2_CheckedChanged(object sender, EventArgs e)
- {
- this.PlcodeEditor.Enabled = this.ChkPlcode.Checked;
- }
- private void checkBox4_CheckedChanged(object sender, EventArgs e)
- {
- this.InsflagOptionSet.Enabled = this.ChkInsflag.Checked;
- }
- private void checkBox5_CheckedChanged(object sender, EventArgs e)
- {
- this.ResultOptionSet.Enabled = this.ChkResult.Checked;
- }
- private void checkBox3_CheckedChanged(object sender, EventArgs e)
- {
- this.JudstNoEditor.Enabled = this.ChkJudstNo.Checked;
- }
- private void Chkdealflag_CheckedChanged(object sender, EventArgs e)
- {
- this.DealflagOptionSet.Enabled = this.Chkdealflag.Checked;
- }
- /// <summary>
- /// 设置关键字与产销软件对应
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- doQuery();
- break;
- case "Save":
- doSave();
- break;
- case "Chuzhi":
- doChuzhi();
- break;
- case "RevokeChuzhi":
- doRevokeChuzhi();
- break;
- case "Del":
- doDel();
- break;
- case "RevokeDel":
- doRevokeDel();
- break;
- case "UpdateActCount":
- doUpdateActCount();
- break;
- case "PrintReport":
- doPrintReport();
- break;
- case "PrintReportZG":
- doPrintReportZG();
- break;
- case "PrintReportCP":
- doPrintReportCP();
- break;
- case "PrintReportTestKey":
- doPrintReportTestKey();
- break;
- case "Close":
- this.Close();
- break;
- case "Export":
- Export();
- break;
- case "UpdateInsflag1":
- doUpdateInsflag1();
- break;
- case "UpdateInsflag2":
- doUpdateInsflag2();
- break;
- }
- }
- /// <summary>
- /// 查询报检主表
- /// </summary>
- public void doQuery()
- {
- string begintime = "";
- string endtime = "";
- string plinecode = "";
- string inspectionflag = "";
- string result = "";
- string judgestoveno = "";
- string validflag = "";
- string disposalflag = "";
- ArrayList list = new ArrayList();
- if(ChkTime.Checked){
- if(DateTime.Parse(this.BeginTime.Value.ToString())>DateTime.Parse(this.EndTime.Value.ToString())){
- MessageUtil.ShowTips("开始时间不能大于结束时间!");
- return;
- }
- else
- {
- begintime = this.BeginTime.Value.ToString("yyyy-MM-dd 07:00:00");
- endtime = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
- }
- }
- if(this.ChkPlcode.Checked && this.PlcodeEditor.Text.Trim() != ""){
- string pc = PlcodeEditor.Tag.ToString();
- plinecode = PlcodeEditor.Tag.ToString().Replace(",", "', '");
- }
- if(this.ChkInsflag.Checked){
- inspectionflag = this.InsflagOptionSet.CheckedItem.DataValue.ToString();
- }
- if(this.ChkResult.Checked){
- result = this.ResultOptionSet.CheckedItem.DataValue.ToString();
- }
- if(this.ChkJudstNo.Checked && this.JudstNoEditor.Text.Trim() !=""){
- judgestoveno = this.JudstNoEditor.Text.Trim();
- }
- if (this.ChkValid.Checked)
- {
- validflag = "0";
- }
- if (this.Chkdealflag.Checked)
- {
- disposalflag = this.DealflagOptionSet.CheckedItem.DataValue.ToString();
- }
- list.Add(begintime);
- list.Add(endtime);
- list.Add(plinecode);
- list.Add(inspectionflag);
- list.Add(result);
- list.Add(judgestoveno);
- list.Add(Processcode);
- list.Add(validflag);
- list.Add(disposalflag);
- //WaitingForm2 wf = new WaitingForm2("正在加载,请稍候....");
- List<BaoJiaoResultMainEntity> listSourcemain = EntityHelper.GetData<BaoJiaoResultMainEntity>(
- "com.steering.mes.mcp.Vrp.FrmBaoJianResult.QueryMain", new object[] { list }, this.ob);
- baoJiaoResultMainEntityBindingSource.DataSource = listSourcemain;
- }
- /// <summary>
- /// 查询报检子表
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- string inspectionno = "";
- string inspectionnum = "";
- ArrayList list = new ArrayList();
- inspectionno = this.ultraGrid1.ActiveRow.Cells["inspectionNo"].Value.ToString();
- inspectionnum = this.ultraGrid1.ActiveRow.Cells["inspectionNum"].Value.ToString();
- list.Add(inspectionno);
- list.Add(inspectionnum);
- List<BaoJiaoResultDetailEntity> listSourcedetail = EntityHelper.GetData<BaoJiaoResultDetailEntity>(
- "com.steering.mes.mcp.Vrp.FrmBaoJianResult.QueryDetail", new object[] { list }, this.ob);
- baoJiaoResultDetailEntityBindingSource.DataSource = listSourcedetail;
- List<BaoJiaoResultMainEntity> listSourcemain = EntityHelper.GetData<BaoJiaoResultMainEntity>(
- "com.steering.mes.mcp.Vrp.FrmBaoJianResult.QueryMain1", new object[] { list }, this.ob);
- var list1 = listSourcemain.ToList();
- var recheck = list1.Select(p => p.Recheck).ToList();
- foreach(var item in recheck){
- if(item.Equals("已重检")){
- this.ultraGrid2.Enabled = false;
- }
- }
- string disposalflag = this.ultraGrid1.ActiveRow.Cells["disposalFlag"].Value.ToString();
- string validflag = this.ultraGrid1.ActiveRow.Cells["validFlag"].Value.ToString();
- if (disposalflag.Equals("已完成") || validflag.Equals("无效"))
- {
- this.ultraGrid2.Enabled = false;
- }
- else
- {
- this.ultraGrid2.Enabled = true;
- }
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["validflag"].Text.ToString().Equals("无效"))
- {
- ugr.Appearance.ForeColor = Color.Red;
- }
- else
- {
- ugr.Appearance.ForeColor = Color.Black;
- }
- }
- }
- /// <summary>
- /// 修改报检子表字段信息
- /// </summary>
- public void doSave()
- {
- if(!ultraGrid1.ActiveRow.Cells["inspectionflag"].Text.ToString().Equals("待检") &&
- !ultraGrid1.ActiveRow.Cells["inspectionflag"].Text.ToString().Equals("已检"))
- {
- MessageUtil.ShowTips("抽检状态不符,无法修改!");
- return;
- }
- string flag = "1";
- foreach (UltraGridRow ugr1 in ultraGrid2.Rows) {
- if (ugr1 == null)
- {
- MessageUtil.ShowTips("无数据!");
- return;
- }
- string s = ugr1.Cells["result"].Text.ToString();
- if (ugr1.Cells["result"].Text.ToString().Equals(""))
- {
- MessageUtil.ShowTips("检验结果项不能为空!请重试!");
- return;
- }
- }
- if (MessageUtil.ShowYesNoAndQuestion("确认保存?") == DialogResult.No)
- {
- return;
- }
-
- foreach(UltraGridRow ugr in ultraGrid2.Rows){
- ArrayList list = new ArrayList();
- string Result = ugr.Cells["result"].Text.ToString();
- string Reasons = ugr.Cells["reasons"].Text.ToString();
- string Mome = ugr.Cells["mome"].Text.ToString();
- string detectiondode = ugr.Cells["detectionCode"].Text.ToString();
- string Guid = ugr.Cells["guid"].Text.ToString();
- list.Add(Result);
- list.Add(Reasons);
- list.Add(Mome);
- list.Add(detectiondode);
- list.Add(Guid);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult";
- ccp.MethodName = "SaveDetail";
- ccp.ServerParams = new object[] { list };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if(ccp.ReturnCode == -1){
- flag = "0";
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- if(flag == "1"){
- UpdateMain();
- doQuery();
- MessageUtil.ShowTips("修改成功!");
- }
- }
- /// <summary>
- /// 根据子表result更新主表inspectionresult
- /// </summary>
- public void UpdateMain()
- {
- UltraGridRow mainrow = ultraGrid1.ActiveRow;
- BaoJiaoResultMainEntity baojianresultmainentity = (BaoJiaoResultMainEntity)ultraGrid1.ActiveRow.ListObject;
- baojianresultmainentity.InspectionNo = mainrow.Cells["Inspectionno"].Text.ToString();
- baojianresultmainentity.InspectionNum = decimal.Parse(mainrow.Cells["Inspectionnum"].Text.ToString());
- baojianresultmainentity.InspectionTime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- baojianresultmainentity.InspectionName = this.UserInfo.GetUserName();
- baojianresultmainentity.UnqualifiedReasons = "";
- baojianresultmainentity.InspectionResult = "";
- foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
- {
- string result = ugr.Cells["result"].Text.ToString();
- if (result=="不合格")
- {
- baojianresultmainentity.InspectionResult = "不合格";
- baojianresultmainentity.UnqualifiedReasons +=
- //ugr.Cells["projectCategory"].Text.ToString() + "-" +
- ugr.Cells["projectName"].Text.ToString() + "-" +
- ugr.Cells["reasons"].Text.ToString() +"\n";
- baojianresultmainentity.DisposalFlag = "0";
- }
-
- }
- if(baojianresultmainentity.InspectionResult.Equals("")){
- baojianresultmainentity.InspectionResult = "合格";
- baojianresultmainentity.DisposalFlag = "";
- }
- if (!baojianresultmainentity.UnqualifiedReasons.Equals(""))
- {
- baojianresultmainentity.UnqualifiedReasons = baojianresultmainentity.UnqualifiedReasons.Substring(0, baojianresultmainentity.UnqualifiedReasons.Length - 1);
- }
- string jsonstr = JSONFormat.Format(baojianresultmainentity);
- CoreClientParam ccp1 = new CoreClientParam();
- ccp1.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult";
- ccp1.MethodName = "UpdateMain";
- ccp1.ServerParams = new object[] { jsonstr };
- ccp1 = ob.ExecuteNonQuery(ccp1, CoreInvokeType.Internal);
- }
- /// <summary>
- /// 处置
- /// </summary>
- public void doChuzhi()
- {
- UltraGridRow mainrow = ultraGrid1.ActiveRow;
- if (mainrow.Cells["validflag"].Text.ToString().Equals("无效"))
- {
- MessageUtil.ShowTips("无效数据!无法进行操作!");
- return;
- }
- if (mainrow.Cells["inspectionResult"].Text.ToString().Equals("合格") ||
- mainrow.Cells["inspectionResult"].Text.ToString().Equals(""))
- {
- MessageUtil.ShowTips("报检结果不符,不能处置!");
- return;
- }
- if (mainrow.Cells["disposalMethod"].Text.ToString().Equals(""))
- {
- MessageUtil.ShowTips("处置方式不能为空!请重试!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("确认处置?") == DialogResult.No)
- {
- return;
- }
- BaoJiaoResultMainEntity baojianresultmainentity = (BaoJiaoResultMainEntity)ultraGrid1.ActiveRow.ListObject;
- baojianresultmainentity.InspectionNo = mainrow.Cells["inspectionNo"].Text.ToString();
- baojianresultmainentity.InspectionNum = decimal.Parse(mainrow.Cells["Inspectionnum"].Text.ToString());
- baojianresultmainentity.DisposalMethod = mainrow.Cells["disposalMethod"].Text.ToString();
- baojianresultmainentity.DisposalFlag = "1";
- baojianresultmainentity.DisposalTime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- baojianresultmainentity.DisposalName = this.UserInfo.GetUserName();
- string jsonstr = JSONFormat.Format(baojianresultmainentity);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult";
- ccp.MethodName = "Chuzhi";
- ccp.ServerParams = new object[]{ jsonstr };
- ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
- if(ccp.ReturnCode != -1){
- if(ccp.ReturnInfo.Equals("处置成功!")){
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 撤销处置
- /// </summary>
- public void doRevokeChuzhi()
- {
- UltraGridRow mainrow = ultraGrid1.ActiveRow;
- if (mainrow.Cells["validflag"].Text.ToString().Equals("无效"))
- {
- MessageUtil.ShowTips("无效数据!无法进行操作!");
- return;
- }
- if (!mainrow.Cells["disposalFlag"].Text.ToString().Equals("已完成"))
- {
- MessageUtil.ShowTips("还未进行处置,不能撤销!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("确认撤销处置?") == DialogResult.No)
- {
- return;
- }
- BaoJiaoResultMainEntity baojianresultmainentity = (BaoJiaoResultMainEntity)ultraGrid1.ActiveRow.ListObject;
- baojianresultmainentity.InspectionNo = mainrow.Cells["inspectionNo"].Text.ToString();
- baojianresultmainentity.InspectionNum = decimal.Parse(mainrow.Cells["Inspectionnum"].Text.ToString());
- baojianresultmainentity.DisposalMethod = "";
- baojianresultmainentity.DisposalFlag = "0";
- baojianresultmainentity.DisposalTime = "";
- baojianresultmainentity.DisposalName = "";
- string jsonstr = JSONFormat.Format(baojianresultmainentity);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult";
- ccp.MethodName = "RevokeChuzhi";
- ccp.ServerParams = new object[] { jsonstr };
- ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
- if(ccp.ReturnCode != -1){
- if(ccp.ReturnInfo.Equals("撤销成功!")){
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 废除
- /// </summary>
- public void doDel()
- {
- UltraGridRow mainrow = ultraGrid1.ActiveRow;
- if (mainrow.Cells["validflag"].Text.ToString().Equals("无效"))
- {
- MessageUtil.ShowTips("已经退回的数据无法再废除!");
- return;
- }
- ArrayList list = new ArrayList();
- string inspectionNo = "";
- string inspectionNum = "";
- inspectionNo = mainrow.Cells["inspectionNo"].Text.ToString();
- inspectionNum = mainrow.Cells["inspectionNum"].Text.ToString();
- list.Add(inspectionNo);
- list.Add(inspectionNum);
- if(MessageUtil.ShowYesNoAndQuestion("确认退回?") == DialogResult.No) return;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult";
- ccp.MethodName = "DelMain";
- ccp.ServerParams = new object[] { list };
- ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
- int returncode = ccp.ReturnCode;
- if(returncode != -1){
- if (ccp.ReturnInfo.Equals("退回成功!"))
- {
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- /// <summary>
- /// 撤销废除
- /// </summary>
- public void doRevokeDel()
- {
- UltraGridRow mainrow = ultraGrid1.ActiveRow;
- if (mainrow.Cells["validflag"].Text.ToString().Equals("有效"))
- {
- MessageUtil.ShowTips("有效数据,无法撤销废除!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("确认撤销废除?") == DialogResult.No)
- {
- return;
- }
- ArrayList list = new ArrayList();
- string inspectionno = mainrow.Cells["inspectionNo"].Text.ToString();
- string inspectionnum = mainrow.Cells["inspectionNum"].Text.ToString();
- list.Add(inspectionno);
- list.Add(inspectionnum);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult";
- ccp.MethodName = "RevokeDel";
- ccp.ServerParams = new object[] { list };
- ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
- if(ccp.ReturnCode != -1){
- if(ccp.ReturnInfo.Equals("撤销废除成功!")){
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- #region 抽检doChoujian()
- /// <summary>
- /// 抽检
- /// </summary>
- public void doChoujian()
- {
- ArrayList listPT = new ArrayList();
- foreach(UltraGridRow ugr in this.ultraGrid1.Rows){
- if (ugr.Cells["gradecode"].Text.ToString() == "20" &&
- ugr.Cells["stdCode"].Text.ToString() == "8162" ||
- ugr.Cells["stdCode"].Text.ToString() == "8163" &&
- ugr.Cells["InspectionFlag"].Text.ToString().Equals("待抽") &&
- ugr.Cells["validflag"].Text.ToString().Equals("有效"))
- {
- string idcode = ugr.Cells["idcode"].Text.ToString();
- listPT.Add(idcode);
- }
- else
- {
- if (ugr.Cells["validflag"].Text.ToString().Equals("无效"))
- {
- return;
- }
- if (ugr.Cells["inspectionFlag"].Text.ToString().Equals("待抽"))
- {
- ArrayList listTS = new ArrayList();
- string idcode = ugr.Cells["idcode"].Text.ToString();
- listTS.Add(idcode);
- CoreClientParam ccpTS = new CoreClientParam();
- ccpTS.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult";
- ccpTS.MethodName = "ChoujianTS";
- ccpTS.ServerParams = new object[] { listTS };
- ccpTS = ob.ExecuteNonQuery(ccpTS, CoreInvokeType.Internal);
- if(ccpTS.ReturnCode == -1){
- MessageUtil.ShowTips(ccpTS.ReturnInfo);
- return;
- }
- }
- }
- }
- CoreClientParam ccpPT = new CoreClientParam();
- ccpPT.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult";
- ccpPT.MethodName = "ChoujianPT";
- ccpPT.ServerParams = new object[] { listPT };
- ccpPT = ob.ExecuteNonQuery(ccpPT, CoreInvokeType.Internal);
- if(ccpPT.ReturnCode != -1){
- if(ccpPT.ReturnInfo.Equals("已抽检!")){
- doQuery();
- MessageUtil.ShowTips(ccpPT.ReturnInfo);
- }
- }
- else
- {
- MessageUtil.ShowTips(ccpPT.ReturnInfo);
- }
- }
- #endregion
- /// <summary>
- /// 修改支数
- /// </summary>
- public void doUpdateActCount()
- {
- UltraGridRow ugr = ultraGrid1.ActiveRow;
- if(!ugr.Cells["inspectionFlag"].Text.ToString().Equals("待检")){
- MessageUtil.ShowTips("抽检状态不符,不能修改支数!");
- return;
- }
- ArrayList list = new ArrayList();
- string inspectionno = ugr.Cells["inspectionNo"].Text.ToString();
- string inspectionum = ugr.Cells["inspectionNum"].Text.ToString();
- decimal countpre = decimal.Parse(ugr.Cells["actCount"].Value.ToString());
- decimal count = decimal.Parse(ugr.Cells["actCount"].Text.ToString());
- if(count>countpre){
- MessageUtil.ShowTips("修改后的支数不能大于原支数!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("确认修改?") == DialogResult.No)
- {
- return;
- }
- string countnew = count.ToString();
- decimal weightpre = decimal.Parse(ugr.Cells["actWeight"].Text.ToString());
- decimal eachweight = (weightpre / countpre);
- string weightnew = Math.Round((eachweight * count),2).ToString();
- string scarpnum = (countpre - count).ToString();
- string scarpwt = (weightpre - decimal.Parse(weightnew)).ToString();
- list.Add(inspectionno);
- list.Add(inspectionum);
- list.Add(countnew);
- list.Add(weightnew);
- list.Add(scarpnum);
- list.Add(scarpwt);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult";
- ccp.MethodName = "UpdateActCount";
- ccp.ServerParams = new object[] { list };
- ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
- if(ccp.ReturnCode != -1){
- if(ccp.ReturnInfo.Equals("修改成功!")){
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- /// <summary>
- /// 打印报检单
- /// </summary>
- public void doPrintReport()
- {
- UltraGridRow ugr = ultraGrid1.ActiveRow;
- if (ugr == null)
- {
- MessageUtil.ShowTips("未查询到数据!");
- return;
- }
- string inspectionno = ugr.Cells["inspectionno"].Text.ToString();
- string inspectionnum = ugr.Cells["inspectionnum"].Text.ToString();
- string heatplanno = ugr.Cells["heatplanno"].Text.ToString();
- string judgestoveno = ugr.Cells["judgestoveno"].Text.ToString();
- string plinecode = ugr.Cells["plinecode"].Text.ToString();
- string processcode = ugr.Cells["processcode"].Text.ToString();
- var strurl = "";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPipeBj.cpt&INSPECTION_NO=" +
- inspectionno + "&INSPECTION_NUM=" + inspectionnum + "&HEAT_PLAN_NO=" + heatplanno +
- "&JUDGE_STOVE_NO=" + judgestoveno + "&PLINE_CODE=" + plinecode + "&PROCESS_CODE=" + processcode;
- var fre = new FrmRepExcel(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>
- public void doPrintReportZG()
- {
- UltraGridRow ugr = ultraGrid1.ActiveRow;
- if (ugr == null)
- {
- MessageUtil.ShowTips("未查询到数据!");
- return;
- }
- string inspectionno = ugr.Cells["inspectionNo"].Text.ToString();
- string inspectionum = ugr.Cells["inspectionNum"].Text.ToString();
- string plinename = ugr.Cells["plineName"].Text.ToString();
- string judgestoveno = ugr.Cells["judgeStoveNo"].Text.ToString();
- string betchno = ugr.Cells["batchNo"].Text.ToString();
- string gradename = ugr.Cells["gradename"].Text.ToString();
- string steelname = ugr.Cells["steelname"].Text.ToString();
- string specname = ugr.Cells["specName"].Text.ToString();
- string craftfileno = ugr.Cells["craftFileNo"].Text.ToString();
- string unqreason = ugr.Cells["unqualifiedReasons"].Text.ToString();
- string inspectiontime = ugr.Cells["inspectionTime"].Text.ToString();
- string inspectionname = ugr.Cells["inspectionName"].Text.ToString();
- string disposalmethod = ugr.Cells["disposalMethod"].Text.ToString();
- string disposaltime = ugr.Cells["disposalTime"].Text.ToString();
- string disposalname = ugr.Cells["disposalName"].Text.ToString();
- var strurl = "";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPipeBjUnqualifiedProductsZG.cpt&INSPECTION_NO=" +
- inspectionno + "&INSPECTION_NUM=" + inspectionum;
- var fre =new FrmRepExcel(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>
- public void doPrintReportCP()
- {
- UltraGridRow ugr = ultraGrid1.ActiveRow;
- if(ugr == null){
- MessageUtil.ShowTips("未查询到数据!");
- return;
- }
- string inspectionno = ugr.Cells["inspectionno"].Text.ToString();
- string inspectionnum = ugr.Cells["inspectionnum"].Text.ToString();
- string heatplanno = ugr.Cells["heatplanno"].Text.ToString();
- string judgestoveno = ugr.Cells["judgestoveno"].Text.ToString();
- string plinecode = ugr.Cells["plinecode"].Text.ToString();
- string processcode = ugr.Cells["processcode"].Text.ToString();
- string batchno = ugr.Cells["batchno"].Text.ToString();
- var strurl = "";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPipeBjCheck.cpt&INSPECTION_NO=" +
- inspectionno + "&INSPECTION_NUM=" + inspectionnum + "&HEAT_PLAN_NO=" + heatplanno +
- "&JUDGE_STOVE_NO=" + judgestoveno + "&PLINE_CODE=" + plinecode + "&PROCESS_CODE=" + processcode +
- "&BATCH_NO=" + batchno;
- var fre = new FrmRepExcel(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>
- public void doPrintReportTestKey()
- {
- UltraGridRow ugr = ultraGrid1.ActiveRow;
- if(ugr == null){
- MessageUtil.ShowTips("未查询到数据!");
- return;
- }
- string PROCESS_CODE = ugr.Cells["processCode"].Text.ToString();
- string ORDER_NO = ugr.Cells["orderNo"].Text.ToString() + "/" + ugr.Cells["orderSeq"].Text.ToString();
- var strurl = "";
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilTestKey2.cpt&PROCESS_CODE=" +
- "D" + "&ORDER_NO=" + ORDER_NO;
- var fre = new FrmRepExcel(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>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void PlcodeEditor_EditorButtonClick_1(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- ChoicePlineFrm frm = new ChoicePlineFrm(_dtPline, this.ob);
- //frm.ShowDialog();
- if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- PlcodeEditor.Tag = frm.ChoicePlineCode;
- PlcodeEditor.Text = frm.ChoicePlineName;
- }
- }
- /// <summary>
- /// 工艺文件查看
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (row == null) return;
- string CraftPath = row.Cells["CraftPath"].Text.ToString();
- FormFileDown askDown = new FormFileDown(this.ob, CraftPath);
- askDown.CtrlFileDown1.Button3.Visible = false;
- askDown.Show();
- }
- /// <summary>
- /// 导出
- /// </summary>
- private void Export()
- {
- string title = "";
- title += "报检实绩[轧管]";
- GridHelper.ulGridToExcel(ultraGrid1, title);
- }
- /// <summary>
- /// 20钢抽检改待检
- /// </summary>
- public void doUpdateInsflag1()
- {
- string inspectionNo = "";
- string inspectionNum = "";
- string insflag = "1";
- if (!this.ultraGrid1.ActiveRow.Cells["inspectionFlag"].Text.ToString().Equals("待抽"))
- {
- MessageUtil.ShowTips("此操作只对状态为待抽的数据有效,请重试!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("确认修改?") == DialogResult.No)
- {
- return;
- }
- ArrayList list = new ArrayList();
- inspectionNo = this.ultraGrid1.ActiveRow.Cells["inspectionNo"].Text.ToString();
- inspectionNum = this.ultraGrid1.ActiveRow.Cells["inspectionNum"].Text.ToString();
- list.Add(inspectionNo);
- list.Add(inspectionNum);
- list.Add(insflag);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult";
- ccp.MethodName = "UpdateInsflag";
- ccp.ServerParams = new object[] { list };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- /// <summary>
- /// 20钢抽检改免检
- /// </summary>
- public void doUpdateInsflag2()
- {
- string inspectionNo = "";
- string inspectionNum = "";
- string insflag = "3";
- if (!this.ultraGrid1.ActiveRow.Cells["inspectionFlag"].Text.ToString().Equals("待抽"))
- {
- MessageUtil.ShowTips("此操作只对状态为待抽的数据有效,请重试!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("确认修改?") == DialogResult.No)
- {
- return;
- }
- ArrayList list = new ArrayList();
- inspectionNo = this.ultraGrid1.ActiveRow.Cells["inspectionNo"].Text.ToString();
- inspectionNum = this.ultraGrid1.ActiveRow.Cells["inspectionNum"].Text.ToString();
- list.Add(inspectionNo);
- list.Add(inspectionNum);
- list.Add(insflag);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.mcp.Vrp.FrmBaoJianResult";
- ccp.MethodName = "UpdateInsflag";
- ccp.ServerParams = new object[] { list };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- }
|