예제 #1
0
        private void PopulateInvestigatedCompanies()
        {
            CheckCompanyNames.Items.Clear();
            var table = _dal.GetInvestigatedCompanies(_investigationId);

            CheckCompanyNames.DataSource    = table;
            CheckCompanyNames.DataTextField = table.company_nameColumn.ColumnName;
            CheckCompanyNames.DataBind();
        }
예제 #2
0
        void DrawChart3()
        {
            var investigationId = int.Parse(DropDownList1.SelectedValue);
            var beginDate       = new DateTime(int.Parse(DropY1.SelectedValue), 1, 1);
            var endDate         = new DateTime(int.Parse(DropY2.SelectedValue), 12, 31);
            var ct        = CheckAutoYears.Checked ? new ChartTools(investigationId, Chart2, 0, 0) : new ChartTools(investigationId, beginDate, endDate, Chart2, 0, 0);
            var positions = new List <string>()
            {
                "mentioned in filing"
            };

            Chart2.Visible = CheckChart.Checked;
            Chart2.Width   = int.Parse(DropSize.SelectedValue);
            Chart2.Height  = (int)((Chart2.Width.Value) * 3D / 4D);
            //series are for positions
            Chart2.Series.Clear();
            var s = Chart2.Series.Add(positions[0]);

            s.ChartType  = SeriesChartType.Point.ToString();
            s.XValueType = ChartValueTypes.Date;
            Chart2.ChartAreas[0].AxisX.LabelStyle.Format = "yyyy";
            Chart2.ChartAreas[0].AxisX.IntervalType      = DateTimeIntervalType.Years;
            Chart2.ChartAreas[0].AxisX.Interval          = 1;
            //
            var table = new LinkManager().GetIndividualCompanyLink(investigationId);

            if (CheckExcel.Checked)
            {
                AddExcelAttachment(table);
                return;
            }
            var invManager = new InvestigationManager();
            var tableI     = invManager.GetInvestigatedIndividuals(investigationId);
            var tableC     = invManager.GetInvestigatedCompanies(investigationId);
            var yIndex     = 0;
            var count      = 0;

            foreach (var company in tableC)
            {
                var inds     = 0;
                var indsList = new List <DtstCOI.investigated_individualRow>();
                foreach (var individual in tableI)
                {
                    var sort = table.company_nameColumn.ColumnName + "='"
                               + company.company_name.Replace("'", "''") + "' and "
                               + table.individual_nameColumn.ColumnName + "='"
                               + individual.individual_name.Replace("'", "''") + "'";
                    var useIndividual = false;
                    var links         = new DataView(table, sort, "link_date asc",
                                                     DataViewRowState.CurrentRows);
                    if (links.Count == 0)
                    {
                        continue;
                    }
                    foreach (DataRowView rv in links)
                    {
                        var link = (DtstCOI.individual_company_linkRow)rv.Row;
                        if (!ct.IsPointUsable(link))
                        {
                            continue;
                        }
                        useIndividual = true;
                    }
                    if (useIndividual)
                    {
                        inds++; indsList.Add(individual);
                    }
                }
                if (inds <= 1)
                {
                    continue;
                }
                foreach (var individual in indsList)
                {
                    var sort = table.company_nameColumn.ColumnName + "='"
                               + company.company_name.Replace("'", "''") + "' and "
                               + table.individual_nameColumn.ColumnName + "='"
                               + individual.individual_name.Replace("'", "''") + "'";
                    var links = new DataView(table, sort, "link_date asc", DataViewRowState.CurrentRows);
                    if (links.Count == 0)
                    {
                        continue;
                    }
                    yIndex++;
                    Chart2.ChartAreas[0].AxisY.CustomLabels.Add(yIndex - 0.5, yIndex + 0.5,
                                                                individual.individual_name);
                    foreach (DataRowView rv in links)
                    {
                        var link = (DtstCOI.individual_company_linkRow)rv.Row;
                        if (!ct.IsPointUsable(link))
                        {
                            continue;
                        }
                        string position;
                        int    positionSeriesIndex;
                        if (link.IspositionNull() || link.position.Trim() == string.Empty)
                        {
                            position            = positions[0];
                            positionSeriesIndex = 0;
                        }
                        else
                        {
                            position            = link.position.Trim().ToLower();
                            positionSeriesIndex = positions.IndexOf(position);
                            if (positionSeriesIndex == -1)
                            {
                                s            = Chart2.Series.Add(position);
                                s.ChartType  = SeriesChartType.Point.ToString();
                                s.XValueType = ChartValueTypes.Date;
                                s.MarkerSize = (int)Chart2.Height.Value / 100;
                                positions.Add(position);
                                positionSeriesIndex = positions.Count - 1;
                            }
                        }
                        var point = new Dundas.Charting.WebControl.DataPoint();
                        point.SetValueXY(link.link_date, yIndex);
                        Chart2.Series[positionSeriesIndex].Points.Add(point);
                        count++;
                    }
                }
                yIndex++;
                Chart2.ChartAreas[0].AxisY.CustomLabels.Add(yIndex - 0.5, yIndex + 0.5, company.company_name);
                Chart2.ChartAreas[0].AxisY.StripLines.Add(new StripLine
                {
                    IntervalOffset = yIndex - 0.1,
                    BackColor      = Color.LightGray,
                    StripWidth     = 0.2
                });
            }
            yIndex++;
            Chart2.ChartAreas[0].AxisY.Maximum = yIndex;
            Chart2.Titles[1].Text += " " + count + " matches found";
            if (!CheckData.Checked)
            {
                return;
            }
            GridView1.DataSource = table;
            GridView1.DataBind();
        }