Пример #1
0
        protected void btnSeleccionarProductos_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow item in gvProductos.Rows)
            {
                CheckBox lnkSeleccionar = (CheckBox)item.FindControl("lnkSeleccionar");
                if (lnkSeleccionar != null)
                {
                    List <UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga> ListaProducto = new List <UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga>();
                    if (Session["ListaProducto"] != null)
                    {
                        ListaProducto = (List <UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga>)Session["ListaProducto"];
                    }

                    if (lnkSeleccionar.Checked)
                    {
                        UPC.CruzDelSur.Datos.Carga.Producto          oBL_Producto = new UPC.CruzDelSur.Datos.Carga.Producto();
                        UPC.CruzDelSur.Negocio.Modelo.Carga.Producto oBE_Producto = oBL_Producto.f_ListadoUnoProducto(Int32.Parse(lnkSeleccionar.CssClass));


                        ListaProducto.RemoveAll(item2 => item2.CODIGO_PRODUCTO == oBE_Producto.CODIGO_PRODUCTO);
                        ListaProducto.RemoveAll(item2 => item2.CODIGO_PRODUCTO == 0);

                        UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga oBE_DetalleCarga = new UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga();
                        oBE_DetalleCarga.CODIGO_PRODUCTO = oBE_Producto.CODIGO_PRODUCTO;
                        oBE_DetalleCarga.DESCRIPCION     = oBE_Producto.DESCRIPCION;
                        oBE_DetalleCarga.PRECIO          = oBE_Producto.PRECIO;
                        ListaProducto.Add(oBE_DetalleCarga);

                        Session["ListaProducto"] = ListaProducto;
                    }
                }
                this.Controls.Add(new LiteralControl("<script language='JavaScript'>alert('Se Actualizaron los productos'); CloseFormOK();</script>"));
            }
        }
Пример #2
0
 void CargarProdutos()
 {
     //CREAMOS LOS PARAMETROS
     UPC.CruzDelSur.Datos.Carga.Producto oBL_Producto = new UPC.CruzDelSur.Datos.Carga.Producto();
     gvProductos.DataSource = oBL_Producto.f_ListadoProducto(txtDescripcion.Text.Trim());
     gvProductos.DataBind();
 }
