| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398 |
- 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;
- namespace Core.LZMes.Client.UIF.UIF07
- {
- public partial class UIF071010 : FrmBase
- {
- public UIF071010()
- {
- InitializeComponent();
- }
- private void Get_PKGPlan_Info()
- {
- try
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF07.UIF071010";
- ccp.MethodName = "queryPkgData";
- CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- if (obj.ReturnInfo.Length == 0)
- {
- this.dataSet1.Tables["TAB_CALINFO"].Clear();
- System.Data.DataTable tab0 = FixDBManager.ConvertToDataTable(obj.ReturnObject as System.Collections.ArrayList, this.dataSet1.Tables["TAB_CALINFO"]);
- tab0.TableName = "TAB_CALINFO";
- this.dataSet1.Tables["TAB_CALINFO"].Merge(tab0);
- this.dataSet1.AcceptChanges();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void Get_PKGPlan_List()
- {
- try
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF07.UIF071010";
- ccp.MethodName = "queryPkgList";
- CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- if (obj.ReturnInfo.Length == 0)
- {
- this.dataSet1.Tables["TAB_CALLIST"].Clear();
- System.Data.DataTable tab0 = FixDBManager.ConvertToDataTable(obj.ReturnObject as System.Collections.ArrayList, this.dataSet1.Tables["TAB_CALLIST"]);
- tab0.TableName = "TAB_CALLIST";
- this.dataSet1.Tables["TAB_CALLIST"].Merge(tab0);
- this.dataSet1.AcceptChanges();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- #region "ToolBar Event"
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- try
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.dataSet1.Tables["TAB_CCOILLIST"].Clear();
- Query("");
- break;
- case "Add":
- Add();
- break;
- case "Delete":
- Delete();
- break;
- case "Save":
- 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 Query(string where)
- {
- try
- {
- string Condition = GetCondition(where);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF07.UIF071010";
- ccp.MethodName = "queryCalCoil";
- ccp.ServerParams = new object[] { Condition };
- CoreClientParam obj = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- if (obj.ReturnInfo.Length == 0)
- {
- System.Data.DataTable tab0 = FixDBManager.ConvertToDataTable(obj.ReturnObject as System.Collections.ArrayList, this.dataSet1.Tables["TAB_CCOILLIST"]);
- tab0.TableName = "TAB_CCOILLIST";
- this.dataSet1.Tables["TAB_CCOILLIST"].Merge(tab0);
- this.dataSet1.AcceptChanges();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void Add()
- {
- try
- {
- this.ugrd_CoilList.UpdateData();
- System.Data.DataRow[] rows = this.dataSet1.Tables["TAB_CCOILLIST"].Select("FLAG='TRUE'");
- if (rows.Length == 0)
- {
- MessageBox.Show("您还未选择钢卷,请选择");
- return;
- }
- string CoilNOS = "";
- string ex = "";
- for (int i = 0; i < this.ugrd_CoilList.Rows.Count; i++)
- {
- if (Common.FixDBManager.CheckNullStr(ugrd_CoilList.Rows[i].Cells["FLAG"].Value).ToUpper() == "TRUE")
- {
- CoilNOS = CoilNOS + ugrd_CoilList.Rows[i].Cells["COIL_NO"].Value.ToString() + ";";
- }
- }
- CoilNOS = CoilNOS.Substring(0, CoilNOS.Length - 1);
- string paras = ";;";
- string paran = "3";
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", CoilNOS);
- paramHsmp.Add("i2", rows.Length.ToString());
- paramHsmp.Add("i3", paras);
- paramHsmp.Add("i4", paran);
- paramHsmp.Add("o5", ex);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF071010.Add_PkgPlan", 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
- {
- Get_PKGPlan_Info();
- Get_PKGPlan_List();
- for (int i = rows.Length - 1; i >= 0; i--)
- {
- this.dataSet1.Tables["TAB_CCOILLIST"].Rows.Remove(rows[i]);
- }
- this.dataSet1.Tables["TAB_CCOILLIST"].AcceptChanges();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void Delete()
- {
- try
- {
- if (this.ugrd_CalList.Selected.Rows.Count == 0)
- {
- MessageBox.Show("请选择您要移除的记录");
- return;
- }
- string pgkNO = this.ugrd_CalList.Rows[0].Cells["PKG_NO"].Value.ToString();
- string CoilNOS = "";
- string Condition = "";
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.ugrd_CalList.Selected.Rows)
- {
- CoilNOS = CoilNOS + Common.FixDBManager.CheckNullStr(row.Cells["COIL_NO"].Value) + ";";
- Condition = Condition + "'" + Common.FixDBManager.CheckNullStr(row.Cells["COIL_NO"].Value) + "',";
- }
- CoilNOS = CoilNOS.Substring(0, CoilNOS.Length - 1);
- Condition = Condition.Substring(0, Condition.Length - 1);
- Condition = " AND A.OLD_SAMPL_NO IN(" + Condition + ") ";
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", pgkNO);
- paramHsmp.Add("i2", CoilNOS);
- paramHsmp.Add("i3", this.ugrd_CalList.Selected.Rows.Count.ToString());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF071010.Del_PkgPlan", 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
- {
- Get_PKGPlan_Info();
- Get_PKGPlan_List();
- Query(Condition);
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void Save()
- {
- try
- {
- string chk_flag = "00000";
- string pgkNO = this.ugrd_CalList.Rows[0].Cells["PKG_NO"].Value.ToString();
- //if (this.CHK_CHEM.Checked)
- // chk_flag = "1";
- //else
- // chk_flag = "0";
- //if (this.CHK_PHY.Checked)
- // chk_flag = chk_flag + "1";
- //else
- // chk_flag = chk_flag + "0";
- //chk_flag=chk_flag + "000";
- string ex = "";
- string chk_ex = "";
- Hashtable paramHsmp = new Hashtable();
- paramHsmp.Add("i1", pgkNO);
- paramHsmp.Add("i2", CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName());
- paramHsmp.Add("i3", chk_flag);
- paramHsmp.Add("o4", chk_ex);
- paramHsmp.Add("o5", ex);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new Object[] { "UIF071010.Affirm_PkgPlan", 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);
- if (err.Count > 1 && Common.FixDBManager.CheckNullStr(err[1]) != "1")
- {
- MessageBox.Show(err[0].ToString(), Common.FixDBManager.MsgCaption);
- }
- }
- else
- {
- Get_PKGPlan_Info();
- Get_PKGPlan_List();
- }
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- #endregion
- private string GetCondition(string InitCondition)
- {
- return "";
- //try
- //{
- // if (InitCondition.Length > 0)
- // return InitCondition;
- // string Condition = "";
- // string tmp = "";
- // if (FixDBManager.CheckNullStr(this.Cmb_BM.Text).Length > 0)
- // {
- // foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.Cmb_BM.CheckedRows)
- // {
- // tmp += "'" + row.Cells["SM_CD"].Value.ToString() + "',";
- // }
- // tmp = tmp.Substring(0, tmp.Length - 1);
- // Condition += " AND B.C_EXTSHAPE_REQ IN(" + tmp + ") ";
- // }
- // if (FixDBManager.CheckNullStr(this.Cmb_PM.Text).Length > 0)
- // {
- // tmp = "";
- // foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.Cmb_PM.CheckedRows)
- // {
- // tmp += "'" + row.Cells["SM_CD"].Value.ToString() + "',";
- // }
- // tmp = tmp.Substring(0, tmp.Length - 1);
- // Condition += " AND B.PRODNM_CD IN(" + tmp + ") ";
- // }
- // string[] height = txt_Height.Text.Split('~');
- // string min_height = height[0].Replace(" ", "");
- // min_height = min_height == "." ? "0" : min_height;
- // string max_height = height[1].Replace(" ", "");
- // max_height = max_height == "." ? "99" : max_height;
- // Condition += " AND B.C_ORD_THK BETWEEN " + min_height + " AND " + max_height;
- // string[] width = txt_Width.Text.Split('~');
- // string min_width = width[0].Replace(" ", "").Length == 0 ? "0" : width[0];
- // string max_width = width[1].Replace(" ", "").Length == 0 ? "1500" : width[1];
- // Condition += " AND B.C_ORD_WTH BETWEEN " + min_width + " AND " + max_width;
- // string[] senddate = mtx_SendDate.Text.Split('~');
- // string min_senddate = senddate[0].Replace(" ", "") == "--" ? "2010-01-01" : senddate[0];
- // string max_senddate = senddate[1].Replace(" ", "") == "--" ? "2099-01-01" : senddate[1];
- // Condition += " AND B.DEL_TO_DATE BETWEEN TO_CHAR(TO_DATE('" + min_senddate + "','YYYY-MM-DD'),'YYYYMMDD') "
- // + " AND TO_CHAR(TO_DATE('" + max_senddate + "','YYYY-MM-DD'),'YYYYMMDD') ";
- // return Condition;
- //}
- //catch (System.Exception ex)
- //{
- // System.Diagnostics.Debug.WriteLine(ex.ToString());
- // return "";
- //}
- }
- private void UIF071010_Load(object sender, EventArgs e)
- {
- try
- {
- Get_PKGPlan_Info();
- Get_PKGPlan_List();
- Common.FixDBManager.SetGridCheckBox("FLAG", "TAB_CCOILLIST", 25, this.ugrd_CoilList);
- string ColumnName = "";
- for (int i = 0; i < this.ugrd_CoilList.DisplayLayout.Bands[0].Columns.Count; i++)
- {
- ColumnName = this.ugrd_CoilList.DisplayLayout.Bands[0].Columns[i].Key;
- if (ColumnName == "FLAG")
- {
- Common.FixDBManager.SetCellActivation(ColumnName, "TAB_CCOILLIST", this.ugrd_CoilList, "ALLOWEDIT");
- }
- else
- {
- Common.FixDBManager.SetCellActivation(ColumnName, "TAB_CCOILLIST", this.ugrd_CoilList, "ACTIVATEONLY");
- }
- }
- this.ugrd_CalList.DisplayLayout.Override.SupportDataErrorInfo = Infragistics.Win.UltraWinGrid.SupportDataErrorInfo.RowsAndCells;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- /// <summary>
- /// 修改钢卷计划包装等级
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button1_Click(object sender, EventArgs e)
- {
- string coilNo = textBox3.Text.Trim();
- if (coilNo != null && coilNo != "")
- {
- string pkgLevel = ultraComboEditor2.Value != null ? ultraComboEditor2.Value.ToString() : "1";
- string pgkNO = this.ugrd_CalList.Rows[0].Cells["PKG_NO"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF07.UIF071010";
- ccp.MethodName = "updatePkgLevel";
- ccp.ServerParams = new Object[] { coilNo,pgkNO,pkgLevel };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- Get_PKGPlan_List();
- }
- else
- {
- MessageBox.Show("请选择需要修改包装等级的钢卷!");
- }
- }
- private void ugrd_CalList_AfterRowActivate(object sender, EventArgs e)
- {
- textBox3.Text = ugrd_CalList.ActiveRow.Cells["COIL_NO"].Value.ToString();
- ultraComboEditor2.Text = ugrd_CalList.ActiveRow.Cells["PACK_METHOD"].Value.ToString();
- }
- }
- }
|