本文整理汇总了C#中IDalSession类的典型用法代码示例。如果您正苦于以下问题:C# IDalSession类的具体用法?C# IDalSession怎么用?C# IDalSession使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDalSession类属于命名空间,在下文中一共展示了IDalSession类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AdjustFixedAccountLine
public static void AdjustFixedAccountLine(IDalSession session, IJournalEntry journalEntry)
{
try
{
if (journalEntry.Status == JournalEntryStati.New && journalEntry.Journal.FixedGLAccount != null)
{
IJournalEntryLine fixedAccountLine = journalEntry.Lines.FixedAccountLine;
Money balance = journalEntry.Balance;
if (balance.IsNotZero)
{
if (fixedAccountLine == null)
{
fixedAccountLine = new JournalEntryLine();
fixedAccountLine.GLAccount = journalEntry.Journal.FixedGLAccount;
journalEntry.Lines.AddJournalEntryLine(fixedAccountLine);
fixedAccountLine.LineNumber = 0;
}
fixedAccountLine.Balance = balance.Negate();
JournalEntryMapper.Update(session, journalEntry);
}
else if (fixedAccountLine != null)
deleteLine(session, fixedAccountLine);
}
}
catch (Exception ex)
{
throw new ApplicationException("Could not adjust Fixed-Account Line.", ex);
}
}
开发者ID:kiquenet,项目名称:B4F,代码行数:33,代码来源:JournalEntryLinesAdapter.cs
示例2: DiscoverSpParameterSet
/// <summary>
/// Resolve at run time the appropriate set of Parameters for a stored procedure
/// </summary>
/// <param name="session">An IDalSession object</param>
/// <param name="spName">the name of the stored procedure</param>
/// <param name="includeReturnValueParameter">whether or not to include their return value parameter</param>
/// <returns></returns>
private IDataParameter[] DiscoverSpParameterSet(IDalSession session, string spName, bool includeReturnValueParameter)
{
return InternalDiscoverSpParameterSet(
session,
spName,
includeReturnValueParameter);
}
开发者ID:hejiquan,项目名称:iBATIS_2010,代码行数:14,代码来源:DBHelperParameterCache.cs
示例3: GetFeeRules
/// <summary>
/// Retrieves a list of all <b>FeeRule</b> objects in the system.
/// </summary>
/// <param name="session">An instance of the Data Access Library (see class <see cref="B4F.TotalGiro.DAL.NHSession">NHSession</see>).</param>
/// <returns>A list of all <b>CommRule</b> objects in the system.</returns>
public static IList<IFeeRule> GetFeeRules(IDalSession session,
int feeCalcId, int modelId, int accountId, int startPeriod, int endPeriod,
bool isDefault, bool hasEmployerRelation, bool executionOnly, bool sendByPost)
{
Hashtable parameters = new Hashtable();
IManagementCompany company = LoginMapper.GetCurrentManagmentCompany(session);
if (!company.IsStichting)
parameters.Add("companyId", company.Key);
if (feeCalcId != 0 && (int)feeCalcId != int.MinValue)
parameters.Add("feeCalcId", feeCalcId);
if (accountId != 0 && accountId != int.MinValue)
parameters.Add("accountId", accountId);
if (modelId != 0 && modelId != int.MinValue)
parameters.Add("modelId", modelId);
if (startPeriod != 0)
parameters.Add("startPeriod", startPeriod);
if (endPeriod != 0)
parameters.Add("endPeriod", endPeriod);
if (isDefault)
parameters.Add("isDefault", isDefault);
if (hasEmployerRelation)
parameters.Add("hasEmployerRelation", hasEmployerRelation);
if (executionOnly)
parameters.Add("executionOnly", executionOnly);
if (sendByPost)
parameters.Add("sendByPost", sendByPost);
return session.GetTypedListByNamedQuery<IFeeRule>(
"B4F.TotalGiro.Fees.FeeRules.GetFeeRules",
parameters);
}
开发者ID:kiquenet,项目名称:B4F,代码行数:37,代码来源:FeeRuleMapper.cs
示例4: GetPositions
public static List<IFundPosition> GetPositions(IDalSession session, int accountId, PositionsView view)
{
List<ICriterion> expressions = new List<ICriterion>();
expressions.Add(Expression.Eq("Account.Key", accountId));
addPositionsViewCriterion(expressions, view);
return session.GetTypedList<FundPosition, IFundPosition>(expressions);
}
开发者ID:kiquenet,项目名称:B4F,代码行数:7,代码来源:FundPositionMapper.cs
示例5: GetAccountsIdsWithUnprintedNotas
//public static IList GetUnprintedNotas(IDalSession session)
//{
// List<ICriterion> expressions = new List<ICriterion>();
// expressions.Add(Expression.Eq("PrintCount", 0));
// return session.GetList(typeof(Nota), expressions);
//}
// public static List<IManagementCompany> GetMgmtCompaniesWithUnprintedNotas(IDalSession session,
// NotaReturnClass returnClass, int[] managementCompanyIds)
// {
// string hql = string.Format(@"FROM ManagementCompany M WHERE M IN
// (SELECT A.AccountOwner FROM CustomerAccount A WHERE A IN
// (SELECT N.UnderlyingTx.AccountA FROM {0} N WHERE N.PrintCount = 0))",
// getType(returnClass).Name);
// if (managementCompanyIds != null && managementCompanyIds.Length > 0)
// {
// string idList = "";
// for (int i = 0; i < managementCompanyIds.Length; i++)
// idList += (i > 0 ? ", " : "") + managementCompanyIds[i].ToString();
// hql += string.Format(" AND M IN ({0})", idList);
// }
// return NHSession.ToList<IManagementCompany>(session.GetListByHQL(hql, new Hashtable()));
// }
public static int[] GetAccountsIdsWithUnprintedNotas(IDalSession session, int managementCompanyId, NotaReturnClass returnClass)
{
Hashtable parameters = new Hashtable();
parameters.Add("ManagementCompanyId", managementCompanyId);
string underlyingAccObj = "";
switch (returnClass)
{
case NotaReturnClass.NotaTransaction:
case NotaReturnClass.NotaTransfer:
case NotaReturnClass.NotaInstrumentConversion:
underlyingAccObj = "UnderlyingTx.AccountA";
break;
default:
underlyingAccObj = "UnderlyingBooking.Account";
break;
}
ArrayList accountIds = (ArrayList)session.GetListByHQL(
string.Format(@"SELECT A.Key FROM CustomerAccount A
WHERE A.Key IN (SELECT N.{0}.Key FROM {1} N WHERE N.PrintCount = 0)
AND A.AccountOwner.Key = :ManagementCompanyId
ORDER BY A.Number",
underlyingAccObj,
getType(returnClass).Name),
parameters);
return (int[])accountIds.ToArray(typeof(int));
}
开发者ID:kiquenet,项目名称:B4F,代码行数:49,代码来源:NotaMapper.cs
示例6: GetPositions
public static List<ICashPosition> GetPositions(IDalSession session, IAccountTypeInternal account, PositionsView view)
{
List<ICriterion> expressions = new List<ICriterion>();
expressions.Add(Expression.Eq("Account.Key", account.Key));
addPositionsViewCriterion(expressions, view);
return session.GetTypedList<CashPosition, ICashPosition>(expressions);
}
开发者ID:kiquenet,项目名称:B4F,代码行数:7,代码来源:CashPositionMapper.cs
示例7: GetExtCustodianPositions
/// <summary>
/// Gets the Positions for the ExtCustodian for the specified date
/// </summary>
/// <param name="session">Data session object</param>
/// <param name="custodian">The specified ExtCustodians</param>
/// <param name="balanceDate">The specified date</param>
/// <returns>A list ExtCustodian Positions</returns>
public static IList GetExtCustodianPositions(IDalSession session, ExtCustodian custodian, DateTime balanceDate)
{
List<NHibernate.Criterion.ICriterion> expressions = new List<NHibernate.Criterion.ICriterion>();
expressions.Add(NHibernate.Criterion.Expression.Eq("Custodian.Key", custodian.Key));
expressions.Add(NHibernate.Criterion.Expression.Eq("BalanceDate", balanceDate));
return session.GetList(typeof(ExtPosition), expressions);
}
开发者ID:kiquenet,项目名称:B4F,代码行数:14,代码来源:ExtCustodianMapper.cs
示例8: GetGLLookupRecords
public static IGLLookupRecords GetGLLookupRecords(IDalSession session, BookingComponentParentTypes bookingComponentParentType)
{
List<ICriterion> expressions = new List<ICriterion>();
expressions.Add(Expression.Eq("BookingComponentParentType", bookingComponentParentType));
IList<IGLLookupRecord> gLLookupRecords = session.GetTypedList<IGLLookupRecord>();
return new GLLookupRecords(gLLookupRecords);
}
开发者ID:kiquenet,项目名称:B4F,代码行数:7,代码来源:GlLookupRecordMapper.cs
示例9: CheckHistoricalExRate
/// <summary>
/// Check whether the rate is within the range
/// </summary>
/// <param name="session"></param>
/// <param name="checkRate"></param>
/// <returns></returns>
public static bool CheckHistoricalExRate(IDalSession session, IHistoricalExRate checkRate, out string errMessage)
{
bool success = true;
errMessage = "";
if (checkRate != null)
{
IList<IHistoricalExRate> previousRates = GetHistoricalExRates(session,
checkRate.Currency, checkRate.RateDate.AddDays(-5),
checkRate.RateDate.AddDays(-1));
if (previousRates != null && previousRates.Count > 0)
{
decimal prevRate = previousRates.OrderByDescending(x => x.RateDate).FirstOrDefault().Rate;
if (prevRate != 0M)
{
decimal diff = Math.Abs((prevRate - checkRate.Rate) / prevRate);
if (diff > 0.05M)
{
errMessage = string.Format("The new Exchange Rate is {0}% different from the previous Exchange Rate.", (diff * 100).ToString("0.0"));
success = false;
}
}
}
}
return success;
}
开发者ID:kiquenet,项目名称:B4F,代码行数:31,代码来源:HistoricalExRateMapper.cs
示例10: GetAverageHoldings
public static IList GetAverageHoldings(IDalSession session, IAccountTypeInternal account, DateTime startDate, DateTime endDate, ValuationTypesFilterOptions filterOption)
{
Hashtable parameters = new Hashtable(1);
parameters.Add("account", account);
parameters.Add("startDate", startDate);
parameters.Add("endDate", endDate);
string instrumentFilter = "";
switch (filterOption)
{
case ValuationTypesFilterOptions.Security:
instrumentFilter = "and I.Key in (select S.Key from TradeableInstrument S) ";
break;
case ValuationTypesFilterOptions.Monetary:
instrumentFilter = "and I.Key in (select C.Key from Currency C) ";
break;
}
string hql = string.Format(@"from AverageHolding A
left join fetch A.Instrument I
where A.Account = :account
and (A.BeginDate between :startDate
and :endDate ) {0}
order by I.Key, A.BeginDate", instrumentFilter);
return session.GetListByHQL(hql, parameters);
}
开发者ID:kiquenet,项目名称:B4F,代码行数:26,代码来源:AverageHoldingMapper.cs
示例11: GetCounterAccounts
/// <summary>
/// This method retrieves a list of counter account instances that meet the passed in arguments.
/// When an argument is ommitted it is not used to filter the counter accounts
/// </summary>
/// <param name="session">An instance of the Data Access Library <see cref="T:B4F.TotalGiro.DAL.NHSession">NHSession</see> class</param>
/// <param name="assetManager">The asset manager the customer belongs to</param>
/// <param name="counterAccountNumber">Number of the counter account</param>
/// <param name="counterAccountName">Name of the counter account</param>
/// <param name="contactName">The name of the contact</param>
/// <param name="accountNumber">The account's number of the account</param>
/// <param name="showActive">Show for active contacts</param>
/// <param name="showInactive">Show for inactive contacts</param>
/// <param name="isPublic">Show public contacts</param>
/// <returns>A list of counter account instances</returns>
public static IList<ICounterAccount> GetCounterAccounts(IDalSession session, IAssetManager assetManager,
string counterAccountNumber, string counterAccountName,
string contactName, string accountNumber, bool showActive,
bool showInactive, bool isPublic)
{
Hashtable parameters = new Hashtable();
if (assetManager != null)
parameters.Add("managementCompanyId", assetManager.Key);
if (counterAccountNumber != null && counterAccountNumber.Length > 0)
parameters.Add("counterAccountNumber", Util.PrepareNamedParameterWithWildcard(counterAccountNumber, MatchModes.Anywhere));
if (counterAccountName != null && counterAccountName.Length > 0)
parameters.Add("counterAccountName", Util.PrepareNamedParameterWithWildcard(counterAccountName, MatchModes.Anywhere));
if (contactName != null && contactName.Length > 0)
parameters.Add("contactName", Util.PrepareNamedParameterWithWildcard(contactName, MatchModes.Anywhere));
parameters.Add("isPublic", isPublic);
if (showActive && !showInactive)
parameters.Add("isActive", true);
if (!showActive && showInactive)
parameters.Add("isActive", false);
if (accountNumber != null && accountNumber.Length > 0)
parameters.Add("accountNumber", Util.PrepareNamedParameterWithWildcard(accountNumber, MatchModes.Anywhere));
return session.GetTypedListByNamedQuery<ICounterAccount>(
"B4F.TotalGiro.Accounts.CounterAccount.GetCounterAccounts",
parameters);
}
开发者ID:kiquenet,项目名称:B4F,代码行数:42,代码来源:CounterAccountMapper.cs
示例12: CheckHistoricalPrice
/// <summary>
/// Check whether the price is within the range
/// </summary>
/// <param name="session"></param>
/// <param name="checkPrice"></param>
/// <returns></returns>
public static bool CheckHistoricalPrice(IDalSession session, IHistoricalPrice checkPrice, out string errMessage)
{
bool success = true;
errMessage = "";
if (checkPrice != null)
{
IList<IHistoricalPrice> previousPrices = GetHistoricalPrices(session,
checkPrice.Instrument.Key, checkPrice.Date.AddDays(-5),
checkPrice.Date.AddDays(-1));
if (previousPrices != null && previousPrices.Count > 0)
{
Price prevPrice = previousPrices.OrderByDescending(x => x.Date).FirstOrDefault().Price;
if (prevPrice == null) prevPrice = checkPrice.Instrument.Get(e => e.CurrentPrice).Get(e => e.Price);
if (prevPrice != null)
{
decimal diff = Math.Abs((prevPrice.Quantity - checkPrice.Price.Quantity) / prevPrice.Quantity);
if (diff > 0.05M)
{
errMessage = string.Format("The new Price is {0}% different from the previous price.", (diff * 100).ToString("0.0"));
success = false;
}
}
}
}
return success;
}
开发者ID:kiquenet,项目名称:B4F,代码行数:33,代码来源:HistoricalPriceMapper.cs
示例13: GetClientBalanceGLAccounts
public static IList<IGLAccount> GetClientBalanceGLAccounts(IDalSession session)
{
List<ICriterion> expressions = new List<ICriterion>();
expressions.Add(Expression.Eq("IsClientOpenBalance", true));
IList<IGLAccount> list = session.GetTypedList<GLAccount, IGLAccount>(expressions);
return list;
}
开发者ID:kiquenet,项目名称:B4F,代码行数:7,代码来源:GLAccountMapper.cs
示例14: GetImportedBankBalance
public static IImportedBankBalance GetImportedBankBalance(IDalSession session, IJournal bankJournal, DateTime bookBalanceDate)
{
Hashtable parameters = new Hashtable();
parameters.Add("BankJournalKey", bankJournal.Key);
parameters.Add("BookBalanceDate", bookBalanceDate);
string hql = @"from ImportedBankBalance I
where I.BankJournal.Key = :BankJournalKey
and I.BookBalanceDate = :BookBalanceDate";
IList result = session.GetListByHQL(hql, parameters);
if (result != null && result.Count == 1)
return (ImportedBankBalance)result[0];
else
return null;
//List<ICriterion> expressions = new List<ICriterion>();
//expressions.Add(Expression.Eq("BankJournal.Key", bankJournal.Key));
//expressions.Add(Expression.Eq("BookBalanceDate", bookBalanceDate));
//IList result = session.GetList(typeof(ImportedBankBalance), expressions);
//if (result != null && result.Count == 1)
// return (IImportedBankBalance)result[0];
//else
// return null;
}
开发者ID:kiquenet,项目名称:B4F,代码行数:25,代码来源:ImportedBankBalanceMapper.cs
示例15: GetAccountFamilies
public static IList<IAccountFamily> GetAccountFamilies(IDalSession session, IAssetManager assetManager)
{
List<ICriterion> expressions = new List<ICriterion>();
if (!assetManager.IsStichting)
expressions.Add(Expression.Eq("AssetManager.Key", assetManager.Key));
return session.GetTypedList<AccountFamily,IAccountFamily>(expressions);
}
开发者ID:kiquenet,项目名称:B4F,代码行数:7,代码来源:AccountFamilyMapper.cs
示例16: InternalDiscoverSpParameterSet
/// <summary>
/// Discover at run time the appropriate set of Parameters for a stored procedure
/// </summary>
/// <param name="session">An IDalSession object</param>
/// <param name="spName">Name of the stored procedure.</param>
/// <param name="includeReturnValueParameter">if set to <c>true</c> [include return value parameter].</param>
/// <returns>The stored procedure parameters.</returns>
private IDataParameter[] InternalDiscoverSpParameterSet(IDalSession session, string spName,
bool includeReturnValueParameter)
{
using (IDbCommand cmd = session.CreateCommand(CommandType.StoredProcedure))
{
cmd.CommandText = spName;
// The session connection object is always created but the connection is not alwys open
// so we try to open it in case.
session.OpenConnection();
DeriveParameters(session.DataSource.DbProvider, cmd);
if (cmd.Parameters.Count > 0) {
IDataParameter firstParameter = (IDataParameter)cmd.Parameters[0];
if (firstParameter.Direction == ParameterDirection.ReturnValue) {
if (!includeReturnValueParameter) {
cmd.Parameters.RemoveAt(0);
}
}
}
IDataParameter[] discoveredParameters = new IDataParameter[cmd.Parameters.Count];
cmd.Parameters.CopyTo(discoveredParameters, 0);
return discoveredParameters;
}
}
开发者ID:techvenky,项目名称:mybatisnet,代码行数:35,代码来源:DBHelperParameterCache.cs
示例17: BeforeDataSetBuild
protected override void BeforeDataSetBuild(IDalSession session, INota[] notaGroup)
{
foreach (INotaDeposit nota in notaGroup)
if (nota.IsWithdrawalPeriodic && (nota.TegenrekeningNumber == null || nota.TegenrekeningNumber == string.Empty))
throw new ApplicationException(
"Periodic Withdrawal Nota cannot be printed because Tegenrekening Number is missing on the Cash Transfer.");
}
开发者ID:kiquenet,项目名称:B4F,代码行数:7,代码来源:NotaDepositPrintCommand.cs
示例18: CreateManagementFeeBookingsforDate
private static bool CreateManagementFeeBookingsforDate(IDalSession session, IList listofFees,
IMemorialBooking feeBookings, IGLAccount clientTaxAccount, IGLAccount clientFeeAccount,
IGLAccount clientFixedCostsAccount, IGLAccount taxAccount)
{
//foreach (IManagementFee imf in listofFees)
//{
// foreach (MgtFeeBreakupLine line in imf.FeeDetails.BreakupLines)
// {
// if (line.Amount.IsNotZero)
// {
// IAccountTypeInternal account = line.Transaction.AccountA;
// IJournalEntryLine newLineClient = new JournalEntryLine();
// IJournalEntryLine newLineCP = new JournalEntryLine();
// IJournalEntryLine newLineClientTax = new JournalEntryLine();
// IJournalEntryLine newLineCPTax = new JournalEntryLine();
// switch (line.MgtFeeType.Key)
// {
// case FeeTypes.AdministrationCosts:
// case FeeTypes.FixedFee:
// newLineClient.GLAccount = clientFixedCostsAccount;
// newLineCP.GLAccount = account.AccountOwner.ManagementFeeFixedCostsAccount;
// break;
// default:
// newLineClient.GLAccount = clientFeeAccount;
// newLineCP.GLAccount = account.AccountOwner.ManagementFeeIncomeAccount;
// break;
// }
// newLineClientTax.GLAccount = clientTaxAccount;
// newLineCPTax.GLAccount = taxAccount;
// newLineClient.Balance = line.Amount;
// newLineCP.Balance = line.Amount.Negate();
// if ((line.Tax != null) && (line.Tax.IsNotZero))
// {
// newLineClientTax.Balance = line.Tax;
// newLineCPTax.Balance = line.Tax.Negate();
// }
// newLineClient.GiroAccount = account;
// newLineClientTax.GiroAccount = account;
// newLineClient.TotalGiroTrade = line.Transaction;
// newLineCP.TotalGiroTrade = line.Transaction;
// newLineClientTax.TotalGiroTrade = line.Transaction;
// newLineCPTax.TotalGiroTrade = line.Transaction;
// feeBookings.Lines.Add(newLineClient);
// feeBookings.Lines.Add(newLineCP);
// feeBookings.Lines.Add(newLineClientTax);
// feeBookings.Lines.Add(newLineCPTax);
// }
// }
//}
return true;
}
开发者ID:kiquenet,项目名称:B4F,代码行数:59,代码来源:MemorialBookingsAdapter.cs
示例19: GetModelComponentsLatestVersion
public static IList<IModelComponent> GetModelComponentsLatestVersion(IDalSession session, int modelID)
{
Hashtable parameters = new Hashtable();
parameters.Add("modelID", modelID);
return session.GetTypedListByNamedQuery<IModelComponent>(
"B4F.TotalGiro.Instruments.ModelComponent.GetModelComponentsLatestVersion",
parameters);
}
开发者ID:kiquenet,项目名称:B4F,代码行数:8,代码来源:ModelMapper.cs
示例20: GetAccountCategories
public static IList GetAccountCategories(IDalSession session, IAssetManager am)
{
List<ICriterion> expressions = new List<ICriterion>();
expressions.Add(Expression.Eq("AssetManager.Key", am.Key));
List<Order> orderings = new List<Order>();
orderings.Add(Order.Asc("CustomerType"));
return session.GetList(typeof(AccountCategory), expressions, orderings, null, null);
}
开发者ID:kiquenet,项目名称:B4F,代码行数:8,代码来源:AccountCategoryMapper.cs
注:本文中的IDalSession类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论