private void btn_Add_Click(object sender, EventArgs e) { Form2_1 f2_1 = new Form2_1(); Form2_2 f2_4 = new Form2_2(); if (count == 1) { f2_1.Show(); } else if (count == 3) { f2_4.Show(); } else { MessageBox.Show("Please select the Details"); } }
private void btn_Update_Click(object sender, EventArgs e) { if (count == 1) { Form2_1 f2_1 = new Form2_1(); f2_1.lbl_Id.Text = this.dataGridView1.CurrentRow.Cells[0].Value.ToString(); f2_1.cmbTran.Text = this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); f2_1.cmbType.Text = this.dataGridView1.CurrentRow.Cells[2].Value.ToString(); f2_1.txtAmount.Text = this.dataGridView1.CurrentRow.Cells[3].Value.ToString(); f2_1.dTP_Date.Text = this.dataGridView1.CurrentRow.Cells[4].Value.ToString(); f2_1.Show(); f2_1.button4.Visible = true; f2_1.label10.Visible = true; f2_1.lbl_Id.Visible = true; f2_1.button3.Visible = false; f2_1.button1.Visible = false; } else { MessageBox.Show("Please select the Details"); } }