Пример #1
0
        private void AddNewProgram_Click(object sender, EventArgs e)
        {
            var models = WorkWithText.GetAllTeleprograms();

            models.Add(ReadFromForm());
            WorkWithText.SaveProgram(models);
            this.Close();
        }
Пример #2
0
        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);
        }
Пример #3
0
 private void SaveFavourites_Click(object sender, EventArgs e)
 {
     WorkWithText.SaveProgram(models.Where(x => x.isSaved == true).ToList(), SavedProgramsLocation);
 }
Пример #4
0
 private void Month_Click(object sender, EventArgs e)
 {
     MainGrid.DataSource = helper.GetProgramsForMonth(models);
     WorkWithText.SaveProgram(models);
 }
Пример #5
0
 private void ViewAll_Click(object sender, EventArgs e)
 {
     MainGrid.DataSource = models;
     WorkWithText.SaveProgram(models);
 }
Пример #6
0
 private void PinButton_Click(object sender, EventArgs e)
 {
     MainGrid.DataSource = models.Where(x => x.isSaved == true).ToList();
     WorkWithText.SaveProgram(models);
 }