protected void ImageButtonP_Click(object sender, ImageClickEventArgs e)
        {
            ImageButton ImgB  = sender as ImageButton;
            GridViewRow gvRow = (GridViewRow)ImgB.NamingContainer;

            AuxPedido = ControlPedido.BuscarNro(Convert.ToInt32(gvRow.Cells[2].Text));
            if (AuxPedido != null)
            {
                Cliente cli = ControlCliente.BuscarID(AuxPedido.Clienteid);
                TxtNombre.Text           = cli.Apellido + " " + cli.Nombre;
                txtnropedidomostrar.Text = Convert.ToString(AuxPedido.Nropedido);
                txtfechamostrar.Text     = Convert.ToString(AuxPedido.Fecha.ToString("yyyy/MM/dd"));
                ListaDetalleDTO          = ControlDetallePedido.DevolverTodoxID(AuxPedido.Pedidoid);
                RefrescarTabla();
                BtnGuardar.Enabled      = true;
                BtnBuscarNombre.Enabled = true;
                TextCant.Focus();
            }
        }
        protected void BtnBuscarNombre_Click(object sender, EventArgs e)
        {
            ArticuloId = null;
            List <Articulo> ListaNombre = new List <Articulo>();

            if (IsValid)
            {
                if (!_isRefresh)
                {
                    if ((HdfArt.Value == null) || (string.IsNullOrEmpty(HdfArt.Value)))
                    {
                        ListaNombre = ControlArticulo.BuscarXNombreMarcaActivo(TxtBuscarNombre.Text.ToLower());
                        if (ListaNombre.Count != 0)
                        {
                            if (!_isRefresh)
                            {
                                GrillaBuscarArt.DataSource = ListaNombre;
                                GrillaBuscarArt.DataBind();
                                ModalPopupExtender2.Show();
                            }
                            else
                            {
                                Response.Redirect("EditarPedido.aspx");
                            }
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "erroralertart();", true);
                        }
                    }
                    else
                    {
                        ArticuloId = ControlArticulo.BuscarXIdActivo(Convert.ToInt32(HdfArt.Value));
                        if (ControlDetallePedido.ArtRepetidosEnElPedidoDetalle(ListaDetalleDTO, ArticuloId) == false)
                        {
                            HdfArt.Value = null;
                            if (!_isRefresh)
                            {
                                ModalPopupExtender3.Show();
                                TextCant.Focus();
                            }
                            else
                            {
                                //Limpiar();
                                Response.Redirect("EditarPedido.aspx");
                            }
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "ArtIngresado();", true);
                            TxtBuscarNombre.Text = "";
                        }
                    }
                }
                else
                {
                    //Limpiar();
                    Response.Redirect("EditarPedido.aspx");
                }
            }
        }