Пример #3
0
        protected void gvProductos_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Eliminar")
            {
                List <UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga> ListaProducto = new List <UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga>();
                if (Session["ListaProducto"] != null)
                {
                    ListaProducto = (List <UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga>)Session["ListaProducto"];
                    UPC.CruzDelSur.Datos.Carga.Producto          oBL_Producto = new UPC.CruzDelSur.Datos.Carga.Producto();
                    UPC.CruzDelSur.Negocio.Modelo.Carga.Producto oBE_Producto = oBL_Producto.f_ListadoUnoProducto(Int32.Parse(e.CommandArgument.ToString()));

                    ListaProducto.RemoveAll(item => item.CODIGO_PRODUCTO == oBE_Producto.CODIGO_PRODUCTO);

                    Session["ListaProducto"] = ListaProducto;
                    gvProductos.DataSource   = ListaProducto;
                    gvProductos.DataBind();

                    CalculaPesoTotalImporteTotal();
                }
            }
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(Context.Request.QueryString["idficha"]))
            {
                hffichacarga.Value = Context.Request.QueryString["idficha"].ToString();


                Session["idcarga2"] = hffichacarga.Value;


                UPC.CruzDelSur.Datos.Carga.Carga          oBL_Carga = new UPC.CruzDelSur.Datos.Carga.Carga();
                UPC.CruzDelSur.Negocio.Modelo.Carga.Carga oBE_Carga = oBL_Carga.f_ListadoUnoCarga(Int32.Parse(hffichacarga.Value));


                txtFicha.Text        = oBE_Carga.FICHA;
                txtObservacion.Text  = oBE_Carga.OBSERVACION;
                lblClave.Text        = oBE_Carga.CLAVE_SEGURIDAD;
                txtImporteTotal.Text = oBE_Carga.DBL_IMPORTETOTAL.ToString();

                txtigv.Text   = oBE_Carga.DBL_IGV.ToString();
                txtTotal.Text = oBE_Carga.DBL_TOTAL.ToString();

                txtPesoTotal.Text         = oBE_Carga.DBL_PESOTOTAL.ToString();
                ddlTipoPago.SelectedValue = oBE_Carga.TIPO_PAGO.ToString();


                UPC.CruzDelSur.Datos.Carga.DetalleCarga oBL_DetalleCarga = new UPC.CruzDelSur.Datos.Carga.DetalleCarga();


                if (Session["ListaProducto2"] == null)
                {
                    Session["ListaProducto2"] = oBL_DetalleCarga.f_ListaDetalleCarga(Int32.Parse(hffichacarga.Value));
                }



                Session["idProgramacionRuta2"] = oBE_Carga.CODIGO_PROGRAMACION_RUTA;
                Session["idRemitente2"]        = oBE_Carga.CLIENTE_ORIGEN;
                Session["idDestinatario2"]     = oBE_Carga.CLIENTE_DESTINO;
            }


            if (Session["idProgramacionRuta2"] != null)
            {
                //CREAMOS LOS PARAMETROS

                UPC.CruzDelSur.Datos.Carga.Programacion_Ruta oBL_Programacion_Ruta = new UPC.CruzDelSur.Datos.Carga.Programacion_Ruta();

                UPC.CruzDelSur.Negocio.Modelo.Carga.Programacion_Ruta oBE_Programacion_Ruta = oBL_Programacion_Ruta.f_UnoProgramacion_Ruta(Int32.Parse(Session["idProgramacionRuta2"].ToString()));


                ddlAgenciaDestino.SelectedValue = oBE_Programacion_Ruta.CODIGO_AGENCIADESTINO.ToString();
                txtFechasalida.Text             = oBE_Programacion_Ruta.FECHA_ORIGEN.Value.ToShortDateString();
                txtfechallegada.Text            = oBE_Programacion_Ruta.FECHA_DESTINO.Value.ToShortDateString();
                MK_ProgramacionRuta_ID.Value    = oBE_Programacion_Ruta.CODIGO_PROGRAMACION_RUTA.ToString();
                txtUnidadTransporte.Text        = oBE_Programacion_Ruta.PLACA.ToString();
            }


            //    if (Session["clave"] != null)
            //    {
            //        lblClave.Text = Session["clave"].ToString();
            //    }

            if (Session["idRemitente2"] != null)
            {
                UPC.CruzDelSur.Datos.Carga.Cliente          oBL_Cliente = new UPC.CruzDelSur.Datos.Carga.Cliente();
                UPC.CruzDelSur.Negocio.Modelo.Carga.Cliente oCliente    = oBL_Cliente.f_UnoCliente(Session["idRemitente2"].ToString());
                txtRemitente.Text     = String.Concat(oCliente.NOMBRES, " ", oCliente.APELLIDOS);
                txtDniRemitente.Text  = oCliente.DOCUMENTO;
                HFIdClienteRemi.Value = oCliente.DOCUMENTO;
            }
            if (Session["idDestinatario2"] != null)
            {
                UPC.CruzDelSur.Datos.Carga.Cliente          oBL_Cliente = new UPC.CruzDelSur.Datos.Carga.Cliente();
                UPC.CruzDelSur.Negocio.Modelo.Carga.Cliente oCliente    = oBL_Cliente.f_UnoCliente(Session["idDestinatario2"].ToString());

                txtDestinatario.Text    = String.Concat(oCliente.NOMBRES, " ", oCliente.APELLIDOS);
                txtDNIDestinatario.Text = oCliente.DOCUMENTO;

                HFIdClienteDest.Value = oCliente.DOCUMENTO;
            }



            List <UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga> ListaProducto = new List <UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga>();

            if (Session["ListaProducto2"] != null)
            {
                ListaProducto = (List <UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga>)Session["ListaProducto2"];
            }
            else
            {
                gvProductos.DataSource = null;
                gvProductos.DataBind();
            }
            if (Session["idProducto2"] != null)
            {
                UPC.CruzDelSur.Datos.Carga.Producto          oBL_Producto = new UPC.CruzDelSur.Datos.Carga.Producto();
                UPC.CruzDelSur.Negocio.Modelo.Carga.Producto oBE_Producto = oBL_Producto.f_ListadoUnoProducto(Int32.Parse(Session["idProducto2"].ToString()));


                ListaProducto.RemoveAll(item2 => item2.CODIGO_PRODUCTO == oBE_Producto.CODIGO_PRODUCTO);
                ListaProducto.RemoveAll(item2 => item2.CODIGO_PRODUCTO == 0);

                UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga oBE_DetalleCarga = new UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga();
                oBE_DetalleCarga.CODIGO_PRODUCTO = oBE_Producto.CODIGO_PRODUCTO;
                oBE_DetalleCarga.DESCRIPCION     = oBE_Producto.DESCRIPCION;
                oBE_DetalleCarga.PRECIO          = oBE_Producto.PRECIO;
                ListaProducto.Add(oBE_DetalleCarga);

                Session["ListaProducto2"] = ListaProducto;
            }
            if (Session["clave2"] != null)
            {
                lblClave.Text = Session["clave2"].ToString();
            }



            gvProductos.DataSource = ListaProducto;
            gvProductos.DataBind();



            //    //}

            //}
            //protected void setInfo()
            //{
            //    ViewState["codigoFicha"] = txtFicha.Text;
            //}
            //protected void GetInfo()
            //{
            //    txtFicha.Text = ViewState["codigoFicha"].ToString();
            this.Controls.Add(new LiteralControl("<script language='JavaScript'> window.print(); </script>"));
        }
