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

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

            TrelloProgram.StartApp(dbProvider);
        }
示例#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);
        }
示例#3
0
        public XML(TrelloAnalog myProgram)
        {
            if (!File.Exists(FilePath))
            {
                CreateXmlFile();
            }

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

            this.myProgram = myProgram;
        }
示例#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);
            }
        }
示例#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);
        }