Example #1
0
        public ActionResult Delete(int?id)
        {
            try
            {
                colourService.Delete(id);

                TempData["Success"] = "Deleted successfully";

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                TempData["Danger"] = $"Something went wrong {ex.Message}";
            }
            return(RedirectToAction("Index"));
        }
        public ActionResult Delete(int?id)
        {
            try
            {
                designService.Delete(Convert.ToInt32(id));
                TempData["Success"] = "Deleted Designation !!";

                return(RedirectToAction("Index"));
            }
            catch (Exception e)
            {
                TempData["Danger"] = $"Opppsss Something went wrong {e.Message} !";
            }

            return(RedirectToAction("Index"));
        }
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            try
            {
                educationService.Delete(Convert.ToInt32(id));

                TempData["Success"] = "Education level deleted !";

                return(RedirectToAction("Index"));
            }
            catch (Exception e)
            {
                TempData["Danger"] = $"Oppps something went wrong {e.Message} ";

                throw;
            }
        }
Example #4
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            try
            {
                officeTypeService.Delete(id);

                TempData["Success"] = "OfficeType Deleted Successfully !";

                return(RedirectToAction("Index"));
            }
            catch (Exception e)
            {
                TempData["Danger"] = $"Opps Something went wrong {e.Message}";

                throw;
            }
        }
        public ActionResult Delete(int?id)
        {
            try
            {
                if (id == null)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                }

                religionService.Delete(id);

                TempData["Success"] = $"Religion Deleted Successfully";

                return(RedirectToAction("Index"));
            }
            catch (Exception e)
            {
                TempData["Danger"] = $"Oppsss something {e.Message}";

                throw;
            }
        }