| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140 |
- 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 QCM030304 : FrmBase
- {
- public QCM030304()
- {
- InitializeComponent();
- }
- 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;
- }
- }
- 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 prodline = comboBox3.Text.ToString();
- string isjudge = this.comboBox4.Text.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "doQueryMaterialDetailsJ";
- ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, "B", prodline, isjudge };
- 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;
- }
- 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 prodline = comboBox3.Text.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "GetSurfaceInfoJ";
- ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, prodline };
- 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.textBox1.Text.Trim();
- if (textBox2.Text.ToString() == "")
- {
- ebatchno = this.textBox1.Text.Trim();
- }
- else
- {
- ebatchno = this.textBox2.Text.Trim();
- }
- }
- if (!checkBox2.Checked && !checkBox3.Checked)
- {
- MessageBox.Show("时间与轧批号必须选择其中一个条件!");
- return;
- }
- string orderno = this.textBox3.Text.Trim();// 订单号
- string psc = textBox4.Text.Trim(); //产品描述
- string prodline = this.comboBox3.Text.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "GetMeasureInfoJ";
- ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, prodline };
- 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)
- {
- try
- {
- List<UltraGridRow> lists = new List<UltraGridRow>();
- foreach (UltraGridRow ugr in ultraGrid3.Rows)
- {
- if (ugr.Cells["CHECK"].Text.ToString() == "True")
- {
- ArrayList list1 = new ArrayList();
- List<ArrayList> list2 = new List<ArrayList>();
- if (comboBox1.Text.Trim() == "")
- {
- MessageBox.Show("请输入检验结果!");
- return;
- }
- if (comboBox2.Text.Trim() == "")
- {
- MessageBox.Show("请输入质量等级!");
- return;
- }
- string is_pass = "";
- string is_zl = "";
- if (comboBox1.Text.ToString() == "合格")
- {
- is_pass = "1";
- }
- else if (comboBox1.Text.ToString() == "不合格")
- {
- is_pass = "2";
- }
- else
- {
- is_pass = "0";
- }
- 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";
- }
- else if (comboBox2.Text.ToString() == "待处理")
- {
- is_zl = "512606";
- }
- list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());
- list1.Add(is_pass);//检验结果代码
- list1.Add(comboBox1.Text.Trim().ToString());//检验结果
- list1.Add(is_zl);//质量等级代码
- list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称
- list1.Add(textBox5.Text.ToString().Trim());
- list1.Add(this.UserInfo.GetUserName());//操作人
- list1.Add(this.UserInfo.GetUserOrderText());//班次
- list1.Add(this.UserInfo.GetUserGroupText());//班组
- int count = 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["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
- {
- 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());
- }
- count++;
- j++;
- list2.Add(list);
- }
- }
- if (count == 0 && comboBox1.Text.ToString() == "不合格")
- {
- MessageBox.Show("请录入缺陷信息并选择!");
- return;
- }
- if (i == 0 && comboBox1.Text.ToString() == "不合格")
- {
- MessageBox.Show("请录入主要缺陷!");
- return;
- }
- if (i > 1)
- {
- MessageBox.Show("请不要录入多条主要缺陷!");
- return;
- }
- if ((comboBox1.Text.ToString() == "合格" && comboBox2.Text.ToString() != "正品") || (comboBox1.Text.ToString() == "不合格" && comboBox2.Text.ToString() == "正品"))
- {
- MessageBox.Show("检验结果与质量等级不一致!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "doAddFlawJ";
- ccp.ServerParams = new object[] { list2, list1 };
- 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("系统出错,请联系管理人员", "警告");
- }
- }
- 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 QCM030304_Load(object sender, EventArgs e)
- {
- this.comboBox3.SelectedIndex = 0;
- this.comboBox4.SelectedIndex = 0;
- string prodline = comboBox3.Text.ToString();
- this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
- this.ultraGrid3.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
- this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7);
- 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 = "findFlawArea";
- 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 = "findFlawPosDesc";
- 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 vsflv = 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++)
- {
- vsflv.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString());
- }
- this.comboBox2.DataSource = vsflv.ValueListItems;
- ValueList VFLAW_SIZE_DESC = new ValueList();
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "findFlawSizeDesc";
- 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 = "findFlawLvDesc";
- 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)
- {
- 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 this.ultraGrid3.Rows)
- {
- if (ugr.Cells["CHECK"].Text.ToString() == "True")
- {
- if (count == 1)
- {
- 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() == "")
- {
- MessageBox.Show("请输入登记结果!");
- return;
- }
- 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());//质量等级名称
- foreach (System.Data.DataRow row in dataSet7.Tables[0].Rows)
- {
- ArrayList list = new ArrayList();
- String st = row["bias_code"].ToString();
- list.Add(row["bias_code"].ToString());
- //if (ugrs.Cells["val"].Text.ToString() == "")
- //{
- // MessageBox.Show("请输入判定值");
- // return;
- //}
- list.Add(row["val"].ToString());
- list.Add(row["bias_name"].ToString());
- list.Add(row["plan"].ToString());
- list2.Add(list);
- }
-
- //ArrayList list = new ArrayList();
- //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());
- //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());
- //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 = "judgeByHuman2";
- 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());
- }
- //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)
- {
- }
- }
- }
|