Bläddra i källkod

上传文件至 ''

Joey 3 veckor sedan
förälder
incheckning
472e43b55d
4 ändrade filer med 339 tillägg och 166 borttagningar
  1. 37 0
      DataAccess.cs
  2. 111 108
      DataManager.Designer.cs
  3. 191 55
      DataManager.cs
  4. 0 3
      DataManager.resx

+ 37 - 0
DataAccess.cs

@@ -793,5 +793,42 @@ namespace DataManager
             return dt;
         }
 
+        public static DataTable Report_fund_coverage(int? userId)
+        {
+            MySqlConnection connection = new MySqlConnection(connectionString);
+            MySqlDataAdapter ad = new MySqlDataAdapter("sp_dm_report_fund_coverage", connection);
+
+            MySqlParameter i_userid = new MySqlParameter("i_userid", userId);
+
+            ad.SelectCommand.Parameters.Add(i_userid);
+
+            ad.SelectCommand.CommandType = CommandType.StoredProcedure;
+
+            DataTable dt = new DataTable();
+            ad.Fill(dt);
+
+            connection.Close();
+
+            return dt;
+        }
+
+        public static DataTable Get_dm_fund_authorization(int? userId)
+        {
+            MySqlConnection connection = new MySqlConnection(connectionString);
+            MySqlDataAdapter ad = new MySqlDataAdapter("sp_get_dm_fund_authorization", connection);
+
+            MySqlParameter i_userid = new MySqlParameter("i_userid", userId);
+
+            ad.SelectCommand.Parameters.Add(i_userid);
+
+            ad.SelectCommand.CommandType = CommandType.StoredProcedure;
+
+            DataTable dt = new DataTable();
+            ad.Fill(dt);
+
+            connection.Close();
+
+            return dt;
+        }
     }
 }

+ 111 - 108
DataManager.Designer.cs

@@ -28,11 +28,11 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
-            System.Windows.Forms.DataVisualization.Charting.Legend legend4 = new System.Windows.Forms.DataVisualization.Charting.Legend();
-            System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series();
-            System.Windows.Forms.DataVisualization.Charting.Title title4 = new System.Windows.Forms.DataVisualization.Charting.Title();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+            System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+            System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title();
             this.ctnDataCollection = new System.Windows.Forms.SplitContainer();
             this.dtpCollectionTaskDate = new System.Windows.Forms.DateTimePicker();
             this.btnCollectionSearch = new System.Windows.Forms.Button();
@@ -104,8 +104,8 @@
             this.label13 = new System.Windows.Forms.Label();
             this.tbpAuthorization = new System.Windows.Forms.TabPage();
             this.splitContainer4 = new System.Windows.Forms.SplitContainer();
-            this.txtLocalCompany = new System.Windows.Forms.TextBox();
-            this.btnCompanyCoverage = new System.Windows.Forms.Button();
+            this.txtLocateEntity = new System.Windows.Forms.TextBox();
+            this.btnEntityCoverage = new System.Windows.Forms.Button();
             this.chk0 = new System.Windows.Forms.CheckBox();
             this.chk5 = new System.Windows.Forms.CheckBox();
             this.chk10 = new System.Windows.Forms.CheckBox();
@@ -114,9 +114,9 @@
             this.chk100 = new System.Windows.Forms.CheckBox();
             this.splitContainer5 = new System.Windows.Forms.SplitContainer();
             this.splitContainer6 = new System.Windows.Forms.SplitContainer();
-            this.chtCompanyCoverage = new System.Windows.Forms.DataVisualization.Charting.Chart();
-            this.grdCompanyCoverage = new System.Windows.Forms.DataGridView();
-            this.grdAuthCompany = new System.Windows.Forms.DataGridView();
+            this.chtEntityCoverage = new System.Windows.Forms.DataVisualization.Charting.Chart();
+            this.grdEntityCoverage = new System.Windows.Forms.DataGridView();
+            this.grdAuthorizedEntity = new System.Windows.Forms.DataGridView();
             this.panel3 = new System.Windows.Forms.Panel();
             this.rdbFund = new System.Windows.Forms.RadioButton();
             this.rdbCompany = new System.Windows.Forms.RadioButton();
