Browse Source

上传文件至 ''

Joey 3 tuần trước cách đây
mục cha
commit
00f3840e49
2 tập tin đã thay đổi với 12 bổ sung3 xóa
  1. 3 0
      UIFund.Designer.cs
  2. 9 3
      UIFund.cs

+ 3 - 0
UIFund.Designer.cs

@@ -563,6 +563,7 @@
             this.txtParentFund.Enabled = false;
             this.txtParentFund.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.txtParentFund.Location = new System.Drawing.Point(82, 68);
+            this.txtParentFund.MaxLength = 100;
             this.txtParentFund.Name = "txtParentFund";
             this.txtParentFund.Size = new System.Drawing.Size(165, 23);
             this.txtParentFund.TabIndex = 6;
@@ -601,6 +602,7 @@
             // 
             this.txtFundShortName.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.txtFundShortName.Location = new System.Drawing.Point(82, 31);
+            this.txtFundShortName.MaxLength = 100;
             this.txtFundShortName.Name = "txtFundShortName";
             this.txtFundShortName.Size = new System.Drawing.Size(165, 23);
             this.txtFundShortName.TabIndex = 1;
@@ -751,6 +753,7 @@
             // 
             this.txtMatchFund.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.txtMatchFund.Location = new System.Drawing.Point(83, 165);
+            this.txtMatchFund.MaxLength = 10;
             this.txtMatchFund.Name = "txtMatchFund";
             this.txtMatchFund.Size = new System.Drawing.Size(165, 23);
             this.txtMatchFund.TabIndex = 19;

+ 9 - 3
UIFund.cs

@@ -18,6 +18,7 @@ namespace DataManager
         private string fundId = null;
         private string providerId = null;
         private string externalId = null;
+        private string matchedFundId = null;
 
         private DataTable fundInfo = new DataTable();
 
@@ -32,10 +33,11 @@ namespace DataManager
             InitializeData();
         }
 
-        public UIFund(string providerId, string externalId, int userId)
+        public UIFund(string providerId, string externalId, string fundId, int userId)
         {
             this.providerId = providerId;
             this.externalId = externalId;
+            this.matchedFundId = fundId;
             this.userId = userId;
 
             InitializeComponent();
@@ -55,6 +57,7 @@ namespace DataManager
         { 
             txtFundId.Text = fundId;
 
+            // 正常的基金页面
             if (!string.IsNullOrEmpty(fundId))
             {
 
@@ -157,6 +160,7 @@ namespace DataManager
 
                 #endregion
             }
+            // 用于孤儿基金的页面
             else
             {
                 txtFundName.Text = ExternalId;
@@ -168,6 +172,7 @@ namespace DataManager
                 chkAuthorized.Enabled = false;
                 chkRanking.Enabled = false;
                 chkRating.Enabled = false;
+                txtMatchFund.Text = (this.matchedFundId == null ? string.Empty : matchedFundId);
 
                 LoadNavGrid(null, ProviderId, ExternalId, null, null);
             }
@@ -180,7 +185,8 @@ namespace DataManager
             {
                 string matchedFundId = txtMatchFund.Text;
 
-                if (matchedFundId.Length == 10)
+                // 暂时只做个简单的ID长度和前两位字母检查
+                if (matchedFundId.Length == 10 && matchedFundId.Substring(0, 2) == "HF")
                 {
                     DataAccess.Set_dm_external_fund_mapping(ProviderId, ExternalId, matchedFundId, UserId);
                     this.DialogResult = DialogResult.OK;
@@ -188,7 +194,7 @@ namespace DataManager
                 }
                 else
                 {
-                    MessageBox.Show("输入的基金ID不大对哦", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                    MessageBox.Show("输入的基金ID应该是HFXXXXXXXXXX", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                     txtMatchFund.Focus();
                 }
             }