private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            DataTable midatatable = new DataTable();

            if (e.KeyCode == Keys.Enter)
            {
                if (CBBuscarportipo.Text == "ADJUDICACION")
                {
                    midatatable = NegocioRetirodeMercaderia.buscarconcatenacion(0, "", "", DateTime.Now.ToString("dd/MM/yyyy"), DateTime.Now.ToString("dd/MM/yyyy"), false, false, false, false, 0, true, Convert.ToInt32(textBox1.Text));
                }
                if (CBBuscarportipo.Text == "VENTA")
                {
                    midatatable = NegocioRetirodeMercaderia.buscarconcatenacion(0, "", "", DateTime.Now.ToString("dd/MM/yyyy"), DateTime.Now.ToString("dd/MM/yyyy"), false, false, false, false, 0, false, 0, true, Convert.ToInt32(textBox1.Text));
                }
                if (midatatable.Rows.Count != 0)
                {
                    DataRow row = midatatable.Rows[0];
                    LblNorden.Text      = row["Orden"].ToString();
                    LblRazonsocial.Text = row["NombreBeneficiado"].ToString();
                    LblCuit.Text        = row["cuit"].ToString();
                    LblEstado.Text      = row["estado"].ToString();
                    LblTipo.Text        = row["Tipo"].ToString();
                    LblCodcliente.Text  = row["CodEmpresaB"].ToString();
                    LblEmpresa.Text     = row["Tipo"].ToString() == "VENTA" ? NegocioConfigEmpresa.emrazonsocial : row["razon_social"].ToString();
                    idempresa           = row["Tipo"].ToString() == "VENTA" ? 1 : Convert.ToInt32(row["codcliente"].ToString());
                    cargardetalleretiro(Convert.ToInt32(row["Orden"].ToString()));
                    Txtitems.Focus();
                }
                else
                {
                    UtilityFrm.mensajeError("La orden que ingreso es inexistente");
                    textBox1.SelectAll();
                }
            }
        }
        private void cambiartextbox()
        {
            if (CHKCambiarcantidad.Checked == true)
            {
                if (indice < 0)
                {
                    GDDetalleretiro.Rows[GDDetalleretiro.Rows.Count - 1].Cells[3].Selected = true;
                }
                else
                {
                    GDDetalleretiro.Rows[indice].Cells[3].Selected = true;
                }

                //  DGDetalleitems.Rows[DGDetalleitems.CurrentCell.RowIndex].Selected = true;
                Rectangle rec = GDDetalleretiro.GetCellDisplayRectangle(GDDetalleretiro.CurrentCell.ColumnIndex, GDDetalleretiro.CurrentCell.RowIndex, false);
                GDDetalleretiro.Focus();


                TxtcambioDv.Location = new Point(rec.Location.X + GDDetalleretiro.Location.X, rec.Location.Y + GDDetalleretiro.Location.Y);

                TxtcambioDv.Visible = true;
                TxtcambioDv.Text    = GDDetalleretiro.CurrentCell.Value.ToString();
                TxtcambioDv.Focus();
            }
            else
            {
                Txtitems.Focus();
            }
        }
 private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (tabControl1.SelectedTab == tabPage1)
     {
         Txtitems.Focus();
     }
     if (tabControl1.SelectedTab == tabPage2)
     {
         DGListado.DataSource = NegocioRetirodeMercaderia.buscarconcatenacion(idcliente, CBEstado.Text, "", dtpFechaIni.Value.ToString("dd/MM/yyyy"), dtpFechaFin.Value.ToString("dd/MM/yyyy"),
                                                                              CHKCliente.Checked, CHKEstado.Checked, CHKTipo.Checked, CHKFecha.Checked, Convert.ToInt32(CbTipopedido.SelectedValue));
     }
 }
 private void TXTCantidad_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (TXTCantidad.Text != "")
         {
             recorreritems(Convert.ToInt64(Txtitems.Text), Convert.ToInt32(TXTCantidad.Text));
             Txtitems.Text    = "";
             TXTCantidad.Text = "0";
             Txtitems.Focus();
             CHKCambiarcantidad.Checked = false;
         }
     }
 }