コード例 #1
0
 protected void BtnCli_Click(object sender, EventArgs e)
 {
     ListaDetalleDTO = (List <DetallePedidoDTO>)Session["ListaDetalleDTO"];
     if (IsValid)
     {
         if (RadioButtonListBusqueda.SelectedValue == "cliente")
         {
             if ((hdnIDCli.Value == null) || (string.IsNullOrEmpty(hdnIDCli.Value)))
             {
                 ListaDTO = ControlPedido.PedidoPorNombreApellido(TxtCli.Text.ToLower());
                 if (ListaDTO.Count != 0)
                 {
                     if (!_isRefresh)
                     {
                         RefrescarTablaNombreApellido();
                         ModalPopupExtenderUno.Show();
                     }
                     else
                     {
                         Response.Redirect("AgregarFactura.aspx");
                     }
                 }
                 else
                 {
                     ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "errorcliente();", true);
                 }
             }
             else
             {
                 if (!_isRefresh)
                 {
                     AuxPedido = ControlPedido.BuscarID(Convert.ToInt32(hdnIDCli.Value));
                     if (AuxPedido != null)
                     {
                         Session["PedidoSession"] = AuxPedido;
                         hdnIDCli.Value           = null;
                         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"));
                         Tipo                       = TipoFactura(cli.Tipo);
                         TxtTipoFactura.Text        = Convert.ToString(TipoFactura(cli.Tipo));
                         ListaDetalleDTO            = ControlDetallePedido.DevolverTodoxID(AuxPedido.Pedidoid);
                         Session["ListaDetalleDTO"] = ListaDetalleDTO;
                         RefrescarTabla();
                     }
                 }
                 else
                 {
                     Response.Redirect("AgregarFactura.aspx");
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: EditarPedido.aspx.cs プロジェクト: DAzcurra/TpFinal
 protected void BtnCli_Click(object sender, EventArgs e)
 {
     ListaDTO = null;
     if (IsValid)
     {
         if (RadioButtonListBusqueda.SelectedValue == "cliente")
         {
             if ((hdnIDCli.Value == null) || (string.IsNullOrEmpty(hdnIDCli.Value)))
             {
                 ListaDTO = ControlPedido.PedidoPorNombreApellido(TxtCli.Text.ToLower());
                 if (ListaDTO.Count != 0)
                 {
                     if (!_isRefresh)
                     {
                         RefrescarTablaNombreApellido();
                         ModalPopupExtenderUno.Show();
                     }
                     else
                     {
                         Response.Redirect("EditarPedido.aspx");
                     }
                 }
                 else
                 {
                     ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "errorcliente();", true);
                 }
             }
             else
             {
                 if (!_isRefresh)
                 {
                     AuxPedido = ControlPedido.BuscarID(Convert.ToInt32(hdnIDCli.Value));
                     if (AuxPedido != null)
                     {
                         hdnIDCli.Value = 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
                 {
                     Response.Redirect("EditarPedido.aspx");
                 }
             }
         }
     }
 }