| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- 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 UIK050102 : FrmBase
- {
- public UIK050102()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "query"://查询
- this.DoQuery();
- break;
-
- case "Update"://下发换下轧辊实绩
- this.DoUpdate();
- break;
- }
- }
- private void DoQuery()
- {
- try
- {
- string zgNum = "";
- string beginTime = "";
- string endTime = "";
- CoreClientParam ccp = new CoreClientParam();
- CoreClientParam ccp2 = new CoreClientParam();
- DataTable dt = new DataTable();
- DataTable dt2 = new DataTable();
- if (this.ultraCheckEditor1.Checked)
- {
- this.dataSet1.Clear();
- zgNum = this.ultraTextzgNum.Text;
- if (zgNum == "")
- {
- MessageBox.Show("请输入轧辊编号");
- return;
- }
-
- this.ultraTextzgNum.Clear();
- this.ultraCheckEditor1.Checked = false;
- ccp.ServerName = "UIK.UIK05.UIK050101";
- ccp.MethodName = "DoQuerydetailwithno";
- ccp.ServerParams = new object[] { zgNum };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- else
- {
- //flag = true;
- 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 = "DoQueryShang";
- ccp.MethodName = "DoQuerydetail";
- ccp.ServerParams = new object[] { zgNum, 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.ultraDateTimeEditor1.Enabled = false;
- this.ultraDateTimeEditor2.Enabled = false;
- }
- if (!this.ultraCheckEditor1.Checked)
- {
- this.ultraDateTimeEditor1.Enabled = true;
- this.ultraDateTimeEditor2.Enabled = true;
- }
- }
- catch (Exception Ex)
- {
- MessageBox.Show(Ex.ToString());
- }
- }
-
- private void DoUpdate()
- {
- try
- {
- //Infragistics.Win.UltraWinGrid.UltraGridRow ugr = this.ultraGrid1.ActiveRow;
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["SELECT_ITME"].Text.ToString() == "True")
- {
- //if (ugr.Cells["MEG_FLAG"].Value.ToString() == "是")
- //{
- // MessageBox.Show("该计划已下发!");
- // ugr.Cells["SELECT_ITME"].Value = false;
- //}
- //else
- //{
- // string 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;
- // string uid = "Core.LZMes.Client.UIK.UIK050030";
- string number = ugr.Cells["SPEC_NO"].Value.ToString();
- string create_time = ugr.Cells["REG_DTIME"].Value.ToString();
- //DataTable dt = new DataTable();
- //CoreClientParam ccp = new CoreClientParam();
- //ccp.ServerName = "UIK.UIK05.UIK050030";
- //ccp.MethodName = "DoSelect";
- //ccp.ServerParams = new object[] { create_time };
- //ccp.SourceDataTable = dt;
- //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- //{
- string reason = ugr.Cells["REASON_CODE"].Text.Trim().ToString();
- 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,number, create_time };
- ccp2 = this.ExecuteNonQuery(ccp2, CoreInvokeType.Internal);
- if (0 != ccp2.ReturnCode)
- {
- MessageBox.Show("保存失败!");
- }
- else
- {
- MessageBox.Show("保存成功!");
- //CoreClientParam ccp3 = new CoreClientParam();
- //ccp3.ServerName = "UIK.UIK05.UIK050030";
- //ccp3.MethodName = "DoUpdate";
- //ccp3.ServerParams = new object[] { create_time };
- //ccp3 = this.ExecuteNonQuery(ccp3, CoreInvokeType.Internal);
- //if (0 != ccp3.ReturnCode)
- //{
- // MessageBox.Show("修改失败!");
- //}
- //else
- //{
- // MessageBox.Show("修改成功!");
- //}
- }
- // }
- //}
- }
- else
- {
- continue;
- }
- }
- }
- catch (Exception Ex)
- {
- MessageBox.Show(Ex.ToString());
- }
-
- }
-
- private void UIK050102_Load(object sender, EventArgs e)
- {
- }
- private void ultraGrid1_DoubleClick(object sender, EventArgs e)
- {
- try
- {
- if (this.ultraGrid1.ActiveCell == null)
- return;
- //string gridValue = this.ultraGrid1.ActiveCell.Column.Key;//== "ZHIBIAO";
- // string s1 = this.ultraComboEditor1.Text;
- string s2 = this.ultraGrid1.ActiveRow.Cells["FLAG"].Text;
- //if (s1 == "酸轧")
- //{
- // CUIC030110 CWindow = new CUIC030110();
- // CWindow.ob = this.ob;
- // CWindow.pLine = this.ultraComboEditor1.Text;
- // CWindow.sTime = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
- // CWindow.eTime = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
- // CWindow.flag = this.ultraGrid1.ActiveRow.Cells["ZHIBIAO"].Text;
- // if (s2 == "酸轧非计划总量(t)" || s2 == "酸轧卷一次命中率(%)" || s2 == "酸轧表面缺陷量(t)" || s2 == "1.原料类(t)" || s2 == "待判(未判定)(t)" || s2 == "2.酸轧类(t)" || s2 == "3.钢质类(t)" || s2 == "2.1酸轧辊印(t)" || s2 == "2.2酸轧擦划伤(t)" || s2 == "2.3酸轧振动纹(t)" || s2 == "2.4酸轧其它(t)")
- // {
- // CWindow.StartPosition = FormStartPosition.CenterScreen;
- // if (CWindow.ShowDialog() == DialogResult.OK)
- // {
- // //null;
- // }
- // CWindow.Dispose();
- // }
- //}
-
-
-
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
-
- }
- }
|