Beispiel #1
0
        public override Model.Procurement.CBPmGoodsDelivery GetCBPmGoodsDeliveryByPSysNo(int pSysNo)
        {
            CBPmGoodsDelivery mod = new CBPmGoodsDelivery();

            mod.ListItems = GetCBPmGoodsDeliveryItemByPSysNo(pSysNo);
            Dictionary <int, CBPmGoodsDeliveryItem> dic_Items = new Dictionary <int, CBPmGoodsDeliveryItem>();

            foreach (var item in mod.ListItems)
            {
                if (dic_Items.ContainsKey(item.gdi_GoodSysNo))
                {
                    dic_Items[item.gdi_GoodSysNo].gdi_SendQuity += item.gdi_SendQuity;
                }
                else
                {
                    dic_Items.Add(item.gdi_GoodSysNo, item);
                }
            }
            mod.ListItems.Clear();
            foreach (int key in dic_Items.Keys)
            {
                if (dic_Items[key].Poi_ProQuity > dic_Items[key].gdi_SendQuity)
                {
                    mod.ListItems.Add(dic_Items[key]);
                }
            }
            return(mod);
        }
Beispiel #2
0
        public override Model.Procurement.CBPmGoodsDelivery GetCBPmGoodsDeliveryBySysNo(int SysNo)
        {
            string            sql = " select PmGoodsDelivery.*,SyUser.UserName as CurrentName from PmGoodsDelivery left join SyUser on PmGoodsDelivery.gd_DeliveryUserSys=SyUser.SysNo where PmGoodsDelivery.SysNo='" + SysNo + "'";
            CBPmGoodsDelivery mod = new CBPmGoodsDelivery();

            mod           = Context.Sql(sql).QuerySingle <CBPmGoodsDelivery>();
            mod.ListItems = GetCBPmGoodsDeliveryItemBySysNo(SysNo);
            return(mod);
        }
Beispiel #3
0
 public void CreateOrUpdateDeliveryOrder(CBPmGoodsDelivery deliveryMod)
 {
     int sysNo = IPmDeliveryDao.Instance.InnerGoodsDelivery(deliveryMod);
     deliveryMod.SysNo = sysNo;
     foreach (PmGoodsDeliveryItem item in deliveryMod.ListItems)
     {
         item.gdi_PSysNo = sysNo;
         IPmDeliveryDao.Instance.InnerGoodsDeliveryItem(item);
     }
 }