Ejemplo n.º 1
0
        public ServiceResponse <HeadstoneUserRole> Delete(Expression <Func <HeadstoneUserRole, bool> > predicate)
        {
            using (var bo = new UserRoleDAO())
            {
                var model = bo.Find(predicate);

                bool isDeleted = bo.Delete(model as HeadstoneUserRole, true);
                if (isDeleted)
                {
                    return(new ServiceResponse <HeadstoneUserRole>()
                    {
                        Type = ServiceResponseTypes.Success,
                        Source = ServiceResponseSources.MsSQL,
                        Result = new List <HeadstoneUserRole>()
                        {
                            model
                        }
                    });
                }
                else
                {
                    return(new ServiceResponse <HeadstoneUserRole>()
                    {
                        Type = ServiceResponseTypes.Error,
                        Source = ServiceResponseSources.MsSQL,
                        Result = new List <HeadstoneUserRole>()
                        {
                            model
                        }
                    });
                }
            }
        }
Ejemplo n.º 2
0
 public ServiceResponse <HeadstoneUserRole> Delete(HeadstoneUserRole model)
 {
     using (var bo = new UserRoleDAO())
     {
         bool isDeleted = bo.Delete(model as HeadstoneUserRole, true);
         if (isDeleted)
         {
             return(new ServiceResponse <HeadstoneUserRole>()
             {
                 Type = ServiceResponseTypes.Success,
                 Source = ServiceResponseSources.MsSQL,
                 Result = new List <HeadstoneUserRole>()
                 {
                     model
                 }
             });
         }
         else
         {
             return(new ServiceResponse <HeadstoneUserRole>()
             {
                 Type = ServiceResponseTypes.Error,
                 Source = ServiceResponseSources.MsSQL,
                 Result = new List <HeadstoneUserRole>()
                 {
                     model
                 }
             });
         }
     }
 }
        public ActionResult Delete(string id, FormCollection collection)
        {
            try
            {
                userRoleDAO.Delete(id);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View("Error"));
            }
        }
Ejemplo n.º 4
0
        public ActionResult Delete(string id, FormCollection collection)
        {
            try
            {
                userRoleDAO.Delete(id); //brisanje iz Identity-ja
                clientDAO.Delete(id);   //brisanje iz baze

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View("Error"));
            }
        }
        public JsonResult Delete(int id)
        {
            var lst = roledao.Delete(id);

            return(Json(lst, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 6
0
 public override bool Delete(object dto)
 {
     return(dao.Delete(dto));
 }
Ejemplo n.º 7
0
 public int Delete(int userId, RoleType roleId)
 {
     return(_userroledao.Delete(userId, roleId));
 }