| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- 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 com.hnshituo.pur.vo;
- using Core.Mes.Client.Comm.Tool;
- using CoreFS.CA06;
- using Pur.Entity;
- using Pur.Entity.ck;
- using Pur.PublicTools;
- namespace Pur.Pop_upWindow
- {
- public partial class frmPopDeliverySubSplit : FrmPmsBase
- {
- public frmPopDeliverySubSplit()
- {
- InitializeComponent();
- }
- String deliverySubLineSqe = "";
- ExcDeliverySubC dsc = new ExcDeliverySubC();
- public String tips = "0";
- public frmPopDeliverySubSplit(OpeBase Mob,String strDeliverySubLineSqe)
- {
- InitializeComponent();
- this.ob = Mob;
- this.deliverySubLineSqe = strDeliverySubLineSqe;
- this.Text = "送货单行【" + strDeliverySubLineSqe + "】拆分";
- }
- private void frmPopDeliverySubSplit_Load(object sender, EventArgs e)
- {
- if (String.IsNullOrEmpty(deliverySubLineSqe))
- {
- MessageUtil.ShowTips("未获取到待拆分的送货单行号");
- tips = "0";
- this.Close();
- return;
- }
- dsc = this.execute<ExcDeliverySubC>("com.hnshituo.pur.ck.service.ExcDeliverySubCService", "findById", new object[] { deliverySubLineSqe });
- if (dsc == null)
- {
- MessageUtil.ShowTips("未发现送货单行:" + deliverySubLineSqe + "信息记录,可能已被删除,或请刷新界面重试");
- tips = "0";
- this.Close();
- return;
- }
- if (dsc.Validflag != "1")
- {
- MessageUtil.ShowTips("送货单行:" + deliverySubLineSqe + "信息记录可能已被删除,或请刷新界面重试");
- tips = "0";
- this.Close();
- return;
- }
- if (!String.IsNullOrEmpty(dsc.CheckNo))
- {
- MessageUtil.ShowTips("送货单行:" + deliverySubLineSqe + "已生成检化验委托,无法拆分!");
- tips = "0";
- this.Close();
- return;
- }
- txt_canSplit.Text = dsc.Qty+"";
- }
- private void btn_doSplit_Click(object sender, EventArgs e)
- {
- String strNumCol = txt_split.Text.ToString().Trim();
- String[] sss = strNumCol.Split(';');
- double QtyUse = 0;
- ArrayList list = new ArrayList();
- foreach (string str in sss)
- {
- if (!StringUtil.IsDouble(str))
- {
- MessageUtil.ShowTips("输入拆分量不正确,请按照要求输入");
- return;
- }
- ExcDeliverySubC subc = new ExcDeliverySubC();
- subc.Qty = Math.Round(double.Parse(str),3);
- QtyUse = QtyUse + (double)subc.Qty;
- list.Add(subc);
- }
- if (list.Count <= 0)
- {
- MessageUtil.ShowTips("未编制有效数量");
- return;
- }
- if (dsc.Qty < QtyUse)
- {
- MessageUtil.ShowTips("总编制量不能大于" + dsc.Qty);
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("确定拆分送货单行") == DialogResult.No)
- {
- return;
- }
- ExcDeliverySubC subcNew = new ExcDeliverySubC();
- subcNew.DeliverySubLineSqe = deliverySubLineSqe;
- subcNew.CreateUserid = UserInfo.GetUserID();
- subcNew.CreateTime = DateTime.Now;
- subcNew.CreateName = UserInfo.GetUserName();
- subcNew.Remark = txt_remark.Text.ToString().Trim();
- CoreResult rt = this.execute<CoreResult>("com.hnshituo.pur.ck.service.ExcDeliverySubCService", "doSplit", new object[] { list, subcNew});
- if (rt.Resultcode != 0)
- {
- MessageUtil.ShowTips("操作失败:" + rt.Resultmsg);
- this.tips = "0";
- return;
- }
- else
- {
- MessageUtil.ShowTips("操作成功");
- this.tips = "1";
- this.Close();
- return;
- }
-
- }
- }
- }
|