public static async Task <int> UpdateFundAsync(this MasterSideLetterDataAccess dataAccess, Fund fund) { await dataAccess.ValidateFundReferences(fund); return(await dataAccess.ExecuteAsync("update Fund set ModifiedDate = getdate(), Name = @Name, SponsorId = @SponsorId, BusinessUnitId = @BusinessUnitId, StrategyId = @StrategyId, Year = @Year, Size = @Size where Id = @Id", fund)); }
public static async Task UpdateFundInvestorSideLetterAsync(this MasterSideLetterDataAccess dataAccess, int id, string fileName, Stream readStream) { var dynamicParameters = new DynamicParameters(); dynamicParameters.Add("id", id, DbType.Int32); dynamicParameters.Add("fileName", fileName, DbType.String); dynamicParameters.Add("fileContent", readStream, DbType.Binary); await dataAccess.ExecuteAsync("update FundInvestor set SideLetterFileName = @fileName, SideLetterFileContent = @fileContent where Id = @id", dynamicParameters); }
public static async Task UpdateProvisionAsync(this MasterSideLetterDataAccess dataAccess, Provision provision) { if (string.IsNullOrWhiteSpace(provision.ProvisionType)) { provision.ProvisionType = null; } await dataAccess.ExecuteAsync(@"update Provision set FundInvestorId = @FundInvestorId, ProvisionType = @ProvisionType, IsProvisionTypeInherited = @IsProvisionTypeInherited, Content = @Content, Notes = @Notes, ModifiedDate = getdate() where Id = @Id", provision); }
public static async Task UpdateFundIsFavoriteAsync(this MasterSideLetterDataAccess dataAccess, int id, string userName, bool isFavorite) { await dataAccess.ExecuteAsync(@"update UserFund set IsFavorite = @isFavorite where FundId = @id and UserName = @userName if @@RowCount = 0 begin insert UserFund(FundId,UserName,IsFavorite) values(@id, @userName, @isFavorite) end", new { userName, id, isFavorite }); }
public static async Task UpdateInvestorLastAccessedDate(this MasterSideLetterDataAccess dataAccess, int id, string userName) { await dataAccess.ExecuteAsync(@"update UserInvestor set LastAccessedDate = getdate() where InvestorId = @id and UserName = @userName if @@RowCount = 0 begin insert UserInvestor(InvestorId,UserName,LastAccessedDate) values(@id, @userName, getdate()) end", new { userName, id }); }
public static async Task <int> UpdateSearchSettingsAsync(this MasterSideLetterDataAccess dataAccess, SearchSettings settings) { return(await dataAccess.ExecuteAsync( @"update SearchSettings set Algorithm1Weight = @Algorithm1Weight, Algorithm2Weight = @Algorithm2Weight, Algorithm3Weight = @Algorithm3Weight, Algorithm1Threshold = @Algorithm1Threshold, Algorithm2Threshold = @Algorithm2Threshold, Algorithm3Threshold = @Algorithm3Threshold, WeightedThreshold = @WeightedThreshold, InheritThreshold = @InheritThreshold, MslGroupingThreshold = @MslGroupingThreshold", settings)); }
public static async Task <int> UpdateFundInvestorAsync(this MasterSideLetterDataAccess dataAccess, FundInvestor fundInvestor) { await dataAccess.ValidateFundInvestorAsync(fundInvestor); return(await dataAccess.ExecuteAsync( @" update FundInvestor set FundId = @FundId, FundSponsorName = @FundSponsorName, FundBusinessUnitName = @FundBusinessUnitName, FundStrategyName = @FundStrategyName, InvestorId = @InvestorId, InvestorType = @InvestorType, Entity = @Entity, Commitment = @Commitment, Counsel = @Counsel, Notes = @Notes, FundYear = @FundYear, FundSize = @FundSize, ModifiedDate = getdate() where Id = @id", fundInvestor)); }
public static async Task <int> RemoveFundInvestorSideLetterAsync(this MasterSideLetterDataAccess dataAccess, int id) { return(await dataAccess.ExecuteAsync( @"update FundInvestor set SideLetterFileName = null, SideLetterFileContent = null where Id = @id; delete Provision where FundInvestorId = @id;", new { id })); }
public static async Task <int> BatchDeleteFundInvestorAsync(this MasterSideLetterDataAccess dataAccess, int[] ids) { return(await dataAccess.ExecuteAsync("delete FundInvestor where Id in @ids", new { ids })); }
public static async Task <int> DeleteFundInvestorAsync(this MasterSideLetterDataAccess dataAccess, int id) { await dataAccess.RemoveFundInvestorSideLetterAsync(id); return(await dataAccess.ExecuteAsync("delete FundInvestor where Id = @id", new { id })); }
public static async Task <int> DeleteFundAsync(this MasterSideLetterDataAccess dataAccess, int id) { return(await dataAccess.ExecuteAsync("delete Fund where Id = @id", new { id })); }
public static Task <int> UpdateBusinessUnitAsync(this MasterSideLetterDataAccess dataAccess, BusinessUnit businessUnit) { return(dataAccess.ExecuteAsync("update BusinessUnit set Name=@Name,ModifiedDate = getdate() where Id = @Id", businessUnit)); }
public static Task <int> DeleteBusinessUnitAsync(this MasterSideLetterDataAccess dataAccess, int id) { return(dataAccess.ExecuteAsync("delete BusinessUnit where Id = @id", new { id })); }
public static async Task DeleteProvisionAsync(this MasterSideLetterDataAccess dataAccess, int id) { await dataAccess.ExecuteAsync(@"delete Provision where Id = @id", new { id }); }
public static async Task DeleteProvisionsByFundInvestorAsync(this MasterSideLetterDataAccess dataAccess, int fundInvestorId) { await dataAccess.ExecuteAsync(@"delete Provision where FundInvestorId = @fundInvestorId", new { fundInvestorId }); }
public static async Task RemoveMfnFromFundAsync(this MasterSideLetterDataAccess dataAccess, int id) { await dataAccess.ExecuteAsync("update Fund set MfnFileName = null, MfnFileContent = null where Id = @id", new { id }); }
public static Task DeleteSponsorAsync(this MasterSideLetterDataAccess dataAccess, int id) { return(dataAccess.ExecuteAsync("delete Sponsor where Id = @id", new { id })); }
public static Task UpdateSponsorAsync(this MasterSideLetterDataAccess dataAccess, Sponsor sponsor) { return(dataAccess.ExecuteAsync("update Sponsor set Name=@Name, ModifiedDate = getdate() where Id = @Id", sponsor)); }
public static async Task <int> UpdateInvestorAsync(this MasterSideLetterDataAccess dataAccess, Investor investor) { return(await dataAccess.ExecuteAsync("update Investor set Name = @Name, InvestorType = @InvestorType where Id = @Id", investor)); }
public static Task <int> UpdateStrategyAsync(this MasterSideLetterDataAccess dataAccess, Strategy strategy) { return(dataAccess.ExecuteAsync("update Strategy set Name=@Name, ModifiedDate = getdate() where Id = @id", strategy)); }