From b0c18d369abd06075c83759b0e19823c2a11d716 Mon Sep 17 00:00:00 2001
From: ulysseskao <ulysseskao@gmail.com>
Date: Fri, 29 Apr 2016 18:45:41 +0800
Subject: [PATCH] update for new model

---
 CCSTrace/CCS/Object/LocateEquipment.cs |  119 +++++++++++++++++++++++++++--------------------------------
 1 files changed, 54 insertions(+), 65 deletions(-)

diff --git a/CCSTrace/CCS/Object/LocateEquipment.cs b/CCSTrace/CCS/Object/LocateEquipment.cs
index f3172c3..6a42b71 100644
--- a/CCSTrace/CCS/Object/LocateEquipment.cs
+++ b/CCSTrace/CCS/Object/LocateEquipment.cs
@@ -1,12 +1,4 @@
 using System;
-using System.Data;
-using System.Configuration;
-using System.Web;
-using System.Web.Security;
-using System.Web.UI;
-using System.Web.UI.HtmlControls;
-using System.Web.UI.WebControls;
-using System.Web.UI.WebControls.WebParts;
 
 using System.Data.OracleClient;
 
@@ -14,52 +6,49 @@
 {
     public class LocateEquipment
     {
-        private int CaseID = 0;
-        private int DSUfid = -1;
-        private int Fsc = 0;
-        private int Ufid = 0;
-        private String FDR = "";
-        private String TPCLID = "";
+        private int _caseId = 0;
+        private int _dsUfid = -1;
+        private int _fsc = 0;
+        private int _ufid = 0;
+        private string _fdr = "";
+        private string _tpclid = "";
 
-        public LocateEquipment(int m_CaseID, bool hasData,OracleConnection _Conn, OracleTransaction _Transaction)
+        public LocateEquipment(int mCaseId, bool hasData, OracleConnection conn, OracleTransaction transaction)
         {
-            String SqlStmt;
-            OracleCommand Command = null;
+            string sqlStmt;
+            OracleCommand command = null;
             OracleDataReader reader = null;
 
-            this.setCaseID(m_CaseID);
+            SetCaseId(mCaseId);
 
             try
             {
                 if (hasData)
                 {
-                    SqlStmt = "SELECT DSUFID,FSC,UFID,FDR,TPCLID FROM EOS.EVENTRECORD_EX WHERE CASEID = " + m_CaseID;
+                    sqlStmt = "SELECT DSUFID,FSC,UFID,FDR,TPCLID FROM EOS.EVENTRECORD_EX WHERE CASEID = " + mCaseId;
 
-                    Command = new OracleCommand(SqlStmt, _Conn, _Transaction);
-                    reader = Command.ExecuteReader();
+                    command = new OracleCommand(sqlStmt, conn, transaction);
+                    reader = command.ExecuteReader();
 
                     if (reader.Read())
                     {
-                        this.setDSUFID(Convert.ToInt32(reader["DSUFID"].ToString()));
-                        this.setFSC(Convert.ToInt32(reader["FSC"].ToString()));
-                        this.setUFID(Convert.ToInt32(reader["UFID"].ToString()));
-                        this.setFDR(reader["FDR"].ToString());
-                        this.setTPCLID(reader["TPCLID"].ToString());
+                        SetDsufid(Convert.ToInt32(reader["DSUFID"].ToString()));
+                        SetFsc(Convert.ToInt32(reader["FSC"].ToString()));
+                        SetUfid(Convert.ToInt32(reader["UFID"].ToString()));
+                        SetFdr(reader["FDR"].ToString());
+                        SetTpclid(reader["TPCLID"].ToString());
                     }
-
-
                 }
                 else
                 {
-                    SqlStmt = "SELECT UFID FROM EOS.DISASTER_EX WHERE ISDISASTER = " + CCS.LocalVariable.isDisaster;
+                    sqlStmt = "SELECT UFID FROM EOS.DISASTER_EX WHERE ISDISASTER = " + GlobalVariable.IsDisaster;
 
-                    Command = new OracleCommand(SqlStmt, _Conn, _Transaction);
-                    reader = Command.ExecuteReader();
+                    command = new OracleCommand(sqlStmt, conn, transaction);
+                    reader = command.ExecuteReader();
 
                     if (reader.Read())
-                        this.setDSUFID(Convert.ToInt32(reader["UFID"].ToString()));
+                        SetDsufid(Convert.ToInt32(reader["UFID"].ToString()));
                 }
-
             }
             catch (Exception e)
             {
@@ -67,79 +56,79 @@
                 Console.WriteLine(e.StackTrace);
             }
             finally
-            { 
+            {
                 reader.Close();
-                Command.Dispose();
+                command.Dispose();
             }
         }
 
-        public int getCaseID()
+        public int GetCaseId()
         {
-            return this.CaseID;
+            return _caseId;
         }
 
-        public void setCaseID(int m_CaseID)
+        public void SetCaseId(int mCaseId)
         {
-            this.CaseID = m_CaseID;
+            _caseId = mCaseId;
         }
 
-        public int getDSUFID()
+        public int GetDsufid()
         {
-            return this.DSUfid;
+            return _dsUfid;
         }
 
-        public void setDSUFID(int m_DSUfid)
+        public void SetDsufid(int mDsUfid)
         {
-            this.DSUfid = m_DSUfid;
+            _dsUfid = mDsUfid;
         }
 
-        public int getFSC()
+        public int GetFsc()
         {
-            return this.Fsc;
+            return _fsc;
         }
 
-        public void setFSC(int m_FSC)
+        public void SetFsc(int mFsc)
         {
-            this.Fsc = m_FSC;
+            _fsc = mFsc;
         }
 
-        public int getUFID()
+        public int GetUfid()
         {
-            return this.Ufid;
+            return _ufid;
         }
 
-        public void setUFID(int m_UFID)
+        public void SetUfid(int mUfid)
         {
-            this.Ufid = m_UFID;
+            _ufid = mUfid;
         }
 
-        public String getFDR()
+        public string GetFdr()
         {
-            return this.FDR;
+            return _fdr;
         }
 
-        public void setFDR(String m_FDR)
+        public void SetFdr(string mFdr)
         {
-            this.FDR = m_FDR;
+            _fdr = mFdr;
         }
 
-        public String getTPCLID()
+        public string GetTpclid()
         {
-            return this.TPCLID;
+            return _tpclid;
         }
 
-        public void setTPCLID(String m_TPCLID)
+        public void SetTpclid(string mTpclid)
         {
-            this.TPCLID = m_TPCLID;
+            _tpclid = mTpclid;
         }
 
-        public String getSqlStmt()
+        public string GetSqlStmt()
         {
-            String SqlStmt;
+            string sqlStmt;
 
-            SqlStmt = "INSERT INTO EOS.EVENTRECORD_EX (CASEID,DSUFID,FSC,UFID,TPCLID,FDR) VALUES(" + getCaseID() + "," + getDSUFID() + "," + getFSC()
-                    + "," + getUFID() + ",'" + getTPCLID() + "','" + getFDR() + "')";
-            return SqlStmt;
+            sqlStmt = "INSERT INTO EOS.EVENTRECORD_EX (CASEID,DSUFID,FSC,UFID,TPCLID,FDR) VALUES(" + GetCaseId() + "," + GetDsufid() + "," + GetFsc()
+                    + "," + GetUfid() + ",'" + GetTpclid() + "','" + GetFdr() + "')";
+            return sqlStmt;
         }
 
         //public String getUpdateSqlStmt()
@@ -152,4 +141,4 @@
         //    return SqlStmt;
         //}
     }
-}
+}
\ No newline at end of file

--
Gitblit v0.0.0-SNAPSHOT