public ActionResult DeleteConfirmed(int id)
        {
            Branch branch = Service.GetById(id);

            Service.Delete(branch);
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public async Task DeleteBranch()
        {
            MyCompany.Branches.RemoveAt(MyCompany.Branches.FindIndex(i => i.Id.Equals(SelectedBranch.Id)));

            await _branchService.Delete(SelectedBranch);

            _navigationService.NavigateTo(nameof(MyCompanyPage));
            RaisePropertyChanged(nameof(MyCompany.Branches));
        }
        public IActionResult Delete(int Id)
        {
            var isLogin = HttpContext.Session.GetString("isUserLogin");

            if (isLogin == "true")
            {
                var branch = _branchService.GetById(Id);
                _branchService.Delete(branch);
                return(View("Index", _branchService.GetAll()));
            }
            return(RedirectToAction("Login", "Home"));
        }
Exemple #4
0
        public ActionResult DeleteBranch(string Id)
        {
            int branchId = DecryptQueryString(Id);

            if (branchId < 1)
            {
                return(RedirectToAction("BranchLookUp"));
            }

            ResultDto resultDto = _branchService.Delete(branchId, UserInfo.UserID);

            TempData["Result"] = resultDto;

            return(RedirectToAction("BranchLookUp"));
        }
 public ActionResult Delete(int branchId)
 {
     try
     {
         _branchService.Delete(branchId);
         var responseModel = new ResponseModel
         {
             StatusCode = (int)HttpStatusCode.OK,
             MessageAr  = AppResource.DeletedSuccessfully
         };
         return(Json(responseModel, JsonRequestBehavior.AllowGet));
     }
     catch (System.Exception)
     {
         var responseModel = new ResponseModel
         {
             StatusCode = (int)HttpStatusCode.OK,
             MessageAr  = AppResource.DeleteErrorValidation
         };
         return(Json(responseModel, JsonRequestBehavior.AllowGet));
     }
 }