/// <summary> /// 查询 /// </summary> private void DoSelect() { if (!SearchCriterion.Orders.Exists(en => en.PropertyName == "CreateTime")) { SearchCriterion.Orders.Add(new OrderCriterionItem("CreateTime", false)); } string paystate = RequestData.Get <string>("paystate"); if (paystate == "1") { SearchCriterion.AddSearch("PayState", "1"); ents = Logistic.FindAll(SearchCriterion); } else { ents = Logistic.FindAll(SearchCriterion, Expression.Sql(" isnull(PayState,0) <> '1' ")); } this.PageState.Add("LogisticList", ents); }
/// <summary> /// 查询 /// </summary> private void DoSelect() { if (SearchCriterion.Orders.Count == 0) { if (!SearchCriterion.Orders.Exists(en => en.PropertyName == "CreateTime")) { SearchCriterion.Orders.Add(new OrderCriterionItem("CreateTime", false)); } } string type = "all"; foreach (CommonSearchCriterionItem sear in SearchCriterion.Searches.Searches) { if (sear.PropertyName == "Name" && sear.Value + "" != "") { type = "Logistic"; } else if ((sear.PropertyName == "CName" && sear.Value + "" != "") || (sear.PropertyName == "Number" && sear.Value + "" != "")) { type = "Order"; } } string did = RequestData.Get <string>("did"); if (type == "all" || type == "Logistic" || !string.IsNullOrEmpty(did)) { //if (!string.IsNullOrEmpty(did)) //{ // SearchCriterion.Searches.Clear(); //} ents = Logistic.FindAll(SearchCriterion, Expression.Sql(" charindex('" + did + "',DeliveryId)>0 ")); //if (ents.Count == 0 && !string.IsNullOrEmpty(did)) //{ // DeliveryOrder doent = DeliveryOrder.TryFind(did); // if (doent != null) // { // ents = Logistic.FindAll(SearchCriterion, Expression.Eq("CustomerId", doent.CId)); // } //} this.PageState.Add("LogisticList", ents); } if (type == "all" || type == "Order") { string wtype = RequestData.Get <string>("wtype"); ICriterion crit = null; if (wtype == "1") { SearchCriterion.AddSearch("LogisticState", "已填写"); } else { crit = Expression.Or(Expression.Sql(" LogisticState <> '已填写' "), Expression.IsNull("LogisticState")); } SearchCriterion.AddSearch("State", "已出库"); DeliveryOrder[] ents2 = DeliveryOrder.FindAll(SearchCriterion, crit); this.PageState.Add("OrderList", ents2); SearchCriterion.RemoveSearch("State"); } }