private void coupleWordButton_Click(object sender, EventArgs e) { PersonStatistic personStatistic = person.StatisticsToday(); FindAFewWords findAFewWords = new FindAFewWords(person.SectionSearch(sectionStorageListBox.SelectedItem.ToString()).Words, personStatistic, 1); findAFewWords.ShowDialog(); person.SaveStatistic(person.PersonStatistics); }
public FindAFewWords(List <Word> words, PersonStatistic personStatistic, int operationMode) { InitializeComponent(); this.setWord = new List <Word>(words); this.operationMode = operationMode; this.PersonStatistics = personStatistic; this.Buttons = new Button[] { activeButton1, activeButton2, activeButton3, activeButton4, activeButton5, activeButton6, activeButton7, activeButton8, activeButton9, activeButton10, activeButton11, activeButton12, activeButton13, activeButton14, activeButton15, activeButton16 }; FillButton(); statisticVariableLabel1.Text = "0"; }
public PersonStatistic StatisticsToday() { if (this.PersonStatistics.Find(u => u.DateStatistics.Date == System.DateTime.Now.Date) == null) { PersonStatistic personStatistic = new PersonStatistic(); personStatistic.DateStatistics = System.DateTime.Now.Date; PersonStatistics.Add(personStatistic); } return(PersonStatistics[PersonStatistics.FindIndex(u => u.DateStatistics.Date == System.DateTime.Now.Date)]); }