private void Buscar() { try { Nuevo = false; using (Profit_RGEntities context = new Profit_RGEntities()) { pSeleccionarGIT_Ubicaciones_Result Ubicacion1 = new pSeleccionarGIT_Ubicaciones_Result(); var pubi1 = context.GIT_Consultor.Where(xD => xD.co_consultor == txtBuscar.Text.Trim()).ToList(); if (pubi1.Count > 0) { consultor1 = context.pSeleccionarGIT_Consultor(pubi1[0].co_consultor.Trim().ToUpper()).FirstOrDefault(); txtCo_consultor.Text = consultor1.co_consultor.Trim(); txtDescripcion.Text = consultor1.nombre.Trim(); txtBuscar.Text = ""; txtCo_consultor.Focus(); } else { MessageBox.Show("El registro no existe", "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Error); txtBuscar.Focus(); } } } catch (EntityException ex) { MessageBox.Show(ex.InnerException.Message, "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ex1) { MessageBox.Show(ex1.Message, "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Navegar(int p) { try { Nuevo = false; txtCo_ubicacion.Enabled = false; using (Profit_RGEntities context = new Profit_RGEntities()) { var pubi = context.pObtenerTablaStr(txtCo_ubicacion.Text.Trim(), "co_ubic", p, "GIT_Ubicaciones").ToList(); if (pubi.Count > 0) { Ubicacion1 = context.pSeleccionarGIT_Ubicaciones(pubi[0].Trim()).FirstOrDefault(); txtCo_ubicacion.Text = Ubicacion1.co_ubic; txtDescripcion.Text = Ubicacion1.descrip; //var Imagen = ImagenBD.BytesToImage(Usuario.ilustracion) } } } catch (EntityException ex) { MessageBox.Show(ex.InnerException.Message, "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ex1) { MessageBox.Show(ex1.Message, "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Error); } }