@@ -166,9 +166,9 @@
             this.splitContainer6.Panel1.SuspendLayout();
             this.splitContainer6.Panel2.SuspendLayout();
             this.splitContainer6.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.chtCompanyCoverage)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.grdCompanyCoverage)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.grdAuthCompany)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.chtEntityCoverage)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.grdEntityCoverage)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.grdAuthorizedEntity)).BeginInit();
             this.panel3.SuspendLayout();
             this.SuspendLayout();
             // 
@@ -325,14 +325,14 @@
             this.grdCollectionTask.AllowUserToDeleteRows = false;
             this.grdCollectionTask.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
             this.grdCollectionTask.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle4.BackColor = System.Drawing.Color.WhiteSmoke;
-            dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.ControlText;
-            dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
-            this.grdCollectionTask.DefaultCellStyle = dataGridViewCellStyle4;
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
+            dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.grdCollectionTask.DefaultCellStyle = dataGridViewCellStyle1;
             this.grdCollectionTask.Dock = System.Windows.Forms.DockStyle.Fill;
             this.grdCollectionTask.Location = new System.Drawing.Point(0, 53);
             this.grdCollectionTask.Name = "grdCollectionTask";
@@ -895,10 +895,10 @@
             // 
             this.tbpOrphanFund.Controls.Add(this.grdOrphanFund);
             this.tbpOrphanFund.Controls.Add(this.panel2);
-            this.tbpOrphanFund.Location = new System.Drawing.Point(68, 4);
+            this.tbpOrphanFund.Location = new System.Drawing.Point(34, 4);
             this.tbpOrphanFund.Name = "tbpOrphanFund";
             this.tbpOrphanFund.Padding = new System.Windows.Forms.Padding(3);
-            this.tbpOrphanFund.Size = new System.Drawing.Size(853, 594);
+            this.tbpOrphanFund.Size = new System.Drawing.Size(887, 594);
             this.tbpOrphanFund.TabIndex = 0;
             this.tbpOrphanFund.Text = "孤儿基金";
             this.tbpOrphanFund.UseVisualStyleBackColor = true;
@@ -916,7 +916,7 @@
             this.grdOrphanFund.ReadOnly = true;
             this.grdOrphanFund.RowHeadersVisible = false;
             this.grdOrphanFund.RowTemplate.Height = 23;
-            this.grdOrphanFund.Size = new System.Drawing.Size(847, 535);
+            this.grdOrphanFund.Size = new System.Drawing.Size(881, 535);
             this.grdOrphanFund.TabIndex = 10;
             this.grdOrphanFund.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdOrphanFund_CellClick);
             // 
@@ -930,7 +930,7 @@
             this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
             this.panel2.Location = new System.Drawing.Point(3, 3);
             this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(847, 53);
+            this.panel2.Size = new System.Drawing.Size(881, 53);
             this.panel2.TabIndex = 0;
             // 
             // chkIsOrphan
@@ -949,7 +949,7 @@
             // 
             this.btnOrphanFundSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnOrphanFundSearch.BackColor = System.Drawing.Color.SkyBlue;
-            this.btnOrphanFundSearch.Location = new System.Drawing.Point(705, 11);
+            this.btnOrphanFundSearch.Location = new System.Drawing.Point(739, 11);
             this.btnOrphanFundSearch.Name = "btnOrphanFundSearch";
             this.btnOrphanFundSearch.Size = new System.Drawing.Size(121, 28);
             this.btnOrphanFundSearch.TabIndex = 9;
@@ -995,8 +995,8 @@
             // 
             // splitContainer4.Panel1
             // 
-            this.splitContainer4.Panel1.Controls.Add(this.txtLocalCompany);
-            this.splitContainer4.Panel1.Controls.Add(this.btnCompanyCoverage);
+            this.splitContainer4.Panel1.Controls.Add(this.txtLocateEntity);
+            this.splitContainer4.Panel1.Controls.Add(this.btnEntityCoverage);
             this.splitContainer4.Panel1.Controls.Add(this.chk0);
             this.splitContainer4.Panel1.Controls.Add(this.chk5);
             this.splitContainer4.Panel1.Controls.Add(this.chk10);
@@ -1011,26 +1011,26 @@
             this.splitContainer4.SplitterDistance = 48;
             this.splitContainer4.TabIndex = 1;
             // 
-            // txtLocalCompany
+            // txtLocateEntity
             // 
