private void BtnCreateTicket_Click(object sender, EventArgs e) { if (IsValid()) { string title = TxtTitle.Text; DateTime?due = (DtpDueDate.Checked) ? (DateTime?)DtpDueDate.Value : null; Priority priority = (Priority)CboPriorities.SelectedItem; Ticket newTicket = new Ticket(title, due, priority); TicketDB.Create(newTicket); } LoadTickets(); }
private void BtnCreateTicket_Click(object sender, EventArgs e) { if (IsValid()) { string title = TxtTitle.Text; DateTime?due = (DateTime?)DtpDueDate.Value; Priority priority = (Priority)CboPriorities.SelectedItem; Ticket newTicket = new Ticket(title, due, priority); TicketDB.Create(newTicket); FrmAddComment newComment = new FrmAddComment(newTicket); newComment.ShowDialog(); } LoadTickets(); }