Joey 2 mesiacov pred
rodič
commit
8bd8854666
3 zmenil súbory, kde vykonal 66 pridanie a 14 odobranie
  1. 10 11
      DataManager.cs
  2. 51 0
      UIBuckAuthorizeFund.cs
  3. 5 3
      UIFund.cs

+ 10 - 11
DataManager.cs

@@ -667,7 +667,7 @@ namespace DataManager
 
         #endregion
 
-        #region Company Coverage
+        #region Authorization Coverage
 
         private void LoadCompanyCoverageChart()
         {
@@ -789,7 +789,7 @@ namespace DataManager
 
         private void LoadAuthrizedCompanyList()
         {
-            authorizedCompanyTable = DataAccess.Get_dm_company_authorization(null);
+            authorizedCompanyTable = DataAccess.Get_dm_company_authorization(null, null);
         }
 
         private void LoadAuthrizedFundList()
@@ -807,7 +807,7 @@ namespace DataManager
                 string nameExp = txtLocateEntity.Text.Trim();
                 if (nameExp.Length > 0) selectExp += " and company_short_name LIKE '%" + nameExp + "%'";
 
-                DataRow[] dr = authorizedCompanyTable.Select(selectExp);
+                DataRow[] dr = authorizedCompanyTable.Select(selectExp, "company_asset_size DESC");
 
                 if (dr != null && dr.Length > 0) dt = dr.CopyToDataTable();
 
@@ -839,7 +839,7 @@ namespace DataManager
                 string nameExp = txtLocateEntity.Text.Trim();
                 if (nameExp.Length > 0) selectExp += " and fund_short_name LIKE '%" + nameExp + "%'";
 
-                DataRow[] dr = authorizedFundTable.Select(selectExp);
+                DataRow[] dr = authorizedFundTable.Select(selectExp, "company_asset_size DESC");
 
                 if (dr != null && dr.Length > 0) dt = dr.CopyToDataTable();
 
@@ -889,17 +889,11 @@ namespace DataManager
         }
 
 
-
-
-
-        #endregion
-
-
         private void rdbCompany_CheckedChanged(object sender, EventArgs e)
         {
             btnEntityCoverage_Click(sender, e);
         }
-        #endregion
+        
 
         private void chk100_CheckedChanged(object sender, EventArgs e)
         {
@@ -994,5 +988,10 @@ namespace DataManager
         {
             // DO NOTHING, because same actions were triggered by rdbCompany_CheckedChanged anyway
         }
+
+
+        #endregion
+
+        #endregion
     }
 }

+ 51 - 0
UIBuckAuthorizeFund.cs

@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace DataManager
+{
+    public partial class UIBuckAuthorizeFund : Form
+    {
+        private int userId;
+
+        public int UserId { get => userId; set => userId = value; }
+
+        public UIBuckAuthorizeFund(int userId)
+        {
+            this.userId = userId;
+
+            InitializeComponent();
+        }
+
+        private void btnBuckAuthorizeFund_Click(object sender, EventArgs e)
+        {
+            string s = txtFundIds.Text.Trim().ToUpper();
+
+            string[] ids = s.Split(',');
+
+            List<string> errIds = new List<string> { };
+
+            foreach (string id in ids)
+            {
+                if (id.Length != 6) errIds.Add(id);
+            }
+
+            if (errIds.Count > 0) 
+            {
+                MessageBox.Show("这些备案编码有问题:" + string.Join(",", errIds), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                txtFundIds.Focus();
+            }
+            else
+            {
+                int ret = DataAccess.Set_dm_fund_authorization(s, 1, UserId);
+                MessageBox.Show(ret < 0 ? "通知程序员存盘有问题" : "批量导入成功", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
+            }
+        }
+    }
+}

+ 5 - 3
UIFund.cs

@@ -133,14 +133,16 @@ namespace DataManager
                 if (string.IsNullOrEmpty(navFreq)) navFreq = "未知";
                 cmbNavFrequency.SelectedIndex = cmbNavFrequency.Items.IndexOf(navFreq);
 
-                chkRating.Checked = fundInfo.Rows[0]["is_rating"].ToString() == "1" ? true : false;
-                chkRanking.Checked = fundInfo.Rows[0]["is_ranking"].ToString() == "1" ? true : false;
-                chkAuthorized.Checked = fundInfo.Rows[0]["is_authorized"].ToString() == "1" ? true : false;
+                chkRating.Checked = fundInfo.Rows[0]["is_rating"].ToString() == "" ? true : false;
+                chkRanking.Checked = fundInfo.Rows[0]["is_ranking"].ToString() == "" ? true : false;
+                chkAuthorized.Checked = fundInfo.Rows[0]["is_authorized"].ToString() == "" ? true : false;
 
                 lblMatchFund.Visible = false;
                 lblMatchInstrunction.Visible = false;
                 txtMatchFund.Visible = false;
 
+                txtFundShortName.Focus();
+
 
                 #endregion