STAGE 3-3
This commit is contained in:
@@ -46,7 +46,7 @@ public partial class admin_hr_index2 : MyWeb.config
|
||||
s_mem_num.Items.Add(new ListItem("", ""));
|
||||
s_kind.Items.Clear();
|
||||
s_kind.Items.Add(new ListItem("", ""));
|
||||
var qry = _db.members.AsEnumerable();
|
||||
var qry = _db.members.AsQueryable();
|
||||
|
||||
foreach (Model.member item in qry)
|
||||
s_mem_num.Items.Add(new ListItem(item.u_name, item.num.ToString()));
|
||||
@@ -121,7 +121,7 @@ public partial class admin_hr_index2 : MyWeb.config
|
||||
sd.AppendChild(tr);
|
||||
|
||||
//查詢要匯出的資料
|
||||
var qry = _db.member_check.AsEnumerable();
|
||||
var qry = _db.member_check.AsQueryable();
|
||||
|
||||
if (!string.IsNullOrEmpty(u_name.Value))
|
||||
qry = qry.Where(o => o.member.u_name.Contains(u_name.Value));
|
||||
|
||||
@@ -104,9 +104,9 @@ public partial class admin_activity_index2 : MyWeb.config
|
||||
sd.AppendChild(tr);
|
||||
|
||||
//查詢要匯出的資料
|
||||
var fileDt = _db.files.AsEnumerable().Where(f => f.subject.Contains(fileTxt.Value)).Select(f => f.num.ToString());//文件
|
||||
var fileDt = _db.files.Where(f => f.subject.Contains(fileTxt.Value)).Select(f => f.num.ToString());//文件
|
||||
|
||||
var qry = _db.actItems.AsEnumerable();
|
||||
var qry = _db.actItems.AsQueryable();
|
||||
|
||||
//每個品項在每個倉庫的結餘量
|
||||
var stockDt = (
|
||||
|
||||
@@ -405,7 +405,7 @@ public partial class admin_follower_reg : MyWeb.config
|
||||
protected bool chk_pro_num(string txt, int num = 0)
|
||||
{
|
||||
bool success = false;
|
||||
var qry = _db.followers.AsEnumerable();
|
||||
var qry = _db.followers.AsQueryable();
|
||||
qry = qry.Where(q => q.f_number == txt);
|
||||
if (num > 0)
|
||||
qry = qry.Where(q => q.num != num);
|
||||
|
||||
@@ -28,7 +28,7 @@ public partial class admin_news__reg : MyWeb.config
|
||||
else
|
||||
{
|
||||
int _num = Val(Request["num"]);
|
||||
var qry = _db.news.AsEnumerable();
|
||||
var qry = _db.news.AsQueryable();
|
||||
var prod = qry.Where(q => q.num == _num).FirstOrDefault();
|
||||
|
||||
if (prod != null)
|
||||
@@ -54,7 +54,7 @@ public partial class admin_news__reg : MyWeb.config
|
||||
|
||||
|
||||
//檔案
|
||||
var qry2 = _db.news_files.AsEnumerable();
|
||||
var qry2 = _db.news_files.AsQueryable();
|
||||
var prod2 = qry2.Where(q => q.news_id == _num).ToList();
|
||||
Repeater1.DataSource = prod2;
|
||||
Repeater1.DataBind();
|
||||
|
||||
@@ -46,10 +46,10 @@ public partial class admin_print_exportExcel : MyWeb.function
|
||||
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
|
||||
{
|
||||
int _detail = (int)e.Item.DataItem;
|
||||
var orderItem = _db.pro_order_detail.AsEnumerable().Where(q => q.num == _detail).FirstOrDefault();
|
||||
var orderItem = _db.pro_order_detail.Where(q => q.num == _detail).FirstOrDefault();
|
||||
|
||||
int _num = Convert.ToInt32(Request["file"]);
|
||||
var qry = _db.files.AsEnumerable();
|
||||
var qry = _db.files.AsQueryable();
|
||||
var prod = qry.Where(q => q.num == _num).FirstOrDefault();
|
||||
if (prod != null && orderItem != null)
|
||||
{
|
||||
|
||||
@@ -27,10 +27,10 @@ public partial class admin_order_print : MyWeb.function
|
||||
if (!isStrNull(Request["num"]) && !isStrNull(Request["detail"]))
|
||||
{
|
||||
int _detail = Val(Request["detail"]);
|
||||
var orderItem = _db.pro_order_detail.AsEnumerable().Where(q => q.num == _detail).FirstOrDefault();
|
||||
var orderItem = _db.pro_order_detail.Where(q => q.num == _detail).FirstOrDefault();
|
||||
|
||||
int _num = Val(Request["num"]);
|
||||
var qry = _db.files.AsEnumerable();
|
||||
var qry = _db.files.AsQueryable();
|
||||
var prod = qry.Where(q => q.num == _num).FirstOrDefault();
|
||||
if (prod != null && orderItem !=null)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ public partial class admin_print_print_multi : MyWeb.function
|
||||
var orderItem = _db.pro_order_detail.Where(q => q.num == _detail).FirstOrDefault();
|
||||
|
||||
int _num = Convert.ToInt32(Request["file"]);
|
||||
var qry = _db.files.AsEnumerable();
|
||||
var qry = _db.files.AsQueryable();
|
||||
var prod = qry.Where(q => q.num == _num).FirstOrDefault();
|
||||
if (prod != null && orderItem != null)
|
||||
{
|
||||
|
||||
@@ -68,7 +68,7 @@ public partial class admin_printpw_index : MyWeb.function
|
||||
}
|
||||
}
|
||||
|
||||
var qry = _db.files.AsEnumerable();
|
||||
var qry = _db.files.AsQueryable();
|
||||
var prod = qry.Where(q => q.num == _num).FirstOrDefault();
|
||||
if (prod != null && orderItem != null)
|
||||
{
|
||||
|
||||
@@ -27,10 +27,10 @@ public partial class admin_order_print : MyWeb.function
|
||||
if (!isStrNull(Request["num"]) && !isStrNull(Request["detail"]))
|
||||
{
|
||||
int _detail = Val(Request["detail"]);
|
||||
var orderItem = _db.pro_order_detail.AsEnumerable().Where(q => q.num == _detail).FirstOrDefault();
|
||||
var orderItem = _db.pro_order_detail.Where(q => q.num == _detail).FirstOrDefault();
|
||||
|
||||
int _num = Val(Request["num"]);
|
||||
var qry = _db.files.AsEnumerable();
|
||||
var qry = _db.files.AsQueryable();
|
||||
var prod = qry.Where(q => q.num == _num).FirstOrDefault();
|
||||
if (prod != null && orderItem !=null)
|
||||
{
|
||||
|
||||
@@ -54,9 +54,8 @@ public partial class admin_project_index : MyWeb.config
|
||||
//品項
|
||||
s_actItem_num.Items.Clear();
|
||||
s_actItem_num.Items.Add(new ListItem("請選擇", ""));
|
||||
var qry = _db.actItems.AsEnumerable();
|
||||
qry = qry.Where(o => (int?)o.category==(int)Model.activity.category.Patronize);//贊助項目
|
||||
qry = qry.OrderByDescending(o => o.num).ToList();
|
||||
var qry = _db.actItems.Where(o => (int?)o.category==(int)Model.activity.category.Patronize);//贊助項目
|
||||
qry = qry.OrderByDescending(o => o.num);
|
||||
if(qry.Count() > 0)
|
||||
foreach(var qq in qry)
|
||||
s_actItem_num.Items.Add(new ListItem(qq.subject, qq.num.ToString()));
|
||||
@@ -113,7 +112,7 @@ public partial class admin_project_index : MyWeb.config
|
||||
sd.AppendChild(tr);
|
||||
|
||||
//查詢要匯出的資料
|
||||
var qry = _db.projects.AsEnumerable();
|
||||
var qry = _db.projects.AsQueryable();
|
||||
|
||||
if (!string.IsNullOrEmpty(subject.Value))
|
||||
qry = qry.Where(o => o.subject.Contains(subject.Value.Trim()));
|
||||
|
||||
@@ -57,9 +57,8 @@ public partial class admin_stock_index : MyWeb.config
|
||||
//品項
|
||||
s_actItem_num.Items.Clear();
|
||||
s_actItem_num.Items.Add(new ListItem("請選擇", ""));
|
||||
var qry = _db.actItems.AsEnumerable();
|
||||
qry = qry.Where(o => (int?)o.category == (int)Model.activity.category.Spares);//備品項目
|
||||
qry = qry.OrderByDescending(o => o.num).ToList();
|
||||
var qry = _db.actItems.Where(o => (int?)o.category == (int)Model.activity.category.Spares);//備品項目
|
||||
qry = qry.OrderByDescending(o => o.num);
|
||||
if (qry.Count() > 0)
|
||||
foreach (var qq in qry)
|
||||
s_actItem_num.Items.Add(new ListItem(qq.subject, qq.num.ToString()));
|
||||
@@ -69,8 +68,7 @@ public partial class admin_stock_index : MyWeb.config
|
||||
//活動
|
||||
s_activity_num.Items.Clear();
|
||||
s_activity_num.Items.Add(new ListItem("請選擇", ""));
|
||||
var qry2 = _db.activities.AsEnumerable();
|
||||
qry2 = qry2.OrderByDescending(o => o.num).ToList();
|
||||
var qry2 = _db.activities.OrderByDescending(o => o.num);
|
||||
if (qry2.Count() > 0)
|
||||
foreach (var qq in qry2)
|
||||
s_activity_num.Items.Add(new ListItem(qq.subject, qq.num.ToString()));
|
||||
@@ -132,7 +130,7 @@ public partial class admin_stock_index : MyWeb.config
|
||||
sd.AppendChild(tr);
|
||||
|
||||
//查詢要匯出的資料
|
||||
var qry = _db.stocks.AsEnumerable();
|
||||
var qry = _db.stocks.AsQueryable();
|
||||
|
||||
if (!string.IsNullOrEmpty(uptime1.Value))
|
||||
qry = qry.Where(o => o.uptime >= Convert.ToDateTime( uptime1.Value));
|
||||
@@ -143,7 +141,7 @@ public partial class admin_stock_index : MyWeb.config
|
||||
if (!string.IsNullOrEmpty(s_kind.SelectedValue))
|
||||
qry = qry.Where(o => o.kind == Convert.ToInt32(s_kind.SelectedValue));
|
||||
if (!string.IsNullOrEmpty(activity_num_txt.Value))
|
||||
qry = qry.Where(o => o.activity_num.HasValue && o.activity.subject.Contains(activity_num_txt.Value?.Trim()));
|
||||
qry = qry.Where(o => o.activity_num.HasValue && o.activity.subject.Contains(activity_num_txt.Value.Trim()));
|
||||
if (!string.IsNullOrEmpty(s_activity_num.SelectedValue))
|
||||
qry = qry.Where(o => o.activity_num == Convert.ToInt32(s_activity_num.SelectedValue));
|
||||
if (!string.IsNullOrEmpty(s_actItem_num.SelectedValue))
|
||||
|
||||
Reference in New Issue
Block a user