Просмотр исходного кода

重置仓库已申请未发货数量

lcl 1 год назад
Родитель
Сommit
8ee9dc16fe
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      Areas/Admin/Controllers/MainServer/StoreHouseController.cs

+ 3 - 1
Areas/Admin/Controllers/MainServer/StoreHouseController.cs

@@ -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();
                     }
                 }