コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }