public static List <Schedule_Of_Fees_DSC> GetList_from_CD(string country, string depositary) { List <Schedule_Of_Fees_DSC> list = new List <Schedule_Of_Fees_DSC>(); if (string.IsNullOrEmpty(country) || string.IsNullOrEmpty(depositary)) { return(list); } DB_select selt = new DB_select(Schedule_Of_Fees_DSC.Get_cmdTP()); SQL_relation rela1 = new SQL_relation("Country", RelationalOperator.Equals, country); SQL_relation rela2 = new SQL_relation("Depositary", RelationalOperator.Equals, depositary); SQL_condition cond = new SQL_condition(new SQL_condition(rela1), ConditionalOperator.And, new SQL_condition(rela2)); selt.SetCondition(cond); DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB()); while (reader.Read()) { Schedule_Of_Fees_DSC sof = new Schedule_Of_Fees_DSC(); sof.Init_from_reader(reader); list.Add(sof); } reader.Close(); list.Sort((a, b) => DateTime.Compare(b.EffectiveDate.Value, a.EffectiveDate.Value)); return(list); }
public static Schedule_Of_Fees_DSC GetDSC_from_CDS(string country, string depositary, DateTime curr_dt, int secTypeID) { List <Schedule_Of_Fees_DSC> list = DSC_master.GetList_from_CD(country, depositary); Schedule_Of_Fees_DSC temp_sf = null; foreach (Schedule_Of_Fees_DSC sf in list) { if (sf.SecurityTypeID.Value != secTypeID) { continue; } temp_sf = sf; if (curr_dt >= sf.EffectiveDate.Value) { return(sf); } } return(temp_sf); }
public Schedule_Of_Fees_DSC GetCopy() { Schedule_Of_Fees_DSC newEntity = new Schedule_Of_Fees_DSC(); if (!this.Country.IsNull_flag) { newEntity.Country.Value = this.Country.Value; } 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.ShortFormFees.IsNull_flag) { newEntity.ShortFormFees.Value = this.ShortFormFees.Value; } if (!this.LongFormFees.IsNull_flag) { newEntity.LongFormFees.Value = this.LongFormFees.Value; } if (!this.FavAtSourceFee.IsNull_flag) { newEntity.FavAtSourceFee.Value = this.FavAtSourceFee.Value; } if (!this.ExemptAtSourceFee.IsNull_flag) { newEntity.ExemptAtSourceFee.Value = this.ExemptAtSourceFee.Value; } if (!this.FavTransparentEntityFee.IsNull_flag) { newEntity.FavTransparentEntityFee.Value = this.FavTransparentEntityFee.Value; } if (!this.MinAtSourceFee.IsNull_flag) { newEntity.MinAtSourceFee.Value = this.MinAtSourceFee.Value; } if (!this.MinLongFormFee.IsNull_flag) { newEntity.MinLongFormFee.Value = this.MinLongFormFee.Value; } if (!this.MinQuickRefundFee.IsNull_flag) { newEntity.MinQuickRefundFee.Value = this.MinQuickRefundFee.Value; } if (!this.MinShortFormFee.IsNull_flag) { newEntity.MinShortFormFee.Value = this.MinShortFormFee.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; } if (!this.Notes.IsNull_flag) { newEntity.Notes.Value = this.Notes.Value; } if (!this.SecurityTypeID.IsNull_flag) { newEntity.SecurityTypeID.Value = this.SecurityTypeID.Value; } if (!this.IncomeEventID.IsNull_flag) { newEntity.IncomeEventID.Value = this.IncomeEventID.Value; } if (!this.Issue.IsNull_flag) { newEntity.Issue.Value = this.Issue.Value; } if (!this.CUSIP.IsNull_flag) { newEntity.CUSIP.Value = this.CUSIP.Value; } if (!this.AdditionalDSCFee.IsNull_flag) { newEntity.AdditionalDSCFee.Value = this.AdditionalDSCFee.Value; } return(newEntity); }
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_DSC.Get_cmdTP()); if (this.Country.ValueChanged) { upd.AddValue("Country", this.Country); } if (this.Security_Type.ValueChanged) { upd.AddValue("Security_Type", this.Security_Type); /*Optional 3*/ } if (this.Depositary.ValueChanged) { upd.AddValue("Depositary", this.Depositary); } if (this.ShortFormFees.ValueChanged) { upd.AddValue("ShortFormFees", this.ShortFormFees); /*Optional 5*/ } if (this.LongFormFees.ValueChanged) { upd.AddValue("LongFormFees", this.LongFormFees); /*Optional 6*/ } if (this.FavAtSourceFee.ValueChanged) { upd.AddValue("FavAtSourceFee", this.FavAtSourceFee); /*Optional 7*/ } if (this.ExemptAtSourceFee.ValueChanged) { upd.AddValue("ExemptAtSourceFee", this.ExemptAtSourceFee); /*Optional 8*/ } if (this.FavTransparentEntityFee.ValueChanged) { upd.AddValue("FavTransparentEntityFee", this.FavTransparentEntityFee); /*Optional 9*/ } if (this.MinAtSourceFee.ValueChanged) { upd.AddValue("MinAtSourceFee", this.MinAtSourceFee); /*Optional 10*/ } if (this.MinLongFormFee.ValueChanged) { upd.AddValue("MinLongFormFee", this.MinLongFormFee); /*Optional 11*/ } if (this.MinQuickRefundFee.ValueChanged) { upd.AddValue("MinQuickRefundFee", this.MinQuickRefundFee); /*Optional 12*/ } if (this.MinShortFormFee.ValueChanged) { upd.AddValue("MinShortFormFee", this.MinShortFormFee); /*Optional 13*/ } if (this.EffectiveDate.ValueChanged) { upd.AddValue("EffectiveDate", this.EffectiveDate); } if (this.CreatedDate.ValueChanged) { upd.AddValue("CreatedDate", this.CreatedDate); /*Optional 15*/ } if (this.ImportBy.ValueChanged) { upd.AddValue("ImportBy", this.ImportBy); /*Optional 16*/ } if (this.Notes.ValueChanged) { upd.AddValue("Notes", this.Notes); /*Optional 17*/ } if (this.SecurityTypeID.ValueChanged) { upd.AddValue("SecurityTypeID", this.SecurityTypeID); } if (this.IncomeEventID.ValueChanged) { upd.AddValue("IncomeEventID", this.IncomeEventID); /*Optional 19*/ } if (this.Issue.ValueChanged) { upd.AddValue("Issue", this.Issue); /*Optional 20*/ } if (this.CUSIP.ValueChanged) { upd.AddValue("CUSIP", this.CUSIP); /*Optional 21*/ } if (this.AdditionalDSCFee.ValueChanged) { upd.AddValue("AdditionalDSCFee", this.AdditionalDSCFee); /*Optional 22*/ } HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("FeesID", HssUtility.General.RelationalOperator.Equals, this.pk_ID); upd.SetCondition(rela); return(upd); }
internal HssUtility.SQLserver.DB_insert Get_DBinsert() { HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(Schedule_Of_Fees_DSC.Get_cmdTP()); dbIns.AddValue("Country", this.Country); dbIns.AddValue("Security_Type", this.Security_Type); /*Optional 3*/ dbIns.AddValue("Depositary", this.Depositary); dbIns.AddValue("ShortFormFees", this.ShortFormFees); /*Optional 5*/ dbIns.AddValue("LongFormFees", this.LongFormFees); /*Optional 6*/ dbIns.AddValue("FavAtSourceFee", this.FavAtSourceFee); /*Optional 7*/ dbIns.AddValue("ExemptAtSourceFee", this.ExemptAtSourceFee); /*Optional 8*/ dbIns.AddValue("FavTransparentEntityFee", this.FavTransparentEntityFee); /*Optional 9*/ dbIns.AddValue("MinAtSourceFee", this.MinAtSourceFee); /*Optional 10*/ dbIns.AddValue("MinLongFormFee", this.MinLongFormFee); /*Optional 11*/ dbIns.AddValue("MinQuickRefundFee", this.MinQuickRefundFee); /*Optional 12*/ dbIns.AddValue("MinShortFormFee", this.MinShortFormFee); /*Optional 13*/ dbIns.AddValue("EffectiveDate", this.EffectiveDate); dbIns.AddValue("CreatedDate", this.CreatedDate); /*Optional 15*/ dbIns.AddValue("ImportBy", this.ImportBy); /*Optional 16*/ dbIns.AddValue("Notes", this.Notes); /*Optional 17*/ dbIns.AddValue("SecurityTypeID", this.SecurityTypeID); dbIns.AddValue("IncomeEventID", this.IncomeEventID); /*Optional 19*/ dbIns.AddValue("Issue", this.Issue); /*Optional 20*/ dbIns.AddValue("CUSIP", this.CUSIP); /*Optional 21*/ dbIns.AddValue("AdditionalDSCFee", this.AdditionalDSCFee); /*Optional 22*/ return(dbIns); }
/// <summary> /// Initialize object from DB /// </summary> public bool Init_from_DB() { if (this.FeesID < 0) { return(false); } HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(Schedule_Of_Fees_DSC.Get_cmdTP()); db_sel.tableName = "Schedule_Of_Fees_DSC"; HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("FeesID", HssUtility.General.RelationalOperator.Equals, this.FeesID); 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); }