This commit is contained in:
2025-11-12 18:18:01 +08:00
parent d41ad3e4cc
commit 8b8869fbde
5 changed files with 10 additions and 11 deletions

View File

@@ -35,7 +35,7 @@ public partial class admin_stock_new_reg : MyWeb.config
else
{
int _num = Val(Request["num"]);
var qry = _db.stocks.AsEnumerable();
var qry = _db.stocks.AsQueryable();
var prod = qry.Where(q => q.num == _num).FirstOrDefault();
if (prod != null)
{
@@ -315,7 +315,7 @@ public partial class admin_stock_new_reg : MyWeb.config
int _type = Val(category.SelectedValue);
var qry = _db.stocks.AsEnumerable();
var qry = _db.stocks.AsQueryable();
qry = qry.Where(o => o.actItem_num == item_id);
qry = qry.Where(o => o.kind == Convert.ToInt32(kind.Value));
@@ -376,8 +376,7 @@ public partial class admin_stock_new_reg : MyWeb.config
protected int getFinalStock(int actItem , int kind,bool rent=false)
{
int _fq = 0;
var qry = _db.stocks.AsEnumerable()
.Where(q => q.kind == kind) //同倉庫
var qry = _db.stocks.Where(q => q.kind == kind) //同倉庫
.Where(q => q.actItem_num == actItem) //同品項
.OrderByDescending(q => q.num).FirstOrDefault();
if (qry != null)