Exemplo n.º 1
0
        public BaseResponse <SysManagerUser> editUser(string loginName, ViewModelUserEditReqeust condtion)
        {
            BaseResponse <SysManagerUser> result = new BaseResponse <SysManagerUser>();

            try
            {
                if (!User.IsInRole("admin"))
                {
                    loginName = User.Identity.Name;
                }

                SysManagerUser smu = new SysManagerUser(loginName);
                result.result = smu.saveInfo(condtion);
                result.msg    = "保存成功";
            }
            catch (SysException ex)
            {
                result = ex.getresult(result, true);
            }
            catch (Exception e) {
                result = SysException.getResult(result, e, condtion);
            }

            return(result);
        }
Exemplo n.º 2
0
        public BaseResponse <BaseResponseList <SysExcptionLog> > searchExceptionLog(VMMsgSearchExceptionLogRequest condtion)
        {
            BaseResponse <BaseResponseList <SysExcptionLog> > result = new BaseResponse <BaseResponseList <SysExcptionLog> >();

            try
            {
                result.result = SysExcptionLog.searchLog(condtion);
            }
            catch (Exception e) {
                result = SysException.getResult(result, e, condtion);
            }
            return(result);
        }
Exemplo n.º 3
0
        public BaseResponse <BaseResponseList <SysUserLog> > searchUserLog(ViewModelMsgSearchUserLogReqeust condtion)
        {
            BaseResponse <BaseResponseList <SysUserLog> > result = new BaseResponse <BaseResponseList <SysUserLog> >();

            try
            {
                result.result = SysUserLog.searchLog(condtion);
            }
            catch (Exception e) {
                SysException.getResult(result, e, condtion);
            }
            return(result);
        }
Exemplo n.º 4
0
        public BaseResponse <List <SysCatTree> > getTreelist(string fun)
        {
            BaseResponse <List <SysCatTree> > result = new BaseResponse <List <SysCatTree> >();

            try
            {
                result.result = SysCatTree.getTreeList(fun);
            }
            catch (Exception e) {
                result = SysException.getResult(result, e, fun);
            }
            return(result);
        }
Exemplo n.º 5
0
        public BaseResponse <BaseResponseList <SysManagerUser> > searchUserList(ViewModelSearchUserBaseRequest condtion)
        {
            BaseResponse <BaseResponseList <SysManagerUser> > res = new BaseResponse <BaseResponseList <SysManagerUser> >();

            try
            {
                res.result = SysManagerUser.searchUserList(condtion);
            }
            catch (Exception e) {
                res = SysException.getResult(res, e, condtion);
            }
            return(res);
        }
Exemplo n.º 6
0
        public BaseResponse delCatTree(string Id)
        {
            BaseResponse result = new BaseResponse();

            try
            {
                SysCatTree tree = new SysCatTree(Id);
                tree.delete();
                result.msg = "删除成功";
            }
            catch (Exception e) {
                result = SysException.getResult(result, e, Id);
            }
            return(result);
        }
Exemplo n.º 7
0
        public BaseResponse reSetPwd(string loginName)
        {
            BaseResponse result = new BaseResponse();

            try
            {
                SysManagerUser user = new SysManagerUser(loginName);
                user.reSetPwd();
                result.msg = "重置成功";
            }
            catch (Exception e) {
                result = SysException.getResult(result, e, loginName);
            }
            return(result);
        }
Exemplo n.º 8
0
        public BaseResponse delete(string loginName)
        {
            BaseResponse res = new BaseResponse();

            try
            {
                SysUser user = new SysManagerUser(loginName);
                user.delete();
                res.msg = "删除成功";
            }
            catch (Exception e) {
                res = SysException.getResult(res, e, loginName);
            }
            return(res);
        }
Exemplo n.º 9
0
        public BaseResponse setDisable(string loginName, ViewModelSetUserDisable condtion)
        {
            BaseResponse result = new BaseResponse();

            try
            {
                SysManagerUser user = new SysManagerUser(loginName);
                user.setDisable(condtion);
                result.msg = "设置成功";
            }
            catch (Exception e) {
                result = SysException.getResult(result, e, condtion);
            }
            return(result);
        }
Exemplo n.º 10
0
        public BaseResponse <SysCatTree> editCatTree(VMTreeEditCatTreeRequest condtion)
        {
            BaseResponse <SysCatTree> result = new BaseResponse <SysCatTree>();

            try
            {
                result.result = SysCatTree.edit(condtion);
                result.msg    = "保存成功";
            }
            catch (SysException ex)
            {
                result = ex.getresult(result);
            }
            catch (Exception e) {
                result = SysException.getResult(result, e, condtion);
            }
            return(result);
        }
Exemplo n.º 11
0
        public BaseResponse <SysManagerUser> createUser(ViewModelUserRegisterRequest condtion)
        {
            BaseResponse <SysManagerUser> result = new BaseResponse <SysManagerUser>();

            try
            {
                result.result = SysManagerUser.create(condtion);
                result.msg    = "保存成功";
            }
            catch (SysException r)
            {
                return(r.getresult(result, true));
            }
            catch (Exception e) {
                return(SysException.getResult(result, e, condtion));
            }
            return(result);
        }
Exemplo n.º 12
0
        public BaseResponse reSetNewPwd(ViewModelChangePwdRequest condtion)
        {
            BaseResponse result = new BaseResponse();

            try
            {
                SysManagerUser user = new SysManagerUser(User.Identity.Name);
                user.reSetNewPwd(condtion);
                result.msg = "密码修改成功";
            }
            catch (SysException ex) {
                result = ex.getresult(result, true);
            }
            catch (Exception e)
            {
                result = SysException.getResult(result, e, condtion);
            }
            return(result);
        }
Exemplo n.º 13
0
        public BaseResponse <SysManagerUser> login(ViewModelLoginReqeust condtion)
        {
            BaseResponse <SysManagerUser> result = new BaseResponse <SysManagerUser>();

            try
            {
                Thread.Sleep(500);
                result.result = SysManagerUser.checkLogin(condtion);
                FormsAuthentication.SetAuthCookie(result.result.loginName, true);
                result.msg = "登录成功";
            }
            catch (SysException ex)
            {
                result = ex.getresult(result, true);
            }
            catch (Exception e) {
                result = SysException.getResult(result, e, condtion);
            }
            return(result);
        }