예제 #1
0
        private void btSupprimer_Click(object sender, EventArgs e)
        {
            GroupsService groupsService = new GroupsService();
            Group         g             = (Group)groupeBindingSource.Current;

            groupsService.Delete(g.Id);
            this.Actualiser();
        }
예제 #2
0
 public ActionResult <Group> Delete(int id)
 {
     try
     {
         string userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
         return(Ok(_gs.Delete(id, userId)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
        public ActionResult Delete(int?id)
        {
            if (!id.HasValue)
            {
                return(this.RedirectToAction(c => c.List()));
            }

            UnitOfWork    unitOfWork    = new UnitOfWork();
            GroupsService groupsService = new GroupsService(unitOfWork);

            groupsService.GetByID(id.Value).Contacts.Clear();
            groupsService.Delete(id.Value);

            return(this.RedirectToAction(c => c.List()));
        }