STAGE3 OK
This commit is contained in:
@@ -130,7 +130,8 @@ public partial class admin_hr_import : MyWeb.config
|
|||||||
);
|
);
|
||||||
sd2.AppendChild(tr);
|
sd2.AppendChild(tr);
|
||||||
//查詢要匯出的資料
|
//查詢要匯出的資料
|
||||||
var list = _db.member_group.AsEnumerable().ToList();
|
// TODO: REVIEW - member_group 為固定少量資料表,ToList() 可接受
|
||||||
|
var list = _db.member_group.ToList();
|
||||||
if (list.Count > 0)
|
if (list.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (var item in list)
|
foreach (var item in list)
|
||||||
@@ -178,7 +179,8 @@ public partial class admin_hr_import : MyWeb.config
|
|||||||
);
|
);
|
||||||
sd3.AppendChild(tr);
|
sd3.AppendChild(tr);
|
||||||
//查詢要匯出的資料
|
//查詢要匯出的資料
|
||||||
var list2 = _db.member_title.AsEnumerable().ToList();
|
// TODO: REVIEW - member_title 為固定少量資料表,ToList() 可接受
|
||||||
|
var list2 = _db.member_title.ToList();
|
||||||
if (list2.Count > 0)
|
if (list2.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (var item in list2)
|
foreach (var item in list2)
|
||||||
@@ -229,10 +231,16 @@ public partial class admin_hr_import : MyWeb.config
|
|||||||
startRowNumber += 1;
|
startRowNumber += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
var fDt = _db.followers.AsEnumerable().ToList(); //信眾
|
// TODO: REVIEW - 整表載入性能評估:
|
||||||
var aDt = _db.admins.AsEnumerable().ToList(); //後台系統
|
// - followers (信眾) ⚠️ 會成長!若超過 1000 筆需優化為按需載入(先掃描 Excel 收集編號)
|
||||||
var gDt = _db.member_group.AsEnumerable().Select(x => x.num).ToList(); //組別
|
// - admins (管理員) ✓ 通常少量,ToList() 可接受
|
||||||
var tDt = _db.member_title.AsEnumerable().Select(x => x.num).ToList(); //職稱
|
// - member_group (組別) ✓ 固定少量,可接受
|
||||||
|
// - member_title (職稱) ✓ 固定少量,可接受
|
||||||
|
// 優化方案:先掃描 Excel → 只載入需要的編號 → 使用 Dictionary 加速查找(O(1) vs O(n))
|
||||||
|
var fDt = _db.followers.ToList(); //信眾
|
||||||
|
var aDt = _db.admins.ToList(); //後台系統
|
||||||
|
var gDt = _db.member_group.Select(x => x.num).ToList(); //組別
|
||||||
|
var tDt = _db.member_title.Select(x => x.num).ToList(); //職稱
|
||||||
MyWeb.encrypt encrypt = new MyWeb.encrypt();
|
MyWeb.encrypt encrypt = new MyWeb.encrypt();
|
||||||
|
|
||||||
for (int currentRow = startRowNumber; currentRow <= endRowNumber; currentRow++)
|
for (int currentRow = startRowNumber; currentRow <= endRowNumber; currentRow++)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public partial class admin_activity_itemKind : MyWeb.config
|
|||||||
if (!isStrNull(Request["num"]))
|
if (!isStrNull(Request["num"]))
|
||||||
{
|
{
|
||||||
int _num = Val(Request["num"]);
|
int _num = Val(Request["num"]);
|
||||||
var prod = _db.actItem_kind.AsEnumerable().Where(q => q.num == _num).OrderBy(q => q.kind).FirstOrDefault();
|
var prod = _db.actItem_kind.Where(q => q.num == _num).OrderBy(q => q.kind).FirstOrDefault();
|
||||||
|
|
||||||
if (prod != null)
|
if (prod != null)
|
||||||
{
|
{
|
||||||
@@ -214,7 +214,7 @@ public partial class admin_activity_itemKind : MyWeb.config
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var prod = _db.actItem_kind.AsEnumerable().Where(q => q.root == root).OrderByDescending(q => q.range).FirstOrDefault();
|
var prod = _db.actItem_kind.Where(q => q.root == root).OrderByDescending(q => q.range).FirstOrDefault();
|
||||||
if (prod != null)
|
if (prod != null)
|
||||||
if (prod.range.HasValue)
|
if (prod.range.HasValue)
|
||||||
range = prod.range.Value + 1;
|
range = prod.range.Value + 1;
|
||||||
@@ -252,7 +252,7 @@ public partial class admin_activity_itemKind : MyWeb.config
|
|||||||
|
|
||||||
int num = Val(Request["num"]);
|
int num = Val(Request["num"]);
|
||||||
del_product(num);
|
del_product(num);
|
||||||
var prod = _db.actItem_kind.AsEnumerable().Where(q => q.num == num).FirstOrDefault(); //刪除該筆資料
|
var prod = _db.actItem_kind.Where(q => q.num == num).FirstOrDefault(); //刪除該筆資料
|
||||||
if (prod != null)
|
if (prod != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ public partial class admin_activity_itemKind : MyWeb.config
|
|||||||
|
|
||||||
public void Del_Ohter_Items(int d_num)
|
public void Del_Ohter_Items(int d_num)
|
||||||
{
|
{
|
||||||
var prod = _db.actItem_kind.AsEnumerable().Where(q => q.root == d_num).ToList();
|
var prod = _db.actItem_kind.Where(q => q.root == d_num).ToList();
|
||||||
if (prod.Count > 0)
|
if (prod.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (var row in prod)
|
foreach (var row in prod)
|
||||||
@@ -289,7 +289,7 @@ public partial class admin_activity_itemKind : MyWeb.config
|
|||||||
|
|
||||||
public void del_product(int num)
|
public void del_product(int num)
|
||||||
{
|
{
|
||||||
var prod = _db.actItems.AsEnumerable().Where(q => q.kind == num).ToList();
|
var prod = _db.actItems.Where(q => q.kind == num).ToList();
|
||||||
if (prod.Count > 0)
|
if (prod.Count > 0)
|
||||||
{
|
{
|
||||||
//清空分類
|
//清空分類
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public partial class admin_follower_index : MyWeb.config
|
|||||||
//國籍
|
//國籍
|
||||||
s_country.Items.Clear();
|
s_country.Items.Clear();
|
||||||
s_country.Items.Add(new ListItem("請選擇", ""));
|
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)
|
if (qry.Count > 0)
|
||||||
{
|
{
|
||||||
foreach(var x in qry)
|
foreach(var x in qry)
|
||||||
@@ -222,7 +222,7 @@ public partial class admin_follower_index : MyWeb.config
|
|||||||
{
|
{
|
||||||
|
|
||||||
//查詢要匯出的資料
|
//查詢要匯出的資料
|
||||||
var qry = _db.followers.AsEnumerable();
|
var qry = _db.followers.AsQueryable();
|
||||||
|
|
||||||
//紀錄匯出條件
|
//紀錄匯出條件
|
||||||
if (!isStrNull(s_f_number.Value))
|
if (!isStrNull(s_f_number.Value))
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public partial class admin_follower_print_ : System.Web.UI.Page
|
|||||||
|
|
||||||
//紀錄匯出條件
|
//紀錄匯出條件
|
||||||
string _query = "";
|
string _query = "";
|
||||||
var qry = _db.followers.AsEnumerable();
|
var qry = _db.followers.AsQueryable();
|
||||||
if (!string.IsNullOrEmpty(Request["f_number"]))
|
if (!string.IsNullOrEmpty(Request["f_number"]))
|
||||||
{
|
{
|
||||||
qry = qry.Where(o => o.f_number.Contains(Request["f_number"].Trim()));
|
qry = qry.Where(o => o.f_number.Contains(Request["f_number"].Trim()));
|
||||||
@@ -57,7 +57,7 @@ public partial class admin_follower_print_ : System.Web.UI.Page
|
|||||||
if (!string.IsNullOrEmpty(Request["country"]))
|
if (!string.IsNullOrEmpty(Request["country"]))
|
||||||
{
|
{
|
||||||
qry = qry.Where(o => o.country == Request["country"]);
|
qry = qry.Where(o => o.country == Request["country"]);
|
||||||
_query += "國家:" + (_db.countries.AsEnumerable().Where(x => x.ID == Request["country"].ToString()).Select(x => x.name_zh).FirstOrDefault()??"" )+ "\n";
|
_query += "國家:" + (_db.countries.Where(x => x.ID == Request["country"].ToString()).Select(x => x.name_zh).FirstOrDefault()??"" )+ "\n";
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(Request["country2"]))
|
if (!string.IsNullOrEmpty(Request["country2"]))
|
||||||
{
|
{
|
||||||
@@ -70,7 +70,7 @@ public partial class admin_follower_print_ : System.Web.UI.Page
|
|||||||
qry = qry.Where(o => o.country != "158");
|
qry = qry.Where(o => o.country != "158");
|
||||||
|
|
||||||
}
|
}
|
||||||
_query += "國家:" + (_db.countries.AsEnumerable().Where(x => x.ID == Request["country2"].ToString()).Select(x => x.name_zh).FirstOrDefault()??"") + "\n";
|
_query += "國家:" + (_db.countries.Where(x => x.ID == Request["country2"].ToString()).Select(x => x.name_zh).FirstOrDefault()??"") + "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
//管理報表
|
//管理報表
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public partial class admin_news_news_reg : MyWeb.config
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
int _num = Val(Request["num"]);
|
int _num = Val(Request["num"]);
|
||||||
var qry = _db.news.AsEnumerable();
|
var qry = _db.news.AsQueryable();
|
||||||
//var prod = _db.news.Where(q => q.num == _num).ToList();
|
//var prod = _db.news.Where(q => q.num == _num).ToList();
|
||||||
var prod = qry.Where(q => q.num == _num).FirstOrDefault();
|
var prod = qry.Where(q => q.num == _num).FirstOrDefault();
|
||||||
|
|
||||||
@@ -410,13 +410,11 @@ public partial class admin_news_news_reg : MyWeb.config
|
|||||||
#region 載入
|
#region 載入
|
||||||
protected void initNewsFiles(int num = 0)
|
protected void initNewsFiles(int num = 0)
|
||||||
{
|
{
|
||||||
var qry = _db.news_files.AsEnumerable();
|
var qry = _db.news_files.AsQueryable();
|
||||||
if (num > 0)
|
if (num > 0)
|
||||||
qry = qry.Where(q => q.news_id == num).ToList();
|
qry = qry.Where(q => q.news_id == num);
|
||||||
else
|
|
||||||
qry = qry.ToList();
|
|
||||||
|
|
||||||
fileRepeater.DataSource = qry;
|
fileRepeater.DataSource = qry.ToList();
|
||||||
fileRepeater.DataBind();
|
fileRepeater.DataBind();
|
||||||
}
|
}
|
||||||
protected void fileRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
|
protected void fileRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public partial class admin_order_index : MyWeb.config
|
|||||||
//國籍
|
//國籍
|
||||||
s_country.Items.Clear();
|
s_country.Items.Clear();
|
||||||
s_country.Items.Add(new ListItem("請選擇", ""));
|
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)
|
if (qry.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (var x in qry)
|
foreach (var x in qry)
|
||||||
@@ -128,8 +128,8 @@ public partial class admin_order_index : MyWeb.config
|
|||||||
sd.AppendChild(tr);
|
sd.AppendChild(tr);
|
||||||
|
|
||||||
//查詢要匯出的資料
|
//查詢要匯出的資料
|
||||||
var aIDt = _db.actItems.AsEnumerable().Where(f => f.subject.Contains(s_actItemTxt.Value.Trim())).Select(f => f.num.ToString());//品項
|
var aIDt = _db.actItems.Where(f => f.subject.Contains(s_actItemTxt.Value.Trim())).Select(f => f.num.ToString());//品項
|
||||||
var qry = _db.pro_order.AsEnumerable();
|
var qry = _db.pro_order.AsQueryable();
|
||||||
|
|
||||||
if (!isStrNull(s_order_no.Value))
|
if (!isStrNull(s_order_no.Value))
|
||||||
qry = qry.Where(o => o.order_no.Contains(s_order_no.Value.Trim()));
|
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();
|
MyWeb.encrypt encrypt = new MyWeb.encrypt();
|
||||||
var tdesc = publicFun.enum_desc<Model.pro_order.detailKeyin1>();
|
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
|
//left join 使用 GroupJoin
|
||||||
@@ -167,7 +167,7 @@ public partial class admin_order_index : MyWeb.config
|
|||||||
order_no = o.order_no,
|
order_no = o.order_no,
|
||||||
up_time = o.up_time,
|
up_time = o.up_time,
|
||||||
keyin1 = o.keyin1,
|
keyin1 = o.keyin1,
|
||||||
f_num = o.follower?.u_name, //姓名/名稱
|
f_num = o.follower != null ? o.follower.u_name : "", //姓名/名稱
|
||||||
phone = o.phone,
|
phone = o.phone,
|
||||||
activity_num = o.activity_num.HasValue ? o.activity.subject : "",
|
activity_num = o.activity_num.HasValue ? o.activity.subject : "",
|
||||||
address = o.address,
|
address = o.address,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public partial class admin_follower_print_ : System.Web.UI.Page
|
|||||||
|
|
||||||
//紀錄匯出條件
|
//紀錄匯出條件
|
||||||
string _query = "";
|
string _query = "";
|
||||||
var qry = _db.pro_order.AsEnumerable();
|
var qry = _db.pro_order.AsQueryable();
|
||||||
if (!string.IsNullOrEmpty(Request["order_no"]))
|
if (!string.IsNullOrEmpty(Request["order_no"]))
|
||||||
{
|
{
|
||||||
qry = qry.Where(o => o.order_no.Contains(Request["order_no"].Trim()));
|
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"]))
|
if (!string.IsNullOrEmpty(Request["country"]))
|
||||||
{
|
{
|
||||||
qry = qry.Where(o => o.f_num != null && o.follower?.country == 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";
|
_query += "國家:" + (_db.countries.Where(x => x.ID == Request["country"]).Select(x => x.name_zh).FirstOrDefault()??"") + "\n";
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(Request["country2"]))
|
if (!string.IsNullOrEmpty(Request["country2"]))
|
||||||
{
|
{
|
||||||
if (Request["country2"] == "1")
|
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")
|
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"]))
|
if (!string.IsNullOrEmpty(Request["hasPrice"]))
|
||||||
{
|
{
|
||||||
@@ -175,7 +175,7 @@ public partial class admin_follower_print_ : System.Web.UI.Page
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(Request["year"]))
|
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
|
else
|
||||||
qry = qry.OrderByDescending(o => o.order_no);
|
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>();
|
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();
|
var orderNos = prod.Select(o => o.order_no).ToList();
|
||||||
_bedDt = _db.bed_order_detail.AsEnumerable().Where(x => prod.Select(o => o.order_no).Contains( x.bed_order.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.DataSource = prod;
|
||||||
Repeater1.DataBind();
|
Repeater1.DataBind();
|
||||||
|
|||||||
@@ -39,9 +39,8 @@ public partial class admin_project_list : MyWeb.config
|
|||||||
//品項
|
//品項
|
||||||
s_actItem_num.Items.Clear();
|
s_actItem_num.Items.Clear();
|
||||||
s_actItem_num.Items.Add(new ListItem("請選擇", ""));
|
s_actItem_num.Items.Add(new ListItem("請選擇", ""));
|
||||||
var qry = _db.actItems.AsEnumerable();
|
var qry = _db.actItems.Where(o => (int?)o.category==(int)Model.activity.category.Patronize);//贊助項目
|
||||||
qry = qry.Where(o => (int?)o.category==(int)Model.activity.category.Patronize);//贊助項目
|
qry = qry.OrderByDescending(o => o.num);
|
||||||
qry = qry.OrderByDescending(o => o.num).ToList();
|
|
||||||
if(qry.Count() > 0)
|
if(qry.Count() > 0)
|
||||||
foreach(var qq in qry)
|
foreach(var qq in qry)
|
||||||
s_actItem_num.Items.Add(new ListItem(qq.subject, qq.num.ToString()));
|
s_actItem_num.Items.Add(new ListItem(qq.subject, qq.num.ToString()));
|
||||||
@@ -99,7 +98,7 @@ public partial class admin_project_list : MyWeb.config
|
|||||||
sd.AppendChild(tr);
|
sd.AppendChild(tr);
|
||||||
|
|
||||||
//查詢要匯出的資料
|
//查詢要匯出的資料
|
||||||
var qry = _db.pro_order_detail.AsEnumerable();
|
var qry = _db.pro_order_detail.AsQueryable();
|
||||||
qry = qry.Where(o => (int?)o.actItem.category == (int)Model.activity.category.Patronize);
|
qry = qry.Where(o => (int?)o.actItem.category == (int)Model.activity.category.Patronize);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(s_f_num.Value))
|
if (!string.IsNullOrEmpty(s_f_num.Value))
|
||||||
@@ -111,7 +110,8 @@ public partial class admin_project_list : MyWeb.config
|
|||||||
var list = qry.ToList();
|
var list = qry.ToList();
|
||||||
if (list.Count > 0)
|
if (list.Count > 0)
|
||||||
{
|
{
|
||||||
var projectDt = _db.projects.AsEnumerable(); //專案
|
// TODO: REVIEW - projects 資料量可能成長,若超過數千筆需優化為按需查詢
|
||||||
|
var projectDt = _db.projects.ToList(); //專案
|
||||||
foreach (var item in list)
|
foreach (var item in list)
|
||||||
{
|
{
|
||||||
var projects = from s in projectDt
|
var projects = from s in projectDt
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public partial class admin_stock_reason_reg : MyWeb.config
|
|||||||
if (!isStrNull(Request["num"]))
|
if (!isStrNull(Request["num"]))
|
||||||
{
|
{
|
||||||
int _num = Val(Request["num"]);
|
int _num = Val(Request["num"]);
|
||||||
var prod = _db.stock_reason.AsEnumerable().Where(q => q.num == _num).OrderBy(q => q.kind).FirstOrDefault();
|
var prod = _db.stock_reason.Where(q => q.num == _num).OrderBy(q => q.kind).FirstOrDefault();
|
||||||
|
|
||||||
if (prod != null)
|
if (prod != null)
|
||||||
{
|
{
|
||||||
@@ -221,7 +221,7 @@ public partial class admin_stock_reason_reg : MyWeb.config
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var prod = _db.stock_reason.AsEnumerable().Where(q => q.root == root).OrderByDescending(q => q.range).FirstOrDefault();
|
var prod = _db.stock_reason.Where(q => q.root == root).OrderByDescending(q => q.range).FirstOrDefault();
|
||||||
if (prod != null)
|
if (prod != null)
|
||||||
if (prod.range.HasValue)
|
if (prod.range.HasValue)
|
||||||
range = prod.range.Value + 1;
|
range = prod.range.Value + 1;
|
||||||
@@ -257,7 +257,7 @@ public partial class admin_stock_reason_reg : MyWeb.config
|
|||||||
{
|
{
|
||||||
|
|
||||||
int num = Val(Request["num"]);
|
int num = Val(Request["num"]);
|
||||||
var prod = _db.stock_reason.AsEnumerable().Where(q => q.num == num).FirstOrDefault(); //刪除該筆資料
|
var prod = _db.stock_reason.Where(q => q.num == num).FirstOrDefault(); //刪除該筆資料
|
||||||
if (prod != null)
|
if (prod != null)
|
||||||
{
|
{
|
||||||
_db.stock_reason.Remove(prod);
|
_db.stock_reason.Remove(prod);
|
||||||
@@ -275,7 +275,7 @@ public partial class admin_stock_reason_reg : MyWeb.config
|
|||||||
|
|
||||||
public void Del_Ohter_Items(int d_num)
|
public void Del_Ohter_Items(int d_num)
|
||||||
{
|
{
|
||||||
var prod = _db.stock_reason.AsEnumerable().Where(q => q.root == d_num).ToList();
|
var prod = _db.stock_reason.Where(q => q.root == d_num).ToList();
|
||||||
if (prod.Count > 0)
|
if (prod.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (var row in prod)
|
foreach (var row in prod)
|
||||||
|
|||||||
Reference in New Issue
Block a user