public int Delete(int id) { var department = new Department(); department.Id = id; return(_departmentServices.DeleteDepartment(department)); }
public JsonResult DeleteDepartment(string id) { bool result = _departmentservice.DeleteDepartment(Convert.ToInt64(id)); if (result) { return(Json("Successfully deleted Record !")); } else { TempData["Delete"] = string.Format("Error Coming While Deleting Data"); return(Json("Error Coming While Deleting Data")); } }
public HttpResponseMessage Delete(int id) { HttpResponseMessage msg = Request.CreateResponse(HttpStatusCode.BadRequest, false); try { if (id > 0) { var isSuccess = _departmentServices.DeleteDepartment(id); if (isSuccess) { msg = Request.CreateResponse(HttpStatusCode.OK, isSuccess); } } return(msg); } catch (Exception ex) { return(msg); } }
public IResponseDTO RemoveDepartment(DepartmentModel departmentModel) { var depart = _departmentServices.DeleteDepartment(departmentModel); return(depart); }