-            this.txtLocalCompany.Location = new System.Drawing.Point(567, 13);
-            this.txtLocalCompany.MaxLength = 100;
-            this.txtLocalCompany.Name = "txtLocalCompany";
-            this.txtLocalCompany.Size = new System.Drawing.Size(175, 25);
-            this.txtLocalCompany.TabIndex = 6;
-            this.txtLocalCompany.TextChanged += new System.EventHandler(this.txtLocalCompany_TextChanged);
+            this.txtLocateEntity.Location = new System.Drawing.Point(567, 13);
+            this.txtLocateEntity.MaxLength = 100;
+            this.txtLocateEntity.Name = "txtLocateEntity";
+            this.txtLocateEntity.Size = new System.Drawing.Size(175, 25);
+            this.txtLocateEntity.TabIndex = 6;
+            this.txtLocateEntity.TextChanged += new System.EventHandler(this.txtLocateEntity_TextChanged);
             // 
-            // btnCompanyCoverage
+            // btnEntityCoverage
             // 
-            this.btnCompanyCoverage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnCompanyCoverage.BackColor = System.Drawing.Color.SkyBlue;
-            this.btnCompanyCoverage.Location = new System.Drawing.Point(748, 11);
-            this.btnCompanyCoverage.Name = "btnCompanyCoverage";
-            this.btnCompanyCoverage.Size = new System.Drawing.Size(121, 28);
-            this.btnCompanyCoverage.TabIndex = 10;
-            this.btnCompanyCoverage.Text = "搜 索";
-            this.btnCompanyCoverage.UseVisualStyleBackColor = false;
-            this.btnCompanyCoverage.Click += new System.EventHandler(this.btnCompanyCoverage_Click);
+            this.btnEntityCoverage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnEntityCoverage.BackColor = System.Drawing.Color.SkyBlue;
+            this.btnEntityCoverage.Location = new System.Drawing.Point(748, 11);
+            this.btnEntityCoverage.Name = "btnEntityCoverage";
+            this.btnEntityCoverage.Size = new System.Drawing.Size(121, 28);
+            this.btnEntityCoverage.TabIndex = 10;
+            this.btnEntityCoverage.Text = "搜 索";
+            this.btnEntityCoverage.UseVisualStyleBackColor = false;
+            this.btnEntityCoverage.Click += new System.EventHandler(this.btnEntityCoverage_Click);
             // 
             // chk0
             // 
@@ -1120,7 +1120,7 @@
             // 
             // splitContainer5.Panel2
             // 
-            this.splitContainer5.Panel2.Controls.Add(this.grdAuthCompany);
+            this.splitContainer5.Panel2.Controls.Add(this.grdAuthorizedEntity);
             this.splitContainer5.Size = new System.Drawing.Size(887, 493);
             this.splitContainer5.SplitterDistance = 422;
             this.splitContainer5.TabIndex = 0;
@@ -1134,67 +1134,69 @@
             // 
             // splitContainer6.Panel1
             // 
-            this.splitContainer6.Panel1.Controls.Add(this.chtCompanyCoverage);
+            this.splitContainer6.Panel1.Controls.Add(this.chtEntityCoverage);
             // 
             // splitContainer6.Panel2
             // 
-            this.splitContainer6.Panel2.Controls.Add(this.grdCompanyCoverage);
+            this.splitContainer6.Panel2.Controls.Add(this.grdEntityCoverage);
             this.splitContainer6.Size = new System.Drawing.Size(422, 493);
             this.splitContainer6.SplitterDistance = 299;
             this.splitContainer6.TabIndex = 0;
             // 
