| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace ddq
- {
- public partial class frmMain : Form
- {
- // 先hard-code公司ID,以后要按照登录用户来判断它的公司归属
- private string companyId = "CO000201PR";
- private DataTable fundDataTable;
- public frmMain()
- {
- InitializeComponent();
- InitializeData();
- }
- private void InitializeData()
- {
- }
- private void tbcMain_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (tbcMain.SelectedIndex == 0) { }
- else if (tbcMain.SelectedIndex == 1) {
- LoadFundList(companyId);
- }
- else { };
- }
- private void LoadFundList(string companyId)
- {
- if (fundDataTable == null)
- {
- fundDataTable = DataAccess.Get_fund_list_by_company(companyId, 1, 1000);
- this.grdFundList.DataSource = fundDataTable;
- }
- }
- private void grdFundList_CellContentClick(object sender, DataGridViewCellEventArgs e)
- {
- int rowIndex = e.RowIndex;
- int columnIndex = e.ColumnIndex;
- if (columnIndex < 0 || rowIndex < 0) return;
- DataRow row = fundDataTable.Rows[rowIndex];
- // 弹出基金页面
- string entityId = row["fund_id"].ToString();
- if (entityId.Length == 10 && Regex.Match(entityId, "^[HM]F").Success)
- {
- FundQ fundQ = new FundQ(entityId);
- fundQ.Show();
- }
- }
- }
- }
|