Esempio n. 1
0
 public IActionResult SetDelivaryCostByArea(DelivaryCost newDelivaryCost)
 {
     if (ModelState.IsValid)
     {
         Context.DelivaryCost.Add(newDelivaryCost);
         Context.SaveChanges();
         return(Content("Cost added successfully"));
     }
     return(View(newDelivaryCost));
 }
Esempio n. 2
0
        // ---------------------------------------------------------------------------

        // Calculate Order TotalCost :

        public double DelivaryPlaceCost(int PlaceAreaID, int customerAreaID)
        {
            DelivaryCost cost = Context.DelivaryCost.FirstOrDefault(c => c.CustomerAreaID == customerAreaID && c.ShoppingPlaceAreaID == PlaceAreaID);

            if (cost != null)
            {
                return(cost.Cost);
            }
            else
            {
                return(5);
            }
        }