当前位置: 首页>>代码示例>>C#>>正文


C# SessionScopeWrapper.QueryOver方法代码示例

本文整理汇总了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();
     }
 }
开发者ID:ssommerfeldt,项目名称:TAC_EAB,代码行数:10,代码来源:PickListItems.ascx.cs

示例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();
//.........这里部分代码省略.........
开发者ID:ssommerfeldt,项目名称:TAC_EAB,代码行数:101,代码来源:CommonTasksTasklet.ascx.cs

示例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();
        }
    }
开发者ID:ssommerfeldt,项目名称:TAC_EAB,代码行数:15,代码来源:PickListItems.ascx.cs


注:本文中的SessionScopeWrapper.QueryOver方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。