private void btnEditPro_Click(object sender, EventArgs e) { string id = txtId.Text; if (!string.IsNullOrEmpty(id)) { string title = txtTitle.Text; var startdate = dateStart.Value; var finishdate = dateFinish.Value; var status = promotionController.GetStatus(startdate, finishdate); var promotion = promotionController.Get(Int32.Parse(id)); promotion.Title = title; promotion.StartDate = startdate; promotion.FinishDate = finishdate; promotion.Status = status; promotionController.Update(promotion); MessageBox.Show("You updated promotion successfully", "Notification"); loadTable(); } }