Beispiel #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
                        }
                    });
                }
            }
        }
Beispiel #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"));
            }
        }
Beispiel #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));
        }
Beispiel #6
0
 public override bool Delete(object dto)
 {
     return(dao.Delete(dto));
 }
Beispiel #7
0
 public int Delete(int userId, RoleType roleId)
 {
     return(_userroledao.Delete(userId, roleId));
 }