コード例 #1
0
        public ActionResult Sitzung(int id)
        {
            if (_SessionContext == null)
            {
                return(Redirect(FormsAuthentication.LoginUrl));
            }
            var value = UserIniHelper.GetValue(_SessionContext.Shortname, "SIT", "Sitzung", "CanDownloadAll");

            ViewBag.CanDownloadAll = !string.IsNullOrEmpty(value) && value == "1";
            var model = new SitzungViewModel(_Entities, id, _SessionContext.SysUsrId); //added BenutzerId, 10.2

            return(View(model));
        }
コード例 #2
0
        public ActionResult Home()
        {
            _Logger.Info("Home");
            if (_SessionContext == null)
            {
                _Logger.Info("_SessionContext is null");
                //return Redirect(FormsAuthentication.LoginUrl);
                return(RedirectToAction("LogOff", "Home"));
            }
            ViewBag.S = _SessionContext.HasModule("S");
            ViewBag.K = _SessionContext.HasModule("K");
            ViewBag.A = _SessionContext.HasModule("A");
            ViewBag.V = _SessionContext.HasModule("V");
            ViewBag.E = _SessionContext.HasModule("E");
            ViewBag.G = _SessionContext.HasModule("G");

            var value             = UserIniHelper.GetValue(_SessionContext.Shortname, "GES", "Sitzung", "IgnoreWebFreigabe");
            var ignoreWebFreigabe = !string.IsNullOrEmpty(value) && value == "1";

            var model = new SitzungenViewModel(_Entities, _SessionContext.SysUsrId, _SessionContext.GremiumListe, ignoreWebFreigabe);

            return(View(model));
        }
コード例 #3
0
        protected override void Initialize(RequestContext requestContext)
        {
            base.Initialize(requestContext);
            _SessionContext = (HomeViewModel)Session["SessionContext"];
            var value = UserIniHelper.GetValue(_SessionContext.Shortname, "AFG", "Tasks", "CanSeeAllTasks");

            _CanSeeAllTasks = !string.IsNullOrEmpty(value) && value == "1";
            _Entities       = new BehoerdenloesungEntities();
            if (Session["statusList"] == null)
            {
                var q1 = from x in CodeArten.GESAufgabeStatCodes
                         select new ComboBoxItem <int>()
                {
                    Value = (int)x.ID,
                    Text  = x.BEZ
                };
                Session["statusList"] = q1.ToList();
            }
            if (Session["prioritaetList"] == null)
            {
                var q2 = from x in CodeArten.GESAufgabePrioCodes
                         select new ComboBoxItem <int>()
                {
                    Value = (int)x.ID,
                    Text  = x.BEZ
                };
                Session["prioritaetList"] = q2.ToList();
            }
            if (Session["filterList"] == null)
            {
                var liste = new List <ComboBoxItem <int> >();
                liste.Add(new ComboBoxItem <int>()
                {
                    Value = -1, Text = "Meine"
                });
                liste.Add(new ComboBoxItem <int>()
                {
                    Value = 0, Text = "Alle"
                });
                foreach (var g in _SessionContext.GremiumListe)
                {
                    liste.Add(new ComboBoxItem <int>()
                    {
                        Value = (int)g.TbBHDGremium_id, Text = g.Bezeichnung
                    });
                }
                ;
                Session["filterList"] = liste;
            }
            if (Session["artListAfg"] == null)
            {
                var q3 = from x in CodeArten.AFGInternArt
                         select new ComboBoxItem <int>()
                {
                    Value = (int)x.ID,
                    Text  = x.BEZ
                };
                Session["artListAfg"] = q3.ToList();
            }
            if (Session["sachbearbeiterList"] == null)
            {
                var q4 = from x in _Entities.TbSysUSRs
                         orderby x.Name
                         select new ComboBoxItem <int>()
                {
                    Value = (int)x.ID,
                    Text  = x.Name
                };
                Session["sachbearbeiterList"] = q4.ToList();
            }
            ViewData["statusList"]     = Session["statusList"];
            ViewData["prioritaetList"] = Session["prioritaetList"];
            ViewData["filterList"]     = Session["filterList"];
            if (Session["filter"] == null)
            {
                Session["filter"] = -1; // -1: nur meine, 0: alle, > 0: gremium_id
            }
            ViewData["artListAfg"]         = Session["artListAfg"];
            ViewData["sachbearbeiterList"] = Session["sachbearbeiterList"];
        }