private void editbutton_Click(object sender, EventArgs e) { if (cargobox.Text == "" || edadbox.Text == "" || comboname.Text == "") { MessageBox.Show("Hay datos importantes faltantes."); if (cargobox.Text == "") { cargobox.BackColor = Color.Red; } if (edadbox.Text == "") { edadbox.BackColor = Color.Red; } if (comboname.Text == "") { comboname.BackColor = Color.Red; } } else { DireccionGestor.setsombrestatic(comboname.Text); DireccionGestor.setedadstatic(int.Parse(edadbox.Text)); DireccionGestor.setotrostatic(cargobox.Text); string userDataName = UserAccessForm.getusername() + "_employee_table"; EmployeeClass student = new EmployeeClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport()); string orden = "SELECT * FROM " + userDataName + " WHERE `NOMBRE COMPLETO`= '" + comboname.Text + "' and EDAD = '" + edadbox.Text + "' and ID='" + EmployeeClass.getids() + "';"; DireccionGestor.setorigen("editor"); DireccionGestor.setordensql(orden); if (student.fillcombos(comboname, edadbox, cargobox, orden) == true) { EmployeeForm studentaddobject = new EmployeeForm(); studentaddobject.WindowState = FormWindowState.Maximized; studentaddobject.Show(); this.Close(); } } }
private void editbutton_Click(object sender, EventArgs e) { if (gradebox.Text == "" || edadbox.Text == "" || namebox.Text == "") { MessageBox.Show("Hay datos importantes faltantes."); if (gradebox.Text == "") { gradebox.BackColor = Color.Red; } if (edadbox.Text == "") { edadbox.BackColor = Color.Red; } if (namebox.Text == "") { namebox.BackColor = Color.Red; } } else { DireccionGestor.setsombrestatic(namebox.Text); DireccionGestor.setedadstatic(int.Parse(edadbox.Text)); DireccionGestor.setotrostatic(gradebox.Text); string userDataName = UserAccessForm.getusername() + "_student_table"; StudentsClass student = new StudentsClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport()); string orden = "select * from " + userDataName + " where `NOMBRE COMPLETO` = '" + namebox.Text + "' and EDAD = '" + edadbox.Text + "' and CURSO= '" + gradebox.Text + "';"; if (student.fillcombos(namebox, edadbox, gradebox, orden) == true) { DireccionGestor.setorigen("editor"); DireccionGestor.setordensql(orden); StudentForm studentaddobject = new StudentForm(); studentaddobject.WindowState = FormWindowState.Maximized; studentaddobject.Show(); this.Close(); } } }