public HttpResponseMessage Delete([FromBody] Branch[] branches) { try { int rowsAffected = BranchManager.Delete(branches); return(Request.CreateResponse(HttpStatusCode.Created, rowsAffected)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, $"failed to delete branch {ex.Message}")); } }
public ActionResult Delete(Branch selectedbBranch) { // var singleOrganization = db.Organizations.FirstOrDefault(x=>x.id == selectedOrganization.id); //db.Organizations.Remove(singleOrganization); //db.Entry(selectedOrganization).State = EntityState.Deleted; //int rowAffected = db.SaveChanges(); bool isSaved = branchManager.Delete(selectedbBranch); if (isSaved) { ViewBag.Message = "Deleted Successfully!"; } return(RedirectToAction("Create")); }
public Branch Delete(Branch branch) { _branches.Remove(branch); _manager.Delete(branch.Id); return(branch); }
public ActionResult Remove(int id) { manager.Delete(id); return(RedirectToAction("Index", "Branch", new { Success = false, SuccessUpdated = false, SuccessRemoved = true })); }
public async Task <DeleteBranchOutput> DeleteBranch(DeleteBranchInput Parameters) { return(await BranchManager.Delete(Parameters)); }