| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319 |
- 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 Infragistics.Win.UltraWinGrid;
- using System.Diagnostics;
- using System.Collections;
- using Newtonsoft.Json;
- namespace Core.LZMes.Client.QCM
- {
- public partial class QCM030604 : FrmBase
- {
- public QCM030604()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Judge":
- this.Judge();
- break;
- case "Cancel":
- this.canceljudge();
- break;
- case "Ex_warehouse":
- this.Ex_warehouse();
- break;
- case "Cancel_Ex_warehouse":
- this.Cancel_Ex_warehouse();
- break;
- case "Send_memo":
- this.sendMemo();
- break;
- case "Exit":
- this.Close();
- break;
- case "Export":
- this.DoExport();
- break;
- case "JudgedLG"://判定记录中的待判
- this.JudgedLG();
- break;
- case "CancelJudged"://判定记录中的取消待判
- this.CancelJudged();
- break;
- }
- }
- private void CancelJudged()
- {
- try
- {
- if (this.ultraTabControl1.SelectedTab.Index == 1)
- {
- UltraGridRow ugr = this.ultraGrid5.ActiveRow;
- string heatNo = ugr.Cells["HEAT_NO"].Value.ToString();//炉号
- string userName = this.UserInfo.GetUserName();//操作人
- int num = 0;
- string MATERIAL_NO = "[";
- foreach (UltraGridRow ugr1 in this.ultraGrid2.Rows)
- {
- if (ugr1.Cells["checked"].Text.ToString() == "True")
- {
- if (num == 0)
- {
- MATERIAL_NO += '"' + ugr1.Cells["MATERIAL_NO"].Value.ToString() + '"';
- }
- if (num != 0)
- {
- MATERIAL_NO += "," + '"' + ugr1.Cells["MATERIAL_NO"].Value.ToString() + '"';
- }
- num++;
- }
- }
- MATERIAL_NO += "]";
- if (num == 0)
- {
- this.alert("未勾选待判数据");
- return;
- }
- Dictionary<string, string> openWith = new Dictionary<string, string>();
- openWith.Add("FLAG", "1");//取消待判
- openWith.Add("HEAT_NO", heatNo);
- openWith.Add("USER_NAME", userName);
- openWith.Add("MATERIAL_NO", MATERIAL_NO);
- string sbb = JsonConvert.SerializeObject(openWith).ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "JudgedLG";
- ccp.ServerParams = new object[] { sbb };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- MessageBox.Show("取消待判成功!");
- DoQuery();
- }
- else
- {
- var dataSource = new List<string>();
- string heatNo = "";
- string userName = this.UserInfo.GetUserName();//操作人
- int num = 0;
- string MATERIAL_NO = "[";
- foreach (UltraGridRow ugr1 in this.ultraGrid1.Rows)
- {
- if (ugr1.Cells["checked"].Text.ToString() == "True")
- {
- heatNo = ugr1.Cells["HEAT_NO"].Value.ToString();//炉号
- dataSource.Add(heatNo);
- if (num == 0)
- {
- MATERIAL_NO += '"' + ugr1.Cells["MATERIAL_NO"].Value.ToString() + '"';
- }
- if (num != 0)
- {
- MATERIAL_NO += "," + '"' + ugr1.Cells["MATERIAL_NO"].Value.ToString() + '"';
- }
- num++;
- }
- }
- MATERIAL_NO += "]";
- if (num == 0)
- {
- this.alert("未勾选待判数据");
- return;
- }
- var uniqueData = dataSource.Distinct();
- int unum = 0;
- foreach (var item in uniqueData)
- {
- unum = unum + 1;
- }
- if (unum >= 2)
- {
- this.alert("只能勾选同炉号请核实数据!");
- return;
- }
- Dictionary<string, string> openWith = new Dictionary<string, string>();
- openWith.Add("FLAG", "1");//取消待判
- openWith.Add("HEAT_NO", heatNo);
- openWith.Add("USER_NAME", userName);
- openWith.Add("MATERIAL_NO", MATERIAL_NO);
- string sbb = JsonConvert.SerializeObject(openWith).ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "JudgedLG";
- ccp.ServerParams = new object[] { sbb };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- MessageBox.Show("取消待判成功!");
- DoQuery();
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void JudgedLG()
- {
- try
- {
- if (this.ultraTabControl1.SelectedTab.Index == 1)
- {
- UltraGridRow ugr = this.ultraGrid5.ActiveRow;
- string heatNo = ugr.Cells["HEAT_NO"].Value.ToString();//炉号
- string userName = this.UserInfo.GetUserName();//操作人
- //ArrayList material_no = new ArrayList();
- int num = 0;
- string MATERIAL_NO = "[";
- foreach (UltraGridRow ugr1 in this.ultraGrid2.Rows)
- {
- if (ugr1.Cells["checked"].Text.ToString() == "True")
- {
- if (num==0)
- {
- MATERIAL_NO += '"'+ugr1.Cells["MATERIAL_NO"].Value.ToString()+'"';
- }
- if (num != 0)
- {
- MATERIAL_NO +=","+ '"' + ugr1.Cells["MATERIAL_NO"].Value.ToString() + '"';
- }
- num++;
- }
- }
- MATERIAL_NO += "]";
- if (num==0)
- {
- this.alert("未勾选待判数据");
- return;
- }
- Dictionary<string, string> openWith = new Dictionary<string, string>();
- openWith.Add("FLAG", "0");//待判
- openWith.Add("HEAT_NO", heatNo);
- openWith.Add("USER_NAME", userName);
- openWith.Add("MATERIAL_NO", MATERIAL_NO);
- string sbb = JsonConvert.SerializeObject(openWith).ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "JudgedLG";
- ccp.ServerParams = new object[] { sbb };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- MessageBox.Show("待判成功!");
- DoQuery();
- }
- else
- {
- var dataSource = new List<string>();
- string heatNo = "";
- string userName = this.UserInfo.GetUserName();//操作人
- int num = 0;
- string MATERIAL_NO = "[";
- foreach (UltraGridRow ugr1 in this.ultraGrid1.Rows)
- {
- if (ugr1.Cells["checked"].Text.ToString() == "True")
- {
- heatNo = ugr1.Cells["HEAT_NO"].Value.ToString();//炉号
- dataSource.Add(heatNo);
- if (num == 0)
- {
- MATERIAL_NO += '"' + ugr1.Cells["MATERIAL_NO"].Value.ToString() + '"';
- }
- if (num != 0)
- {
- MATERIAL_NO += "," + '"' + ugr1.Cells["MATERIAL_NO"].Value.ToString() + '"';
- }
- num++;
- }
- }
- MATERIAL_NO += "]";
- if (num == 0)
- {
- this.alert("未勾选待判数据");
- return;
- }
- var uniqueData = dataSource.Distinct();
- int unum = 0;
- foreach (var item in uniqueData)
- {
- unum = unum + 1;
- }
- if (unum >= 2)
- {
- this.alert("只能勾选同炉号请核实数据!");
- return;
- }
- Dictionary<string, string> openWith = new Dictionary<string, string>();
- openWith.Add("FLAG", "0");//待判
- openWith.Add("HEAT_NO", heatNo);
- openWith.Add("USER_NAME", userName);
- openWith.Add("MATERIAL_NO", MATERIAL_NO);
- string sbb = JsonConvert.SerializeObject(openWith).ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "JudgedLG";
- ccp.ServerParams = new object[] { sbb };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- MessageBox.Show("待判成功!");
- DoQuery();
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void Ex_warehouse()
- {
- ArrayList material_no = new ArrayList();
- foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
- {
- if (ugr.Cells["checked"].Text.ToString() == "True")
- {
- //if (ugr.Cells["ISFX"].Text.ToString() == "是")
- //{
- // MessageBox.Show("物料号" + ugr.Cells["MATERIAL_NO"].Value.ToString() + "已经出库放行!");
- // return;
- //}
- material_no.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
- }
- }
- string username = this.UserInfo.GetUserName();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "ex_warehouse";
- ccp.ServerParams = new object[] { username, material_no, "4001LGX", "J" };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- MessageBox.Show("出库放行失败!");
- return;
- }
- MessageBox.Show("出库放行成功!");
- DoQuery();
- }
- private void Cancel_Ex_warehouse()
- {
- ArrayList material_no = new ArrayList();
- foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
- {
- if (ugr.Cells["checked"].Text.ToString() == "True")
- {
- if (ugr.Cells["ISFX"].Text.ToString() != "是")
- {
- MessageBox.Show("物料号" + ugr.Cells["MATERIAL_NO"].Value.ToString() + "未出库!");
- return;
- }
- material_no.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
- }
- }
- string username = this.UserInfo.GetUserName();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "cancel_ex_warehouse";
- ccp.ServerParams = new object[] { username, material_no, "4001LGX", "J" };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- MessageBox.Show("撤销出库放行失败!");
- return;
- }
- MessageBox.Show("撤销出库放行成功!");
- DoQuery();
- }
- private void Judge()
- {
- try
- {
- ArrayList material_no = new ArrayList();
- string username = this.UserInfo.GetUserName();
- ArrayList prod_name = new ArrayList();
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["checked"].Text.ToString() == "True")
- {
- material_no.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
- prod_name.Add(ugr.Cells["PROD_NAME"].Value.ToString());
- }
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "LgultimateJudgeAuto";
- ccp.ServerParams = new object[] { material_no, username, "4001LGX", prod_name };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- MessageBox.Show("综合判定成功!");
- DoQuery();
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- private void canceljudge()
- {
- try
- {
- ArrayList material_no = new ArrayList();
- string username = this.UserInfo.GetUserName();
- string again_judge_type = "";
- foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
- {
- if (ugr.Cells["checked"].Text.ToString() == "True")
- {
- material_no.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
- }
- }
- if (material_no.Count == 0)
- {
- MessageBox.Show("请在判定记录中选择需要撤销判定的产品!");
- return;
- }
- QCM030605 frm = new QCM030605();
- if (frm.ShowDialog() == DialogResult.OK)
- {
- again_judge_type = frm.Results;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "cancelLgUltimateJudge";
- ccp.ServerParams = new object[] { username, material_no, again_judge_type };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- DoQuery();
- }
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- private void sendMemo()
- {
- try
- {
- if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
- {
- ArrayList material_no = new ArrayList();
- string username = this.UserInfo.GetUserName();
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["checked"].Text.ToString() == "True")
- {
- material_no.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
- }
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "findLg2_1";
- ccp.ServerParams = new object[] { };
- ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- DataTable table1 = ccp.SourceDataTable;
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "findLg2_2";
- ccp.ServerParams = new object[] { };
- ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- DataTable table2 = ccp.SourceDataTable;
- QCM030606 frm = new QCM030606(table1, table2);
- if (frm.ShowDialog() == DialogResult.OK)
- {
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "ex_remark";
- ccp.ServerParams = new object[] { username, material_no, "4001LGX", "板坯", frm._noRedSendReason, frm._noRedirectSendReason, frm._ischk, frm._memo };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- DoQuery();
- }
- }
- if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
- {
- ArrayList material_no = new ArrayList();
- ArrayList utm_id = new ArrayList();
- string username = this.UserInfo.GetUserName();
- foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
- {
- if (ugr.Cells["checked"].Text.ToString() == "True")
- {
- material_no.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
- utm_id.Add(ugr.Cells["UTM_ID"].Value.ToString());
- }
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "findLg2_1";
- ccp.ServerParams = new object[] { };
- ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- DataTable table1 = ccp.SourceDataTable;
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "findLg2_2";
- ccp.ServerParams = new object[] { };
- ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- DataTable table2 = ccp.SourceDataTable;
- QCM030606 frm = new QCM030606(table1, table2);
- if (frm.ShowDialog() == DialogResult.OK)
- {
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "ex_remark1";
- ccp.ServerParams = new object[] { username, material_no, utm_id, "4001LGX", "板坯", frm._noRedSendReason, frm._noRedirectSendReason, frm._ischk, frm._memo };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- DoQuery();
- }
- }
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- private void DoQuery()
- {
- if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
- {
- DoQueryMe();
- }
- if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
- {
- DoQueryRe();
- }
- }
- //查询待判信息
- private void DoQueryMe()
- {
- try
- {
- this.dataSet1.Clear();
- string bbatchno = textBox1.Text.Trim();
- string prod_name = this.comboBox2.Text.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "getLgZRejudgeInfo";
- ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), bbatchno, "4001LGX", prod_name, "J" };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["SURFACERESULT_DESC"].Text.ToString() == "")
- {
- ugr.Cells["SURFACERESULT_DESC"].Appearance.BackColor = Color.Red;
- }
- if (ugr.Cells["R_CHEMRESULT_DESC"].Text.ToString() == "")
- {
- ugr.Cells["R_CHEMRESULT_DESC"].Appearance.BackColor = Color.Red;
- }
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- //查询判定记录
- private void DoQueryRe()
- {
- try
- {
- this.dataSet14.Clear();
- string bbatchno = textBox1.Text.Trim();
- //string prod_name = this.comboBox2.Text.ToString();
- //string isvalid = "0";
- //this.label20.Text = "";
- //if (checkBox1.Checked)
- //{
- // isvalid = "1";
- //}
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "GetHeatProcessInfo";
- ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), bbatchno, "4001LGX"};
- ccp.SourceDataTable = this.dataSet14.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
- //{
- // foreach (UltraGridRow ugr2 in this.ultraGrid2.Rows)
- // {
- // if (ugr2.Cells["UTM_RESULT_DESC"].Value.ToString() == "合格")
- // {
- // ugr2.Cells["UTM_RESULT_DESC"].Appearance.BackColor = Color.FromArgb(185, 235, 204);
- // ugr2.Cells["UTM_RESULT_DESC"].Appearance.ForeColor = Color.Black;
- // }
- // else
- // {
- // ugr2.Cells["UTM_RESULT_DESC"].Appearance.BackColor = Color.FromArgb(249, 198, 186);
- // ugr2.Cells["UTM_RESULT_DESC"].Appearance.ForeColor = Color.Black;
- // }
- // }
- //}
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- DoQueryR();
- DoQueryS();//表面信息
- }
- private void DoQueryS()
- {
- try
- {
- UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- if (ugr == null)
- return;
- this.dataSet7.Clear();
- if (ugr.Cells["SURFACEID"].Text.ToString() == "")
- {
- return;
- }
- string surface_id = ugr.Cells["SURFACEID"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "findNameByMN";
- ccp.ServerParams = new object[] { surface_id };
- ccp.SourceDataTable = this.dataSet7.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void DoQueryR()
- {
- try
- {
- UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- if (ugr == null)
- return;
- this.dataSet9.Clear();
- if (ugr.Cells["R_CHEMID"].Text.ToString() == "")
- {
- return;
- }
- string cic_id = ugr.Cells["R_CHEMID"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "GetLgRChemeResult";
- ccp.ServerParams = new object[] { cic_id };
- ccp.SourceDataTable = this.dataSet9.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //ccp = new CoreClientParam();
- //ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- //ccp.MethodName = "GetCheme";
- //ccp.ServerParams = new object[] { cic_id };
- //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
- //{
- // foreach (UltraGridRow ugr5 in this.ultraGrid10.Rows)
- // {
- // if (ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Value.ToString().Contains(ccp.SourceDataTable.Rows[i]["stdmin"].ToString()) && ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Value.ToString().Contains(ccp.SourceDataTable.Rows[i]["stdmax"].ToString()))
- // {
- // ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Appearance.BackColor = Color.Red;
- // }
- // }
- //}
- UltraGridRow judge_row = null;
- foreach (UltraGridRow ugst in this.ultraGrid10.Rows)
- {
- if (ccp.ReturnInfo.Contains(ugst.Cells["STD_TYPE"].Text.ToString()) && ugr.Cells["R_CHEMRESULT_DESC"].Text.ToString().Trim() != "")
- {
- ugst.Appearance.BackColor = Color.Green;
- }
- if (!ugst.Cells["STD_TYPE"].Text.ToString().Contains("标准") && !ugst.Cells["STD_TYPE"].Text.ToString().Contains("要求"))
- {
- judge_row = ugst;
- }
- if (judge_row != null)
- {
- foreach (UltraGridRow ugs in this.ultraGrid10.Rows)
- {
- if (!string.IsNullOrEmpty(ugs.Cells["STD_TYPE"].Text) && (ugs.Cells["STD_TYPE"].Text.ToString() == "放行标准(熔炼)" || ugs.Cells["STD_TYPE"].Text.ToString() == "交付标准(熔炼)" || ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)"))
- {
- for (int i = 0; i < ugs.Cells.Count; i++)
- {
- if (!string.IsNullOrEmpty(ugs.Cells[i].Text) && ugs.Cells[i].Text.ToString().Contains(" "))
- {
- string[] str_arr = ugs.Cells[i].Text.ToString().Replace(" ", "#").Split('#');
- if (str_arr.Length == 1)
- {
- if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
- {
- if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
- {
- judge_row.Cells[i].Appearance.BackColor = Color.Red;
- judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
- {
- ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- }
- }
- }
- else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
- {
- if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
- {
- judge_row.Cells[i].Appearance.BackColor = Color.Red;
- judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
- {
- ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- }
- }
- }
- else if (string.IsNullOrEmpty(judge_row.Cells[i].Text))
- {
- judge_row.Cells[i].Appearance.BackColor = Color.Red;
- judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
- {
- ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- }
- }
- }
- else if (str_arr.Length == 2)
- {
- if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
- {
- if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
- {
- judge_row.Cells[i].Appearance.BackColor = Color.Red;
- judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
- {
- ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- }
- }
- }
- else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
- {
- if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
- {
- judge_row.Cells[i].Appearance.BackColor = Color.Red;
- judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
- {
- ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- }
- }
- }
- if (str_arr[1].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
- {
- if (double.Parse(str_arr[1].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
- {
- judge_row.Cells[i].Appearance.BackColor = Color.Red;
- judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
- {
- ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- }
- }
- }
- else if (str_arr[1].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
- {
- if (double.Parse(str_arr[1].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
- {
- judge_row.Cells[i].Appearance.BackColor = Color.Red;
- judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
- {
- ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- }
- }
- }
- else if (string.IsNullOrEmpty(judge_row.Cells[i].Text))
- {
- judge_row.Cells[i].Appearance.BackColor = Color.Red;
- judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
- {
- ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void QCM030604_Load(object sender, EventArgs e)
- {
- this.comboBox2.SelectedIndex = 0;
- this.checkBox1.Checked = true;
- this.checkBox1.Visible = false;
- this.label19.Visible = false;
- this.label20.Visible = false;
- this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
- this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
- this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3);
- }
- private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
- {
- DoQueryR1();
- DoQueryS1();//表面信息
- }
- private void DoQueryS1()
- {
- try
- {
- UltraGridRow ugr = this.ultraGrid2.ActiveRow;
- if (ugr == null)
- return;
- this.dataSet12.Clear();
- if (ugr.Cells["SFU_ID"].Text.ToString() == "")
- {
- return;
- }
- string surface_id = ugr.Cells["SFU_ID"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "findNameByMN";
- ccp.ServerParams = new object[] { surface_id };
- ccp.SourceDataTable = this.dataSet12.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void DoQueryR1()
- {
- try
- {
- UltraGridRow ugr = this.ultraGrid2.ActiveRow;
- if (ugr == null)
- return;
- this.dataSet13.Clear();
- if (ugr.Cells["R_CIC_ID"].Text.ToString() == "")
- {
- return;
- }
- string cic_id = ugr.Cells["R_CIC_ID"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "GetLgRChemeResult";
- ccp.ServerParams = new object[] { cic_id };
- ccp.SourceDataTable = this.dataSet13.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //ccp = new CoreClientParam();
- //ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- //ccp.MethodName = "GetCheme";
- //ccp.ServerParams = new object[] { cic_id };
- //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
- //{
- // foreach (UltraGridRow ugr5 in this.ultraGrid10.Rows)
- // {
- // if (ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Value.ToString().Contains(ccp.SourceDataTable.Rows[i]["stdmin"].ToString()) && ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Value.ToString().Contains(ccp.SourceDataTable.Rows[i]["stdmax"].ToString()))
- // {
- // ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Appearance.BackColor = Color.Red;
- // }
- // }
- //}
- UltraGridRow judge_row = null;
- foreach (UltraGridRow ugst in this.ultraGrid4.Rows)
- {
- if (ccp.ReturnInfo.Contains(ugst.Cells["STD_TYPE"].Text.ToString()))
- {
- ugst.Appearance.BackColor = Color.Green;
- }
- if (!ugst.Cells["STD_TYPE"].Text.ToString().Contains("标准") && !ugst.Cells["STD_TYPE"].Text.ToString().Contains("要求"))
- {
- judge_row = ugst;
- }
- if (judge_row != null)
- {
- foreach (UltraGridRow ugs in this.ultraGrid4.Rows)
- {
- if (!string.IsNullOrEmpty(ugs.Cells["STD_TYPE"].Text) && (ugs.Cells["STD_TYPE"].Text.ToString() == "放行标准(熔炼)" || ugs.Cells["STD_TYPE"].Text.ToString() == "交付标准(熔炼)" || ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)"))
- {
- for (int i = 0; i < ugs.Cells.Count; i++)
- {
- if (!string.IsNullOrEmpty(ugs.Cells[i].Text) && ugs.Cells[i].Text.ToString().Contains(" "))
- {
- string[] str_arr = ugs.Cells[i].Text.ToString().Replace(" ", "#").Split('#');
- if (str_arr.Length == 1)
- {
- if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
- {
- if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
- {
- judge_row.Cells[i].Appearance.BackColor = Color.Red;
- if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
- {
- ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- }
- }
- }
- else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
- {
- if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
- {
- judge_row.Cells[i].Appearance.BackColor = Color.Red;
- if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
- {
- ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- }
- }
- }
- else if (string.IsNullOrEmpty(judge_row.Cells[i].Text))
- {
- judge_row.Cells[i].Appearance.BackColor = Color.Red;
- if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
- {
- ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- }
- }
- }
- else if (str_arr.Length == 2)
- {
- if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
- {
- if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
- {
- judge_row.Cells[i].Appearance.BackColor = Color.Red;
- if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
- {
- ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- }
- }
- }
- else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
- {
- if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
- {
- judge_row.Cells[i].Appearance.BackColor = Color.Red;
- if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
- {
- ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- }
- }
- }
- if (str_arr[1].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
- {
- if (double.Parse(str_arr[1].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
- {
- judge_row.Cells[i].Appearance.BackColor = Color.Red;
- if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
- {
- ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- }
- }
- }
- else if (str_arr[1].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
- {
- if (double.Parse(str_arr[1].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
- {
- judge_row.Cells[i].Appearance.BackColor = Color.Red;
- if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
- {
- ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- }
- }
- }
- else if (string.IsNullOrEmpty(judge_row.Cells[i].Text))
- {
- judge_row.Cells[i].Appearance.BackColor = Color.Red;
- if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")
- {
- ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void ultraTabControl1_Click(object sender, EventArgs e)
- {
- if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
- {
- this.label4.Text = "判定时间";
- this.checkBox1.Visible = true;
- this.label19.Visible = true;
- this.label20.Visible = true;
- this.dateTimePicker1.Value = System.DateTime.Now;
- }
- if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
- {
- this.label4.Text = "生产时间";
- this.checkBox1.Visible = false;
- this.label19.Visible = false;
- this.label20.Visible = false;
- this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3);
- }
- }
- private void DoExport()
- {
- try
- {
- //if (this.ultraGrid2.Rows.Count == 0)
- //{
- // MessageBox.Show("没有可以导出的数据", "提示");
- // return;
- //}
- this.dataSet2.Clear();
- string prod_name = this.comboBox2.Text.ToString();
- string isvalid = "0";
- if (checkBox1.Checked)
- {
- isvalid = "1";
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "getLgZjudgeInfo";
- ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), "", "4001LGX", prod_name, "J", isvalid };
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
- {
- string fName = this.saveFileDialog1.FileName;
- this.ultraGridExcelExporter1.Export(this.ultraGrid2, fName);
- Process.Start(fName);
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void label9_Click(object sender, EventArgs e)
- {
- CoreClientParam ccp = new CoreClientParam();
- foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
- {
- if (ugr.Cells["checked"].Text.ToString() == "True")
- {
- string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
- string length = this.textBox4.Text.ToString();
- string width = this.textBox3.Text.ToString();
- string thick = this.textBox2.Text.ToString();
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "upLGSize";
- ccp.ServerParams = new object[] { material_no, length, width, thick };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- ugr.Cells["checked"].Value = "False";
- }
- }
- MessageBox.Show("登记成功");
- }
- private void label8_Click(object sender, EventArgs e)
- {
- CoreClientParam ccp = new CoreClientParam();
- foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
- {
- if (ugr.Cells["checked"].Text.ToString() == "True")
- {
- string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
- string check_remarks = this.checkBoxComboBox2.Text.ToString();
- string fix_remarks = this.checkBoxComboBox1.Text.ToString();
- string pline = "4001LGX";
- string username = this.UserInfo.GetUserName().ToString();
- string prod_type = this.comboBox2.Text.ToString();
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "upLGMemo";
- ccp.ServerParams = new object[] { material_no, fix_remarks, check_remarks, pline, username, prod_type };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- ugr.Cells["checked"].Value = "False";
- }
- }
- this.checkBoxComboBox2.Text = "";
- this.checkBoxComboBox1.Text = "";
- MessageBox.Show("登记成功");
- }
- private void label12_Click(object sender, EventArgs e)
- {
- CoreClientParam ccp = new CoreClientParam();
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["checked"].Text.ToString() == "True")
- {
- string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
- string check_remarks = this.checkBoxComboBox3.Text.ToString();
- string fix_remarks = this.checkBoxComboBox4.Text.ToString();
- string pline = "4001LGX";
- string username = this.UserInfo.GetUserName().ToString();
- string prod_type = this.comboBox2.Text.ToString();
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "upLGMemo1";
- ccp.ServerParams = new object[] { material_no, fix_remarks, check_remarks, pline, username, prod_type };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- ugr.Cells["checked"].Value = "False";
- }
- }
- this.checkBoxComboBox3.Text = "";
- this.checkBoxComboBox4.Text = "";
- MessageBox.Show("登记成功");
- }
- private void label16_Click(object sender, EventArgs e)
- {
- CoreClientParam ccp = new CoreClientParam();
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["checked"].Text.ToString() == "True")
- {
- string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
- string length = this.textBox5.Text.ToString();
- string width = this.textBox6.Text.ToString();
- string thick = this.textBox7.Text.ToString();
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "upLGSize1";
- ccp.ServerParams = new object[] { material_no, length, width, thick };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- ugr.Cells["checked"].Value = "False";
- }
- }
- MessageBox.Show("登记成功");
- }
- private void textBox5_TextChanged(object sender, EventArgs e)
- {
- }
- private void label17_Click(object sender, EventArgs e)
- {
- }
- private void label15_Click(object sender, EventArgs e)
- {
- }
- private void textBox6_TextChanged(object sender, EventArgs e)
- {
- }
- private void textBox7_TextChanged(object sender, EventArgs e)
- {
- }
- private void label18_Click(object sender, EventArgs e)
- {
- }
- private void ultraGrid2_AfterCellUpdate(object sender, CellEventArgs e)
- {
- }
- private void ultraGrid2_BeforeCellUpdate(object sender, BeforeCellUpdateEventArgs e)
- {
- }
- private void ultraGrid2_ClickCell(object sender, ClickCellEventArgs e)
- {
- }
- private void ultraGrid2_CellChange(object sender, CellEventArgs e)
- {
- UltraGridRow ugr1 = this.ultraGrid2.ActiveRow;
- //this.ultraGrid2.DisplayLayout.Bands[0].Header.Column["选择"]
- string ss = "";
- string s1 = "";
- if (ugr1.Cells["checked"] == e.Cell)
- {
- double sum = 0.0;
- foreach (UltraGridRow ugr in ultraGrid2.Rows)
- {
- if (ugr.Cells["checked"].Text.ToString() == "True")
- {
- ss = ugr.Cells["THEORYWEIGHT"].Value.ToString();
- s1 = ugr.Cells["THEORYWEIGHT"].Text.ToString();
- if (ugr.Cells["THEORYWEIGHT"].Value != null && ugr.Cells["THEORYWEIGHT"].Text.ToString() != "")
- {
- sum += Convert.ToDouble(ugr.Cells["THEORYWEIGHT"].Value);
- this.label20.Text = sum.ToString();
- }
- }
- else
- {
- this.label20.Text = sum.ToString();
- }
- }
- }
- }
- private void ultraGrid2_AfterCellUpdate_1(object sender, CellEventArgs e)
- {
- double sum = 0.0;
- foreach (UltraGridRow ugr in ultraGrid2.Rows)
- {
- if (ugr.Cells["checked"].Text.ToString() == "True")
- {
- if (ugr.Cells["THEORYWEIGHT"].Value != null && ugr.Cells["THEORYWEIGHT"].Text.ToString() != "")
- {
- sum += Convert.ToDouble(ugr.Cells["THEORYWEIGHT"].Value);
- this.label20.Text = sum.ToString();
- }
- }
- else
- {
- this.label20.Text = sum.ToString();
- }
- }
- }
- private void ultraGrid5_AfterRowActivate(object sender, EventArgs e)
- {
- try
- {
- UltraGridRow ugr = this.ultraGrid5.ActiveRow;
- this.dataSet2.Clear();
- string bbatchno = ugr.Cells["HEAT_NO"].Value.ToString();
- string prod_name = ugr.Cells["PLATE_TYPE"].Value.ToString();
- string isvalid = "0";
- this.label20.Text = "";
- if (checkBox1.Checked)
- {
- isvalid = "1";
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "getLgZjudgeInfo";
- ccp.ServerParams = new object[] { "", "", bbatchno, "4001LGX", prod_name, "J", isvalid };
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
- //{
- // foreach (UltraGridRow ugr2 in this.ultraGrid2.Rows)
- // {
- // if (ugr2.Cells["UTM_RESULT_DESC"].Value.ToString() == "合格")
- // {
- // ugr2.Cells["UTM_RESULT_DESC"].Appearance.BackColor = Color.FromArgb(185, 235, 204);
- // ugr2.Cells["UTM_RESULT_DESC"].Appearance.ForeColor = Color.Black;
- // }
- // else
- // {
- // ugr2.Cells["UTM_RESULT_DESC"].Appearance.BackColor = Color.FromArgb(249, 198, 186);
- // ugr2.Cells["UTM_RESULT_DESC"].Appearance.ForeColor = Color.Black;
- // }
- // }
- //}
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
-
- }
- }
|