예제 #1
0
 public MResultModel AdminLogin(LoginInModel model)
 {
     try
     {
         if (VerificationImageCode(model.ValidateCode))
         {
             LoginOutModel resM = _bll.Login(model.UserName, model.Password);
             if (resM != null)
             {
                 return(MResultModel <LoginOutModel> .GetSuccessResultM(resM, "登录成功"));
             }
             else
             {
                 return(MResultModel.GetFailResultM("登录失败,用户名或者密码错误"));
             }
         }
         else
         {
             return(MResultModel.GetFailResultM("登录失败,验证码错误"));
         }
     }
     catch (ApplicationException ex)
     {
         return(MResultModel.GetFailResultM(ex.Message));
     }
 }
 public MResultModel SavePermissions(SavePermissionsInModel model)
 {
     try
     {
         _bll.SavePermissions(model.UserGroupID, model.PermissionsIDs);
         return(MResultModel.GetSuccessResultM("保存成功"));
     }
     catch (ArgumentException ex)
     {
         return(MResultModel.GetFailResultM(ex.Message));
     }
 }
예제 #3
0
 public MResultModel EditPermissions(EditPermissionsInModel model)
 {
     try
     {
         _bll.Update(model);
         return(MResultModel.GetSuccessResultM("修改成功"));
     }
     catch (ArgumentException ex)
     {
         return(MResultModel.GetFailResultM(ex.Message));
     }
 }
예제 #4
0
 public MResultModel AddUser(EditUserInModel model)
 {
     try
     {
         _bll.Add(model);
         return(MResultModel.GetSuccessResultM("添加成功"));
     }
     catch (ArgumentException ex)
     {
         return(MResultModel.GetFailResultM(ex.Message));
     }
 }
예제 #5
0
 public MResultModel DeleteUser(DeleteInModel model)
 {
     try
     {
         _bll.Delete(model.ID);
         return(MResultModel.GetSuccessResultM("删除成功"));
     }
     catch (ArgumentException ex)
     {
         return(MResultModel.GetFailResultM(ex.Message));
     }
 }
예제 #6
0
 public MResultModel GetEnablePermissionsInfoByUserGroupID(Guid UserGroupID)
 {
     try
     {
         List <PermissionsGroupModel> resM = _bll.GetEnablePermissionsInfoByUserGroupID(UserGroupID);
         return(MResultModel <List <PermissionsGroupModel> > .GetSuccessResultM(resM, "查询成功"));
     }
     catch (ArgumentException ex)
     {
         return(MResultModel.GetFailResultM(ex.Message));
     }
 }
예제 #7
0
 public MResultModel ChangeRank(ChangeRankInModel model)
 {
     try
     {
         _bll.ChangeRank(model.ID, model.TargetID);
         return(MResultModel.GetSuccessResultM("更改成功"));
     }
     catch (ArgumentException ex)
     {
         return(MResultModel.GetFailResultM(ex.Message));
     }
 }
