private void AddConclusion(conclusionClass conCl) { if (conclusionList.Count <= 9) { //conclusionClass conCl = new conclusionClass() { ID = conclusionID, Name = name, Amount = amount, Date = date }; conclusionList.Add(conCl); List<conclusionClass> conclSortedList = conclusionList.OrderBy(o => o.Date).ToList(); conclusionList.Clear(); conclusionDataGrid.Items.Clear(); foreach (conclusionClass conclusionCl in conclSortedList) { conclusionList.Add(conclusionCl); conclusionDataGrid.Items.Add(conclusionCl); } conclusionLabelCount.Content = conclusionList.Count() + " OF 10"; } else { MessageBox.Show("Maximum entries in CONCLUSION reached!"); } }
private void AddConclusion(int id, string name, string amount, DateTime date, string attachment, bool increment) { if (conclusionList.Count <= 9) { conclusionClass conCl = new conclusionClass() { ID = id, Name = name, Amount = amount, Date = date, Attachment = attachment }; conclusionList.Add(conCl); List<conclusionClass> conclSortedList = conclusionList.OrderBy(o => o.Date).ToList(); conclusionList.Clear(); conclusionDataGrid.Items.Clear(); foreach (conclusionClass conclusionCl in conclSortedList) { conclusionList.Add(conclusionCl); conclusionDataGrid.Items.Add(conclusionCl); } conclusionLabelCount.Content = conclusionList.Count() + " OF 10"; if (increment) conclusionID++; } else { MessageBox.Show("Maximum entries in CONCLUSION reached!"); } }