Exemple #1
0
 private void btnBaja_Click(object sender, EventArgs e)
 {
     if (txtBuscar.Text == "")
     {
         MessageBox.Show("Falta ID");
     }
     else
     {
         empleados MyEmplead = bdo.empleados.Single(q =>
                                                    q.id == int.Parse(txtBuscar.Text));
         bdo.empleados.DeleteOnSubmit(MyEmplead);
         bdo.SubmitChanges();
         cargarGrid();
         cargarGrid();
         txtID.Text         = "";
         txtName.Text       = "";
         txtSurname.Text    = "";
         txtAge.Text        = "";
         txtBuscar.Text     = "";
         chkMarried.Checked = false;
     }
 }
Exemple #2
0
        private void btnAlta_Click(object sender, EventArgs e)
        {
            try
            {
                empleados MyEmpleado = new empleados();
                MyEmpleado.id       = int.Parse(txtID.Text);
                MyEmpleado.nombre   = txtName.Text;
                MyEmpleado.apellido = txtSurname.Text;
                MyEmpleado.edad     = int.Parse(txtAge.Text);
                bool casao = false;

                if (chkMarried.Checked == true)
                {
                    casao = true;
                }
                else
                {
                }

                MyEmpleado.casado = casao;
                bdo.empleados.InsertOnSubmit(MyEmpleado);
                bdo.SubmitChanges();
                cargarGrid();
                txtID.Text         = "";
                txtName.Text       = "";
                txtSurname.Text    = "";
                txtAge.Text        = "";
                txtBuscar.Text     = "";
                chkMarried.Checked = false;
            }
            catch
            {
                if (txtID.Text == "" || txtName.Text == "" || txtSurname.Text == "" || txtAge.Text == "")
                {
                    MessageBox.Show("Falta algún valor");
                }
            }
        }
Exemple #3
0
        private void btnModif_Click(object sender, EventArgs e)
        {
            if (txtBuscar.Text == "")
            {
                MessageBox.Show("Falta algún valor");
            }
            else
            {
                empleados MyEmpleao = bdo.empleados.Single(q =>
                                                           q.id == int.Parse(txtBuscar.Text));
                //MyEmpleao.id = int.Parse(txtID.Text);
                MyEmpleao.nombre   = txtName.Text;
                MyEmpleao.apellido = txtSurname.Text;
                MyEmpleao.edad     = int.Parse(txtAge.Text);
                bool casao = false;

                if (chkMarried.Checked == true)
                {
                    casao = true;
                }
                else
                {
                }

                MyEmpleao.casado = casao;
                bdo.SubmitChanges();
                cargarGrid();
                cargarGrid();
                txtID.Text         = "";
                txtName.Text       = "";
                txtSurname.Text    = "";
                txtAge.Text        = "";
                txtBuscar.Text     = "";
                chkMarried.Checked = false;
            }
        }
Exemple #4
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            empleados MyEmpleado = bdo.empleados.Single(q => q.id == int.Parse(txtBuscar.Text));

            string variablet = txtBuscar.Text;
        }
Exemple #5
0
 partial void Deleteempleados(empleados instance);
Exemple #6
0
 partial void Updateempleados(empleados instance);
Exemple #7
0
 partial void Insertempleados(empleados instance);