| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784 |
- 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 Infragistics.Win.UltraWinGrid;
- using Infragistics.Win;
- using System.Collections;
- using CoreFS.CA06;
- using System.Diagnostics;
- namespace Core.LZMes.Client.QCM
- {
- public partial class QCM030305 : FrmBase
- {
- public QCM030305()
- {
- InitializeComponent();
- }
- private string prodline = "";
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Judge":
- Operate();
- break;
- case "FB":
- fb();
- break;
- case "Cancel_FB":
- cancel_fb();
- break;
- case "Exit":
- this.Close();
- break;
- case "Export":
- this.DoExport();
- break;
- case "Export1":
- this.DoExport1();
- break;
- }
- }
- private void DoQuery()
- {
- if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
- {
- DoQueryMe();
- }
- if (this.ultraTabControl1.Tabs[1].Selected) //表面判定记录
- {
- DoQueryRe();
- }
- if (this.ultraTabControl1.Tabs[2].Selected) //公差判定记录
- {
- DoQueryRe1();
- }
- }
- private void DoQueryMe()
- {
- //查询探伤待检信息(轧批号、计划号)
- try
- {
- this.dataSet3.Clear();
- dataSet6.Clear();
- string starttime = "";
- string endtime = "";
- if (checkBox2.Checked)
- {
- starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
- endtime = this.dateTimePicker2.Value.AddDays(1).ToString("yyyyMMdd");
- }
- string sbatchno = "";
- string ebatchno = "";
- if (checkBox3.Checked)
- {
- sbatchno = this.textBox2.Text.Trim();
- if (textBox1.Text.ToString() == "")
- {
- ebatchno = this.textBox2.Text.Trim();
- }
- else
- {
- ebatchno = this.textBox1.Text.Trim();
- }
- }
- if (!checkBox2.Checked && !checkBox3.Checked)
- {
- MessageBox.Show("时间与轧批号必须选择其中一个条件!");
- return;
- }
- string orderno = this.textBox4.Text.Trim();// 订单号
- string psc = textBox3.Text.Trim(); //产品描述
- string stellname = this.textBox7.Text.Trim();
- //string prodline = "连退";
- string isjudge = this.comboBox4.Text.ToString();
- //string stellname = this.textBox7.Text.Trim();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "doQueryMaterialDetailsJ2";
- ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, "MB", prodline, isjudge, stellname };
- ccp.SourceDataTable = this.dataSet3.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
-
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "findFlawDataJ";
- ccp.ServerParams = new object[] { prodline };
- ccp.SourceDataTable = this.dataSet6.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- ultraCombo1.DataSource = ccp.SourceDataTable;
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1;
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown;
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].AutoCompleteMode = Infragistics.Win.AutoCompleteMode.SuggestAppend;
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].FilterOperandDropDownItems = FilterOperandDropDownItems.CellValues;
-
- //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].AllowRowFiltering = Infragistics.Win.AutoCompleteMode.Append;
-
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void DoQueryRe()
- {
- //查询判定记录
- try
- {
- this.dataSet2.Clear();
- string starttime = "";
- string endtime = "";
- if (checkBox2.Checked)
- {
- starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
- endtime = this.dateTimePicker2.Value.ToString("yyyyMMdd");
- }
- string sbatchno = "";
- string ebatchno = "";
- if (checkBox3.Checked)
- {
- sbatchno = this.textBox2.Text.Trim();
- if (textBox1.Text.ToString() == "")
- {
- ebatchno = this.textBox2.Text.Trim();
- }
- else
- {
- ebatchno = this.textBox1.Text.Trim();
- }
- }
- if (!checkBox2.Checked && !checkBox3.Checked)
- {
- MessageBox.Show("时间与轧批号必须选择其中一个条件!");
- return;
- }
- string orderno = textBox4.Text.Trim();
- string psc = textBox3.Text.Trim();
- string stellname = this.textBox7.Text.Trim();
- //string prodline = "连退";
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "GetSurfaceInfoJ";
- ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, prodline, stellname };
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void DoQueryRe1()
- {
- try
- {
- this.dataSet9.Clear();
-
- string starttime = "";
- string endtime = "";
- if (checkBox2.Checked)
- {
- starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
- endtime = this.dateTimePicker2.Value.ToString("yyyyMMdd");
- }
- string sbatchno = "";
- string ebatchno = "";
- if (checkBox3.Checked)
- {
- sbatchno = this.textBox2.Text.Trim();
- if (textBox1.Text.ToString() == "")
- {
- ebatchno = this.textBox2.Text.Trim();
- }
- else
- {
- ebatchno = this.textBox1.Text.Trim();
- }
- }
- if (!checkBox2.Checked && !checkBox3.Checked)
- {
- MessageBox.Show("时间与轧批号必须选择其中一个条件!");
- return;
- }
- string orderno = this.textBox4.Text.Trim();// 订单号
- string psc = textBox3.Text.Trim(); //产品描述
- string stellname = this.textBox7.Text.Trim();
- //string prodline = "连退";
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "GetMeasureInfoJ";
- ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, prodline, stellname };
- ccp.SourceDataTable = this.dataSet9.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void Operate()
- {
- string material_no = "";
- try
- {
- UltraGridRow ugr = this.ultraGrid3.ActiveRow;
- if (ugr == null)
- return;
- CoreClientParam ccp = new CoreClientParam();
- foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
- {
- if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
- {
- string surfaceid = ugrs.Cells["SURFACE_ID"].Value.ToString();
- string username = this.UserInfo.GetUserName();
- string userorder = this.UserInfo.GetUserOrderText();
- string usergroup = this.UserInfo.GetUserGroupText();
- string flag = "";
- if (ugrs.Cells["PRIMARY_FLAG"].Text.ToString().Contains("是"))
- {
- flag = "1";
- }
- else
- {
- flag = "0";
- }
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "repairFlaw";
- ccp.ServerParams = new object[] { surfaceid, ugrs.Cells["FLAW_SEQ"].Value.ToString(), flag, username, userorder, usergroup };
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- }
- this.dataSet4.Clear();
- string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "findNameByMN";
- ccp.ServerParams = new object[] { surface_id };
- ccp.SourceDataTable = this.dataSet4.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void fb()
- {
- try
- {
- List<UltraGridRow> lists = new List<UltraGridRow>();
- foreach (UltraGridRow ugr in ultraGrid3.Rows)
- {
- if (ugr.Cells["CHECK"].Text.ToString() == "True")
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "coiljudge_status_call_commit";
- ccp.ServerParams = new object[] { ugr.Cells["PLINE_CODE"].Value.ToString()
- , ugr.Cells["MATERIAL_NO"].Value.ToString()
- , ""
- , ""
- , ""
- , ""
- , ""
- , "Y"
- , txt_fb_reason.Text,""};
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- lists.Add(ugr);
- }
- }
- for (int i = 0; i < lists.Count; i++)
- {
- lists[i].Delete(false);
- }
- //DoQuery();
- MessageBox.Show("封闭成功!");
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void cancel_fb()
- {
- try
- {
- List<UltraGridRow> lists = new List<UltraGridRow>();
- foreach (UltraGridRow ugr in ultraGrid3.Rows)
- {
- if (ugr.Cells["CHECK"].Text.ToString() == "True")
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "coiljudge_status_call_commit";
- ccp.ServerParams = new object[] { ugr.Cells["PLINE_CODE"].Value.ToString()
- , ugr.Cells["MATERIAL_NO"].Value.ToString()
- , ""
- , ""
- , ""
- , ""
- , ""
- , "N"
- , txt_fb_reason.Text,""};
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- lists.Add(ugr);
- }
- }
- for (int i = 0; i < lists.Count; i++)
- {
- lists[i].Delete(false);
- }
- //DoQuery();
- MessageBox.Show("解除封闭成功!");
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void label9_Click(object sender, EventArgs e)
- {
-
- }
- public static bool IsNumberal(string input)
- {
- bool flag = true;
- int count = 0;
- int count1 = 0;
- if (input.Length == 0)
- {
- flag = false;
- }
- else
- {
- char[] x = input.ToCharArray();
- for (int i = 0; i < input.Length; i++)
- {
- if (!char.IsNumber(x[i]) && x[i] != '.' && x[i] != '-')
- {
- flag = false; break;
- }
- if (x[i] == '.')
- {
- count++;
- if (i == 0 || i == input.Length - 1) flag = false;
- }
- if (x[i] == '-')
- {
- count1++;
- if (i > 1) flag = false;
- }
- }
- if (count > 1 || count1 > 1) flag = false;
- }
- return flag;
- }
- private void QCM030305_Load(object sender, EventArgs e)
- {
- //获取自定义参数
- if (!this.CustomInfo.Equals(""))
- {
- prodline = this.CustomInfo;
- }
- //this.comboBox3.SelectedIndex = 0;
- this.comboBox4.SelectedIndex = 0;
- //string prodline = "连退";
- this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
- this.ultraGrid3.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
- this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3);
- this.ultraGrid1.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
- this.ultraGrid3.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
- this.ultraGrid4.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightBlue;
- ValueList vis_repair = new ValueList();
- vis_repair.ValueListItems.Add("0", "待修复");
- vis_repair.ValueListItems.Add("1", "已修复");
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["IS_REPAIR"].ValueList = vis_repair;
- ValueList vprimary_flag = new ValueList();
- vprimary_flag.ValueListItems.Add("1", "是");
- vprimary_flag.ValueListItems.Add("0", "否");
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["PRIMARY_FLAG"].ValueList = vprimary_flag;
- ValueList vFLAW_DESC = new ValueList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "findJFlawArea";
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
- {
- vFLAW_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
- }
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_AREA"].ValueList = vFLAW_DESC;
- ValueList vflaw_pos_desc = new ValueList();
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "findJFlawPosDesc";
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
- {
- vflaw_pos_desc.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
- }
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_POS_DESC"].ValueList = vflaw_pos_desc;
- ValueList vsflv1 = new ValueList();
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "findSfLv";
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
- {
- vsflv1.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
- }
- this.comboBox2.DataSource = vsflv1.ValueListItems;
- ValueList vsflv2 = new ValueList();
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "findSfLv";
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
- {
- vsflv2.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
- }
- this.comboBox5.DataSource = vsflv2.ValueListItems;
- ValueList VFLAW_SIZE_DESC = new ValueList();
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "findJFlawSizeDesc";
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
- {
- VFLAW_SIZE_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
- }
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_SIZE_DESC"].ValueList = VFLAW_SIZE_DESC;
- ValueList VFLAW_LV_DESC = new ValueList();
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "findJFlawLvDesc";
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
- {
- VFLAW_LV_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
- }
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_LV_DESC"].ValueList = VFLAW_LV_DESC;
- ValueList VFLAW_DIR_DESC = new ValueList();
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "findJFlawDirDesc";
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
- {
- VFLAW_DIR_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
- }
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DIR_DESC"].ValueList = VFLAW_DIR_DESC;
- //ccp = new CoreClientParam();
- //ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- //ccp.MethodName = "findFlawDataJ";
- //ccp.ServerParams = new object[] {prodline };
- //ccp.SourceDataTable = this.dataSet6.Tables[0];
- //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- ////ValueList VDEFECT_DESC = new ValueList();
- ////for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++)
- ////{
- //// VDEFECT_DESC.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["DEFECT_CODE"].ToString(), ccp.SourceDataTable.Rows[i]["DEFECT_DESC"].ToString());
- ////}
- ////this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = VDEFECT_DESC;
- ////this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = VDEFECT_DESC;
- //UltraCombo uc;
- //uc = new UltraCombo();
- //uc.BindingContext = this.BindingContext;
- //uc.DataSource = ccp.SourceDataTable;
- //this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].ValueList = new BindableValueList(ccp.SourceDataTable, "", "DEFECT_NAME", "DEFECT_CODE", this.ultraGrid4);
- DoQuery();
- }
- private void ultraGrid3_AfterRowActivate(object sender, EventArgs e)
- {
- try
- {
- UltraGridRow ugr = this.ultraGrid3.ActiveRow;
- this.dataSet4.Clear();
- string surface_id = ugr.Cells["SURFACE_ID"].Value.ToString();
- if (surface_id != "")
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "findNameByMN";
- ccp.ServerParams = new object[] { surface_id };
- ccp.SourceDataTable = this.dataSet4.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString();
- if (design_key != "")
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "GetMemo";
- ccp.ServerParams = new object[] { design_key };
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- if (ccp.SourceDataTable.Rows.Count == 0)
- {
- this.textBox6.Text = "";
- }
- else
- {
- this.textBox6.Text = ccp.SourceDataTable.Rows[0]["MEMO"].ToString();
- }
- }
- this.dataSet7.Clear();
- string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
- CoreClientParam ccp1 = new CoreClientParam();
- ccp1.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp1.MethodName = "getToleranceJ";
- ccp1.ServerParams = new object[] { design_key, material_no };
- ccp1.SourceDataTable = this.dataSet7.Tables[0];
- this.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal);
- this.ultraGrid4.DisplayLayout.Bands[0].Columns["FLAW_DESC"].EditorComponent = ultraCombo1;
- foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
- {
- if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复"))
- {
- ugrs.Appearance.BackColor = Color.Pink;
- }
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- try
- {
- UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- if (ugr == null)
- return;
- this.dataSet5.Clear();
- string surface_id = ugr.Cells["SURFACE_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.dataSet5.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- foreach (UltraGridRow ugrs in this.ultraGrid5.Rows)
- {
- if (ugrs.Cells["IS_REPAIR"].Text.ToString().Contains("已修复"))
- {
- ugrs.Appearance.BackColor = Color.Pink;
- }
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- foreach (UltraGridRow ugr in this.ultraGrid3.Rows.Where(p => p.IsFilteredOut == false).ToList())
- {
- if (checkBox1.Checked)
- {
- ugr.Cells["CHECK"].Value = "True";
- }
- else
- {
- ugr.Cells["CHECK"].Value = "False";
- }
- }
- }
- private void ultraTabControl1_Click(object sender, EventArgs e)
- {
- if (this.ultraTabControl1.Tabs[1].Selected || this.ultraTabControl1.Tabs[2].Selected) //判定记录
- {
- this.label11.Visible = false;
- this.comboBox4.Visible = false;
- this.label12.Text = "判定时间";
- }
- if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
- {
- this.label11.Visible = true;
- this.comboBox4.Visible = true;
- this.label12.Text = "生产时间";
- }
- }
- private void DoExport()
- {
- try
- {
- if (this.ultraGrid1.Rows.Count == 0)
- {
- MessageBox.Show("没有可以导出的已检验的表面数据", "提示");
- return;
- }
- if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
- {
- string fName = this.saveFileDialog1.FileName;
- this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName);
- Process.Start(fName);
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
-
- //DoQuery();
- }
- private void ultraGrid4_InitializeLayout(object sender, InitializeLayoutEventArgs e)
- {
- }
- private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
- {
- try
- {
-
- UltraGridRow ugr = this.ultraGrid2.ActiveRow;
- if (ugr == null)
- return;
- this.dataSet10.Clear();
- string sic = ugr.Cells["SIC_ID"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "getToleranceInfoNew";
- ccp.ServerParams = new object[] { sic };
- ccp.SourceDataTable = this.dataSet10.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- this.dataSet8.Clear();
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "getQcmJudgeMeasureJ";
- ccp.ServerParams = new object[] { sic };
- ccp.SourceDataTable = this.dataSet8.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void ultraGrid2_InitializeLayout(object sender, InitializeLayoutEventArgs e)
- {
- }
- private void DoExport1()
- {
- try
- {
- if (this.ultraGrid2.Rows.Count == 0)
- {
- MessageBox.Show("没有可以导出的已检验公差数据", "提示");
- return;
- }
- 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 button3_Click(object sender, EventArgs e)
- {
- try
- {
- int count = 0;
- foreach (UltraGridRow ugr in this.ultraGrid3.Rows)
- {
- if (ugr.Cells["CHECK"].Text.ToString() == "True")
- {
- count++;
- }
- }
- List<UltraGridRow> lists = new List<UltraGridRow>();
- foreach (UltraGridRow ugr in ultraGrid3.Rows)
- {
- if (ugr.Cells["CHECK"].Text.ToString() == "True")
- {
- ArrayList list4 = new ArrayList();
- List<ArrayList> list5 = new List<ArrayList>();
- if (comboBox3.Text.Trim() == "")
- {
- MessageBox.Show("请输入表面检验结果!");
- return;
- }
- //if (comboBox2.Text.Trim() == "")
- //{
- // MessageBox.Show("请输入质量等级!");
- // return;
- //}
- string is_pass = "";
- string is_zl = "";
- if (comboBox3.Text.ToString() == "合格")
- {
- is_pass = "1";
- }
- else if (comboBox3.Text.ToString() == "不合格")
- {
- is_pass = "2";
- }
- else if (comboBox3.Text.ToString() == "待判")
- {
- is_pass = "0";
- }
- else
- {
- is_pass = "";
- }
- if (comboBox5.Text.ToString() == "正品")
- {
- is_zl = "512601";
- }
- else if (comboBox5.Text.ToString() == "次品")
- {
- is_zl = "512602";
- }
- else if (comboBox5.Text.ToString() == "废品")
- {
- is_zl = "512603";
- }
- else if (comboBox5.Text.ToString() == "协议品")
- {
- is_zl = "512604";
- }
- else if (comboBox5.Text.ToString() == "订单外")
- {
- is_zl = "512605";
- }
- else if (comboBox5.Text.ToString() == "待处理")
- {
- is_zl = "512606";
- }
- list4.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
- list4.Add(is_pass);//检验结果代码
- list4.Add(comboBox3.Text.Trim().ToString());//检验结果
- list4.Add(is_zl);//质量等级代码
- list4.Add(comboBox5.Text.Trim().ToString());//质量等级名称
- list4.Add(textBox5.Text.ToString().Trim());
- list4.Add(this.UserInfo.GetUserName());//操作人
- list4.Add(this.UserInfo.GetUserOrderText());//班次
- list4.Add(this.UserInfo.GetUserGroupText());//班组
- int count1 = 0;
- int i = 0;
- foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
- {
- if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
- {
- int j = 2;
- ArrayList list = new ArrayList();
- if (ugrs.Cells["QUEXIAN_TP"].Value.ToString() == "")
- {
- MessageBox.Show("请选择缺陷来源次!", "提示");
- return;
- }
- if (ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "1")
- i++;
- list.Add(ugrs.Cells["PRIMARY_FLAG"].Value.ToString());
- if (ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "1")
- {
- list.Add("1");
- j = j - 1;
- }
- else
- {
- list.Add(j);
- }
- if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
- {
- list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
- }
- else
- {
- list.Add(ugrs.Cells["FLAW_DESC"].Value.ToString());
- }
- list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
- if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
- {
- MessageBox.Show("已选择的请录入缺陷信息!");
- return;
- }
- if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上表面")
- {
- list.Add("U");
- }
- else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "下表面")
- {
- list.Add("D");
- }
- else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "边部")
- {
- list.Add("E");
- }
- else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "钢卷侧面")
- {
- list.Add("A");
- }
- else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上下表面都有,且不对称")
- {
- list.Add("N");
- }
- else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上下表面都有,且对称")
- {
- list.Add("S");
- }
- else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上凸下凹")
- {
- list.Add("T");
- }
- else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上凹下凸")
- {
- list.Add("B");
- }
- else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "已跟踪去重卷切除")
- {
- list.Add("C");
- }
- else
- {
- list.Add("");
- }
- //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Value.ToString());
- //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Text.ToString());
- if (ugrs.Cells["FLAW_POS_DESC"].Text.ToString() == "")
- {
- list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
- }
- else
- {
- list.Add(ugrs.Cells["FLAW_POS_DESC"].Value.ToString());
- }
- list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
- if (ugrs.Cells["FLAW_DIR_DESC"].Text.ToString() == "")
- {
- list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
- }
- else
- {
- list.Add(ugrs.Cells["FLAW_DIR_DESC"].Value.ToString());
- }
- list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
- if (ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString() == "")
- {
- list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
- }
- else
- {
- list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Value.ToString());
- }
- list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
- if (ugrs.Cells["FLAW_LV_DESC"].Text.ToString() == "")
- {
- list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
- }
- else
- {
- list.Add(ugrs.Cells["FLAW_LV_DESC"].Value.ToString());
- }
- list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
- //if (!IsNumberal(ugrs.Cells["FLAW_QUANTITY"].Text))
- //{
- // MessageBox.Show("数量请输入数字!");
- // return;
- //}
- list.Add(ugrs.Cells["FLAW_QUANTITY"].Text.ToString());
- list.Add(ugrs.Cells["MEMO"].Text.ToString());
- if (ugrs.Cells["IS_REPAIR"].Text.ToString() == "")
- {
- list.Add("0");
- }
- else
- {
- list.Add(ugrs.Cells["IS_REPAIR"].Value.ToString());
- }
- list.Add(ugrs.Cells["QUEXIAN_TP"].Value.ToString());
- count1++;
- j++;
- list5.Add(list);
- }
- }
- if (count1 == 0 && comboBox3.Text.ToString() == "不合格")
- {
- MessageBox.Show("请录入缺陷信息并选择!");
- return;
- }
- if (i == 0 && comboBox3.Text.ToString() == "不合格")
- {
- MessageBox.Show("请录入主要缺陷!");
- return;
- }
- //if (i > 1)
- //{
- // MessageBox.Show("请不要录入多条主要缺陷!");
- // return;
- //}
- if ((comboBox3.Text.ToString() == "合格" && comboBox5.Text.ToString() != "正品") || (comboBox3.Text.ToString() == "不合格" && comboBox5.Text.ToString() == "正品"))
- {
- MessageBox.Show("检验结果与质量等级不一致!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "doAddFlawJ";
- ccp.ServerParams = new object[] { list5, list4 };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- }
- }
- foreach (UltraGridRow ugr in this.ultraGrid3.Rows)
- {
- if (ugr.Cells["CHECK"].Text.ToString() == "True")
- {
- if ((ugr.Cells["VAL"].Text.ToString() != "") || (ugr.Cells["VAL_2"].Text.ToString() != "") &&
- (ugr.Cells["VAL2"].Text.ToString() != "" && ugr.Cells["VAL2_2"].Text.ToString() != ""))
- {
- ArrayList list1 = new ArrayList();
- List<ArrayList> list2 = new List<ArrayList>();
- List<ArrayList> list3 = new List<ArrayList>();
- list1.Add(ugr.Cells["DESIGN_KEY"].Value.ToString());
- list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
- if (comboBox1.Text.ToString() == "待判")
- {
-
- list1.Add("0");
- list1.Add("待判");
- }
- else
- {
- list1.Add("");
- list1.Add("");
- }
-
-
- //else
- //{
- // if (comboBox1.Text.ToString() == "合格")
- // {
- // list1.Add("1");
- // list1.Add("合格");
- // }
- // else if (comboBox1.Text.ToString() == "不合格")
- // {
- // list1.Add("2");
- // list1.Add("不合格");
- // }
- // else
- // {
- // list1.Add("0");
- // list1.Add("待判");
- // }
- //}
- string is_zl = "";
- if (comboBox2.Text.ToString() == "正品")
- {
- is_zl = "512601";
- }
- else if (comboBox2.Text.ToString() == "次品")
- {
- is_zl = "512602";
- }
- else if (comboBox2.Text.ToString() == "废品")
- {
- is_zl = "512603";
- }
- else if (comboBox2.Text.ToString() == "协议品")
- {
- is_zl = "512604";
- }
- else if (comboBox2.Text.ToString() == "订单外")
- {
- is_zl = "512605";
- }
- list1.Add(textBox5.Text.Trim().ToString());
- list1.Add(this.UserInfo.GetUserName());
- list1.Add(this.UserInfo.GetUserOrderText());
- list1.Add(this.UserInfo.GetUserGroupText());
- list1.Add(is_zl);//质量等级代码
- list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
- ArrayList list = new ArrayList();
- if (ugr.Cells["BIAS_CODE"].Text.ToString() == "" || ugr.Cells["BIAS_CODE_2"].Text.ToString() == "")
- {
- MessageBox.Show(ugr.Cells["MATERIAL_NO"].Value.ToString() + "卷没有判定标准");
- return;
- }
- list.Add(ugr.Cells["BIAS_CODE"].Text.ToString());
- list.Add(ugr.Cells["VAL"].Text.ToString());
- list.Add(ugr.Cells["BIAS_NAME"].Text.ToString());
- list.Add(ugr.Cells["PLAN"].Text.ToString());
- list.Add(ugr.Cells["VAL2"].Text.ToString());
- list2.Add(list);
- list = new ArrayList();
-
- list.Add(ugr.Cells["BIAS_CODE_2"].Text.ToString());
- list.Add(ugr.Cells["VAL_2"].Text.ToString());
- list.Add(ugr.Cells["BIAS_NAME_2"].Text.ToString());
- list.Add(ugr.Cells["PLAN_2"].Text.ToString());
- list.Add(ugr.Cells["VAL2_2"].Text.ToString());
- list2.Add(list);
- ArrayList listc1 = new ArrayList();
- listc1.Add("传动侧");
- listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString());
- listc1.Add(ugr.Cells["H_VAL1"].Value.ToString());
- listc1.Add(ugr.Cells["M_VAL1"].Value.ToString());
- listc1.Add(ugr.Cells["R_VAL1"].Value.ToString());
- list3.Add(listc1);
- listc1 = new ArrayList();
- listc1.Add("中间");
- listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString());
- listc1.Add(ugr.Cells["H_VAL2"].Value.ToString());
- listc1.Add(ugr.Cells["M_VAL2"].Value.ToString());
- listc1.Add(ugr.Cells["R_VAL2"].Value.ToString());
- list3.Add(listc1);
- listc1 = new ArrayList();
- listc1.Add("操作侧");
- listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString());
- listc1.Add(ugr.Cells["H_VAL3"].Value.ToString());
- listc1.Add(ugr.Cells["M_VAL3"].Value.ToString());
- listc1.Add(ugr.Cells["R_VAL3"].Value.ToString());
- list3.Add(listc1);
- if ((comboBox1.Text.ToString() == "合格" && comboBox2.Text.ToString() != "正品") || (comboBox1.Text.ToString() == "不合格" && comboBox2.Text.ToString() == "正品"))
- {
- MessageBox.Show("检验结果与质量等级不一致!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "judgeByHumanRZ";
- ccp.ServerParams = new object[] { list1, list2, list3 };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- lists.Add(ugr);
- }
- else
- {
- ArrayList list1 = new ArrayList();
- List<ArrayList> list3 = new List<ArrayList>();
- list1.Add(ugr.Cells["DESIGN_KEY"].Value.ToString());
- list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
- if (comboBox1.Text.ToString() == "")
- {
- MessageBox.Show("没有公差判定值,公差暂未判定");
- return;
- }
- else
- {
- if (comboBox1.Text.ToString() == "合格")
- {
- list1.Add("1");
- list1.Add("合格");
- }
- else if (comboBox1.Text.ToString() == "待判")
- {
- list1.Add("0");
- list1.Add("待判");
- }
- else
- {
- list1.Add("2");
- list1.Add("不合格");
- }
- }
- string is_zl = "";
- if (comboBox2.Text.ToString() == "正品")
- {
- is_zl = "512601";
- }
- else if (comboBox2.Text.ToString() == "次品")
- {
- is_zl = "512602";
- }
- else if (comboBox2.Text.ToString() == "废品")
- {
- is_zl = "512603";
- }
- else if (comboBox2.Text.ToString() == "协议品")
- {
- is_zl = "512604";
- }
- else if (comboBox2.Text.ToString() == "订单外")
- {
- is_zl = "512605";
- }
- list1.Add(textBox5.Text.Trim().ToString());
- list1.Add(this.UserInfo.GetUserName());
- list1.Add(this.UserInfo.GetUserOrderText());
- list1.Add(this.UserInfo.GetUserGroupText());
- list1.Add(is_zl);//质量等级代码
- list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
- ArrayList listc1 = new ArrayList();
- listc1.Add("传动侧");
- listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString());
- listc1.Add(ugr.Cells["H_VAL1"].Value.ToString());
- listc1.Add(ugr.Cells["M_VAL1"].Value.ToString());
- listc1.Add(ugr.Cells["R_VAL1"].Value.ToString());
- list3.Add(listc1);
- listc1 = new ArrayList();
- listc1.Add("中间");
- listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString());
- listc1.Add(ugr.Cells["H_VAL2"].Value.ToString());
- listc1.Add(ugr.Cells["M_VAL2"].Value.ToString());
- listc1.Add(ugr.Cells["R_VAL2"].Value.ToString());
- list3.Add(listc1);
- listc1 = new ArrayList();
- listc1.Add("操作侧");
- listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString());
- listc1.Add(ugr.Cells["H_VAL3"].Value.ToString());
- listc1.Add(ugr.Cells["M_VAL3"].Value.ToString());
- listc1.Add(ugr.Cells["R_VAL3"].Value.ToString());
- list3.Add(listc1);
- if ((comboBox1.Text.ToString() == "合格" && comboBox2.Text.ToString() != "正品") || (comboBox1.Text.ToString() == "不合格" && comboBox2.Text.ToString() == "正品"))
- {
- MessageBox.Show("检验结果与质量等级不一致!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "judgeByHumanJ";
- ccp.ServerParams = new object[] { list1, list3 };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- lists.Add(ugr);
- }
- }
- }
-
- for (int i = 0; i < lists.Count; i++)
- {
- lists[i].Delete(false);
- }
- MessageBox.Show("表面公差检验登记成功!");
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- }
- private void ultraGrid3_InitializeLayout(object sender, InitializeLayoutEventArgs e)
- {
- }
- private void button1_Click_1(object sender, EventArgs e)
- {
- try
- {
- int count = 0;
- List<UltraGridRow> lists = new List<UltraGridRow>();
- foreach (UltraGridRow ugr in this.ultraGrid3.Rows)
- {
- if (ugr.Cells["CHECK"].Text.ToString() == "True")
- {
- if ((ugr.Cells["VAL"].Text.ToString() != "" && ugr.Cells["VAL_2"].Text.ToString() != "")&&
- (ugr.Cells["VAL2"].Text.ToString() != "" && ugr.Cells["VAL2_2"].Text.ToString() != ""))
- {
- ArrayList list1 = new ArrayList();
- List<ArrayList> list2 = new List<ArrayList>();
- List<ArrayList> list3 = new List<ArrayList>();
- list1.Add(ugr.Cells["DESIGN_KEY"].Value.ToString());
- list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
- if (comboBox1.Text.ToString() == "待判")
- {
- list1.Add("0");
- list1.Add("待判");
- }
- else
- {
- list1.Add("");
- list1.Add("");
- }
- //else
- //{
- // if (comboBox1.Text.ToString() == "合格")
- // {
- // list1.Add("1");
- // list1.Add("合格");
- // }
- // else if (comboBox1.Text.ToString() == "不合格")
- // {
- // list1.Add("2");
- // list1.Add("不合格");
- // }
- // else
- // {
- // list1.Add("0");
- // list1.Add("待判");
- // }
- //}
- string is_zl = "";
- if (comboBox2.Text.ToString() == "正品")
- {
- is_zl = "512601";
- }
- else if (comboBox2.Text.ToString() == "次品")
- {
- is_zl = "512602";
- }
- else if (comboBox2.Text.ToString() == "废品")
- {
- is_zl = "512603";
- }
- else if (comboBox2.Text.ToString() == "协议品")
- {
- is_zl = "512604";
- }
- else if (comboBox2.Text.ToString() == "订单外")
- {
- is_zl = "512605";
- }
- list1.Add(textBox5.Text.Trim().ToString());
- list1.Add(this.UserInfo.GetUserName());
- list1.Add(this.UserInfo.GetUserOrderText());
- list1.Add(this.UserInfo.GetUserGroupText());
- list1.Add(is_zl);//质量等级代码
- list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
- ArrayList list = new ArrayList();
- if (ugr.Cells["BIAS_CODE"].Text.ToString() == "" || ugr.Cells["BIAS_CODE_2"].Text.ToString() == "")
- {
- MessageBox.Show(ugr.Cells["MATERIAL_NO"].Value.ToString() + "卷没有判定标准");
- return;
- }
- list.Add(ugr.Cells["BIAS_CODE"].Text.ToString());
- list.Add(ugr.Cells["VAL"].Text.ToString());
- list.Add(ugr.Cells["BIAS_NAME"].Text.ToString());
- list.Add(ugr.Cells["PLAN"].Text.ToString());
- list.Add(ugr.Cells["VAL2"].Text.ToString());
- list2.Add(list);
- list = new ArrayList();
- list.Add(ugr.Cells["BIAS_CODE_2"].Text.ToString());
- list.Add(ugr.Cells["VAL_2"].Text.ToString());
- list.Add(ugr.Cells["BIAS_NAME_2"].Text.ToString());
- list.Add(ugr.Cells["PLAN_2"].Text.ToString());
- list.Add(ugr.Cells["VAL2_2"].Text.ToString());
- list2.Add(list);
- ArrayList listc1 = new ArrayList();
- listc1.Add("传动侧");
- listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString());
- listc1.Add(ugr.Cells["H_VAL1"].Value.ToString());
- listc1.Add(ugr.Cells["M_VAL1"].Value.ToString());
- listc1.Add(ugr.Cells["R_VAL1"].Value.ToString());
- list3.Add(listc1);
- listc1 = new ArrayList();
- listc1.Add("中间");
- listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString());
- listc1.Add(ugr.Cells["H_VAL2"].Value.ToString());
- listc1.Add(ugr.Cells["M_VAL2"].Value.ToString());
- listc1.Add(ugr.Cells["R_VAL2"].Value.ToString());
- list3.Add(listc1);
- listc1 = new ArrayList();
- listc1.Add("操作侧");
- listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString());
- listc1.Add(ugr.Cells["H_VAL3"].Value.ToString());
- listc1.Add(ugr.Cells["M_VAL3"].Value.ToString());
- listc1.Add(ugr.Cells["R_VAL3"].Value.ToString());
- list3.Add(listc1);
- if ((comboBox1.Text.ToString() == "合格" && comboBox2.Text.ToString() != "正品") || (comboBox1.Text.ToString() == "不合格" && comboBox2.Text.ToString() == "正品"))
- {
- MessageBox.Show("检验结果与质量等级不一致!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "judgeByHumanRZ";
- ccp.ServerParams = new object[] { list1, list2, list3 };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- lists.Add(ugr);
- }
- else
- {
- ArrayList list1 = new ArrayList();
- List<ArrayList> list3 = new List<ArrayList>();
- list1.Add(ugr.Cells["DESIGN_KEY"].Value.ToString());
- list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
- if (comboBox1.Text.ToString() == "")
- {
- MessageBox.Show("请输入公差判定值!");
- return;
- }
- else
- {
- if (comboBox1.Text.ToString() == "合格")
- {
- list1.Add("1");
- list1.Add("合格");
- }
- else if (comboBox1.Text.ToString() == "待判")
- {
- list1.Add("0");
- list1.Add("待判");
- }
- else
- {
- list1.Add("2");
- list1.Add("不合格");
- }
- }
- string is_zl = "";
- if (comboBox2.Text.ToString() == "正品")
- {
- is_zl = "512601";
- }
- else if (comboBox2.Text.ToString() == "次品")
- {
- is_zl = "512602";
- }
- else if (comboBox2.Text.ToString() == "废品")
- {
- is_zl = "512603";
- }
- else if (comboBox2.Text.ToString() == "协议品")
- {
- is_zl = "512604";
- }
- else if (comboBox2.Text.ToString() == "订单外")
- {
- is_zl = "512605";
- }
- list1.Add(textBox5.Text.Trim().ToString());
- list1.Add(this.UserInfo.GetUserName());
- list1.Add(this.UserInfo.GetUserOrderText());
- list1.Add(this.UserInfo.GetUserGroupText());
- list1.Add(is_zl);//质量等级代码
- list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
- ArrayList listc1 = new ArrayList();
- listc1.Add("传动侧");
- listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString());
- listc1.Add(ugr.Cells["H_VAL1"].Value.ToString());
- listc1.Add(ugr.Cells["M_VAL1"].Value.ToString());
- listc1.Add(ugr.Cells["R_VAL1"].Value.ToString());
- list3.Add(listc1);
- listc1 = new ArrayList();
- listc1.Add("中间");
- listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString());
- listc1.Add(ugr.Cells["H_VAL2"].Value.ToString());
- listc1.Add(ugr.Cells["M_VAL2"].Value.ToString());
- listc1.Add(ugr.Cells["R_VAL2"].Value.ToString());
- list3.Add(listc1);
- listc1 = new ArrayList();
- listc1.Add("操作侧");
- listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString());
- listc1.Add(ugr.Cells["H_VAL3"].Value.ToString());
- listc1.Add(ugr.Cells["M_VAL3"].Value.ToString());
- listc1.Add(ugr.Cells["R_VAL3"].Value.ToString());
- list3.Add(listc1);
- if ((comboBox1.Text.ToString() == "合格" && comboBox2.Text.ToString() != "正品") || (comboBox1.Text.ToString() == "不合格" && comboBox2.Text.ToString() == "正品"))
- {
- MessageBox.Show("检验结果与质量等级不一致!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "judgeByHumanJ";
- ccp.ServerParams = new object[] { list1, list3 };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- lists.Add(ugr);
- }
- }
- }
- for (int i = 0; i < lists.Count; i++)
- {
- lists[i].Delete(false);
- }
- MessageBox.Show("公差检验登记成功!");
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- try
- {
- int count = 0;
- foreach (UltraGridRow ugr in this.ultraGrid3.Rows)
- {
- if (ugr.Cells["CHECK"].Text.ToString() == "True")
- {
- count++;
- }
- }
- List<UltraGridRow> lists = new List<UltraGridRow>();
- foreach (UltraGridRow ugr in ultraGrid3.Rows)
- {
- if (ugr.Cells["CHECK"].Text.ToString() == "True")
- {
- ArrayList list4 = new ArrayList();
- List<ArrayList> list5 = new List<ArrayList>();
- if (comboBox3.Text.Trim() == "")
- {
- MessageBox.Show("请输入表面检验结果!");
- return;
- }
- //if (comboBox2.Text.Trim() == "")
- //{
- // MessageBox.Show("请输入质量等级!");
- // return;
- //}
- string is_pass = "";
- string is_zl = "";
- if (comboBox3.Text.ToString() == "合格")
- {
- is_pass = "1";
- }
- else if (comboBox3.Text.ToString() == "不合格")
- {
- is_pass = "2";
- }
- else if (comboBox3.Text.ToString() == "待判")
- {
- is_pass = "0";
- }
- else
- {
- is_pass = "";
- }
- if (comboBox5.Text.ToString() == "正品")
- {
- is_zl = "512601";
- }
- else if (comboBox5.Text.ToString() == "次品")
- {
- is_zl = "512602";
- }
- else if (comboBox5.Text.ToString() == "废品")
- {
- is_zl = "512603";
- }
- else if (comboBox5.Text.ToString() == "协议品")
- {
- is_zl = "512604";
- }
- else if (comboBox5.Text.ToString() == "订单外")
- {
- is_zl = "512605";
- }
- else if (comboBox5.Text.ToString() == "待处理")
- {
- is_zl = "512606";
- }
- list4.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
- list4.Add(is_pass);//检验结果代码
- list4.Add(comboBox3.Text.Trim().ToString());//检验结果
- list4.Add(is_zl);//质量等级代码
- list4.Add(comboBox5.Text.Trim().ToString());//质量等级名称
- list4.Add(textBox5.Text.ToString().Trim());
- list4.Add(this.UserInfo.GetUserName());//操作人
- list4.Add(this.UserInfo.GetUserOrderText());//班次
- list4.Add(this.UserInfo.GetUserGroupText());//班组
- int count1 = 0;
- int i = 0;
- foreach (UltraGridRow ugrs in this.ultraGrid4.Rows)
- {
- if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True")
- {
- int j = 2;
- ArrayList list = new ArrayList();
- if ( ugrs.Cells["QUEXIAN_TP"].Value.ToString() == "")
- {
- MessageBox.Show("请选择缺陷来源次!", "提示");
- return;
- }
- if (ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "1")
- i++;
- list.Add(ugrs.Cells["PRIMARY_FLAG"].Value.ToString());
- if (ugrs.Cells["PRIMARY_FLAG"].Value.ToString() == "1")
- {
- list.Add("1");
- j = j - 1;
- }
- else
- {
- list.Add(j);
- }
- if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
- {
- list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
- }
- else
- {
- list.Add(ugrs.Cells["FLAW_DESC"].Value.ToString());
- }
- list.Add(ugrs.Cells["FLAW_DESC"].Text.ToString());
- if (ugrs.Cells["FLAW_DESC"].Text.ToString() == "")
- {
- MessageBox.Show("已选择的请录入缺陷信息!");
- return;
- }
- if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上表面")
- {
- list.Add("U");
- }
- else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "下表面")
- {
- list.Add("D");
- }
- else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "边部")
- {
- list.Add("E");
- }
- else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "钢卷侧面")
- {
- list.Add("A");
- }
- else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上下表面都有,且不对称")
- {
- list.Add("N");
- }
- else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上下表面都有,且对称")
- {
- list.Add("S");
- }
- else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上凸下凹")
- {
- list.Add("T");
- }
- else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "上凹下凸")
- {
- list.Add("B");
- }
- else if (ugrs.Cells["FLAW_AREA"].Text.ToString() == "已跟踪去重卷切除")
- {
- list.Add("C");
- }
- else
- {
- list.Add("");
- }
- //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Value.ToString());
- //list.Add(ugrs.Cells["FLAW_TYPE_DESC"].Text.ToString());
- if (ugrs.Cells["FLAW_POS_DESC"].Text.ToString() == "")
- {
- list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
- }
- else
- {
- list.Add(ugrs.Cells["FLAW_POS_DESC"].Value.ToString());
- }
- list.Add(ugrs.Cells["FLAW_POS_DESC"].Text.ToString());
- if (ugrs.Cells["FLAW_DIR_DESC"].Text.ToString() == "")
- {
- list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
- }
- else
- {
- list.Add(ugrs.Cells["FLAW_DIR_DESC"].Value.ToString());
- }
- list.Add(ugrs.Cells["FLAW_DIR_DESC"].Text.ToString());
- if (ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString() == "")
- {
- list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
- }
- else
- {
- list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Value.ToString());
- }
- list.Add(ugrs.Cells["FLAW_SIZE_DESC"].Text.ToString());
- if (ugrs.Cells["FLAW_LV_DESC"].Text.ToString() == "")
- {
- list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
- }
- else
- {
- list.Add(ugrs.Cells["FLAW_LV_DESC"].Value.ToString());
- }
- list.Add(ugrs.Cells["FLAW_LV_DESC"].Text.ToString());
- //if (!IsNumberal(ugrs.Cells["FLAW_QUANTITY"].Text))
- //{
- // MessageBox.Show("数量请输入数字!");
- // return;
- //}
- list.Add(ugrs.Cells["FLAW_QUANTITY"].Text.ToString());
- list.Add(ugrs.Cells["MEMO"].Text.ToString());
- if (ugrs.Cells["IS_REPAIR"].Text.ToString() == "")
- {
- list.Add("0");
- }
- else
- {
- list.Add(ugrs.Cells["IS_REPAIR"].Value.ToString());
- }
- list.Add(ugrs.Cells["QUEXIAN_TP"].Value.ToString());
- count1++;
- j++;
- list5.Add(list);
- }
- }
- if (count1 == 0 && comboBox3.Text.ToString() == "不合格")
- {
- MessageBox.Show("请录入缺陷信息并选择!");
- return;
- }
- if (i == 0 && comboBox3.Text.ToString() == "不合格")
- {
- MessageBox.Show("请录入主要缺陷!");
- return;
- }
- //if (i > 1)
- //{
- // MessageBox.Show("请不要录入多条主要缺陷!");
- // return;
- //}
- if ((comboBox3.Text.ToString() == "合格" && comboBox5.Text.ToString() != "正品") || (comboBox3.Text.ToString() == "不合格" && comboBox5.Text.ToString() == "正品"))
- {
- MessageBox.Show("检验结果与质量等级不一致!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "doAddFlawJ";
- ccp.ServerParams = new object[] { list5, list4 };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- lists.Add(ugr);
- }
- }
- for (int i = 0; i < lists.Count; i++)
- {
- lists[i].Delete(false);
- }
- //DoQuery();
- MessageBox.Show("表面登记成功!");
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void button4_Click(object sender, EventArgs e)
- {
- try
- {
-
- foreach (UltraGridRow ugr in ultraGrid3.Rows)
- {
- if (ugr.Cells["CHECK"].Text.ToString() == "True")
- {
- ArrayList list4 = new ArrayList();
- List<ArrayList> list5 = new List<ArrayList>();
- list4.Add(ugr.Cells["CJ_REMARK"].Text.ToString());
- list4.Add(ugr.Cells["CPCJ_REMARK"].Text.ToString());
- list4.Add(ugr.Cells["SPM_RMK"].Text.ToString());
- list4.Add(ugr.Cells["DEAL_REMARK"].Text.ToString());
- list4.Add(ugr.Cells["MATERIAL_NO"].Text.ToString());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "upRemarks";
- ccp.ServerParams = new object[] { list4 };
- 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 ultraGrid4_CellChange(object sender, CellEventArgs e)
- {
- }
- }
- }
|