示例#1
0
 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"));
        }
示例#3
0
 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 }));
        }
示例#5
0
 public async Task <DeleteBranchOutput> DeleteBranch(DeleteBranchInput Parameters)
 {
     return(await BranchManager.Delete(Parameters));
 }