public UserGroupResult Create(UserGroupParam param) { Data.Entity.UserGroup entity = UserGroupParamConverter.Convert(param, null); UserGroupDao.Save(entity); return(UserGroupResultConverter.Convert(entity)); }
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()); }
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()); }
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); } }
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); }
public void ValidateParameters(UserGroupParam param) { throw new NotImplementedException(); }