コード例 #1
0
        private void savebuttonstrip_Click(object sender, EventArgs e)
        {
            carga man = new carga();

            if (savebuttonstrip.Text == "GUARDAR")
            {
                man.WindowState = FormWindowState.Normal;

                if (gottendegree.Text == "" || nameEmployeeBox.Text == "" || idBox.Text == "" || telephoneNumberBox.Text == "" || schedule.Text == "" || cargobox.Text == "" || comboNacionalidad.Text == "" || ageBox.Text == "" || mensualitybox.Text == "" || personalReferenceBox.Text == "" || telephoneReferenceBox.Text == "" || relationReferenceBox.Text == "" || AlergyNmaeBox.Text == "" || DolenciaNameBox.Text == "" || nameMedicineBox.Text == "" || MotivoMedicineBox.Text == "")
                {
                    MessageBox.Show("Hay datos importantes vacios, termine el formulario.");



                    if (gottendegree.Text == "")
                    {
                        gottendegree.BackColor = Color.Red;
                    }
                    else
                    {
                        gottendegree.BackColor = Color.Green;
                    }

                    if (nameEmployeeBox.Text == "")
                    {
                        nameEmployeeBox.BackColor = Color.Red;
                    }
                    else
                    {
                        nameEmployeeBox.BackColor = Color.Green;
                    }

                    if (idBox.Text == "")
                    {
                        idBox.BackColor = Color.Red;
                    }
                    else
                    {
                        idBox.BackColor = Color.Green;
                    }

                    if (telephoneNumberBox.Text == "")
                    {
                        telephoneNumberBox.BackColor = Color.Red;
                    }
                    else
                    {
                        telephoneNumberBox.BackColor = Color.Green;
                    }

                    if (schedule.Text == "")
                    {
                        schedule.BackColor = Color.Red;
                    }
                    else
                    {
                        schedule.BackColor = Color.Green;
                    }

                    if (cargobox.Text == "")
                    {
                        cargobox.BackColor = Color.Red;
                    }
                    else
                    {
                        cargobox.BackColor = Color.Green;
                    }

                    if (comboNacionalidad.Text == "")
                    {
                        comboNacionalidad.BackColor = Color.Red;
                    }
                    else
                    {
                        comboNacionalidad.BackColor = Color.Green;
                    }

                    if (ageBox.Text == "")
                    {
                        ageBox.BackColor = Color.Red;
                    }
                    else
                    {
                        ageBox.BackColor = Color.Green;
                    }

                    if (mensualitybox.Text == "")
                    {
                        mensualitybox.BackColor = Color.Red;
                    }
                    else
                    {
                        mensualitybox.BackColor = Color.Green;
                    }

                    if (personalReferenceBox.Text == "")
                    {
                        personalReferenceBox.BackColor = Color.Red;
                    }
                    else
                    {
                        personalReferenceBox.BackColor = Color.Green;
                    }

                    if (telephoneReferenceBox.Text == "")
                    {
                        telephoneReferenceBox.BackColor = Color.Red;
                    }
                    else
                    {
                        telephoneReferenceBox.BackColor = Color.Green;
                    }

                    if (relationReferenceBox.Text == "")
                    {
                        relationReferenceBox.BackColor = Color.Red;
                    }
                    else
                    {
                        relationReferenceBox.BackColor = Color.Green;
                    }

                    if (AlergyNmaeBox.Text == "")
                    {
                        AlergyNmaeBox.BackColor = Color.Red;
                    }
                    else
                    {
                        AlergyNmaeBox.BackColor = Color.Green;
                    }

                    if (DolenciaNameBox.Text == "")
                    {
                        DolenciaNameBox.BackColor = Color.Red;
                    }
                    else
                    {
                        DolenciaNameBox.BackColor = Color.Green;
                    }

                    if (nameMedicineBox.Text == "")
                    {
                        nameMedicineBox.BackColor = Color.Red;
                    }
                    else
                    {
                        nameMedicineBox.BackColor = Color.Green;
                    }

                    if (MotivoMedicineBox.Text == "")
                    {
                        MotivoMedicineBox.BackColor = Color.Red;
                    }
                    else
                    {
                        MotivoMedicineBox.BackColor = Color.Green;
                    }
                }
                else
                {
                    try
                    {
                        string        userDataName = UserAccessForm.getusername() + "_employee_table";
                        EmployeeClass employee     = new EmployeeClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                        employee.NameNoCopied(nameEmployeeBox.Text, userDataName);
                        int      age        = int.Parse(ageBox.Text);
                        double   mensuality = double.Parse(mensualitybox.Text);
                        DateTime birthdate  = Convert.ToDateTime(birthDateBox.Value.Date);
                        DateTime timegetin  = Convert.ToDateTime(dategetin.Value.ToShortTimeString());
                        string   access     = userDataName;

                        if (mensualitybox.BackColor == Color.Red)
                        {
                            MessageBox.Show("Arregle el campo no valido");
                        }
                        else
                        {
                            if (employee.NameNoCopied(nameEmployeeBox.Text, userDataName) == true)
                            {
                                man.Close();
                                MessageBox.Show("El Empleado " + nameEmployeeBox.Text + " ya existe.");
                                if (MessageBox.Show("Agregar a otro empleado?", "Agregar", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
                                {
                                    employee = new EmployeeClass();

                                    DireccionGestor menu = new DireccionGestor();
                                    menu.WindowState = FormWindowState.Normal;
                                    menu.Show();
                                    this.Close();
                                }
                                else
                                {
                                    employee = new EmployeeClass();

                                    EmployeeForm menu = new EmployeeForm();
                                    menu.WindowState = FormWindowState.Normal;
                                    menu.Show();
                                    this.Close();
                                }
                            }
                            else if (employee.NameNoCopied(nameEmployeeBox.Text, userDataName) == false)
                            {
                                if (gottendegree.Text == "" || nameEmployeeBox.Text == "" || idBox.Text == "" || telephoneNumberBox.Text == "" || schedule.Text == "" || cargobox.Text == "" || comboNacionalidad.Text == "" || ageBox.Text == "" || mensualitybox.Text == "" || personalReferenceBox.Text == "" || telephoneReferenceBox.Text == "" || relationReferenceBox.Text == "" || AlergyNmaeBox.Text == "" || DolenciaNameBox.Text == "" || nameMedicineBox.Text == "" || MotivoMedicineBox.Text == "")
                                {
                                    MessageBox.Show("Hay datos importantes vacios, termine el formulario.");
                                }
                                else
                                {
                                    string date       = birthDateBox.Value.Day.ToString() + "/" + birthDateBox.Value.Month.ToString() + "/" + birthDateBox.Value.Year.ToString();
                                    string evento     = birthDateBox.Value.Day.ToString() + "/" + birthDateBox.Value.Month.ToString();
                                    string eventoname = "CUMPLEAÑOS DE " + nameEmployeeBox.Text;

                                    AgendaClass addevent = new AgendaClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                                    addevent.saveData(UserAccessForm.getusername(), eventoname, 1, date, "7:20:0", "NO", "NO", "NO", "NO", "NO", "NO", "NO", evento, "SI", "");

                                    LoginClass add = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                                    add.AddContact(nameEmployeeBox.Text, telephoneNumberBox.Text, direccionbox.Text, emailcombo.Text, UserAccessForm.getusername().ToString());

                                    if (employee.SaveData(userDataName, dategetin, gottendegree.Text, nameEmployeeBox.Text, idBox.Text, birthDateBox, telephoneNumberBox.Text, schedule.Text, cargobox.Text, comboNacionalidad.Text, age, mensuality, personalReferenceBox.Text, telephoneReferenceBox.Text, relationReferenceBox.Text, AlergyNmaeBox.Text, DolenciaNameBox.Text, nameMedicineBox.Text, MotivoMedicineBox.Text, picturetextbox.Text, monedatipo.Text, sexobox.Text, direccionbox.Text, emailcombo.Text))
                                    {
                                        man.Close();
                                        employee.NameNoCopied(nameEmployeeBox.Text, userDataName);
                                        employee.OrderID(userDataName);
                                        MessageBox.Show("NUEVO EMPLEADO " + nameEmployeeBox.Text + " HA SIDO AGREGADO.");

                                        if (MessageBox.Show("Agregar a otro empleado?", "Agregar", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
                                        {
                                            employee = new EmployeeClass();

                                            DireccionGestor menu = new DireccionGestor();
                                            menu.WindowState = FormWindowState.Normal;
                                            menu.Show();
                                            this.Close();
                                        }
                                        else
                                        {
                                            employee = new EmployeeClass();

                                            EmployeeForm menu = new EmployeeForm();
                                            menu.WindowState = FormWindowState.Normal;
                                            menu.Show();
                                            this.Close();
                                        }
                                    }

                                    else
                                    {
                                        man.Close();

                                        MessageBox.Show("NUEVO EMPLEADO " + nameEmployeeBox.Text + "HA SIDO AGREGADO.");
                                        if (MessageBox.Show("Agregar a otro empleado?", "Agregar", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
                                        {
                                            employee = new EmployeeClass();

                                            DireccionGestor menu = new DireccionGestor();
                                            menu.WindowState = FormWindowState.Normal;
                                            menu.Show();
                                            this.Close();
                                        }
                                        else
                                        {
                                            employee = new EmployeeClass();

                                            EmployeeForm menu = new EmployeeForm();
                                            menu.WindowState = FormWindowState.Normal;
                                            menu.Show();
                                            this.Close();
                                        }
                                    }
                                }
                            }
                        }
                    }
                    catch (FormatException datethis) { datethis.ToString(); }
                }
            }
            else if (savebuttonstrip.Text == "MODIFICAR")
            {
                man.WindowState = FormWindowState.Normal;

                if (referenciaopcionbox.Text == "NO")
                {
                    man.Close();
                    telephoneNumberBox.Text   = "NINGUNA";
                    relationReferenceBox.Text = "NINGUNA";
                    personalReferenceBox.Text = "NINGUNA";
                }

                try
                {
                    man.Close();
                    string        userDataName = UserAccessForm.getusername() + "_employee_table";
                    EmployeeClass save         = new EmployeeClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                    AgendaClass   addevent     = new AgendaClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());


                    double mensuality = double.Parse(mensualitybox.Text);

                    string nameevent  = "CUMPLEAÑOS DE " + nameEmployeeBox.Text;
                    string date       = birthDateBox.Value.Day.ToString() + "/" + birthDateBox.Value.Month.ToString() + "/" + birthDateBox.Value.Year.ToString();
                    string momentdate = birthDateBox.Value.Day.ToString() + "/" + birthDateBox.Value.Month.ToString();

                    save.ModifyData(DireccionGestor.getnombrestatic(), trabajando.Text, userDataName, dategetin, salidapicker, gottendegree.Text, nameEmployeeBox.Text, idBox.Text, birthDateBox,
                                    telephoneNumberBox.Text, schedule.Text, cargobox.Text, comboNacionalidad.Text, int.Parse(ageBox.Text), mensuality, personalReferenceBox.Text, telephoneNumberBox.Text,
                                    relationReferenceBox.Text, AlergyNmaeBox.Text, DolenciaNameBox.Text, nameMedicineBox.Text, MotivoMedicineBox.Text, picturetextbox.Text, monedatipo.Text,
                                    sexobox.Text, direccionbox.Text, emailcombo.Text, EmployeeClass.getids());
                    addevent.modifydata(UserAccessForm.getusername(), DireccionGestor.getnombrestatic(), nameevent, 1, date, "7:20:0", "NO", "NO", "NO", "NO", "NO", "NO", "NO", momentdate, "SI");
                    LoginClass add = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                    add.editContact(nameEmployeeBox.Text, telephoneNumberBox.Text, direccionbox.Text, emailcombo.Text, DireccionGestor.getnombrestatic(), UserAccessForm.getusername().ToString());

                    MessageBox.Show("EL EMPLEADO " + nameEmployeeBox.Text + " HA SIDO MODIFICADO");



                    EmployeeClass      studentobject = new EmployeeClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                    EmployeeFormSearch buscar        = new EmployeeFormSearch();
                    buscar.WindowState = FormWindowState.Maximized;
                    buscar.Show();
                    this.Close();
                }
                catch (FormatException datethis) { datethis.ToString(); }
            }
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
        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();
                }
            }
        }
コード例 #4
0
        private void eliminarbutton_Click(object sender, EventArgs e)
        {
            if (workingbox.Text == "NO")
            {
                MessageBox.Show("Solo se pueden Despedir Empleados.");
                workingbox.BackColor = Color.Red;
            }
            else
            {
                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
                {
                    EmployeeClass show         = new EmployeeClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                    string        userDataName = UserAccessForm.getusername() + "_employee_table";
                    string        mandosql     = "update " + userDataName + " set TRABAJANDO ='NO' where `NOMBRE COMPLETO` ='" + comboname.Text + "' and EDAD = '" + edadbox.Text + "' and PUESTO = '" + cargobox.Text + "' and ID='" + EmployeeClass.getids() + "';";
                    if (show.ordensql(mandosql) == true)
                    {
                        MessageBox.Show("Empleado ha sido despedido");
                    }
                    else
                    {
                        MessageBox.Show("Empleado Despedido");
                    }
                    show.ShowDataGrid(findinggrid, userDataName);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
            }
        }
コード例 #5
0
        private void searchbutton_Click(object sender, EventArgs e)
        {
            string        userDataName = UserAccessForm.getusername() + "_employee_table";
            EmployeeClass show         = new EmployeeClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
            string        orden;

            string fecha = datecontrol.Value.Day.ToString() + "/" + datecontrol.Value.Month.ToString() + "/" + datecontrol.Value.Year.ToString();
            string name  = comboname.Text;
            string edad  = edadbox.Text;

            string birthdates = birthdatebox.Value.Day.ToString() + "/" + birthdatebox.Value.Month.ToString() + "/" + birthdatebox.Value.Year.ToString();
            string timegetin  = getindateTimePicker.Value.Day.ToString() + "/" + getindateTimePicker.Value.Month.ToString() + "/" + getindateTimePicker.Value.Year.ToString();
            string timegetout = getoutdateTimePicker.Value.Day.ToString() + "/" + getoutdateTimePicker.Value.Month.ToString() + "/" + getoutdateTimePicker.Value.Year.ToString();
            string puesto     = cargobox.Text;
            string trabaja    = workingbox.Text;


            if (trabaja == "SI" || trabaja == "si")
            {
                orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `NOMBRE COMPLETO` like '%" + comboname.Text + "%' AND EDAD = '" + edad + "' AND `FECHA DE NACIMIENTO`= '" + birthdates + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND `FECHA DE SALIDA` = '" + timegetout + "' AND PUESTO ='" + puesto + "' AND  TRABAJANDO = '" + trabaja + "';";
                show.ShowDataGridFound(findinggrid, orden);
                encontradoslabel.Text = show.getcuenta().ToString();

                if (birthdates == fecha)
                {
                    birthdates = "";
                    orden      = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `NOMBRE COMPLETO` like '%" + comboname.Text + "%' AND EDAD = '" + edad + "' AND  `FECHA DE ENTRADA` = '" + timegetin + "' AND `FECHA DE SALIDA` = '" + timegetout + "' AND PUESTO ='" + puesto + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (name == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where EDAD = '" + edad + "' AND `FECHA DE NACIMIENTO`= '" + birthdates + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND `FECHA DE SALIDA` = '" + timegetout + "' AND PUESTO ='" + puesto + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (edad == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `NOMBRE COMPLETO` like '%" + comboname.Text + "%' AND `FECHA DE NACIMIENTO`= '" + birthdates + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND `FECHA DE SALIDA` = '" + timegetout + "' AND PUESTO ='" + puesto + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (puesto == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `NOMBRE COMPLETO` like '%" + comboname.Text + "%' AND EDAD = '" + edad + "' AND `FECHA DE NACIMIENTO`= '" + birthdates + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND `FECHA DE SALIDA` = '" + timegetout + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (birthdates == fecha && name == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where  EDAD = '" + edad + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND `FECHA DE SALIDA` = '" + timegetout + "' AND PUESTO ='" + puesto + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (birthdates == fecha && edad == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `NOMBRE COMPLETO` like '%" + comboname.Text + "%' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND `FECHA DE SALIDA` = '" + timegetout + "' AND PUESTO ='" + puesto + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (birthdates == fecha && puesto == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `NOMBRE COMPLETO` like '%" + comboname.Text + "%' AND EDAD = '" + edad + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND `FECHA DE SALIDA` = '" + timegetout + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (name == "" && edad == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `FECHA DE NACIMIENTO`= '" + birthdates + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND `FECHA DE SALIDA` = '" + timegetout + "' AND PUESTO ='" + puesto + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (name == "" && puesto == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where EDAD = '" + edad + "' AND `FECHA DE NACIMIENTO`= '" + birthdates + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND `FECHA DE SALIDA` = '" + timegetout + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (edad == "" && puesto == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `NOMBRE COMPLETO` like '%" + comboname.Text + "%'  AND `FECHA DE NACIMIENTO`= '" + birthdates + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND `FECHA DE SALIDA` = '" + timegetout + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (birthdates == fecha && name == "" && edad == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `FECHA DE ENTRADA` = '" + timegetin + "' AND `FECHA DE SALIDA` = '" + timegetout + "' AND PUESTO ='" + puesto + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (name == "" && edad == "" && puesto == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `FECHA DE NACIMIENTO`= '" + birthdates + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND `FECHA DE SALIDA` = '" + timegetout + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (birthdates == fecha && edad == "" && puesto == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `NOMBRE COMPLETO` like '%" + comboname.Text + "%' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND `FECHA DE SALIDA` = '" + timegetout + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (birthdates == fecha && name == "" && puesto == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where EDAD = '" + edad + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND `FECHA DE SALIDA` = '" + timegetout + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (birthdates == fecha && name == "" && edad == "" && puesto == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `FECHA DE ENTRADA` = '" + timegetin + "' AND `FECHA DE SALIDA` = '" + timegetout + "'AND TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
            }
            else
            {
                orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `NOMBRE COMPLETO` like '%" + comboname.Text + "%' AND EDAD = '" + edad + "' AND `FECHA DE NACIMIENTO`= '" + birthdates + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND PUESTO ='" + puesto + "' AND  TRABAJANDO = '" + trabaja + "';";
                show.ShowDataGridFound(findinggrid, orden);
                encontradoslabel.Text = show.getcuenta().ToString();

                if (birthdates == fecha)
                {
                    birthdates = "";
                    orden      = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `NOMBRE COMPLETO` like '%" + comboname.Text + "%' AND EDAD = '" + edad + "' AND  `FECHA DE ENTRADA` = '" + timegetin + "' AND PUESTO ='" + puesto + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (name == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where EDAD = '" + edad + "' AND `FECHA DE NACIMIENTO`= '" + birthdates + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND PUESTO ='" + puesto + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (edad == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `NOMBRE COMPLETO` like '%" + comboname.Text + "%' AND `FECHA DE NACIMIENTO`= '" + birthdates + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND PUESTO ='" + puesto + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (puesto == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `NOMBRE COMPLETO` like '%" + comboname.Text + "%' AND EDAD = '" + edad + "' AND `FECHA DE NACIMIENTO`= '" + birthdates + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (birthdates == fecha && name == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where  EDAD = '" + edad + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND PUESTO ='" + puesto + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (birthdates == fecha && edad == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `NOMBRE COMPLETO` like '%" + comboname.Text + "%' AND `FECHA DE ENTRADA` = '" + timegetin + "'  AND PUESTO ='" + puesto + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (birthdates == fecha && puesto == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `NOMBRE COMPLETO` like '%" + comboname.Text + "%' AND EDAD = '" + edad + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (name == "" && edad == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `FECHA DE NACIMIENTO`= '" + birthdates + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND  PUESTO ='" + puesto + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (name == "" && puesto == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where EDAD = '" + edad + "' AND `FECHA DE NACIMIENTO`= '" + birthdates + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (edad == "" && puesto == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `NOMBRE COMPLETO` like '%" + comboname.Text + "%'  AND `FECHA DE NACIMIENTO`= '" + birthdates + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (birthdates == fecha && name == "" && edad == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `FECHA DE ENTRADA` = '" + timegetin + "' AND PUESTO ='" + puesto + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (name == "" && edad == "" && puesto == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `FECHA DE NACIMIENTO`= '" + birthdates + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (birthdates == fecha && edad == "" && puesto == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `NOMBRE COMPLETO` like '%" + comboname.Text + "%' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (birthdates == fecha && name == "" && puesto == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where EDAD = '" + edad + "' AND `FECHA DE ENTRADA` = '" + timegetin + "' AND  TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
                else if (birthdates == fecha && name == "" && edad == "" && puesto == "")
                {
                    orden = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where `FECHA DE ENTRADA` = '" + timegetin + "' AND TRABAJANDO = '" + trabaja + "';";
                    show.ShowDataGridFound(findinggrid, orden);
                    encontradoslabel.Text = show.getcuenta().ToString();
                }
            }
            //////////////////////////////////////////////
            string mandosql = "select `NOMBRE COMPLETO` from " + userDataName + " where `NOMBRE COMPLETO` ='" + name + "' and EDAD = '" + edad + "' and PUESTO = '" + puesto + "';";

            if (show.ordensql(mandosql) == true)
            {
                eliminarbutton.Enabled = true;
                editbutton.Enabled     = true;
            }
            else
            {
                eliminarbutton.Enabled = false;
                editbutton.Enabled     = false;
            }


            if (comboname.Text == "" || edadbox.Text == "" || cargobox.Text == "")
            {
                editbutton.Enabled = false;
            }
            else
            {
                editbutton.Enabled = true;
            }
        }