public SingleResponeMessage <UserGroupInfo> Get(int id) { SingleResponeMessage <UserGroupInfo> ret = new SingleResponeMessage <UserGroupInfo>(); try { UserGroupInfo item = UserGroupService.GetInstance().GetDetail(id); if (item == null) { ret.isSuccess = false; ret.err.msgCode = "001"; ret.err.msgString = "no User found"; return(ret); } ret.item = item; ret.isSuccess = true; } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "Internal Error !!!"; ret.err.msgString = ex.ToString(); } return(ret); }
public ActionMessage Patch(int groupID, [FromBody] List <UserGroupPermission> groupPermissions) { ActionMessage ret = new ActionMessage(); ret.isSuccess = true; try { UserGroupService.GetInstance().UpdateListPermission(groupID, groupPermissions); } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "Internal Error !!!"; ret.err.msgString = ex.ToString(); } return(ret); }
public ListResponeMessage <UserGroupPermission> Get(int groupID) { ListResponeMessage <UserGroupPermission> ret = new ListResponeMessage <UserGroupPermission>(); try { ret.isSuccess = true; ret.data = UserGroupService.GetInstance().GetListGroupPermission(groupID); } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "005"; ret.err.msgString = ex.ToString(); } return(ret); }
public ActionMessage Put(string id, [FromBody] UserGroupInfo userGroup) { ActionMessage ret = new ActionMessage(); ret.isSuccess = true; try { UserGroupService.GetInstance().UpdateUserGroup(id, userGroup); } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "Internal Error !!!"; ret.err.msgString = ex.ToString(); } return(ret); }
public ActionMessage UpdateListGroupsOfUser(string userID, [FromBody] List <UserGroupUser> lstGroup) { ActionMessage ret = new ActionMessage(); ret.isSuccess = true; try { UserGroupService.GetInstance().UpdateGroupOfUser(userID, lstGroup); } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "Internal Error !!!"; ret.err.msgString = ex.ToString(); } return(ret); }
public ListResponeMessage <UserGroupInfo> GetListGroupsOfUser(string userID) { ListResponeMessage <UserGroupInfo> ret = new ListResponeMessage <UserGroupInfo>(); try { ret.isSuccess = true; ret.data = UserGroupService.GetInstance().GetListGroupOfUser(userID); } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "005"; ret.err.msgString = ex.ToString(); } return(ret); }
public ActionMessage Delete(string id) { ActionMessage ret = new ActionMessage(); ret.isSuccess = true; try { UserGroupService.GetInstance().DeleteUserGroup(id); } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "Internal Error !!!"; ret.err.msgString = ex.ToString(); } return(ret); }
public ListResponeMessage <UserGroupInfo> GetList([FromQuery] UserGroupCriteria criteria) { ListResponeMessage <UserGroupInfo> ret = new ListResponeMessage <UserGroupInfo>(); try { ret.isSuccess = true; ret.data = UserGroupService.GetInstance().GetList(criteria); ret.totalRecords = UserGroupService.GetInstance().getTotalRecords(criteria); } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "005"; ret.err.msgString = ex.ToString(); } return(ret); }