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

            this.DividendIndex          = reader.GetInt("DividendIndex");
            this.DTC_Number             = reader.GetString("DTC_Number");
            this.Company_Name           = reader.GetString("Company_Name");
            this.Total_RecDate_Position = reader.GetDecimal("Total_RecDate_Position");
            this.CustodianID            = reader.GetInt("CustodianID");

            for (int i = 1; i <= Rates.RateCount; ++i)
            {
                this.curr_ratePos[i] = reader.GetDecimal("Rate_Position_" + i);
                this.DB_ratePos[i]   = this.curr_ratePos[i];

                this.curr_rateCharges[i] = reader.GetDecimal("Rate_Chargeback_" + i);
                this.DB_rateCharges[i]   = this.curr_rateCharges[i];
            }

            for (int i = 1; i <= 5; ++i)
            {
                this.Exampts[i] = reader.GetDecimal("Exempt" + i);
            }
        }
Beispiel #2
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();
        }
        internal void Init_from_reader(DB_reader reader)
        {
            if (reader == null || reader.IsClosed)
            {
                return;
            }

            this.Dividend_OptionID = reader.GetInt("Dividend_OptionID");
            this.DividendIndex     = reader.GetInt("DividendIndex");
            this.OptionNumber      = reader.GetInt("OptionNumber");
            this.Sender            = reader.GetString("Sender");
            this.OptionActionType  = reader.GetString("OptionActionType");
        }
Beispiel #4
0
        internal void Init_from_reader(DB_reader reader)
        {
            if (reader == null || reader.IsClosed)
            {
                return;
            }

            this.pk_ID                      = reader.GetInt("esp_system_id");
            this.coi_code.Value             = reader.GetString("coi_code");
            this.clearing_system_id.Value   = reader.GetInt("clearing_system_id");
            this.security_type_id.Value     = reader.GetInt("security_type_id");
            this.event_restriction_id.Value = reader.GetInt("event_restriction_id");

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

            this.pk_ID = reader.GetInt("security_id");
            this.security_name.Value = reader.GetString("security_name");
            this.esp_system_id.Value = reader.GetInt("esp_system_id");
            this.cusip.Value         = reader.GetString("cusip");
            this.isin.Value          = reader.GetString("isin");
            this.sedol.Value         = reader.GetString("sedol");

            this.SyncWithDB();
        }
Beispiel #6
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 #7
0
        public void Init_from_reader(DB_reader reader)
        {
            if (reader == null || reader.IsClosed)
            {
                return;
            }

            this.DTC_Number           = reader.GetString("DTC_Number");
            this.DividendIndex        = reader.GetInt("DividendIndex");
            this.ClaimShares_ADRS_SUM = reader.GetDecimal("ClaimShares_ADRS_SUM");
        }
Beispiel #8
0
        internal void Init_from_reader(DB_reader reader)
        {
            if (reader == null || reader.IsClosed)
            {
                return;
            }

            this.curr_DCT     = reader.GetInt("DTC");
            this.DCT_Number   = reader.GetString("DTC_Number");
            this.Company_Name = reader.GetString("Company_Name");
            this.Type         = reader.GetString("Type");
        }
Beispiel #9
0
        internal void Init_from_reader(DB_reader reader)
        {
            if (reader == null || reader.IsClosed)
            {
                return;
            }

            this.pk_ID = reader.GetInt("depositary_info_id");
            this.depositary_name.Value     = reader.GetString("depositary_name");
            this.depositary_address1.Value = reader.GetString("depositary_address1");
            this.depositary_address2.Value = reader.GetString("depositary_address2");
            this.phone.Value = reader.GetString("phone");
            this.fax.Value   = reader.GetString("fax");
            this.international_phone.Value  = reader.GetString("international_phone");
            this.depositary_full_name.Value = reader.GetString("depositary_full_name");
            this.depositary_index.Value     = reader.GetInt("depositary_index");
            this.active.Value     = reader.GetBool("active");
            this.stamp_name.Value = reader.GetString("stamp_name");

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

            this.DTC_PositionID         = reader.GetInt("DTC_PositionID");
            this.DTC_Number             = reader.GetString("DTC_Number");
            this.DividendIndex          = reader.GetInt("DividendIndex");
            this.Total_RecDate_Position = reader.GetDecimal("Total_RecDate_Position");

            for (int i = 1; i <= 18; ++i)
            {
                string  colName = "Rate_Position_" + i;
                decimal val     = reader.GetDecimal(colName, 0);
                if (val > 0)
                {
                    this.values_dic[colName] = val;
                }
            }
            for (int i = 1; i <= 18; ++i)
            {
                string  colName = "Rate_Chargeback_" + i;
                decimal val     = reader.GetDecimal(colName, 0);
                if (val > 0)
                {
                    this.values_dic[colName] = val;
                }
            }
            for (int i = 1; i <= 5; ++i)
            {
                string  colName = "Exempt" + i;
                decimal val     = reader.GetDecimal(colName, 0);
                if (val > 0)
                {
                    this.values_dic[colName] = val;
                }
            }
        }
Beispiel #11
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");
        }
Beispiel #12
0
        internal void Init_from_reader(DB_reader reader)
        {
            if (reader == null || reader.IsClosed)
            {
                return;
            }

            this.TABLE_SCHEMA     = reader.GetString("TABLE_SCHEMA");
            this.TABLE_NAME       = reader.GetString("TABLE_NAME");
            this.COLUMN_NAME      = reader.GetString("COLUMN_NAME");
            this.ORDINAL_POSITION = reader.GetInt("ORDINAL_POSITION");
            this.IS_NULLABLE      = reader.GetString("IS_NULLABLE");
            this.DATA_TYPE        = reader.GetString("DATA_TYPE");

            this.attr_name = this.COLUMN_NAME.Replace(' ', '_');
        }
Beispiel #13
0
        public static Dividend GetDividend_XBRL_refNum(string XBRL_ReferenceNumber, DividendTable_option table = DividendTable_option.Dividend_Control_Approved)
        {
            if (string.IsNullOrEmpty(XBRL_ReferenceNumber))
            {
                return(null);
            }

            CmdTemplate tp = new CmdTemplate();

            tp.tableName = "Dividend_XBRL";
            tp.AddColumn("DividendIndex");

            DB_select    selt = new DB_select(tp);
            SQL_relation rela = new SQL_relation("XBRL_ReferenceNumber", RelationalOperator.Equals, XBRL_ReferenceNumber);

            selt.SetCondition(rela);

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

            int dividendIndex = -1;

            if (reader.Read())
            {
                dividendIndex = reader.GetInt("DividendIndex");
            }
            reader.Close();

            if (dividendIndex < 0)
            {
                return(null);
            }

            Dividend dvd = new Dividend(dividendIndex);

            dvd.Init_from_DB(table);

            return(dvd);
        }