| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 |
- 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 Pur.Entity;
- using Core.Mes.Client.Comm.Control;
- using Pur.Entity.ck;
- using Infragistics.Win.UltraWinGrid;
- using System.Collections;
- using Core.Mes.Client.Comm.Tool;
- using com.hnshituo.pur.vo;
- namespace Pur.ck
- {
- public partial class PurExcDeliveryManag : FrmPmsBase
- {
- public PurExcDeliveryManag()
- {
- InitializeComponent();
- }
- /// <summary>
- /// 菜单栏
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- Get_ExcDeliveryNoticeM();
- break;
- case "Update":
- Upd_ExcDeliveryNoticeM();
- break;
- case "Delete":
- Del_ExcDeliveryNoticeM();
- break;
- case "Add":
- Add_ExcDeliveryNoticeM();
- break;
- case "Return":
- Ret_ExcDeliveryNoticeM();
- break;
- case "Confirm":
- Con_ExcDeliveryNoticeM();
- break;
- case "Receiving":
- Rec_ExcDeliveryNoticeM();
- break;
- }
- }
- /// <summary>
- /// 生成收货单
- /// </summary>
- private void Rec_ExcDeliveryNoticeM()
- {
- throw new NotImplementedException();
- }
- /// <summary>
- /// 到货确认
- /// </summary>
- private void Con_ExcDeliveryNoticeM()
- {
- throw new NotImplementedException();
- }
- /// <summary>
- /// 退货
- /// </summary>
- private void Ret_ExcDeliveryNoticeM()
- {
- UltraGridRow uge = ultraGrid1.ActiveRow;
-
- PurExcDe_Return Ret = new PurExcDe_Return(this.ob,uge);
- Ret.ShowDialog();
- }
- /// <summary>
- /// 生成送货子单
- /// </summary>
- private void Add_ExcDeliveryNoticeM()
- {
- UltraGridRow uge = ultraGrid1.ActiveRow;
- string str = uge.Cells["DeliveryId"].Value.ToString();
- string str2 = uge.Cells["orderId"].Value.ToString();
- PurExcDeliveryOk PwdOK = new PurExcDeliveryOk(this.ob, uge);
- PwdOK.ShowDialog();
- Get_ExcDeliveryNoticeM();
- }
- /// <summary>
- /// 删除
- /// </summary>
- private void Del_ExcDeliveryNoticeM()
- {
- try
- {
- if (SQ == "0")
- {
- UltraGridRow uge = ultraGrid1.ActiveRow;
- ExcDeliveryM EdnM = new ExcDeliveryM();
- EdnM.DeliveryId = uge.Cells["DeliveryId"].Value.ToString();
- EdnM.Validflag = "0";
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.ck.service.ExcDeliveryMService", "doUpdate", new object[] { EdnM });
- if (crt.Resultcode != 0)
- {
- MessageUtil.ShowTips("送货单 " + EdnM.DeliveryId + " 删除失败");
- return;
- }
- MessageUtil.ShowTips("送货单 " + EdnM.DeliveryId + " 删除成功!");
- Get_ExcDeliveryNoticeM();
- }
- if (SQ == "1")
- {
- UltraGridRow uge = ultraGrid2.ActiveRow;
- ExcDeliveryC EdnC = new ExcDeliveryC();
- EdnC.DeliveryLineSqe = uge.Cells["DeliveryLineSqe"].Value.ToString();
- EdnC.Validflag = "0";
- EdnC.Qty = 0;
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.ck.service.ExcDeliveryCService", "doUpdate", new object[] { EdnC });
- if (crt.Resultcode != 0)
- {
- MessageUtil.ShowTips("送货单行 " + EdnC.DeliveryLineSqe + " 删除失败");
- return;
- }
- MessageUtil.ShowTips("送货单行 " + EdnC.DeliveryLineSqe + " 删除成功!");
- ExcDeliveryC EdnCC = new ExcDeliveryC();
- EdnCC.DeliveryId = uge.Cells["DeliveryId"].Value.ToString();
- EdnCC.Validflag = "1";
- DataTable dt = this.execute<DataTable>("com.hnshituo.pur.ck.service.ExcDeliveryCService", "find_ExcDC", new object[] { EdnCC, 0, 0 });
- GridHelper.CopyDataToDatatable(dt, dataTable2, true);
- }
- }
- catch (Exception e)
- {
- MessageUtil.ShowTips("送货单行 删除失败" + e);
- return;
- }
- }
- /// <summary>
- /// 修改
- /// </summary>
- private void Upd_ExcDeliveryNoticeM()
- {
- UltraGridRow uge = ultraGrid2.ActiveRow;
- ExcDeliveryC EdnC = new ExcDeliveryC();
- if (uge == null)
- {
- MessageUtil.ShowTips("请选择送货单行!");
- return;
- }
- try
- {
- if (string.IsNullOrEmpty(ultraTextEditor6.Text))
- {
- MessageUtil.ShowTips("已发货数量不能为空!");
- return;
- }
-
-
- EdnC.DeliveryLineSqe = uge.Cells["DeliveryLineSqe"].Value.ToString();
- EdnC.CreatedQty = Convert.ToDouble(ultraTextEditor6.Value);
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.ck.service.ExcDeliveryCService", "doUpdate", new object[] { EdnC });
- if (crt.Resultcode != 0)
- {
- MessageUtil.ShowTips("送货单行 " + EdnC.DeliveryLineSqe + " 修改失败");
- return;
- }
- MessageUtil.ShowTips("送货单行 " + EdnC.DeliveryLineSqe + " 修改成功!");
- }
- catch (Exception e)
- {
- MessageUtil.ShowTips("送货单行 " + EdnC.DeliveryLineSqe + " 修改失败"+e);
- return;
- }
- ExcDeliveryC EdnCC = new ExcDeliveryC();
- EdnCC.DeliveryId = uge.Cells["DeliveryId"].Value.ToString();
-
- EdnCC.Validflag = "1";
- DataTable dt = this.execute<DataTable>("com.hnshituo.pur.ck.service.ExcDeliveryCService", "find_ExcDC", new object[] { EdnCC, 0, 0 });
- GridHelper.CopyDataToDatatable(dt, dataTable2, true);
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void Get_ExcDeliveryNoticeM()
- {
- dataTable2.Clear();
- ExcDeliveryM EdnM = new ExcDeliveryM();
- EdnM.OrderId = txt_OrderId.Text;
- EdnM.NoticeId = txt_NoticeId.Text;
- EdnM.CreateTime = Convert.ToDateTime(txt_CreateTimeS.Text);
- EdnM.DeleteTime = Convert.ToDateTime(txt_CreateTimeE.Value);
- DataTable dt = this.execute<DataTable>("com.hnshituo.pur.ck.service.ExcDeliveryMService", "find_ExcDM ", new object[] { EdnM });
- GridHelper.CopyDataToDatatable(dt,dataTable1,true);
- }
- string SQ = "";
- private void ultraGrid1_ClickCell(object sender, ClickCellEventArgs e)
- {
- SQ = "0";
- UltraGridRow uge = ultraGrid1.ActiveRow;
- ExcDeliveryC EdnC = new ExcDeliveryC();
- EdnC.DeliveryId = uge.Cells["DeliveryId"].Value.ToString();
- EdnC.Validflag = "1";
- DataTable dt = this.execute<DataTable>("com.hnshituo.pur.ck.service.ExcDeliveryCService", "find_ExcDC", new object[] { EdnC, 0, 0 });
- GridHelper.CopyDataToDatatable(dt, dataTable2, true);
- }
- private void ultraGrid2_ClickCell(object sender, ClickCellEventArgs e)
- {
- SQ = "1";
- UltraGridRow uge = ultraGrid2.ActiveRow;
- ultraTextEditor4.Text = uge.Cells["ITEMNAME"].Value.ToString();
- ultraTextEditor5.Text = uge.Cells["QTY"].Value.ToString();
- ultraTextEditor6.Text = uge.Cells["CREATEDQTY"].Value.ToString();
- }
- private void PurExcDeliveryManag_Load(object sender, EventArgs e)
- {
- txt_CreateTimeS.Value = DateTime.Now.AddMonths(-1);
- txt_CreateTimeE.Value = Convert.ToDateTime(DateTime.Now.ToShortDateString()).AddHours(23).AddMinutes(59);
- Get_ExcDeliveryNoticeM();
- }
- }
- }
|