STAGE3 OK
This commit is contained in:
@@ -25,7 +25,7 @@ public partial class admin_follower_print_ : System.Web.UI.Page
|
||||
|
||||
//紀錄匯出條件
|
||||
string _query = "";
|
||||
var qry = _db.pro_order.AsEnumerable();
|
||||
var qry = _db.pro_order.AsQueryable();
|
||||
if (!string.IsNullOrEmpty(Request["order_no"]))
|
||||
{
|
||||
qry = qry.Where(o => o.order_no.Contains(Request["order_no"].Trim()));
|
||||
@@ -73,21 +73,21 @@ public partial class admin_follower_print_ : System.Web.UI.Page
|
||||
}
|
||||
if (!string.IsNullOrEmpty(Request["country"]))
|
||||
{
|
||||
qry = qry.Where(o => o.f_num != null && o.follower?.country == Request["country"]);
|
||||
_query += "國家:" + (_db.countries.AsEnumerable().Where(x => x.ID == Request["country"]).Select(x => x.name_zh).FirstOrDefault()??"") + "\n";
|
||||
qry = qry.Where(o => o.f_num != null && o.follower.country == Request["country"]);
|
||||
_query += "國家:" + (_db.countries.Where(x => x.ID == Request["country"]).Select(x => x.name_zh).FirstOrDefault()??"") + "\n";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(Request["country2"]))
|
||||
{
|
||||
if (Request["country2"] == "1")
|
||||
{
|
||||
qry = qry.Where(o => o.f_num != null && o.follower?.country == "158");
|
||||
qry = qry.Where(o => o.f_num != null && o.follower.country == "158");
|
||||
}
|
||||
else if (Request["country2"] == "2")
|
||||
{
|
||||
qry = qry.Where(o => o.f_num != null && o.follower?.country != "158");
|
||||
qry = qry.Where(o => o.f_num != null && o.follower.country != "158");
|
||||
|
||||
}
|
||||
_query += "國家:" + (_db.countries.AsEnumerable().Where(x => x.ID == Request["country2"]).Select(x => x.name_zh).FirstOrDefault()??"") + "\n";
|
||||
_query += "國家:" + (_db.countries.Where(x => x.ID == Request["country2"]).Select(x => x.name_zh).FirstOrDefault()??"") + "\n";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(Request["hasPrice"]))
|
||||
{
|
||||
@@ -175,7 +175,7 @@ public partial class admin_follower_print_ : System.Web.UI.Page
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Request["year"]))
|
||||
qry = qry.OrderByDescending(o => o.activity?.startDate_solar).ThenByDescending(o=>o.up_time).ThenByDescending(o=>o.order_no);
|
||||
qry = qry.OrderByDescending(o => o.activity != null ? o.activity.startDate_solar : null).ThenByDescending(o=>o.up_time).ThenByDescending(o=>o.order_no);
|
||||
else
|
||||
qry = qry.OrderByDescending(o => o.order_no);
|
||||
|
||||
@@ -186,8 +186,9 @@ public partial class admin_follower_print_ : System.Web.UI.Page
|
||||
tdesc = publicFun.enum_desc<Model.pro_order.detailKeyin1>();
|
||||
|
||||
//明細
|
||||
_detail = _db.pro_order_detail.AsEnumerable().Where(x => prod.Select(o => o.order_no).Contains( x.order_no)).ToList();
|
||||
_bedDt = _db.bed_order_detail.AsEnumerable().Where(x => prod.Select(o => o.order_no).Contains( x.bed_order.order_no)).ToList();
|
||||
var orderNos = prod.Select(o => o.order_no).ToList();
|
||||
_detail = _db.pro_order_detail.Where(x => orderNos.Contains(x.order_no)).ToList();
|
||||
_bedDt = _db.bed_order_detail.Where(x => orderNos.Contains(x.bed_order.order_no)).ToList();
|
||||
|
||||
Repeater1.DataSource = prod;
|
||||
Repeater1.DataBind();
|
||||
|
||||
Reference in New Issue
Block a user