public Dividend_Schedule_Of_Fees_DSC GetCopy()
        {
            Dividend_Schedule_Of_Fees_DSC newEntity = new Dividend_Schedule_Of_Fees_DSC();

            if (!this.DividendIndex.IsNull_flag)
            {
                newEntity.DividendIndex.Value = this.DividendIndex.Value;
            }
            if (!this.WHRate.IsNull_flag)
            {
                newEntity.WHRate.Value = this.WHRate.Value;
            }
            if (!this.LongFormFees.IsNull_flag)
            {
                newEntity.LongFormFees.Value = this.LongFormFees.Value;
            }
            if (!this.MinLongFormFee.IsNull_flag)
            {
                newEntity.MinLongFormFee.Value = this.MinLongFormFee.Value;
            }
            if (!this.Fee_Max.IsNull_flag)
            {
                newEntity.Fee_Max.Value = this.Fee_Max.Value;
            }
            if (!this.Fee_Consularization.IsNull_flag)
            {
                newEntity.Fee_Consularization.Value = this.Fee_Consularization.Value;
            }
            if (!this.FavAtSourceFee.IsNull_flag)
            {
                newEntity.FavAtSourceFee.Value = this.FavAtSourceFee.Value;
            }
            if (!this.MinAtSourceFee.IsNull_flag)
            {
                newEntity.MinAtSourceFee.Value = this.MinAtSourceFee.Value;
            }
            if (!this.ExemptAtSourceFee.IsNull_flag)
            {
                newEntity.ExemptAtSourceFee.Value = this.ExemptAtSourceFee.Value;
            }
            if (!this.ShortFormFees.IsNull_flag)
            {
                newEntity.ShortFormFees.Value = this.ShortFormFees.Value;
            }
            if (!this.Fee_AtSource.IsNull_flag)
            {
                newEntity.Fee_AtSource.Value = this.Fee_AtSource.Value;
            }
            if (!this.MinQuickRefundFee.IsNull_flag)
            {
                newEntity.MinQuickRefundFee.Value = this.MinQuickRefundFee.Value;
            }
            if (!this.FavTransparentEntityFee.IsNull_flag)
            {
                newEntity.FavTransparentEntityFee.Value = this.FavTransparentEntityFee.Value;
            }
            if (!this.MinShortFormFee.IsNull_flag)
            {
                newEntity.MinShortFormFee.Value = this.MinShortFormFee.Value;
            }
            if (!this.Fee_QuickRefund.IsNull_flag)
            {
                newEntity.Fee_QuickRefund.Value = this.Fee_QuickRefund.Value;
            }
            if (!this.LastModifiedBy.IsNull_flag)
            {
                newEntity.LastModifiedBy.Value = this.LastModifiedBy.Value;
            }
            if (!this.ModifiedDateTime.IsNull_flag)
            {
                newEntity.ModifiedDateTime.Value = this.ModifiedDateTime.Value;
            }
            if (!this.AdditionalDSCFee.IsNull_flag)
            {
                newEntity.AdditionalDSCFee.Value = this.AdditionalDSCFee.Value;
            }
            if (!this.Source_FeeID.IsNull_flag)
            {
                newEntity.Source_FeeID.Value = this.Source_FeeID.Value;
            }
            if (!this.AdditionalDSCFee1.IsNull_flag)
            {
                newEntity.AdditionalDSCFee1.Value = this.AdditionalDSCFee1.Value;
            }
            if (!this.AtSourceModifiedBy.IsNull_flag)
            {
                newEntity.AtSourceModifiedBy.Value = this.AtSourceModifiedBy.Value;
            }
            return(newEntity);
        }
        internal HssUtility.SQLserver.DB_insert Get_DBinsert()
        {
            HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(Dividend_Schedule_Of_Fees_DSC.Get_cmdTP());

            dbIns.AddValue("DividendIndex", this.DividendIndex);
            dbIns.AddValue("WHRate", this.WHRate);
            dbIns.AddValue("LongFormFees", this.LongFormFees);
            dbIns.AddValue("MinLongFormFee", this.MinLongFormFee);
            dbIns.AddValue("Fee_Max", this.Fee_Max);
            dbIns.AddValue("Fee_Consularization", this.Fee_Consularization);
            dbIns.AddValue("FavAtSourceFee", this.FavAtSourceFee);
            dbIns.AddValue("MinAtSourceFee", this.MinAtSourceFee);
            dbIns.AddValue("ExemptAtSourceFee", this.ExemptAtSourceFee);
            dbIns.AddValue("ShortFormFees", this.ShortFormFees);
            dbIns.AddValue("Fee_AtSource", this.Fee_AtSource);
            dbIns.AddValue("MinQuickRefundFee", this.MinQuickRefundFee);
            dbIns.AddValue("FavTransparentEntityFee", this.FavTransparentEntityFee);
            dbIns.AddValue("MinShortFormFee", this.MinShortFormFee);
            dbIns.AddValue("Fee_QuickRefund", this.Fee_QuickRefund);
            dbIns.AddValue("LastModifiedBy", this.LastModifiedBy);         /*Optional 17*/
            dbIns.AddValue("ModifiedDateTime", this.ModifiedDateTime);     /*Optional 18*/
            dbIns.AddValue("AdditionalDSCFee", this.AdditionalDSCFee);     /*Optional 19*/
            dbIns.AddValue("Source_FeeID", this.Source_FeeID);             /*Optional 20*/
            dbIns.AddValue("AdditionalDSCFee1", this.AdditionalDSCFee1);   /*Optional 21*/
            dbIns.AddValue("AtSourceModifiedBy", this.AtSourceModifiedBy); /*Optional 22*/

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

            HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(Dividend_Schedule_Of_Fees_DSC.Get_cmdTP());
            if (this.DividendIndex.ValueChanged)
            {
                upd.AddValue("DividendIndex", this.DividendIndex);
            }
            if (this.WHRate.ValueChanged)
            {
                upd.AddValue("WHRate", this.WHRate);
            }
            if (this.LongFormFees.ValueChanged)
            {
                upd.AddValue("LongFormFees", this.LongFormFees);
            }
            if (this.MinLongFormFee.ValueChanged)
            {
                upd.AddValue("MinLongFormFee", this.MinLongFormFee);
            }
            if (this.Fee_Max.ValueChanged)
            {
                upd.AddValue("Fee_Max", this.Fee_Max);
            }
            if (this.Fee_Consularization.ValueChanged)
            {
                upd.AddValue("Fee_Consularization", this.Fee_Consularization);
            }
            if (this.FavAtSourceFee.ValueChanged)
            {
                upd.AddValue("FavAtSourceFee", this.FavAtSourceFee);
            }
            if (this.MinAtSourceFee.ValueChanged)
            {
                upd.AddValue("MinAtSourceFee", this.MinAtSourceFee);
            }
            if (this.ExemptAtSourceFee.ValueChanged)
            {
                upd.AddValue("ExemptAtSourceFee", this.ExemptAtSourceFee);
            }
            if (this.ShortFormFees.ValueChanged)
            {
                upd.AddValue("ShortFormFees", this.ShortFormFees);
            }
            if (this.Fee_AtSource.ValueChanged)
            {
                upd.AddValue("Fee_AtSource", this.Fee_AtSource);
            }
            if (this.MinQuickRefundFee.ValueChanged)
            {
                upd.AddValue("MinQuickRefundFee", this.MinQuickRefundFee);
            }
            if (this.FavTransparentEntityFee.ValueChanged)
            {
                upd.AddValue("FavTransparentEntityFee", this.FavTransparentEntityFee);
            }
            if (this.MinShortFormFee.ValueChanged)
            {
                upd.AddValue("MinShortFormFee", this.MinShortFormFee);
            }
            if (this.Fee_QuickRefund.ValueChanged)
            {
                upd.AddValue("Fee_QuickRefund", this.Fee_QuickRefund);
            }
            if (this.LastModifiedBy.ValueChanged)
            {
                upd.AddValue("LastModifiedBy", this.LastModifiedBy);                                  /*Optional 17*/
            }
            if (this.ModifiedDateTime.ValueChanged)
            {
                upd.AddValue("ModifiedDateTime", this.ModifiedDateTime);                                    /*Optional 18*/
            }
            if (this.AdditionalDSCFee.ValueChanged)
            {
                upd.AddValue("AdditionalDSCFee", this.AdditionalDSCFee);                                    /*Optional 19*/
            }
            if (this.Source_FeeID.ValueChanged)
            {
                upd.AddValue("Source_FeeID", this.Source_FeeID);                                /*Optional 20*/
            }
            if (this.AdditionalDSCFee1.ValueChanged)
            {
                upd.AddValue("AdditionalDSCFee1", this.AdditionalDSCFee1);                                     /*Optional 21*/
            }
            if (this.AtSourceModifiedBy.ValueChanged)
            {
                upd.AddValue("AtSourceModifiedBy", this.AtSourceModifiedBy);                                      /*Optional 22*/
            }
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("Dividend_FeeID", HssUtility.General.RelationalOperator.Equals, this.pk_ID);
            upd.SetCondition(rela);

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

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