| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- 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;
- namespace Core.LZMes.Client.UIK
- {
- public partial class UIK050101 : FrmBase
- {
- public UIK050101()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query"://查询
- this.DoQuery();
- break;
- case "Insert"://添加换下轧辊实绩
- this.DoInsert();
- break;
- case "Update"://下发换下轧辊实绩
- this.DoUpdate();
- break;
- }
- }
- private void DoQuery()
- {
- try
- {
- string zgNum = "";
- string beginTime = "";
- string endTime = "";
- bool flag = false;
- CoreClientParam ccp = new CoreClientParam();
- CoreClientParam ccp2 = new CoreClientParam();
- DataTable dt = new DataTable();
- DataTable dt2 = new DataTable();
- if (this.ultraCheckEditor1.Checked)
- {
- //this.ultraTextzgNum.Clear();
- //this.ultraCheckEditor1.Checked = false;
- //ccp.ServerName = "UIK.UIK05.UIK050030";
- //ccp.MethodName = "DoQueryShang";
- //ccp.ServerParams = new object[] { zgNum, flag ,beginTime,endTime};
- //ccp.SourceDataTable = dt;
- //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //this.ultraGrid1.DataSource = dt;
- //CoreClientParam ccp = new CoreClientParam();
- //ccp.ServerName = "UIM.UIM010040";
- //ccp.MethodName = "queryCoilStatus";
- //ccp.ServerParams = new object[] { coilNo };
- //ccp.SourceDataTable = this.dataSet1.Tables[0];
- //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //if (dt.Rows.Count <= 0)
- //{
- // MessageBox.Show("暂无记录!");
- //}
- //return;
- }
- else
- {
- zgNum = this.ultraTextzgNum.Text;
- beginTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : "";
- endTime = ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") : "";
- this.dataSet1.Clear();
- // this.ultraTextzgNum.Clear();
- // this.ultraCheckEditor1.Checked = false;
- ccp.ServerName = "UIK.UIK05.UIK050101";
- ccp.MethodName = "DoQuery";
- ccp.ServerParams = new object[] { zgNum, beginTime, endTime, beginTime, endTime };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
-
- }
- }
- // }
- catch (Exception Ex)
- {
- MessageBox.Show(Ex.ToString());
- }
- }
- private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e)
- {
- try
- {
- if (this.ultraCheckEditor1.Checked)
- {
- this.ultraTextzgNum.Enabled = false;
- }
- if (!this.ultraCheckEditor1.Checked)
- {
- this.ultraTextzgNum.Enabled = true;
- }
- }
- catch (Exception Ex)
- {
- MessageBox.Show(Ex.ToString());
- }
- }
- private void DoInsert()
- {
- try
- {
- if (this.ultraTextStand_id.Text == "")
- {
- MessageBox.Show("轧辊编号必须填写!");
- }
- else
- {
- // string spec_No = this.ultraTextSpec_no.Text;
- string roll_num = this.ultraTextStand_id.Text; //轧辊编号
- string daima = this.ultraTextEditor3.Text;//
- string cucaodu = this.ultraTextEditor6.Text; //轧辊区域
- string kaishizhijing = this.ultraTextShangID.Text;//上编号
- string jieshuzhijing = this.ultraTextXiaBian.Text;//下编号
- string ruandian = this.ultraTextEditor2.Text;//时间
- string moxueliang = this.ultraTextEditor4.Text;//原因 ------
- string chuangbianhao = this.ultraTextEditor5.Text;//轧制长度
- string yingdu = this.ultraTextEditor1.Text;//轧制量
- string kaishi = this.ultraCalendarDis_time.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : ""; //this.ultraCalendarDis_time.Text.ToString();
- string jieshu = this.dateTimePicker1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : ""; //this.dateTimePicker1.Text.ToString();
- string gunxing=this.ultraTextEditor9.Text;
- string yuandu=this.ultraTextEditor7.Text;
- string liewen = this.ultraTextEditor8.Text;
- System.DateTime dtt = System.DateTime.Now;
- string spec_No = (string.Format("{0:yyyyMMddHHmmss}", dtt)).Substring(8,6);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIK.UIK05.UIK050101";
- ccp.MethodName = "PlanAdd";
- ccp.ServerParams = new object[] { roll_num, daima, cucaodu, kaishizhijing, jieshuzhijing, ruandian, moxueliang, chuangbianhao, yingdu, kaishi, jieshu ,gunxing,yuandu,liewen};
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- //if (0 != ccp.ReturnCode) return;
- if (0 != ccp.ReturnCode)
- {
- MessageBox.Show("添加失败");
- }
- else
- {
- MessageBox.Show("添加成功");
- this.ultraTextStand_id.Clear();
- //this.ultraComboType.Clear();
- // this.ultraComboArea.Clear();
- this.ultraTextShangID.Clear();
- this.ultraTextXiaBian.Clear();
- //this.ultraComboEditor1.Clear();
- this.ultraTextEditor2.Clear();
- this.ultraTextEditor1.Clear();
- }
- // }
- }
- }
- catch (Exception Ex)
- {
- MessageBox.Show(Ex.ToString());
- }
- }
- private void ultraGrid1_DoubleClickRow(object sender, DoubleClickRowEventArgs e)
- {
- Infragistics.Win.UltraWinGrid.UltraGrid uGrid = (Infragistics.Win.UltraWinGrid.UltraGrid)sender;
- ultraTextStand_id.Text = uGrid.ActiveRow.Cells["ROLL_NUMBER"].Text;
- ultraTextEditor3.Text = uGrid.ActiveRow.Cells["PROGRAM_NUMBE"].Text;//磨削程序代码
- ultraTextEditor6.Text = uGrid.ActiveRow.Cells["ROUGHNESS"].Text;//粗糙度
- ultraTextShangID.Text = uGrid.ActiveRow.Cells["ROLL_DIAMETER_MD_BEFORE"].Text;//磨前直径
- ultraTextEditor2.Text = uGrid.ActiveRow.Cells["BRUISEMAX"].Text;//软点
- ultraTextEditor4.Text = uGrid.ActiveRow.Cells["GRIND_AMOUNT"].Text;//磨削量
- ultraTextEditor5.Text = uGrid.ActiveRow.Cells["STATION_NO"].Text;//辊床编号
- ultraTextXiaBian.Text = uGrid.ActiveRow.Cells["ROLL_DIAMETER_MD_AFTER"].Text;//磨后直径
- ultraTextEditor1.Text = uGrid.ActiveRow.Cells["HARDNESS_MD"].Text;//硬度
- //ultraCalendarDis_time.Text = uGrid.ActiveRow.Cells["GRIND_START_TIME"].Text;//磨前直径
- //dateTimePicker1.Text = uGrid.ActiveRow.Cells["GRIND_END_TIME"].Text;//软点
- ultraTextEditor9.Text = uGrid.ActiveRow.Cells["ROLL_TYPE"].Text;//辊型
- ultraTextEditor7.Text = uGrid.ActiveRow.Cells["ROLL_ROUNDNESS"].Text;//圆度
- ultraTextEditor8.Text = uGrid.ActiveRow.Cells["CRACKMAX"].Text;//裂纹
- }
- private void DoUpdate()
- {
- try
- {
- ArrayList al = new ArrayList();
- ArrayList list = new ArrayList();
- list.Add("UIK050101_01.UPDATE");
- string roll_num = this.ultraTextStand_id.Text; //轧辊编号
- string daima = this.ultraTextEditor3.Text;//
- string cucaodu = this.ultraTextEditor6.Text; //轧辊区域
- string kaishizhijing = this.ultraTextShangID.Text;//上编号
- string jieshuzhijing = this.ultraTextXiaBian.Text;//下编号
- string ruandian = this.ultraTextEditor2.Text;//软点
- string moxueliang = this.ultraTextEditor4.Text;//原因 ------
- string chuangbianhao = this.ultraTextEditor5.Text;//轧制长度
- string yingdu = this.ultraTextEditor1.Text;//轧制量
- // string kaishi = this.ultraCalendarDis_time.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : ""; //this.ultraCalendarDis_time.Text.ToString();
- // string jieshu = this.dateTimePicker1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : ""; //this.dateTimePicker1.Text.ToString();
- string gunxing = this.ultraTextEditor9.Text;
- string yuandu = this.ultraTextEditor7.Text;
- string liewen = this.ultraTextEditor8.Text;
- string beginTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : "";
- string endTime = ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") : "";
-
- //
- list.Add(daima);
- list.Add(cucaodu);
- list.Add(kaishizhijing);
- list.Add(ruandian);
- list.Add(moxueliang);
- list.Add(chuangbianhao);
- list.Add(jieshuzhijing);
- list.Add(yingdu);
- list.Add(gunxing);
- list.Add(yuandu);
- list.Add(liewen);
- list.Add(roll_num);
- list.Add(beginTime);
- list.Add(endTime);
- al.Add(list);
- if (al.Count == 0)
- {
- MessageBox.Show("请勾选数据再做保存操作!", "提示");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBSave";
- ccp.MethodName = "doXmlSave";
- ccp.ServerParams = new object[] { al };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.DoQuery();
-
- //CoreClientParam ccp2 = new CoreClientParam();
- //ccp2.ServerName = "UIK.UIK05.UIK050030";
- //ccp2.MethodName = "DoUpdate";
- ////ccp2.ServerParams = new object[] { spec_No, sand_Id, roll_Type, roll_Area, roll_Id_up, roll_Id_lo, z_time, reason, banci, banbie, s_chang, s_liang, s_shi, x_chang, x_liang, x_shi, create_time, uid };
- //ccp2.ServerParams = new object[] { reason, zhazhiliang, zhazhicd, timexg, number, iddown, idup, namerg };
- //ccp2 = this.ExecuteNonQuery(ccp2, CoreInvokeType.Internal);
- if (0 != ccp.ReturnCode)
- {
- MessageBox.Show("保存失败!");
- }
- else
- {
- MessageBox.Show("保存成功!");
- }
- }
- catch (Exception Ex)
- {
- MessageBox.Show(Ex.ToString());
- }
-
- }
-
- private void UIK050101_Load(object sender, EventArgs e)
- {
- }
- }
- }
|