protected void BtnNro_Click(object sender, EventArgs e) { List <Articulo> ListaAux = new List <Articulo>(); if (IsValid) { if (RadioButtonListBusqueda.SelectedValue == "nro") { if (!_isRefresh) { AuxPedido = ControlPedido.BuscarNroPedidoEstadoEntregado(Convert.ToInt32(TxtNro.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; } else { ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "errorpedido();", true); } } else { Response.Redirect("EditarPedido.aspx"); } } } }
protected void BtnNro_Click(object sender, EventArgs e) { ListaDetalleDTO = (List <DetallePedidoDTO>)Session["ListaDetalleDTO"]; if (IsValid) { if (RadioButtonListBusqueda.SelectedValue == "nro") { if (!_isRefresh) { AuxPedido = ControlPedido.BuscarNroPedidoEstadoEntregado(Convert.ToInt32(TxtNro.Text)); if (AuxPedido != null) { Session["PedidoSession"] = AuxPedido; cli = ControlCliente.BuscarID(AuxPedido.Clienteid); TxtNombre.Text = cli.Apellido + " " + cli.Nombre; txtnropedidomostrar.Text = Convert.ToString(AuxPedido.Nropedido); txtfechamostrar.Text = Convert.ToString(DateTime.Now.ToString("yyyy/MM/dd")); TxtTipoFactura.Text = Convert.ToString(TipoFactura(cli.Tipo)); Tipo = TipoFactura(cli.Tipo); ListaDetalleDTO = ControlDetallePedido.DevolverTodoxID(AuxPedido.Pedidoid); Session["ListaDetalleDTO"] = ListaDetalleDTO; RefrescarTabla(); } else { ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "errorpedido();", true); } } else { Response.Redirect("AgregarFactura.aspx"); } } } }