| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Collections;
- using System.Windows.Forms;
- using CoreFS.CA06;
- using PrintSolution;
- using Infragistics.Win.UltraWinGrid;
- namespace Core.LZMes.Client.UIJ
- {
-
- public partial class UIJ030020 : FrmBase
- {
- #region
- public UIJ030020()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Save":
- this.DoSave();
- break;
- case "Comfirm":
- this.DoComfirm();
- break;
- case "Print":
- DoPrint();
- break;
- case "Exit":
- this.Close();
- break;
- }
- }
- #endregion
- private void UIJ030020_Load(object sender, EventArgs e)
- {
- initParam();
- this.tabControl1.SelectedIndex = 1;
- }
- private void initParam()
- {
- try
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ03.UIJ030020";
- ccp.MethodName = "queryTransUnits";
- ccp = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- ArrayList transList = (ArrayList)ccp.ReturnObject;
- int listSize = transList.Count;
- Infragistics.Win.ValueListItem[] valueListItems = new Infragistics.Win.ValueListItem[listSize];
- for (int i = 0; i < listSize; i++)
- {
- Infragistics.Win.ValueListItem item = new Infragistics.Win.ValueListItem();
- Hashtable ht = (Hashtable)transList[i];
- item.DataValue = ht["VALUE"].ToString();
- item.DisplayText = ht["LABEL"].ToString(); ;
- valueListItems[i] = item;
- }
- this.ultraComboEditor1.Items.AddRange(valueListItems);
-
- }
- catch (Exception e)
- {
- MessageBox.Show(e.Message);
- }
- }
- /// <summary>
- /// 查询装车计划
- /// </summary>
- private void DoQuery()
- {
- string shipProgCd = "03";//发货指示状态
- string fromDate = this.ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : "";
- //this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
- string toDate = this.ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") : "";
- //this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
- string shipDirNo = this.textBox1.Text.Trim();//发货指示号
- string curProgCd = "DFB";//物料进度
- string laneTp = "";//火车入库道次
- string entranceSeq = "";//装车次数
- string shipCompNm = 0 > this.ultraComboEditor1.SelectedIndex ? "" : this.ultraComboEditor1.SelectedItem.DataValue.ToString();//运输单位
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ03.UIJ030020";
- ccp.MethodName = "queryTransPlan";
- DataRowCollection drs = null;
- string dlivTp = "";//运输方式
- switch (this.tabControl1.SelectedIndex)
- {
- case 0:
- dlivTp = "T";
- this.dataSet1.Tables[0].Clear();
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- ccp.ServerParams = new Object[] { shipProgCd, fromDate, toDate, shipDirNo, curProgCd, shipCompNm, dlivTp, laneTp, entranceSeq };
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- drs = dataSet1.Tables[0].Rows;
- for (int i = 0; i < drs.Count; i++)
- {
- ultraGrid1.Rows[i].Cells[0].Value = false;
- ultraGrid1.Rows[i].Cells[0].Column.CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- }
- dataSet5.Tables[0].Clear();
- dataSet3.Tables[0].Clear();
- break;
- case 1:
- dlivTp = "C";
- this.dataSet2.Tables[0].Clear();
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- ccp.ServerParams = new Object[] { shipProgCd, fromDate, toDate, shipDirNo, curProgCd, shipCompNm, dlivTp, laneTp, entranceSeq };
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- drs = dataSet2.Tables[0].Rows;
- for (int i = 0; i < drs.Count; i++)
- {
- ultraGrid4.Rows[i].Cells[0].Value = false;
- ultraGrid4.Rows[i].Cells[0].Column.CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- }
- dataSet4.Tables[0].Clear();
- dataSet6.Tables[0].Clear();
- break;
- default:
- return;
- }
- }
- private string Checkdriv()
- {
- Infragistics.Win.UltraWinGrid.RowsCollection rs = null;
- ArrayList list = new ArrayList();
- string dlivno = null;
- string ord_no = null;
- string ord_seq = null;
- string carflag = "1";
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ03.UIJ030020";
- switch (this.tabControl1.SelectedIndex)
- {
- case 0://火车
- return "1";
- break;
- case 1://汽车
- label13.Focus();
- ultraGrid4.Update();
- rs = this.ultraGrid4.Rows;
- for (int i = 0; i < rs.Count; i++)
- {
- if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
- {
- dlivno = rs[i].Cells["DLIV_DIRNO"].Value.ToString().Trim();
- ord_no = rs[i].Cells["ORD_NO"].Value.ToString().Trim();
- ord_seq = rs[i].Cells["ORD_SEQ"].Value.ToString().Trim();
- ccp.MethodName = "GetCarNo";
- ccp.ServerParams = new Object[] { dlivno, ord_no, ord_seq };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnObject !=null)
- {
- list = (ArrayList)ccp.ReturnObject;
-
- Hashtable ht = (Hashtable)list[0];
- // ht["VALUE"].ToString();
- if (ht["RET_CODE"].ToString() == "0")
- {
- carflag = "0";
- return carflag;
- }
- }
-
- }
- }
- return carflag;
- break;
- default:
- return carflag;
- }
- }
- private void GetCarNo()
- {
- Infragistics.Win.UltraWinGrid.RowsCollection rs = null;
- ArrayList list = new ArrayList();
- string dlivno= null;
- string ord_no = null;
- string ord_seq = null;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ03.UIJ030020";
- switch (this.tabControl1.SelectedIndex)
- {
- case 0://火车
- break;
- case 1://汽车
- label13.Focus();
- ultraGrid4.Update();
- rs = this.ultraGrid4.Rows;
- for (int i = 0; i < rs.Count; i++)
- {
- if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
- {
- dlivno = rs[i].Cells["DLIV_DIRNO"].Value.ToString().Trim();
- ord_no = rs[i].Cells["ORD_NO"].Value.ToString().Trim();
- ord_seq = rs[i].Cells["ORD_SEQ"].Value.ToString().Trim();
- ccp.MethodName = "GetCarNo";
- ccp.ServerParams = new Object[] { dlivno, ord_no, ord_seq };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnObject != null)
- {
- Hashtable ht = (Hashtable)ccp.ReturnObject;
- if (ht.Contains("PLAT_NO"))
- {
- rs[i].Cells["TRANS_CAR_NO"].Value = ht["PLAT_NO"].ToString();
- }
- }
-
- }
- }
- break;
- default:
- return;
- }
- }
- /// <summary>
- /// 排车
- /// </summary>
- private void DoSave()
- {
- //if (Checkdriv() == "0")
- //{
- // MessageBox.Show("司机身份未复核,请稍后排车!");
- // return;
- //}
- Infragistics.Win.UltraWinGrid.RowsCollection rs = null;
- ArrayList list = new ArrayList();
- string[] param = null;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ03.UIJ030020";
- switch (this.tabControl1.SelectedIndex)
- {
- case 0://火车
-
- label10.Focus();
- ultraGrid1.Update();
- rs = this.ultraGrid1.Rows;
- for (int i = 0; i < rs.Count; i++)
- {
- if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
- {
- param = new string[6];
- param[0] = rs[i].Cells["ALLOC_SEQ"].Value.ToString().Trim();
- param[1] = rs[i].Cells["TRANS_CAR_NO"].Value.ToString().Trim();
- param[2] = rs[i].Cells["LANE_TP"].Value.ToString().Trim();
- param[3] = rs[i].Cells["ENTERANCE_SEQ"].Value.ToString().Trim();
- param[4] = rs[i].Cells["DLIV_DIRNO"].Value.ToString().Trim();
- param[5] = rs[i].Cells["SHIP_DIRNO"].Value.ToString().Trim();
- list.Add(param);
- if (param[1] == null || param[1].Equals(""))
- {
- MessageBox.Show("车辆号不能为空,请确认后重新操作!");
- return;
- }
- if (param[2] == null || param[2].Equals(""))
- {
- MessageBox.Show("入库道次不能为空,请确认后重新操作!");
- return;
- }
- if (param[3] == null || param[3].Equals(""))
- {
- MessageBox.Show("装车次数不能为空,请确认后重新操作!");
- return;
- }
- }
- }
- ccp.MethodName = "saveSHIPTrain";
- ccp.ServerParams = new Object[] { list };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- for (int i = 0; i < rs.Count; i++)
- {
- if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
- {
- //设置单元格禁用
- rs[i].Cells["CHK"].Column.CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
- }
- }
- queryDlivDirCoil("T");
- break;
- case 1://汽车
- label13.Focus();
- ultraGrid4.Update();
- rs = this.ultraGrid4.Rows;
- for (int i = 0; i < rs.Count; i++)
- {
- if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
- {
- param = new string[6];
- param[0] = rs[i].Cells["ALLOC_SEQ"].Value.ToString().Trim();
- param[1] = rs[i].Cells["TRANS_CAR_NO"].Value.ToString().Trim();
- param[2] = rs[i].Cells["DLIV_DIRNO"].Value.ToString().Trim();
- param[3] = rs[i].Cells["SHIP_DIRNO"].Value.ToString().Trim();
- param[4] = rs[i].Cells["ORD_NO"].Value.ToString().Trim();
- param[5] = rs[i].Cells["ORD_SEQ"].Value.ToString().Trim();
- list.Add(param);
- if (param[1] == null || param[1].Equals(""))//param[0] == null || param[0].Equals("") ||
- {
- MessageBox.Show("车辆号不能为空,请确认后重新操作!");
- return;
- }
- }
- }
- ccp.MethodName = "saveSHIPDIRCAR";
- ccp.ServerParams = new Object[] { list};
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- for (int i = 0; i < rs.Count; i++)
- {
- if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
- {
- //设置单元格禁用
- rs[i].Cells["CHK"].Column.CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
-
- }
- }
- queryDlivDirCoil("C");
- break;
- default:
- return;
- }
- }
- /// <summary>
- /// 确认装车操作
- /// </summary>
- private void DoComfirm()
- {
- if (DialogResult.Yes != MessageBox.Show("确认后不能进行排车操作,是否排车完毕?", "提示", MessageBoxButtons.YesNo))
- {
- return;
- }
- //用户名
- string regId = this.UserInfo.GetUserID();
- //超重是否继续装车标识
- bool top_wgt = false;
- //超数车辆数量
- int num_car = 0;
- Infragistics.Win.UltraWinGrid.RowsCollection rs = null;
- ArrayList list = new ArrayList();
- string[] param = null;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ03.UIJ030020";
- switch (this.tabControl1.SelectedIndex)
- {
- case 0:
- rs = this.ultraGrid2.Rows;
- for (int i = 0; i < rs.Count; i++)
- {
- if (!"TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
- {
- MessageBox.Show("第" + (i + 1) + "行的选择项没有选择,作为同一批次的车不能出现为空的现象!");
- return;
- }
- param = new string[8];
- param[0] = rs[i].Cells["ALLOC_SEQ"].Text.Trim();//排车顺序号
- param[1] = rs[i].Cells["TRANS_CAR_NO"].Text.Trim();//车厢号
- param[2] = rs[i].Cells["DLIV_DIRNO"].Text.Trim();//运输号
- param[3] = rs[i].Cells["SHIP_DIRNO"].Text.Trim();//发货指示号
- param[4] = rs[i].Cells["OLD_SAMPL_NO"].Text.Trim();//批次号
- param[5] = rs[i].Cells["COIL_NO"].Text.Trim();//钢卷号
- param[6] = rs[i].Cells["ACT_WGT"].Text.Trim();//钢卷重量
- param[7] = rs[i].Cells["CUR_LOAD_LOC"].Text.Trim();//垛位
- list.Add(param);
- }
- ccp.MethodName = "saveDLIVDIRCAR";
- ccp.ServerParams = new Object[] { regId, UserInfo.GetUserOrder(), UserInfo.GetUserGroup(), list };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- break;
- case 1:
- rs = this.ultraGrid6.Rows;
- for (int i = 0; i < rs.Count; i++)
- {
- if (!"TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
- {
- MessageBox.Show("第"+(i+1)+"行的选择项没有选择,作为同一批次的车不能出现为空的现象!");
- return;
- }
- param = new string[8];
- param[0] = rs[i].Cells["ALLOC_SEQ"].Text.Trim();//排车顺序号
- param[1] = rs[i].Cells["TRANS_CAR_NO"].Text.Trim();//车厢号
- param[2] = rs[i].Cells["DLIV_DIRNO"].Text.Trim();//运输号
- param[3] = rs[i].Cells["SHIP_DIRNO"].Text.Trim();//发货指示号
- param[4] = rs[i].Cells["OLD_SAMPL_NO"].Text.Trim();//批次号
- param[5] = rs[i].Cells["COIL_NO"].Text.Trim();//钢卷号
- param[6] = rs[i].Cells["ACT_WGT"].Text.Trim();//钢卷重量
- param[7] = rs[i].Cells["CUR_LOAD_LOC"].Text.Trim();//垛位
- list.Add(param);
- }
- ccp.MethodName = "saveDLIVDIRCAR";
- ccp.ServerParams = new Object[] { regId, UserInfo.GetUserOrder(), UserInfo.GetUserGroup(), list };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- break;
- default:
- return;
- }
- this.DoQuery();
- }
- //汽车待装车计划
- private void label13_Click(object sender, EventArgs e)
- {
- string shipProgCd = "04";
- string fromDate = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
- string toDate = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
- string shipDirNo = this.textBox1.Text.Trim();
- string curProgCd = "DFB";
- string laneTp = "";
- string entranceSeq = "";
- string shipCompNm = 0 > this.ultraComboEditor1.SelectedIndex ? "" : this.ultraComboEditor1.SelectedItem.DataValue.ToString();
- string dlivTp = "C";
- this.dataSet2.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ03.UIJ030020";
- ccp.MethodName = "queryTransPlan";
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- ccp.ServerParams = new Object[] { shipProgCd, fromDate, toDate, shipDirNo, curProgCd, shipCompNm, dlivTp, laneTp, entranceSeq };
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- DataRowCollection drs = dataSet2.Tables[0].Rows;
- for (int i = 0; i < drs.Count; i++)
- {
- ultraGrid4.Rows[i].Cells[0].Value = true;
- ultraGrid4.Rows[i].Cells[0].Column.CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
- }
- queryDlivDirCoil(dlivTp);
- }
- /// <summary>
- /// 查询待装车钢卷 queryShipDir
- /// <param name="dlivTp"
- /// </summary>
- public void queryDlivDirCoil(string dlivTp)
- {
- if ("T".Equals(dlivTp.ToUpperInvariant()))
- {
- this.dataSet3.Tables[0].Clear();
- CoreClientParam ccp4 = new CoreClientParam();
- ccp4.ServerName = "UIJ.UIJ03.UIJ030020";
- ccp4.MethodName = "queryShipDir";
- ccp4.SourceDataTable = this.dataSet3.Tables[0];
- ccp4.ServerParams = new Object[] { dlivTp };
- this.ExecuteQueryToDataTable(ccp4, CoreInvokeType.Internal);
- DataRowCollection drs = dataSet3.Tables[0].Rows;
- for (int i = 0; i < drs.Count; i++)
- {
- ultraGrid2.Rows[i].Cells[0].Value = false;
- }
- }
- else
- {
- this.dataSet4.Tables[0].Clear();
- CoreClientParam ccp4 = new CoreClientParam();
- ccp4.ServerName = "UIJ.UIJ03.UIJ030020";
- ccp4.MethodName = "queryShipDir";
- ccp4.SourceDataTable = this.dataSet4.Tables[0];
- ccp4.ServerParams = new Object[] { dlivTp };
- this.ExecuteQueryToDataTable(ccp4, CoreInvokeType.Internal);
- DataRowCollection drs = dataSet4.Tables[0].Rows;
- for (int i = 0; i < drs.Count; i++)
- {
- ultraGrid6.Rows[i].Cells[0].Value = false;
- }
- }
- }
- /// <summary>
- /// 查询下达汽车排车计划时排车计划对应的钢卷信息 queryPlanCoil
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid6_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
- {
- Infragistics.Win.UltraWinGrid.UltraGridRow uRow = this.ultraGrid6.ActiveRow;
- string dlivNo = uRow.Cells["DLIV_DIRNO"].Text.ToString().Trim();
- this.dataSet6.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ03.UIJ030020";
- ccp.MethodName = "queryPlanCoil";
- ccp.SourceDataTable = this.dataSet6.Tables[0];
- ccp.ServerParams = new Object[] { dlivNo };
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- /// <summary>
- /// 取消火车待装车指示
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void label7_Click(object sender, EventArgs e)
- {
- Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid2.Rows;
- ArrayList list = new ArrayList();
- string[] param = null;
- for (int i = 0; i < rs.Count; i++)
- {
- if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
- {
- param = new string[2];
- param[0] = rs[i].Cells["DLIV_DIRNO"].Value.ToString().Trim();
- param[1] = rs[i].Cells["SHIP_DIRNO"].Value.ToString().Trim();
- bool flag = false;
- //去除重复的发运指示号
- foreach (string[] tmp in list)
- {
- if (param[0].Equals(tmp[0]) && param[1].Equals(tmp[1]))
- {
- flag = true;
- break;
- }
- }
- if (!flag)
- {
- list.Add(param);
- }
- }
- }
- if (DialogResult.Yes == MessageBox.Show("是否确认同一运输指示号(计划号)下的钢卷全部选择上?", "提示", MessageBoxButtons.YesNo))
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ03.UIJ030020";
- ccp.MethodName = "returnSHIPDIRCAR";
- ccp.ServerParams = new Object[] { list };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- dataSet3.Tables[0].Clear();
- dataSet5.Tables[0].Clear();
- this.DoQuery();
- }
- }
- /// <summary>
- /// 取消汽车待装车指示
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void label15_Click(object sender, EventArgs e)
- {
- Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid6.Rows;
- ArrayList list = new ArrayList();
- string[] param = null;
- for (int i = 0; i < rs.Count; i++)
- {
- if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
- {
- param = new string[2];
- param[0] = rs[i].Cells["DLIV_DIRNO"].Value.ToString().Trim();
- param[1] = rs[i].Cells["SHIP_DIRNO"].Value.ToString().Trim();
- bool flag = false;
- //去除重复的发运指示号
- foreach (string[] tmp in list)
- {
- if (param[0].Equals(tmp[0]) && param[1].Equals(tmp[1]))
- {
- flag = true;
- break;
- }
- }
- if (!flag)
- {
- list.Add(param);
- }
- }
- }
- if(DialogResult.Yes == MessageBox.Show("是否确认同一运输指示号(计划号)下的钢卷全部选择上?","提示",MessageBoxButtons.YesNo))
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ03.UIJ030020";
- ccp.MethodName = "returnSHIPDIRCAR";
- ccp.ServerParams = new Object[] { list };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- dataSet4.Tables[0].Clear();
- dataSet6.Tables[0].Clear();
- this.DoQuery();
- }
- }
- /// <summary>
- /// 火车待装车计划
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void label10_Click(object sender, EventArgs e)
- {
- if (this.ultraComboEditor2.SelectedIndex < 0)
- {
- MessageBox.Show("火车入库道次不能为空,请选择相应的入库道次!");
- return;
- }
- if ("".Equals(this.textBox2.Text.Trim()))
- {
- MessageBox.Show("装车次数不能为空,请输入相应的装车次数信息!");
- return;
- }
- string shipProgCd = "04";
- string fromDate = this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd");
- string toDate = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
- string shipDirNo = this.textBox1.Text.Trim();
- string curProgCd = "DFB";
- string laneTp = this.ultraComboEditor2.Value.ToString();
- string entranceSeq = this.textBox2.Text.Trim();
- string shipCompNm = 0 > this.ultraComboEditor1.SelectedIndex ? "" : this.ultraComboEditor1.SelectedItem.DataValue.ToString();
- string dlivTp = "T";
- this.dataSet1.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ03.UIJ030020";
- ccp.MethodName = "queryTransPlan";
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- ccp.ServerParams = new Object[] { shipProgCd, fromDate, toDate, shipDirNo, curProgCd, shipCompNm, dlivTp, laneTp, entranceSeq };
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- DataRowCollection drs = dataSet1.Tables[0].Rows;
- for (int i = 0; i < drs.Count; i++)
- {
- ultraGrid1.Rows[i].Cells[0].Value = true;
- ultraGrid1.Rows[i].Cells[0].Column.CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
- }
- queryDlivDirCoil(dlivTp);
- }
- /// <summary>
- /// 查询下达火车排车计划时排车计划对应的钢卷信息
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGrid2_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
- {
- Infragistics.Win.UltraWinGrid.UltraGridRow uRow = this.ultraGrid2.ActiveRow;
- string dlivNo = uRow.Cells["DLIV_DIRNO"].Text.ToString().Trim();
- this.dataSet5.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ03.UIJ030020";
- ccp.MethodName = "queryPlanCoil";
- ccp.SourceDataTable = this.dataSet5.Tables[0];
- ccp.ServerParams = new Object[] { dlivNo };
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- /// <summary>
- /// 打印产品调运单
- /// </summary>
- private void DoPrint()
- {
- switch (this.tabControl1.SelectedIndex)
- {
- case 0:
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in this.ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Value))
- {
- try
- {
- ArrayList param = new ArrayList();
- // param.Add(uRow.Cells["TRANS_CAR_NO"].Value.ToString());//车辆号
- param.Add("");//钢卷数 202101 屏蔽
- string dlivDirNo = uRow.Cells["DLIV_DIRNO"].Text.ToString().Trim();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ03.UIJ030020";
- ccp.MethodName = "queryTransCoils";
- ccp.ServerParams = new Object[] { dlivDirNo };
- ccp = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- ArrayList coils = (ArrayList)ccp.ReturnObject;
- // param.Add(coils.Count);//钢卷数
- param.Add("");//钢卷数 202101 屏蔽
- double sumWeight = 0;
- foreach (object obj in coils)
- {
- Hashtable ht = (Hashtable)obj;
- sumWeight += Convert.ToDouble(((Hashtable)ht["ACT_WGT"])["value"].ToString().Trim());
- }
- // param.Add(sumWeight / 1000);//钢卷总重量
- param.Add("");//钢卷数 202101 屏蔽
- for (int i = 0; i < 10; i++)
- {
- if (i < coils.Count)
- {
- Hashtable ht = (Hashtable)coils[i];
- param.Add(ht["COIL_NO"].ToString());//卷号
- param.Add(ht["SPEC_STL_GRD"].ToString());//牌号
- param.Add(ht["ORD_SIZE"].ToString());//订单规格
- param.Add(((Hashtable)ht["ACT_WGT"])["value"].ToString().Trim());//重量
- param.Add(ht["CUR_LOAD_LOC"].ToString());//堆放位置
- }
- else
- {
- param.Add("");
- param.Add("");
- param.Add("");
- param.Add("");
- param.Add("");
- }
- }
- ExcelPrinter ePrinter = new ExcelPrinter("trans.xml", param);
- ePrinter.PageSetup.IsCustom = true;
- ePrinter.Orientation = 1;//横向打印
- ePrinter.printExcel();
- }
- catch (Exception ex)
- {
- MessageBox.Show("打印失败,请关闭程序后重新操作!");
- return;
- }
- }
- }
- break;
- case 1:
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in this.ultraGrid4.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Value))
- {
- try
- {
- ArrayList param = new ArrayList();
- // param.Add(uRow.Cells["TRANS_CAR_NO"].Value.ToString());//车辆号
- param.Add("");//钢卷数 202101 屏蔽
- string dlivDirNo = uRow.Cells["DLIV_DIRNO"].Text.ToString().Trim();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ03.UIJ030020";
- ccp.MethodName = "queryTransCoils";
- ccp.ServerParams = new Object[] { dlivDirNo };
- ccp = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- ArrayList coils = (ArrayList)ccp.ReturnObject;
- // param.Add(coils.Count);//钢卷数
- param.Add("");//钢卷数 202101 屏蔽
- double sumWeight = 0;
- foreach (object obj in coils)
- {
- Hashtable ht = (Hashtable)obj;
- sumWeight += Convert.ToDouble(((Hashtable)ht["ACT_WGT"])["value"].ToString().Trim());
- }
- //param.Add(sumWeight / 1000);//钢卷总重量
- param.Add("");//钢卷数 202101 屏蔽
- for (int i = 0; i < 10; i++)
- {
- if (i < coils.Count)
- {
- Hashtable ht = (Hashtable)coils[i];
- param.Add(ht["COIL_NO"].ToString());//卷号
- param.Add(ht["SPEC_STL_GRD"].ToString());//牌号
- param.Add(ht["ORD_SIZE"].ToString());//订单规格
- param.Add(((Hashtable)ht["ACT_WGT"])["value"].ToString().Trim());//重量
- param.Add(ht["CUR_LOAD_LOC"].ToString());//堆放位置
- }
- else
- {
- param.Add("");
- param.Add("");
- param.Add("");
- param.Add("");
- param.Add("");
- }
- }
- ExcelPrinter ePrinter = new ExcelPrinter("trans.xml", param);
- ePrinter.PageSetup.IsCustom = true;
- ePrinter.Orientation = 1;//横向打印
- ePrinter.printExcel();
- }
- catch (Exception ex)
- {
- MessageBox.Show("打印失败,请关闭程序后重新操作!");
- return;
- }
- }
- }
- break;
- default:
- return;
- }
- }
- //private void DoPrint()
- //{
- // try
- // {
- // UltraGrid ug = null;
- // if (this.tabControl1.SelectedTab.Text == "火车")
- // {
- // ug = this.ultraGrid1;
- // }
- // else
- // {
- // ug = this.ultraGrid4;
- // }
- // foreach (Infragistics.Win.UltraWinGrid.UltraGridRow uRow in ug.Rows)
- // {
- // if (Convert.ToBoolean(uRow.Cells["CHK"].Text))
- // {
- // try
- // {
- // ArrayList param = new ArrayList();
- // param.Add(uRow.Cells["TRANS_CAR_NO"].Value.ToString());//车辆号
- // string dlivDirNo = uRow.Cells["DLIV_DIRNO"].Text.ToString().Trim();
- // CoreClientParam ccp = new CoreClientParam();
- // ccp.ServerName = "UIJ.UIJ03.UIJ030020";
- // ccp.MethodName = "queryTransCoils";
- // ccp.ServerParams = new Object[] { dlivDirNo };
- // ccp = this.ExecuteQuery(ccp, CoreInvokeType.Internal);
- // ArrayList coils = (ArrayList)ccp.ReturnObject;
- // param.Add(coils.Count);//钢卷数
- // double sumWeight = 0;
- // foreach (object obj in coils)
- // {
- // Hashtable ht = (Hashtable)obj;
- // sumWeight += Convert.ToDouble(((Hashtable)ht["ACT_WGT"])["value"].ToString().Trim());
- // }
- // param.Add(sumWeight / 1000);//钢卷总重量
- // for (int i = 0; i < 10; i++)
- // {
- // if (i < coils.Count)
- // {
- // Hashtable ht = (Hashtable)coils[i];
- // param.Add(ht["COIL_NO"].ToString());//卷号
- // param.Add(ht["SPEC_STL_GRD"].ToString());//牌号
- // param.Add(ht["ORD_SIZE"].ToString());//订单规格
- // param.Add(((Hashtable)ht["ACT_WGT"])["value"].ToString().Trim());//重量
- // param.Add(ht["CUR_LOAD_LOC"].ToString());//堆放位置
- // }
- // else
- // {
- // param.Add("");
- // param.Add("");
- // param.Add("");
- // param.Add("");
- // param.Add("");
- // }
- // }
- // ExcelPrinter ePrinter = new ExcelPrinter("trans.xml", param);
- // ePrinter.PageSetup.IsCustom = true;
- // ePrinter.Orientation = 1;//横向打印
- // ePrinter.printExcel();
- // //2014221打印后更新界面状态
- // this.DoQuery();
- // }
- // catch (Exception ex)
- // {
- // MessageBox.Show("打印失败,请关闭程序后重新操作!");
- // return;
- // }
- // }
- // }
- // }
- // catch (Exception p)
- // {
- // }
- //}
- private void label3_Click(object sender, EventArgs e)
- {
- ArrayList coils = new ArrayList();
- string dlivDirNo = string.Empty;
- string ordNo = string.Empty;
- string ordSeq = string.Empty;
- ultraGrid6.UpdateData();
- Infragistics.Win.UltraWinGrid.RowsCollection rs = ultraGrid6.Rows;
- for (int i = 0; i < rs.Count; i++)
- {
- if (Convert.ToBoolean(rs[i].Cells["CHK"].Value))
- {
- if (string.IsNullOrEmpty(ordNo))
- {
- ordNo = rs[i].Cells["ORD_NO"].Value.ToString();
- ordSeq = rs[i].Cells["ORD_SEQ"].Value.ToString();
- }
- if (string.IsNullOrEmpty(dlivDirNo) || rs[i].Cells["DLIV_DIRNO"].Value.ToString().Equals(dlivDirNo))
- {
- coils.Add(rs[i].Cells["COIL_NO"].Value.ToString());
- dlivDirNo = rs[i].Cells["DLIV_DIRNO"].Value.ToString();
- }
- else
- {
- MessageBox.Show("只能对同一发运计划进行换卷!");
- return;
- }
- }
- }
- if (coils.Count == 0)
- {
- MessageBox.Show("请选择需要替换的钢卷!");
- return;
- }
- //UIJ030021 reCoilForm = new UIJ030021();
- //reCoilForm.StartPosition = FormStartPosition.CenterScreen;
- //reCoilForm.ob = this.ob;
- //reCoilForm.OrdNo = ordNo;
- //reCoilForm.OrdSeq = ordSeq;
- //reCoilForm.Coils = coils;
- //reCoilForm.ShowOnwer = this;
- //reCoilForm.ShowDialog();
- }
-
- #region 根据车辆号选择
- private void ultraGrid6_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- try
- {
- if (e.Cell.Column.Key == "CHK")
- {
- e.Cell.Row.Update();
- if (e.Cell.Value.ToString().ToUpper() == "TRUE")
- {
- string vDLIV_DIRNO = e.Cell.Row.Cells["DLIV_DIRNO"].Text;
- Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid6.Rows;
- for (int i = 0; i < rs.Count; i++)
- {
- if (rs[i].Cells["DLIV_DIRNO"].Text == vDLIV_DIRNO)
- {
- rs[i].Cells["CHK"].Value = true;
- rs[i].Appearance.ForeColor = System.Drawing.Color.Blue;
- }
- else {
- rs[i].Cells["CHK"].Value = false;
- rs[i].Appearance.ForeColor = System.Drawing.Color.Black;
- }
- }
-
- }
- else
- {
- string vDLIV_DIRNO = e.Cell.Row.Cells["DLIV_DIRNO"].Text;
- Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid6.Rows;
- for (int i = 0; i < rs.Count; i++)
- {
- if (rs[i].Cells["DLIV_DIRNO"].Text == vDLIV_DIRNO)
- {
- rs[i].Cells["CHK"].Value = false;
- rs[i].Appearance.ForeColor = System.Drawing.Color.Black;
- }
- }
- }
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- #endregion
- private void ultraGrid2_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- try
- {
- if (e.Cell.Column.Key == "CHK")
- {
- e.Cell.Row.Update();
- if (e.Cell.Value.ToString().ToUpper() == "TRUE")
- {
- string vDLIV_DIRNO = e.Cell.Row.Cells["DLIV_DIRNO"].Text;
- Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid2.Rows;
- for (int i = 0; i < rs.Count; i++)
- {
- if (rs[i].Cells["DLIV_DIRNO"].Text == vDLIV_DIRNO)
- {
- rs[i].Cells["CHK"].Value = true;
- rs[i].Appearance.ForeColor = System.Drawing.Color.Blue;
- }
- //else
- //{
- // rs[i].Cells["CHK"].Value = false;
- // rs[i].Appearance.ForeColor = System.Drawing.Color.Black;
- //}
- }
- }
- else
- {
- string vDLIV_DIRNO = e.Cell.Row.Cells["DLIV_DIRNO"].Text;
- Infragistics.Win.UltraWinGrid.RowsCollection rs = this.ultraGrid2.Rows;
- for (int i = 0; i < rs.Count; i++)
- {
- if (rs[i].Cells["DLIV_DIRNO"].Text == vDLIV_DIRNO)
- {
- rs[i].Cells["CHK"].Value = false;
- rs[i].Appearance.ForeColor = System.Drawing.Color.Black;
- }
- }
- }
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- this.GetCarNo();
- }
-
- }
-
- }
|