Ejemplo n.º 1
0
        public ActionResult Delete(int id, StaffDto staff)
        {
            try
            {
                StaffLoader.Save(staff);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Ejemplo n.º 2
0
        public ActionResult Create(StaffDto staff)
        {
            try
            {
                StaffLoader.Save(staff);
                // TODO: Add insert logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Ejemplo n.º 3
0
        public ActionResult Edit(int id, StaffDto staff)
        {
            try
            {
                if (id == staff.Id)
                {
                    TempData["SuccessMessage"] = "Updated Successfully";
                    StaffLoader.Save(staff);
                }
                else
                {
                    TempData["FailMessage"] = "Updated Failed";
                    return(View());
                }

                // TODO: Add update logic here

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