public ActionResult _AjaxCancelList(GridCommand command, string HuId)
        {
            if (!CheckHuIdIsNull(HuId, false))
            {
                return PartialView(new GridModel(new List<HuMapping>()));
            }
            else
            {
                HuMapping huMapping = base.genericMgr.FindAll<HuMapping>("select h from HuMapping as h where HuId=?",HuId)[0];
                
                string[] oldHuIdArray = huMapping.OldHus.Split(';');
                IList<HuMapping> huMappingList = new List<HuMapping>();
                foreach (string oldHuId in oldHuIdArray)
                {
                    if (!string.IsNullOrEmpty(oldHuId))
                    {
                        HuMapping newHuMapping = new HuMapping() ;
                        newHuMapping.Id = huMapping.Id;
                        newHuMapping.OldHus = oldHuId;
                        newHuMapping.HuId = huMapping.HuId;
                        newHuMapping.Item = huMapping.Item;
                        newHuMapping.Qty = huMapping.Qty;
                        newHuMapping.IsEffective = huMapping.IsEffective;
                        newHuMapping.IsRepack = huMapping.IsRepack;
                        newHuMapping.OrderNo = huMapping.OrderNo;
                        newHuMapping.OrderDetId = huMapping.OrderDetId;
                        newHuMapping.CreateUserId = huMapping.CreateUserId;
                        newHuMapping.CreateUserName = huMapping.CreateUserName;
                        newHuMapping.CreateDate = huMapping.CreateDate;
                        newHuMapping.LastModifyUserId = huMapping.LastModifyUserId;
                        newHuMapping.LastModifyUserName = huMapping.LastModifyUserName;
                        newHuMapping.LastModifyDate = huMapping.LastModifyDate;
                        huMappingList.Add(newHuMapping);
                    }
                }
              
                GridModel<HuMapping> gridList = new GridModel<HuMapping>();
                gridList.Data=huMappingList;
                gridList.Total=oldHuIdArray.Length;
                return PartialView(gridList);
            }

        }
Exemplo n.º 2
0
        public IList<Hu> CreateHu(OrderDetail orderDetail, Boolean isRepack, string manufactureParty, string lotNo, decimal totalQty, decimal unitQty, decimal huQty, string oldHus, string binTo, Boolean isRepackForOrder)
        {
            IList<Hu> huList = new List<Hu>();

            IDictionary<string, decimal> huIdDic = numberControlMgr.GetHuId(lotNo, orderDetail.Item, manufactureParty, totalQty, unitQty);
            if (huIdDic != null && huIdDic.Count > 0)
            {
                Hu hu = new Hu();
                hu.HuId = huIdDic.SingleOrDefault().Key;
                hu.LotNo = lotNo;
                hu.Item = orderDetail.Item;
                hu.ItemDescription = orderDetail.ItemDescription;
                hu.BaseUom = orderDetail.BaseUom;
                hu.Qty = huQty;
                hu.ManufactureParty = manufactureParty;
                hu.ManufactureDate = LotNoHelper.ResolveLotNo(lotNo);
                hu.PrintCount = 0;
                hu.ConcessionCount = 0;
                hu.ReferenceItemCode = orderDetail.ReferenceItemCode;
                hu.UnitCount = orderDetail.UnitCount;
                hu.UnitQty = orderDetail.UnitQty;
                hu.Uom = orderDetail.Uom;
                hu.IsOdd = huQty != hu.UnitCount;
                hu.IsChangeUnitCount = orderDetail.IsChangeUnitCount;
                hu.UnitCountDescription = orderDetail.UnitCountDescription;
                hu.Bin = binTo;
                hu.LocationTo = orderDetail.LocationTo;
                hu.OldHus = oldHus;
                genericMgr.Create(hu);
                //this.AsyncSendPrintData(hu);
                this.genericMgr.Create(hu);
                huList.Add(hu);

                HuMapping huMapping = new HuMapping();
                huMapping.HuId = huIdDic.SingleOrDefault().Key;
                huMapping.OldHus = oldHus;
                huMapping.Item = orderDetail.Item;
                if (isRepackForOrder == true)
                {
                    huMapping.OrderNo = orderDetail.OrderNo;
                    huMapping.OrderDetId = orderDetail.Id;
                }
                else
                {
                    huMapping.OrderNo = "";
                    huMapping.OrderDetId = 0;
                }
                huMapping.IsRepack = isRepack;
                huMapping.Qty = huQty;
                huMapping.IsEffective = false;
                this.genericMgr.Create(huMapping);
            }
            return huList;
        }