Exemplo n.º 1
0
        public StatisticsView()
        {
            InitializeComponent();
            this.WindowState = FormWindowState.Maximized;

            groupBox1.Height     = Screen.PrimaryScreen.Bounds.Height;
            dataGridView1.Height = Screen.PrimaryScreen.Bounds.Height;
            int panelOffsetwidth  = Screen.PrimaryScreen.Bounds.Width - panel1.Width;
            int panelOffsetheight = Screen.PrimaryScreen.Bounds.Height - panel1.Height;

            panel1.Size = new Size(panel1.Width + panelOffsetwidth, panel1.Height + panelOffsetheight);

            int navigationOffset = Screen.PrimaryScreen.Bounds.Width - btnExport.Location.X - 200;

            btnExport.Location      = new Point(btnExport.Location.X + navigationOffset, btnExport.Location.Y);
            btnCompare.Location     = new Point(btnCompare.Location.X + navigationOffset, btnExport.Location.Y);
            btnLoadReports.Location = new Point(btnLoadReports.Location.X + navigationOffset, btnExport.Location.Y);
            btnOverall.Location     = new Point(btnOverall.Location.X + navigationOffset, btnExport.Location.Y);

            data            = new ReportsData();
            graphs          = new GraphsUtils(data, this.panel1);
            pbLogo.Location = new Point(
                this.Width / 2 - pbLogo.Size.Width / 2,
                this.Height / 2 - pbLogo.Size.Height / 2);
            pbLogo.Anchor = AnchorStyles.None;
            pbLogo.Size   = new Size(900, 700);
        }
Exemplo n.º 2
0
        public static ProxyPackageInfoV2 FindPackage(
            this PackagesData packagesData,
            IEnumerable <ProxyPackageInfoV2> packages
            )
        {
            IEnumerable <ReportsData> reportsDatas = packages.AllReportsDatas();

            ReportsData reportsData = packagesData.FindReportsData(reportsDatas);

            return(reportsData.FindPackage(packages));
        }
Exemplo n.º 3
0
 public NotebookData(NotebookConfig config) : base(config)
 {
     // Add an empty string for every character
     foreach (char _ in config.Acronym)
     {
         acronymNotes.Add("");
     }
     // Unlock each initial item
     foreach (ItemID item in config.InitiallyUnlockedItems)
     {
         UnlockItem(item);
     }
     research       = new ResearchData(config);
     observations   = new ObservationsData(config);
     concepts       = new ConceptsData(config);
     testAndMetrics = new TestAndMetricsData(config);
     reports        = new ReportsData(config);
 }
Exemplo n.º 4
0
        public static ProxyPackageInfoV2 FindPackage(
            this ReportsData reportsData,
            IEnumerable <ProxyPackageInfoV2> packages
            )
        {
            foreach (ProxyPackageInfoV2 package in packages)
            {
                if (package.RequestJson is AnalyticsRequest analyticsRequest)
                {
                    ReportsData[] reportsDatas = analyticsRequest.Reports;

                    if (reportsDatas.Contains(reportsData))
                    {
                        return(package);
                    }
                }
            }

            return(null);
        }
Exemplo n.º 5
0
        public void ProcessRequest(HttpContext context)
        {
            Int32 userid = 0;


            System.Web.HttpRequest request = System.Web.HttpContext.Current.Request;
            int ClientuserId = Convert.ToInt32(request.QueryString["userId"]);

            if (ClientuserId > 0)
            {
                userid = ClientuserId;
            }
            else
            {
                userid = SessionData.UserID;
            }
            DateTime date     = Convert.ToDateTime(request.QueryString["date"]);
            int      type     = Convert.ToInt32(request.QueryString["type"]);
            String   fileName = String.Empty;

            if (type == 1)
            {
                fileName = "MyPPCPal_KeywordReport_" + date + ".csv";
            }
            //else if(type==2)
            //    fileName = "MyPPCPal_OptimizedKeywordReport_" + date + ".csv";
            else if (type == 3)
            {
                fileName = "MyPPCPal_SearchTermReport_" + date + ".csv";
            }
            //else if (type == 4)
            //    fileName = "MyPPCPal_OptimizedSearchTermReport_" + date + ".csv";
            else if (type == 5)
            {
                fileName = "MyPPCPal_KeywordOptimized_" + date + ".csv";
            }
            else if (type == 6)
            {
                fileName = "MyPPCPal_SearchTermOptimized_" + date + ".csv";
            }

            var response = System.Web.HttpContext.Current.Response;

            if (userid > 0)
            {
                var adata   = new ReportsData();
                var dataset = adata.GetReports(userid, date, type);


                if (dataset.Tables.Count > 0 && dataset.Tables[0].Rows.Count > 0)
                {
                    StringBuilder sb = new StringBuilder();
                    if (type == 1 || type == 5)
                    {
                        KeywordReportGenerator(dataset, out sb);
                    }
                    else
                    {
                        KeywordSearchTermReportGenerator(dataset, out sb);
                    }

                    sb.Remove(sb.Length - 1, 1);
                    sb.Append(Environment.NewLine);
                    response.ClearContent();
                    response.Clear();
                    response.ContentType = "text/csv";
                    response.AddHeader("content-disposition", "attachment; filename=" + fileName + "");
                    response.BufferOutput = true;
                    response.Cache.SetCacheability(HttpCacheability.NoCache);
                    response.Write(sb.ToString());
                    response.Flush();
                    response.End();
                }
                else
                {
                    response.Write("Active users were not found");
                }
            }
            else
            {
                response.Redirect("admin/account/login");
            }
        }
Exemplo n.º 6
0
 public ReportsController()
 {
     this.rdata = new ReportsData();
 }