コード例 #1
0
        // GET: Reporter Messages
        public ActionResult Settings(int?id)
        {
            user user = (user)Session[ECGlobalConstants.CurrentUserMarcker];

            if (user == null || user.id == 0 || user.role_id == 4 || user.role_id == 5 || user.role_id == 6 || user.role_id == 7)
            {
                return(RedirectToAction("Index", "Account"));
            }

            //    ViewBag.user_id = id.Value; // 167-171
            id = user.id;

            if ((!id.HasValue) || (id.Value == 0))
            {
                return(RedirectToAction("Index", "Account"));
            }

            #region EC-CC Viewbag
            ViewBag.is_cc = is_cc;
            string cc_ext = "";
            if (is_cc)
            {
                cc_ext = "_cc";
            }
            ViewBag.cc_extension = cc_ext;
            #endregion



            ViewBag.user_id = id.Value; // 167-171

            UserModel um        = new UserModel(id.Value);
            int       report_id = um._reporter_report_id;
            ViewBag.report_id = report_id;
            ReportModel      rm         = new ReportModel(report_id);//same as activity on bottom.
            CompanyModel     cm         = new CompanyModel(rm._report.company_id);
            string           anon_level = "";
            List <anonymity> list_anon  = cm.GetAnonymities(rm._report.company_id, 0).Where(t => t.id == rm._report.incident_anonymity_id).ToList();
            foreach (anonymity _anon in list_anon)
            {
                anon_level = string.Format(_anon.anonymity_company_en, rm.CompanyName());
            }
            Session["incidentAnonymity"] = list_anon[0].id;
            ViewBag.anon_level           = anon_level;
            //ViewBag.notification_new_reports_flag = user.notification_new_reports_flag;
            return(View(rm._reporter_user));
        }