| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760 |
- 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;
- using System.Collections;
- using Infragistics.Win.UltraWinGrid;
- using System.Diagnostics;
- namespace Core.LZMes.Client.QCM
- {
- public partial class QCM030301 : FrmBase
- {
- public QCM030301()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Export":
- this.DoExport();
- break;
- case "PlanImport":
- this.PlanImport();
- break;
- }
- }
- private void PlanImport()
- {
- }
- private void DoQuery()
- {
- if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
- {
- DoQueryMe();
- }
- if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
- {
- DoQueryRe();
- }
- }
- //查询待判信息
- private void DoQueryMe()
- {
- try
- {
- this.dataSet2.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.textBox1.Text.Trim();
- }
- //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();
- string isjudge = this.comboBox4.Text.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "doQueryMaterialDetailsBS";
- ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc,"M",prodline,isjudge };
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- //查询判定记录
- private void DoQueryRe()
- {
- try
- {
- this.dataSet5.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 (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 = "GetMeasureInfoB";
- ccp.ServerParams = new object[] { starttime, endtime, sbatchno, ebatchno, orderno, psc, prodline };
- ccp.SourceDataTable = this.dataSet5.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
- {
- try
- {
- UltraGridRow ugr = this.ultraGrid2.ActiveRow;
- if (ugr == null)
- return;
- this.dataSet3.Clear();
- string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString();
- string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "getToleranceZhb";
- ccp.ServerParams = new object[] { design_key, material_no };
- ccp.SourceDataTable = this.dataSet3.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- this.dataSet4.Clear();
- string sic_id = ugr.Cells["SIZEID"].Value.ToString();
- if (sic_id != "")
- {
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "getQcmJudgeMeasure";
- ccp.ServerParams = new object[] { sic_id };
- ccp.SourceDataTable = this.dataSet4.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- if (design_key != "")
- {
- 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();
- }
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void QCM0303_Load(object sender, EventArgs e)
- {
- this.comboBox3.SelectedIndex = 0;
- this.comboBox4.SelectedIndex = 0;
- ValueList VFLAW_SIZE_DESC = new ValueList();
- VFLAW_SIZE_DESC.ValueListItems.Add("0", "头");
- VFLAW_SIZE_DESC.ValueListItems.Add("1", "中");
- VFLAW_SIZE_DESC.ValueListItems.Add("2", "尾");
- this.ultraGrid5.DisplayLayout.Bands[0].Columns["THICK_TYPE"].ValueList = VFLAW_SIZE_DESC;
- ValueList vsflv = new ValueList();
- CoreClientParam 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;
- this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
- this.ultraGrid4.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
- this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-7);
- //this.comboBox3.SelectedIndex = 0;
- //DoQuery();
- String doPlineCode = DoPlineCode();
- if (doPlineCode.Equals("厚板线"))
- {
- this.comboBox3.SelectedIndex = 1;
- }
- else
- {
- this.comboBox3.SelectedIndex = 0;
- }
-
- }
- private void ultraGrid4_AfterRowActivate(object sender, EventArgs e)
- {
- try
- {
- UltraGridRow ugr = this.ultraGrid4.ActiveRow;
- if (ugr == null)
- return;
- this.dataSet6.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.dataSet6.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- this.dataSet7.Clear();
- ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "getQcmJudgeMeasure";
- ccp.ServerParams = new object[] { sic };
- ccp.SourceDataTable = this.dataSet7.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- try
- {
- int num1 = 0;
- int num2 = 0;
- foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
- {
- if (ugr.Cells["CHECK"].Text.ToString() == "True")
- {
- num1++;
- String doPlineCode = DoPlineCode();//20240902 王坚提出
- if (doPlineCode.Equals("厚板线") || doPlineCode.Equals("中板线"))
- {
- String mno=ugr.Cells["MATERIAL_NO"].Value.ToString();
- String comboBoxText = this.comboBox1.Text.ToString().Trim();
- if (!comboBoxText.Equals("待判"))
- {
- MessageBox.Show("技术中心规定您的检验结果权限只能选择【待判】不能选择其它!");
- return;
- }
- if (doPlineCode.Equals("厚板线"))
- {
- if (mno.StartsWith("Z"))
- {
- MessageBox.Show("您是厚板线操作人员不能操作该子板【" + mno + "】");
- return;
- }
- }
- else if (doPlineCode.Equals("中板线"))
- {
- if (mno.StartsWith("H"))
- {
- MessageBox.Show("您是中板线操作人员不能操作该子板【" + mno + "】");
- return;
- }
- }
- }
- }
- }
- //判断是否都有勾选
- if (num1 == 0)
- {
- MessageBox.Show("请勾选待检信息!");
- return;
- }
- foreach (UltraGridRow ugr1 in this.ultraGrid5.Rows)
- {
- if (ugr1.Cells["CHECK"].Text.ToString() == "True")
- {
- if (ugr1.Cells["THICK_TYPE"].Text.ToString().Trim() == "")
- {
- MessageBox.Show("请勾选测量实绩头中尾!");
- return;
- }
- }
- }
-
- int count = 0;
- foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
- {
- if (ugr.Cells["CHECK"].Text.ToString() == "True")
- {
- count++;
- }
- }
- List<UltraGridRow> lists = new List<UltraGridRow>();
- foreach (UltraGridRow ugr in this.ultraGrid2.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()); //0
- list1.Add(ugr.Cells["MATERIAL_NO"].Value.ToString());//1
- if (comboBox1.Text.ToString() == "")
- {
- MessageBox.Show("请输入登记结果!");
- return;
- }
- else
- {
- if (comboBox1.Text.ToString() == "合格")
- {
- list1.Add("1");//2
- list1.Add("合格");//3
- }
- 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());//4
- list1.Add(this.UserInfo.GetUserName());//5
- list1.Add(this.UserInfo.GetUserOrderText());//6
- list1.Add(this.UserInfo.GetUserGroupText());//7
- list1.Add(is_zl);//质量等级代码 //8
- list1.Add(comboBox2.Text.Trim().ToString());//质量等级名称 //9
- foreach (UltraGridRow ugrs in this.ultraGrid3.Rows)
- {
- ArrayList list = new ArrayList();
- list.Add(ugrs.Cells["bias_code"].Text.ToString());
- //if (ugrs.Cells["val"].Text.ToString() == "")
- //{
- // MessageBox.Show("请输入判定值");
- // return;
- //}
- list.Add(ugrs.Cells["val"].Text.ToString());
- list.Add(ugrs.Cells["bias_name"].Text.ToString());
- list.Add(ugrs.Cells["plan"].Text.ToString());
- list2.Add(list);
- }
- foreach (UltraGridRow ugr1 in this.ultraGrid5.Rows)
- {
- if (ugr1.Cells["CHECK"].Text.ToString() == "True")
- {
- ArrayList listc = new ArrayList();
- listc.Add(ugr1.Cells["THICK_TYPE"].Text.ToString().Trim());
- listc.Add(ugr1.Cells["THICK_VAL"].Text.ToString());
- listc.Add(ugr1.Cells["H_VAL"].Value.ToString());
- listc.Add(ugr1.Cells["M_VAL"].Value.ToString());
- listc.Add(ugr1.Cells["R_VAL"].Value.ToString());
- list3.Add(listc);
- }
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "judgeByHuman";
- 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("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 (UltraGridRow ugr1 in this.ultraGrid5.Rows)
- {
- if (ugr1.Cells["CHECK"].Text.ToString() == "True")
- {
- ArrayList listc = new ArrayList();
- listc.Add(ugr1.Cells["THICK_TYPE"].Text.ToString().Trim());
- listc.Add(ugr1.Cells["THICK_VAL"].Text.ToString());
- listc.Add(ugr1.Cells["H_VAL"].Value.ToString());
- listc.Add(ugr1.Cells["M_VAL"].Value.ToString());
- listc.Add(ugr1.Cells["R_VAL"].Value.ToString());
- list3.Add(listc);
- }
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl";
- ccp.MethodName = "judgeByHuman1";
- 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 checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- foreach (UltraGridRow ugr in this.ultraGrid2.Rows.Where(p => p.IsFilteredOut == false).ToList())
- {
- if (checkBox1.Checked)
- {
- ugr.Cells["CHECK"].Value = "True";
- }
- else
- {
- ugr.Cells["CHECK"].Value = "False";
- }
- }
- }
- private void ultraGrid3_KeyDown(object sender, KeyEventArgs e)
- {
- UltraGrid grid = (UltraGrid)sender;
- if (e.KeyCode == Keys.Enter)
- {
- //Go down one row
- grid.PerformAction(UltraGridAction.EnterEditMode);
- grid.PerformAction(UltraGridAction.BelowCell);
- foreach (UltraGridRow ugrs in this.ultraGrid3.Rows)
- {
- ArrayList list = new ArrayList();
- ugrs.Appearance.BackColor = Color.White;
- double val1 = Convert.ToDouble(ugrs.Cells["val"].Text.ToString()) - Convert.ToDouble(ugrs.Cells["plan"].Text.ToString());
- if (ugrs.Cells["std_min_val"].Text.ToString() != "" && Convert.ToDouble(ugrs.Cells["std_min_val"].Text.ToString()) - val1 > 0)
- {
- ugrs.Appearance.BackColor = Color.Yellow;
- this.comboBox1.SelectedIndex = 0;
- }
- if (ugrs.Cells["std_max_val"].Text.ToString() != "" && Convert.ToDouble(ugrs.Cells["std_max_val"].Text.ToString()) - val1 < 0)
- {
- ugrs.Appearance.BackColor = Color.Yellow;
- this.comboBox1.SelectedIndex = 0;
- }
- if (ugrs.Cells["std_min_val_k"].Text.ToString() != "" && Convert.ToDouble(ugrs.Cells["std_min_val_k"].Text.ToString()) - val1 > 0)
- {
- ugrs.Appearance.BackColor = Color.Yellow;
- this.comboBox1.SelectedIndex = 0;
- }
- if (ugrs.Cells["std_max_val_k"].Text.ToString() != "" && Convert.ToDouble(ugrs.Cells["std_max_val_k"].Text.ToString()) - val1 < 0)
- {
- ugrs.Appearance.BackColor = Color.Yellow;
- this.comboBox1.SelectedIndex = 0;
- }
- if (ugrs.Cells["std_min_val_n"].Text.ToString() != "" && Convert.ToDouble(ugrs.Cells["std_min_val_n"].Text.ToString()) - val1 > 0)
- {
- ugrs.Appearance.BackColor = Color.Yellow;
- this.comboBox1.SelectedIndex = 0;
- }
- if (ugrs.Cells["std_max_val_n"].Text.ToString() != "" && Convert.ToDouble(ugrs.Cells["std_max_val_n"].Text.ToString()) - val1 < 0)
- {
- ugrs.Appearance.BackColor = Color.Yellow;
- this.comboBox1.SelectedIndex = 0;
- }
- }
- }
- }
- private void ultraTabControl1_Click(object sender, EventArgs e)
- {
- if (this.ultraTabControl1.Tabs[1].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 ultraGrid5_KeyDown(object sender, KeyEventArgs e)
- {
- switch (e.KeyCode)
- {
- case Keys.Up:
- this.ultraGrid5.PerformAction(UltraGridAction.ExitEditMode, false, false);
- this.ultraGrid5.PerformAction(UltraGridAction.AboveCell, false, false);
- e.Handled = true;
- this.ultraGrid5.PerformAction(UltraGridAction.EnterEditMode, false, false);
- break;
- case Keys.Down:
- this.ultraGrid5.PerformAction(UltraGridAction.ExitEditMode, false, false);
- this.ultraGrid5.PerformAction(UltraGridAction.BelowCell, false, false);
- e.Handled = true;
- this.ultraGrid5.PerformAction(UltraGridAction.EnterEditMode, false, false);
- break;
- case Keys.Right:
- this.ultraGrid5.PerformAction(UltraGridAction.ExitEditMode, false, false);
- this.ultraGrid5.PerformAction(UltraGridAction.NextCellByTab, false, false);
- e.Handled = true;
- this.ultraGrid5.PerformAction(UltraGridAction.EnterEditMode, false, false);
- break;
- case Keys.Left:
- this.ultraGrid5.PerformAction(UltraGridAction.ExitEditMode, false, false);
- this.ultraGrid5.PerformAction(UltraGridAction.PrevCellByTab, false, false);
- e.Handled = true;
- this.ultraGrid5.PerformAction(UltraGridAction.EnterEditMode, false, false);
- break;
- case Keys.Enter:
- this.ultraGrid5.PerformAction(UltraGridAction.ExitEditMode, false, false);
- this.ultraGrid5.PerformAction(UltraGridAction.BelowCell, false, false);
- e.Handled = true;
- this.ultraGrid5.PerformAction(UltraGridAction.EnterEditMode, false, false);
- break;
- }
- }
- private void DoExport()
- {
- try
- {
- if (this.ultraGrid4.Rows.Count == 0)
- {
- MessageBox.Show("没有可以导出的数据", "提示");
- return;
- }
- if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
- {
- string fName = this.saveFileDialog1.FileName;
- this.ultraGridExcelExporter2.Export(this.ultraGrid4, fName);
- Process.Start(fName);
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void comboBox1_SelectedValueChanged(object sender, EventArgs e)
- {
- if (this.comboBox1.SelectedIndex == 0)
- {
- ValueList vsflv = new ValueList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "findSfLv1";
- ccp.ServerParams = new object[] { "2" };
- 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;
- }
- else if (this.comboBox1.SelectedIndex == 1)
- {
- ValueList vsflv = new ValueList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "findSfLv1";
- ccp.ServerParams = new object[] { "0" };
- 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;
- }
- else if (this.comboBox1.SelectedIndex == 2)
- {
- ValueList vsflv = new ValueList();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- ccp.MethodName = "findSfLv1";
- ccp.ServerParams = new object[] { "1" };
- 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;
- }
- }
- #region 条件 240902 技术中心王坚提出
- private String DoPlineCode()
- {
- try
- {
- String userid = this.UserInfo.GetUserID();//员工ID
- if (userid.Equals("X16943") || userid.Equals("X16937") || userid.Equals("X16947") || userid.Equals("X16953") || userid.Equals("X16954"))
- {
- return "厚板线";
- }
- else if (userid.Equals("X16821") || userid.Equals("X16814") || userid.Equals("X16792") || userid.Equals("X16806") )
- {
- return "中板线";
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- return "1";
- }
- #endregion
- }
- }
|