Beispiel #1
0
        public static void Init_from_DB()
        {
            if ((DateTime.Now - CustodianMaster.lastUpdateTime).TotalHours < Utility.RefreshInterval)
            {
                return;
            }

            CustodianMaster.Reset();
            DB_select selt   = new DB_select(Custodian.Get_cmdTP());
            DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB());

            while (reader.Read())
            {
                Custodian cust = new Custodian();
                cust.Init_from_reader(reader);

                CustodianMaster.num_dic[cust.Custodian_Number]            = cust;
                CustodianMaster.full_dic[cust.Custodian_FullName.Value]   = cust;
                CustodianMaster.short_dic[cust.Custodian_ShortName.Value] = cust;
            }
            reader.Close();

            CustodianMaster.lastUpdateTime = DateTime.Now;
        }
Beispiel #2
0
        internal HssUtility.SQLserver.DB_insert Get_DBinsert()
        {
            HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(Custodian.Get_cmdTP());

            dbIns.AddValue("Custodian_ShortName", this.Custodian_ShortName);
            dbIns.AddValue("Custodian_FullName", this.Custodian_FullName);
            dbIns.AddValue("Account_Number", this.Account_Number);               /*Optional 4*/
            dbIns.AddValue("Safekeeping_Number", this.Safekeeping_Number);       /*Optional 5*/
            dbIns.AddValue("Language", this.Language);                           /*Optional 6*/
            dbIns.AddValue("Country_Code", this.Country_Code);                   /*Optional 7*/
            dbIns.AddValue("Title", this.Title);                                 /*Optional 8*/
            dbIns.AddValue("From_FirstName", this.From_FirstName);               /*Optional 9*/
            dbIns.AddValue("From_LastName", this.From_LastName);                 /*Optional 10*/
            dbIns.AddValue("From_Company", this.From_Company);                   /*Optional 11*/
            dbIns.AddValue("From_Address1", this.From_Address1);                 /*Optional 12*/
            dbIns.AddValue("From_Address2", this.From_Address2);                 /*Optional 13*/
            dbIns.AddValue("From_Address3", this.From_Address3);                 /*Optional 14*/
            dbIns.AddValue("From_Address4", this.From_Address4);                 /*Optional 15*/
            dbIns.AddValue("From_Address5", this.From_Address5);                 /*Optional 16*/
            dbIns.AddValue("Telephone", this.Telephone);                         /*Optional 17*/
            dbIns.AddValue("Fax", this.Fax);                                     /*Optional 18*/
            dbIns.AddValue("DefaultCustodianType", this.DefaultCustodianType);   /*Optional 19*/
            dbIns.AddValue("PrimaryAllowed", this.PrimaryAllowed);               /*Optional 20*/
            dbIns.AddValue("Tax_Authority", this.Tax_Authority);                 /*Optional 21*/
            dbIns.AddValue("TA_ATTN", this.TA_ATTN);                             /*Optional 22*/
            dbIns.AddValue("TA_Address1", this.TA_Address1);                     /*Optional 23*/
            dbIns.AddValue("TA_Address2", this.TA_Address2);                     /*Optional 24*/
            dbIns.AddValue("Custodian_Alias", this.Custodian_Alias);             /*Optional 25*/
            dbIns.AddValue("TA_Phone", this.TA_Phone);                           /*Optional 26*/
            dbIns.AddValue("TA_FAX", this.TA_FAX);                               /*Optional 27*/
            dbIns.AddValue("Custodian_Ref_Number", this.Custodian_Ref_Number);   /*Optional 28*/
            dbIns.AddValue("JPM_Custodian_Ref_Num", this.JPM_Custodian_Ref_Num); /*Optional 29*/

            return(dbIns);
        }
