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


C# Query.Execute方法代码示例

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


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

示例1: Query

        public static IEnumerable<Item> Query([Diagnostics.NotNull] this Database database, [Diagnostics.NotNull] string queryText)
        {
            var query = new Query(queryText)
            {
                Max = int.MaxValue
            };

            var result = query.Execute(database.GetRootItem());

            var queryContext = result as QueryContext;
            if (queryContext != null)
            {
                var item = database.GetItem(queryContext.ID);
                if (item != null)
                {
                    yield return item;
                }
            }

            var queryContextArray = result as QueryContext[];
            if (queryContextArray == null)
            {
                yield break;
            }

            foreach (var i in queryContextArray)
            {
                var item = database.GetItem(i.ID);
                if (item != null)
                {
                    yield return item;
                }
            }
        }
开发者ID:pveller,项目名称:Sitecore.Pathfinder,代码行数:34,代码来源:DatabaseExtensions.cs

示例2: crossSell_Clicked

 /// <summary>
 /// Handles the Clicked event of the crossSell control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
 protected void crossSell_Clicked(object sender, EventArgs e)
 {
     try {
     CheckBox checkbox = sender as CheckBox;
     if(checkbox != null) {
       DataGridItem row = checkbox.NamingContainer as DataGridItem;
       int crossProductId = 0;
       if(row != null) {
     int.TryParse(dgCrossSells.DataKeys[row.ItemIndex].ToString(), out crossProductId);
       }
       if(checkbox.Checked) {
     CrossSell crossSell = new CrossSell();
     crossSell.ProductId = productId;
     crossSell.CrossProductId = crossProductId;
     crossSell.Save();
     Store.Caching.ProductCache.RemoveCrossSellCollectionFromCache(productId);
     LoadProducts();
     base.MasterPage.MessageCenter.DisplaySuccessMessage(LocalizationUtility.GetText("lblCrossSellSaved"));
       }
       else {
     Query query = new Query(CrossSell.Schema).WHERE(CrossSell.Columns.ProductId, productId).AND(CrossSell.Columns.CrossProductId, crossProductId);
     query.QueryType = QueryType.Delete;
     query.Execute();
     Store.Caching.ProductCache.RemoveCrossSellCollectionFromCache(productId);
     LoadProducts();
     base.MasterPage.MessageCenter.DisplaySuccessMessage(LocalizationUtility.GetText("lblCrossSellDeleted"));
       }
     }
       }
       catch(Exception ex) {
     Logger.Error(typeof(crosssells).Name + ".crossSell_Clicked", ex);
     base.MasterPage.MessageCenter.DisplayCriticalMessage(ex.Message);
       }
 }
开发者ID:montyclift,项目名称:dashcommerce-3,代码行数:39,代码来源:crosssells.ascx.cs

示例3: SetUp

 public void SetUp()
 {
     Query qry = new Query(Product.Schema);
     qry.QueryType = QueryType.Delete;
     qry.AddWhere(Product.Columns.ProductName, Comparison.Like, "Unit Test%");
     qry.Execute();
 }
开发者ID:khurram063,项目名称:SubSonic-2.0,代码行数:7,代码来源:ActiveListTests.cs

示例4: Delete

 public bool Delete(string MaDoituongKcb,int IdDichvu,int IdDichvuChitiet,string DungtuyenTraituyen,int MaLoaithanhtoan)
 {
     Query qry = new Query(DmucBhytChitraDacbiet.Schema);
     qry.QueryType = QueryType.Delete;
     qry.AddWhere("MaDoituongKcb", MaDoituongKcb).AND("IdDichvu", IdDichvu).AND("IdDichvuChitiet", IdDichvuChitiet).AND("DungtuyenTraituyen", DungtuyenTraituyen).AND("MaLoaithanhtoan", MaLoaithanhtoan);
     qry.Execute();
     return (true);
 }
开发者ID:khaha2210,项目名称:VXIS,代码行数:8,代码来源:DmucBhytChitraDacbietController.cs

示例5: Delete

 public bool Delete(int IdReport,string ThamSo)
 {
     Query qry = new Query(BThamsoBaocao.Schema);
     qry.QueryType = QueryType.Delete;
     qry.AddWhere("IdReport", IdReport).AND("ThamSo", ThamSo);
     qry.Execute();
     return (true);
 }        
开发者ID:khaha2210,项目名称:radio,代码行数:8,代码来源:BThamsoBaocaoController.cs

示例6: Delete

 public bool Delete(long IdBenhnhan,string MaLuotkham)
 {
     Query qry = new Query(KcbLuotkham.Schema);
     qry.QueryType = QueryType.Delete;
     qry.AddWhere("IdBenhnhan", IdBenhnhan).AND("MaLuotkham", MaLuotkham);
     qry.Execute();
     return (true);
 }
