| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494 |
- 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;
- namespace Core.LZMes.Client.UIJ
- {
- public partial class UIJ040020 : FrmBase
- {
- public UIJ040020()
- {
- 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 "Exit":
- this.Close();
- break;
- }
- }
- private void UIJ040020_Load(object sender, EventArgs e)
- {
- initParam();
- }
- private void initParam()
- {
- try
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ04.UIJ040020";
- 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.DateTime.ToString("yyyyMMdd");
- string toDate = this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd");
- string shipDirNo = this.textBox1.Text.Trim();
- string curProgCd = "SFB";
- string laneTp = "";
- string entranceSeq = "";
- string shipCompNm = 0 > this.ultraComboEditor1.SelectedIndex ? "" : this.ultraComboEditor1.SelectedItem.DataValue.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ04.UIJ040020";
- 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;
- }
- }
- /// <summary>
- /// 排车
- /// </summary>
- private void DoSave()
- {
- Infragistics.Win.UltraWinGrid.RowsCollection rs = null;
- ArrayList list = new ArrayList();
- string[] param = null;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIJ.UIJ04.UIJ040020";
- switch (this.tabControl1.SelectedIndex)
- {
- case 0://火车
- break;
- case 1://汽车
- rs = this.ultraGrid4.Rows;
- for (int i = 0; i < rs.Count; i++)
- {
- if ("TRUE".Equals(rs[i].Cells["CHK"].Text.ToUpperInvariant()))
- {
- param = new string[4];
- 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();
- list.Add(param);
- }
- }
- 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.UIJ04.UIJ040020";
- switch (this.tabControl1.SelectedIndex)
- {
- case 0:
- 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[7];
- 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();//钢卷重量
- list.Add(param);
- }
- ccp.MethodName = "saveDLIVDIRCAR";
- ccp.ServerParams = new Object[] { regId, list };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- break;
- default:
- return;
- }
- }
- //汽车待装车计划
- 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 = "SFB";
- 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.UIJ04.UIJ040020";
- 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>
- private void queryDlivDirCoil(string dlivTp)
- {
- if ("T".Equals(dlivTp.ToUpperInvariant()))
- {
- this.dataSet3.Tables[0].Clear();
- CoreClientParam ccp4 = new CoreClientParam();
- ccp4.ServerName = "UIJ.UIJ04.UIJ040020";
- 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.UIJ04.UIJ040020";
- 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.UIJ04.UIJ040020";
- 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.UIJ04.UIJ040020";
- 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.UIJ04.UIJ040020";
- 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 = "SFB";
- 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.UIJ04.UIJ040020";
- 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++)
- {
- ultraGrid2.Rows[i].Cells[0].Value = true;
- ultraGrid2.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.UIJ04.UIJ040020";
- ccp.MethodName = "queryPlanCoil";
- ccp.SourceDataTable = this.dataSet5.Tables[0];
- ccp.ServerParams = new Object[] { dlivNo };
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- }
- }
|