From d95916da8f811650c930b96b6758b70a3d5fe94a Mon Sep 17 00:00:00 2001
From: hank <hank@7fafa455-2d8e-8247-9248-17d0fe17a33f>
Date: Mon, 24 Aug 2015 11:05:36 +0800
Subject: [PATCH] CT-2 基隆事故案件號碼超過上限

---
 CCSTrace/Properties/AssemblyInfo.cs       |    4 ++--
 CCSTrace/CCS/Function/InitialEventData.cs |    6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/CCSTrace/CCS/Function/InitialEventData.cs b/CCSTrace/CCS/Function/InitialEventData.cs
index e7ee53d..ccd77e6 100644
--- a/CCSTrace/CCS/Function/InitialEventData.cs
+++ b/CCSTrace/CCS/Function/InitialEventData.cs
@@ -18,6 +18,7 @@
         private int m_CaseID = 0;
         private int m_Year = 0;
         private bool m_ChangeYear = false;
+        private string m_NowYear = string.Empty;
         private String m_AcceptTime = "";
         private RecordLog _PLog;
         private OracleConnection _ConnectionTPC;
@@ -83,10 +84,10 @@
 
             if (m_ChangeYear)
                 SqlStmt = "UPDATE EOS.EVENTNUM SET ACCEPTNUM = '" + (Convert.ToInt32(m_AcceptNum) + 1).ToString() + "',CASEID = "
-                        + (m_CaseID + 1) + ",YEAR = " + (m_Year + 1) + " WHERE CASEID = " + this.m_CaseID;
+                        + (m_CaseID + 1) + ",YEAR = " + m_NowYear + " WHERE CASEID = " + this.m_CaseID;
             else
                 SqlStmt = "UPDATE EOS.EVENTNUM SET ACCEPTNUM = '" + (Convert.ToInt32(m_AcceptNum) + 1).ToString() + "',CASEID = "
-                        + (m_CaseID + 1) + " WHERE CASEID = " + this.m_CaseID;
+                        + (m_CaseID + 1) + " WHERE CASEID = " + this.m_CaseID + " AND ACCEPTNUM = '" + m_AcceptNum + "'";
 
             OracleCommand Command = new OracleCommand(SqlStmt, _ConnectionTPC);
             
@@ -126,6 +127,7 @@
                 }
             } else {
                 m_AcceptNum = NowYear.ToString() + "010001"; // 新年度
+                m_NowYear = NowYear.ToString();
                 this.m_ChangeYear = true;
             }
 
diff --git a/CCSTrace/Properties/AssemblyInfo.cs b/CCSTrace/Properties/AssemblyInfo.cs
index 91f5143..7977463 100644
--- a/CCSTrace/Properties/AssemblyInfo.cs
+++ b/CCSTrace/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@
 //
 // You can specify all the values or you can default the Revision and Build Numbers 
 // by using the '*' as shown below:
-[assembly: AssemblyVersion("5.1.0.0")]
-[assembly: AssemblyFileVersion("5.1.0.0")]
+[assembly: AssemblyVersion("5.2.0.0")]
+[assembly: AssemblyFileVersion("5.2.0.0")]

--
Gitblit v0.0.0-SNAPSHOT