开发者ID:khaha2210,项目名称:CodeNewHis,代码行数:8,代码来源:KcbLuotkhamController.cs

示例7: Delete

 public bool Delete(int IdThuoc,short IdKho,string KieuThuocVt)
 {
     Query qry = new Query(TDutruThuoc.Schema);
     qry.QueryType = QueryType.Delete;
     qry.AddWhere("IdThuoc", IdThuoc).AND("IdKho", IdKho).AND("KieuThuocVt", KieuThuocVt);
     qry.Execute();
     return (true);
 }
开发者ID:khaha2210,项目名称:VXIS,代码行数:8,代码来源:TDutruThuocController.cs

示例8: Delete

 public bool Delete(int OrderID,int ProductID)
 {
     Query qry = new Query(OrderDetail.Schema);
     qry.QueryType = QueryType.Delete;
     qry.AddWhere("OrderID", OrderID).AND("ProductID", ProductID);
     qry.Execute();
     return (true);
 }
开发者ID:RyanDansie,项目名称:SubSonic-2.0,代码行数:8,代码来源:OrderDetailController.cs

示例9: Delete

 public bool Delete(int CategoryID,int ProductID)
 {
     Query qry = new Query(ProductCategoryMap.Schema);
     qry.QueryType = QueryType.Delete;
     qry.AddWhere("CategoryID", CategoryID).AND("ProductID", ProductID);
     qry.Execute();
     return (true);
 }
开发者ID:RyanDansie,项目名称:SubSonic-2.0,代码行数:8,代码来源:ProductCategoryMapController.cs

示例10: Delete

 public bool Delete(int EmployeeID,string TerritoryID)
 {
     Query qry = new Query(EmployeeTerritory.Schema);
     qry.QueryType = QueryType.Delete;
     qry.AddWhere("EmployeeID", EmployeeID).AND("TerritoryID", TerritoryID);
     qry.Execute();
     return (true);
 }
开发者ID:RyanDansie,项目名称:SubSonic-2.0,代码行数:8,代码来源:EmployeeTerritoryController.cs

示例11: Delete

 public bool Delete(string SUID,long IRoleID,long IParentRoleID,string FpSBranchID)
 {
     Query qry = new Query(SysRolesForUser.Schema);
     qry.QueryType = QueryType.Delete;
     qry.AddWhere("SUID", SUID).AND("IRoleID", IRoleID).AND("IParentRoleID", IParentRoleID).AND("FpSBranchID", FpSBranchID);
     qry.Execute();
     return (true);
 }
开发者ID:khaha2210,项目名称:VXIS,代码行数:8,代码来源:SysRolesForUserController.cs

示例12: Delete

 public bool Delete(short IdNhanvien,string Ma,string Loai)
 {
     Query qry = new Query(QheNhanvienQuyensudung.Schema);
     qry.QueryType = QueryType.Delete;
     qry.AddWhere("IdNhanvien", IdNhanvien).AND("Ma", Ma).AND("Loai", Loai);
     qry.Execute();
     return (true);
 }
开发者ID:vmshis2015,项目名称:VMSPharmacy,代码行数:8,代码来源:QheNhanvienQuyensudungController.cs

示例13: Delete

 public bool Delete(int IdThuoc,int IdThuoctuongduong)
 {
     Query qry = new Query(QheThuoctuongduong.Schema);
     qry.QueryType = QueryType.Delete;
     qry.AddWhere("IdThuoc", IdThuoc).AND("IdThuoctuongduong", IdThuoctuongduong);
     qry.Execute();
     return (true);
 }
开发者ID:khaha2210,项目名称:VXIS,代码行数:8,代码来源:QheThuoctuongduongController.cs

示例14: Delete

 public bool Delete(short IdKhoakcb,int IdPhikemtheo,int IdPhikemtheongoaigio)
 {
     Query qry = new Query(DmucPhikemtheo.Schema);
     qry.QueryType = QueryType.Delete;
     qry.AddWhere("IdKhoakcb", IdKhoakcb).AND("IdPhikemtheo", IdPhikemtheo).AND("IdPhikemtheongoaigio", IdPhikemtheongoaigio);
     qry.Execute();
     return (true);
 }
开发者ID:khaha2210,项目名称:VXIS,代码行数:8,代码来源:DmucPhikemtheoController.cs

示例15: Delete

 public bool Delete(string CustomerID,string CustomerTypeID)
 {
     Query qry = new Query(CustomerCustomerDemo.Schema);
     qry.QueryType = QueryType.Delete;
     qry.AddWhere("CustomerID", CustomerID).AND("CustomerTypeID", CustomerTypeID);
     qry.Execute();
     return (true);
 }
开发者ID:RyanDansie,项目名称:SubSonic-2.0,代码行数:8,代码来源:CustomerCustomerDemoController.cs


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