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


C# IQueryable.ToArray方法代码示例

本文整理汇总了C#中IQueryable.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# IQueryable.ToArray方法的具体用法?C# IQueryable.ToArray怎么用?C# IQueryable.ToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IQueryable的用法示例。


在下文中一共展示了IQueryable.ToArray方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FormEditOrder

        public FormEditOrder(ref res.Employee curEmpl)
        {
            InitializeComponent();
            mode = (short)OrderMode.mode_new;
            curEmployee = curEmpl;
            lbl_num.Text = "Новый";
            #region database context & entities filling
            database = new res.Model1Container(RegistryInteractor.GetFromReg("Connection String"));
            curPositions = new List<PositionForOrder>();
            curOrder = res.Order.CreateOrder(-1, DateTime.Now, "Обработка", -1, -1);
            Items = from it in database.ItemSet select it;
            Categories = from cat in database.ItemCategorySet select cat;
            #endregion
            #region data sources
            cb_itemType.DataSource = Categories.ToArray();
            cb_itemType.DisplayMember = "name";
            cb_itemType.ValueMember = "id";

            DGV.DataSource = DGV_contentsT;
            #endregion
            #region event_bindings
            cb_itemType.SelectedValueChanged += new EventHandler(btn_addPos_check);
            cb_itemType.SelectedValueChanged += new EventHandler(this.cb_itemType_SelectedIndexChanged);

            cb_itemDesignation.SelectedIndexChanged += new EventHandler(this.cb_itemDesignation_SelectedIndexChanged);
            cb_itemDesignation.SelectedValueChanged += new EventHandler(this.num_itemCount_check);
            cb_itemDesignation.SelectedValueChanged += new EventHandler(btn_addPos_check);
            cb_itemDesignation.SelectedValueChanged += new EventHandler(num_itemCount_anull);

            num_itemCount.ValueChanged += new EventHandler(btn_addPos_check);
            num_itemCount.ValueChanged += new EventHandler(num_itemCount_ValueChanged);

            btn_addItem.Click += new EventHandler(btn_addItem_Click);
            btn_addItem.Click += new EventHandler(btn_rmItem_check);
            btn_addItem.Click += new EventHandler(DGV_contentsT_Refill);
            btn_addItem.Click += new EventHandler(this.btn_accept_check);

            btn_rmItem.Click += new EventHandler(btn_rmItem_Click);
            btn_rmItem.Click += new EventHandler(btn_rmItem_check);
            btn_rmItem.Click += new EventHandler(DGV_contentsT_Refill);
            btn_rmItem.Click += new EventHandler(this.btn_accept_check);

            btn_accept.Click += new EventHandler(btn_accept_Click);

            tb_Name.TextChanged += new EventHandler(this.btn_accept_check);
            tb_phone.TextChanged += new EventHandler(this.btn_accept_check);

            DGV.SelectionChanged += new EventHandler(btn_rmItem_check);
            DGV.CellValueChanged += new DataGridViewCellEventHandler(DGV_CellValueChanged);
            DGV.CellValueChanged += new DataGridViewCellEventHandler(DGV_contentsT_Refill);
            DGV.DataError += new DataGridViewDataErrorEventHandler(DGV_DataError);
            #endregion
        }
开发者ID:d-theus,项目名称:SERIOUS_BUSINESS,代码行数:53,代码来源:FormEditOrder.cs

示例2: Execute

        protected virtual object Execute(IQueryable<TextContent> queryable, IEnumerable<OrderExpression> orders, CallType callType, int? skip, int? take)
        {
            #region Order query
            IOrderedQueryable<TextContent> ordered = null;
            foreach (var orderItem in orders)
            {
                if (!orderItem.Descending)
                {
                    if (ordered == null)
                    {
                        ordered = queryable.OrderBy(orderItem.OrderExprssion);
                    }
                    else
                    {
                        ordered = ordered.ThenBy(orderItem.OrderExprssion);
                    }

                }
                else
                {
                    if (ordered == null)
                    {
                        ordered = queryable.OrderByDescending(orderItem.OrderExprssion);
                    }
                    else
                    {
                        ordered = ordered.ThenByDescending(orderItem.OrderExprssion);
                    }
                }
            }
            if (ordered != null)
            {
                queryable = ordered;
            }

            #endregion

            if (skip.HasValue)
            {
                queryable = queryable.Skip(skip.Value);
            }

            if (take.HasValue)
            {
                queryable = queryable.Take(take.Value);
            }
            switch (callType)
            {
                case Kooboo.CMS.Content.Query.Expressions.CallType.Count:
                    return queryable.Count();
                case Kooboo.CMS.Content.Query.Expressions.CallType.First:
                    return queryable.First();
                case Kooboo.CMS.Content.Query.Expressions.CallType.Last:
                    return queryable.Last();
                case Kooboo.CMS.Content.Query.Expressions.CallType.LastOrDefault:
                    return queryable.LastOrDefault();
                case Kooboo.CMS.Content.Query.Expressions.CallType.FirstOrDefault:
                    return queryable.FirstOrDefault();
                case Kooboo.CMS.Content.Query.Expressions.CallType.Unspecified:
                default:
                    return queryable.ToArray();
            }
        }
开发者ID:Epitomy,项目名称:CMS,代码行数:63,代码来源:QueryExecutor.cs

示例3: BindToDataGridView

 /// <summary>
 /// 
 /// </summary>
 /// <param name="r"></param>
 private void BindToDataGridView(IQueryable<tblFlow> r)
 {
     FlowData[] fs = FlowConverter.Convert(r.ToArray());
     DataTable tbl = FlowConverter.Convert(fs);
     this.dataGridView1.DataSource = tbl;
 }
开发者ID:hkiaipc,项目名称:fnq,代码行数:10,代码来源:frmFlowList.cs

示例4: FillCategories

 private void FillCategories()
 {
     Categories = from cats in database.ItemCategorySet select cats;
     cb_type.DataSource = Categories.ToArray<res.ItemCategory>();
     cb_type.DisplayMember = "name";
     cb_type.ValueMember = "id";
     cb_type.IsAccessible = true;
 }
开发者ID:d-theus,项目名称:SERIOUS_BUSINESS,代码行数:8,代码来源:FormIntake.cs


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