Exemple #1
0
        public JsonResult Login(string strLoginName, string strPwd)
        {
            try
            {
                Sys_User user = _sysUserBLL.LoginByUserInfo(strLoginName, strPwd);
                msg = user != null ? new MessageModel() { MessageType = MessageType.Success, Messages = "用户注册成功!" } : new MessageModel() { MessageType = MessageType.Fail, Messages = "用户注册失败!" };
            }
            catch (Exception)
            {
                msg = new MessageModel() { Messages = "用户注册发生异常,请联系管理员!", MessageType = MessageType.Fail };
            }

            return Json(msg, JsonRequestBehavior.AllowGet);
        }
Exemple #2
0
        public JsonResult PostForum(Forum model)
        {
            bool isSuccess = false;
            try
            {
                isSuccess = _forumBLL.AddForum(model);
                msg = isSuccess == true ? new MessageModel() { MessageType = MessageType.Success, Messages = "发布帖子成功!" } : new MessageModel() { MessageType = MessageType.Fail, Messages = "发布帖子失败!" };
            }
            catch (Exception)
            {
                msg = new MessageModel() { Messages = "发布帖子发生异常,请联系管理员!", MessageType = MessageType.Fail };
            }

            return Json(msg, JsonRequestBehavior.AllowGet);
        }
Exemple #3
0
        public JsonResult RegisterUser(Sys_User model)
        {
            bool isSuccess = false;
            try
            {
                model.UserId = Guid.NewGuid();
                model.RegistTime = DateTime.Now;
                isSuccess = _sysUserBLL.AddUser(model);
                msg = isSuccess == true ? new MessageModel() { MessageType = MessageType.Success, Messages = "用户注册成功!" } : new MessageModel() { MessageType = MessageType.Fail, Messages = "用户注册失败!" };
            }
            catch (Exception)
            {
                msg = new MessageModel() { Messages = "用户注册发生异常,请联系管理员!", MessageType = MessageType.Fail };
            }

            return Json(msg, JsonRequestBehavior.AllowGet);
        }