1 files deleted
4 files added
3 files renamed
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | |
| | | <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> |
| | | <session-factory> |
| | | <property name="connection.provider"> |
| | | NHibernate.Connection.DriverConnectionProvider |
| | | </property> |
| | | <property name="connection.driver_class"> |
| | | NHibernate.Driver.OracleClientDriver |
| | | </property> |
| | | <property name="connection.connection_string"> |
| | | <!--Server=(local);database=LocalDatabase;Integrated Security=SSPI;--> |
| | | </property> |
| | | <property name="dialect"> |
| | | NHibernate.Dialect.Oracle10gDialect |
| | | </property> |
| | | </session-factory> |
| | | </hibernate-configuration> |
New file |
| | |
| | | <StyleCopSettings Version="105" /> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Web; |
| | | using NHibernate; |
| | | using NHibernate.Cfg; |
| | | |
| | | namespace CCSTrace.CCS |
| | | { |
| | | public class NHibertnateSession |
| | | { |
| | | public static NHibertnateSession Instance { get; } = new NHibertnateSession(); |
| | | |
| | | private string _configurationPath = null; |
| | | private ISessionFactory _sessionFactory = null; |
| | | |
| | | public string ConfigurationPath |
| | | { |
| | | get { return _configurationPath; } |
| | | set { _configurationPath = value; } |
| | | } |
| | | |
| | | public ISessionFactory SessionFactory |
| | | { |
| | | get { return _sessionFactory; } |
| | | set { _sessionFactory = value; } |
| | | } |
| | | |
| | | public NHibertnateSession() |
| | | { |
| | | } |
| | | |
| | | public NHibertnateSession(string configurationPath) |
| | | { |
| | | _configurationPath = configurationPath; |
| | | } |
| | | |
| | | public void DefaultInitialize() |
| | | { |
| | | if (_configurationPath == null) |
| | | _configurationPath = HttpContext.Current.Server.MapPath(@"~\DMMSNHibernate.cfg.xml"); |
| | | var configuration = new Configuration(); |
| | | if (_configurationPath != null) |
| | | configuration.Configure(_configurationPath); |
| | | configuration.SetProperty("connection.connection_string", GlobalVariable.ConnectionString); |
| | | |
| | | configuration.AddAssembly("CCSTrace"); |
| | | /* |
| | | var mappingConfigurationFile = HttpContext.Current.Server.MapPath(@"~\TPower\DMMS\Model\ADDRCONTRAST.hbm.xml"); |
| | | configuration.AddFile(mappingConfigurationFile); |
| | | */ |
| | | _sessionFactory = configuration.BuildSessionFactory(); |
| | | } |
| | | |
| | | |
| | | public ISession OpenSession() |
| | | { |
| | | return _sessionFactory?.OpenSession(); |
| | | } |
| | | public ISession OpenSession(IDbConnection connection) |
| | | { |
| | | return _sessionFactory?.OpenSession(connection); |
| | | } |
| | | } |
| | | } |
File was renamed from CCSTrace/CCS/Object/EventQuery.cs |
| | |
| | |
|
| | | namespace CCSTrace.CCS.Object
|
| | | {
|
| | | public class EventQuery
|
| | | public class CCSEventQuery |
| | | {
|
| | | private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
| | |
|
| | |
| | | if (Meter == null)
|
| | | {
|
| | | sqlStmt =
|
| | | "INSERT INTO CCS.EVENTQUERY (CCSID,CASESTATUS,CHANGETIME,ASSUMEDTIME,ASSUMEDTIME_NTH,DELAYTIMES,REASON,INPUTTIME) values(" +
|
| | | "INSERT INTO CCS.EVENTQUERY " + |
| | | "(CCSID,CASESTATUS,CHANGETIME,ASSUMEDTIME,ASSUMEDTIME_NTH,DELAYTIMES,REASON,INPUTTIME) " + |
| | | "VALUES (" + |
| | | "'" + CcsId
|
| | | + "'," + CaseStatus + ",to_date('" + ChangeTime + "','yyyy/mm/dd hh24:mi:ss'),to_date('"
|
| | | + AssumedTime + "','yyyy/mm/dd hh24:mi:ss'),to_date('" + AssumedTimeNth +
|
| | |
| | | public bool UpdateCaseStatus(OracleConnection conn, OracleTransaction transaction)
|
| | | {
|
| | | var sqlStmt = "UPDATE CCS.EVENTQUERY SET CASESTATUS = " + CaseStatus + " WHERE CCSID = '" + CcsId + "'";
|
| | |
|
| | | var command = new OracleCommand(sqlStmt, conn, transaction);
|
| | |
|
| | | try
|
File was renamed from CCSTrace/CCS/Object/CCSRecord.cs |
| | |
| | |
|
| | | namespace CCSTrace.CCS.Object
|
| | | {
|
| | | public class CcsRecord
|
| | | public class CCSEventRecord |
| | | {
|
| | | private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
| | |
|
| | |
| | | private readonly int _partHicustomer;
|
| | | private readonly string _note;
|
| | |
|
| | | public CcsRecord(string ccsid, string meter, string customername, string customertel, string addrCity, string addrTown, string addrRoad,
|
| | | public CCSEventRecord(string ccsid, string meter, string customername, string customertel, string addrCity, string addrTown, string addrRoad, |
| | | string addrOther, string recallname, string recalltel, int eventbrief, string accepttime, int importcase, string dept,
|
| | | int partHicustomer, string note)
|
| | | {
|
| | |
| | | _acceptTime = accepttime;
|
| | | }
|
| | |
|
| | | public CcsRecord(string ccsid, OracleConnection connectionTpc)
|
| | | public CCSEventRecord(string ccsid, OracleConnection connectionTpc) |
| | | {
|
| | | var sqlStmt = "SELECT METER,CUSTOMERNAME,CUSTOMERTEL,ADDR_CITY,ADDR_TOWN,ADDR_ROAD,ADDR_OTHER,RECALLNAME,RECALLTEL,EVENTBRIEF,"
|
| | | + "TO_CHAR(ACCEPTTIME,'YYYY/MM/DD HH24:MI:SS') as ACCEPTTIME,CCSID,IMPORTCASE,DEPT,PARTHICUSTOMER,NOTE FROM CCS.EVENTRECORD "
|
| | | + "WHERE CCSID = '" + ccsid + "'";
|
| | | var sqlStmt = "SELECT METER,CUSTOMERNAME,CUSTOMERTEL,ADDR_CITY,ADDR_TOWN,ADDR_ROAD,ADDR_OTHER,RECALLNAME,RECALLTEL,EVENTBRIEF," + |
| | | "TO_CHAR(ACCEPTTIME,'YYYY/MM/DD HH24:MI:SS') AS ACCEPTTIME,CCSID,IMPORTCASE,DEPT,PARTHICUSTOMER,NOTE " + |
| | | "FROM CCS.EVENTRECORD WHERE CCSID = '" + ccsid + "'"; |
| | |
|
| | | OracleCommand command = new OracleCommand(sqlStmt, connectionTpc);
|
| | | OracleDataReader reader = command.ExecuteReader();
|
File was renamed from CCSTrace/CCS/Object/EventRecord.cs |
| | |
| | |
|
| | | namespace CCSTrace.CCS.Object
|
| | | {
|
| | | public class EventRecord
|
| | | public class EOSEventRecord |
| | | {
|
| | | private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
| | | //private CCS.Function.TransferDate Convert = new CCS.Function.TransferDate();
|
| | |
|
| | | public EventRecord(int mCaseId, OracleConnection conn, OracleTransaction trx)
|
| | | public EOSEventRecord(int mCaseId, OracleConnection conn, OracleTransaction trx) |
| | | {
|
| | | CaseId = mCaseId;
|
| | | LocateEquipment = new LocateEquipment(CaseId, false, conn, trx);
|
| | |
| | | IsDespatched = mDespatched;
|
| | | }
|
| | |
|
| | | public string GetSqlStmt()
|
| | | public string GetInsertSqlStmt() |
| | | {
|
| | | var sqlStmt = "INSERT INTO EOS.EVENTRECORD VALUES (" + CaseId + ",'" + Name + "','" + Meter + "','" + Tel +
|
| | | "','" + Addr + "','" + Brief + "'," + Dept + ",'" + Log + "','" + AcceptNum + "',to_date('"
|
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8" ?> |
| | | <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> |
| | | <session-factory> |
| | | <property name="connection.provider"> |
| | | NHibernate.Connection.DriverConnectionProvider |
| | | </property> |
| | | <property name="connection.driver_class"> |
| | | NHibernate.Driver.OracleClientDriver |
| | | </property> |
| | | <!--property name="connection.connection_string"> |
| | | Server=(local);database=LocalDatabase;Integrated Security=SSPI; |
| | | </--> |
| | | <property name="dialect"> |
| | | NHibernate.Dialect.Oracle10gDialect |
| | | </property> |
| | | </session-factory> |
| | | </hibernate-configuration> |