Beispiel #1
0
        /// <summary>
        /// Read information on a single KioskSettings
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        // GET: KioskSettings/Details/5
        public ActionResult Read(string id = null)
        {
            var CurrentId = DataSourceBackend.Instance.IdentityBackend.GetCurrentStudentID(HttpContext);

            if (DataSourceBackend.Instance.IdentityBackend.BlockExecptForRole(CurrentId, UserRoleEnum.TeacherUser))
            {
                return(RedirectToAction("Login", "Admin"));
            }

            var myData = KioskSettingsBackend.Read(id);

            if (myData == null)
            {
                // If no ID is passed in, get the first one.
                if (id == null)
                {
                    myData = KioskSettingsBackend.GetDefault();
                }
                if (myData == null)
                {
                    return(RedirectToAction("Error", "Home"));
                }
            }

            return(View(myData));
        }
Beispiel #2
0
        /// <summary>
        /// Read information on a single KioskSettings
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        // GET: KioskSettings/Details/5
        public ActionResult Read(string id = null)
        {
            var CurrentId = id;

            var myData = KioskSettingsBackend.Read(id);

            if (myData == null)
            {
                // If no ID is passed in, get the first one.
                if (id == null)
                {
                    myData = KioskSettingsBackend.GetDefault();
                }
                if (myData == null)
                {
                    return(RedirectToAction("Error", "Home"));
                }
            }

            return(View(myData));
        }