Пример #1
0
        /// <summary>
        /// Get Custodian dictionary, [Custodian_Number] as key
        /// </summary>
        public Dictionary <int, Custodian> Get_custodian_dic()
        {
            HashSet <int> num_hs = new HashSet <int>();

            foreach (DividendCustodian dc in this.Get_dvdCust_dic(null).Values)
            {
                num_hs.Add(dc.Custodian_Number.Value);
            }

            Dictionary <int, Custodian> dic = new Dictionary <int, Custodian>();

            DB_select    selt = new DB_select(Custodian.Get_cmdTP());
            SQL_relation rela = new SQL_relation("Custodian_Number", true, num_hs);

            selt.SetCondition(rela);

            DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB());

            while (reader.Read())
            {
                Custodian cust = new Custodian();
                cust.Init_from_reader(reader);
                dic[cust.Custodian_Number] = cust;
            }
            reader.Close();

            return(dic);
        }