Exemplo n.º 1
0
        public ActionResult Create(BrunchDto brunch)
        {
            try
            {
                BrunchLoader.Save(brunch);
                TempData["SuccessMessage"] = "Created Successfully";
                // TODO: Add insert logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 2
0
        public ActionResult Edit(int id, BrunchDto brunch)
        {
            try
            {
                if (id == brunch.Id)
                {
                    BrunchLoader.Save(brunch);
                    TempData["SuccessMessage"] = "Updated Successfully";
                }
                else
                {
                    TempData["FailMessage"] = "Updated Failed";
                    return(View());
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }