private void Assign_Dvd_DTC(Dictionary <int, BD_Dividend> dvd_dic, List <BD_DTC_Position> dp_list) { this.statusInfo.status = "Assign DTC_Position to Dividend"; if (dvd_dic == null || dp_list == null) { return; } foreach (BD_DTC_Position bdp in dp_list) { if (!this.dvd_dic.ContainsKey(bdp.DividendIndex)) { continue; } if (string.IsNullOrEmpty(bdp.DTC_Number)) { continue; } BD_Dividend dvd = dvd_dic[bdp.DividendIndex]; dvd.bdp_dic[bdp.DTC_Number] = bdp; ++this.statusInfo.recordNum; } }
private Dictionary <int, BD_Dividend> CreateDvdDic(HashSet <int> dvdIndex_hs) { this.statusInfo.status = "Create Dividend Dictionary"; Dictionary <int, BD_Dividend> dic = new Dictionary <int, BD_Dividend>(); if (dvdIndex_hs == null) { return(dic); } DB_select selt = new DB_select(BD_Dividend.Get_cmdTP()); SQL_relation rela = new SQL_relation("DividendIndex", true, dvdIndex_hs); selt.SetCondition(rela); DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB()); while (reader.Read()) { BD_Dividend dvd = new BD_Dividend(); dvd.Init_from_reader(reader); dic[dvd.DividendIndex] = dvd; ++this.statusInfo.recordNum; } reader.Close(); return(dic); }
private void Cal_ClaimShares_ADRS_SUM(Dictionary <int, BD_Dividend> dic) { this.statusInfo.status = "Calculate ClaimShares_ADRS_SUM"; DB_select selt = new DB_select(BD_detailSum.Get_cmdTP()); SQL_relation rela0 = new SQL_relation("Status", RelationalOperator.NotEqual, "REJECTED"); SQL_relation rela1 = new SQL_relation("ReceivedDate", RelationalOperator.GreaterThan, "1900-1-1"); SQL_condition cond0 = new SQL_condition(rela0, ConditionalOperator.And, rela1); SQL_relation rela2 = new SQL_relation("RecordDatePosition", RelationalOperator.GreaterThan, 0); selt.SetCondition(new SQL_condition(cond0, ConditionalOperator.And, rela2)); DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB()); int count = 0; while (reader.Read()) { BD_detailSum detail = new BD_detailSum(); detail.Init_from_reader(reader); if (!dic.ContainsKey(detail.DividendIndex)) { continue; } BD_Dividend dvd = this.dvd_dic[detail.DividendIndex]; if (!dvd.bdp_dic.ContainsKey(detail.DTC_Number)) { continue; } BD_DTC_Position bdp = dvd.bdp_dic[detail.DTC_Number]; bdp.ClaimShares_ADRS_SUM = detail.ClaimShares_ADRS_SUM; ++count; ++this.statusInfo.recordNum; } reader.Close(); this.statusInfo.additional_info_list.Add("Total BD_detailSum count=" + count); }