private void BtnEdit_Click(object sender, EventArgs e) { TransparentPosition b = new TransparentPosition(); FrmAddPosition a = new FrmAddPosition(); try { a.label8.Text = "Edit Position"; a.lblpositionid.Text = lblpositionid.Text; a.BtnAddPosition.Visible = false; con.Open(); String query = "select * from position where position_id = @id"; MySqlCommand cmd = new MySqlCommand(query, con); cmd.Parameters.AddWithValue("@id", lblpositionid.Text); MySqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { a.TxtPosition.Text = (dr["position"]).ToString(); } dr.Close(); con.Close(); b.Show(); a.ShowDialog(); b.Hide(); } catch { NotificationConnectionError c = new NotificationConnectionError(); c.ShowDialog(); } }
private void BtnAddPosition_Click(object sender, EventArgs e) { TransparentPosition a = new TransparentPosition(); FrmAddPosition b = new FrmAddPosition(); a.Show(); b.ShowDialog(); a.Hide(); }