Example #1
0
        private void BtnEditarEmpleado_Click(object sender, EventArgs e)
        {
            try
            {
                ClsEmp cEmp = new ClsEmp();
                using (GendocsModeloDatos.models.GenDocsContext db = new GendocsModeloDatos.models.GenDocsContext())
                {
                    var lst = (from d in db.GdEmpleados
                               where (d.Empleado.Contains(txtIntroduzcaTexto.Text))
                               orderby d.IdEmpleado
                               select d.IdEmpleado

                               ).ToList();

                    cEmp.LstId = lst;
                    cEmp.CargarFrmEmpleados();
                }
                cmbClientes.SelectedIndex = -1;
                txtIntroduzcaTexto.Text   = string.Empty;
                txtIntroduzcaTexto.Focus();
                CargarGrid();
            }
            catch (Exception ex)
            {
                _ = ex.Message;
            }
        }
Example #2
0
 private void BtnModificar_Click(object sender, EventArgs e)
 {
     try
     {
         ClsEmp cEmp = new ClsEmp();
         using (GendocsModeloDatos.models.GenDocsContext db = new GendocsModeloDatos.models.GenDocsContext())
         {
             List <int> miLista = new List <int>();
             for (int i = 0; i < dgvContactos.SelectedRows.Count; i++)
             {
                 miLista.Add(Convert.ToInt32(dgvContactos.SelectedRows[i].Cells[0].Value.ToString()));
             }
             cEmp.LstId   = miLista.ToList();
             cEmp.EsNuevo = false;
             cEmp.CargarFrmEmpleados();
         }
         cmbClientes.SelectedIndex = 0;
         txtIntroduzcaTexto.Text   = string.Empty;
         txtIntroduzcaTexto.Focus();
         CargarGrid();
     }
     catch (Exception ex)
     {
         _ = ex.Message;
     }
 }
Example #3
0
 private void BtnNuevo_Click(object sender, EventArgs e)
 {
     try
     {
         ClsEmp cEmp = new ClsEmp
         {
             EsAlta  = true,
             EsNuevo = true
         };
         cEmp.CargarFrmEmpleados();
         cmbClientes.SelectedIndex = -1;
         txtIntroduzcaTexto.Text   = string.Empty;
         txtIntroduzcaTexto.Focus();
         CargarGrid();
     }
     catch (Exception ex)
     {
         _ = ex.Message;
     }
 }
Example #4
0
        private void DgvContactos_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                ClsEmp cEmp = new ClsEmp();
                using GendocsModeloDatos.models.GenDocsContext db = new GendocsModeloDatos.models.GenDocsContext();
                var lst = (from d in db.GdEmpleados
                           where (d.IdEmpleado == Convert.ToInt32(dgvContactos.Rows[e.RowIndex].Cells[0].Value))
                           select d.IdEmpleado

                           ).ToList();

                cEmp.LstId = lst;
                cEmp.CargarFrmEmpleados();
            }
            catch (Exception ex)
            {
                _ = ex.Message;
            }
        }