本文整理汇总了C#中SessionScopeWrapper.QueryOver方法的典型用法代码示例。如果您正苦于以下问题:C# SessionScopeWrapper.QueryOver方法的具体用法?C# SessionScopeWrapper.QueryOver怎么用?C# SessionScopeWrapper.QueryOver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionScopeWrapper
的用法示例。
在下文中一共展示了SessionScopeWrapper.QueryOver方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPickListView
private IPickListView GetPickListView()
{
IPickListView plv = BindingSource.Current as IPickListView;
using (ISession session = new SessionScopeWrapper(true))
{
return session.QueryOver<IPickListView>()
.Where(x => x.Id == plv.Id)
.SingleOrDefault();
}
}
示例2: ExportPickListData
private void ExportPickListData(IList<string> selections, string format)
{
if (selections == null)
{
using (ISession session = new SessionScopeWrapper())
{
selections = session.QueryOver<PickList>()
.Where(x => x.PickListId == "PICKLISTLIST")
.OrderBy(x => x.Text).Asc
.Select(x => x.ItemId)
.Cacheable()
.List<string>();
}
}
DataTable dt = new DataTable("PickLists");
DataColumn dc = dt.Columns.Add();
dc.ColumnName = "PickListName";
dc.DataType = typeof(string);
dc.AllowDBNull = true;
dc = dt.Columns.Add();
dc.ColumnName = "Text";
dc.DataType = typeof(string);
dc.AllowDBNull = true;
dc = dt.Columns.Add();
dc.ColumnName = "Code";
dc.DataType = typeof(string);
dc.AllowDBNull = true;
dc = dt.Columns.Add();
dc.ColumnName = "Order";
dc.DataType = typeof(int);
dc.AllowDBNull = true;
dc = dt.Columns.Add();
dc.ColumnName = "IsDefault";
dc.DataType = typeof(bool);
dc.AllowDBNull = true;
dc = dt.Columns.Add();
dc.ColumnName = "PickListId";
dc.DataType = typeof(string);
dc.AllowDBNull = true;
dc = dt.Columns.Add();
dc.ColumnName = "ItemId";
dc.DataType = typeof(string);
dc.AllowDBNull = true;
IDictionary<string, Layout> layout = new Dictionary<string, Layout>();
Layout item = new Layout();
item = new Layout();
item.ColumnName = "PickListName";
item.ColumnCaption = "PickListName";
item.Visible = true;
item.FormatType = string.Empty;
item.FormatString = string.Empty;
item.Width = 64;
layout.Add(item.ColumnName, item);
item = new Layout();
item.ColumnName = "Text";
item.ColumnCaption = "Text";
item.Visible = true;
item.FormatType = string.Empty;
item.FormatString = string.Empty;
item.Width = 64;
layout.Add(item.ColumnName, item);
item = new Layout();
item.ColumnName = "Code";
item.ColumnCaption = "Code";
item.Visible = true;
item.FormatType = string.Empty;
item.FormatString = string.Empty;
item.Width = 64;
layout.Add(item.ColumnName, item);
item = new Layout();
item.ColumnName = "Order";
item.ColumnCaption = "Order";
item.Visible = true;
item.FormatType = string.Empty;
item.FormatString = string.Empty;
item.Width = 64;
layout.Add(item.ColumnName, item);
item = new Layout();
item.ColumnName = "IsDefault";
item.ColumnCaption = "IsDefault";
item.Visible = true;
item.FormatType = string.Empty;
item.FormatString = string.Empty;
item.Width = 64;
layout.Add(item.ColumnName, item);
item = new Layout();
//.........这里部分代码省略.........
示例3: GetItems
private IList<IPickListItemView> GetItems(IPickListView pickList)
{
using (ISession session = new SessionScopeWrapper(true))
{
if (string.IsNullOrEmpty(_sortExpression))
{
_sortExpression = "OrderSeq";
}
var query = session.QueryOver<IPickListItemView>()
.Where(x => x.UserId == "ADMIN" && x.PickListId == (string) pickList.Id);
query.UnderlyingCriteria.AddOrder(new Order(_sortExpression, _sortDirection));
return query.List();
}
}