Exemplo n.º 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.";
            }
        }
Exemplo n.º 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;
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string User = Page.User.Identity.Name;

        DUser = new nsCliente.Usuario(User);


        if (DUser.HasEmpresa)
        {
            if (DUser.InfoEmpresas.Count > 1)
            {
                PnlBtnToMdlChangeCli.Visible = true;
            }
            else
            {
                PnlBtnToMdlChangeCli.Visible = false;
            }
            rut = Request.QueryString["RUT"];
            if (!string.IsNullOrEmpty(rut))
            {
                Cli         = new DatosCliente(rut);
                ClienteEcom = new GetInfoClienteEcomm(rut);
            }
            else
            {
                Cli         = DUser.InfoEmpresas.First();
                ClienteEcom = new GetInfoClienteEcomm(Cli.Rut);
            }
            if (!IsPostBack)
            {
                HdnRutCli.Value = Cli.Rut;
                FillInformation(Cli);
                Thread.CurrentThread.CurrentCulture = new CultureInfo("es-CL");
                FechasExpress.Get get;
                get               = new FechasExpress.Get("TER", ClienteEcom.DiasDeTrato, 7);
                diastermo.Text    = "(" + get.DiasEntrega.ToString() + " días hábiles)";
                FechaTermo.Text   = "Entrega el " + get.FechaCorte.ToShortDateString();
                get               = new FechasExpress.Get("LAMINA", 7);
                DiasLaminas.Text  = "(" + get.DiasEntrega.ToString() + " días hábiles)";
                FechaLaminas.Text = "Entrega el " + get.FechaCorte.ToShortDateString();
                get               = new FechasExpress.Get("ARQ", 0, 7);
                DiasArq.Text      = "(" + get.DiasEntrega.ToString() + " días hábiles)";
                FechaArq.Text     = "Entrega el " + get.FechaCorte.ToShortDateString();
            }
            else
            {
            }
        }
        else
        {
            Response.Redirect(Error404.Redireccion(MasterPageFile, User + ", no tienes empresa asignada :(. Por favor comuníquese con el administrador."));
        }
    }