Beispiel #1
0
        internal void Init_from_reader(DB_reader reader)
        {
            if (reader == null || reader.IsClosed)
            {
                return;
            }

            this.pk_ID = reader.GetInt("event_id");
            this.dividend_index.Value                = reader.GetInt("dividend_index");
            this.security_id.Value                   = reader.GetInt("security_id");
            this.record_date_adr.Value               = reader.GetDateTime("record_date_adr");
            this.pay_date_adr.Value                  = reader.GetDateTime("pay_date_adr");
            this.record_date_ord.Value               = reader.GetDateTime("record_date_ord");
            this.pay_date_ord.Value                  = reader.GetDateTime("pay_date_ord");
            this.deadline_at_source.Value            = reader.GetDateTime("deadline_at_source");
            this.deadline_quick_refund.Value         = reader.GetDateTime("deadline_quick_refund");
            this.deadline_long_form.Value            = reader.GetDateTime("deadline_long_form");
            this.depositary_info_id.Value            = reader.GetInt("depositary_info_id");
            this.market_statute_of_limitations.Value = reader.GetDateTime("market_statute_of_limitations");
            this.enabled.Value          = reader.GetBool("enabled");
            this.notes.Value            = reader.GetString("notes");
            this.last_modified_by.Value = reader.GetString("last_modified_by");
            this.last_modified_at.Value = reader.GetDateTime("last_modified_at");
            this.is_active.Value        = reader.GetBool("is_active");
            this.dividend.Value         = reader.GetString("dividend");
            this.is_exception.Value     = reader.GetBool("is_exception");
            this.esp_model_id.Value     = reader.GetInt("esp_model_id");

            this.SyncWithDB();
        }
Beispiel #2
0
        public static Dictionary <int, DateTime> Get_DateTime_values(List <int> detailID_list, string colName)
        {
            Dictionary <int, DateTime> dic = new Dictionary <int, DateTime>();

            if (detailID_list == null || detailID_list.Count < 1)
            {
                return(dic);
            }
            if (string.IsNullOrEmpty(colName))
            {
                return(dic);
            }

            List <List <int> > splited_list = new List <List <int> >();//split detailID_list into small lists
            List <int>         tempList     = new List <int>();

            foreach (int ID in detailID_list)
            {
                tempList.Add(ID);
                if (tempList.Count >= 100)
                {
                    splited_list.Add(tempList);
                    tempList = new List <int>();
                }
            }
            if (tempList.Count > 0)
            {
                splited_list.Add(tempList);
            }

            CmdTemplate cmdTp = new CmdTemplate();//create template for DB

            cmdTp.tableName = DividendDetail_master.Detail_tableName;
            cmdTp.AddColumn(DividendDetail_master.Detail_PK_colName);
            cmdTp.AddColumn(colName);

            DB_select selt = new DB_select(cmdTp);

            foreach (List <int> list in splited_list)
            {
                SQL_relation rela = new SQL_relation(DividendDetail_master.Detail_PK_colName, true, list);
                selt.SetCondition(rela);

                DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB());
                while (reader.Read())
                {
                    int      detailID = reader.GetInt(DividendDetail_master.Detail_PK_colName);
                    DateTime dt       = reader.GetDateTime(colName);
                    dic[detailID] = dt;
                }
                reader.Close();
            }

            return(dic);
        }
Beispiel #3
0
        public void Init_from_reader(DB_reader reader)
        {
            if (reader == null || reader.IsClosed)
            {
                return;
            }

            this.DividendIndex           = reader.GetInt("DividendIndex");
            this.Issue                   = reader.GetString("Issue");
            this.Country                 = reader.GetString("Country");
            this.CUSIP                   = reader.GetString("CUSIP");
            this.DTCPosition_ModelNumber = reader.GetInt("DTCPosition_ModelNumber");

            this.RecordDate_ADR = reader.GetDateTime("RecordDate_ADR", Utility.MinDate);
            this.PayDate_ADR    = reader.GetDateTime("PayDate_ADR", Utility.MinDate);
            this.PayDate_ORD    = reader.GetDateTime("PayDate_ORD", Utility.MinDate);

            this.FinalDivGrossAmount_ORD = reader.GetDecimal("FinalDivGrossAmount_ORD");
            this.FinalDivGrossAmount_ADR = reader.GetDecimal("FinalDivGrossAmount_ADR");
            this.LongFormFee             = reader.GetDecimal("LongFormFee");
            this.StatutoryRate           = reader.GetDecimal("StatutoryRate");
        }