本文整理汇总了C#中IDalSession.GetListbySQLQuery方法的典型用法代码示例。如果您正苦于以下问题:C# IDalSession.GetListbySQLQuery方法的具体用法?C# IDalSession.GetListbySQLQuery怎么用?C# IDalSession.GetListbySQLQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDalSession
的用法示例。
在下文中一共展示了IDalSession.GetListbySQLQuery方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetNextLedgerEntryNumber
public static string GetNextLedgerEntryNumber(IDalSession session, string exactLedger)
{
string sqlQuery = "SELECT TOP 1 {E.*} FROM LEDGER E WHERE E.JOURNAL = '" + exactLedger + "' order by E.BookingNumber DESC";
IList ledgerEntries = session.GetListbySQLQuery(sqlQuery, "E", typeof(LedgerEntry));
if (ledgerEntries.Count > 0)
return (int.Parse(((ILedgerEntry)ledgerEntries[0]).BookingNumber) + 1).ToString().PadLeft(8, '0');
else
return (("8" + exactLedger.PadLeft(3, '0')).PadRight(7, '0')) + "1";
}
示例2: GetNextOrdinal
public static int GetNextOrdinal(IDalSession session, string fileName)
{
string sqlQuery = string.Format("SELECT TOP 1 {0} FROM ExportedLedgerFile E WHERE E.Name = '{1}' ORDER BY E.Ordinal DESC",
"{E.*}", fileName);
IList exportedLedgerFiles = session.GetListbySQLQuery(sqlQuery, "E", typeof(ExportedLedgerFile));
if (exportedLedgerFiles.Count > 0)
return ((IExportedLedgerFile)exportedLedgerFiles[0]).Ordinal + 1;
else
return 0;
}
示例3: GetMaxHistoricalExRateDate
/// <summary>
/// Get latest historical exchange rate
/// </summary>
/// <param name="DataSession">Data access object</param>
/// <returns>Date</returns>
public static DateTime GetMaxHistoricalExRateDate(IDalSession DataSession)
{
string Query = @"select top 1 {HistoricalExRates.*} from dbo.HistoricalExRates where ratedate = (Select max(RateDate) from dbo.HistoricalExRates)";
IList returnValues = DataSession.GetListbySQLQuery(Query, "HistoricalExRates", typeof(HistoricalExRate));
if (returnValues.Count > 0)
return ((HistoricalExRate)returnValues[0]).RateDate;
else
return DateTime.MinValue;
}