Пример #1
0
        // GET: GroupSetup
        /// <summary>
        /// Startpunkt für den GroupSetup-View, UserSession-Abfrage, Gruppenliste von der BL abfragen, Model initialisieren und an View senden.
        /// </summary>
        /// <returns>GroupSetupModel</returns>
        public ActionResult Index()
        {
            try
            {
                //User-Session-Informationen abrufen.
                UserSession us = (UserSession)Session["UserSession"];

                //Model initialisieren.
                GroupSetupModel gsm = new GroupSetupModel();
                gsm.GroupSetupList = new List<fn_show_lampgroups_Result>();

                //Liste für Ausgabe initialisieren.
                List<fn_show_lampgroups_Result> slr = HicsBL.DbAccess.GetAllLampGroups(us.name, us.pw);

                //Liste invertiert sortieren.
                for (int i = slr.Count - 1; i >= 0; i--)
                {
                    gsm.GroupSetupList.Add(slr[i]);
                }
            
                return View(gsm);
            }
            catch (Exception)
            {
                return RedirectToAction("Login", "Login");
            }

        }
Пример #2
0
        public ActionResult AddGroup(GroupSetupModel gsm)
        {
            //User-Session-Informationen abrufen.
            UserSession us = (UserSession)Session["UserSession"];

            HicsBL.DbAccess.addLampGroup(us.name, us.pw, gsm.Groupname);
            return RedirectToAction("index");
        }