Ejemplo n.º 1
0
    /// <summary>Begin page running after session validations</summary>
    private void Go()
    {
        this.user       = (ApplicationUser)Session["User"];
        Session["User"] = this.user;
        this.master     = this.Master as Main;
        this.company    = Session["Company"] as Company;
        this.Dictionary = Session["Dictionary"] as Dictionary <string, string>;

        this.master.AddBreadCrumb(this.Dictionary["Item_BusquedaUsuarios"]);
        this.master.Titulo           = this.Dictionary["Item_BusquedaUsuarios"];
        this.master.SearcheableItems = "[]";

        var codedQuery = new CodedQuery();

        codedQuery.SetQuery(this.Request.QueryString);
        this.ColectivoId = codedQuery.GetByKey <string>("colectivoId");
        this.PolizaId    = codedQuery.GetByKey <string>("polizaId");
        this.AseguradoId = codedQuery.GetByKey <string>("aseguradoId");

        if (string.IsNullOrEmpty(this.ColectivoId))
        {
            this.Response.Redirect("DashBoard.aspx", Constant.EndResponse);
        }

        var productos = this.Session["ProductosASPAD"] as ReadOnlyCollection <Producto>;

        foreach (var producto in productos)
        {
            if (producto.ColectivoName.Equals(this.ColectivoId, StringComparison.OrdinalIgnoreCase))
            {
                this.TarifaId = producto.TarifaId;
                break;
            }
        }
    }
Ejemplo n.º 2
0
    /// <summary>Begin page running after session validations</summary>
    private void Go()
    {
        this.user       = Session["User"] as ApplicationUser;
        Session["User"] = this.user;
        this.master     = this.Master as Main;
        this.company    = Session["Company"] as Company;
        this.Dictionary = Session["Dictionary"] as Dictionary <string, string>;

        this.master.AddBreadCrumb(this.Dictionary["Item_Validaciones"]);
        this.master.Titulo           = this.Dictionary["Item_Validaciones_Plural"];
        this.master.SearcheableItems = Constant.EmptyJsonList;

        var codedQuery = new CodedQuery();

        codedQuery.SetQuery(this.Request.QueryString);
        this.ColectivoId = codedQuery.GetByKey <string>("colectivoId");
        this.NIF         = codedQuery.GetByKey <string>("dni");
        this.Poliza      = codedQuery.GetByKey <string>("poliza");
        this.RenderData();
    }
Ejemplo n.º 3
0
    /// <summary>Begin page running after session validations</summary>
    private void Go()
    {
        this.user       = (ApplicationUser)Session["User"];
        this.master     = this.Master as Main;
        this.company    = Session["Company"] as Company;
        this.Dictionary = Session["Dictionary"] as Dictionary <string, string>;

        // Renew session
        Session["User"]       = this.user;
        Session["Dictionary"] = this.Dictionary;

        this.master.AddBreadCrumb(ApplicationDictionary.Translate("Item_Presupuestos"));
        this.master.Titulo           = ApplicationDictionary.Translate("Item_Presupuesto");
        this.master.SearcheableItems = "[]";

        var codedQuery = new CodedQuery();

        codedQuery.SetQuery(this.Request.QueryString);
        this.MascotaId   = codedQuery.GetByKey <string>("mascotaId");
        this.Mascota     = Mascota.ById(this.MascotaId);
        this.TarifaId    = codedQuery.GetByKey <string>("tarifaId");
        this.ColectivoId = codedQuery.GetByKey <string>("colectivo");
        this.PolizaId    = codedQuery.GetByKey <string>("polizaId");
        this.GetActos();
        this.RenderActosRealizados();

        var poliza = Poliza.ById(this.PolizaId);

        if (!string.IsNullOrEmpty(poliza.AseguradoNombre))
        {
            this.PolizaNum = poliza.AseguradoNombre + " - " + poliza.Numero;
        }
        else
        {
            this.PolizaNum = poliza.Numero;
        }
    }
Ejemplo n.º 4
0
    /// <summary>Continues PageLoad execution if session is alive</summary>
    private void Go()
    {
        string res = string.Empty;

        if (this.Request.QueryString.Count == 0)
        {
            string instanceName = string.Empty;
            if (this.Request.Form["InstanceName"] != null)
            {
                instanceName = this.Request.Form["InstanceName"];
            }

            this.instance = CustomerFramework.Load(instanceName);
            res           = "No Action";
            this.errors   = new List <Error>();
            this.dataFile = new List <DataLine>();
            if (!IsPostBack)
            {
                if (this.Request.Form["itemName"] != null)
                {
                    this.Item = new ItemBuilder(this.Request.Form["itemName"], this.instance.Name);
                }

                string file = SaveUploadedFile(Request.Files);

                if (!string.IsNullOrEmpty(file))
                {
                    file = Path.GetFileName(file);
                }

                this.dataFile = this.dataFile.OrderBy(d => d.Line).ToList();
                this.errors   = this.errors.OrderBy(d => d.Linea).ToList();

                res = "{\"file\":\"" + file + "\",\"errors\":[";
                bool first = true;
                foreach (var er in errors)
                {
                    if (first)
                    {
                        first = false;
                    }
                    else
                    {
                        res += ",";
                    }

                    res += string.Format(
                        CultureInfo.InvariantCulture,
                        @"{{""Type"":""{0}"",""Line"":{1},""Message"":""{2}""}}",
                        er.ErrorType,
                        er.Linea,
                        ToolsJson.JsonCompliant(er.Message));
                }

                res += "],\"data\":[";

                if (this.errors.Count == 0)
                {
                    first = true;
                    foreach (var dl in this.dataFile)
                    {
                        if (first)
                        {
                            first = false;
                        }
                        else
                        {
                            res += ",";
                        }

                        res += string.Format(
                            CultureInfo.InvariantCulture,
                            @"{{""Type"":""Data"",""Line"":{0},""Message"":{1}}}",
                            dl.Line,
                            dl.Data);
                    }
                }

                res += string.Format(CultureInfo.InvariantCulture, @"],""ImportId"":""{0}""}}", new Guid());
            }

            if (this.errors.Count == 0)
            {
                HttpContext.Current.Session["Import" + this.importId] = this.itemsReaded;
            }

            this.Response.Clear();
            this.Response.Write(res);
            this.Response.Flush();
            this.Response.SuppressContent = true;
            this.ApplicationInstance.CompleteRequest();
        }
        else
        {
            var codedQuery = new CodedQuery();
            codedQuery.SetQuery(this.Request.QueryString);
            string file         = codedQuery.GetByKey <string>("file");
            string itemName     = codedQuery.GetByKey <string>("item");
            string importId     = codedQuery.GetByKey <string>("importId");
            string instanceName = codedQuery.GetByKey <string>("InstanceName");
            string resImport    = ImportXlsx(file, importId, itemName);
            res = "Upload<br />" + file + "<br />" + itemName;

            this.Response.Clear();
            this.Response.Write(resImport);
            this.Response.Flush();
            this.Response.SuppressContent = true;
            this.ApplicationInstance.CompleteRequest();
        }
    }