private void delete_Click(object sender, EventArgs e) { MSAConnection.execute("delete from contact where id=" + id); MessageBox.Show("Eliminado Exitosamente!!"); Form1.load(); Dispose(); }
private void ok_Click(object sender, EventArgs e) { if (firstname.Text != "") { if (action == "add") { MSAConnection.execute("insert into contact (firstname,lastname,address,email,phone) values (\"" + firstname.Text + "\",\"" + lastname.Text + "\",\"" + address.Text + "\",\"" + email.Text + "\",\"" + phone.Text + "\")"); firstname.Text = lastname.Text = address.Text = phone.Text = email.Text = ""; MessageBox.Show("Agregado Exitosamente!!"); } else if (action == "update") { MSAConnection.execute("update contact set firstname=\"" + firstname.Text + "\",lastname=\"" + lastname.Text + "\",address=\"" + address.Text + "\",email=\"" + email.Text + "\",phone=\"" + phone.Text + "\" where id=" + id); //firstname.Text = lastname.Text = address.Text = phone.Text = email.Text = ""; MessageBox.Show("Actualizado Exitosamente!!"); } } else { MessageBox.Show("Campos Obligatorio: Nombre"); } }