| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283 |
- using System;
- using System.Collections;
- 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 Common;
- using Infragistics.Win.UltraWinGrid;
- namespace Core.LZMes.Client.UIF.UIF06
- {
- public partial class UIF061060 : FrmBase
- {
- public UIF061060()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- try
- {
- switch (ToolbarKey)
- {
- case "query":
- DoQuery();
- break;
- case "send":
- Send();
- break;
- case "unsend":
- UnSend();
- break;
- case "Save":
-
- break;
- case "Exit":
- this.dataSet1.Dispose();
- this.dataSet1 = null;
- this.Close();
- break;
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void init()
- {
- string commCodeCd = "F02004";
- DataTable dt = new DataTable();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBQuery";
- ccp.MethodName = "doSimpleQuery";
- ArrayList paramArray = new ArrayList();
- paramArray.Add("UIECOMM00_SELECT.COMM_CODE");
- paramArray.Add(commCodeCd);
- ccp.ServerParams = new object[] { paramArray };
- ccp.SourceDataTable = dt;
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- Core.LZMes.Client.UIE.UIE041.UIEBase.Init_ComboControl(this.ComboOrdProc, ref dt, "F02004");
- }
- private void DoQuery()
- {
- try
- {
- dataSet1.Clear();
- dataSet2.Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF06.UIF061020";
- switch (this.tabControl1.SelectedIndex)
- {
- case 0:
- ccp.MethodName = "queryHotPlanCoils";
- ccp.SourceDataTable = dataSet1.Tables[0];
- break;
- case 1:
- ccp.MethodName = "querySxPlanCoils";
- ccp.SourceDataTable = dataSet2.Tables[0];
- break;
- default:
- return;
- }
- // ccp.MethodName = "queryHotPlanCoils";
-
- CoreClientParam obj = this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- /// <summary>
- /// 酸洗计划下发
- /// </summary>
- private void Send()
- {
- try
- {
- this.ultraGrid1.UpdateData();
- this.ultraGrid2.UpdateData();
- System.Data.DataRow[] rows = this.dataSet1.Tables[0].Select("CHK='TRUE'");
- // System.Data.DataRow[] rows1 = this.dataSet2.Tables[0].Select("CHK='TRUE'");
- switch (this.tabControl1.SelectedIndex)
- {
- case 0:
- rows = this.dataSet1.Tables[0].Select("CHK='TRUE'");
- break;
- case 1:
- rows = this.dataSet2.Tables[0].Select("CHK='TRUE'");
- break;
- default:
- return;
- }
- if (rows.Length == 0)
- {
- MessageBox.Show("请选择你要下发的计划", Common.FixDBManager.MsgCaption);
- return;
- }
- string coilNos = "";
- foreach(System.Data.DataRow row in rows)
- {
- coilNos += row["L_COIL_NO"].ToString().Trim() + ";";
- }
- if (coilNos.Equals(""))
- {
- DoQuery();
- return; }
- coilNos = coilNos.Substring(0, coilNos.Length - 1);
- //string ordPro = Convert.ToString(Common.FixDBManager.CheckNullStr(this.ComboOrdProc.Value));
-
- string ComboOrdProc = Convert.ToString(Convert.ToString(Common.FixDBManager.CheckNullStr(Common.FixDBManager.splitArray(this.ComboOrdProc.Value, ','))));
- string ex = "";
- #region "校验下发可行性"
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", coilNos);
- paramHsmp.Add("i2",rows.Length);
- paramHsmp.Add("i3", ComboOrdProc);
- paramHsmp.Add("o4", ex);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF061020.Send_HotPan", 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();
- //}
- DoQuery();
- #endregion
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- /// <summary>
- /// 对已下发(二级)的重卷计划进行撤销
- /// </summary>
- private void UnSend()
- {
- try
- {
- this.ultraGrid1.UpdateData();
- System.Data.DataRow[] rows = this.dataSet1.Tables[0].Select("CHK='TRUE'");
- if (rows.Length == 0)
- {
- MessageBox.Show("请选择你要取消下发的计划", Common.FixDBManager.MsgCaption);
- return;
- }
- string coilNos = "";
- foreach (System.Data.DataRow row in rows)
- {
- coilNos += row["L_COIL_NO"].ToString().Trim() + ";";
- }
- coilNos = coilNos.Substring(0, coilNos.Length - 1);
- string ex = "";
- #region "校验下发可行性"
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", coilNos);
- paramHsmp.Add("i2", rows.Length);
- paramHsmp.Add("i3", UserInfo.GetUserID());
- paramHsmp.Add("o4", ex);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF061020.Usd_pltcmReelPlan", 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();
- //}
- DoQuery();
- #endregion
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void UIF061020_Load(object sender, EventArgs e)
- {
- init();
- }
- private void ComboOrdProc_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
- {
- UltraGridColumn checkColumn = this.ComboOrdProc.DisplayLayout.Bands[0].Columns.Add("Selected");
- checkColumn.DataType = typeof(bool);
- // Show the checkbox column at the beginning
- checkColumn.Header.VisiblePosition = 0;
- //--
- this.ComboOrdProc.CheckedListSettings.EditorValueSource = Infragistics.Win.EditorWithComboValueSource.CheckedItems;
- // Hook this column up to the CheckedListSettings
- this.ComboOrdProc.CheckedListSettings.CheckStateMember = checkColumn.Key;
- // Ensure that the ValueMember is set to our other field
- this.ComboOrdProc.ValueMember = "LABEL";
- }
- }
- }
|