Example #1
0
        public ViewDispatchChalan GetDispatchChalanByDispatchId(long dispatchId)
        {
            List <ViewProduct> products = _iFactoryDeliveryGateway.GetDespatchedBarcodeByDespatchId(dispatchId).ToList();
            var           destination   = "";
            DispatchModel dispatch      = GetDispatchByDispatchId(dispatchId);
            var           viewTrip      = _inventoryGateway.GetAllTrip().ToList().Find(n => n.TripId == dispatch.TripId);
            var           details       = GetDispatchDetailsByDispatchId(dispatchId);

            foreach (var model in details.ToList().OrderByDescending(n => n.ToBranchId).DistinctBy(n => n.ToBranchId))
            {
                var b = _iBranchGateway.GetById(model.ToBranchId);
                destination += b.BranchName + "-" + b.BranchAddress + ",";
            }


            destination = destination.TrimEnd(',');
            var chalan = new ViewDispatchChalan
            {
                DispatchModel   = dispatch,
                DispatchDetails = details,
                Destination     = destination,
                ViewTripModel   = viewTrip,
                Products        = products
            };

            return(chalan);
        }
Example #2
0
 public ActionResult Chalan(long dispatchId)
 {
     try
     {
         Session["DeliveryFromBranch"] = _iBranchManager.GetAllBranches().FirstOrDefault(n => n.BranchId == 13);
         ViewDispatchChalan chalan = _iFactoryDeliveryManager.GetDispatchChalanByDispatchId(dispatchId);
         return(View(chalan));
     }
     catch (Exception exception)
     {
         Log.WriteErrorLog(exception);
         return(PartialView("_ErrorPartial", exception));
     }
 }
        public ActionResult DispatchedBarCodeList(long dispatchId)
        {
            try
            {
                ViewDispatchChalan chalan = _iFactoryDeliveryManager.GetDispatchChalanByDispatchId(dispatchId);

                return(View(chalan));
            }
            catch (Exception exception)
            {
                Log.WriteErrorLog(exception);
                return(PartialView("_ErrorPartial", exception));
            }
        }