Ejemplo n.º 1
0
        public static void Init_from_DB()
        {
            if ((DateTime.Now - DepositaryMaster.lastUpdateTime).TotalHours < Utility.RefreshInterval)
            {
                return;
            }

            DepositaryMaster.Reset();
            DB_select selt = new DB_select(Depositary.Get_cmdTP());

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

            while (reader.Read())
            {
                Depositary depo = new Depositary();
                depo.Init_from_reader(reader);

                DepositaryMaster.depoID_dic[depo.DepositaryID.Value]           = depo;
                DepositaryMaster.shortName_dic[depo.DepositaryShortName.Value] = depo;

                if (DepositaryMaster.depoName_dic.ContainsKey(depo.DepositaryName.Value)) //handle "unsponsered"
                {
                    Depositary existing_depo = DepositaryMaster.depoName_dic[depo.DepositaryName.Value];
                    if (depo.DepositaryIndex.Value < 0)
                    {
                        continue;
                    }

                    if (existing_depo.DepositaryIndex.Value < 0)
                    {
                        DepositaryMaster.depoName_dic[depo.DepositaryName.Value] = depo;
                    }
                    else if (depo.DepositaryIndex.Value < existing_depo.DepositaryIndex.Value)
                    {
                        DepositaryMaster.depoName_dic[depo.DepositaryName.Value] = depo;
                    }
                    else
                    {
                        continue;
                    }
                }
                else
                {
                    DepositaryMaster.depoName_dic[depo.DepositaryName.Value] = depo;
                }
            }
            reader.Close();

            DepositaryMaster.lastUpdateTime = DateTime.Now;
        }
Ejemplo n.º 2
0
 internal HssUtility.SQLserver.DB_insert Get_DBinsert()
 {
     HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(Depositary.Get_cmdTP());
     dbIns.AddValue("DepositaryID", this.DepositaryID.Value);
     dbIns.AddValue("DepositaryName", this.DepositaryName.Value);
     dbIns.AddValue("DepositaryDisplayName", this.DepositaryDisplayName.Value);         /*Optional 4*/
     dbIns.AddValue("DepositaryShortName", this.DepositaryShortName.Value);             /*Optional 5*/
     dbIns.AddValue("DepositaryIndex", this.DepositaryIndex.Value);                     /*Optional 6*/
     dbIns.AddValue("Depositary_Contact", this.Depositary_Contact.Value);               /*Optional 7*/
     dbIns.AddValue("Depositary_Phone", this.Depositary_Phone.Value);                   /*Optional 8*/
     dbIns.AddValue("Depositary_Address1", this.Depositary_Address1.Value);             /*Optional 9*/
     dbIns.AddValue("Depositary_Address2", this.Depositary_Address2.Value);             /*Optional 10*/
     dbIns.AddValue("Depositary_City", this.Depositary_City.Value);                     /*Optional 11*/
     dbIns.AddValue("Depositary_State", this.Depositary_State.Value);                   /*Optional 12*/
     dbIns.AddValue("Active", this.Active.Value);                                       /*Optional 13*/
     dbIns.AddValue("UniqueDepositaryIndex", this.UniqueDepositaryIndex.Value);         /*Optional 14*/
     dbIns.AddValue("SecurityTypeID", this.SecurityTypeID.Value);                       /*Optional 15*/
     dbIns.AddValue("ESP_DepositaryName", this.ESP_DepositaryName.Value);               /*Optional 16*/
     dbIns.AddValue("ESP_DepositaryAddress1", this.ESP_DepositaryAddress1.Value);       /*Optional 17*/
     dbIns.AddValue("ESP_DepositaryAddress2", this.ESP_DepositaryAddress2.Value);       /*Optional 18*/
     dbIns.AddValue("ESP_Phone", this.ESP_Phone.Value);                                 /*Optional 19*/
     dbIns.AddValue("ESP_Fax", this.ESP_Fax.Value);                                     /*Optional 20*/
     dbIns.AddValue("ESP_InternationalPhone", this.ESP_InternationalPhone.Value);       /*Optional 21*/
     dbIns.AddValue("ESP_DepositaryFullName", this.ESP_DepositaryFullName.Value);       /*Optional 22*/
     dbIns.AddValue("ESP_Idemnification", this.ESP_Idemnification.Value);               /*Optional 23*/
     dbIns.AddValue("ESP_Idemnification2", this.ESP_Idemnification2.Value);             /*Optional 24*/
     dbIns.AddValue("ESP_Idemnification_DI", this.ESP_Idemnification_DI.Value);         /*Optional 25*/
     dbIns.AddValue("ESP_Idemnification2_DI", this.ESP_Idemnification2_DI.Value);       /*Optional 26*/
     dbIns.AddValue("ESP_DepositaryAccount", this.ESP_DepositaryAccount.Value);         /*Optional 27*/
     dbIns.AddValue("ESP_DepositaryIBANCode", this.ESP_DepositaryIBANCode.Value);       /*Optional 28*/
     dbIns.AddValue("ESP_DepositaryBIC", this.ESP_DepositaryBIC.Value);                 /*Optional 29*/
     dbIns.AddValue("ESP_DepositaryBank", this.ESP_DepositaryBank.Value);               /*Optional 30*/
     dbIns.AddValue("Nominee", this.Nominee.Value);                                     /*Optional 31*/
     dbIns.AddValue("Nominee_Address", this.Nominee_Address.Value);                     /*Optional 32*/
     dbIns.AddValue("ESP_Idemnification_RUSSIA", this.ESP_Idemnification_RUSSIA.Value); /*Optional 33*/
     dbIns.AddValue("ActiveFirstFiler", this.ActiveFirstFiler.Value);                   /*Optional 34*/
     dbIns.AddValue("PaymentInvoiceCurrency", this.PaymentInvoiceCurrency.Value);
     dbIns.AddValue("ClearingSystem", this.ClearingSystem.Value);                       /*Optional 36*/
     dbIns.AddValue("ACH_Enabled", this.ACH_Enabled.Value);                             /*Optional 37*/
     dbIns.AddValue("Originated_ACH_Company_ID", this.Originated_ACH_Company_ID.Value); /*Optional 38*/
     dbIns.AddValue("Originated_Account_Number", this.Originated_Account_Number.Value); /*Optional 39*/
     dbIns.AddValue("ACH_ModifiedBy", this.ACH_ModifiedBy.Value);                       /*Optional 40*/
     dbIns.AddValue("ACH_ModifiedDateTime", this.ACH_ModifiedDateTime.Value);           /*Optional 41*/
     dbIns.AddValue("ModifiedDateTime", this.ModifiedDateTime.Value);                   /*Optional 42*/
     dbIns.AddValue("Unique_DepositaryName", this.Unique_DepositaryName.Value);         /*Optional 43*/
     return(dbIns);
 }
Ejemplo n.º 3
0
        public bool Init_from_DB()
        {
            if (this.ID < 0)
            {
                return(false);
            }

            HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(Depositary.Get_cmdTP());
            db_sel.tableName = "Depositaries";
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("ID", HssUtility.General.RelationalOperator.Equals, this.ID);
            db_sel.SetCondition(rela);

            bool res_flag = false;

            HssUtility.SQLserver.DB_reader reader = new HssUtility.SQLserver.DB_reader(db_sel, Utility.Get_DRWIN_hDB());
            if (reader.Read())
            {
                this.Init_from_reader(reader);
                res_flag = true;
            }
            reader.Close();
            return(res_flag);
        }