Beispiel #1
0
        public ActionResult Create(Model.CartonManagementDetailModel CartonManagementDetail)
        {
            //var List = Services.CartonManagementDetailService.GetAll();


            //var data = List.Where(x=>x.CartonManagementID==CartonManagementDetail.CartonManagementID).ToList();
            //int? total = 0;
            //foreach (var item in data)
            //{
            //    total+=item.Total;
            //}
            //var ProductSKU = data.Select(x => x.Product.ProductSKU).FirstOrDefault();
            //if (total>24)
            //{

            //    TempData["Success"] = "Carton is full!";

            //}
            //else
            //{
            bool status = Services.CartonManagementDetailService.Create(CartonManagementDetail);

            // }

            return(RedirectToAction("Index", "CartonManagement"));
        }
Beispiel #2
0
        public ServiceResult <List <CartonManagementDetail> > GetSearchData(Model.CartonManagementDetailModel order)
        {
            ServiceResult <List <CartonManagementDetail> > model = new ServiceResult <List <CartonManagementDetail> >();
            var source = db.CartonManagementDetails
                         .Include(x => x.CartonManagement).AsNoTracking()
                         .Include(x => x.CartonManagement.Branch).AsNoTracking()
                         .Include(x => x.CartonManagement.StockDistributionSummary).AsNoTracking()
                         .Where(x => x.IsActive == true);

            if (order != null && order.BranchId > 0)
            {
                source = source.Where(m => m.CartonManagement.BranchID == order.BranchId &&
                                      (m.CartonManagement.DistributionSummaryID == order.StockDistributionSummaryId));
            }
            var result = source.ToList();
            int count  = result.Count();

            model.TotalCount = count;
            model.data       = result;
            return(model);
        }