Ejemplo n.º 1
0
        /// <summary>
        /// Change the data set from default to demo, to ut etc.
        /// </summary>
        /// <returns></returns>
        // GET: Settings
        public ActionResult DataSourceSet(string id = null)
        {
            var CurrentId = DataSourceBackend.Instance.IdentityBackend.GetCurrentStudentID(HttpContext);

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

            if (string.IsNullOrEmpty(id))
            {
                return(RedirectToAction("Index", "Support"));
            }

            DataSourceDataSetEnum SetEnum = DataSourceDataSetEnum.Default;

            switch (id)
            {
            case "Default":
                SetEnum = DataSourceDataSetEnum.Default;
                break;

            case "Demo":
                SetEnum = DataSourceDataSetEnum.Demo;
                break;

            case "UnitTest":
                SetEnum = DataSourceDataSetEnum.UnitTest;
                break;
            }

            DataSourceBackend.Instance.SetDataSourceDataSet(SetEnum);

            return(RedirectToAction("Index", "Support"));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Change the data set from default to demo, to ut etc.
        /// </summary>
        /// <returns></returns>
        // GET: Settings
        public ActionResult DataSourceSet(string id = null)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(RedirectToAction("Index", "Admin"));
            }

            DataSourceDataSetEnum SetEnum = DataSourceDataSetEnum.Default;

            switch (id)
            {
            case "Default":
                SetEnum = DataSourceDataSetEnum.Default;
                break;

            case "Demo":
                SetEnum = DataSourceDataSetEnum.Demo;
                break;

            case "UnitTest":
                SetEnum = DataSourceDataSetEnum.UnitTest;
                break;
            }

            DataSourceBackend.Instance.SetDataSourceDataSet(SetEnum);

            return(RedirectToAction("Index", "Admin"));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Change between demo, default, and UT data sets
        /// </summary>
        /// <param name="SetEnum"></param>
        public void SetDataSourceDataSet(DataSourceDataSetEnum SetEnum)
        {
            SchoolDismissalSettingsBackend.SetDataSourceDataSet(SetEnum);
            SchoolCalendarBackend.SetDataSourceDataSet(SetEnum);
            ShopInventoryBackend.SetDataSourceDataSet(SetEnum);

            // Avatar must be reset before Student, because Student needs the default avatarID
            AvatarBackend.SetDataSourceDataSet(SetEnum);
            StudentBackend.SetDataSourceDataSet(SetEnum);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Change between demo, default, and UT data sets
        /// </summary>
        /// <param name="SetEnum"></param>
        public void SetDataSourceDataSet(DataSourceDataSetEnum SetEnum)
        {
            // Avatar must be reset before Student, because Student needs the default avatar

            AvatarItemBackend.SetDataSourceDataSet(SetEnum);
            KioskSettingsBackend.SetDataSourceDataSet(SetEnum);

            SchoolDismissalSettingsBackend.SetDataSourceDataSet(SetEnum);

            StudentBackend.SetDataSourceDataSet(SetEnum);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Change between demo, default, and UT data sets
        /// </summary>
        /// <param name="SetEnum"></param>
        public static void SetDataSourceDataSet(DataSourceDataSetEnum SetEnum)
        {
            // Remember the Settigns
            SystemGlobalsModel.SetDataSourceDataSetEnum(SetEnum);

            // Add YourName Below Here #4, at the top of the stack, not the bottom
            //RoleBackend.SetDataSourceDataSet(SetEnum);
            //UserBackend.SetDataSourceDataSet(SetEnum);

            // Call for Navigation to reset to rebuild the cache
            //NavigationHelper.ResetCache();
        }
Ejemplo n.º 6
0
        public void Models_DataSourceDataSetEnumUnitTests_Values_Should_Pass()
        {
            // Assert

            // Make sure there are no additional values
            var enumCount = DataSourceDataSetEnum.GetNames(typeof(DataSourceDataSetEnum)).Length;

            Assert.AreEqual(3, enumCount, TestContext.TestName);

            // Check each value against their expected value.
            Assert.AreEqual(2, (int)DataSourceDataSetEnum.UnitTest, TestContext.TestName);
            Assert.AreEqual(1, (int)DataSourceDataSetEnum.Demo, TestContext.TestName);
            Assert.AreEqual(0, (int)DataSourceDataSetEnum.Default, TestContext.TestName);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Change between demo, default, and UT data sets
 /// </summary>
 /// <param name="SetEnum"></param>
 public void SetDataSourceDataSet(DataSourceDataSetEnum SetEnum)
 {
     ExampleBackend.SetDataSourceDataSet(SetEnum);
     PhotoBackend.SetDataSourceDataSet(SetEnum);
     ClinicBackend.SetDataSourceDataSet(SetEnum);
     ResultLogBackend.SetDataSourceDataSet(SetEnum);
     ResultDataBackend.SetDataSourceDataSet(SetEnum);
     PhoneBackend.SetDataSourceDataSet(SetEnum);
     TechnicianBackend.SetDataSourceDataSet(SetEnum);
     InventoryBackend.SetDataSourceDataSet(SetEnum);
     VersionOSBackend.SetDataSourceDataSet(SetEnum);
     VersionAppBackend.SetDataSourceDataSet(SetEnum);
     HistoryOSBackend.SetDataSourceDataSet(SetEnum);
     HistoryAppBackend.SetDataSourceDataSet(SetEnum);
     // Add YourName Above Here #4
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Change between demo, default, and UT data sets
        /// </summary>
        /// <param name="SetEnum"></param>
        public void SetDataSourceDataSet(DataSourceDataSetEnum SetEnum)
        {
            // Avatar must be reset before Student, because Student needs the default avatar

            AvatarItemBackend.SetDataSourceDataSet(SetEnum);
            FactoryInventoryBackend.SetDataSourceDataSet(SetEnum);

            GameBackend.SetDataSourceDataSet(SetEnum);
            KioskSettingsBackend.SetDataSourceDataSet(SetEnum);

            SchoolDismissalSettingsBackend.SetDataSourceDataSet(SetEnum);
            SchoolCalendarBackend.SetDataSourceDataSet(SetEnum);

            IdentityBackend.SetDataSourceDataSet(SetEnum);

            StudentBackend.SetDataSourceDataSet(SetEnum);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Set which data to load
        /// </summary>
        /// <param name="setEnum"></param>
        public void LoadDataSet(DataSourceDataSetEnum setEnum)
        {
            switch (setEnum)
            {
            case DataSourceDataSetEnum.Demo:
                DataSetDemo();
                break;

            case DataSourceDataSetEnum.UnitTest:
                DataSetUnitTest();
                break;

            case DataSourceDataSetEnum.Default:
            default:
                DataSetDefault();
                break;
            }
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Switch the data set between Demo, Default and Unit Test
 /// </summary>
 /// <param name="SetEnum"></param>
 public static void SetDataSourceDataSet(DataSourceDataSetEnum SetEnum)
 {
     DataSource.LoadDataSet(SetEnum);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Switch the data set between Demo, Default and Unit Test
 /// </summary>
 /// <param name="SetEnum">The type of data running.</param>
 public static void SetDataSourceDataSet(DataSourceDataSetEnum SetEnum)
 {
     repository.LoadDataSet(SetEnum);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Switch the data set between Demo, Default and Unit Test
 /// </summary>
 /// <param name="SetEnum"></param>
 public static void SetDataSourceDataSet(DataSourceDataSetEnum SetEnum)
 {
     StudentDataSourceMock.Instance.LoadDataSet(SetEnum);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Change between demo, default, and UT data sets
 /// </summary>
 /// <param name="SetEnum"></param>
 public void SetDataSourceDataSet(DataSourceDataSetEnum SetEnum)
 {
     // Avatar must be reset before Student, because Student needs the default avatarID
     AvatarBackend.SetDataSourceDataSet(SetEnum);
     StudentBackend.SetDataSourceDataSet(SetEnum);
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Sets the Data Source Set Enum (Unit Test, demo etc.)
 /// </summary>
 /// <param name="SetDataSourceValue"></param>
 public static void SetDataSourceDataSetEnum(DataSourceDataSetEnum SetDataSourceDataSetValue)
 {
     _DataSourceDataSetValue = SetDataSourceDataSetValue;
 }
 /// <summary>
 /// Switch the data set between Demo, Default and Unit Test
 /// </summary>
 /// <param name="SetEnum"></param>
 public static void SetDataSourceDataSet(DataSourceDataSetEnum SetEnum)
 {
     ShopInventoryDataSourceMock.Instance.LoadDataSet(SetEnum);
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Change between demo, default, and UT data sets
 /// </summary>
 /// <param name="SetEnum"></param>
 public void SetDataSourceDataSet(DataSourceDataSetEnum SetEnum)
 {
     StudentBackend.SetDataSourceDataSet(SetEnum);
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Switch the data set between Demo, Default and Unit Test
 /// </summary>
 /// <param name="SetEnum"></param>
 public static void SetDataSourceDataSet(DataSourceDataSetEnum SetEnum)
 {
     SchoolCalendarDataSourceMock.Instance.LoadDataSet(SetEnum);
 }