static void Main(string[] args) { TrelloAnalog TrelloProgram = new TrelloAnalog(); //AbstractDBProvider dbProvider = new XML(TrelloProgram); AbstractDBProvider dbProvider = new JSON(TrelloProgram); TrelloProgram.StartApp(dbProvider); }
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); }
public XML(TrelloAnalog myProgram) { if (!File.Exists(FilePath)) { CreateXmlFile(); } this.myProgram = myProgram; }
public JSON(TrelloAnalog myProgram) { //if (!File.Exists(FilePath)) //{ // CreateJSONFile(); //} this.myProgram = myProgram; }
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); } }
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); }