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

            DTC_Participants_master.Reset();
            DB_select selt   = new DB_select(DTC_Participants.Get_cmdTP());
            DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB());

            while (reader.Read())
            {
                DTC_Participants dp = new DTC_Participants();
                dp.Init_from_reader(reader);

                DTC_Participants_master.ID_dic[dp.DTC] = dp;
                DTC_Participants_master.DTCnum_dic[dp.DTC_Number.Value] = dp;
            }
            reader.Close();

            DTC_Participants_master.lastUpdateTime = DateTime.Now;
        }
Exemplo n.º 2
0
        internal HssUtility.SQLserver.DB_update Get_DBupdate()
        {
            if (!this.CheckValueChanges())
            {
                return(null);
            }

            HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(DTC_Participants.Get_cmdTP());
            if (this.DTC_Number.ValueChanged)
            {
                upd.AddValue("DTC_Number", this.DTC_Number);
            }
            if (this.Company_Name.ValueChanged)
            {
                upd.AddValue("Company_Name", this.Company_Name);
            }
            if (this.ATTN.ValueChanged)
            {
                upd.AddValue("ATTN", this.ATTN);                        /*Optional 4*/
            }
            if (this.Address1.ValueChanged)
            {
                upd.AddValue("Address1", this.Address1);                            /*Optional 5*/
            }
            if (this.Address2.ValueChanged)
            {
                upd.AddValue("Address2", this.Address2);                            /*Optional 6*/
            }
            if (this.City.ValueChanged)
            {
                upd.AddValue("City", this.City);                        /*Optional 7*/
            }
            if (this.State.ValueChanged)
            {
                upd.AddValue("State", this.State);                         /*Optional 8*/
            }
            if (this.Country.ValueChanged)
            {
                upd.AddValue("Country", this.Country);                           /*Optional 9*/
            }
            if (this.Zip_Postal_Code.ValueChanged)
            {
                upd.AddValue("Zip_Postal_Code", this.Zip_Postal_Code);                                   /*Optional 10*/
            }
            if (this.Phone.ValueChanged)
            {
                upd.AddValue("Phone", this.Phone);                         /*Optional 11*/
            }
            if (this.Fax.ValueChanged)
            {
                upd.AddValue("Fax", this.Fax);                       /*Optional 12*/
            }
            if (this.WebsiteUrl.ValueChanged)
            {
                upd.AddValue("WebsiteUrl", this.WebsiteUrl);                              /*Optional 13*/
            }
            if (this.Email.ValueChanged)
            {
                upd.AddValue("Email", this.Email);                         /*Optional 14*/
            }
            if (this.Fixed_Payment_ATTN.ValueChanged)
            {
                upd.AddValue("Fixed_Payment_ATTN", this.Fixed_Payment_ATTN);                                      /*Optional 15*/
            }
            if (this.Type.ValueChanged)
            {
                upd.AddValue("Type", this.Type);                        /*Optional 16*/
            }
            if (this.Depositary.ValueChanged)
            {
                upd.AddValue("Depositary", this.Depositary);                              /*Optional 17*/
            }
            if (this.RejectEmail.ValueChanged)
            {
                upd.AddValue("RejectEmail", this.RejectEmail);                               /*Optional 18*/
            }
            if (this.PaymentEmail.ValueChanged)
            {
                upd.AddValue("PaymentEmail", this.PaymentEmail);                                /*Optional 19*/
            }
            if (this.DocInventoryEmail.ValueChanged)
            {
                upd.AddValue("DocInventoryEmail", this.DocInventoryEmail);                                     /*Optional 20*/
            }
            if (this.SecurityTypeID.ValueChanged)
            {
                upd.AddValue("SecurityTypeID", this.SecurityTypeID);
            }
            if (this.AccountNumber.ValueChanged)
            {
                upd.AddValue("AccountNumber", this.AccountNumber);
            }
            if (this.IssuerCSD.ValueChanged)
            {
                upd.AddValue("IssuerCSD", this.IssuerCSD);                             /*Optional 23*/
            }
            if (this.ACH_Override.ValueChanged)
            {
                upd.AddValue("ACH_Override", this.ACH_Override);                                /*Optional 24*/
            }
            if (this.ACH_Bank.ValueChanged)
            {
                upd.AddValue("ACH_Bank", this.ACH_Bank);                            /*Optional 25*/
            }
            if (this.ACH_ABA.ValueChanged)
            {
                upd.AddValue("ACH_ABA", this.ACH_ABA);                           /*Optional 26*/
            }
            if (this.ACH_Account.ValueChanged)
            {
                upd.AddValue("ACH_Account", this.ACH_Account);                               /*Optional 27*/
            }
            if (this.ClearingSystem.ValueChanged)
            {
                upd.AddValue("ClearingSystem", this.ClearingSystem);
            }
            if (this.CustomWireMemo.ValueChanged)
            {
                upd.AddValue("CustomWireMemo", this.CustomWireMemo);                                  /*Optional 29*/
            }
            if (this.ModifiedDateTime.ValueChanged)
            {
                upd.AddValue("ModifiedDateTime", this.ModifiedDateTime);                                    /*Optional 30*/
            }
            if (this.Email_backup.ValueChanged)
            {
                upd.AddValue("Email_backup", this.Email_backup);                                /*Optional 31*/
            }
            if (this.PaymentEmail_backup.ValueChanged)
            {
                upd.AddValue("PaymentEmail_backup", this.PaymentEmail_backup);                                       /*Optional 32*/
            }
            if (this.RejectEmail_backup.ValueChanged)
            {
                upd.AddValue("RejectEmail_backup", this.RejectEmail_backup);                                      /*Optional 33*/
            }
            if (this.DocInventoryEmail_backup.ValueChanged)
            {
                upd.AddValue("DocInventoryEmail_backup", this.DocInventoryEmail_backup);                                            /*Optional 34*/
            }
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("DTC", HssUtility.General.RelationalOperator.Equals, this.pk_ID);
            upd.SetCondition(rela);

            return(upd);
        }
