Beispiel #1
0
        static void Main(string[] args)
        {
            TrelloAnalog TrelloProgram = new TrelloAnalog();

            //AbstractDBProvider dbProvider = new XML(TrelloProgram);
            AbstractDBProvider dbProvider = new JSON(TrelloProgram);

            TrelloProgram.StartApp(dbProvider);
        }
Beispiel #2
0
        public Repository(TrelloAnalog myProgram, AbstractDBProvider dbProvider)
        {
            this.myProgram  = myProgram;
            this.dBProvider = dbProvider;

            Persons   = new PersonRepository(dBProvider);
            Boards    = new BoardRepository(dBProvider, this);
            HomeWorks = new HomeWorkRepository(dBProvider, this);
        }
Beispiel #3
0
        public XML(TrelloAnalog myProgram)
        {
            if (!File.Exists(FilePath))
            {
                CreateXmlFile();
            }

            this.myProgram = myProgram;
        }
Beispiel #4
0
        public JSON(TrelloAnalog myProgram)
        {
            //if (!File.Exists(FilePath))
            //{
            //    CreateJSONFile();
            //}

            this.myProgram = myProgram;
        }
Beispiel #5
0
        public static Person Login(string userName, TrelloAnalog myProgram)
        {
            var allStudent     = myProgram.repository.Persons.Get().ToList();
            var foundedStudent = allStudent.Where(p => p.PersonName == userName.Trim());

            if (foundedStudent.Count() > 0)
            {
                return(foundedStudent.First());
            }
            else
            {
                return(null);
            }
        }
Beispiel #6
0
        public static Person RegisterPerson(string name, TrelloAnalog myProgram, PersonType type, string email)
        {
            Person newStudent = new Person(name, myProgram.repository.Persons.Get().Count() + 1, type, email);

            return(newStudent);
        }