Example #1
0
        //-------------------------- branch to branch transfer --------------------------------------

        public JsonResult StartPackingStockTransfer(string BranchName)
        {
            CartonManagementForStockTransferModel CM = new CartonManagementForStockTransferModel();

            CM.BranchName = BranchName;
            var list = Services.IBTService.GetIBTNumberStockTransfer();

            CM.IBTNumber = Helper.CommonFunction.IBtNoForStock(list);
            var Summary   = Services.IBTService.GetLast();
            var SummaryId = Summary.StockDistributionSummaryId;

            //ViewBag.SummaryId = SummaryId;
            CM.DistributionSummaryID = SummaryId;
            //Session["ReceiveOrder"] = RO.ReceiptNumber;
            var createCartonManagement = Services.IBTService.CreateCartonManagementForStock(CM);
            var IBT = Services.IBTService.GetIBTNumberStockTransfer().LastOrDefault();
            var c   = Services.CartonManagementService.GetAllDetailForStock(SummaryId);

            if (c.Count != 0)
            {
                var cd1 = c.Where(x => x.DistributionSummaryID == SummaryId);
                var cd  = cd1.LastOrDefault().CartonNumber;
                IBT.CartonNumber = cd + 1;
            }
            else
            {
                IBT.CartonNumber = 1;
            }
            //bool createCartonDetail = Services.IBTService.CreateCartonDetail1(IBT);
            return(Json(IBT, JsonRequestBehavior.AllowGet));
            // return RedirectToAction("Index", "IBTCarton");
        }
Example #2
0
        public JsonResult ProductDetail1ForStock(CartonManagementForStockTransferModel carton)
        {
            List <CartonManagementDetailForStockTransferModel> model = new List <CartonManagementDetailForStockTransferModel>();

            model = carton.CartonMgmtDetailsStockTransfers;
            return(Json(model, JsonRequestBehavior.AllowGet));
        }
Example #3
0
        public ActionResult CreateAForStockTransfer(CartonManagementForStockTransferModel model)
        {
            var create = Services.IBTService.CompleteCreateForStock(model);
            var list   = new List <StockTransferDetail>();

            foreach (var item in model.CartonMgmtDetailsStockTransfers)
            {
                StockTransferDetail st = new StockTransferDetail();
                st.ProductId    = item.ProductID ?? 0;
                st.FromBranchId = model.FromBranchID;
                st.ToBranchId   = model.ToBranchID;
                st.Quantity01   = item.Z01;
                st.Quantity02   = item.Z02;
                st.Quantity03   = item.Z03;
                st.Quantity04   = item.Z04;
                st.Quantity05   = item.Z05;
                st.Quantity06   = item.Z06;
                st.Quantity07   = item.Z07;
                st.Quantity08   = item.Z08;
                st.Quantity09   = item.Z09;
                st.Quantity10   = item.Z10;
                st.Quantity11   = item.Z11;
                st.Quantity12   = item.Z12;
                st.Quantity13   = item.Z13;
                st.Quantity14   = item.Z14;
                st.Quantity15   = item.Z15;
                st.Quantity16   = item.Z16;
                st.Quantity17   = item.Z17;
                st.Quantity18   = item.Z18;
                st.Quantity19   = item.Z19;
                st.Quantity20   = item.Z20;
                st.Quantity21   = item.Z21;
                st.Quantity22   = item.Z22;
                st.Quantity23   = item.Z23;
                st.Quantity24   = item.Z24;
                st.Quantity25   = item.Z25;
                st.Quantity26   = item.Z26;
                st.Quantity27   = item.Z27;
                st.Quantity28   = item.Z28;
                st.Quantity29   = item.Z29;
                st.Quantity30   = item.Z30;
                list.Add(st);
            }
            var status = Services.StockTransferService.UpdateStockTransfer(list);

            return(RedirectToAction("Index", "IBTCarton"));
        }
        public IHttpActionResult GenerateIBTForStock(CartonManagementForStockTransferModel model)
        {
            CartonMgmtStockTransfer carton = new CartonMgmtStockTransfer();

            carton.IBTNumber = model.IBTNumber;
            // carton.IsActive = true;
            carton.FromBranchID = db.Branches.Where(x => x.IsActive == true && x.Name == model.BranchName).FirstOrDefault().Id;
            DateTime today = DateTime.Today;

            carton.PackDate = today;
            //carton.CartonNumber = 0;
            carton.DistributionSummaryID = model.DistributionSummaryID;
            carton.IsDispatched          = false;
            carton.CreatedOn             = System.DateTime.UtcNow;
            carton.UpdatedOn             = System.DateTime.UtcNow;
            db.CartonMgmtStockTransfers.Add(carton);
            db.SaveChanges();
            return(Ok(true));
        }
 public bool CreateCartonManagementForStock(CartonManagementForStockTransferModel model)
 {
     return(ServerResponse.Invoke <bool>("api/cartonManagement/GenerateIBTForStock", JsonConvert.SerializeObject(model), "POST"));
 }