Пример #1
0
        public ActionResult DeleteT(int id)
        {
            TempData["SaveShiftResult"] = $"Shift {service.GetShiftById(id).Shift} was deleted.";
            if (service.DeleteShift(id))
            {
                return(RedirectToAction("Index"));
            }

            ModelState.AddModelError("", "Could not delete Shift.");
            return(View());
        }
Пример #2
0
        public JsonResult Delete(string shiftId)
        {
            try {
                bool isDeleted = shiftServices.DeleteShift(shiftId);

                return(Json(new BaseViewModel <bool>(true, APIResponseMessages.DELETE_SHIFT_SUCCESS, true), JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new BaseViewModel <bool>(false, ex.Message, false), JsonRequestBehavior.AllowGet));
            }
        }