public UserGroupResult Create(UserGroupParam param)
        {
            Data.Entity.UserGroup entity = UserGroupParamConverter.Convert(param, null);
            UserGroupDao.Save(entity);

            return(UserGroupResultConverter.Convert(entity));
        }
Exemplo n.º 2
0
        public string GetUserGroupTreeParam(UserGroupParam param)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("where 1=1 and IsDelete=0 ");

            if (!string.IsNullOrEmpty(param.PlatformId.ToString()))
            {
                sb.AppendFormat("  and  PlatformId=" + param.PlatformId);
            }

            if (!string.IsNullOrEmpty(param.GroupName))
            {
                sb.AppendFormat(" and  GroupName like '%{0}%' ", Utils.SqlSafe(param.GroupName));
            }
            else
            {
                sb.AppendFormat(" and  ParentId=0 ");
            }



            if (string.IsNullOrEmpty(sb.ToString()))
            {
                sb.AppendFormat(" where ParentId=0 ");
            }



            return(sb.ToString());
        }
Exemplo n.º 3
0
        public string GetUserGroupParam(UserGroupParam param)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("where 1=1 and  IsDelete=0 ");

            if (!string.IsNullOrEmpty(param.GroupName))
            {
                sb.AppendFormat(" and GroupName like '%{0}%' ", Utils.SqlSafe(param.GroupName));
            }


            return(sb.ToString());
        }
Exemplo n.º 4
0
        public ApiResponse Create(UserGroupParam param)
        {
            UserGroupProcessor = new UserGroupProcessor();
            Response           = new ApiResponse();

            try
            {
                Response.text   = JsonConverter.JsonConverter.ObjToJson(UserGroupProcessor.Create(param));
                Response.result = true;

                return(Response);
            }

            catch
            {
                Response.text   = "Something went wrong :(";
                Response.result = false;

                return(Response);
            }
        }
Exemplo n.º 5
0
        public ApiResponse Update(long id, UserGroupParam param)
        {
            UserGroupProcessor = new UserGroupProcessor();
            Response           = new ApiResponse();

            try
            {
                UserGroupProcessor.Update(id, param);
                Response.text   = "Entity was successfully updated";
                Response.result = true;

                return(Response);
            }
            catch
            {
                Response.text   = "Unfortunately something went wrong :(";
                Response.result = false;

                return(Response);
            }
        }
 public void Update(long id, UserGroupParam param)
 {
     Data.Entity.UserGroup oldEntity = UserGroupDao.Find(id);
     Data.Entity.UserGroup newEntity = UserGroupParamConverter.Convert(param, null);
     UserGroupDao.Update(newEntity);
 }
Exemplo n.º 7
0
 public void ValidateParameters(UserGroupParam param)
 {
     throw new NotImplementedException();
 }