| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832 |
- 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 System.Collections;
- using Infragistics.Win.UltraWinGrid;
- using Core.LZMes.Client.QCM.QCM03;
- using Infragistics.Win;
- using System.Diagnostics;
- namespace Core.LZMes.Client.QCM
- {
- public partial class QCM030708 : FrmBase
- {
- public QCM030708()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Exit":
- this.Close();
- break;
- case "Unlock":
- this.Judge();
- break;
- case "SteelInfo":
- this.steelinfo();
- break;
- case "Fr_report":
- this.fr_report();
- break;
- case "Fr_report2":
- this.fr_report2();
- break;
- case "Export2":
- this.DoExport();
- break;
- case "ReBack":
- this.Reback();
- break;
- }
- }
- private void Reback()
- {
- UltraGridRow ugr = this.ultraGrid2.ActiveRow;
- if(ugr == null)
- {
- MessageBox.Show("请选择数据!");
- return;
- }
- string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
- string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
- ccp.MethodName = "Reback";
- ccp.ServerParams = new object[] { material_no,lock_seq};
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- MessageBox.Show("回退成功!");
- DoQuery();
- }
- private void steelinfo()
- {
- UltraGridRow ugr = this.ultraGrid9.ActiveRow;
- if (ugr == null)
- return;
- string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
- string prod_name = ugr.Cells["PROD_NAME"].Value.ToString();
- string prodline = "4001LGX";
- string grade_name = this.textBox3.Text.ToString();
- if (grade_name == "")
- return;
- QCM030712 dlg = new QCM030712();
- dlg.material_no = material_no;
- dlg.prod_name = prod_name;
- dlg.prodline = prodline;
- dlg.grade_name = grade_name;
- dlg.ob = this.ob;
- dlg.ShowDialog();
- }
- private void fr_report()
- {
- ultraGrid2.UpdateData();
- if (ultraGrid2.ActiveRow != null)
- {
- string current_class = this.UserInfo.GetUserOrder();
- string userName = this.UserInfo.GetUserID();
- UltraGridRow ugr = ultraGrid2.ActiveRow;
- string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
- string prod_name = ugr.Cells["PROD_NAME"].Value.ToString();
- if (string.IsNullOrEmpty(prod_name))
- {
- MessageBox.Show("选择的处理信息,产品名称为空!");
- return;
- }
- string platetype = "";
- if ("方坯".Equals(prod_name))
- {
- platetype = "2";
- }
- else if ("板坯".Equals(prod_name))
- {
- platetype = "1";
- }
- string url = "http://172.16.0.155/FineReport/decision/view/report?viewlet=XGCX%252Fcffx.cpt&ref_t=design&ref_c=7683bd3a-1031-4f0a-908b-62b6524f80ab¤t_class=" + current_class;
- url += "&lock_id=" + lock_id;
- url += "&create_man=" + userName;
- url += "&platetype=" + platetype;
- url += "&prodline=" + "4001LGX";
- QCM030715 frm = new QCM030715(ob, url);
- frm.Text = "连铸坯成分处置放行通知单";
- frm.ShowDialog();
- return;
- }
- else
- {
- MessageBox.Show("请选择处理信息!");
- return;
- }
- }
- private void fr_report2()
- {
- ultraGrid2.UpdateData();
- if (ultraGrid2.ActiveRow != null)
- {
- string current_class = this.UserInfo.GetUserOrder();
- string userName = this.UserInfo.GetUserID();
- UltraGridRow ugr = ultraGrid2.ActiveRow;
- string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
- string prod_name = ugr.Cells["PROD_NAME"].Value.ToString();
- if (string.IsNullOrEmpty(prod_name))
- {
- MessageBox.Show("选择的处理信息,产品名称为空!");
- return;
- }
- string platetype = "";
- if ("方坯".Equals(prod_name))
- {
- platetype = "2";
- }
- else if ("板坯".Equals(prod_name))
- {
- platetype = "1";
- }
- string url = "http://172.16.0.155/FineReport/decision/view/report?viewlet=XGCX%252Fbhgtzd.cpt&ref_t=design&ref_c=b16af811-10fa-4cb7-bc62-be902d81b522¤t_class=" + current_class;
- url += "&lock_id=" + lock_id;
- url += "&create_man=" + userName;
- url += "&platetype=" + platetype;
- url += "&prodline=" + "4001LGX";
- QCM030715 frm = new QCM030715(ob, url);
- frm.Text = "不合格品通知/审理单";
- frm.ShowDialog();
- return;
- }
- else
- {
- MessageBox.Show("请选择处理信息!");
- return;
- }
- }
- private void Judge()
- {
- if (this.ultraGrid9.Selected.Rows.Count == 0)
- this.ultraGrid9.ActiveRow.Selected = true;
- List<UltraGridRow> lists = new List<UltraGridRow>();
- if (comboBox1.Text.Trim().ToString() == "")
- {
- MessageBox.Show("请选择异常材处置放向!");
- return;
- }
- if (comboBox1.Text.Trim().ToString() == "放行")
- {
- if (MessageBox.Show(this, "是否放行处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
- {
- return;
- }
- }
- else if (comboBox1.Text.Trim().ToString() == "复样")
- {
- if (MessageBox.Show(this, "是否复样处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
- {
- return;
- }
- }
- else if (comboBox1.Text.Trim().ToString() == "修磨")
- {
- if (MessageBox.Show(this, "是否修磨处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
- {
- return;
- }
- }
- else if (comboBox1.Text.Trim().ToString() == "改尺")
- {
- if (MessageBox.Show(this, "是否改尺处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
- {
- return;
- }
- }
- else if (comboBox1.Text.Trim().ToString() == "判次")
- {
- if (MessageBox.Show(this, "是否判次处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
- {
- return;
- }
- }
- else if (comboBox1.Text.Trim().ToString() == "化废")
- {
- if (MessageBox.Show(this, "是否化废处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
- {
- return;
- }
- }
- else if (comboBox1.Text.Trim().ToString() == "脱单")
- {
- if (MessageBox.Show(this, "是否脱单处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
- {
- return;
- }
- }
- else if (comboBox1.Text.Trim().ToString() == "关闭")
- {
- if (MessageBox.Show(this, "是否关闭处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
- {
- return;
- }
- }
- else if (comboBox1.Text.Trim().ToString() == "复样+放行")
- {
- if (MessageBox.Show(this, "是否复样+放行处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
- {
- return;
- }
- }
- else if (comboBox1.Text.Trim().ToString() == "验样")
- {
- if (MessageBox.Show(this, "是否验样处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
- {
- return;
- }
- }
- else if (comboBox1.Text.Trim().ToString() == "验样+放行")
- {
- if (MessageBox.Show(this, "是否验样+放行处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
- {
- return;
- }
- }
- else if (comboBox1.Text.Trim().ToString() == "改判+放行")
- {
- if (textBox3.Text.ToString() == "")
- {
- MessageBox.Show("请选择改判牌号!");
- return;
- }
- if (MessageBox.Show(this, "是否改判+放行处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
- {
- return;
- }
- }
- else if (comboBox1.Text.Trim().ToString() == "改判")
- {
- if (textBox3.Text.ToString() == "")
- {
- MessageBox.Show("请选择改判牌号!");
- return;
- }
- if (MessageBox.Show(this, "是否改判处置?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
- {
- return;
- }
- }
- foreach (UltraGridRow ugr in this.ultraGrid9.Rows)
- {
- if(ugr.Cells["CHECK"].Value.ToString() == "True")
- {
- ArrayList al = new ArrayList();
- if (comboBox1.Text.Trim().ToString() != "改判" && comboBox1.Text.Trim().ToString() != "改判+放行")
- {
- string material = ugr.Cells["MATERIAL_NO"].Value.ToString();
- string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString();
- string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString();
- string heat_no = ugr.Cells["HEAT_NO"].Value.ToString();
- string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString();
- //if (string.IsNullOrEmpty(design_key))
- //{
- // lists.Add(ugr);
- // continue;
- //}
- string username = this.UserInfo.GetUserName();
- string grade_name = ugr.Cells["STEEL_NAME"].Value.ToString();
- string unlock_type_code = "";
- string assay_no = "";
- if (comboBox1.Text.Trim().ToString() == "放行")
- {
- unlock_type_code = "0";
- //QCM030720 dlg = new QCM030720();
- //dlg.StartPosition = FormStartPosition.CenterParent;
- //dlg.design_key = design_key;
- //dlg.heat_no = heat_no;
- //dlg.grade_name = grade_name;
- //dlg.ob = this.ob;
- //if (dlg.ShowDialog() != DialogResult.OK)
- //{
- // return;
- //}
- //assay_no = dlg.assay_no;
- //if (assay_no == "")
- //{
- // MessageBox.Show("请选择成分实绩!");
- // return;
- //}
- }
- else if (comboBox1.Text.Trim().ToString() == "复样")
- {
- unlock_type_code = "1";
- }
- else if (comboBox1.Text.Trim().ToString() == "修磨")
- {
- unlock_type_code = "2";
- }
- else if (comboBox1.Text.Trim().ToString() == "改尺")
- {
- unlock_type_code = "3";
- }
- else if (comboBox1.Text.Trim().ToString() == "判次")
- {
- unlock_type_code = "4";
- }
- else if (comboBox1.Text.Trim().ToString() == "化废")
- {
- unlock_type_code = "5";
- }
- else if (comboBox1.Text.Trim().ToString() == "脱单")
- {
- unlock_type_code = "6";
- }
- else if (comboBox1.Text.Trim().ToString() == "关闭")
- {
- unlock_type_code = "11";
- }
- else if (comboBox1.Text.Trim().ToString() == "复样+放行")
- {
- unlock_type_code = "12";
- QCM030720 dlg = new QCM030720();
- dlg.StartPosition = FormStartPosition.CenterParent;
- dlg.design_key = design_key;
- dlg.heat_no = heat_no;
- dlg.grade_name = grade_name;
- dlg.ob = this.ob;
- if (dlg.ShowDialog() != DialogResult.OK)
- {
- return;
- }
- assay_no = dlg.assay_no;
- if (assay_no == "")
- {
- MessageBox.Show("请选择成分实绩!");
- return;
- }
- //CoreClientParam ccp = new CoreClientParam();
- //ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
- //ccp.MethodName = "JudgeCheck1";
- //ccp.ServerParams = new object[] { heat_no, material, design_key, username, grade_name, "板坯", "4001LGX", "0" };
- //this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- //if (ccp.ReturnCode == 2)
- //{
- // QCM030718 dlg = new QCM030718();
- // dlg.StartPosition = FormStartPosition.CenterParent;
- // dlg.design_key = design_key;
- // dlg.heat_no = heat_no;
- // dlg.grade_name = grade_name;
- // dlg.ob = this.ob;
- // if (dlg.ShowDialog() != DialogResult.OK)
- // {
- // return;
- // }
- //}
- }
- else if (comboBox1.Text.Trim().ToString() == "验样")
- {
- unlock_type_code = "13";
- }
- else if (comboBox1.Text.Trim().ToString() == "验样+放行")
- {
- unlock_type_code = "14";
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
- ccp.MethodName = "JudgeCheck1";
- ccp.ServerParams = new object[] { heat_no, material, design_key, username, grade_name, "板坯", "4001LGX", "1" };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == 2)
- {
- QCM030718 dlg = new QCM030718();
- dlg.StartPosition = FormStartPosition.CenterParent;
- dlg.design_key = design_key;
- dlg.heat_no = heat_no;
- dlg.grade_name = grade_name;
- dlg.ob = this.ob;
- if (dlg.ShowDialog() != DialogResult.OK)
- {
- return;
- }
- }
- }
- string unlock_memo = this.comboBox3.Text.Trim().ToString();
- if (string.IsNullOrEmpty(unlock_memo) && lock_type_code == "C" && "0".Equals(unlock_type_code))
- {
- this.alert("处理备注为空,请选择相应审理人员!");
- return;
- }
- string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
- al.Add(material);
- al.Add(lock_seq);
- al.Add(lock_type_code);
- al.Add(unlock_type_code);
- al.Add(unlock_memo);
- al.Add(username);
- al.Add(lock_id);
- al.Add(this.comboBox4.Text.ToString());
- al.Add(checkBoxComboBox2.Text.ToString());
- al.Add(checkBoxComboBox1.Text.ToString());
- al.Add(assay_no);
- CoreClientParam ccp1 = new CoreClientParam();
- ccp1.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
- ccp1.MethodName = "doInformationLgSure";
- ccp1.ServerParams = new object[] { al };
- ccp1 = this.ExecuteNonQuery(ccp1, CoreInvokeType.Internal);
- if (ccp1.ReturnCode == -1)
- {
- return;
- }
- lists.Add(ugr);
- }
- else
- {
- string material = ugr.Cells["MATERIAL_NO"].Value.ToString();
- string lock_seq = ugr.Cells["LOCK_SEQ"].Value.ToString();
- string lock_type_code = ugr.Cells["LOCK_TYPE_CODE"].Value.ToString();
- string heat_no = ugr.Cells["HEAT_NO"].Value.ToString();
- string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString();
- string username = this.UserInfo.GetUserName();
- string grade_name = ugr.Cells["STEEL_NAME"].Value.ToString();
- string unlock_type_code = "";
- if (comboBox1.Text.Trim().ToString() == "改判")
- {
- unlock_type_code = "7";
- }
- else if (comboBox1.Text.Trim().ToString() == "改判+放行")
- {
- unlock_type_code = "15";
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
- ccp.MethodName = "JudgeCheck1";
- ccp.ServerParams = new object[] { heat_no, material, design_key, username, grade_name, "板坯", "4001LGX", "2" };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == 2)
- {
- QCM030718 dlg = new QCM030718();
- dlg.StartPosition = FormStartPosition.CenterParent;
- dlg.design_key = design_key;
- dlg.heat_no = heat_no;
- dlg.grade_name = grade_name;
- dlg.ob = this.ob;
- if (dlg.ShowDialog() != DialogResult.OK)
- {
- return;
- }
- }
- }
- string unlock_memo = this.comboBox3.Text.Trim().ToString();
- string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
- string qx = this.comboBox5.Text.ToString();
- al.Add(material);
- al.Add(lock_seq);
- al.Add(lock_type_code);
- al.Add(unlock_type_code);
- al.Add(unlock_memo);
- al.Add(username);
- al.Add(lock_id);
- al.Add(textBox3.Text.ToString());
- al.Add(qx);
- CoreClientParam ccp1 = new CoreClientParam();
- ccp1.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
- ccp1.MethodName = "doInformationLgGp";
- ccp1.ServerParams = new object[] { al };
- ccp1 = this.ExecuteNonQuery(ccp1, CoreInvokeType.Internal);
- if (ccp1.ReturnCode == -1)
- {
- return;
- }
- lists.Add(ugr);
- }
- }
- }
- for (int i = 0; i < lists.Count; i++)
- {
- lists[i].Delete(false);
- }
- MessageBox.Show("异常处置成功!");
- DoQuery();
- }
- private void DoQuery()
- {
- if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
- {
- DoQueryMe();
- }
- if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
- {
- DoQueryRe();
- }
- }
- private void DoQueryMe()
- {
- try
- {
- this.dataSet1.Clear();
- string heatno = this.textBox4.Text.ToString();
- string material_no = this.textBox5.Text.ToString();
- string prod_name = this.comboBox2.Text.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
- ccp.MethodName = "getLgInformation";
- ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"),heatno,material_no,prod_name,"4" };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void DoQueryRe()
- {
- try
- {
- this.dataSet2.Clear();
- string heatno = this.textBox4.Text.ToString();
- string material_no = this.textBox5.Text.ToString();
- string prod_name = this.comboBox2.Text.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0307.QcmRejudgeApplyServiceImpl";
- ccp.MethodName = "getAbnormalRecordLgInfo";
- ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyyMMdd"), this.dateTimePicker2.Value.ToString("yyyyMMdd"), heatno, material_no, prod_name, "4" };
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- foreach (UltraGridRow ugrs in this.ultraGrid2.Rows)
- {
- if (ugrs.Cells["UNLOCK_TYPE_DESC"].Text.ToString().Contains("复样"))
- {
- ugrs.Appearance.BackColor = Color.Pink;
- }
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void label1_Click(object sender, EventArgs e)
- {
- }
- private void panel4_Paint(object sender, PaintEventArgs e)
- {
- }
- private void panel2_Paint(object sender, PaintEventArgs e)
- {
- }
- private void DoQueryC()
- {
- try
- {
- UltraGridRow ugr = this.ultraGrid9.ActiveRow;
- if (ugr == null)
- return;
- this.dataSet4.Clear();
- string design_key = ugr.Cells["design_key"].Value.ToString();
- string smp_no = ugr.Cells["smp_no"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
- ccp.MethodName = "GetChemeInfo";
- ccp.ServerParams = new object[] { design_key, smp_no};
- ccp.SourceDataTable = this.dataSet4.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void ultraGrid9_DoubleClickCell(object sender, DoubleClickCellEventArgs e)
- {
- UltraGridRow ugr = e.Cell.Row;
- string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
- if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "F")
- {
- QCM030705 dlg = new QCM030705();
- dlg.lock_id = lock_id;
- dlg.ob = this.ob;
- dlg.ShowDialog();
- }
- else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "D")
- {
- QCM030704 dlg = new QCM030704();
- dlg.lock_id = lock_id;
- dlg.ob = this.ob;
- dlg.ShowDialog();
- }
- else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "C")
- {
- QCM030701 dlg = new QCM030701();
- dlg.lock_id = lock_id;
- dlg.ob = this.ob;
- dlg.ShowDialog();
- }
- else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "P")
- {
- QCM030702 dlg = new QCM030702();
- dlg.lock_id = lock_id;
- dlg.ob = this.ob;
- dlg.ShowDialog();
- }
- else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "S")
- {
- QCM030703 dlg = new QCM030703();
- dlg.lock_id = lock_id;
- dlg.ob = this.ob;
- dlg.ShowDialog();
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- int count = 0;
- UltraGridRow ugr = this.ultraGrid9.ActiveRow;
- foreach (UltraGridRow ugr1 in this.ultraGrid9.Rows)
- {
- if (ugr1.Cells["CHECK"].Value.ToString() == "True")
- {
- ugr = ugr1;
- count++;
- continue;
- }
- }
- if (count == 0)
- {
- MessageBox.Show("请选择数据!");
- return;
- }
- string prodline = "4001LGX";
- string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString();
- string prod_name = ugr.Cells["PROD_NAME"].Value.ToString();
- string steelname = "";
- QCM030710 dlg = new QCM030710();
- dlg.prodline = prodline;
- dlg.material_no = material_no;
- dlg.prod_name = prod_name;
- dlg.steel = steelname;
- dlg.ob = this.ob;
- dlg.ShowDialog();
- this.textBox3.Text = dlg.steelname;
- }
- public static ValueList GeneralValuelist(ref DataTable table, string strKey, string strText)
- {
- if (table == null || !table.Columns.Contains(strKey) || !table.Columns.Contains(strText))
- return null;
- ArrayList alist = new ArrayList();
- ValueList vlist = new ValueList();
- for (int i = 0; i < table.Rows.Count; i++)
- {
- try
- {
- if (!alist.Contains(table.Rows[i][strKey]))
- {
- alist.Add(table.Rows[i][strKey]);
- vlist.ValueListItems.Add(table.Rows[i][strKey], Convert.ToString(table.Rows[i][strText]));
- }
- }
- catch { }
- }
- return vlist;
- }
- private void QCM030708_Load(object sender, EventArgs e)
- {
- this.comboBox2.SelectedIndex = 0;
- this.ultraGrid9.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
- this.ultraGrid2.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
- this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3);
- //CoreClientParam ccp = new CoreClientParam();
- //ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- //ccp.MethodName = "findXmMemo";
- //ccp.ServerParams = new object[] { };
- //ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //DataTable table1 = ccp.SourceDataTable;
- //ValueList valueList1 = GeneralValuelist(ref table1, "SM_CD", "SM_CFNM");
- //this.checkBoxComboBox1.DataSource = valueList1.ValueListItems;
- //ccp = new CoreClientParam();
- //ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl";
- //ccp.MethodName = "findCcMemo";
- //ccp.ServerParams = new object[] { };
- //ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //DataTable table2 = ccp.SourceDataTable;
- //ValueList valueList2 = GeneralValuelist(ref table2, "SM_CD", "SM_CFNM");
- //this.checkBoxComboBox2.DataSource = valueList2.ValueListItems;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM01.QCM0106.QueryDefect";
- ccp.MethodName = "QueryMemo";
- ccp.ServerParams = new object[] { "LG" };
- ccp = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- System.Data.DataTable dt = new System.Data.DataTable();
- dt = ccp.SourceDataTable;
- DataRow dr = dt.NewRow();
- dt.Rows.Add(dr);
- comboBox3.DataSource = dt;
- comboBox3.ValueMember = "MEMO";
- comboBox3.DisplayMember = "MEMO";
- comboBox3.SelectedIndex = dt.Rows.Count - 1;
- }
- private void ultraGrid2_DoubleClickCell(object sender, DoubleClickCellEventArgs e)
- {
- UltraGridRow ugr = e.Cell.Row;
- string lock_id = ugr.Cells["LOCK_ID"].Value.ToString();
- if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "F")
- {
- QCM030705 dlg = new QCM030705();
- dlg.lock_id = lock_id;
- dlg.ob = this.ob;
- dlg.ShowDialog();
- }
- else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "D")
- {
- QCM030704 dlg = new QCM030704();
- dlg.lock_id = lock_id;
- dlg.ob = this.ob;
- dlg.ShowDialog();
- }
- else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "C")
- {
- QCM030701 dlg = new QCM030701();
- dlg.lock_id = lock_id;
- dlg.ob = this.ob;
- dlg.ShowDialog();
- }
- else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "P")
- {
- QCM030702 dlg = new QCM030702();
- dlg.lock_id = lock_id;
- dlg.ob = this.ob;
- dlg.ShowDialog();
- }
- else if (ugr.Cells["LOCK_TYPE_CODE"].Value.ToString() == "S")
- {
- QCM030703 dlg = new QCM030703();
- dlg.lock_id = lock_id;
- dlg.ob = this.ob;
- dlg.ShowDialog();
- }
- }
- private void ultraTabControl1_Click(object sender, EventArgs e)
- {
- if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
- {
- this.label4.Text = "处置时间";
- }
- if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
- {
- this.label4.Text = "封锁时间";
- }
- }
- private void DoExport()
- {
- 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());
- }
- }
- }
- }
|