-            // chtCompanyCoverage
-            // 
-            this.chtCompanyCoverage.BackColor = System.Drawing.Color.Transparent;
-            this.chtCompanyCoverage.BorderlineColor = System.Drawing.Color.Black;
-            this.chtCompanyCoverage.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid;
-            chartArea4.Name = "ChartArea1";
-            this.chtCompanyCoverage.ChartAreas.Add(chartArea4);
-            this.chtCompanyCoverage.Dock = System.Windows.Forms.DockStyle.Fill;
-            legend4.Name = "Legend1";
-            this.chtCompanyCoverage.Legends.Add(legend4);
-            this.chtCompanyCoverage.Location = new System.Drawing.Point(0, 0);
-            this.chtCompanyCoverage.Name = "chtCompanyCoverage";
-            series4.ChartArea = "ChartArea1";
-            series4.Legend = "Legend1";
-            series4.Name = "Series1";
-            this.chtCompanyCoverage.Series.Add(series4);
-            this.chtCompanyCoverage.Size = new System.Drawing.Size(422, 299);
-            this.chtCompanyCoverage.TabIndex = 0;
-            title4.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            title4.Name = "Title1";
-            title4.Text = "公司覆盖";
-            this.chtCompanyCoverage.Titles.Add(title4);
-            // 
-            // grdCompanyCoverage
-            // 
-            this.grdCompanyCoverage.AllowUserToAddRows = false;
-            this.grdCompanyCoverage.AllowUserToDeleteRows = false;
-            this.grdCompanyCoverage.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
-            this.grdCompanyCoverage.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.grdCompanyCoverage.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.grdCompanyCoverage.Location = new System.Drawing.Point(0, 0);
-            this.grdCompanyCoverage.Name = "grdCompanyCoverage";
-            this.grdCompanyCoverage.ReadOnly = true;
-            this.grdCompanyCoverage.RowHeadersVisible = false;
-            this.grdCompanyCoverage.RowTemplate.Height = 23;
-            this.grdCompanyCoverage.Size = new System.Drawing.Size(422, 190);
-            this.grdCompanyCoverage.TabIndex = 0;
-            // 
-            // grdAuthCompany
-            // 
-            this.grdAuthCompany.AllowUserToAddRows = false;
-            this.grdAuthCompany.AllowUserToOrderColumns = true;
-            this.grdAuthCompany.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.grdAuthCompany.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.grdAuthCompany.Location = new System.Drawing.Point(0, 0);
-            this.grdAuthCompany.Name = "grdAuthCompany";
-            this.grdAuthCompany.ReadOnly = true;
-            this.grdAuthCompany.RowHeadersVisible = false;
-            this.grdAuthCompany.RowTemplate.Height = 23;
-            this.grdAuthCompany.Size = new System.Drawing.Size(461, 493);
-            this.grdAuthCompany.TabIndex = 0;
-            this.grdAuthCompany.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdAuthCompany_CellClick);
+            // chtEntityCoverage
+            // 
+            this.chtEntityCoverage.BackColor = System.Drawing.Color.Transparent;
+            this.chtEntityCoverage.BorderlineColor = System.Drawing.Color.Black;
+            this.chtEntityCoverage.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid;
+            chartArea1.Name = "ChartArea1";
+            this.chtEntityCoverage.ChartAreas.Add(chartArea1);
+            this.chtEntityCoverage.Dock = System.Windows.Forms.DockStyle.Fill;
+            legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
+            legend1.Name = "Legend1";
+            legend1.TitleFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.chtEntityCoverage.Legends.Add(legend1);
+            this.chtEntityCoverage.Location = new System.Drawing.Point(0, 0);
+            this.chtEntityCoverage.Name = "chtEntityCoverage";
+            series1.ChartArea = "ChartArea1";
+            series1.Legend = "Legend1";
+            series1.Name = "Series1";
+            this.chtEntityCoverage.Series.Add(series1);
+            this.chtEntityCoverage.Size = new System.Drawing.Size(422, 299);
+            this.chtEntityCoverage.TabIndex = 0;
+            title1.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            title1.Name = "Title1";
+            title1.Text = "协议授权覆盖%";
+            this.chtEntityCoverage.Titles.Add(title1);
+            // 
+            // grdEntityCoverage
+            // 
+            this.grdEntityCoverage.AllowUserToAddRows = false;
+            this.grdEntityCoverage.AllowUserToDeleteRows = false;
+            this.grdEntityCoverage.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
+            this.grdEntityCoverage.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.grdEntityCoverage.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grdEntityCoverage.Location = new System.Drawing.Point(0, 0);
+            this.grdEntityCoverage.Name = "grdEntityCoverage";
+            this.grdEntityCoverage.ReadOnly = true;
+            this.grdEntityCoverage.RowHeadersVisible = false;
+            this.grdEntityCoverage.RowTemplate.Height = 23;
+            this.grdEntityCoverage.Size = new System.Drawing.Size(422, 190);
+            this.grdEntityCoverage.TabIndex = 0;
+            // 
+            // grdAuthorizedEntity
+            // 
+            this.grdAuthorizedEntity.AllowUserToAddRows = false;
+            this.grdAuthorizedEntity.AllowUserToOrderColumns = true;
+            this.grdAuthorizedEntity.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.grdAuthorizedEntity.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grdAuthorizedEntity.Location = new System.Drawing.Point(0, 0);
+            this.grdAuthorizedEntity.Name = "grdAuthorizedEntity";
+            this.grdAuthorizedEntity.ReadOnly = true;
+            this.grdAuthorizedEntity.RowHeadersVisible = false;
+            this.grdAuthorizedEntity.RowTemplate.Height = 23;
+            this.grdAuthorizedEntity.Size = new System.Drawing.Size(461, 493);
+            this.grdAuthorizedEntity.TabIndex = 0;
+            this.grdAuthorizedEntity.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdAuthorizedEntity_CellClick);
             // 
             // panel3
             // 
