private void EmployeeOutForm_Load(object sender, EventArgs e) { outbutton.Enabled = false; EmployeeClass emp = new EmployeeClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport()); //string orden = "SELECT * FROM " + UserAccessForm.getusername() + "_employee_table WHERE `NOMBRE COMPLETO` = '" + namelabel.Text + "';"; emp.filleverylabel(namelabel, getintimelabel, gottendegreelabel, idbox, fechanacimientolabel, telephonelabel, schedulelabel, joblabel, nacionalitylabel, agelabel, tipomonedalabel, sueldolabel, referenciapersonallabel, telefonoreferencialabel, referencialabel, alergialabel, dolencialabel, medicinalabel, razonmedicinalabel, trabajandolabel, fechasalidalabel, sexolabel, direccionlabel, picturetextbox, emaillabel, DireccionGestor.getordensql()); if (fechasalidalabel.Text == "" || fechasalidalabel.Text == "00/00/0000") { fechasalidalabel.Hide(); titlesalida.Hide(); } else { fechasalidalabel.Show(); titlesalida.Show(); } if (picturetextbox.Text != "") { string path = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures); string combinacion = System.IO.Path.Combine(path, UserAccessForm.getusername()); string fotopath = System.IO.Path.Combine(combinacion, picturetextbox.Text); pictureBox.ImageLocation = fotopath; } }
private void EmployeeForm_Load(object sender, EventArgs e) { EmployeeClass emp = new EmployeeClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport()); string orden = "SELECT distinct `TITULO UNIVERSITARIO` FROM " + UserAccessForm.getusername() + "_employee_table;"; emp.Fillcombo(gottendegree, orden); orden = "SELECT distinct `PUESTO` FROM " + UserAccessForm.getusername() + "_employee_table;"; emp.Fillcombo(cargobox, orden); orden = "SELECT distinct `RELACION DE REFERENCIA` FROM " + UserAccessForm.getusername() + "_employee_table;"; emp.Fillcombo(relationReferenceBox, orden); orden = "SELECT distinct `NOMBRE DE ALERGIA` FROM " + UserAccessForm.getusername() + "_employee_table;"; emp.Fillcombo(AlergyNmaeBox, orden); orden = "SELECT distinct `NOMBRE DE DOLENCIA` FROM " + UserAccessForm.getusername() + "_employee_table;"; emp.Fillcombo(DolenciaNameBox, orden); orden = "SELECT distinct `NOMBRE DE MEDICINA` FROM " + UserAccessForm.getusername() + "_employee_table;"; emp.Fillcombo(nameMedicineBox, orden); orden = "SELECT distinct `RAZON DE MEDICINA` FROM " + UserAccessForm.getusername() + "_employee_table;"; emp.Fillcombo(MotivoMedicineBox, orden); monedatipo.Text = "DOP"; if (DireccionGestor.getorigen() == "editor") { titulolabel.Text = "EDITAR EMPLEADO"; savebuttonstrip.Text = "MODIFICAR"; emp.filleverything(dategetin, gottendegree, nameEmployeeBox, idBox, birthDateBox, telephoneNumberBox, schedule, cargobox, comboNacionalidad, ageBox, monedatipo, mensualitybox, personalReferenceBox, telephoneReferenceBox, relationReferenceBox, AlergyNmaeBox, DolenciaNameBox, nameMedicineBox, MotivoMedicineBox, trabajando, salidapicker, picturetextbox, direccionbox, sexobox, emailcombo, DireccionGestor.getordensql()); if (nameMedicineBox.Text == "NINGUNA" && MotivoMedicineBox.Text == "NINGUNA") { medicinepanel.Hide(); medicamentosopcionbox.Text = "NO"; } else { medicamentosopcionbox.Text = "SI"; medicinepanel.Show(); } if (DolenciaNameBox.Text == "NINGUNA") { dolenciaopcionbox.Text = "NO"; dolenciapanel.Hide(); } else { dolenciaopcionbox.Text = "SI"; dolenciapanel.Show(); } if (AlergyNmaeBox.Text == "NINGUNA") { alergypanel.Hide(); alergiaopcionbox.Text = "NO"; } else { alergypanel.Show(); alergiaopcionbox.Text = "SI"; } if (personalReferenceBox.Text == "NINGUNA" && telephoneReferenceBox.Text == "NINGUNA" && relationReferenceBox.Text == "NINGUNA") { referenciapanel.Hide(); referenciaopcionbox.Text = "NO"; } else { referenciaopcionbox.Text = "SI"; referenciapanel.Show(); } empleadopanel.Show(); } else { savebuttonstrip.Text = "GUARDAR"; titulolabel.Text = "AGREGAR EMPLEADO"; empleadopanel.Hide(); } if (picturetextbox.Text != "") { string path = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures); string combinacion = System.IO.Path.Combine(path, UserAccessForm.getusername()); string fotopath = System.IO.Path.Combine(combinacion, picturetextbox.Text); pictureBox.ImageLocation = fotopath; } }