Exemplo n.º 1
0
 public PartialViewResult Delete(int id, string gridId)
 {
     var p = _partnerService.GetSingle(id);
     if (p != null)
     {
         var model = new DeleteConfirmInput()
             {
                 GridId = gridId,
                 Id = id,
                 Message =
                     String.Format("Are you sure you want to delete {0} and all attendant partnership logs?",
                                   p.LastName + " " + p.FirstName)
             };
         return PartialView("Delete",model);
     }
     return PartialView("Delete");
 }
Exemplo n.º 2
0
 public PartialViewResult StageDelete(int id, string gridId)
 {
     var s = _stagedPartnerService.GetSingle(id);
     if (s != null)
     {
         var m = new DeleteConfirmInput()
             {
                 GridId = gridId,
                 Id = id,
                 Message =
                     String.Format("Are you sure you want to delete the staged record for {0}",
                                   s.LastName + " " + s.FirstName)
             };
         return PartialView("Delete", m);
     }
     return PartialView("Delete");
 }
Exemplo n.º 3
0
 public PartialViewResult ChapterDelete(int id, string gridId)
 {
     var m = _stagedChurchService.GetSingle(id);
     if (m != null)
     {
         var model = new DeleteConfirmInput()
         {
             GridId = gridId,
             Id = id,
             Message =
                 String.Format("Are you sure you want to delete the staged record for zone {0}", m.Name)
         };
         return PartialView("Delete", model);
     }
     return PartialView();
 }
Exemplo n.º 4
0
 public ActionResult ChapterDelete(DeleteConfirmInput model)
 {
     if (ModelState.IsValid)
     {
         _stagedChurchService.Delete(Convert.ToInt32(model.Id));
         return Json(new { });
     }
     return PartialView("Delete", model);
 }
Exemplo n.º 5
0
 public PartialViewResult StageDelete(int id, string gridId)
 {
     var m = _stagedPartnershipService.GetSingle(id);
     if (m != null)
     {
         var model = new DeleteConfirmInput()
         {
             GridId = gridId,
             Id = id,
             Message =
                 String.Format("Are you sure you want to delete the staged record for {0} {1} for Partner with Id P{2}",
                     ((MonthEnums) m.Month).ToString(), m.Year, m.PartnerId)
         };
         return PartialView("Delete", model);
     }
     return PartialView("Delete");
 }
Exemplo n.º 6
0
 public PartialViewResult GroupDelete(int id, string gridId)
 {
     var group = _groupService.GetSingle(id);
     if (group != null)
     {
         var m = new DeleteConfirmInput()
             {
                 GridId = gridId,
                 Id = id,
                 Message =
                     string.Format(
                         "Are you sure you want to delete group {0} along with all Churches, PCFs and Cells it contains",
                         group.Name)
             };
         return PartialView("Delete",m);
     }
     return PartialView("Delete");
 }
Exemplo n.º 7
0
 public ActionResult CurrencyDelete(DeleteConfirmInput model)
 {
     if (ModelState.IsValid)
     {
         _currencyService.Delete(Convert.ToInt32(model.Id));
         return Json(new {});
     }
     return PartialView("Delete",model);
 }
Exemplo n.º 8
0
 public async Task<ActionResult> Delete(DeleteConfirmInput model)
 {
     if (ModelState.IsValid)
     {
         var m = await _userManager.FindByIdAsync(model.Id);
         if(m != null)
         {
         var t =  await  _userManager.DeleteAsync(m);
             if (t.Succeeded)
             {
                 return Json(new {});
             }
         }
     }
     ModelState.AddModelError("","Unable to delete user");
     return PartialView("Delete", model);
 } 
Exemplo n.º 9
0
 public PartialViewResult ArmDelete(int id, String gridId)
 {
     var model = _armService.GetSingle(id);
     if (model != null)
     {
         var m = new DeleteConfirmInput()
             {
                 Id = id,
                 GridId = gridId,
                 Message = String.Format("Are you sure you want to delete {0}", model.Name)
             };
         return PartialView("Delete", m);
     }
     return PartialView("Delete");
 }
Exemplo n.º 10
0
 public PartialViewResult CurrencyDelete(int id, string gridId)
 {
     var model = _currencyService.GetSingle(id);
     if (model != null)
     {
         var m = new DeleteConfirmInput()
             {
                 GridId = gridId,
                 Id = model.Id,
                 Message =
                     String.Format("Are you sure you want to delete the currency {0} from the datastore",
                                   model.Symbol)
             };
         return PartialView("Delete", m);
     }
     return PartialView("Delete");
 }
Exemplo n.º 11
0
 public ActionResult ChapterDelete(DeleteConfirmInput input)
 {
     if (ModelState.IsValid)
     {
         _churchService.Delete(Convert.ToInt32(input.Id));
         var m =
             _userManager.Users.FirstOrDefault(
                 i => i.ChurchId == input.Id && i.IdentityUserInRoles.Any(k => k.IdentityRole.Name == RolesEnum.CHAPTER_ADMIN.ToString()));
         if (m != null)
             _userManager.Delete(m);
         return Json(new {});
     }
     return PartialView("Delete");
 }
