From 31dbf9289bb067a40b514250f02b93d00a3fde12 Mon Sep 17 00:00:00 2001 From: b110212000 Date: Fri, 25 Jun 2021 10:50:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A8=88=E7=95=AB=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implement/OperationRepository.cs | 27 +- SolarPower/Views/Operation/Index.cshtml | 301 +++++++++++++----- 2 files changed, 233 insertions(+), 95 deletions(-) diff --git a/SolarPower/Repository/Implement/OperationRepository.cs b/SolarPower/Repository/Implement/OperationRepository.cs index f0d0a99..c708a72 100644 --- a/SolarPower/Repository/Implement/OperationRepository.cs +++ b/SolarPower/Repository/Implement/OperationRepository.cs @@ -63,19 +63,28 @@ namespace SolarPower.Repository.Implement List result; var count = 0; string Wheresql = "oc.PowerStationId = "; - foreach (int too in id) + if( id != null) { + foreach (int too in id) + { - if(count == id.Count-1) - { - Wheresql += too.ToString(); + if (count == id.Count - 1) + { + Wheresql += too.ToString(); + } + else + { + Wheresql += too.ToString() + " OR oc.PowerStationId = "; + } + count++; } - else - { - Wheresql += too.ToString() + " OR oc.PowerStationId = "; - } - count++; + } + else + { + Wheresql += "0"; + } + using (IDbConnection conn = this._databaseHelper.GetConnection()) { try diff --git a/SolarPower/Views/Operation/Index.cshtml b/SolarPower/Views/Operation/Index.cshtml index 13a9265..4234459 100644 --- a/SolarPower/Views/Operation/Index.cshtml +++ b/SolarPower/Views/Operation/Index.cshtml @@ -36,7 +36,7 @@
- +
@@ -69,34 +53,11 @@
- +
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
+
+
@@ -145,17 +106,6 @@ - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 -
@@ -179,14 +129,14 @@