| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650 |
- 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;
- using Infragistics.Win.UltraWinGrid;
- using Core.Mes.Client.Comm.Tool;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Control;
- using Core.StlMes.Client.YdmPipeManage.Tool;
- using Core.StlMes.Client.YdmPipeManage.Entity;
- using Infragistics.Win;
- namespace Core.StlMes.Client.YdmPipeManage
- {
- public partial class FrmPipeBillOfLadingClose : FrmBase
- {
- /// <summary>
- /// 登入用户的销售组织权限
- /// </summary>
- private string[] _salgPermissions;
- public FrmPipeBillOfLadingClose()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
- private void FrmPipeBillOfLadingClose_Load(object sender, EventArgs e)
- {
- InitDate();
- _salgPermissions = BaseMethod.InitPermissions(this.ValidDataPurviewIds, ob);
- EntityHelper.ShowGridCaption<YdmZcBillMyEntity>(ultraGridOrder.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<YdmZcBillCyEntity>(ultraGridJustNo.DisplayLayout.Bands[0]);
- BaseMethod.setOtherColumnReadOnly(ultraGridBillNo, new string[] { "Chc" });
- BaseMethod.setOtherColumnReadOnly(ultraGridOrder, new string[] { "Chc" });
- BaseMethod.setOtherColumnReadOnly(ultraGridJustNo, new string[] { "Chc", "SendNum" });
- BaseMethod.InitCellPosition(ultraGridOrder, new string[] {"PlanWt", "PlanNum", "ActWt", "ActNum", "DelvryQty", "WgtEstmt" });
- BaseMethod.InitCellPosition(ultraGridJustNo, new string[] { "ActLenMin", "ActLenMax", "ActCount", "ActWeight", "ActCountLoad", "ActWeightLoad", "ActCountKc", "ActWeightKc", "SendNum" });
- EntityHelper.setColumnShowOrHidden(this.ultraGridOrder, new string[] { "PrtFlag", "SaleAreaDesc", "CreateName" }, false);
- }
- private void ChcCheckedChanged(object sender, EventArgs e)
- {
- if (ChcLadingSeq.Checked)
- {
- TxtLadingSeq.Enabled = true;
- }
- else
- {
- TxtLadingSeq.Enabled = false;
- }
- if (ChcLadingStatus.Checked)
- {
- ComLadingStatus.Enabled = true;
- }
- else
- {
- ComLadingStatus.Enabled = false;
- }
- if (ChcOrderNo.Checked)
- {
- TxtOrderNo.Enabled = true;
- }
- else
- {
- TxtOrderNo.Enabled = false;
- }
- if (ChcTime.Checked)
- {
- TimeBegin.Enabled = true;
- TimeEnd.Enabled = true;
- }
- else
- {
- TimeEnd.Enabled = false;
- TimeBegin.Enabled = false;
- }
- }
- /// <summary>
- /// 初始时间
- /// </summary>
- private void InitDate()
- {
- DateTime now = DateTime.Now;
- DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
- DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
- TimeBegin.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd")+" 00:00:00");
- TimeEnd.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd")+" 23:59:59");
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- DoQuery();
- break;
- case "BillClose":
- BillClose();
- break;
- case "UpdateClose":
- UpdateClose();
- break;
- case "BillCut":
- BillCut();
- break;
- case"Print":
- printData();
- break;
- case "Print2":
- printData2();
- break;
- case "Export":
- GridHelper.ulGridToExcel(ultraGridJustNo, "提单炉信息");
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 单据打印(非套打)
- /// </summary>
- private void printData2()
- {
- string TallyNo = "";
- UltraGridRow ugr = this.ultraGridBillNo.ActiveRow;
- if (ugr == null) { MessageUtil.ShowTips("无数据,请确认!"); return; }
- TallyNo = ugr.Cells["BILL_NO"].Text.Trim();
- string LOADVEHICLE_TYPE = ugr.Cells["LOADVEHICLE_TYPE"].Text.Trim();
- string SALE_ORG = ugr.Cells["SALE_ORG"].Text.Trim();
- string strurl = "";
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose.getBillStatus", new Object[] { TallyNo }, this.ob);
- if (dt.Rows.Count > 0)
- {
- if (dt.Rows[0]["LOADVEHICLE_TYPE"].ToString().Equals("1"))
- {
- if (int.Parse(dt.Rows[0]["BILL_STATUS"].ToString()) < 4)
- {
- MessageUtil.ShowTips("提单不是关闭的不能打印!");
- return;
- }
- }
- else
- {
- if (dt.Rows[0]["ISPRECLOSE"].ToString().Equals("0"))
- {
- MessageUtil.ShowTips("虚单未第一次关闭!");
- return;
- }
- }
- }
- if (this.CustomInfo == "120504")
- {
- if (LOADVEHICLE_TYPE.Equals("实际"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderTH.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
- }
- else
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderXDTH.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
- }
- }
- else
- {
- //if (_salgPermissions.Length == 1)
- //{
- if (SALE_ORG.Equals("100102"))
- {
- if (LOADVEHICLE_TYPE.Equals("实际"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderGouMao.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();//实单
- }
- else
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderXDGouMao.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();//虚单
- }
- }
- else
- {
- if (LOADVEHICLE_TYPE.Equals("实际"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorder2.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
- }
- else
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderXD2.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
- }
- }
-
- }
- string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- ServerHelper.SetData("com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose.updatePintFlag", new object[] { time, TallyNo }, ob);
- BillDocPrintExcel fBug = new BillDocPrintExcel(ob, strurl);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.Text = "出库单打印";
- fBug.ShowDialog();
- fBug.StartPosition = FormStartPosition.CenterScreen;
- DoQuery();
- }
- private void printData()
- {
- string TallyNo = "";
- UltraGridRow ugr = this.ultraGridBillNo.ActiveRow;
- if (ugr == null) { MessageUtil.ShowTips("无数据,请确认!"); return; }
- TallyNo = ugr.Cells["BILL_NO"].Text.Trim();
- string LOADVEHICLE_TYPE = ugr.Cells["LOADVEHICLE_TYPE"].Text.Trim();
- string SALE_ORG = ugr.Cells["SALE_ORG"].Text.Trim();
- string strurl = "";
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose.getBillStatus", new Object[] { TallyNo }, this.ob);
- if (dt.Rows.Count > 0)
- {
- if (dt.Rows[0]["LOADVEHICLE_TYPE"].ToString().Equals("1"))
- {
- if (int.Parse(dt.Rows[0]["BILL_STATUS"].ToString()) < 4)
- {
- MessageUtil.ShowTips("提单不是关闭的不能打印!");
- return;
- }
- }
- else
- {
- if (dt.Rows[0]["ISPRECLOSE"].ToString().Equals("0"))
- {
- MessageUtil.ShowTips("虚单未第一次关闭!");
- return;
- }
- }
- }
- if (this.CustomInfo == "120504")
- {
- if (LOADVEHICLE_TYPE.Equals("实际"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderTH.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
- }
- else
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderXDTH.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
- }
- }
- else
- {
- //if (_salgPermissions.Length == 1)
- //{
- if (SALE_ORG.Equals("100102"))
- {
- if (LOADVEHICLE_TYPE.Equals("实际"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderGouMao.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();//实单
- }
- else
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderXDGouMao.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();//虚单
- }
- }
- else
- {
- if (LOADVEHICLE_TYPE.Equals("实际"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorder.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
- }
- else
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderXD.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
- }
- }
- //}
- //else
- //{
- // if (LOADVEHICLE_TYPE.Equals("实际"))
- // {
- // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorder.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
- // }
- // else
- // {
- // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepYdmOutboundorderXD.cpt" + "&P_BILL_NO=" + TallyNo + "&USERID=" + this.UserInfo.GetUserID();
- // }
- //}
- }
- string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- ServerHelper.SetData("com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose.updatePintFlag", new object[] { time, TallyNo }, ob);
- BillDocPrintExcel fBug = new BillDocPrintExcel(ob, strurl);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.Text = "出库单打印";
- fBug.ShowDialog();
- fBug.StartPosition = FormStartPosition.CenterScreen;
- DoQuery();
- }
- private void DoQuery()
- {
- ArrayList param = new ArrayList();
- string billNo = "";
- if (ChcLadingSeq.Checked)
- {
- billNo = TxtLadingSeq.Text.Trim();
- }
- string orderNo = "";
- if (ChcOrderNo.Checked)
- {
- orderNo = TxtOrderNo.Text.Trim();
- }
- string billStatus = "";
- if (ChcLadingStatus.Checked)
- {
- billStatus = ComLadingStatus.Value.ToString();
- }
- string strBegin = "1900-01-01 00:00:00";
- string strEnd = "9900-01-01 00:00:00";
- if (ChcTime.Checked)
- {
- if (TimeBegin.Value == null || TimeEnd.Value == null)
- {
- MessageUtil.ShowWarning("请选择正确的创建时间");
- return;
- }
- strBegin = TimeBegin.Value.ToString();
- strEnd = TimeEnd.Value.ToString();
- }
-
- //string[] arr = BaseMethod.InitPermissions(this.ValidDataPurviewIds,this.ob);
- string[] arr = this.ValidDataPurviewIds;
- param.Add(billNo);
- param.Add(orderNo);
- param.Add(billStatus);
- param.Add(strBegin);
- param.Add(strEnd);
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose.getBiltNo", new Object[] { param, arr, this.CustomInfo}, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
- if (dt == null || dt.Rows.Count == 0)
- {
- QueryOrder("");
- QueryJustStoveInfo("");
- }
- BaseMethod.SetUltraGridRowColor(ultraGridBillNo, new string[] { "LOADVEHICLE_TYPE" }, new string[] { "虚拟" }, Color.GreenYellow);
- }
- private void ultraGridBillNo_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow ugr = ultraGridBillNo.ActiveRow;
- if (ugr == null)
- {
- return;
- }
- QueryOrder(ugr.GetCellValue("BILL_NO").ToString());
- QueryJustStoveInfo(ugr.GetCellValue("BILL_NO").ToString());
- }
- private void QueryOrder(string billNo)
- {
- List<YdmZcBillMyEntity> listSource = EntityHelper.GetData<YdmZcBillMyEntity>(
- "com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose.getOrderInfoByBiltNo", new object[] { billNo }, this.ob);
- ydmZcBillMyEntityBindingSource.DataSource = listSource;
- }
- private void QueryJustStoveInfo(string billNo)
- {
- ultraGridJustNo.UpdateData();
- List<YdmZcBillCyEntity> listSource = EntityHelper.GetData<YdmZcBillCyEntity>(
- "com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose.getJustStoveNoInfoByBiltNo", new object[] { billNo }, this.ob);
- ydmZcBillCyEntityBindingSource.DataSource = listSource;
- foreach (UltraGridRow row in ultraGridJustNo.Rows)
- {
- //理货在途量
- row.Cells["ActCountKc"].Value = (double.Parse(row.Cells["ActTallCount"].Value.ToString()) - double.Parse(row.Cells["ActCountLoad"].Value.ToString())).ToString();
- if (double.Parse(row.Cells["ActCountKc"].Value.ToString()) != 0.0)
- {
- row.Cells["ActWeightKc"].Value = (double.Parse(row.Cells["ActTallWt"].Value.ToString()) - double.Parse(row.Cells["ActWeightLoad"].Value.ToString())).ToString("f3");
- }
- else
- {
- row.Cells["ActWeightKc"].Value = "0.000";
- }
- //提单在途量
- row.Cells["ActCountZy"].Value = (double.Parse(row.Cells["ActCount"].Value.ToString()) - double.Parse(row.Cells["ActCountLoad"].Value.ToString())).ToString();
- if (double.Parse(row.Cells["ActCountZY"].Value.ToString()) != 0.0)
- {
- row.Cells["ActWeightZy"].Value = (double.Parse(row.Cells["ActWeight"].Value.ToString()) - double.Parse(row.Cells["ActWeightLoad"].Value.ToString())).ToString("f3");
- }
- else
- {
- row.Cells["ActWeightZY"].Value = "0.000";
- }
- if (row.Cells["orderUnit"].Text.Equals("吨"))
- {
- //row.Cells["SendNum"].Value = row.Cells["ActWeightLoad"].Value.ToString();
- row.Cells["SendNum"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
- }
- else if (row.Cells["OrderUnit"].Text.Equals("支") || row.Cells["OrderUnit"].Text.Equals("个"))
- {
- //row.Cells["SendNum"].Value = row.Cells["ActCountLoad"].Value.ToString();
- row.Cells["SendNum"].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
- }
- else
- {
- row.Cells["SendNum"].Appearance.BackColor = Color.FromArgb(255, 255, 128);
- row.Cells["SendNum"].Appearance.BackHatchStyle = BackHatchStyle.None;
- row.Cells["SendNum"].Activation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit;
- }
- }
- }
- private void ultraGridOrder_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow ugr = ultraGridOrder.ActiveRow;
- if (ugr == null)
- {
- return;
- }
- foreach (UltraGridRow ugrJ in ultraGridJustNo.Rows)
- {
- if (ugrJ.Cells["OrdLnDlyPk"].Text.Equals(ugr.Cells["OrdLnDlyPk"].Text))
- {
- ugrJ.Appearance.BackColor = Color.Wheat;
- }
- else
- {
- ugrJ.Appearance.BackColor = Color.White;
- }
- }
- }
- /// <summary>
- /// 提单关闭
- /// </summary>
- private void BillClose()
- {
- ultraGridJustNo.UpdateData();
- UltraGridRow ugr = ultraGridBillNo.ActiveRow;
- ArrayList list1 = new ArrayList();
- ArrayList pram1 = new ArrayList();
- if (ugr == null)
- {
- MessageUtil.ShowWarning("请选择提单号!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否提单关闭?") == DialogResult.No)
- {
- return;
- }
- string billNo = ugr.Cells["BILL_NO"].Value.ToString();
- string sendNo = ugr.Cells["SEND_PLAN_NO"].Value.ToString();
- string prcls = ugr.Cells["PRD_CLS"].Value.ToString();
- string name = this.UserInfo.GetUserName();
- string sendNumber = "";
- string loadvehicleType = ugr.Cells["LOADVEHICLE_TYPE"].Value.ToString();
- //炉号信息
- foreach (UltraGridRow row in ultraGridJustNo.Rows)
- {
- ArrayList list = new ArrayList();
- if (row.Cells["ActCountLoad"].Text.Trim() != "0")
- {
- if (row.Cells["SendNum"].Text.Trim() == "0.000")
- {
- MessageUtil.ShowTips("请填写提单炉信息里面的实发数!");
- return;
- //sendNumber = "0";
- }
- else
- {
- sendNumber = row.Cells["SendNum"].Value.ToString();
- }
- }
- else { sendNumber = "0"; }
-
-
- list.Add(sendNumber);
- list.Add(row.Cells["ActCountLoad"].Value.ToString());
- list.Add(row.Cells["JudgeStoveNo"].Value.ToString());
- list.Add(row.Cells["BatchNo"].Value.ToString());
- list.Add(row.Cells["GroupNo"].Value.ToString());
- list.Add(row.Cells["OrdLnDlyPk"].Value.ToString());
- list.Add(row.Cells["OrderUnit"].Value.ToString());
- list.Add(row.Cells["PrtFlag"].Value.ToString());
- list.Add(row.Cells["StdCode"].Value.ToString2());
- list1.Add(list);
- }
- ///合同信息
- foreach (UltraGridRow row in ultraGridOrder.Rows)
- {
- ArrayList pram = new ArrayList();
- pram.Add(row.Cells["BillNoSeq"].Value.ToString());
- pram.Add(row.Cells["OrdLnDlyPk"].Value.ToString());
- pram1.Add(pram);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose";
- ccp.MethodName = "BillClose";
- ccp.ServerParams = new object[] { billNo, sendNo, name, list1, pram1, prcls, loadvehicleType };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("提单关闭成功!"))
- {
- if (!_salgPermissions[0].Equals("100102"))
- {
- printData();
- }
- DoQuery();
- BaseMethod.UltraGridLocation(ultraGridBillNo, new string[] { "BILL_NO" }, new string[] { billNo });
- }
- }
- }
- /// <summary>
- /// 提单划断
- /// </summary>
- private void BillCut()
- {
- UltraGridRow ugr = ultraGridBillNo.ActiveRow;
- if (ugr == null)
- {
- MessageUtil.ShowWarning("请选择提单号!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否提单划断?") == DialogResult.No)
- {
- return;
- }
- string billNo = ugr.Cells["BILL_NO"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose";
- ccp.MethodName = "BillCut";
- ccp.ServerParams = new object[] { billNo };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("提单划断成功!"))
- {
- DoQuery();
- BaseMethod.UltraGridLocation(ultraGridBillNo, new string[] { "BILL_NO" }, new string[] { billNo });
- }
- }
- }
- /// <summary>
- /// 按回车键触发查询按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ContPublic_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- DoQuery();
- }
- }
- /// <summary>
- /// 填写时触发
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGridJustNo_CellChange(object sender, CellEventArgs e)
- {
- if (e.Cell.Column.Key.Equals("SendNum"))
- {
- if (e.Cell.Row.Cells["SendNum"].Value == null)
- {
- e.Cell.Row.Cells["SendNum"].Value = "0";
- }
- else
- {
- ultraGridJustNo.UpdateData();
- string actCount = e.Cell.Row.Cells["SendNum"].Value.ToString();
- if (!StringUtil.IsFloat(actCount) || actCount == "0")//actCount == "" || int.Parse(actCount)==0
- {
- e.Cell.Row.Cells["SendNum"].Value = "0";
- }
- else
- {
- e.Cell.Row.Cells["SendNum"].Value = e.Cell.Row.Cells["SendNum"].Value.ToString();
- }
- }
- //DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose.queryOrderUnit", new Object[] { e.Cell.Row.Cells["OrdLnDlyPk"].Text.Trim() }, this.ob);
- //if (dt.Rows.Count > 0)
- //{
- // if (dt.Rows[0]["ORDER_UNIT"].ToString().Equals("吨") || dt.Rows[0]["ORDER_UNIT"].ToString().Equals("支"))
- // {
- // MessageUtil.ShowTips("该炉对应合同信息交货行计量单位为:"+dt.Rows[0]["ORDER_UNIT"].ToString()+"不能填!");
- // e.Cell.Row.Cells["SendNum"].Value = "0";
- // return;
- // }
- //}
- }
- }
- /// <summary>
- /// 撤销关闭提单
- /// </summary>
- private void UpdateClose()
- {
- ultraGridBillNo.UpdateData();
- UltraGridRow ugr = ultraGridBillNo.ActiveRow;
- if (ugr == null) return;
- if (MessageUtil.ShowYesNoAndQuestion("是否撤销关闭提单?") == DialogResult.No) return;
- string billNo = ugr.Cells["BILL_NO"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.ydm.pipemanage.CorePipeBillOfLadingClose";
- ccp.MethodName = "updateBill";
- ccp.ServerParams = new object[] { billNo};
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("撤销关闭提单成功!"))
- {
- DoQuery();
- BaseMethod.UltraGridLocation(ultraGridBillNo, new string[] { "BILL_NO" }, new string[] { billNo });
- }
- }
- }
- }
- }
|