Beispiel #3
0
        internal HssUtility.SQLserver.DB_update Get_DBupdate()
        {
            if (!this.CheckValueChanges())
            {
                return(null);
            }

            HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(Custodian.Get_cmdTP());
            if (this.Custodian_ShortName.ValueChanged)
            {
                upd.AddValue("Custodian_ShortName", this.Custodian_ShortName);
            }
            if (this.Custodian_FullName.ValueChanged)
            {
                upd.AddValue("Custodian_FullName", this.Custodian_FullName);
            }
            if (this.Account_Number.ValueChanged)
            {
                upd.AddValue("Account_Number", this.Account_Number);                                  /*Optional 4*/
            }
            if (this.Safekeeping_Number.ValueChanged)
            {
                upd.AddValue("Safekeeping_Number", this.Safekeeping_Number);                                      /*Optional 5*/
            }
            if (this.Language.ValueChanged)
            {
                upd.AddValue("Language", this.Language);                            /*Optional 6*/
            }
            if (this.Country_Code.ValueChanged)
            {
                upd.AddValue("Country_Code", this.Country_Code);                                /*Optional 7*/
            }
            if (this.Title.ValueChanged)
            {
                upd.AddValue("Title", this.Title);                         /*Optional 8*/
            }
            if (this.From_FirstName.ValueChanged)
            {
                upd.AddValue("From_FirstName", this.From_FirstName);                                  /*Optional 9*/
            }
            if (this.From_LastName.ValueChanged)
            {
                upd.AddValue("From_LastName", this.From_LastName);                                 /*Optional 10*/
            }
            if (this.From_Company.ValueChanged)
            {
                upd.AddValue("From_Company", this.From_Company);                                /*Optional 11*/
            }
            if (this.From_Address1.ValueChanged)
            {
                upd.AddValue("From_Address1", this.From_Address1);                                 /*Optional 12*/
            }
            if (this.From_Address2.ValueChanged)
            {
                upd.AddValue("From_Address2", this.From_Address2);                                 /*Optional 13*/
            }
            if (this.From_Address3.ValueChanged)
            {
                upd.AddValue("From_Address3", this.From_Address3);                                 /*Optional 14*/
            }
            if (this.From_Address4.ValueChanged)
            {
                upd.AddValue("From_Address4", this.From_Address4);                                 /*Optional 15*/
            }
            if (this.From_Address5.ValueChanged)
            {
                upd.AddValue("From_Address5", this.From_Address5);                                 /*Optional 16*/
            }
            if (this.Telephone.ValueChanged)
            {
                upd.AddValue("Telephone", this.Telephone);                             /*Optional 17*/
            }
            if (this.Fax.ValueChanged)
            {
                upd.AddValue("Fax", this.Fax);                       /*Optional 18*/
            }
            if (this.DefaultCustodianType.ValueChanged)
            {
                upd.AddValue("DefaultCustodianType", this.DefaultCustodianType);                                        /*Optional 19*/
            }
            if (this.PrimaryAllowed.ValueChanged)
            {
                upd.AddValue("PrimaryAllowed", this.PrimaryAllowed);                                  /*Optional 20*/
            }
            if (this.Tax_Authority.ValueChanged)
            {
                upd.AddValue("Tax_Authority", this.Tax_Authority);                                 /*Optional 21*/
            }
            if (this.TA_ATTN.ValueChanged)
            {
                upd.AddValue("TA_ATTN", this.TA_ATTN);                           /*Optional 22*/
            }
            if (this.TA_Address1.ValueChanged)
            {
                upd.AddValue("TA_Address1", this.TA_Address1);                               /*Optional 23*/
            }
            if (this.TA_Address2.ValueChanged)
            {
                upd.AddValue("TA_Address2", this.TA_Address2);                               /*Optional 24*/
            }
            if (this.Custodian_Alias.ValueChanged)
            {
                upd.AddValue("Custodian_Alias", this.Custodian_Alias);                                   /*Optional 25*/
            }
            if (this.TA_Phone.ValueChanged)
            {
                upd.AddValue("TA_Phone", this.TA_Phone);                            /*Optional 26*/
            }
            if (this.TA_FAX.ValueChanged)
            {
                upd.AddValue("TA_FAX", this.TA_FAX);                          /*Optional 27*/
            }
            if (this.Custodian_Ref_Number.ValueChanged)
            {
                upd.AddValue("Custodian_Ref_Number", this.Custodian_Ref_Number);                                        /*Optional 28*/
            }
            if (this.JPM_Custodian_Ref_Num.ValueChanged)
            {
                upd.AddValue("JPM_Custodian_Ref_Num", this.JPM_Custodian_Ref_Num);                                         /*Optional 29*/
            }
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("Custodian_Number", HssUtility.General.RelationalOperator.Equals, this.pk_ID);
            upd.SetCondition(rela);

            return(upd);
        }
Beispiel #4
0
        /// <summary>
        /// Initialize object from DB
        /// </summary>
        public bool Init_from_DB()
        {
            if (this.Custodian_Number < 0)
            {
                return(false);
            }

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