Пример #5
0
        //ServletGestionCarga _servletGestionCarga = new ServletGestionCarga();


        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                UPC.CruzDelSur.Datos.Carga.Carga CodigoFicha = new UPC.CruzDelSur.Datos.Carga.Carga();

                UPC.CruzDelSur.Datos.Carga.Agencia blAgencia = new UPC.CruzDelSur.Datos.Carga.Agencia();


                ddlAgenciaOrigen.DataSource     = blAgencia.f_ListadoAgencia();
                ddlAgenciaOrigen.DataValueField = "CODIGO_AGENCIA";
                ddlAgenciaOrigen.DataTextField  = "NOMBRE";
                ddlAgenciaOrigen.DataBind();


                ddlAgenciaDestino.DataSource     = blAgencia.f_ListadoAgencia();
                ddlAgenciaDestino.DataValueField = "CODIGO_AGENCIA";
                ddlAgenciaDestino.DataTextField  = "NOMBRE";
                ddlAgenciaDestino.DataBind();



                txtFicha.Text = CodigoFicha.f_GenerarNumero();
                if (!String.IsNullOrEmpty(Context.Request.QueryString["idficha"]))
                {
                    hffichacarga.Value = Context.Request.QueryString["idficha"].ToString();


                    Session["idcarga"] = hffichacarga.Value;


                    UPC.CruzDelSur.Datos.Carga.Carga          oBL_Carga = new UPC.CruzDelSur.Datos.Carga.Carga();
                    UPC.CruzDelSur.Negocio.Modelo.Carga.Carga oBE_Carga = oBL_Carga.f_ListadoUnoCarga(Int32.Parse(hffichacarga.Value));


                    txtFicha.Text             = oBE_Carga.FICHA;
                    txtObservacion.Text       = oBE_Carga.OBSERVACION;
                    lblClave.Text             = oBE_Carga.CLAVE_SEGURIDAD;
                    txtImporteTotal.Text      = oBE_Carga.DBL_IMPORTETOTAL.ToString();
                    txtPesoTotal.Text         = oBE_Carga.DBL_PESOTOTAL.ToString();
                    ddlTipoPago.SelectedValue = oBE_Carga.TIPO_PAGO.ToString();


                    UPC.CruzDelSur.Datos.Carga.DetalleCarga oBL_DetalleCarga = new UPC.CruzDelSur.Datos.Carga.DetalleCarga();


                    Session["idProgramacionRuta"] = oBE_Carga.CODIGO_PROGRAMACION_RUTA;
                    Session["idRemitente"]        = oBE_Carga.CLIENTE_ORIGEN;
                    Session["idDestinatario"]     = oBE_Carga.CLIENTE_DESTINO;


                    if (Session["ListaProducto"] == null)
                    {
                        Session["ListaProducto"] = oBL_DetalleCarga.f_ListaDetalleCarga(Int32.Parse(hffichacarga.Value));
                    }



                    if (Session["idRemitente"] != null)
                    {
                        UPC.CruzDelSur.Datos.Carga.Cliente          oBL_Cliente = new UPC.CruzDelSur.Datos.Carga.Cliente();
                        UPC.CruzDelSur.Negocio.Modelo.Carga.Cliente oCliente    = oBL_Cliente.f_UnoCliente(Session["idRemitente"].ToString());
                        txtRemitente.Text     = String.Concat(oCliente.NOMBRES, " ", oCliente.APELLIDOS);
                        txtDniRemitente.Text  = oCliente.DOCUMENTO;
                        HFIdClienteRemi.Value = oCliente.DOCUMENTO;
                    }
                    if (Session["idDestinatario"] != null)
                    {
                        UPC.CruzDelSur.Datos.Carga.Cliente          oBL_Cliente = new UPC.CruzDelSur.Datos.Carga.Cliente();
                        UPC.CruzDelSur.Negocio.Modelo.Carga.Cliente oCliente    = oBL_Cliente.f_UnoCliente(Session["idDestinatario"].ToString());

                        txtDestinatario.Text    = String.Concat(oCliente.NOMBRES, " ", oCliente.APELLIDOS);
                        txtDNIDestinatario.Text = oCliente.DOCUMENTO;

                        HFIdClienteDest.Value = oCliente.DOCUMENTO;
                    }
                }
            }



            if (Session["idProgramacionRuta"] != null)
            {
                //CREAMOS LOS PARAMETROS

                UPC.CruzDelSur.Datos.Carga.Programacion_Ruta oBL_Programacion_Ruta = new UPC.CruzDelSur.Datos.Carga.Programacion_Ruta();

                UPC.CruzDelSur.Negocio.Modelo.Carga.Programacion_Ruta oBE_Programacion_Ruta = oBL_Programacion_Ruta.f_UnoProgramacion_Ruta(Int32.Parse(Session["idProgramacionRuta"].ToString()));


                ddlAgenciaDestino.SelectedValue = oBE_Programacion_Ruta.CODIGO_AGENCIADESTINO.ToString();
                txtFechasalida.Text             = oBE_Programacion_Ruta.FECHA_ORIGEN.Value.ToShortDateString();
                txtfechallegada.Text            = oBE_Programacion_Ruta.FECHA_DESTINO.Value.ToShortDateString();
                MK_ProgramacionRuta_ID.Value    = oBE_Programacion_Ruta.CODIGO_PROGRAMACION_RUTA.ToString();
                txtUnidadTransporte.Text        = oBE_Programacion_Ruta.PLACA.ToString();
            }


            //    if (Session["clave"] != null)
            //    {
            //        lblClave.Text = Session["clave"].ToString();
            //    }



            List <UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga> ListaProducto = new List <UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga>();

            if (Session["ListaProducto"] != null)
            {
                ListaProducto = (List <UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga>)Session["ListaProducto"];
            }
            else
            {
                gvProductos.DataSource = null;
                gvProductos.DataBind();
            }
            if (Session["idProducto"] != null)
            {
                UPC.CruzDelSur.Datos.Carga.Producto          oBL_Producto = new UPC.CruzDelSur.Datos.Carga.Producto();
                UPC.CruzDelSur.Negocio.Modelo.Carga.Producto oBE_Producto = oBL_Producto.f_ListadoUnoProducto(Int32.Parse(Session["idProducto"].ToString()));


                ListaProducto.RemoveAll(item => item.CODIGO_PRODUCTO == oBE_Producto.CODIGO_PRODUCTO);
                ListaProducto.RemoveAll(item => item.CODIGO_PRODUCTO == 0);

                UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga oBE_DetalleCarga = new UPC.CruzDelSur.Negocio.Modelo.Carga.DetalleCarga();
                oBE_DetalleCarga.CODIGO_PRODUCTO = oBE_Producto.CODIGO_PRODUCTO;
                oBE_DetalleCarga.DESCRIPCION     = oBE_Producto.DESCRIPCION;
                oBE_DetalleCarga.PRECIO          = oBE_Producto.PRECIO;
                ListaProducto.Add(oBE_DetalleCarga);

                Session["ListaProducto"] = ListaProducto;
            }
            if (Session["clave"] != null)
            {
                lblClave.Text     = "******";
                HFPregunta.Value  = Session["pregunta"].ToString();
                HFRespuesta.Value = Session["respuesta"].ToString();
            }


            if (gvProductos.Rows.Count != ListaProducto.Count())
            {
                gvProductos.DataSource = ListaProducto;
                gvProductos.DataBind();
            }



            CalculaPesoTotalImporteTotal();

            //    //}

            //}
            //protected void setInfo()
            //{
            //    ViewState["codigoFicha"] = txtFicha.Text;
            //}
            //protected void GetInfo()
            //{
            //    txtFicha.Text = ViewState["codigoFicha"].ToString();
        }