private void updatepwi_btn_Click(object sender, EventArgs e) { string query = "UPDATE detailsinsurance set pinsurance = '" + process_txt.Text + "', tariff = '" + priceprocess_txt.Text + "' where id= '" + idprocess_txt.Text + "'"; DBManager c = new DBManager(); c.command(query); seepwi frm = new seepwi(); frm.loaddgv(); Close(); //try //{ // SQLiteConnection cnx = new SQLiteConnection("Data Source=C:\\syspandemic\\db\\syspandemic.db;Version=3;"); // cnx.Open(); // string comando = "UPDATE detailsinsurance set pinsurance = '" + process_txt.Text + "', tariff = '" + priceprocess_txt.Text + "' where id= '" +idprocess_txt.Text+"'"; // SQLiteCommand insertion = new SQLiteCommand(comando, cnx); // if (insertion.ExecuteNonQuery() > 0) // { // cnx.Close(); // seepwi frm = new seepwi(); // frm.loaddgv(); // MessageBox.Show("Se ha actualizado!"); // Close(); // } // else // { // MessageBox.Show("No se consiguio"); // } //} //catch (Exception ex) //{ // MessageBox.Show(ex.Message, "Error"); //} }
private void administrarProcesosSinSeguroToolStripMenuItem_Click(object sender, EventArgs e) { seepwi f = new seepwi(); try { Form frm2 = Application.OpenForms.Cast <Form>().FirstOrDefault(x => x is seepwi); if (frm2 != null) { frm2.BringToFront(); MessageBox.Show("Esta ventana ya esta abierta.", "Error"); return; } else { f.MdiParent = this; f.Show(); } } catch (Exception ex) { MessageBox.Show("No se puede abrir el ventana solicitado. Razón: " + ex.Message, "Error al abrir la ventana.", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void addpwi_FormClosing(object sender, FormClosingEventArgs e) { seepwi frm = new seepwi(); frm.loaddgv(); }