@@ -1216,6 +1218,7 @@
             this.rdbFund.TabIndex = 1;
             this.rdbFund.Text = "基金";
             this.rdbFund.UseVisualStyleBackColor = true;
+            this.rdbFund.CheckedChanged += new System.EventHandler(this.rdbFund_CheckedChanged);
             // 
             // rdbCompany
             // 
@@ -1295,9 +1298,9 @@
             this.splitContainer6.Panel2.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.splitContainer6)).EndInit();
             this.splitContainer6.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.chtCompanyCoverage)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.grdCompanyCoverage)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.grdAuthCompany)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.chtEntityCoverage)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.grdEntityCoverage)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.grdAuthorizedEntity)).EndInit();
             this.panel3.ResumeLayout(false);
             this.panel3.PerformLayout();
             this.ResumeLayout(false);
@@ -1386,12 +1389,12 @@
         private System.Windows.Forms.SplitContainer splitContainer5;
         private System.Windows.Forms.CheckBox chk5;
         private System.Windows.Forms.CheckBox chk0;
-        private System.Windows.Forms.Button btnCompanyCoverage;
-        private System.Windows.Forms.DataGridView grdAuthCompany;
-        private System.Windows.Forms.TextBox txtLocalCompany;
+        private System.Windows.Forms.Button btnEntityCoverage;
+        private System.Windows.Forms.DataGridView grdAuthorizedEntity;
+        private System.Windows.Forms.TextBox txtLocateEntity;
         private System.Windows.Forms.SplitContainer splitContainer6;
-        private System.Windows.Forms.DataVisualization.Charting.Chart chtCompanyCoverage;
-        private System.Windows.Forms.DataGridView grdCompanyCoverage;
+        private System.Windows.Forms.DataVisualization.Charting.Chart chtEntityCoverage;
+        private System.Windows.Forms.DataGridView grdEntityCoverage;
     }
 }
 

+ 191 - 55
DataManager.cs

@@ -25,6 +25,8 @@ namespace DataManager
         private DataTable orphanFundTable;
         private DataTable companyCoverageTable;
         private DataTable authorizedCompanyTable;
+        private DataTable fundCoverageTable;
+        private DataTable authorizedFundTable;
 
         private static int userId;
 
@@ -679,16 +681,56 @@ namespace DataManager
                 totalCnt += int.Parse(rows[i]["total_cnt"].ToString());
             }
 
-            string[] pieX = { "合作", "其它" };
+            string[] pieX = { "合作#", "未合作#" };
             int[] pieY = { coveredCnt, totalCnt - coveredCnt };
 
-            Series series = chtCompanyCoverage.Series[0];
+            chtEntityCoverage.Series.Clear();
+            Series series = new Series();
             series.ChartType = SeriesChartType.Pie;
+
             series.Points.DataBindXY(pieX, pieY);
-            series.Points[0].Label = $"{series.Points[0].AxisLabel}: {coveredCnt}";
+            series.Points[0].Label = $"{series.Points[0].AxisLabel}: {coveredCnt:N0}";
             series.Points[0].ToolTip = $"{series.Points[0].AxisLabel}: {(100.0 * coveredCnt / totalCnt):F2}%";
-            series.Points[1].Label = $"{series.Points[1].AxisLabel}: {totalCnt - coveredCnt}";
+            series.Points[1].Label = $"{series.Points[1].AxisLabel}: {(totalCnt - coveredCnt):N0}";
             series.Points[1].ToolTip = $"{series.Points[1].AxisLabel}: {(100.0 * ( 1.0 - coveredCnt / totalCnt)):F2}%";
