Example #1
0
        //TODO Заглушка для Dependency Inversion
        public void DI()
        {
            //Repo = new Data.DataRepository();
            //Repo.Init(new string[] { @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=C:\USERS\СЕРГЕЙ\DOCUMENTS\ESPROJECT\ESPROJECT\BIN\DEBUG\BD4.MDF;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" });

            Repo = new MockDataBase.MockRepository();
            Repo.Init(null);
            Factors = new List<FactorSettings>();

            AllocConsole();
            loggingService = new NLogLoggingService();

            //storage = DataConvertor.ConvertData(Repo.GetTeachers(), Repo.GetStudentsGroups(), Repo.GetClassRoomsTypes(), Repo.GetClassRooms(), Repo.GetStudentsClasses());
            storage = CurrentBase.EStorage;

            vip = new Setting(storage, storage.Classes);
            loggingService.Info("Загружены данные");
        }
Example #2
0
        public static EntityStorage CreateEntityStorage(IRepository repo, string[] connectionStrings)
        {
            EntityStorage storage;
            try
            {
                repo.Init(connectionStrings);

                List<DBTeacher> teachers = repo.GetTeachers().ToList();
                List<DBStudentSubGroup> groups = repo.GetStudentsGroups().ToList();
                List<DBClassRoomType> roomTypes = repo.GetClassRoomsTypes().ToList();
                List<DBClassRoom> rooms = repo.GetClassRooms().ToList();
                List<DBStudentsClass> classes = repo.GetStudentsClasses().ToList();

                storage = MandarinCore.DataConvertor.ConvertData(teachers, groups, roomTypes, rooms, classes);
            }
            catch (Exception ex)
            {
                throw;
            }

            return storage;
        }