public ActionResult Delete(int id) { var branch = _branchService.FindById(id); _branchService.DeleteBranch(branch); return(RedirectToAction("Index", "Branches")); }
public ActionResult DeleteConfirmed(int id) { Branch branch = _branchService.FindById(id); _branchService.DeleteBranch(branch); return(RedirectToAction("Index")); }
public HttpResponseMessage DeleteBranches(BranchModel aBranchModel) { try { if (this.ModelState.IsValid) { var result = service.DeleteBranch(aBranchModel); if (result != null) { return(Request.CreateResponse(HttpStatusCode.OK, result)); } else { string message = "Not deleted successfully"; return(Request.CreateErrorResponse(HttpStatusCode.Forbidden, message)); } } else { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex)); } }
public IActionResult DeleteBranch(int branchId) { try { branchService.DeleteBranch(branchId); return Ok(); } catch (Exception ex) { return BadRequest(ex.Message); } }
public IActionResult Delete(int id) { try { _branchService.DeleteBranch(id); return(Ok()); } catch (Exception) { return(BadRequest("Branch not found")); } }
public async Task <IActionResult> DeleteBranch(int enterpriseId, int branchId) { if (ModelState.IsValid) { var temp = await branchService.DeleteBranch(enterpriseId, branchId); if (temp != null) { return(Ok(temp)); } else { return(BadRequest(new { Message = "Something went wrong. Please, try again later." })); } } else { return(BadRequest(new { Message = "Invalid parameters supplied." })); } }
public IActionResult BranchDeleted(int id) { _branchService.DeleteBranch(id); return(View()); }
public async Task <IActionResult> DeleteBranch(int branchId) { var result = await branchService.DeleteBranch(branchId); return(StatusCode((int)result.Code, result.Value)); }
public IActionResult DeleteBranch(int id) { branchService.DeleteBranch(id); return(Ok()); }
public ActionResult Delete(int branchId) { branchService.DeleteBranch(branchId); return(RedirectToAction("Index")); }
public async Task <ActionResult> DeleteById(int id) { var response = await _branchService.DeleteBranch(id); return(StatusCode(response.StatusCode)); }
public ActionResult DeleteBranch(int branchId, int organisationId) { _branchService.DeleteBranch(branchId); return RedirectToAction("OrganisationBranchesList", new {organisationId}); }