+            series.Points[1].Color = Color.LightGray;
+
+            chtEntityCoverage.Series.Add(series);
+
+        }
+
+        private void LoadFundCoverageChart()
+        {
+
+            chtEntityCoverage.Series.Clear();
+
+            Series series = new Series();
+            series.Name = "合作%";
+            series.ChartType = SeriesChartType.StackedColumn100;
+
+            Series series2 = new Series();
+            series2.Name = "未合作%";
+            series2.ChartType = SeriesChartType.StackedColumn100;
+            series2.Color = Color.LightGray;
+
+            int coveredCnt = 0;
+            int totalCnt = 0;
+
+            DataRow[] rows = fundCoverageTable.Select(CompanySizeFilter());
+            for (int i = 0; i < rows.Length; i++)
+            {
+                coveredCnt += int.Parse(rows[i]["covered_cnt"].ToString());
+                totalCnt += int.Parse(rows[i]["total_cnt"].ToString());
+
+                series.Points.AddXY(rows[i]["company_asset_size_name"].ToString(), coveredCnt);
+                series2.Points.AddXY(rows[i]["company_asset_size_name"].ToString(), totalCnt - coveredCnt);
+                
+            }
+
+            chtEntityCoverage.Series.Add(series);
+            chtEntityCoverage.Series.Add(series2);
+            chtEntityCoverage.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.LightGray;
+            chtEntityCoverage.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.LightGray;
 
         }
 
@@ -710,26 +752,38 @@ namespace DataManager
         }
 
 
