public ActionResult DeleteCollege(Guid id)
        {
            CollegeService collegeService = new CollegeService();

            if (collegeService.DeleteCollege(id))
            {
                TempData["toast"] = "College Deleted successfully";
                return(RedirectToAction("ViewColleges"));
            }
            else
            {
                ModelState.AddModelError("DeleteCollegeFailedError", "Unable to delete college");
                return(this.View());
            }
        }
Exemplo n.º 2
0
        public ActionResult DeleteCollege(int CollegeId)
        {
            try
            {
                var msg = collegeService.DeleteCollege(CollegeId);

                if (msg.status)
                {
                    return(Ok());
                }
                else
                {
                    return(BadRequest(msg.message));
                }
            }
            catch (Exception e)
            {
                return(StatusCode(500, e));
            }
        }