private void button10_Click(object sender, EventArgs e) { if (variable == 1) { var2 = 2; variable = 2; empadd emp_add = new empadd(); emp_add.button2.Visible = true; emp_add.textBox_empid.Text = this.dataGridView1.CurrentRow.Cells[0].Value.ToString(); emp_add.textBoxname.Text = this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); emp_add.textBoxage.Text = this.dataGridView1.CurrentRow.Cells[4].Value.ToString(); emp_add.textBoxconno.Text = this.dataGridView1.CurrentRow.Cells[3].Value.ToString(); emp_add.textBoxnic.Text = this.dataGridView1.CurrentRow.Cells[5].Value.ToString(); //emp_add.birthday.Value.Date.ToString("MM/dd/yyyy") = this.dataGridView1.CurrentRow.Cells[6].Value.ToString(); //emp_add.birthday.Text = this.dataGridView1.CurrentRow.Cells[6].Value.ToString(); emp_add.richTextadd.Text = this.dataGridView1.CurrentRow.Cells[2].Value.ToString(); emp_add.comboBox1.SelectedItem = this.dataGridView1.CurrentRow.Cells[7].Value.ToString(); emp_add.richTextBoxexp.Text = this.dataGridView1.CurrentRow.Cells[9].Value.ToString(); // emp_add.joindate.Value = Convert.ToDateTime(this.dataGridView1.CurrentRow.Cells[10].Value); emp_add.textBox1.Text = this.dataGridView1.CurrentRow.Cells[8].Value.ToString(); var data = (byte[])(this.dataGridView1.CurrentRow.Cells[11].Value); var stream = new MemoryStream(data); emp_add.pictureBox1.Image = Image.FromStream(stream); emp_add.textBox1.Enabled = true; emp_add.Show(); this.Dispose(); } else if (variable == 3) { addleave add_leave = new addleave(); add_leave.textBox1.Text = this.dataGridView1.CurrentRow.Cells[0].Value.ToString(); add_leave.textBox2.Text = this.dataGridView1.CurrentRow.Cells[1].Value.ToString(); add_leave.textBox3.Text = this.dataGridView1.CurrentRow.Cells[2].Value.ToString(); add_leave.Show(); } }
private void button9_Click(object sender, EventArgs e) { if (variable == 1) { var2 = 1; variable = 1; empadd ad = new empadd(); ad.textBox1.Enabled = false; ad.Visible = true; ad.button1.Visible = true; this.Visible = false; } else if (variable == 3) { //variable2 = 1; //variable = 1; addleave addle = new addleave(); addle.Visible = true; this.Visible = false; } }