| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344 |
- 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;
- namespace Core.LZMes.Client.UIF
- {
- public partial class UIF061090 : FrmBase
- {
- public UIF061090()
- {
- InitializeComponent();
- }
- #region "ToolBar Event"
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Save":
- this.Save();
- break;
- case "Delete":
- Delete();
- break;
- case "Send":
- Send();
- break;
- case "UnSend":
- UnSend();
- break;
- case "Exit":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 查询轧辊单元计划信息
- /// </summary>
- private void DoQuery()
- {
- try
- {
- this.dataSet1.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF06.UIF061090";
- ccp.MethodName = "QueryRollPlan";
- ccp.ServerParams = new object[] { };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- if (obj.ReturnInfo.Length == 0)
- {
- System.Data.DataTable tab0 = Common.FixDBManager.ConvertToDataTable(obj.ReturnObject as System.Collections.ArrayList, this.dataSet1.Tables["C_TBF03_SPEC_ROLL"]);
- tab0.TableName = "C_TBF03_SPEC_ROLL";
- this.dataSet1.Tables["C_TBF03_SPEC_ROLL"].Merge(tab0);
- this.dataSet1.AcceptChanges();
- };
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- /// <summary>
- /// 保存轧辊单元计划的顺序调整
- /// </summary>
- private void Save()
- {
- try
- {
- string rollNO = Convert.ToString(Common.FixDBManager.CheckNullStr(this.textTarget.Text));
- string pos = Convert.ToString(Common.FixDBManager.CheckNullStr(this.comboPosition.Value));
- string type = Convert.ToString(Common.FixDBManager.CheckNullStr(this.optionBF.Value));
- if (rollNO == "" || pos == "" || type == "")
- {
- MessageBox.Show(" 条件不能为空! ");
- }
- string ex = "";
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", rollNO);
- paramHsmp.Add("i2", pos);
- paramHsmp.Add("i3", type);
- paramHsmp.Add("o4", ex);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF061090.Adj_RollUnit", paramHsmp };
- CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
- if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
- {
- MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
- }
- else
- {
- DoQuery();
- }
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- /// <summary>
- /// 删除轧辊单元计划
- /// </summary>
- private void Delete()
- {
- try
- {
- this.ugrd_RollInfo.UpdateData();
- System.Data.DataRow[] rows = this.dataSet1.Tables[0].Select("CHK='TRUE'");
- if (rows.Length == 0)
- {
- MessageBox.Show("请选择你要下发的计划", Common.FixDBManager.MsgCaption);
- return;
- }
- string RollNO = rows[0]["ROLL_MANA_NO"].ToString();
- System.Windows.Forms.DialogResult rt = MessageBox.Show("是否确认删除所选轧制单元计划?", Common.FixDBManager.MsgCaption, MessageBoxButtons.YesNo);
- if (rt == DialogResult.No)
- {
- return;
- }
- string Ex = "";
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", RollNO);
- paramHsmp.Add("i2", CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
- paramHsmp.Add("o3", Ex);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF061090.Del_RollUnit", paramHsmp };
- CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
- if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
- {
- MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
- }
- else
- {
- DoQuery();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- /// <summary>
- /// 轧辊单元计划指令下发(二级)
- /// 支持≤2调计划指令下发
- /// </summary>
- private void Send()
- {
- try
- {
- this.ugrd_RollInfo.UpdateData();
- System.Data.DataRow[] rows = this.dataSet1.Tables[0].Select("CHK='TRUE'");
- if (rows.Length == 0)
- {
- MessageBox.Show("请选择你要下发的计划", Common.FixDBManager.MsgCaption);
- return;
- }
- string RollNO = rows[0]["ROLL_MANA_NO"].ToString();
- string ex = "";
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", RollNO);
- paramHsmp.Add("o2", ex);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF061090.Sed_RollUnit", paramHsmp };
- CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
- if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
- {
- MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
- }
- else
- {
- DoQuery();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- /// <summary>
- /// 对已下发(二级)的轧辊单元计划进行撤销
- /// </summary>
- private void UnSend()
- {
- try
- {
- this.ugrd_RollInfo.UpdateData();
- System.Data.DataRow[] rows = this.dataSet1.Tables[0].Select("CHK='TRUE'");
- if (rows.Length == 0)
- {
- MessageBox.Show("请选择你要下发的计划", Common.FixDBManager.MsgCaption);
- return;
- }
- string RollNO = rows[0]["ROLL_MANA_NO"].ToString();
- string ex = "";
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", RollNO);
- paramHsmp.Add("i2", CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
- paramHsmp.Add("o3", ex);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF061090.Usd_RollUnit", paramHsmp };
- CoreClientParam obj = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- System.Collections.ArrayList err = obj.ReturnObject as System.Collections.ArrayList;
- if (err != null && err.Count > 0 && Common.FixDBManager.CheckNullStr(err[0]) != "1")
- {
- MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
- }
- else
- {
- DoQuery();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- #endregion
- #region "Init"
- private void UIF061090_Load(object sender, EventArgs e)
- {
- try
- {
- GetInitData();
- Init_Grid();
- Common.FixDBManager.Init_ComboControl(this.comboPosition, "SCM_BASE_INFO", "NAME_", "ID_", ref dataSet2);
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void GetInitData()
- {
- try
- {
- this.dataSet2.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF06.UIF061090";
- ccp.MethodName = "queryInitdata";
- ccp.ServerParams = new object[] { };
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- dataSet2.Tables[0].TableName = "SCM_BASE_INFO";
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void Init_Grid()
- {
- try
- {
- Common.FixDBManager.SetGridCheckBox("CHK", "C_TBF03_SPEC_ROLL", 0, this.ugrd_RollInfo);
- foreach (Infragistics.Win.UltraWinGrid.UltraGridColumn col in this.ugrd_RollInfo.DisplayLayout.Bands[0].Columns)
- {
- if (col.Key == "CHK")
- {
- Common.FixDBManager.SetCellActivation(col.Key, "C_TBF03_SPEC_ROLL", this.ugrd_RollInfo, "ALLOWEDIT");
- }
- else
- {
- Common.FixDBManager.SetCellActivation(col.Key, "C_TBF03_SPEC_ROLL", this.ugrd_RollInfo, "ALLOWEDIT");
- }
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- #endregion
- #region "Grid Event"
- private void ugrd_RollInfo_AfterRowActivate(object sender, EventArgs e)
- {
- try
- {
- this.textTarget.Text = Convert.ToString(this.ugrd_RollInfo.ActiveRow.Cells["ROLL_MANA_NO"].Value);
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void ugrd_RollInfo_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- try
- {
- this.ugrd_RollInfo.UpdateData();
- if (e.Cell.Column.Key == "CHK")
- {
- if (e.Cell.Value.ToString().ToUpper() == "TRUE")
- {
- string RollNO = e.Cell.Row.Cells["ROLL_MANA_NO"].Value.ToString();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_RollInfo.Rows)
- {
- if (row.Cells["ROLL_MANA_NO"].Value.ToString() != RollNO)
- {
- row.Cells["CHK"].Value = "FALSE";
- }
- }
- this.ugrd_RollInfo.UpdateData();
- }
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- #endregion
-
- }
- }
|