本文整理汇总了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;
}
}
}
示例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);
}
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}