| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using System.Threading;
- using System.Collections;
- using System.Reflection;
- using CoreFS.CA06;
- namespace Core.StlMes.Client.Sale.UI.Balance.BalanceDetail
- {
- public partial class FrmBalanceDetailAccept : Core.StlMes.Client.Sale.Common.FrmStyleBase.FrmUIBase
- {
- DataSet dsMain = new DataSet();
- Core.StlMes.Client.Sale.BLL.SaleBusinessMgt.Trans.YdmZcLoadVehicleMatMgt ydmZcLoadVehicleMatMgt = null;
- public FrmBalanceDetailAccept()
- {
- InitializeComponent();
- }
-
- private void FrmBalanceDetailAccept_Load(object sender, EventArgs e)
- {
- this.checkBox1.Checked = true;
- ydmZcLoadVehicleMatMgt = new Core.StlMes.Client.Sale.BLL.SaleBusinessMgt.Trans.YdmZcLoadVehicleMatMgt(this.ob);
- dsMain = base.GetDataSetByColumnName(this.GetGrid1DataStructTg(),
- new Hashtable(), this.GetColumnAndCaption());
- this.ultraGrid1.DataSource = dsMain;
- HidenColumn();
- base.SetGridStyle(ref this.ultraGrid1);
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case ToolbarKey_Query:
- {
- if (this.checkBox1.Checked)
- this.Query();
- else
- this.QueryVirtual();
- break;
- }
- case "Accept":
- {
- this.Accept();
- break;
- }
- case ToolbarKey_Close:
- {
- this.Close();
- break;
- }
- }
- }
- private void Query()
- {
- // this.dsMain.Clear();
- dsMain = base.GetDataSetByColumnName(this.GetGrid1DataStructTg(),
- new Hashtable(), this.GetColumnAndCaption());
- this.ultraGrid1.DataSource = this.dsMain;
- HidenColumn();
- base.SetGridStyle(ref this.ultraGrid1);
- // 获取所有关闭的提单
- DataSet ds = this.ydmZcLoadVehicleMatMgt.GetCanAcceptMatInfo();
- // 如果有查询条件,在原有记录中模糊查找
- if (this.textBox7.Text.Length > 0)
- ds = Util.UtilDataSet.GetDataSetWithRowFilterWithApproximateMatch(ds, this._BILL_NO, this.textBox7.Text.Trim());
-
- // 分组数据显示
- ds = Util.UtilDataSet.GetDateSetByGroupColumnAndStaticsColumnName(ds,
- this.GetGroupByName(), this.GetShowName(), this.GetStaticsName());
- // 填充数据到数据源显示
- Util.UtilDataSet.SetDataSetByMergeSameColumnName(ref dsMain,ds);
- SetRoudWgt();
-
- }
- private void HidenColumn()
- {
- try
- {
- foreach (string s in GetHideName())
- {
- this.ultraGrid1.DisplayLayout.Bands[0].Columns[s].Hidden = true;
- }
- }
- catch
- {
- }
- }
- private void SetRoudWgt()
- {
- try
- {
- foreach (DataRow dr in dsMain.Tables[0].Rows)
- {
- dr[_ACT_WEIGHT] = Math.Round(Convert.ToDouble(dr[_ACT_WEIGHT]), 4);
- }
- }
- catch
- { }
-
- }
- private void QueryVirtual()
- {
- DataSet dsShow = base.GetDataSetByColumnName(this.GetGrid1DataStructTgVirtualBillno(),
- new Hashtable(), this.GetColumnAndCaption());
- // 获取所有关闭的提单
- DataSet ds = this.ydmZcLoadVehicleMatMgt.GetUnAcceptVirtulYdmZcBillM();
- // 如果有查询条件,在原有记录中模糊查找
- if (this.textBox7.Text.Length > 0)
- ds = Util.UtilDataSet.GetDataSetWithRowFilterWithApproximateMatch(ds, this._BILL_NO, this.textBox7.Text.Trim());
-
- // 填充数据到数据源显示
- Util.UtilDataSet.SetDataSetByMergeSameColumnName(ref dsShow, ds);
- this.ultraGrid1.DataSource = dsShow;
- }
- private void Accept()
- {
- if (this.ultraGrid1.Rows.Count == 0)
- return;
- if (this.ultraGrid1.Rows.Count == 1)
- this.ultraGrid1.Rows[0].Selected = true;
- // this.ultraGrid1.ActiveRow.Selected = true;
- ArrayList listBillNo = new ArrayList();
- string billNo = "";
- if (this.ultraGrid1.Selected.Rows.Count == 0)
- {
- Core.StlMes.Client.Sale.Util.MessageUtil.ShowError("请选择需要接收的行");
- return;
- }
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugr in this.ultraGrid1.Selected.Rows)
- {
- billNo = ugr.Cells[_BILL_NO].Value.ToString();
- if (!listBillNo.Contains(billNo))
- {
- listBillNo.Add(billNo);
- }
- }
- string errMsg = "";
- foreach (string s in listBillNo)
- {
- this.ydmZcLoadVehicleMatMgt.AcceptSignle(s,out errMsg);
- if (errMsg.Length > 0)
- {
- return;
- }
- else
- {
- DataRow[] drs = this.dsMain.Tables[0].Select(string.Format(" BILL_NO = '{0}' ",s));
- foreach (DataRow dr in drs)
- {
- this.dsMain.Tables[0].Rows.Remove(dr);
- }
- }
- }
- Core.StlMes.Client.Sale.Util.MessageUtil.ShowTips("操作成功");
- if (this.checkBox1.Checked)
- this.Query();
- else
- this.QueryVirtual();
-
- }
- private string[] GetKeys()
- {
- try
- {
- return base.QueryStrings;
- }
- catch
- {
- return new string[] { };
- }
- }
- private string[] GetGrid1DataStructTg()
- {
- return new string[]
- {
- this._BILL_NO,
- // this._BILL_NO_XH,
- this._ORDER_NO,
- this._ORDER_SEQ,
- this._ORDER_SEQ_NO,
- this._ACT_COUNT,
- this._ACT_WEIGHT,
- _ACT_THEORY_WEIGHT,
- this._STEELNAME,
- this._GRADENAME,
- this._STD_STYLE_DESC,
- this._SPEC_NAME,
- this._MODEL_DESC,
- this._PLINE_NAME,
- this._ACT_DIMATER,
- this._ACT_HEIGHT
- // this._ACT_LEN
-
- };
- }
- private string[] GetGrid1DataStructTgVirtualBillno()
- {
- return new string[]
- {
- this._BILL_NO,
- // this._BILL_NO_XH,
- this._ORDER_NO,
- this._ORDER_SEQ,
- "DELIVERY_NO",
- "PLAN_WT",
- "PLAN_NUM",
- "SPEC_NAME",
- "STATION_NM",
- "SPCL_LN_NM",
- "SALE_ORG_DESC",
- "CUSTOMER_NM",
- "RECEIV_NM",
- "STEELNAME",
- "MEMO"
- };
- }
- private List<string> GetGroupByName()
- {
- List<string> list = new List<string>();
- list.Add(_BILL_NO);
- // list.Add(_BILL_NO_XH);
- list.Add(_ORDER_NO);
- list.Add(_ORDER_SEQ);
- list.Add(_ORDER_SEQ_NO);
-
- return list;
-
- }
- private List<string> GetStaticsName()
- {
- List<string> list = new List<string>();
- list.Add(this._ACT_COUNT);
- list.Add(this._ACT_WEIGHT);
- list.Add(_ACT_THEORY_WEIGHT);
- return list;
- }
- private List<string> GetShowName()
- {
- List<string> list = new List<string>(GetGrid1DataStructTg());
- return list;
- }
- private List<string> GetHideName()
- {
- List<string> list = new List<string>(new string[]{ this._GRADENAME,
- this._STD_STYLE_DESC,
- this._SPEC_NAME,_PLINE_NAME});
- return list;
- }
-
-
- private string[] GetGrid1DataStruct()
- {
- return new string[]
- {
- "ASKPLAN_ID",
- "TRANSTYPE",
- "PICKSTORAGETIME",
- "QUANTITY",
- "WEIGHT",
- "TRAINWAGON",
- "SHIPNO",
- "BUYERCODE",
- "STATIONCODE",
- "INCEPTCORPCODE",
- "ACCEPT_STATUS"
- }
- ;
- }
- private string[] GetGrid2DataStruct()
- {
- return new string[]
- {
- "SERIALNUMBER",
- "ORDERNO",
- "PLY",
- "WIDTH",
- "LENGTH",
- "WEIGHT",
- "STEELCODE",
- "STOVENO",
- }
- ;
- }
- private Hashtable GetColumnAndCaption()
- {
- if (GetKeys().Length > 0)
- {
- if (this.GetKeys()[0] == "0")
- return GetColumnAndCaptionForSlab();
- else
- return GetColumnAndCaptionForTube();
- }
- return GetColumnAndCaptionForTube();
- }
- /// <summary>
- /// 钢管重命名
- /// </summary>
- /// <returns></returns>
- private Hashtable GetColumnAndCaptionForTube()
- {
- Hashtable hs = new Hashtable();
- hs.Add("QUANTITY", "支数");
- hs.Add("WEIGHT", "重量");
- hs.Add("SHIPNO", "船号");
- hs.Add("PLY", "壁厚");
- hs.Add("WIDTH", "外径");
- hs.Add("ACCEPT_STATUS", "接收结果");
- hs.Add("SERIALNUMBER", "序号");
- hs.Add(_BILL_NO, "提单号");
- hs.Add(_BILL_NO_XH, "序号");
- hs.Add(_ORDER_NO, "合同号");
- hs.Add(_ORDER_SEQ, "行号");
- hs.Add(_ORDER_SEQ_NO, "交货行");
- hs.Add(_ACT_COUNT, "支数");
- hs.Add(_ACT_WEIGHT, "重量");
- hs.Add(_ACT_THEORY_WEIGHT, "理论重量");
- hs.Add(_STEELNAME, "钢级(牌号)");
- hs.Add(_GRADENAME, "钢种名称");
- hs.Add(_STD_STYLE_DESC, "标准类别");
- hs.Add(_SPEC_NAME, "产品规格");
- hs.Add(_MODEL_DESC, "扣型");
- hs.Add(_PLINE_NAME, "产线");
- hs.Add(_ACT_DIMATER, "外径");
- hs.Add(_ACT_HEIGHT, "壁厚");
- hs.Add(_ACT_LEN, "长度");
- hs.Add("STATION_NM", "到站");
- hs.Add("SPCL_LN_NM", "专用线");
- hs.Add("SALE_ORG_DESC", "销售组织");
- hs.Add("CUSTOMER_NM", "订货单位");
- hs.Add("RECEIV_NM", "收货单位");
- hs.Add("PLAN_NUM", "支数");
- hs.Add("PLAN_WT", "重量");
- hs.Add("MEMO", "备注");
- hs.Add("DELIVERY_NO", "交货行");
-
- return hs;
- }
- /// <summary>
- /// 其他
- /// </summary>
- /// <returns></returns>
- private Hashtable GetColumnAndCaptionForSlab()
- {
- Hashtable hs = new Hashtable();
- hs.Add("QUANTITY", "支数");
- hs.Add("WEIGHT", "重量");
- hs.Add("SHIPNO", "船号");
- hs.Add("ACCEPT_STATUS", "接收结果");
- hs.Add("SERIALNUMBER", "序号");
- return hs;
- }
- protected override Hashtable GetGridColumnLength()
- {
- Hashtable hs = new Hashtable();
-
- hs.Add("SHIPNO",80);
- hs.Add(_BILL_NO, 120);
- hs.Add(_BILL_NO_XH, 80);
- hs.Add(_ORDER_NO, 100);
- hs.Add(_ORDER_SEQ, 60);
- hs.Add(_ORDER_SEQ_NO, 60);
- hs.Add(_ACT_COUNT, 60);
- hs.Add(_ACT_WEIGHT, 60);
- hs.Add(_ACT_THEORY_WEIGHT, 60);
- hs.Add(_STEELNAME, 80);
- hs.Add(_GRADENAME, 80);
- hs.Add(_STD_STYLE_DESC, 120);
- hs.Add(_SPEC_NAME,120);
- hs.Add(_MODEL_DESC, 80);
- hs.Add(_PLINE_NAME, 80);
- hs.Add(_ACT_DIMATER, 60);
- hs.Add(_ACT_HEIGHT, 60);
- hs.Add(_ACT_LEN, 60);
- return hs;
- }
- private string _LOADVEHICLE_SQE = "LOADVEHICLE_SQE";
- private string _LOADVEHICLE_NO = "LOADVEHICLE_NO";
- private string _BILL_NO = "BILL_NO";
- private string _BILL_NO_XH = "BILL_NO_XH";
- private string _TALLYSHEET_NO = "TALLYSHEET_NO";
- private string _VEHICLE_NO = "VEHICLE_NO";
- private string _ORDER_NO = "ORDER_NO";
- private string _ORDER_SEQ = "ORDER_SEQ";
- private string _ORDER_SEQ_NO = "ORDER_SEQ_NO";
- private string _PRO_ORDER_NO = "PRO_ORDER_NO";
- private string _MAT_NO = "MAT_NO";
- private string _LOT_NO = "LOT_NO";
- private string _JUDGE_STOVE_NO = "JUDGE_STOVE_NO";
- private string _BATCH_NO = "BATCH_NO";
- private string _GROUP_NO = "GROUP_NO";
- private string _STOVE_NO = "STOVE_NO";
- private string _MATERIAL_NO = "MATERIAL_NO";
- private string _MATERIAL_NAME = "MATERIAL_NAME";
- private string _PRODUCCODE = "PRODUCCODE";
- private string _PRODUCNAME = "PRODUCNAME";
- private string _STD_CODE = "STD_CODE";
- private string _STD_NAME = "STD_NAME";
- private string _GRADECODE = "GRADECODE";
- private string _GRADENAME = "GRADENAME";
- private string _STEELCODE = "STEELCODE";
- private string _STEELNAME = "STEELNAME";
- private string _STD_STYLE = "STD_STYLE";
- private string _STD_STYLE_DESC = "STD_STYLE_DESC";
- private string _SPEC_CODE = "SPEC_CODE";
- private string _SPEC_NAME = "SPEC_NAME";
- private string _MODEL_CODE = "MODEL_CODE";
- private string _MODEL_DESC = "MODEL_DESC";
- private string _PROCESS_CDOE = "PROCESS_CDOE";
- private string _PROCESS_DESC = "PROCESS_DESC";
- private string _PLINE_CODE = "PLINE_CODE";
- private string _PLINE_NAME = "PLINE_NAME";
- private string _ACT_DIMATER = "ACT_DIMATER";
- private string _ACT_HEIGHT = "ACT_HEIGHT";
- private string _ACT_LEN = "ACT_LEN";
- private string _ACT_LEN_MIN = "ACT_LEN_MIN";
- private string _ACT_LEN_MAX = "ACT_LEN_MAX";
- private string _ACT_COUNT = "ACT_COUNT";
- private string _ACT_WEIGHT = "ACT_WEIGHT";
- private string _ACT_THEORY_WEIGHT = "ACT_THEORY_WEIGHT";
- private string _JUDGE_RESULT_CODE = "JUDGE_RESULT_CODE";
- private string _PRO_BC = "PRO_BC";
- private string _PRO_BZ = "PRO_BZ";
- private string _RPO_TIME = "RPO_TIME";
- private string _SEN_BC = "SEN_BC";
- private string _SEN_BZ = "SEN_BZ";
- private string _SEN_TIME = "SEN_TIME";
- private string _ZBS_BH = "ZBS_BH";
- private string _SALE_ORG = "SALE_ORG";
- private string _SALE_ORG_DESC = "SALE_ORG_DESC";
- private string _SALE_AREA = "SALE_AREA";
- private string _STORAGE_TYPE_NO = "STORAGE_TYPE_NO";
- private string _STORAGE_TYPE_NAME = "STORAGE_TYPE_NAME";
- private string _MANAGEMENT_NO = "MANAGEMENT_NO";
- private string _MANAGEMENT_NAME = "MANAGEMENT_NAME";
- private string _UPLOAD_WEB_FLAG = "UPLOAD_WEB_FLAG";
- private string _STORAGE_NO = "STORAGE_NO";
- private string _LOCATION_NO = "LOCATION_NO";
- private string _LARY_NO = "LARY_NO";
- private string _LOC_NO = "LOC_NO";
- private string _TRANS_TPE = "TRANS_TPE";
- private string _RECEIV_NO = "RECEIV_NO";
- private string _RECEIV_NM = "RECEIV_NM";
- private string _STATION_NO = "STATION_NO";
- private string _STATION_NM = "STATION_NM";
- private string _SPCL_LN_NO = "SPCL_LN_NO";
- private string _SPCL_LN_NM = "SPCL_LN_NM";
- private string _PORT = "PORT";
- private string _PLANT = "PLANT";
- private string _PLANT_DESC = "PLANT_DESC";
- private string _VSTEL = "VSTEL";
- private string _VSTEL_DESC = "VSTEL_DESC";
- private string _CARRY_COMPANY_CODE = "CARRY_COMPANY_CODE";
- private string _CARRY_COMPANY_NAME = "CARRY_COMPANY_NAME";
- private string _OUT_STOCK_CODE = "OUT_STOCK_CODE";
- private string _DELIVY_PLACE_CODE = "DELIVY_PLACE_CODE";
- private string _DELIVY_PLACE_NAME = "DELIVY_PLACE_NAME";
- private string _STLMT_UNIT_NO = "STLMT_UNIT_NO";
- private string _STLMT_UNIT_NM = "STLMT_UNIT_NM";
- private string _DELIVY_TIME = "DELIVY_TIME";
- private string _MEMO = "MEMO";
- private string _VALIDFLAG = "VALIDFLAG";
- private string _CREATE_NAME = "CREATE_NAME";
- private string _CREATE_TIME = "CREATE_TIME";
- private string _UPDATE_NAME = "UPDATE_NAME";
- private string _UPDATE_TIME = "UPDATE_TIME";
- private string _DELETE_NAME = "DELETE_NAME";
- private string _DELETE_TIME = "DELETE_TIME";
-
- }
- }
|