Пример #1
0
 private void txtCo_shipper_Leave(object sender, EventArgs e)
 {
     try
     {
         if (txtCo_shipper.Text.Trim().Length > 0)
         {
             pSeleccionarProv_Result shipper = new pSeleccionarProv_Result();
             using (Profit_RGEntities context = new Profit_RGEntities())
             {
                 shipper = context.pSeleccionarProv(txtCo_consig.Text.Trim(), txtCo_shipper.Text.Trim()).FirstOrDefault();
             }
             if (shipper == null)
             {
                 txtShipper_des.Text = "NO ENCONTRADO";
             }
             else
             {
                 txtShipper_des.Text = shipper.prov_des.Trim();
             }
         }
     }
     catch (DataException ex0)
     {
         MessageBox.Show(ex0.InnerException.Message, "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     catch (Exception ex1)
     {
         MessageBox.Show(ex1.Message, "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #2
0
 private void txtCo_prov_Leave(object sender, EventArgs e)
 {
     try
     {
         pSeleccionarProv_Result shipper = new pSeleccionarProv_Result();
         using (Profit_RGEntities context = new Profit_RGEntities())
         {
             shipper = context.pSeleccionarProv(txtEmpresa.Text.Trim()).Where(s => s.co_prov == txtCo_prov.Text.Trim()).First();
         }
         if (shipper == null)
         {
             txtProv_des.Text = "NO ENCONTRADO";
         }
         else
         {
             txtProv_des.Text = shipper.prov_des.Trim();
         }
     }
     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);
     }
 }