示例#1
0
    protected void Page_Load()
    {
        rut   = Request.QueryString["RUT"];
        ID    = Request.QueryString["ID"];
        TOKEN = Request.QueryString["TOKEN"];

        //UnidadFomento.GetUF getUF = new UnidadFomento.GetUF(DateTime.Now);


        //var ufff = getUF.Lista.UFs.First();

        if (ValidarIngreso(rut, ID, TOKEN))
        {
            Page.Title = "Cot N°" + Cot.Correlativo + "-" + Cot.Cliente.Nombre;
            if (!IsPostBack)
            {
                Encabezado();
                FormularioModelos.GetFamilias familias = new FormularioModelos.GetFamilias();
                FillDDL(DDlFamilia, "value", "key", "--Seleccionar--", familias.Datos);
                OTRosCostos(Cot);
                GastosGrales(Cot);
                Margen(Cot);
                Descuento(Cot);
                FillTablaDetalleyTotales(ID, true, Cot.MARGEN);
            }
        }
        else
        {
            Response.Redirect(Error404.Redireccion(MasterPageFile, " la página no fue encontrada."));
        }
    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        rut = Request.QueryString["RUT"];
        DateTime.TryParse(Request.QueryString["DFrom"], out DFrom);
        DateTime.TryParse(Request.QueryString["DTo"], out DTo);



        if (!string.IsNullOrEmpty(rut))
        {
            Random Rnd = new Random();
            if (!IsPostBack)
            {
                CantItems = 10;
                DoFiltering();
            }
            else
            {
                CantItems = Convert.ToInt32(DDlTopitems.SelectedValue);
            }

            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;");
            FillInfoCabecera();
        }
        else
        {
            Response.Redirect(Error404.Redireccion(MasterPageFile, " Error al intentar entrar en la página."));
        }
    }
示例#3
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;
    }
示例#4
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;
            }
            if (!IsPostBack)
            {
                rut = Request.QueryString["RUT"];
                if (!string.IsNullOrEmpty(rut))
                {
                    Cli = new DatosCliente(rut);
                }
                else
                {
                    Cli = DUser.InfoEmpresas.First();
                }
                HdnRutCli.Value = Cli.Rut;
                FillInformation(Cli);
            }
            else
            {
            }
        }
        else
        {
            Response.Redirect(Error404.Redireccion(MasterPageFile, User + ", no tienes empresa asignada :(. Por favor comuníquese con el administrador."));
        }



        Thread.CurrentThread.CurrentCulture = new CultureInfo("es-CL");
        FunDetPed    Funcion           = new FunDetPed();
        PlazoEntrega Plazoentregatermo = Funcion.PlazoEntrega("Termo");

        diastermo.Text  = "(" + Plazoentregatermo.Dias.ToString() + " días hábiles)";
        FechaTermo.Text = "Entrega el " + Plazoentregatermo.Fecha.ToShortDateString();
        PlazoEntrega Plazolamina = Funcion.PlazoEntrega("Lamina");

        DiasLaminas.Text  = "(" + Plazolamina.Dias.ToString() + " días hábiles)";
        FechaLaminas.Text = "Entrega el " + Plazolamina.Fecha.ToShortDateString();
        PlazoEntrega Plazoarq = Funcion.PlazoEntrega("Arq");

        DiasArq.Text  = "(" + Plazoarq.Dias.ToString() + " días hábiles)";
        FechaArq.Text = "Entrega el " + Plazoarq.Fecha.ToShortDateString();
    }
示例#5
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."));
        }
    }
示例#6
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."));
        }
    }
示例#7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string rut = Request.QueryString["RUT"];

        if (!string.IsNullOrEmpty(rut))
        {
            HdnRutCli.Value = rut;
            string User = Page.User.Identity.Name;
            DUser = new nsCliente.Usuario(User);
            Cli   = DUser.InfoEmpresas.Where(it => it.Rut == rut).First();
        }
        else
        {
            Response.Redirect(Error404.Redireccion(MasterPageFile, "Hubo un error al tratar de buscar la empresa, intentelo en otro momento."));
        }
    }
