Exemplo n.º 1
0
 public ActionResult AddPantry(PantryWithOfficeIdDto pantry)
 {
     try
     {
         var addedPantry = new PantryCommand().AddPantry(pantry);
         return(RedirectToAction("PantryEditor", "Pantry", new { id = addedPantry.PantryId, officeId = addedPantry.OfficeId }));
     }
     catch (Exception ex)
     {
         TempData["Error"] = ex.GetBaseException();
         return(RedirectToAction("PantryEditor", "Pantry", new { officeId = pantry.OfficeId }));
     }
 }
Exemplo n.º 2
0
        public JsonResult AddDrinks(List <int> drinkIds, int pantryId)
        {
            var success = new PantryCommand().AddDrinkToPantry(drinkIds, pantryId);

            return(Json(new { success }, JsonRequestBehavior.AllowGet));
        }