| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354 |
- 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.UIN
- {
- public partial class UIN060210 : FrmBase
- {
- public UIN060210()
- {
- InitializeComponent();
- }
- /// <summary>
- /// ToolBar Event事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- #region "ToolBar Event"
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Save":
- this.Save();
- this.DoQuery();
- break;
- case "Add":
- this.Add();
- break;
- case "Cancel":
- this.Save();
- this.Cancel();
- break;
- }
- }
- private void DoQuery()
- {
- try
- {
- string coilNO = Convert.ToString(Common.FixDBManager.CheckNullStr(this.CombCAL_COIL_NO.Value));
- this.dataSet1.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBQuery";
- ccp.MethodName = "doSimpleQuery";
- ArrayList paramArray = new ArrayList();
- paramArray.Add("UIN060110_REEL_NO.Select");
- paramArray.Add(coilNO);
- ccp.ServerParams = new object[] { paramArray };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- //System.Diagnostics.Debug.WriteLine(this.dataSet1.Tables[0].ToString());
- ccp = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- ArrayList list = (ArrayList)ccp.ReturnObject;
- if (list != null && 0 < list.Count)
- {
- Hashtable ht = (Hashtable)list[0];
- DataRow dr = dataSet1.Tables[0].NewRow();
- for (int i = 0; i < dataSet1.Tables[0].Columns.Count; i++)
- {
- object obj = ht[dataSet1.Tables[0].Columns[i].ColumnName];
- if (null == obj)
- {
- continue;
- }
- if (obj.GetType().Equals(typeof(Hashtable)))
- {
- dr[i] = ((Hashtable)obj)["value"];
- }
- else
- {
- dr[i] = obj;
- }
- }
- dataSet1.Tables[0].Rows.Add(dr);
- ultraGrid1.Rows[0].Cells["EXIT_COIL_NO"].Activation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
- }
- else
- {
- dataTable1.Rows.Add(dataTable1.NewRow());
- //ultraGrid1.Rows[0].Cells["CHK"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- ultraGrid1.Rows[0].Cells["CHK"].Value = "true";
- //ultraGrid1.Rows[0].Cells["EXIT_COIL_NO"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- //ultraGrid1.Rows[0].Cells["EN_COIL_NO"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- }
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- public void Add()
- {
- try
- {
- int rowCnt = this.dataSet1.Tables[0].Rows.Count;
- DataRow rowt = this.dataSet1.Tables[0].Rows[rowCnt - 1];
-
- //rowt["COIL_CUT_SEQ"] = "0" + (sq + 1);
-
- DataTable dt = this.dataSet1.Tables[0];
- DataRow dr = dt.NewRow();
- dr["EN_COIL_NO"] = rowt["EN_COIL_NO"].ToString();
- dr["MILL_DTIME"] = "";
- dr["EXIT_COIL_NO"] = rowt["EXIT_COIL_NO"].ToString();
- dr["ACT_WGT"] = "";
- dr["COIL_LEN"] = "";
- dr["COIL_WTH"] = "";
- dr["COIL_THK"] = "";
- dr["COIL_INDIA"] = "";
- dr["COIL_OUTDIA"] = "";
- dt.Rows.InsertAt(dr, rowCnt);
-
-
- this.ultraGrid1.Refresh();
- System.Diagnostics.Debug.WriteLine(this.dataSet1.Tables[0].ToString());
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- public void Cancel()
- {
- try
- {
- int rowCnt = this.dataSet1.Tables[0].Rows.Count;
- this.dataSet1.Tables[0].Rows.Add(this.dataSet1.Tables[0].Rows[1]);
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- public void Save()
- {
- try
- {
- Hashtable paramHsmp = new Hashtable();
- StringBuilder strBf = new StringBuilder();
- this.ultraGrid1.UpdateData();
- int rowCount = 0;
- string coilNo = "";
- string enCoilNo = "";
- string coilCutSEQ = "";
- string actWgt = "";
- string coilLen = "";
- string coilWth = "";
- string coilThk = "";
- string coilIndia = "";
- string coilOutdia = "";
- string ordno = "";
- string regID = this.UserInfo.GetUserID();
- string regShift = this.UserInfo.GetUserOrder();
- string regGroup = this.UserInfo.GetUserGroup();
- if (regShift == "" || regGroup == "")
- {
- System.Windows.Forms.MessageBox.Show("班次、班组不能为空!");
- return;
- }
- string errorMsg = "";
- Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid1.Rows;
- if (rs.Count > 0)
- {
- for (int i = 0; i < rs.Count; i++)
- {
- if (rs[i].Cells["CHK"].Text.Trim() == "false")
- {
- continue;
- }
- else if (rs[i].Cells["ACT_WGT"].Text.Trim() == null || rs[i].Cells["ACT_WGT"].Text.Trim() == "")
- {
- continue;
- }
- else
- {
- paramHsmp = new Hashtable();
- coilNo = rs[i].Cells["EXIT_COIL_NO"].Text.Trim();//+ "|";
- //coilCutSEQ = coilCutSEQ + rs[i].Cells["COIL_CUT_SEQ"].Text.Trim() + "|";
- enCoilNo = rs[i].Cells["EN_COIL_NO"].Text.Trim(); //+ "|";
- actWgt = rs[i].Cells["ACT_WGT"].Text.Trim(); //+ "|";
- coilLen = rs[i].Cells["COIL_LEN"].Text.Trim();// + "|";
- coilWth = rs[i].Cells["COIL_WTH"].Text.Trim();// + "|";
- coilThk = rs[i].Cells["COIL_THK"].Text.Trim(); //+ "|";
- coilIndia = rs[i].Cells["COIL_INDIA"].Text.Trim();//+ "|";
- coilOutdia = rs[i].Cells["COIL_OUTDIA"].Text.Trim();// + "|";
- ordno = rs[i].Cells["ORDNO"].Text.Trim();// + "|";
- paramHsmp.Add("i1", enCoilNo);
- paramHsmp.Add("i2", coilNo);
- paramHsmp.Add("i3", "");
- paramHsmp.Add("i4", actWgt);
- paramHsmp.Add("i5", coilLen);
- paramHsmp.Add("i6", coilWth);
- paramHsmp.Add("i7", coilThk);
- paramHsmp.Add("i8", coilIndia);
- paramHsmp.Add("i9", coilOutdia);
- paramHsmp.Add("i10", regID);
- paramHsmp.Add("i11", "MAN");
- paramHsmp.Add("o12", "");
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIN060210_REEL_RESULT_NEW.call", paramHsmp };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- //提示
- ArrayList all = ccp.ReturnObject as ArrayList;
- if (all[0].ToString() != "YY")//确认是否存在问题
- {
- MessageBox.Show(all[0].ToString(), "提示");
- }
- else
- {
- // MessageBox.Show(all[1].ToString(), "提示");
- }
- }
- rowCount += 1;
- }
- //操作人
- //paramHsmp.Add("i1", regID);
- //paramHsmp.Add("i2", regShift);
- //paramHsmp.Add("i3", regGroup);
- //paramHsmp.Add("i4", rowCount);
- //paramHsmp.Add("i5", enCoilNo);
- //paramHsmp.Add("i6", coilNo);
- //paramHsmp.Add("i7", coilCutSEQ);
- //paramHsmp.Add("i8", ordno);
- //paramHsmp.Add("i9", actWgt);
- //paramHsmp.Add("i10", coilLen);
- //paramHsmp.Add("i11", coilWth);
- //paramHsmp.Add("i12", coilThk);
- //paramHsmp.Add("i13", coilIndia);
- //paramHsmp.Add("i14", coilOutdia);
- //paramHsmp.Add("o15", errorMsg);
- //paramHsmp.Add("i1", coilNo);
- //paramHsmp.Add("i2", enCoilNo);
- //paramHsmp.Add("i3", "");
- //paramHsmp.Add("i4", actWgt);
- //paramHsmp.Add("i5", coilLen);
- //paramHsmp.Add("i6", coilWth);
- //paramHsmp.Add("i7", coilThk);
- //paramHsmp.Add("i8", coilIndia);
- //paramHsmp.Add("i9", coilOutdia);
- //paramHsmp.Add("i10", regID);
- //paramHsmp.Add("i11", "MAN");
- //paramHsmp.Add("i12", "");
- //CoreClientParam ccp = new CoreClientParam();
- //ccp.ServerName = "UIB.COM.ComDBProcedure";
- //ccp.MethodName = "doXmlProcedure";
- //ccp.ServerParams = new Object[] { "UIN060210_REEL_RESULT_NEW.call", paramHsmp };
- //this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- ////提示
- //ArrayList all = ccp.ReturnObject as ArrayList;
- //if (all[0].ToString() != "YY")//确认是否存在问题
- //{
- // MessageBox.Show(all[0].ToString(), "提示");
- //}
- }
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- #endregion
- #region "Init"
- public void init()
- {
-
- DataTable dt = new DataTable();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBQuery";
- ccp.MethodName = "doSimpleQuery";
- ArrayList paramArray = new ArrayList();
- paramArray.Add("UIECOMM00_SELECT.RECOIL_NO");
- ccp.ServerParams = new object[] { paramArray };
- ccp.SourceDataTable = dt;
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- Core.LZMes.Client.UIE.UIE041.UIEBase.Init_ComboControl(this.CombCAL_COIL_NO, ref dt, "REEL_NO");
- }
- private void UIN060210_Load_1(object sender, EventArgs e)
- {
- init();
- }
- #endregion
- private void CombCAL_COIL_NO_ValueChanged(object sender, EventArgs e)
- {
- this.DoQuery();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- try
- {
- Hashtable ht = new Hashtable();
- ht.Add("i1", this.CombCAL_COIL_NO.Text.Trim());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIN060110_CAL_RESULT_NEW_TEMP.call", ht };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- MessageBox.Show("系统发生未知异常", "提示");
- }
- }
-
- }
- }
|