示例#8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        IDENDODET = Request.QueryString["IDENDODET"];
        IDENDO    = Request.QueryString["IDENDO"];
        TOKEN     = Request.QueryString["TOKEN"];
        NOMBRE    = Request.QueryString["NAME"];

        if (ValidarIngreso())
        {
            Page.Title = "Cot N°" + Cot.Correlativo + "-" + Cot.Cliente.Nombre;
            if (!IsPostBack)
            {
            }
        }
        else
        {
            Response.Redirect(Error404.Redireccion(MasterPageFile, " la página no fue encontrada."));
        }
    }
示例#9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string ID = Request.QueryString["ID"];

        TOKEN = Request.QueryString["TOKEN"];

        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(ID) && !string.IsNullOrEmpty(TOKEN))
            {
                ComponentesClass CsC          = new ComponentesClass();
                bool             IsComponente = CsC.IsComponente(ID, TOKEN);
                HdnIdComp.Value = ID;
                if (IsComponente)
                {
                    Imagen.ImageUrl = CsC._Detalle.Path_Photo;

                    TxtNombre.Text      = CsC._Detalle.Nombre;
                    LblCreateDate.Text  = CsC._Detalle.F_Creacion.ToLongDateString();
                    LblEditDate.Text    = CsC._Detalle.F_Actualizacion.ToLongDateString();
                    TxtDescripcion.Text = CsC._Detalle.Descripcion;


                    FillDDLMagnitud();
                    FamiliasAlfak alfak = new FamiliasAlfak();
                    List <FamiliasAlfak.Familia> familias = alfak.familias;
                    FamiliasAlfak.Familia        Item1    = new FamiliasAlfak.Familia {
                        ID = "VI", Name = "VIDRIOS"
                    };
                    familias.Add(Item1);

                    FillDDL(DDLTipoProcAsocAlfak, "Name", "ID", "Seleccionar Tipo", familias);

                    if (string.IsNullOrEmpty(CsC._Detalle.COD_ALFAK))
                    {
                        LblEditAsocAlfak.Text        = "El componente no tiene asociado ningún código en Alfak";
                        LinkTomdlAsocAlfak.InnerHtml = "Asociar";
                        TitleMdlAsocAlfak1.InnerHtml = "Asociar Código Alfak";
                    }
                    else
                    {
                        ProductoAlfak             alfakP   = new ProductoAlfak();
                        ProductoAlfak.BA_PRODUKTE producto = alfakP.GetByCod(CsC._Detalle.COD_ALFAK);
                        LblEditAsocAlfak.Text        = "El componente tiene asociado el código Alfak \"" + producto.CodigoAlfak + "\" - " + producto.Descripcion;
                        lblFamilyAlfak.Text          = "Familia Alfak " + producto.Familia_Alfak;
                        LinkTomdlAsocAlfak.InnerHtml = "Editar";
                        TitleMdlAsocAlfak1.InnerHtml = "Editar Código Alfak";
                    }



                    //habilita el textbox si es que no tiene precio
                    if (CsC._Detalle.PrecioUn == 0)
                    {
                    }
                    //habilita el textbox para actualizar la cantidad del componente
                    if (CsC._Detalle.CantEmb == 0)
                    {
                    }



                    //verifica si tiene precio
                    if (CsC._Detalle.PrecioUn == 0)
                    {
                        BtnEditPrecio.InnerHtml = "Ingresar";
                        LblPrecioydim.Text      = "Debe ingresar precio y dimensión.";
                    }
                    else
                    {
                        BtnEditPrecio.InnerHtml = "Editar";
                        GetMagnitudes Mag = new GetMagnitudes();

                        LblPrecioydim.Text        = "Precio por " + CsC._Detalle.UnMedSimbolo + " : " + CsC._Detalle.PrecioUn.ToString("C0", CultureInfo.CurrentCulture);
                        LblCantEmb.Text           = CsC._Detalle.CantEmb + " " + CsC._Detalle.UnidadMedida + " por unidad de entrega.";
                        TxtPrecio.Text            = CsC._Detalle.PrecioUn.ToString();
                        TxtCant.Text              = CsC._Detalle.CantEmb.ToString();
                        DDLmagnitud.SelectedValue = CsC._Detalle.Magnitud;
                        DDLUnidadmed.Visible      = true;
                        GetMagnitudes Mag2 = new GetMagnitudes(CsC._Detalle.Magnitud);

                        FillDDLUnidadmed(Mag2.AllMagnitudes);

                        DDLUnidadmed.SelectedValue = CsC._Detalle.ID_Magnitud;
                        LblPrecioX.Visible         = true;
                        LblCantX.Visible           = true;
                        TxtCant.Visible            = true;
                        TxtPrecio.Visible          = true;
                        LblCant2.Visible           = true;

                        LblCantX.Text       = CsC._Detalle.UnidadMedida + " por unidad de entrega:";
                        LblMedida1.Visible  = true;
                        LblSimbolUn.Visible = true;
                        LblPrecioX.Text     = "Precio por " + CsC._Detalle.UnMedSimbolo + ":";
                    }

                    //verifica si tiene procesos asociados
                    ProcesosClass.GetProcNoAsign procesos = new ProcesosClass.GetProcNoAsign(ID, true);
                    FillDDlProcesos(procesos.Procesos);
                    if (!CsC._Detalle.HasProc)
                    {
                        LblProcesos.Text     = "No tiene procesos asociados";
                        LblMdltitleProc.Text = "Agregar Procesos";
                    }
                    else
                    {
                        LblMdltitleProc.Text = "Agregar Procesos";
                        LblProcesos.Visible  = false;
                        ProcesosClass.GetProcAsign procAsign = new ProcesosClass.GetProcAsign(ID, true);
                        FillingTable(procAsign.Procesos);
                    }
                }
                else
                {
                    Response.Redirect(Error404.Redireccion(MasterPageFile, "El componente no fue encontrado"));
                }
            }
            else
            {
                Response.Redirect(Error404.Redireccion(MasterPageFile, "Hubo un error al tratar de buscar el componente, intentelo nuevamente"));
            }
        }
    }
