public ActionResult Delete(int id)
        {
            AppUser a = arep.GetByID(id);

            #region Açıklama
            //if (a != null)
            //{
            //    arep.Delete(a);
            //}
            //else
            //{
            //    ViewBag.Hata = "Hata Oluştu";       //Böyle bir kullanımda ViewBag ile gönderilmek istenen veri yakalanamaz. Çünkü böyle bir durumda ikinci bir action çalıştırılmak istenmektedir ve ViewBag yapısı ile ikinci bir action metoda veri gönderilmez. Oluşturulduğu action metodun yaşam döngüsü bittikten sonra kendisi de yok olur. Bu nedenle burada kllanılması gereken yapı tam anlamıyla TempData'dır. TempData ile bir sonraki çalışacak action metodun yaşam döngüsüne veri aktarılabilir.

            //}
            //return RedirectToAction("List");
            #endregion

            if (a != null)
            {
                arep.Delete(a);
            }
            else
            {
                TempData["Hata"] = "Hata Oluştu";
            }
            return(RedirectToAction("List"));
        }
Exemplo n.º 2
0
        public ActionResult DeleteUser(int id)
        {
            _uRep.Delete(_uRep.Find(id));
            _upRep.Delete(_upRep.Find(id));



            return(RedirectToAction("UserList", "User", new { Area = "Panel" }));
        }
 private void BtnDelete_Click(object sender, EventArgs e)
 {
     if (lstAppUsers.SelectedIndex > -1)
     {
         profileRepository.Delete(profile);
         appUserRepository.Delete(appUser);
         LoadListBox();
         ClearTextBoxes();
     }
 }
Exemplo n.º 4
0
 public ActionResult Delete(Guid id)
 {
     try
     {
         userRepo.Delete(id);
         TempData["OnayMesaji"] = "Silme Başarılı";
     }
     catch
     {
         TempData["HataMesaji"] = "Silme sırasında hata oluştu";
     }
     return(RedirectToAction("Index", "Appuser", new { area = "Admin" }));
 }
Exemplo n.º 5
0
        //kullanıcıyı siler(pasif hale getirir)
        public ActionResult Delete(int id)
        {
            AppUser a = arep.GetByID(id);



            if (a != null)
            {
                arep.Delete(a);
            }
            else
            {
                TempData["Hata"] = "Hata Oluştu";
            }
            return(RedirectToAction("List"));
        }
Exemplo n.º 6
0
        public void Delete(int id)
        {
            AppUser appUser = AppUserRepository.GetSingle(x => x.Id == id);

            if (appUser == null)
            {
                throw new BussinesException(1002, ErrorResource.NoData);
            }
            AppUserRole appUserRole = AppUserRoleRepository.GetSingle(x => x.AppUserId == id);

            if (appUserRole == null)
            {
                throw new BussinesException(1003, ErrorResource.NoData);
            }
            AppUserRoleRepository.Delete(appUserRole);
            AppUserRepository.Delete(appUser);
        }
Exemplo n.º 7
0
 public ActionResult DeleteAppUser(int id)
 {
     apprep.Delete(apprep.GetByID(id));
     return(RedirectToAction("ListAppUser"));
 }
 public ActionResult DeleteAppUser(int id)
 {
     aurep.Delete(aurep.Find(id));
     return(RedirectToAction("Index"));
 }