Esempio n. 1
0
        internal HssUtility.SQLserver.DB_update Get_DBupdate()
        {
            if (!this.CheckValueChanges())
            {
                return(null);
            }

            HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(Schedule_Of_Fees_Per_Rate.Get_cmdTP());
            if (this.Security_Type.ValueChanged)
            {
                upd.AddValue("Security_Type", this.Security_Type);                                 /*Optional 2*/
            }
            if (this.Depositary.ValueChanged)
            {
                upd.AddValue("Depositary", this.Depositary);
            }
            if (this.WithholdingRate.ValueChanged)
            {
                upd.AddValue("WithholdingRate", this.WithholdingRate);                                   /*Optional 4*/
            }
            if (this.ADSC.ValueChanged)
            {
                upd.AddValue("ADSC", this.ADSC);                        /*Optional 5*/
            }
            if (this.RateWithADSC.ValueChanged)
            {
                upd.AddValue("RateWithADSC", this.RateWithADSC);                                /*Optional 6*/
            }
            if (this.EffectiveDate.ValueChanged)
            {
                upd.AddValue("EffectiveDate", this.EffectiveDate);                                 /*Optional 7*/
            }
            if (this.CreatedDate.ValueChanged)
            {
                upd.AddValue("CreatedDate", this.CreatedDate);                               /*Optional 8*/
            }
            if (this.ImportBy.ValueChanged)
            {
                upd.AddValue("ImportBy", this.ImportBy);                            /*Optional 9*/
            }
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("Country", HssUtility.General.RelationalOperator.Equals, this.pk_ID);
            upd.SetCondition(rela);

            return(upd);
        }
Esempio n. 2
0
        public Schedule_Of_Fees_Per_Rate GetCopy()
        {
            Schedule_Of_Fees_Per_Rate newEntity = new Schedule_Of_Fees_Per_Rate();

            if (!this.Security_Type.IsNull_flag)
            {
                newEntity.Security_Type.Value = this.Security_Type.Value;
            }
            if (!this.Depositary.IsNull_flag)
            {
                newEntity.Depositary.Value = this.Depositary.Value;
            }
            if (!this.WithholdingRate.IsNull_flag)
            {
                newEntity.WithholdingRate.Value = this.WithholdingRate.Value;
            }
            if (!this.ADSC.IsNull_flag)
            {
                newEntity.ADSC.Value = this.ADSC.Value;
            }
            if (!this.RateWithADSC.IsNull_flag)
            {
                newEntity.RateWithADSC.Value = this.RateWithADSC.Value;
            }
            if (!this.EffectiveDate.IsNull_flag)
            {
                newEntity.EffectiveDate.Value = this.EffectiveDate.Value;
            }
            if (!this.CreatedDate.IsNull_flag)
            {
                newEntity.CreatedDate.Value = this.CreatedDate.Value;
            }
            if (!this.ImportBy.IsNull_flag)
            {
                newEntity.ImportBy.Value = this.ImportBy.Value;
            }
            return(newEntity);
        }
Esempio n. 3
0
        public static void Init_from_DB()
        {
            if ((DateTime.Now - DSC_master.lastUpdateTime).TotalHours < Utility.RefreshInterval)
            {
                return;
            }

            DSC_master.Reset();
            DB_select selt = new DB_select(Schedule_Of_Fees_Per_Rate.Get_cmdTP());

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

            while (reader.Read())
            {
                Schedule_Of_Fees_Per_Rate sfpr = new Schedule_Of_Fees_Per_Rate();
                sfpr.Init_from_reader(reader);
                DSC_master.sfpr_list.Add(sfpr);
            }
            reader.Close();

            DSC_master.sfpr_list.Sort((a, b) => DateTime.Compare(b.EffectiveDate.Value, a.EffectiveDate.Value));
            DSC_master.lastUpdateTime = DateTime.Now;
        }
Esempio n. 4
0
        /// <summary>
        /// Initialize object from DB
        /// </summary>
        public bool Init_from_DB()
        {
            if (string.IsNullOrEmpty(this.Country))
            {
                return(false);
            }

            HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(Schedule_Of_Fees_Per_Rate.Get_cmdTP());
            db_sel.tableName = "Schedule_Of_Fees_Per_Rate";
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("Country", HssUtility.General.RelationalOperator.Equals, this.Country);
            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);
        }
Esempio n. 5
0
        internal HssUtility.SQLserver.DB_insert Get_DBinsert()
        {
            HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(Schedule_Of_Fees_Per_Rate.Get_cmdTP());

            dbIns.AddValue("Security_Type", this.Security_Type);     /*Optional 2*/
            dbIns.AddValue("Depositary", this.Depositary);
            dbIns.AddValue("WithholdingRate", this.WithholdingRate); /*Optional 4*/
            dbIns.AddValue("ADSC", this.ADSC);                       /*Optional 5*/
            dbIns.AddValue("RateWithADSC", this.RateWithADSC);       /*Optional 6*/
            dbIns.AddValue("EffectiveDate", this.EffectiveDate);     /*Optional 7*/
            dbIns.AddValue("CreatedDate", this.CreatedDate);         /*Optional 8*/
            dbIns.AddValue("ImportBy", this.ImportBy);               /*Optional 9*/

            return(dbIns);
        }