示例#10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string ID = Request.QueryString["ID"];

        TOKEN = Request.QueryString["TOKEN"];

        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(ID) && !string.IsNullOrEmpty(TOKEN))
            {
                Modelos Model   = new Modelos();
                bool    IsModel = Model.IsModel(ID, true, TOKEN);
                HdnIdModel.Value = ID;
                if (IsModel)
                {
                    //Llena el dropdown de las formulas predeterminadas
                    FillDDlFormulasPred(DDLFormulasPred);

                    //fill DDL piezas y copmponentes
                    FillDDLFirstPieceOrComp();

                    Imagen.ImageUrl = Model._modelo.IMAGE;

                    TxtNombre.Text      = Model._modelo.NOMBRE;
                    LblCreateDate.Text  = Model._modelo.F_Created.ToLongDateString();
                    LblEditDate.Text    = Model._modelo.F_Update.ToLongDateString();
                    TxtDescripcion.Text = Model._modelo.DESCRIPCION;

                    FillDDlFamilia();

                    BomModel bomModel = new BomModel(ID, true);
                    FILLtablaBOM(bomModel.Lista);

                    //Fill DDr canales no asignaDOS y tabla



                    CanalDis cdis = new CanalDis();
                    FillTablaCanales(cdis.GetCanalesAsign(ID, true));
                    FillDDL(DDlSelectChanel, "CHANNAME", "ID", "Seleccionar", cdis.GetCanalesNOAsign(ID, true));

                    // Habilita el ddl de la familia
                    if (string.IsNullOrEmpty(Model._modelo.Familia))
                    {
                        DDLFamilia.Enabled   = true;
                        DDLCategoria.Enabled = false;
                        LinkBtnFamCat.Text   = "Actualizar";
                    }
                    else
                    {
                        DDLFamilia.SelectedValue = Model._modelo.IdFamilia;
                    }
                    //habilita el ddl de categoria
                    if (string.IsNullOrEmpty(Model._modelo.Categoria))
                    {
                        DDLCategoria.Enabled = false;
                        LinkBtnFamCat.Text   = "Actualizar";
                        GetListVariables getList = new GetListVariables(6);
                        FillDDlCategoria(getList.Listavariables);
                    }
                    else
                    {
                        GetListVariables Get = new GetListVariables();
                        Get.GetListModelCategory(Model._modelo.IdFamilia);
                        FillDDlCategoria(Get.ListCompCategory);
                        DDLCategoria.SelectedValue = Model._modelo.ID_PASIGFAMCAT.ToString();
                    }
                }
                else
                {
                    Response.Redirect(Error404.Redireccion(MasterPageFile, "El componente no fue encontrado"));
                }
            }
            else
            {
                Response.Redirect(Error404.Redireccion(MasterPageFile, "Hubo un error al tratar de buscar el componente, intentelo nuevamente"));
            }
        }
    }