private void btnadd_Click(object sender, EventArgs e) { if (txt_title.Text == "") { PL.FRM_ERRORINSERT FError = new FRM_ERRORINSERT(); FError.Show(); } else { if (ID == 0) { BL.CLS_BRO BLBR = new BL.CLS_BRO(); BLBR.Insert(Convert.ToString(dataGridView1.CurrentRow.Cells[1].Value), Convert.ToString(dataGridView2.CurrentRow.Cells[1].Value), Convert.ToString(txt_date1.Value), Convert.ToString(txt_date2.Value), Convert.ToInt32(txt_title.Text)); PL.FRM_DADD fadd = new FRM_DADD(); fadd.Show(); this.Close(); } else { BL.CLS_BRO BLBR = new BL.CLS_BRO(); BLBR.update(Convert.ToString(dataGridView1.CurrentRow.Cells[1].Value), Convert.ToString(dataGridView2.CurrentRow.Cells[1].Value), Convert.ToString(txt_date1.Value), Convert.ToString(txt_date2.Value), Convert.ToInt32(txt_title.Text), ID); PL.FRM_DEDIT fedit = new FRM_DEDIT(); fedit.Show(); this.Close(); } } }