private void AddNewProgram_Click(object sender, EventArgs e) { var models = WorkWithText.GetAllTeleprograms(); models.Add(ReadFromForm()); WorkWithText.SaveProgram(models); this.Close(); }
public void DeleteProgram(ICollection <TeleprogramModel> models) { var nonExpiredPrograms = new List <TeleprogramModel>(); foreach (var teleprogramModel in models) { if (WorkWithText.GetDateFromString(teleprogramModel.Date) >= DateTime.Today) { nonExpiredPrograms.Add(teleprogramModel); } } WorkWithText.SaveProgram(nonExpiredPrograms); }
private void SaveFavourites_Click(object sender, EventArgs e) { WorkWithText.SaveProgram(models.Where(x => x.isSaved == true).ToList(), SavedProgramsLocation); }
private void Month_Click(object sender, EventArgs e) { MainGrid.DataSource = helper.GetProgramsForMonth(models); WorkWithText.SaveProgram(models); }
private void ViewAll_Click(object sender, EventArgs e) { MainGrid.DataSource = models; WorkWithText.SaveProgram(models); }
private void PinButton_Click(object sender, EventArgs e) { MainGrid.DataSource = models.Where(x => x.isSaved == true).ToList(); WorkWithText.SaveProgram(models); }