Exemple #1
0
        public EnviarPedidoDVH(PedidoEcom _Pedido, GetInfoClienteEcomm InfoCliEcom)
        {
            pedidoEcom       = _Pedido;
            infoClienteEcomm = InfoCliEcom;
            DatosCli         = new DatosCliente(pedidoEcom.RUT);
            if (DatosCli.Region == "05")
            {
                Sucursal = "VIÑA DEL MAR";
            }
            else
            {
                Sucursal = "SANTIAGO";
            }
            if (!DatosCli.Bloqueado && DatosCli.EFinanciero.Disponible > _Pedido.Bruto)
            {
                PedidoAlfak.Generate generate = new PedidoAlfak.Generate(_Pedido, Sucursal);
                if (generate.IsSuccess)
                {
                    NroPedido = generate.NroPedido;

                    /*actualizar el nro de pedido en PLABAL*/
                    /*Ingresar en PLABAL.Planificacion*/
                }
                else
                {
                    IsSuccess = false;
                    Mensaje   = generate.Mensaje;
                }
            }
            else
            {
                IsSuccess = false;
                Mensaje   = "El pedido no pudo ser ingresado debido a que el cliente está bloqueado o el cupo disponible no alcanza.";
            }
        }
Exemple #2
0
    protected void Page_Load()
    {
        rut   = Request.QueryString["RUT"];
        ID    = Request.QueryString["ID"];
        TOKEN = Request.QueryString["TOKEN"];



        if (!string.IsNullOrEmpty(rut) && !string.IsNullOrEmpty(ID) && !string.IsNullOrEmpty(TOKEN))
        {
            HtmlGenericControl a = new HtmlGenericControl("a")
            {
                InnerHtml = "Pedidos",
            };
            a.Attributes.Add("href", Page.ResolveUrl("/View/Cliente/MisPedidos/Default.aspx?RUT=") + rut);
            BreadPedido.Controls.Add(a);
            if (!IsPostBack)
            {
                PedidoEcom.UpdateMontos montos = new PedidoEcom.UpdateMontos(ID, TOKEN);
                if (montos.IsSuccess)
                {
                    Pedido       = montos.Pedido;
                    Cliente      = new GetInfoClienteEcomm(Pedido.RUT);
                    DatosCliente = montos.datosCliente;
                    FillInfoCabecera();
                    FillDetailTable();
                    FillDDLAddItem();
                    if (montos.TieneMensaje)
                    {
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "myalert", "alert('" + montos.Mensaje + "');", true);
                    }
                }
                else
                {
                    Response.Redirect(Error404.Redireccion(MasterPageFile, montos.Mensaje));
                }
            }
            else
            {
                PedidoEcom.Get get = new PedidoEcom.Get(ID, TOKEN);
                if (get.IsSuccess)
                {
                    Pedido       = get.Pedido;
                    Cliente      = get.InfoCliente;
                    DatosCliente = get.Cliente;
                }
                else
                {
                    Response.Redirect(Error404.Redireccion(MasterPageFile, "Error en la Url."));
                }
            }
        }
        else
        {
            Response.Redirect(Error404.Redireccion(MasterPageFile, " No tienes acceso a esta página."));
        }

        BtnSendOrder.Enabled = false;
    }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        rut   = Request.QueryString["RUT"];
        Token = Request.QueryString["TOKEN"];
        ID    = Request.QueryString["ID"];
        OLD   = Request.QueryString["OLD"];

        if (!string.IsNullOrEmpty(rut) && !string.IsNullOrEmpty(OLD) && !string.IsNullOrEmpty(ID))
        {
            HtmlGenericControl a = new HtmlGenericControl("a")
            {
                InnerHtml = "Pedidos",
            };
            a.Attributes.Add("href", Page.ResolveUrl("/View/Cliente/MisPedidos/Default.aspx?RUT=") + rut);
            BreadPedido.Controls.Add(a);
            Random Rnd   = new Random();
            string Fondo = Rnd.Next(1, 11).ToString() + ".png";
            contenedor.Attributes.Add("style", "background: url(" + Page.ResolveUrl("/Images/Fondos/random/" + Fondo) + ") no-repeat center center fixed;background-size: cover;");
            if (Convert.ToBoolean(OLD))
            {
                GetOldPedido = new PedidoEcom.GetOld(ID, rut);
                Pedido       = GetOldPedido.Pedido;

                getItems = new PedidoEcom.GetItems(Pedido.NroPedido);
                if (getItems.TieneItems)
                {
                    Items = getItems.Lista;
                    FillTabla();
                    FillEncabezado();
                }
            }
            else
            {
                GetPedido = new PedidoEcom.Get(ID, Token);
                Pedido    = GetPedido.Pedido;
                getItems  = new PedidoEcom.GetItems(Pedido.NroPedido.Split(','));
                if (getItems.TieneItems)
                {
                    Items = getItems.Lista;
                    FillTabla();
                    FillEncabezado();
                }
            }
        }
        else
        {
            Response.Redirect(Error404.Redireccion(MasterPageFile, " Error al intentar acceder a la página."));
        }
    }
Exemple #4
0
    private void FillSummaryTable(PedidoEcom Ped)
    {
        HtmlGenericControl table = new HtmlGenericControl("table")
        {
            ID = "TablaTotales"
        };

        table.Attributes.Add("class", "table card-border-naranjo");
        HtmlGenericControl strong = new HtmlGenericControl("strong");
        HtmlGenericControl tbody  = new HtmlGenericControl("tbody");
        HtmlGenericControl td;
        HtmlGenericControl tr;

        /*Neto Total*/
        tr = new HtmlGenericControl("tr");

        td = new HtmlGenericControl("td");
        td.Attributes.Add("style", "text-align:right;");
        strong = new HtmlGenericControl("strong")
        {
            InnerHtml = "Neto Total"
        };
        td.Controls.Add(strong);

        tr.Controls.Add(td);
        td     = new HtmlGenericControl("td");
        strong = new HtmlGenericControl("strong")
        {
            InnerHtml = Ped.Neto.ToString("C0", CultureInfo.CurrentCulture)
        };
        td.Controls.Add(strong);
        tr.Controls.Add(td);
        /*agrega al tbody*/
        tbody.Controls.Add(tr);

        /*IVA*/
        tr = new HtmlGenericControl("tr");

        td = new HtmlGenericControl("td")
        {
            InnerHtml = "IVA (19%)"
        };
        td.Attributes.Add("style", "text-align:right;");


        tr.Controls.Add(td);
        td = new HtmlGenericControl("td")
        {
            InnerHtml = Ped.Iva.ToString("C0", CultureInfo.CurrentCulture)
        };
        tr.Controls.Add(td);
        /*agrega al tbody*/
        tbody.Controls.Add(tr);

        /*TOTAL*/
        tr = new HtmlGenericControl("tr");

        td = new HtmlGenericControl("td");
        td.Attributes.Add("style", "text-align:right;");
        strong = new HtmlGenericControl("strong")
        {
            InnerHtml = "TOTAL"
        };
        td.Controls.Add(strong);

        tr.Controls.Add(td);
        td     = new HtmlGenericControl("td");
        strong = new HtmlGenericControl("strong")
        {
            InnerHtml = Ped.Bruto.ToString("C0", CultureInfo.CurrentCulture)
        };
        td.Controls.Add(strong);
        tr.Controls.Add(td);
        /*agrega al tbody*/
        tbody.Controls.Add(tr);
        table.Controls.Add(tbody);
        DivSummary.Controls.Clear();
        DivSummary.Controls.Add(table);
    }