-        private void LoadCompanyCoverageGrid()
+        private void LoadEntityCoverageGrid()
         {
-            companyCoverageTable = DataAccess.Report_company_coverage(null);
+            // 这个sp有点慢
+            this.Cursor = Cursors.WaitCursor;
+
+            if (rdbCompany.Checked)
+            {
+                companyCoverageTable = DataAccess.Report_company_coverage(null);
+                grdEntityCoverage.DataSource = companyCoverageTable;
+            }
+            else
+            {
+                fundCoverageTable = DataAccess.Report_fund_coverage(null);
+                grdEntityCoverage.DataSource = fundCoverageTable;
+            }
 
-            grdCompanyCoverage.DataSource = companyCoverageTable;
+            this.Cursor = Cursors.Default;
 
-            grdCompanyCoverage.Columns["company_asset_size"].Visible = false;
-            grdCompanyCoverage.Columns["company_asset_size_name"].HeaderText = "规模";
-            grdCompanyCoverage.Columns["covered_cnt"].HeaderText = "覆盖家数";
-            grdCompanyCoverage.Columns["covered_cnt"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
-            grdCompanyCoverage.Columns["covered_cnt"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
-            grdCompanyCoverage.Columns["total_cnt"].HeaderText = "总家数";
-            grdCompanyCoverage.Columns["total_cnt"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
-            grdCompanyCoverage.Columns["total_cnt"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
-            grdCompanyCoverage.Columns["cover_pct"].HeaderText = "覆盖率%";
-            grdCompanyCoverage.Columns["cover_pct"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
-            grdCompanyCoverage.Columns["cover_pct"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
+            grdEntityCoverage.Columns["company_asset_size"].Visible = false;
+            grdEntityCoverage.Columns["company_asset_size_name"].HeaderText = "规模";
+            grdEntityCoverage.Columns["covered_cnt"].HeaderText = "覆盖数";
+            grdEntityCoverage.Columns["covered_cnt"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
+            grdEntityCoverage.Columns["covered_cnt"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
+            grdEntityCoverage.Columns["total_cnt"].HeaderText = "总数";
+            grdEntityCoverage.Columns["total_cnt"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
+            grdEntityCoverage.Columns["total_cnt"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
+            grdEntityCoverage.Columns["cover_pct"].HeaderText = "覆盖率%";
+            grdEntityCoverage.Columns["cover_pct"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
+            grdEntityCoverage.Columns["cover_pct"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
 
-            grdCompanyCoverage.Columns["company_asset_size_name"].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
-            grdCompanyCoverage.Columns["cover_pct"].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
+            grdEntityCoverage.Columns["company_asset_size_name"].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
+            grdEntityCoverage.Columns["cover_pct"].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
 
         }
 
@@ -738,6 +792,11 @@ namespace DataManager
             authorizedCompanyTable = DataAccess.Get_dm_company_authorization(null);
         }
 
+        private void LoadAuthrizedFundList()
+        {
+            authorizedFundTable = DataAccess.Get_dm_fund_authorization(null);
+        }
+
         private void LoadAuthorizedCompanyGrid()
         {
             if (authorizedCompanyTable != null)
@@ -745,41 +804,88 @@ namespace DataManager
                 DataTable dt = null;
 
                 string selectExp = CompanySizeFilter();
-                string nameExp = txtLocalCompany.Text.Trim();
+                string nameExp = txtLocateEntity.Text.Trim();
                 if (nameExp.Length > 0) selectExp += " and company_short_name LIKE '%" + nameExp + "%'";
 
                 DataRow[] dr = authorizedCompanyTable.Select(selectExp);
 
                 if (dr != null && dr.Length > 0) dt = dr.CopyToDataTable();
 
-                grdAuthCompany.DataSource = dt;
+                grdAuthorizedEntity.DataSource = dt;
 
                 if (dt != null)
                 {
-                    grdAuthCompany.Columns["company_id"].Visible = false;
-                    grdAuthCompany.Columns["company_name"].Visible = false;
-                    grdAuthCompany.Columns["company_short_name"].HeaderText = "公司简称";
-                    grdAuthCompany.Columns["company_asset_size"].Visible = false;
-                    grdAuthCompany.Columns["company_asset_size_name"].HeaderText = "规模";
-                    grdAuthCompany.Columns["register_number"].HeaderText = "协会编号";
-                    grdAuthCompany.Columns["establish_date"].HeaderText = "成立日";
-
-                    grdAuthCompany.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
-                    grdAuthCompany.Columns["company_short_name"].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
-                    grdAuthCompany.Columns["company_asset_size_name"].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
+                    grdAuthorizedEntity.Columns["company_id"].Visible = false;
+                    grdAuthorizedEntity.Columns["company_name"].Visible = false;
+                    grdAuthorizedEntity.Columns["company_short_name"].HeaderText = "公司简称";
+                    grdAuthorizedEntity.Columns["company_asset_size"].Visible = false;
+                    grdAuthorizedEntity.Columns["company_asset_size_name"].HeaderText = "规模";
+                    grdAuthorizedEntity.Columns["register_number"].HeaderText = "协会编号";
+                    grdAuthorizedEntity.Columns["establish_date"].HeaderText = "成立日";
+
+                    grdAuthorizedEntity.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
+                    grdAuthorizedEntity.Columns["company_short_name"].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
                 }
             }
         }
 
-        private void btnCompanyCoverage_Click(object sender, EventArgs e)
+        private void LoadAuthorizedFundGrid()
         {
-            LoadAuthrizedCompanyList();
+            if (authorizedFundTable != null)
+            {
+                DataTable dt = null;
 
-            LoadCompanyCoverageGrid();
+                string selectExp = CompanySizeFilter();
+                string nameExp = txtLocateEntity.Text.Trim();
+                if (nameExp.Length > 0) selectExp += " and fund_short_name LIKE '%" + nameExp + "%'";
 
-            LoadCompanyCoverageChart();
-            
-            LoadAuthorizedCompanyGrid();
+                DataRow[] dr = authorizedFundTable.Select(selectExp);
+
+                if (dr != null && dr.Length > 0) dt = dr.CopyToDataTable();
+
+                grdAuthorizedEntity.DataSource = dt;
+
+                if (dt != null)
+                {
+                    grdAuthorizedEntity.Columns["fund_id"].Visible = false;
+                    grdAuthorizedEntity.Columns["fund_name"].Visible = false;
+                    grdAuthorizedEntity.Columns["fund_short_name"].HeaderText = "基金简称";
+                    grdAuthorizedEntity.Columns["company_asset_size"].Visible = false;
+                    grdAuthorizedEntity.Columns["strategy"].Visible = false;
+                    grdAuthorizedEntity.Columns["substrategy"].HeaderText = "二级分类";
+                    grdAuthorizedEntity.Columns["inception_date"].HeaderText = "成立日";
+                    grdAuthorizedEntity.Columns["register_number"].HeaderText = "备案编码";
+
+                    grdAuthorizedEntity.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
+                    grdAuthorizedEntity.Columns["fund_short_name"].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
+                }
+            }
+        }
+
+        private void btnEntityCoverage_Click(object sender, EventArgs e)
+        {
+            // 左下角的固定格式覆盖率表
+            LoadEntityCoverageGrid();
+
+            if (rdbCompany.Checked)
+            {
+                // 授权公司数据
+                LoadAuthrizedCompanyList();
+                // 对公司覆盖率表进行可视化 (PIE)
+                LoadCompanyCoverageChart();
+                // 授权公司列表
+                LoadAuthorizedCompanyGrid();
+            }
+            else
+            {
+                // 授权基金数据
+                LoadAuthrizedFundList();
+                // 对基金覆盖率表进行可视化(BAR)
+                LoadFundCoverageChart();
+                // 授权基金列表
+                LoadAuthorizedFundGrid();
+
+            }
         }
 
 
@@ -791,10 +897,7 @@ namespace DataManager
 
         private void rdbCompany_CheckedChanged(object sender, EventArgs e)
         {
-            if (rdbCompany.Checked)
-            {
-                btnCompanyCoverage_Click(sender, e);
-            }
+            btnEntityCoverage_Click(sender, e);
         }
         #endregion
 
@@ -802,11 +905,23 @@ namespace DataManager
         {
             if (((Control)sender).Focus())
             {
-                // 重新画饼图
-                LoadCompanyCoverageChart();
+                if (rdbCompany.Checked)
+                {
+                    // 重新画图
+                    LoadCompanyCoverageChart();
 
-                // 刷新公司列表
-                LoadAuthorizedCompanyGrid();
+                    // 刷新公司列表
+                    LoadAuthorizedCompanyGrid();
+                }
+                else
+                {
+                    // 重新画图
+                    LoadFundCoverageChart();
+
+                    // 刷新基金列表
+                    LoadAuthorizedFundGrid();
+
+                }
             }
         }
 
@@ -835,28 +950,49 @@ namespace DataManager
             chk100_CheckedChanged(sender, e);
         }
 
-        private void txtLocalCompany_TextChanged(object sender, EventArgs e)
+        private void txtLocateEntity_TextChanged(object sender, EventArgs e)
         {
-            LoadAuthorizedCompanyGrid();
+            if (rdbCompany.Checked) LoadAuthorizedCompanyGrid();
+            else LoadAuthorizedFundGrid();
         }
 
-        private void grdAuthCompany_CellClick(object sender, DataGridViewCellEventArgs e)
+        private void grdAuthorizedEntity_CellClick(object sender, DataGridViewCellEventArgs e)
         {
             int rowIndex = e.RowIndex;
             int columnIndex = e.ColumnIndex;
 
             if (columnIndex < 0 || rowIndex < 0) return;
 
-            DataGridViewRow row = grdAuthCompany.Rows[rowIndex];
+            DataGridViewRow row = grdAuthorizedEntity.Rows[rowIndex];
 
-            string entityId = row.Cells["company_id"].Value.ToString().ToUpper();
+            if (rdbCompany.Checked)
+            {
+                string entityId = row.Cells["company_id"].Value.ToString().ToUpper();
 
-            if (entityId.Length == 10 && Regex.Match(entityId, "^CO").Success)
+                if (entityId.Length == 10 && Regex.Match(entityId, "^CO").Success)
+                {
+                    UICompany frm = new UICompany(entityId, UserId);
+
+                    frm.Show();
+                }
+            }
+            else
             {
-                UICompany frm = new UICompany(entityId, UserId);
+                string entityId = row.Cells["fund_id"].Value.ToString().ToUpper();
+
+                if (entityId.Length == 10 && Regex.Match(entityId, "^[H|M]F").Success)
+                {
+                    UIFund frm = new UIFund(entityId, UserId);
+
+                    frm.Show();
+                }
 
-                frm.Show();
             }
         }
+
+        private void rdbFund_CheckedChanged(object sender, EventArgs e)
+        {
+            // DO NOTHING, because same actions were triggered by rdbCompany_CheckedChanged anyway
+        }
     }
 }

+ 0 - 3
DataManager.resx

@@ -120,7 +120,4 @@
   <metadata name="sstData.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
-  <metadata name="sstData.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
 </root>