Exemplo n.º 12
0
        public PartialViewResult ChapterDelete(int id, string gridId)
        {
            var model = _churchService.GetSingle(id);
            if (model != null)
            {
                var m = new DeleteConfirmInput()
                    {
                        GridId = gridId,
                        Id = id,
                        Message =
                            String.Format(
                                "Are you sure you want to delete {0} Along with Cells, PCFs and The Partner Information Contained",
                                model.Name)

                    };
                return PartialView("Delete", m);
            }
           
            return PartialView("Delete");
        }
Exemplo n.º 13
0
 public ActionResult GroupDelete(DeleteConfirmInput model)
 {
     if (ModelState.IsValid)
     {
         _groupService.Delete(Convert.ToInt32(model.Id));
         var m =
             _userManager.Users.FirstOrDefault(
                 i =>
                     i.GroupId == model.Id &&
                     i.IdentityUserInRoles.Any(k => k.IdentityRole.Name == RolesEnum.GROUP_ADMIN.ToString()));
         if (m != null)
             _userManager.Delete(m);
         return Json(new {});
     }
     return PartialView("Delete",model);
 }
Exemplo n.º 14
0
 public ActionResult StageDelete(DeleteConfirmInput model)
 {
     if (ModelState.IsValid)
     {
         var id = Convert.ToInt32(model.Id);
         _stagedPartnerService.Delete(id);
         return Json(new {});
     }
     return PartialView("Delete", model);
 }
Exemplo n.º 15
0
 public PartialViewResult ZoneDelete(int id, string gridId)
 {
     var zone = _zoneService.GetSingle(id);
     if (zone != null)
     {
         var m = new DeleteConfirmInput()
             {
                 GridId = gridId,
                 Id = id,
                 Message = String.Format("Are you sure you want to delete Zone {0}, along with all the chapters, PCFs and Cells", zone.Name)
             };
         return PartialView("Delete",m);
     }
     return PartialView("Delete");
 }
Exemplo n.º 16
0
 public async Task<PartialViewResult> Delete(int id, string gridId)
 {
     var user = await _userManager.FindByIdAsync(id);
     if (user != null)
     {
         var model = new DeleteConfirmInput()
             {
                 GridId = gridId,
                 Id = id,
                 Message = String.Format("Are you sure you want to delete {0} {1} with username {2}", user.LastName, user.FirstName, user.UserName)
             };
         return PartialView("Delete", model);
     }
     return PartialView();
 }
Exemplo n.º 17
0
 public PartialViewResult Delete(int id, string gridId)
 {
     var m = _pcfService.GetSingle(id);
     if (m != null)
     {
         var c = new DeleteConfirmInput()
             {
                 GridId = gridId,
                 Id = m.Id,
                 Message = string.Format("Are you sure you want to delete PCF {0}", m.Name)
             };
         return PartialView("Delete", c);
     }
     return PartialView("Delete");
 }
Exemplo n.º 18
0
 public PartialViewResult Delete(int id, string gridId)
 {
     var p = _partnershipService.GetSingle(id);
     if (p != null)
     {
         var m = new DeleteConfirmInput()
         {
             GridId = gridId,
             Id = id,
             Message =
                 String.Format("Are you sure you want to delete the partnership record with Id", p.TrackingId)
         };
         return PartialView(m);
     }
     return PartialView();
 }
Exemplo n.º 19
0
 public ActionResult Delete(DeleteConfirmInput model)
 {
     if (ModelState.IsValid)
     {
         var m = _pcfService.GetSingle(Convert.ToInt32(model.Id));
         if (m != null)
         {
             var partners = _partnerService.Find(i => i.PCFId == Convert.ToInt32(model.Id));
             if(partners.Any())
                 partners.UpdateAll(c => c.Set(k => k.PCFId, null));
             _pcfService.Delete(m);
         }
         return Json(new {});
     }
     return PartialView("Delete", model);
 }
Exemplo n.º 20
0
 public ActionResult StageDelete(DeleteConfirmInput model)
 {
     if (ModelState.IsValid)
     {
         _stagedPartnershipService.Delete(model.Id);
         return Json(new {});
     }
     return PartialView("Delete", model);
 }
Exemplo n.º 21
0
 public ActionResult ZoneDelete(DeleteConfirmInput model)
 {
     if (ModelState.IsValid)
     {
         _zoneService.Delete(Convert.ToInt32(model.Id));
         var user = _userManager.Users.FirstOrDefault(i => i.ZoneId == model.Id && i.IdentityUserInRoles.Any(k => k.IdentityRole.Name == RolesEnum.ZONE_ADMIN.ToString()));
         if (user != null)
             _userManager.Delete(user);
         return Json(new {});
     }
     return PartialView();
 }