STAGE3 OK
This commit is contained in:
@@ -47,7 +47,7 @@ public partial class admin_order_index : MyWeb.config
|
||||
//國籍
|
||||
s_country.Items.Clear();
|
||||
s_country.Items.Add(new ListItem("請選擇", ""));
|
||||
var qry = _db.countries.AsEnumerable().OrderBy(x => x.range).ThenBy(x => x.name_en).ToList();
|
||||
var qry = _db.countries.OrderBy(x => x.range).ThenBy(x => x.name_en).ToList();
|
||||
if (qry.Count > 0)
|
||||
{
|
||||
foreach (var x in qry)
|
||||
@@ -128,8 +128,8 @@ public partial class admin_order_index : MyWeb.config
|
||||
sd.AppendChild(tr);
|
||||
|
||||
//查詢要匯出的資料
|
||||
var aIDt = _db.actItems.AsEnumerable().Where(f => f.subject.Contains(s_actItemTxt.Value.Trim())).Select(f => f.num.ToString());//品項
|
||||
var qry = _db.pro_order.AsEnumerable();
|
||||
var aIDt = _db.actItems.Where(f => f.subject.Contains(s_actItemTxt.Value.Trim())).Select(f => f.num.ToString());//品項
|
||||
var qry = _db.pro_order.AsQueryable();
|
||||
|
||||
if (!isStrNull(s_order_no.Value))
|
||||
qry = qry.Where(o => o.order_no.Contains(s_order_no.Value.Trim()));
|
||||
@@ -154,7 +154,7 @@ public partial class admin_order_index : MyWeb.config
|
||||
MyWeb.encrypt encrypt = new MyWeb.encrypt();
|
||||
var tdesc = publicFun.enum_desc<Model.pro_order.detailKeyin1>();
|
||||
|
||||
var bedDt = _db.bed_order_detail.AsEnumerable();//掛單明細
|
||||
var bedDt = _db.bed_order_detail.AsQueryable();//掛單明細
|
||||
|
||||
|
||||
//left join 使用 GroupJoin
|
||||
@@ -167,7 +167,7 @@ public partial class admin_order_index : MyWeb.config
|
||||
order_no = o.order_no,
|
||||
up_time = o.up_time,
|
||||
keyin1 = o.keyin1,
|
||||
f_num = o.follower?.u_name, //姓名/名稱
|
||||
f_num = o.follower != null ? o.follower.u_name : "", //姓名/名稱
|
||||
phone = o.phone,
|
||||
activity_num = o.activity_num.HasValue ? o.activity.subject : "",
|
||||
address = o.address,
|
||||
|
||||
@@ -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