|
|
@@ -1954,14 +1954,16 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
if (Id > 0)
|
|
|
{
|
|
|
- DataTable dt = OtherMySqlConn.dtable("select Id,(select count(Id) from PosMachinesTwo where StoreId=s.Id and BuyUserId=0 and PreUserId=0 and Status>-1) as CurLaveNum from StoreHouse s where Id=" + Id);
|
|
|
+ DataTable dt = OtherMySqlConn.dtable("select Id,(select count(Id) from PosMachinesTwo where StoreId=s.Id and BuyUserId=0 and PreUserId=0 and Status>-1) as CurLaveNum,(select sum(ApplyDeviceNum) from MachineApply where StoreId=s.Id and Status=0) as ApplyNum from StoreHouse s where Id=" + Id);
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
int CurLaveNum = int.Parse(function.CheckInt(dt.Rows[0]["CurLaveNum"].ToString()));
|
|
|
+ int ApplyNum = int.Parse(function.CheckInt(dt.Rows[0]["ApplyNum"].ToString()));
|
|
|
StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == Id);
|
|
|
if (store != null)
|
|
|
{
|
|
|
store.LaveNum = CurLaveNum;
|
|
|
+ store.ApplyNum = ApplyNum;
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
}
|