Ejemplo n.º 1
0
        public ActionResult ChangeLoginMsg(string txtChangeLoginMsg)
        {
            try
            {
                IWebUserService webUserService = new WebUserService();

                var studentNo = Session[SessionKeyStudentNo];

                webUserService.UpdateLoginMsg(txtChangeLoginMsg);

                // Get Admin information ...
                WebUser userInfo = webUserService.GetUserInfo(int.Parse(studentNo.ToString()));
                userInfo.WelcomeMsg        = webUserService.GetWelcomeMsgText();
                userInfo.RoleReportsRights = webUserService.GetRoleRights("Student");
                userInfo.LoginMsg          = webUserService.GetLoginMsgText();

                ViewData["editOption"] = "NN";
                // Record is updated.
                ViewData["successMsg"] = "1";

                logger.Info("Welcome message changed successfully of Student No." + Session[SessionKeyStudentNo]);
                return(View("AdminSettings", userInfo));
            }
            catch (Exception ex)
            {
                logger.Error("Welcome message not changed of Student No." + Session[SessionKeyStudentNo], ex);

                // Redirect to error page
                Response.Redirect("Result/error");
                return(null);
            }
        }