示例#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
        public ASPXHandler(String fileName, Dictionary <String, String> envVariables)
        {
            this.fileName      = fileName.Substring(fileName.LastIndexOf('\\') + 1);
            this.fullFilePath  = fileName;
            this.fileExtension = this.fileName.Substring(this.fileName.IndexOf('.'));

            if (File.Exists(fileName))
            {
                // Create an instance of Host class
                var aspxHost = new Host();
                // Pass to it filename and query string
                this.responseBody = aspxHost.CreateHost(
                    fileName,
                    envVariables["server_root"],
                    envVariables["query_string"]);
                this.responseHeader = new ResponseHeader("Status: 200 OK\r\nContent-Type: text/html\r\n");
                this.responseHeader.setContentLength(this.responseBody.Length);
            }
            else
            {
                var error = new Error404();
                this.responseHeader = error.getResponseHeader();
                this.responseBody   = error.getResponseBody();
            }
        }
示例#3
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."));
        }
    }
示例#4
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;
    }
        public Error404 errorPage(int currentUmbracoPageId)
        {
            var current = _umbracoHelper.TypedContent(currentUmbracoPageId);
            IPublishedContent _languageNode = current.AncestorOrSelf(DocumentTypeEnum.location.ToString());
            Error404          error         = new Error404(_languageNode.Descendant(DocumentTypeEnum.error404.ToString()));

            return(error);
        }
示例#6
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();
    }
示例#7
0
        public void URL_Verify_Document()
        {
            URL.GoTo(Parameters.production_URL_client_portal + "/asdasdasdasd");
            Error404 error = new Error404();

            Assert.IsTrue(error.IsAt, "[practice_name].accountantspace.co.uk did not load the ClientPortal Login page");
            error.Revert_to_OC_login_page();
            Thread.Sleep(5000);
            Assert.IsTrue(OneClick_LoginPage.IsAt, "OneClick login page is not loaded after clicking Take me back to dashboard");
        }
示例#8
0
        public PHPHandler(String fileName, Dictionary <String, String> envVariables)
        {
            this.scriptName   = fileName.Substring(fileName.LastIndexOf('\\') + 1);
            this.fullFilePath = fileName;
            if (File.Exists(fileName))
            {
                Process proc = new Process();
                proc.StartInfo.FileName = _config.Instance.CurrentConfig.WebHostPhpPath + "\\\\php-cgi.exe";
                proc.StartInfo.EnvironmentVariables.Add("REMOTE_ADDR", envVariables["remote_addr"]);
                proc.StartInfo.EnvironmentVariables.Add("SCRIPT_NAME", this.scriptName);
                proc.StartInfo.EnvironmentVariables.Add("USER_AGENT", envVariables["user_agent"]);
                proc.StartInfo.EnvironmentVariables.Add("REQUEST_METHOD", envVariables["request_method"]);
                proc.StartInfo.EnvironmentVariables.Add("REFERER", envVariables["referer"]);
                proc.StartInfo.EnvironmentVariables.Add("SERVER_PROTOCOL", envVariables["server_protocol"]);
                proc.StartInfo.EnvironmentVariables.Add("QUERY_STRING", envVariables["query_string"]);
                proc.StartInfo.EnvironmentVariables.Add("HTTP_COOKIE", envVariables["cookie"]);
                proc.StartInfo.EnvironmentVariables.Add("SCRIPT_FILENAME", this.fullFilePath);
                proc.StartInfo.EnvironmentVariables.Add("REDIRECT_STATUS", "200");
                proc.StartInfo.EnvironmentVariables.Add("CONTENT_LENGTH", envVariables["post"].Length.ToString());
                proc.StartInfo.EnvironmentVariables.Add("CONTENT_TYPE", "application/x-www-form-urlencoded");
                proc.StartInfo.EnvironmentVariables.Add("HTTP_RAW_POST_DATA", envVariables["post"]);
                if (proc.StartInfo.EnvironmentVariables.ContainsKey("PHPRC"))
                {
                    proc.StartInfo.EnvironmentVariables["PHPRC"] = _config.Instance.CurrentConfig.WebHostPhpPath;
                }
                else
                {
                    proc.StartInfo.EnvironmentVariables.Add("PHPRC", _config.Instance.CurrentConfig.WebHostPhpPath);
                }
                proc.StartInfo.UseShellExecute        = false;
                proc.StartInfo.RedirectStandardOutput = true;
                proc.StartInfo.RedirectStandardInput  = true;
                proc.StartInfo.RedirectStandardError  = true;
                proc.StartInfo.CreateNoWindow         = true;
                proc.Start();
                proc.StandardInput.WriteLine(envVariables["post"]);
                this.phpOutput      = proc.StandardOutput.ReadToEnd();
                this.phpErrorOutput = proc.StandardError.ReadToEnd();
                proc.Close();

                this.responseHeaders =
                    new ResponseHeader(
                        this.phpOutput.Substring(0, this.phpOutput.IndexOf("\r\n\r\n")),
                        this.fullFilePath);
                this.setResponseBody(this.phpOutput.Substring(this.phpOutput.IndexOf("\r\n\r\n")));
                this.responseHeaders.setContentLength(this.getContentLength());
            }
            else
            {
                var error = new Error404();
                this.responseHeaders = error.getResponseHeader();
                this.responseBody    = error.getResponseBody();
            }
        }
