예제 #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;
     }
 }
예제 #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");
                }
            }
        }
예제 #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;
            }
        }
예제 #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;
        }
예제 #5
0
 partial void Deleteempleados(empleados instance);
예제 #6
0
 partial void Updateempleados(empleados instance);
예제 #7
0
 partial void Insertempleados(empleados instance);