private void button1_Click(object sender, EventArgs e) { Detail_Page dp = this; Emp_Update eu = new Emp_Update(dp); eu.Passvalue2 = Passvalue; // 전달자(Passvalue)를 통해서 dp페이지로 전달 eu.ShowDialog(this); }
private void button2_Click(object sender, EventArgs e) { int rowIndex = dataGridView1.CurrentRow.Index; string id = dataGridView1.SelectedRows[0].Cells[0].FormattedValue.ToString(); //상세 정보 페이지에 Man_Page mp = this; Detail_Page DP = new Detail_Page(mp); DP.Passvalue = id; // 전달자(Passvalue)를 통해서 dp페이지로 전달 DP.ShowDialog(this); }
private void button2_Click(object sender, EventArgs e) { if (MessageBox.Show("삭제하시겠습니까?", "YesOrNo", MessageBoxButtons.YesNo) == DialogResult.Yes) { try { Detail_Page dp = new Detail_Page(); conn = new MySqlConnection(strConn); cmd = new MySqlCommand(); conn.Open(); cmd.Connection = conn; cmd.CommandText = ($"delete from emp_info where emp_id = {Passvalue}"); cmd.ExecuteNonQuery(); conn.Close(); conn.Open(); cmd.CommandText = ($"delete from emp_img where imageNO = {emp_id.Text}"); cmd.ExecuteNonQuery(); conn.Close(); MessageBox.Show("직원 삭제 완료"); dp.Close(); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); MessageBox.Show("직원 삭제 실패"); conn.Close(); this.Close(); } this.Close(); } else { } }
public Emp_Update(Detail_Page _dp) { InitializeComponent(); dp = _dp; }