示例#9
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."));
        }
    }
示例#10
0
 private void SendError404(ref Socket sockets)
 {
     try
     {
         var error = new Error404();
         SendData(error.getResponseHeader().getResponseHeaders(), ref sockets);
         sockets.Close();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
 }
示例#11
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."));
        }
    }
示例#12
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."));
        }
    }
示例#13
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."));
        }
    }
示例#14
0
        public FileHandler(String fileName)
        {
            this.contentTypes.Add(".txt", "text/plain");
            this.contentTypes.Add(".html", "text/html");
            this.contentTypes.Add(".htm", "text/html");
            this.contentTypes.Add(".json", "application/json");
            this.contentTypes.Add(".xml", "application/xml");
            this.contentTypes.Add(".png", "image/png");
            this.contentTypes.Add(".gif", "image/gif");
            this.contentTypes.Add(".jpeg", "image/jpg");
            this.contentTypes.Add(".jpg", "image/jpg");
            this.contentTypes.Add(".css", "text/css");
            this.contentTypes.Add(".js", "application/javascript");

            this.fileName      = fileName.Substring(fileName.LastIndexOf('\\') + 1);
            this.fullFilePath  = fileName;
            this.fileExtension = this.fileName.Substring(this.fileName.LastIndexOf('.'));

            if (File.Exists(fileName))
            {
                var fs = new FileStream(this.fullFilePath, FileMode.Open, FileAccess.Read, FileShare.Read);
                this.responseBody       = new byte[fs.Length];
                this.responseBodyLength = this.responseBody.Length;
                fs.Read(this.responseBody, 0, this.responseBodyLength);
                fs.Close();

                string tmpHeader = "Status: 200 OK\r\n";
                if (this.contentTypes.ContainsKey(this.fileExtension))
                {
                    tmpHeader += "Content-Type: " + this.contentTypes[this.fileExtension] + "\r\n";
                }

                this.responseHeader = new ResponseHeader(tmpHeader);
                this.responseHeader.setContentLength(this.responseBodyLength);
            }
            else
            {
                var error = new Error404();
                this.responseHeader = error.getResponseHeader();
                this.responseBody   = Encoding.ASCII.GetBytes(error.getResponseBody());
            }
        }
示例#15
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"));
            }
        }
    }
示例#16
0
 public Error404 GetErrorPage()
 {
     return(_errorPage ?? (_errorPage = _contentHelper
                                        .GetDescendantOrSelf <Error404>(_siteService.GetDomainNodeId())));
 }
示例#17
0
 public ActionResult Index(Error404 Error404)
 {
     return(RedirectToAction("Index", "Home"));
 }
 public Error404 Put(string AppID, Error404 error)
 {
     return(General.ErrorLogging.Data.Error404.UpdateError404(error));
 }
 public Error404 Post(string AppID, Error404 error)
 {
     return(General.ErrorLogging.Data.Error404.RecordError404(error.AppID, error.Environment, error.ClientID, error.URL, error.UserAgent, error.Detail));
 }
示例#20
0
        public override ActionResult Index(RenderModel model)
        {
            Error404 page = model.As <Error404>();

            return(this.View("Error404", page));
        }
