Ejemplo n.º 1
0
 public IHttpActionResult RemoveStatus(int id)
 {
     try
     {
         repo.DeleteStatus(id);
         return(Ok("Status Deleted Successfully"));
     }
     catch (Exception)
     {
         return(NotFound());
     }
 }
        public ActionResult Delete(StatusVM status)
        {
            string msg = "";

            if (ModelState.IsValid)
            {
                bool success = _sRepo.DeleteStatus(status.StatusID, out msg);
                if (success)
                {
                    TempData["SuccessMsg"] = msg;
                    return(RedirectToAction("index"));
                }
                else
                {
                    TempData["ErrorMsg"] = msg;
                }
            }
            else
            {
                TempData["ErrorMsg"] = "Status cannot be deleted at this time.";
            }
            status = _sRepo.GetStatus(status.StatusID);
            return(View(status));
        }