예제 #8
0
        public MResultModel DeleteClassInfo(DeleteModel inputM)
        {
            MResultModel resM;

            try
            {
                _classListBLL.DeleteClassInfo(inputM.ID);
                resM = MResultModel.GetSuccessResultM("删除成功");
            }
            catch (ArgumentNullException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            return(resM);
        }
예제 #9
0
        public MResultModel GetAnswerSheetResultInfoByID(Guid ID)
        {
            MResultModel resM;

            try
            {
                AnswerSheetResultModel asrM = _answerSheetBLL.GetAnswerSheetResultInfoByID(ID);
                resM = MResultModel <AnswerSheetResultModel> .GetSuccessResultM(asrM, "查询成功");
            }
            catch (ArgumentException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            return(resM);
        }
예제 #10
0
        public MResultModel Login(LoginModel inputM)
        {
            MResultModel resM;
            V_User       model = _userBLL.Login(inputM);

            if (model != null)
            {
                resM = MResultModel <V_User> .GetSuccessResultM(model, "登录成功");
            }
            else
            {
                resM = MResultModel.GetFailResultM("登录失败,用户名或者密码错误");
            }
            return(resM);
        }
예제 #11
0
 public MResultModel EditMyPassword(EditPasswordInModel model)
 {
     try
     {
         _bll.EditMyPassword(model.ID, model.OldPassword, model.NewPassword, model.LoginUserID);
         return(MResultModel.GetSuccessResultM("修改成功"));
     }
     catch (ArgumentException ex)
     {
         return(MResultModel.GetFailResultM(ex.Message));
     }
     catch (ApplicationException ex)
     {
         return(MResultModel.GetFailResultM(ex.Message));
     }
 }
예제 #12
0
 public MResultModel RemoveUserGroup(EditUserGroupUserInModel model)
 {
     try
     {
         _bll.RemoveUserGroup(model.UserID, model.UserGroupID);
         return(MResultModel.GetSuccessResultM("移除成功"));
     }
     catch (ArgumentException ex)
     {
         return(MResultModel.GetFailResultM(ex.Message));
     }
     catch (ApplicationException ex)
     {
         return(MResultModel.GetFailResultM(ex.Message));
     }
 }
예제 #13
0
 public MResultModel UpdateMyInfo(EditUserInModel model)
 {
     try
     {
         _bll.UpdateMyInfo(model, model.LoginUserID);
         return(MResultModel.GetSuccessResultM("修改成功"));
     }
     catch (ArgumentException ex)
     {
         return(MResultModel.GetFailResultM(ex.Message));
     }
     catch (ApplicationException ex)
     {
         return(MResultModel.GetFailResultM(ex.Message));
     }
 }
예제 #14
0
        public MResultModel AddProblemInfo(EditProblemModel inputM)
        {
            MResultModel resM;

            try
            {
                _problemBLL.AddProblemInfo(inputM, inputM.Answers);
                resM = MResultModel.GetSuccessResultM("添加成功");
            }
            catch (ArgumentNullException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            catch (ArgumentException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            return(resM);
        }
예제 #15
0
        public MResultModel EditClassInfo(EditClassModel inputM)
        {
            MResultModel resM;

            try
            {
                _classListBLL.EditClassInfo(inputM);
                resM = MResultModel.GetSuccessResultM("修改成功");
            }
            catch (ArgumentNullException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            catch (ArgumentException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            return(resM);
        }
예제 #16
0
        public MResultModel ChangeClassRank(ChangeClassRankModel inputM)
        {
            MResultModel resM;

            try
            {
                _classListBLL.ChangeClassRank(inputM.ClassID, inputM.TargetClassID);
                resM = MResultModel.GetSuccessResultM("调换成功");
            }
            catch (ArgumentNullException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            catch (ArgumentException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            return(resM);
        }
예제 #17
0
        public MResultModel AddPaperInfo(EditPaperModel inputM)
        {
            MResultModel resM;

            try
            {
                _paperBLL.AddPaperInfo(inputM);
                resM = MResultModel.GetSuccessResultM("添加成功");
            }
            catch (ArgumentNullException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            catch (ArgumentException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            return(resM);
        }
예제 #18
0
        public MResultModel SubmitAnswerSheet(AnswerSheetSubmitModel inputM)
        {
            MResultModel resM;

            try
            {
                inputM.StudentName = HttpUtility.UrlDecode(inputM.StudentName);
                Guid ID = _answerSheetBLL.SubmitAnswerSheet(inputM);
                resM = MResultModel <Guid> .GetSuccessResultM(ID, "提交成功");
            }
            catch (ArgumentNullException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            catch (ArgumentException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            return(resM);
        }
예제 #19
0
        public MResultModel ChangePassword(EditPasswordModel inputM)
        {
            MResultModel resM;

            try
            {
                _userBLL.ChangePassword(inputM.ID, inputM.OldPassword, inputM.NewPassword);
                resM = MResultModel.GetSuccessResultM("修改成功");
            }
            catch (ApplicationException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            catch (ArgumentNullException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            catch (ArgumentException ex)
            {
                resM = MResultModel.GetFailResultM(ex.Message);
            }
            return(resM);
        }