Beispiel #1
0
 private void Navegar(int p)
 {
     try
     {
         Nuevo = false;
         txtCo_campos.Enabled = false;
         using (Profit_RGEntities context = new Profit_RGEntities())
         {
             var pubi4 = context.pObtenerTablaStr(txtCo_campos.Text.Trim(), "co_campo", p, "GIT_Campos_Logicos").ToList();
             if (pubi4.Count > 0)
             {
                 campos1             = context.pSeleccionarGIT_CamposLogicos(pubi4[0].Trim()).FirstOrDefault();
                 txtCo_campos.Text   = campos1.co_campo;
                 txtDescripcion.Text = campos1.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);
     }
 }
Beispiel #2
0
        private void Buscar()
        {
            try
            {
                Nuevo = false;
                using (Profit_RGEntities context = new Profit_RGEntities())
                {
                    pSeleccionarGIT_CamposLogicos_Result campos1 = new pSeleccionarGIT_CamposLogicos_Result();
                    var pubi1 = context.GIT_Campos_Logicos.Where(xD => xD.co_campo == txtBuscar.Text.Trim()).ToList();

                    if (pubi1.Count > 0)
                    {
                        campos1             = context.pSeleccionarGIT_CamposLogicos(pubi1[0].co_campo.Trim().ToUpper()).FirstOrDefault();
                        txtCo_campos.Text   = campos1.co_campo.Trim();
                        txtDescripcion.Text = campos1.descrip.Trim();
                        txtBuscar.Text      = "";
                        txtCo_campos.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);
            }
        }