| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using Infragistics.Win;
- using System.Windows.Forms;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- using System.Diagnostics;
- using System.Text.RegularExpressions;
- using Infragistics.Win.UltraWinEditors;
- using System.Collections;
- namespace Core.LZMes.Client.QCM
- {
- public partial class QCM030613 : FrmBase
- {
- public QCM030613()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Judge":
- this.Judge();
- break;
- case "Exit":
- this.Close();
- break;
- case "Export":
- this.DoExport();
- break;
- }
- }
- private void Judge()
- {
- try
- {
- UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- if (ugr == null)
- return;
- string material_no = ugr.Cells["OLD_SAMPL_NO"].Value.ToString();
- string steel_name = ugr.Cells["SPEC_STL_GRD"].Value.ToString();
- string thick = ugr.Cells["COIL_THK"].Value.ToString();
- string width = ugr.Cells["COIL_WTH"].Value.ToString();
- string orderno = textBox3.Text.Trim().ToString();
- string gp_steel_name = txt_gp_tradeno.Text.Trim().ToString();
- string old_orderno = ugr.Cells["ORG_ORD_NO"].Value.ToString() + ugr.Cells["ORG_ORD_SEQ"].Value.ToString();
- string weight = ugr.Cells["ACT_WGT"].Value.ToString();
- string prod_line = ugr.Cells["PROD_LINE"].Value.ToString();
- string username = this.UserInfo.GetUserName();
- string gp_type = comboBox1.Text.ToString();
- if (gp_type.Equals(""))
- {
- MessageBox.Show("请选择改判类型!");
- return;
- }
- if (MessageBox.Show(this, "是否确认按【" + gp_type + "】改判!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "CoilGp";
- ccp.ServerParams = new object[] { material_no,steel_name,thick,width,orderno,old_orderno,weight,prod_line, username,gp_steel_name,gp_type};
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1)
- {
- return;
- }
- MessageBox.Show("改判成功!");
- this.textBox3.Text="";
- this.txt_gp_tradeno.Text ="";
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- private void canceljudge()
- {
- //try
- //{
- // QCM030607 frm = new QCM030607();
- // if (frm.ShowDialog() == DialogResult.OK)
- // {
- // string remark = frm._memo;
- // if (remark == "")
- // {
- // MessageBox.Show("请录入备注信息!");
- // return;
- // }
- // if (this.ultraGrid18.Selected.Rows.Count == 0)
- // this.ultraGrid18.ActiveRow.Selected = true;
- // foreach (UltraGridRow ugr in this.ultraGrid18.Rows)
- // {
- // if (ugr.Cells["CHECK"].Text.ToString() == "True")
- // {
- // string MATERIAL_NO = ugr.Cells["MATERIAL_NO"].Value.ToString();
- // string utm_id = ugr.Cells["UTM_ID"].Value.ToString();
- // string username = this.UserInfo.GetUserName();
- // CoreClientParam ccp = new CoreClientParam();
- // ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- // ccp.MethodName = "cancelUltimateJudge";
- // ccp.ServerParams = new object[] { username, MATERIAL_NO, utm_id,remark };
- // ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- // if (ccp.ReturnCode == -1)
- // {
- // return;
- // }
- // }
- // }
- // MessageBox.Show("取消判定成功!");
- // }
- //}
- //catch (Exception EX)
- //{
- // MessageBox.Show(EX.ToString());
- //}
- //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 coil_no = textBox4.Text.Trim();
- string prod_line = comboBox3.Text.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "GetGpCoilInfo";
- ccp.ServerParams = new object[] { coil_no,prod_line };
- 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 starttime = this.dateTimePicker1.Value.ToString("yyyyMMdd");
- string endtime = this.dateTimePicker2.Value.ToString("yyyyMMdd");
- string prod_line = comboBox3.Text.ToString();
- string coil_no = textBox4.Text.Trim();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.QCM03.QCM0302.QcmJudgePhysicalServiceImpl";
- ccp.MethodName = "GetGpHistory";
- ccp.ServerParams = new object[] { coil_no,starttime,endtime,prod_line };
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("系统出错,请联系管理人员", "警告");
- }
- }
- private void QCM030601_Load(object sender, EventArgs e)
- {
- ValueList vsflv = new ValueList();
- CoreClientParam ccp = new CoreClientParam();
- this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
- this.ultraGrid18.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
- this.label1.Visible = false;
- this.label2.Visible = false;
- this.dateTimePicker1.Visible = false;
- this.dateTimePicker2.Visible = false;
- //DoQuery();
- }
- public static bool SetUltraComboEditor(ref UltraComboEditor cbEdt, ref ValueList vlist, bool bNull)
- {
- if (cbEdt == null || vlist == null)
- return false;
- cbEdt.Items.Clear();
- if (bNull)
- cbEdt.Items.Add(null, "");
- for (int i = 0; i < vlist.ValueListItems.Count; i++)
- {
- try
- {
- cbEdt.Items.Add(vlist.ValueListItems[i].DataValue, vlist.ValueListItems[i].DisplayText);
- }
- catch { }
- }
- return true;
- }
- 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 checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- SetFilterUIType(this.ultraGrid1, this.checkBox1.Checked);
- SetFilterUIType(this.ultraGrid1, this.checkBox1.Checked);
- SetFilterUIType(this.ultraGrid16, this.checkBox1.Checked);
- SetFilterUIType(this.ultraGrid7, this.checkBox1.Checked);
- SetFilterUIType(this.ultraGrid11, this.checkBox1.Checked);
- SetFilterUIType(this.ultraGrid12, this.checkBox1.Checked);
- SetFilterUIType(this.ultraGrid13, this.checkBox1.Checked);
- SetFilterUIType(this.ultraGrid14, this.checkBox1.Checked);
- SetFilterUIType(this.ultraGrid15, this.checkBox1.Checked);
- }
- private void SetFilterUIType(UltraGrid grid, bool checkType)
- {
- if (checkType)
- {
- grid.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;
- }
- else
- {
- grid.DisplayLayout.Bands[0].ColumnFilters.ClearAllFilters();
- grid.DisplayLayout.Override.FilterUIType = FilterUIType.Default;
- }
- }
- private void DoExport()
- {
- try
- {
- if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
- {
- 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);
- }
- }
- if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
- {
- if (this.ultraGrid18.Rows.Count == 0)
- {
- MessageBox.Show("没有可以导出的数据", "提示");
- return;
- }
- if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK)
- {
- string fName = this.saveFileDialog1.FileName;
- this.ultraGridExcelExporter1.Export(this.ultraGrid18, fName);
- Process.Start(fName);
- }
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void checkBox2_CheckedChanged(object sender, EventArgs e)
- {
- if (this.ultraTabControl1.Tabs[0].Selected) //待判信息
- {
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows.Where(p => p.IsFilteredOut == false).ToList())
- {
- if (checkBox2.Checked)
- {
- ugr.Selected = true;
- }
- else
- {
- ugr.Selected = false;
- }
- }
- }
- if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
- {
- foreach (UltraGridRow ugr in this.ultraGrid18.Rows.Where(p => p.IsFilteredOut == false).ToList())
- {
- if (checkBox2.Checked)
- {
- ugr.Cells["CHECK"].Value = "True";
- }
- else
- {
- ugr.Cells["CHECK"].Value = "False";
- }
- }
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- if (ugr == null)
- return;
- string material_no = ugr.Cells["OLD_SAMPL_NO"].Text.ToString();
- string steel_code = ugr.Cells["SPEC_STL_GRD"].Text.ToString();
- string thick = ugr.Cells["COIL_THK"].Text.ToString();
- string PSC = ugr.Cells["PSC"].Text.ToString();
- string WIDTH = ugr.Cells["COIL_WTH"].Text.ToString();
- string PRODLINE = ugr.Cells["PROD_LINE"].Text.ToString();
- QCM030709 dlg = new QCM030709();
- dlg.MATERIAL_NO = material_no;
- dlg.STD_CODE = "";
- dlg.STEELCODE = steel_code;
- dlg.DELIVERY_STATE_CODE = "";
- dlg.HEIGHT = thick;
- dlg.PSC = PSC;
- dlg.WIDTH = WIDTH;
- dlg.LENGTH = "";
- dlg.PROD_LINE = PRODLINE;
- dlg.ob = this.ob;
- dlg.ShowDialog();
- this.textBox3.Text = dlg.orderno;
- this.txt_gp_tradeno.Text = dlg.gp_tradeno;
- }
- private void ultraTabControl1_Click(object sender, EventArgs e)
- {
- if (this.ultraTabControl1.Tabs[1].Selected) //判定记录
- {
- this.label1.Visible = true;
- this.label2.Visible = true;
- this.dateTimePicker1.Visible = true;
- this.dateTimePicker2.Visible = true;
- }
- if (this.ultraTabControl1.Tabs[0].Selected) //判定记录
- {
- this.label1.Visible = false;
- this.label2.Visible = false;
- this.dateTimePicker1.Visible = false;
- this.dateTimePicker2.Visible = false;
- }
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- this.textBox3.Text = "";
- this.txt_gp_tradeno.Text = "";
- }
- }
- }
|