| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434 |
- 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 UIF052030 : FrmBase
- {
- public UIF052030()
- {
- InitializeComponent();
- }
- #region "ToolBar Event"
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Query2":
- this.DoQuery2();
- break;
- case "Save":
- this.Save();
- break;
- case "Delete":
- Delete();
- break;
- case "Send":
- Send();
- break;
- case "UnSend":
- UnSend();
- break;
- case "Exit":
- this.dataSet1.Dispose();
- this.dataSet2.Dispose();
- this.dataSet1 = null;
- this.dataSet2 = null;
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 查询轧辊单元计划信息
- /// </summary>
- private void DoQuery()
- {
- try
- {
- this.dataSet1.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF05.UIF052030";
- ccp.MethodName = "QueryCalPlan";
- 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["L_TBF03_SPEC_ROLL"]);
- tab0.TableName = "L_TBF03_SPEC_ROLL";
- this.dataSet1.Tables["L_TBF03_SPEC_ROLL"].Merge(tab0);
- this.dataSet1.AcceptChanges();
- };
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- /// <summary>
- /// 查询轧辊单元计划信息
- /// </summary>
- private void DoQuery2()
- {
- try
- {
- this.dataSet1.Tables[0].Clear();
- DataTable dt = new DataTable();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBQuery";
- ccp.MethodName = "doSimpleQuery";
- ArrayList paramArray = new ArrayList();
- paramArray.Add("UIF052030.Query_CALPlan_List_02");
- ccp.ServerParams = new object[] { paramArray };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- /*
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF05.UIF052030";
- ccp.MethodName = "UIF052030.Query_CALPlan_List_02";
- 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["L_TBF03_SPEC_ROLL"]);
- tab0.TableName = "L_TBF03_SPEC_ROLL";
- this.dataSet1.Tables["L_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[] { "UIF052030.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_CalInfo.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]["CAL_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[] { "UIF052030.Del_CalUnit", 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_CalInfo.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]["CAL_NO"].ToString();
- string ex = "";
- #region "校验下发可行性"
- 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[] { "UIF052030.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);
- return;
- }
- #endregion
- //#region "执行下发"
- //paramHsmp = new Hashtable();
- //paramHsmp.Add("i1", RollNO);
- //paramHsmp.Add("o2", ex);
- //ccp = new CoreClientParam();
- //ccp.ServerName = "com.core.sip.xinyu.service.CalSendTelegramService";
- //ccp.MethodName = "sendPlanByPlanNo";
- //ccp.ServerParams = new Object[] { RollNO };
- //obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- //if (Common.FixDBManager.CheckNullInt(obj.ReturnObject)<=0)
- //{
- // MessageBox.Show("下发失败", Common.FixDBManager.MsgCaption);
- //}
- //else
- //{
- //DoQuery();
- //}
- //#endregion
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- /// <summary>
- /// 对已下发(二级)的轧辊单元计划进行撤销
- /// </summary>
- private void UnSend()
- {
- try
- {
- this.ugrd_CalInfo.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]["CAL_NO"].ToString();
- string ex = "";
- #region "校验下发可行性"
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", RollNO);
- paramHsmp.Add("i2", UserInfo.GetUserID());
- paramHsmp.Add("o3", ex);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF052030.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);
- return;
- }
- #endregion
- //#region "执行下发"
- //paramHsmp = new Hashtable();
- //paramHsmp.Add("i1", RollNO);
- //paramHsmp.Add("o2", ex);
- //ccp = new CoreClientParam();
- //ccp.ServerName = "com.core.sip.xinyu.service.CalSendTelegramService";
- //ccp.MethodName = "canclePlanByPlanNo";
- //ccp.ServerParams = new Object[] { RollNO };
- //obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- //if (Common.FixDBManager.CheckNullInt(obj.ReturnObject) <= 0)
- //{
- // MessageBox.Show("下发失败", Common.FixDBManager.MsgCaption);
- //}
- //else
- //{
- //DoQuery();
- //}
- //#endregion
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- #endregion
- #region "Init"
- private void UIF052030_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.UIF05.UIF052030";
- 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", "L_TBF03_SPEC_ROLL", 0, this.ugrd_CalInfo);
- foreach (Infragistics.Win.UltraWinGrid.UltraGridColumn col in this.ugrd_CalInfo.DisplayLayout.Bands[0].Columns)
- {
- if (col.Key == "CHK")
- {
- Common.FixDBManager.SetCellActivation(col.Key, "L_TBF03_SPEC_ROLL", this.ugrd_CalInfo, "ALLOWEDIT");
- }
- else
- {
- Common.FixDBManager.SetCellActivation(col.Key, "L_TBF03_SPEC_ROLL", this.ugrd_CalInfo, "ALLOWEDIT");
- }
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- #endregion
- #region "Grid Event"
- private void ugrd_CalInfo_AfterRowActivate(object sender, EventArgs e)
- {
- try
- {
- this.textTarget.Text = Convert.ToString(this.ugrd_CalInfo.ActiveRow.Cells["CAL_NO"].Value);
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void ugrd_CalInfo_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- try
- {
- this.ugrd_CalInfo.UpdateData();
- if (e.Cell.Column.Key == "CHK")
- {
- if (e.Cell.Value.ToString().ToUpper() == "TRUE")
- {
- string RollNO = e.Cell.Row.Cells["CAL_NO"].Value.ToString();
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_CalInfo.Rows)
- {
- if (row.Cells["CAL_NO"].Value.ToString() != RollNO)
- {
- row.Cells["CHK"].Value = "FALSE";
- }
- }
- this.ugrd_CalInfo.UpdateData();
- }
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- #endregion
-
- }
- }
|