示例#21
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"));
            }
        }
    }
        /*
         * // GET api/[AppID]/Error404/IncludeSuppressed?StartDate=1/1/2015&EndDate=1/31/15&Environment=Dev&Filter=all
         * [HttpGet]
         * [Authorize]
         * public List<Error404> IncludeSuppressed(string AppID, DateTimeOffset StartDate, DateTimeOffset EndDate, string Environment, string Filter = "all")
         * {
         *  return ApplyFilters(General.ErrorLogging.Data.Error404.GetError404s_Hidden(ParseAppID(AppID), null, ParseEnvironment(Environment), StartDate, EndDate), Filter);
         * }
         *
         *
         * // GET api/[AppID]/Error404/IncludeSuppressed?StartDate=1/1/2015&EndDate=1/31/15&ClientID=1&Filter=all
         * [HttpGet]
         * [Authorize]
         * public List<Error404> IncludeSuppressed(string AppID, DateTimeOffset StartDate, DateTimeOffset EndDate, string ClientID, string Filter = "all")
         * {
         *  return ApplyFilters(General.ErrorLogging.Data.Error404.GetError404s_Hidden(ParseAppID(AppID), ClientID, null, StartDate, EndDate), Filter);
         * }
         *
         *
         * // GET api/[AppID]/Error404/IncludeSuppressed?StartDate=1/1/2015&EndDate=1/31/15&ClientID=1&Environment=Dev&Filter=all
         * [HttpGet]
         * [Authorize]
         * public List<Error404> IncludeSuppressed(string AppID, DateTimeOffset StartDate, DateTimeOffset EndDate, string ClientID, string Environment = "any", string Filter = "all")
         * {
         *  return ApplyFilters(General.ErrorLogging.Data.Error404.GetError404s_Hidden(ParseAppID(AppID), ClientID, ParseEnvironment(Environment), StartDate, EndDate), Filter);
         * }
         */
        #endregion

        #region Search
        private bool FullTextMatch(string strSearch, Error404 obj)
        {
            if (String.IsNullOrWhiteSpace(strSearch))
            {
                return(true);
            }

            var tokens = FullTextSearch.Tokenize(strSearch);

            bool blnHasNotToken      = tokens.Where(t => t.StartsWith("-")).Count() > 0;
            bool blnMatchedHardBlock = false;
            bool blnMatched          = false;

            if (tokens.Where(t => t.StartsWith("-")).Count() == tokens.Count()) //If I'm only using negative matches, then show everything that isn't eliminated.
            {
                blnMatched = true;
            }

            if (FullTextSearch.TokenContains(obj.ClientID, tokens, out blnMatchedHardBlock))
            {
                blnMatched = true;
            }
            if (blnHasNotToken && blnMatchedHardBlock)
            {
                return(false);
            }
            else if (!blnHasNotToken && blnMatched)
            {
                return(true);
            }

            if (FullTextSearch.TokenContains(obj.URL, tokens, out blnMatchedHardBlock))
            {
                blnMatched = true;
            }
            if (blnHasNotToken && blnMatchedHardBlock)
            {
                return(false);
            }
            else if (!blnHasNotToken && blnMatched)
            {
                return(true);
            }

            if (FullTextSearch.TokenContains(obj.UserAgent, tokens, out blnMatchedHardBlock))
            {
                blnMatched = true;
            }
            if (blnHasNotToken && blnMatchedHardBlock)
            {
                return(false);
            }
            else if (!blnHasNotToken && blnMatched)
            {
                return(true);
            }

            if (FullTextSearch.TokenContains(obj.Detail, tokens, out blnMatchedHardBlock))
            {
                blnMatched = true;
            }
            if (blnHasNotToken && blnMatchedHardBlock)
            {
                return(false);
            }
            else if (!blnHasNotToken && blnMatched)
            {
                return(true);
            }

            return(blnMatched);

            /*
             *  Original (simple) token matching
             * if(tokens.Any(t => obj.URL.ToLower().Contains(t)))
             *  return true;
             * if (tokens.Any(t => obj.UserAgent.ToLower().Contains(t)))
             *  return true;
             * if (tokens.Any(t => obj.Detail.ToLower().Contains(t)))
             *  return true;
             */
        }