private static void Main() { List <Event> events = null; IEnumerable<Footballer> footballers = null; try { var repo = new FootballersRepository(); footballers = repo.GetAll(out events); } catch (Exception e) { MessageBox.Show(string.Format("Error retrieving footballer details:{0}Message: {1}", Environment.NewLine, e.Message)); } if (footballers != null) { var mapper = new FootballMapper(); var footballersDataTable = mapper.MapFootballers(footballers); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm(footballersDataTable,events)); } }
public void AuthenticateUser(string username, string password) { FootballersRepository footballersRepository = new FootballersRepository(); LoggedUser = footballersRepository.GetAll().Where(item => item.Username == username && item.Password == password).FirstOrDefault(); if (LoggedUser != null) { return; } RefereesRepository refereesRepository = new RefereesRepository(); LoggedUser = refereesRepository.GetAll().Where(item => item.Username == username && item.Password == password).FirstOrDefault(); }
public ActionResult Index(FootballersIndexVM model) { model.Footballers = footballersRepository.GetAll(); model.Teams = teamsRepository.GetAll(); return(View(model)); }