Exemple #1
0
        private void saveData()
        {
            List <DateTime> dates = new List <DateTime>();

            userElement.Exceptions.Clear();
            foreach (DataGridViewRow row in dataGrid.Rows)
            {
                if (row.IsNewRow)
                {
                    continue;
                }
                try {
                    DateTime date    = Convert.ToDateTime(row.Cells[0].Value);
                    int      minutes = Convert.ToInt32(row.Cells[1].Value);
                    if (!dates.Contains(date))
                    {
                        TickExceptionElement exceptionElement = new TickExceptionElement();
                        exceptionElement.Day     = date;
                        exceptionElement.Minutes = minutes;
                        userElement.Exceptions.Add(exceptionElement);
                    }
                }
                catch (Exception) {
                    // Skip this row if empty
                }
            }
            this.DialogResult = DialogResult.OK;
            Close();
        }
Exemple #2
0
 public void Add(TickExceptionElement exceptionElement)
 {
     base.BaseAdd(exceptionElement);
 }
Exemple #3
0
 public void Remove(TickExceptionElement exceptionElement)
 {
     base.BaseRemove(exceptionElement);
 }