Esempio n. 1
0
        public ActionResult ModifyReportRights(string enableReports)
        {
            try
            {
                var studentNo = Session[SessionKeyStudentNo];

                IWebUserService webUserService = new WebUserService();
                webUserService.UpdateReportsRight(enableReports, "Student");

                // 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("Report rights modification done successfully of Student No." + Session[SessionKeyStudentNo]);
                return(View("AdminSettings", userInfo));
            }
            catch (Exception ex)
            {
                logger.Error("Report rights modification failded of Student No." + Session[SessionKeyStudentNo], ex);

                // Redirect to error page
                Response.Redirect("Result/error");
                return(null);
            }
        }
Esempio n. 2
0
        public ActionResult ModifyReportRights(FormCollection collection)
        {
            string enableReports = collection["enableReports"];

            try
            {
                var studentNo = Session[SessionKeyStudentNo];

                IWebUserService webUserService = new WebUserService();
                webUserService.UpdateReportsRight(enableReports, "Student");

                // Get Admin information ...
                WebUser userInfo = GetWebInformation();

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

                logger.Debug("Report rights modification done successfully for Student role. enableReports:" + enableReports);
                return(View("Rights", userInfo));
            }
            catch (Exception ex)
            {
                logger.Error("Report rights modification failded for Student Role. enableReports:" + enableReports, ex);

                // Redirect to error page
                Response.Redirect(AppHelper.SharedUrl("Reply/Error"));
                return(null);
            }
        }