Exemplo n.º 3
0
        internal HssUtility.SQLserver.DB_insert Get_DBinsert()
        {
            HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(DTC_Participants.Get_cmdTP());

            dbIns.AddValue("DTC", this.DTC);
            dbIns.AddValue("DTC_Number", this.DTC_Number);
            dbIns.AddValue("Company_Name", this.Company_Name);
            dbIns.AddValue("ATTN", this.ATTN);                             /*Optional 4*/
            dbIns.AddValue("Address1", this.Address1);                     /*Optional 5*/
            dbIns.AddValue("Address2", this.Address2);                     /*Optional 6*/
            dbIns.AddValue("City", this.City);                             /*Optional 7*/
            dbIns.AddValue("State", this.State);                           /*Optional 8*/
            dbIns.AddValue("Country", this.Country);                       /*Optional 9*/
            dbIns.AddValue("Zip_Postal_Code", this.Zip_Postal_Code);       /*Optional 10*/
            dbIns.AddValue("Phone", this.Phone);                           /*Optional 11*/
            dbIns.AddValue("Fax", this.Fax);                               /*Optional 12*/
            dbIns.AddValue("WebsiteUrl", this.WebsiteUrl);                 /*Optional 13*/
            dbIns.AddValue("Email", this.Email);                           /*Optional 14*/
            dbIns.AddValue("Fixed_Payment_ATTN", this.Fixed_Payment_ATTN); /*Optional 15*/
            dbIns.AddValue("Type", this.Type);                             /*Optional 16*/
            dbIns.AddValue("Depositary", this.Depositary);                 /*Optional 17*/
            dbIns.AddValue("RejectEmail", this.RejectEmail);               /*Optional 18*/
            dbIns.AddValue("PaymentEmail", this.PaymentEmail);             /*Optional 19*/
            dbIns.AddValue("DocInventoryEmail", this.DocInventoryEmail);   /*Optional 20*/
            dbIns.AddValue("SecurityTypeID", this.SecurityTypeID);
            dbIns.AddValue("AccountNumber", this.AccountNumber);
            dbIns.AddValue("IssuerCSD", this.IssuerCSD);                               /*Optional 23*/
            dbIns.AddValue("ACH_Override", this.ACH_Override);                         /*Optional 24*/
            dbIns.AddValue("ACH_Bank", this.ACH_Bank);                                 /*Optional 25*/
            dbIns.AddValue("ACH_ABA", this.ACH_ABA);                                   /*Optional 26*/
            dbIns.AddValue("ACH_Account", this.ACH_Account);                           /*Optional 27*/
            dbIns.AddValue("ClearingSystem", this.ClearingSystem);
            dbIns.AddValue("CustomWireMemo", this.CustomWireMemo);                     /*Optional 29*/
            dbIns.AddValue("ModifiedDateTime", this.ModifiedDateTime);                 /*Optional 30*/
            dbIns.AddValue("Email_backup", this.Email_backup);                         /*Optional 31*/
            dbIns.AddValue("PaymentEmail_backup", this.PaymentEmail_backup);           /*Optional 32*/
            dbIns.AddValue("RejectEmail_backup", this.RejectEmail_backup);             /*Optional 33*/
            dbIns.AddValue("DocInventoryEmail_backup", this.DocInventoryEmail_backup); /*Optional 34*/

            return(dbIns);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initialize object from DB
        /// </summary>
        public bool Init_from_DB()
        {
            if (this.DTC < 0)
            {
                return(false);
            }

            HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(DTC_Participants.Get_cmdTP());
            db_sel.tableName = "DTC_Participants";
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("DTC", HssUtility.General.RelationalOperator.Equals, this.DTC);
            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);
        }