リビジョン 23
MySQL対応
CreateConstructionList.csは対象外
branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsCalendar.cs | ||
---|---|---|
77 | 77 |
int Holidays = 0; |
78 | 78 |
|
79 | 79 |
string strSQL = "SELECT COUNT(*) FROM HOLIDAYCALENDERMASTER"; |
80 |
strSQL += string.Format(" WHERE TO_DATE('{0}','YYYY/MM/DD') <= HOLIDAY", Startdate.ToShortDateString());
|
|
81 |
strSQL += string.Format(" AND HOLIDAY <= TO_DATE('{0}','YYYY/MM/DD')", Complatedate.ToShortDateString());
|
|
80 |
strSQL += string.Format(" WHERE DATE_FORMAT('{0}','%Y/%m/%d') <= HOLIDAY", Startdate.ToShortDateString());
|
|
81 |
strSQL += string.Format(" AND HOLIDAY <= DATE_FORMAT('{0}','%Y/%m/%d')", Complatedate.ToShortDateString());
|
|
82 | 82 |
|
83 | 83 |
ArrayList datalist = new ArrayList(); |
84 | 84 |
if (!calDB.ExecuteReader(strSQL, ref datalist)) return 0; |
branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsChangeLedgerData.cs | ||
---|---|---|
87 | 87 |
, GetConstructionLedgerGroupNo((int)CommonDefine.CostDataNo.Lease) |
88 | 88 |
, GetConstructionLedgerGroupNo((int)CommonDefine.CostDataNo.StoragePlace) |
89 | 89 |
, GetConstructionLedgerGroupNo((int)CommonDefine.CostDataNo.Lodging)); |
90 |
strDelSQL += string.Format(" AND TARGETMONTH = TO_DATE('{0}','YYYY/MM/DD')", (TargetMonth + "/01"));
|
|
90 |
strDelSQL += string.Format(" AND TARGETMONTH = DATE_FORMAT('{0}','%Y/%m/%d')", (TargetMonth + "/01"));
|
|
91 | 91 |
LedgerExcuteDB.ExecuteNonQuery(strDelSQL, false); |
92 | 92 |
|
93 | 93 |
for (int i = (int)CommonDefine.CostDataNo.Transport; i <= (int)CommonDefine.CostDataNo.Lodging; i++) |
94 | 94 |
{ |
95 |
string strSQL = "SELECT CONSTRUCTIONCODE, DATATYPE, TO_CHAR(ACTIONDATE,'YYYY/MM'), SUM(ENTRYPRICE) FROM COSTDATAOFPERSON";
|
|
96 |
strSQL += String.Format(" WHERE TO_CHAR(ACTIONDATE,'YYYY/MM') = '{0}'", TargetMonth);
|
|
95 |
string strSQL = "SELECT CONSTRUCTIONCODE, DATATYPE, DATE_FORMAT(ACTIONDATE,'%Y/%m'), SUM(ENTRYPRICE) FROM COSTDATAOFPERSON";
|
|
96 |
strSQL += String.Format(" WHERE DATE_FORMAT(ACTIONDATE,'%Y/%m') = '{0}'", TargetMonth);
|
|
97 | 97 |
strSQL += String.Format(" AND DATATYPE = {0}", i); |
98 | 98 |
strSQL += " AND CONSTRUCTIONCODE IN (SELECT CONSTRUCTIONCODE FROM CONSTRUCTIONBASEINFO"; |
99 | 99 |
strSQL += string.Format(" WHERE (SALESPERSONCODE = {0} OR CONSTRUCTIONPERSONCODE = {0} OR CONSTRSUBPERSONCODE = {0} OR CONSTRUCTIONINSTRUCTOR = {0}))", PersonCode); |
100 |
strSQL += " GROUP BY CONSTRUCTIONCODE, DATATYPE, TO_CHAR(ACTIONDATE,'YYYY/MM')";
|
|
100 |
strSQL += " GROUP BY CONSTRUCTIONCODE, DATATYPE, DATE_FORMAT(ACTIONDATE,'%Y/%m')";
|
|
101 | 101 |
strSQL += " ORDER BY CONSTRUCTIONCODE, DATATYPE"; |
102 | 102 |
ArrayList arList = new ArrayList(); |
103 | 103 |
if (!CostDB.ExecuteReader(strSQL, ref arList, false)) continue; |
... | ... | |
276 | 276 |
FrmConstructionLedger frm = new FrmConstructionLedger(); |
277 | 277 |
try |
278 | 278 |
{ |
279 |
string strSQL = "SELECT PERSONCODE, TO_CHAR(ACTIONDATE,'YYYY/MM'), CONSTRUCTIONCODE FROM COSTDATAOFPERSON";
|
|
280 |
strSQL += String.Format(" WHERE PERSONCODE = {0} AND TO_CHAR(ACTIONDATE,'YYYY/MM') = '{1}'", PersonCode, TargetMonth);
|
|
281 |
strSQL += " GROUP BY PERSONCODE, TO_CHAR(ACTIONDATE,'YYYY/MM'), CONSTRUCTIONCODE";
|
|
279 |
string strSQL = "SELECT PERSONCODE, DATE_FORMAT(ACTIONDATE,'%Y/%m'), CONSTRUCTIONCODE FROM COSTDATAOFPERSON";
|
|
280 |
strSQL += String.Format(" WHERE PERSONCODE = {0} AND DATE_FORMAT(ACTIONDATE,'%Y/%m') = '{1}'", PersonCode, TargetMonth);
|
|
281 |
strSQL += " GROUP BY PERSONCODE, DATE_FORMAT(ACTIONDATE,'%Y/%m'), CONSTRUCTIONCODE";
|
|
282 | 282 |
strSQL += " ORDER BY CONSTRUCTIONCODE"; |
283 | 283 |
|
284 | 284 |
ArrayList arList = new ArrayList(); |
... | ... | |
750 | 750 |
{ |
751 | 751 |
// キー作成 |
752 | 752 |
string strSQL = LedgerExDB.CreatePrimarykeyString(ConstrCode, GroupCount, LineCount, ColumnCount); |
753 |
strSQL += string.Format(" AND TargetMonth = TO_DATE('{0}','YYYY/MM/DD')", ColumnDate.ToShortDateString());
|
|
753 |
strSQL += string.Format(" AND TargetMonth = DATE_FORMAT('{0}','%Y/%m/%d')", ColumnDate.ToShortDateString());
|
|
754 | 754 |
|
755 | 755 |
// データ読込み |
756 | 756 |
List<ConstructionLedgerExcute> LedgerExDBList = new List<ConstructionLedgerExcute>(); |
branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsSystemOnceExecute.cs | ||
---|---|---|
584 | 584 |
int iCode3 = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("見積提出")).Key; |
585 | 585 |
|
586 | 586 |
// 対象データが存在するかを確認する |
587 |
string strSQL = "SELECT COUNT(*) FROM CONSTRUCTIONBASEINFO WHERE TRUNC(ESTIMATESSUBMITTEDDATE) != TO_DATE('0001/01/01','YYYY/MM/DD')";
|
|
588 |
strSQL += string.Format(" AND TRUNC(ESTIMATESSUBMITTEDDATE + {0})", s_NonOrderDay);
|
|
589 |
strSQL += string.Format(" < TO_DATE('{0}','YYYY/MM/DD')", DateTime.Now.ToShortDateString());
|
|
587 |
string strSQL = "SELECT COUNT(*) FROM CONSTRUCTIONBASEINFO WHERE DATE(ESTIMATESSUBMITTEDDATE) != DATE_FORMAT('0001/01/01','%Y/%m/%d')";
|
|
588 |
strSQL += string.Format(" AND DATE(ESTIMATESSUBMITTEDDATE + {0})", s_NonOrderDay);
|
|
589 |
strSQL += string.Format(" < DATE_FORMAT('{0}','%Y/%m/%d')", DateTime.Now.ToShortDateString());
|
|
590 | 590 |
strSQL += string.Format(" AND CONSTRUCTIONSTATUSFLG IN({0}, {1})", iCode2, iCode3); |
591 | 591 |
strSQL += string.Format(" AND ESTIMATETYPE IN ({0}, {1})", (int)CommonDefine.BaseInfoEstimateType.Normal, (int)CommonDefine.BaseInfoEstimateType.GetBudget); |
592 | 592 |
ArrayList arList = new ArrayList(); |
... | ... | |
601 | 601 |
// 対象データが存在すれば更新する |
602 | 602 |
strSQL = string.Format("UPDATE CONSTRUCTIONBASEINFO SET CONSTRUCTIONSTATUSFLG = {0}", iCode1); |
603 | 603 |
strSQL += " WHERE CONSTRUCTIONCODE IN"; |
604 |
strSQL += " (SELECT CONSTRUCTIONCODE FROM CONSTRUCTIONBASEINFO WHERE TRUNC(ESTIMATESSUBMITTEDDATE) != TO_DATE('0001/01/01','YYYY/MM/DD')";
|
|
605 |
strSQL += string.Format(" AND TRUNC(ESTIMATESSUBMITTEDDATE + {0})", s_NonOrderDay);
|
|
606 |
strSQL += string.Format(" < TO_DATE('{0}','YYYY/MM/DD')", DateTime.Now.ToShortDateString());
|
|
604 |
strSQL += " (SELECT CONSTRUCTIONCODE FROM CONSTRUCTIONBASEINFO WHERE DATE(ESTIMATESSUBMITTEDDATE) != DATE_FORMAT('0001/01/01','%Y/%m/%d')";
|
|
605 |
strSQL += string.Format(" AND DATE(ESTIMATESSUBMITTEDDATE + {0})", s_NonOrderDay);
|
|
606 |
strSQL += string.Format(" < DATE_FORMAT('{0}','%Y/%m/%d')", DateTime.Now.ToShortDateString());
|
|
607 | 607 |
strSQL += string.Format(" AND CONSTRUCTIONSTATUSFLG IN({0}, {1})", iCode2, iCode3); |
608 | 608 |
strSQL += string.Format(" AND ESTIMATETYPE IN ({0}, {1}))", (int)CommonDefine.BaseInfoEstimateType.Normal, (int)CommonDefine.BaseInfoEstimateType.GetBudget); |
609 | 609 |
if (!BaseDB.ExecuteNonQuery(strSQL)) |
branches/src/ProcessManagement/ProcessManagement/Common/Utility/DefinitionFileRead.cs | ||
---|---|---|
38 | 38 |
public class DBConnectionInfo |
39 | 39 |
{ |
40 | 40 |
/// <summary> |
41 |
/// DB接続先取得 |
|
42 |
/// </summary> |
|
43 |
[System.Xml.Serialization.XmlElement("DBServer")] |
|
44 |
public String DBServer { get; set; } |
|
45 |
|
|
46 |
/// <summary> |
|
41 | 47 |
/// DB接続ユーザー名取得 |
42 | 48 |
/// </summary> |
43 | 49 |
[System.Xml.Serialization.XmlElement("DBUser")] |
... | ... | |
50 | 56 |
public String Password { get; set; } |
51 | 57 |
|
52 | 58 |
/// <summary> |
53 |
/// DB接続ソース名取得
|
|
59 |
/// DB名取得 |
|
54 | 60 |
/// </summary> |
55 |
[System.Xml.Serialization.XmlElement("DBDataSource")]
|
|
56 |
public String DBDataSource { get; set; }
|
|
61 |
[System.Xml.Serialization.XmlElement("Database")]
|
|
62 |
public String Database { get; set; }
|
|
57 | 63 |
} |
58 | 64 |
|
59 | 65 |
///// <summary> |
branches/src/ProcessManagement/ProcessManagement/DB/Oracle/OracleProcess.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Collections; |
|
4 |
using System.Data; |
|
5 |
using System.Linq; |
|
6 |
using System.Text; |
|
7 |
|
|
8 |
using Oracle.ManagedDataAccess.Client; |
|
9 |
using log4net; |
|
10 |
using log4net.Appender; |
|
11 |
using log4net.Repository.Hierarchy; |
|
12 |
|
|
13 |
using ProcessManagement.DB.Core; |
|
14 |
|
|
15 |
namespace ProcessManagement.DB.Oracle |
|
16 |
{ |
|
17 |
/// <summary> |
|
18 |
/// Oracle使用共通ラッパークラス |
|
19 |
/// </summary> |
|
20 |
public class OracleProcess : ABaseDBProcess |
|
21 |
{ |
|
22 |
#region コンストラクタ |
|
23 |
/// <summary> |
|
24 |
/// コンストラクタ。 |
|
25 |
/// </summary> |
|
26 |
/// <param name="connectionString">接続文字列</param> |
|
27 |
public OracleProcess(String connectionString) |
|
28 |
: base(connectionString) |
|
29 |
{ |
|
30 |
} |
|
31 |
#endregion |
|
32 |
|
|
33 |
#region メソッド |
|
34 |
/// <summary> |
|
35 |
/// Connectionを取得。 |
|
36 |
/// </summary> |
|
37 |
/// <param name="connectionString"></param> |
|
38 |
/// <returns>Connection</returns> |
|
39 |
public override IDbConnection getConnection(String connectionString) |
|
40 |
{ |
|
41 |
return new OracleConnection(connectionString); |
|
42 |
} |
|
43 |
|
|
44 |
#endregion |
|
45 |
} |
|
46 |
} |
branches/src/ProcessManagement/ProcessManagement/DB/SqlServerCompact/SqlServerCompact.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Data.SqlServerCe; |
|
6 |
|
|
7 |
namespace ProcessManagement.DB |
|
8 |
{ |
|
9 |
public class SqlServerCompact |
|
10 |
{ |
|
11 |
//データベースのファイル名 |
|
12 |
private const string DATABASE_FILENAME = "MyDatabase.sdf"; |
|
13 |
|
|
14 |
//データベースの接続文字列 |
|
15 |
private const string s_Connection_String = "Data Source = 'D:\\devlop\\processmanagement\\First\\Data\\MyDatabase.sdf'; LCID=1033; Password = password; Encrypt = TRUE;"; |
|
16 |
|
|
17 |
//テーブル作成のSQL |
|
18 |
private const string COMMANDTEXT_CREATE_TABLE_IDEA = @"CREATE TABLE IDEA(IDEA_ID BIGINT PRIMARY KEY IDENTITY(1,1) NOT NULL, LIMIT_TIME DATETIME NOT NULL, IDEA_CONTENTS NVARCHAR(2000) NOT NULL)"; |
|
19 |
|
|
20 |
#region プライベートメソッド |
|
21 |
/// <summary> |
|
22 |
/// コンストラクタ |
|
23 |
/// </summary> |
|
24 |
private SqlServerCompact() |
|
25 |
{ |
|
26 |
} |
|
27 |
#endregion |
|
28 |
|
|
29 |
#region パブリックメソッド |
|
30 |
|
|
31 |
/// <summary> |
|
32 |
/// コネクションを作成する |
|
33 |
/// </summary> |
|
34 |
/// <returns></returns> |
|
35 |
public static SqlCeConnection GetConnection() |
|
36 |
{ |
|
37 |
return new SqlCeConnection(s_Connection_String); |
|
38 |
} |
|
39 |
|
|
40 |
#endregion |
|
41 |
} |
|
42 |
} |
branches/src/ProcessManagement/ProcessManagement/DB/Core/ABaseDBProcess.cs | ||
---|---|---|
4 | 4 |
using System.Linq; |
5 | 5 |
using System.Text; |
6 | 6 |
using System.Collections; |
7 |
/// Oracle |
|
8 |
using Oracle.ManagedDataAccess.Types; |
|
9 |
using Oracle.ManagedDataAccess.Client; |
|
10 | 7 |
|
8 |
using MySql.Data.MySqlClient; |
|
9 |
|
|
11 | 10 |
using log4net; |
12 | 11 |
using log4net.Appender; |
13 | 12 |
using log4net.Repository.Hierarchy; |
... | ... | |
106 | 105 |
/// <returns>Connectionのオブジェクト</returns> |
107 | 106 |
public virtual IDbConnection getConnection(String connectionString) |
108 | 107 |
{ |
109 |
return new OracleConnection(connectionString);
|
|
108 |
return new MySqlConnection(connectionString);
|
|
110 | 109 |
} |
111 | 110 |
|
112 | 111 |
#endregion |
... | ... | |
289 | 288 |
|
290 | 289 |
#region ExecuteReader |
291 | 290 |
/// <summary> |
292 |
/// オラクルフリーSQLリーダー
|
|
291 |
/// MySQLリーダー
|
|
293 | 292 |
/// </summary> |
294 | 293 |
/// <param name="strSql">検索SQL</param> |
295 | 294 |
/// <param name="arData">取得データ</param> |
296 | 295 |
/// <returns>成功時:true 失敗時:false</returns> |
297 | 296 |
public bool ExecuteReader(string strSql, ref ArrayList arData, bool bconnect = true) |
298 | 297 |
{ |
299 |
//Oracle インターフェース
|
|
300 |
OracleCommand oracmd = new OracleCommand();
|
|
301 |
OracleDataReader orareader = null;
|
|
298 |
//MySQL インターフェース
|
|
299 |
MySqlCommand mycmd = new MySqlCommand();
|
|
300 |
MySqlDataReader myreader = null;
|
|
302 | 301 |
try |
303 | 302 |
{ |
304 |
// 接続
|
|
303 |
//接続 |
|
305 | 304 |
if (bconnect) this.connect(); |
306 | 305 |
|
307 |
// OracleCommand・OracleDataReader作成
|
|
308 |
oracmd.Connection = (OracleConnection)m_connection;
|
|
306 |
//MySqlCommand・MySqlDataReader作成
|
|
307 |
mycmd.Connection = (MySqlConnection)m_connection;
|
|
309 | 308 |
|
310 |
// SQLセット
|
|
311 |
oracmd.CommandText = strSql;
|
|
309 |
//SQLセット |
|
310 |
mycmd.CommandText = strSql;
|
|
312 | 311 |
|
313 |
orareader = oracmd.ExecuteReader();
|
|
312 |
myreader = mycmd.ExecuteReader();
|
|
314 | 313 |
|
315 |
int iFeildcnt = oracmd.ExecuteReader().FieldCount;
|
|
316 |
// 読込
|
|
317 |
while (orareader.Read())
|
|
314 |
int iFeildcnt = myreader.FieldCount;
|
|
315 |
//読込 |
|
316 |
while (myreader.Read())
|
|
318 | 317 |
{ |
319 | 318 |
object[] objwrk = new object[iFeildcnt]; |
320 | 319 |
|
321 |
orareader.GetOracleValues(objwrk);
|
|
320 |
myreader.GetValues(objwrk);
|
|
322 | 321 |
|
323 |
// null抑制
|
|
322 |
//null抑制 |
|
324 | 323 |
int i = 0; |
325 | 324 |
foreach (object www in objwrk) |
326 | 325 |
{ |
... | ... | |
332 | 331 |
} |
333 | 332 |
return true; |
334 | 333 |
} |
335 |
catch (OracleException oraex)
|
|
334 |
catch (MySqlException myex)
|
|
336 | 335 |
{ |
337 |
logger.ErrorFormat("オラクルエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), oraex.Message, strSql);
|
|
336 |
logger.ErrorFormat("MySQLエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), myex.Message, strSql);
|
|
338 | 337 |
return false; |
339 | 338 |
} |
340 | 339 |
catch (Exception ex) |
... | ... | |
344 | 343 |
} |
345 | 344 |
finally |
346 | 345 |
{ |
347 |
if (orareader != null)
|
|
346 |
if (myreader != null)
|
|
348 | 347 |
{ |
349 |
orareader.Close();
|
|
350 |
orareader.Dispose();
|
|
351 |
orareader = null;
|
|
348 |
myreader.Close();
|
|
349 |
myreader.Dispose();
|
|
350 |
myreader = null;
|
|
352 | 351 |
} |
353 |
oracmd.Dispose();
|
|
354 |
oracmd = null;
|
|
352 |
mycmd.Dispose();
|
|
353 |
mycmd = null;
|
|
355 | 354 |
|
356 |
// 切断
|
|
355 |
//切断 |
|
357 | 356 |
if (bconnect) this.close(); |
358 | 357 |
} |
359 | 358 |
} |
... | ... | |
361 | 360 |
|
362 | 361 |
#region ExecuteNonQuery |
363 | 362 |
/// <summary> |
364 |
/// オラクルフリーExecuteNonQuery
|
|
363 |
/// MySQL ExecuteNonQuery
|
|
365 | 364 |
/// </summary> |
366 | 365 |
/// <param name="strSql">実行SQL</param> |
367 | 366 |
/// <returns>成功時:true 失敗時:false</returns> |
368 | 367 |
public bool ExecuteNonQuery(string strSql, bool bconnect = true) |
369 | 368 |
{ |
370 |
//Oracle インターフェース
|
|
371 |
OracleCommand oracmd = new OracleCommand();
|
|
369 |
//MySQL インターフェース
|
|
370 |
MySqlCommand mycmd = new MySqlCommand();
|
|
372 | 371 |
|
373 | 372 |
try |
374 | 373 |
{ |
375 |
// 接続
|
|
374 |
//接続 |
|
376 | 375 |
if (bconnect) this.connect(); |
377 | 376 |
|
378 |
// コネクションセット
|
|
379 |
oracmd.Connection = (OracleConnection)m_connection;
|
|
377 |
//ネクションセット |
|
378 |
mycmd.Connection = (MySqlConnection)m_connection;
|
|
380 | 379 |
|
381 |
// トランザクション
|
|
380 |
//トランザクション |
|
382 | 381 |
if (bconnect) |
383 | 382 |
{ |
384 | 383 |
if (!this.beginTran()) return false; |
385 | 384 |
} |
386 | 385 |
|
387 |
// SQLセット
|
|
388 |
oracmd.CommandText = strSql;
|
|
386 |
//SQLセット |
|
387 |
mycmd.CommandText = strSql;
|
|
389 | 388 |
//実行 |
390 |
if (oracmd.ExecuteNonQuery() == 0)
|
|
389 |
if (mycmd.ExecuteNonQuery() == 0)
|
|
391 | 390 |
{ |
392 |
// エラー時rollbackして処理終了
|
|
391 |
//エラー時rollbackして処理終了 |
|
393 | 392 |
if (bconnect) this.rollback(); |
394 | 393 |
return false; |
395 | 394 |
} |
396 |
// 成功時Commit
|
|
395 |
//成功時Commit |
|
397 | 396 |
if (bconnect) |
398 | 397 |
{ |
399 | 398 |
if (!this.commit()) return false; |
... | ... | |
401 | 400 |
|
402 | 401 |
return true; |
403 | 402 |
} |
404 |
catch (OracleException oraex)
|
|
403 |
catch (MySqlException myex)
|
|
405 | 404 |
{ |
406 |
logger.ErrorFormat("オラクルエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), oraex.Message, strSql);
|
|
405 |
logger.ErrorFormat("MySQLエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), myex.Message, strSql);
|
|
407 | 406 |
return false; |
408 | 407 |
} |
409 | 408 |
catch (Exception ex) |
... | ... | |
413 | 412 |
} |
414 | 413 |
finally |
415 | 414 |
{ |
416 |
// 切断
|
|
415 |
//切断 |
|
417 | 416 |
if (bconnect) this.close(); |
418 | 417 |
|
419 |
oracmd.Dispose();
|
|
420 |
oracmd = null;
|
|
418 |
mycmd.Dispose();
|
|
419 |
mycmd = null;
|
|
421 | 420 |
} |
422 | 421 |
} |
423 | 422 |
#endregion |
branches/src/ProcessManagement/ProcessManagement/DB/Core/DBCommon.cs | ||
---|---|---|
61 | 61 |
public void Initialize() |
62 | 62 |
{ |
63 | 63 |
// DB接続情報作成 |
64 |
m_dbconnectString = string.Format("User Id={0};", CommonMotions.DFRModel.DBConnect.DBUser);
|
|
65 |
m_dbconnectString += string.Format("Password={0};", CommonMotions.DFRModel.DBConnect.Password);
|
|
66 |
m_dbconnectString += string.Format("Data Source={0};", CommonMotions.DFRModel.DBConnect.DBDataSource);
|
|
67 |
//m_dbconnectString += "Pooling=false";
|
|
64 |
m_dbconnectString = string.Format("Server={0};", CommonMotions.DFRModel.DBConnect.DBServer);
|
|
65 |
m_dbconnectString += string.Format("Uid={0};", CommonMotions.DFRModel.DBConnect.DBUser);
|
|
66 |
m_dbconnectString += string.Format("Pwd={0};", CommonMotions.DFRModel.DBConnect.Password);
|
|
67 |
m_dbconnectString += string.Format("Database={0};", CommonMotions.DFRModel.DBConnect.Database);
|
|
68 | 68 |
} |
69 | 69 |
|
70 | 70 |
#endregion |
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/DBCommonMotions.cs | ||
---|---|---|
6 | 6 |
using System.Collections; |
7 | 7 |
|
8 | 8 |
using log4net; |
9 |
using Oracle.ManagedDataAccess.Client;
|
|
9 |
using MySql.Data.MySqlClient;
|
|
10 | 10 |
|
11 |
using ProcessManagement.DB.Oracle;
|
|
11 |
using ProcessManagement.DB.MySql;
|
|
12 | 12 |
using ProcessManagement.DB.Core; |
13 | 13 |
using ProcessManagement.DataModel; |
14 | 14 |
using ProcessManagement.Common; |
... | ... | |
18 | 18 |
/// <summary> |
19 | 19 |
/// DBアクセス共通処理 |
20 | 20 |
/// </summary> |
21 |
public class DBCommonMotions : OracleProcess
|
|
21 |
public class DBCommonMotions : MySqlProcess
|
|
22 | 22 |
{ |
23 | 23 |
#region 定義部 |
24 | 24 |
/// <summary> |
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOActionScheduleData.cs | ||
---|---|---|
5 | 5 |
using System.Collections; |
6 | 6 |
|
7 | 7 |
using log4net; |
8 |
using Oracle.ManagedDataAccess.Client;
|
|
8 |
using MySql.Data.MySqlClient;
|
|
9 | 9 |
|
10 |
using ProcessManagement.DB.Oracle;
|
|
10 |
using ProcessManagement.DB.MySql;
|
|
11 | 11 |
using ProcessManagement.DB.Core; |
12 | 12 |
using ProcessManagement.DataModel; |
13 | 13 |
|
... | ... | |
18 | 18 |
/// <summary> |
19 | 19 |
/// 行動予定アクセスクラス |
20 | 20 |
/// </summary> |
21 |
public class IOActionScheduleData : OracleProcess
|
|
21 |
public class IOActionScheduleData : MySqlProcess
|
|
22 | 22 |
{ |
23 | 23 |
#region 定義部 |
24 | 24 |
/// <summary> |
... | ... | |
73 | 73 |
{ |
74 | 74 |
// SQL作成(oracleのDateTime型が変換できないのでCharに変換しておく) |
75 | 75 |
strcmd = "SELECT"; |
76 |
strcmd += " TO_CHAR(TargetDate, 'YYYY/MM/DD')";
|
|
76 |
strcmd += " DATE_FORMAT(TargetDate, '%Y/%m/%d')";
|
|
77 | 77 |
strcmd += " ,PersonCode"; |
78 | 78 |
strcmd += " ,ActionSchedule"; |
79 | 79 |
strcmd += " ,TargetYear"; |
80 | 80 |
strcmd += " ,TargetMonth"; |
81 | 81 |
strcmd += " ,TargetDay"; |
82 |
strcmd += " ,TO_CHAR(EntryDate, 'YYYY/MM/DD HH24:MI:ss')";
|
|
83 |
strcmd += " ,TO_CHAR(UpdateDate, 'YYYY/MM/DD HH24:MI:ss')";
|
|
82 |
strcmd += " ,DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')";
|
|
83 |
strcmd += " ,DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')";
|
|
84 | 84 |
strcmd += " FROM ActionScheduleData"; |
85 | 85 |
strcmd += AddSQLString; |
86 | 86 |
|
... | ... | |
149 | 149 |
|
150 | 150 |
strcmd += " VALUES ("; |
151 | 151 |
|
152 |
strcmd += string.Format(" TO_DATE('{0}','YYYY/MM/DD')", data.TargetDate.ToShortDateString());
|
|
152 |
strcmd += string.Format(" DATE_FORMAT('{0}','%Y/%m/%d')", data.TargetDate.ToShortDateString());
|
|
153 | 153 |
strcmd += string.Format(", {0}", data.PersonCode.ToString()); |
154 | 154 |
strcmd += string.Format(", '{0}'", data.ActionSchedule); |
155 | 155 |
strcmd += string.Format(", {0}", data.TargetYear.ToString()); |
156 | 156 |
strcmd += string.Format(", {0}", data.TargetMonth.ToString()); |
157 | 157 |
strcmd += string.Format(", {0}", data.TargetDay.ToString()); |
158 | 158 |
|
159 |
strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
160 |
strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
159 |
strcmd += ", DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
160 |
strcmd += ", DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
161 | 161 |
strcmd = strcmd + ")"; |
162 | 162 |
|
163 | 163 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
... | ... | |
189 | 189 |
|
190 | 190 |
strcmd += " SET"; |
191 | 191 |
|
192 |
strcmd += string.Format(" TargetDate = TO_DATE('{0}','YYYY/MM/DD')", data.TargetDate.ToShortDateString());
|
|
192 |
strcmd += string.Format(" TargetDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.TargetDate.ToShortDateString());
|
|
193 | 193 |
strcmd += string.Format(",PersonCode = {0}", data.PersonCode.ToString()); |
194 | 194 |
strcmd += string.Format(",ActionSchedule = '{0}'", data.ActionSchedule); |
195 | 195 |
strcmd += string.Format(",TargetYear = {0}", data.TargetYear.ToString()); |
196 | 196 |
strcmd += string.Format(",TargetMonth = {0}", data.TargetMonth.ToString()); |
197 | 197 |
strcmd += string.Format(",TargetDay = {0}", data.TargetDay.ToString()); |
198 | 198 |
|
199 |
strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
199 |
strcmd += ", UpdateDate = DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
200 | 200 |
strcmd += AddSQLString; |
201 | 201 |
|
202 | 202 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
... | ... | |
259 | 259 |
wrk.EntryDate = DateTime.Parse(objwrk[(int)NameColumn.ENTRY_DATE].ToString()); |
260 | 260 |
wrk.UpdateDate = DateTime.Parse(objwrk[(int)NameColumn.UPDATE_DATE].ToString()); |
261 | 261 |
} |
262 |
catch (OracleException oraex)
|
|
262 |
catch (MySqlException myex)
|
|
263 | 263 |
{ |
264 |
logger.ErrorFormat("オラクルエラー:{0}:{1}", CommonMotions.GetMethodName(), oraex.Message);
|
|
264 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(2), myex.Message);
|
|
265 | 265 |
} |
266 | 266 |
catch (Exception ex) |
267 | 267 |
{ |
... | ... | |
290 | 290 |
wrk.EntryDate = DateTime.Now; |
291 | 291 |
wrk.UpdateDate = DateTime.Now; |
292 | 292 |
} |
293 |
catch (OracleException oraex)
|
|
293 |
catch (MySqlException myex)
|
|
294 | 294 |
{ |
295 |
logger.ErrorFormat("オラクルエラー:{0}:{1}", CommonMotions.GetMethodName(), oraex.Message);
|
|
295 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(2), myex.Message);
|
|
296 | 296 |
} |
297 | 297 |
catch (Exception ex) |
298 | 298 |
{ |
... | ... | |
312 | 312 |
string strWork = string.Empty; |
313 | 313 |
try |
314 | 314 |
{ |
315 |
strWork = string.Format(" Where TargetDate = TO_DATE('{0}','YYYY/MM/DD')", TargetDate.ToShortDateString());
|
|
315 |
strWork = string.Format(" Where TargetDate = DATE_FORMAT('{0}','%Y/%m/%d')", TargetDate.ToShortDateString());
|
|
316 | 316 |
if(PersonCode != 0) |
317 | 317 |
strWork += string.Format(" And PersonCode = {0}", PersonCode.ToString()); |
318 | 318 |
|
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBaseInfo.cs | ||
---|---|---|
6 | 6 |
using System.Collections; |
7 | 7 |
|
8 | 8 |
using log4net; |
9 |
using Oracle.ManagedDataAccess.Client;
|
|
9 |
using MySql.Data.MySqlClient;
|
|
10 | 10 |
|
11 |
using ProcessManagement.DB.Oracle;
|
|
11 |
using ProcessManagement.DB.MySql;
|
|
12 | 12 |
using ProcessManagement.DB.Core; |
13 | 13 |
using ProcessManagement.DataModel; |
14 | 14 |
using ProcessManagement.Common; |
... | ... | |
18 | 18 |
/// <summary> |
19 | 19 |
/// 工事基本情報DBアクセス |
20 | 20 |
/// </summary> |
21 |
public class IOConstructionBaseInfo : OracleProcess
|
|
21 |
public class IOConstructionBaseInfo : MySqlProcess
|
|
22 | 22 |
{ |
23 | 23 |
#region 定義部 |
24 | 24 |
/// <summary> |
... | ... | |
108 | 108 |
strcmd += ", TyingFlg"; |
109 | 109 |
strcmd += ", ConstructionYear"; |
110 | 110 |
strcmd += ", ConstructionPeriod"; |
111 |
strcmd += ", TO_CHAR(RequestedDate, 'YYYY/MM/DD')";
|
|
112 |
strcmd += ", TO_CHAR(EstimatesSubmitDeadline, 'YYYY/MM/DD')";
|
|
113 |
strcmd += ", TO_CHAR(EstimatesSubmittedDate, 'YYYY/MM/DD')";
|
|
114 |
strcmd += ", TO_CHAR(ProvisionalOrderDate, 'YYYY/MM/DD')";
|
|
115 |
strcmd += ", TO_CHAR(OrderDate, 'YYYY/MM/DD')";
|
|
116 |
strcmd += ", TO_CHAR(OrderStartingDate, 'YYYY/MM/DD')";
|
|
117 |
strcmd += ", TO_CHAR(OrderCompletionDate, 'YYYY/MM/DD')";
|
|
118 |
strcmd += ", TO_CHAR(PreparationStartDate, 'YYYY/MM/DD')";
|
|
119 |
strcmd += ", TO_CHAR(ConstructionStartingDate, 'YYYY/MM/DD')";
|
|
120 |
strcmd += ", TO_CHAR(ConstructionCompletionDate, 'YYYY/MM/DD')";
|
|
121 |
strcmd += ", TO_CHAR(NonOrderDate, 'YYYY/MM/DD')";
|
|
111 |
strcmd += ", DATE_FORMAT(RequestedDate, '%Y/%m/%d')";
|
|
112 |
strcmd += ", DATE_FORMAT(EstimatesSubmitDeadline, '%Y/%m/%d')";
|
|
113 |
strcmd += ", DATE_FORMAT(EstimatesSubmittedDate, '%Y/%m/%d')";
|
|
114 |
strcmd += ", DATE_FORMAT(ProvisionalOrderDate, '%Y/%m/%d')";
|
|
115 |
strcmd += ", DATE_FORMAT(OrderDate, '%Y/%m/%d')";
|
|
116 |
strcmd += ", DATE_FORMAT(OrderStartingDate, '%Y/%m/%d')";
|
|
117 |
strcmd += ", DATE_FORMAT(OrderCompletionDate, '%Y/%m/%d')";
|
|
118 |
strcmd += ", DATE_FORMAT(PreparationStartDate, '%Y/%m/%d')";
|
|
119 |
strcmd += ", DATE_FORMAT(ConstructionStartingDate, '%Y/%m/%d')";
|
|
120 |
strcmd += ", DATE_FORMAT(ConstructionCompletionDate, '%Y/%m/%d')";
|
|
121 |
strcmd += ", DATE_FORMAT(NonOrderDate, '%Y/%m/%d')";
|
|
122 | 122 |
strcmd += ", OrdersDecisionPrice"; |
123 | 123 |
strcmd += ", OrdersDecisionPriceInTax"; |
124 | 124 |
strcmd += ", SalesPersonCode"; |
... | ... | |
126 | 126 |
strcmd += ", ConstrSubPersonCode"; |
127 | 127 |
strcmd += ", ConstructionInstructor"; |
128 | 128 |
strcmd += ", TransferConstruction"; |
129 |
strcmd += ", TO_CHAR(TransferConstructionDate, 'YYYY/MM/DD')";
|
|
129 |
strcmd += ", DATE_FORMAT(TransferConstructionDate, '%Y/%m/%d')";
|
|
130 | 130 |
strcmd += ", OrderersDivision"; |
131 | 131 |
strcmd += ", OrderersCode"; |
132 |
strcmd += ", TO_CHAR(EstimatesExpirationDate, 'YYYY/MM/DD')";
|
|
133 |
strcmd += ", TO_CHAR(ConstructionPeriodStart, 'YYYY/MM/DD')";
|
|
134 |
strcmd += ", TO_CHAR(ConstructionPeriodEnd, 'YYYY/MM/DD')";
|
|
135 |
strcmd += ", TO_CHAR(ConstructionPeriodStart2, 'YYYY/MM/DD')";
|
|
136 |
strcmd += ", TO_CHAR(ConstructionPeriodEnd2, 'YYYY/MM/DD')";
|
|
137 |
strcmd += ", TO_CHAR(StartDate, 'YYYY/MM/DD')";
|
|
138 |
strcmd += ", TO_CHAR(EndDate, 'YYYY/MM/DD')";
|
|
139 |
strcmd += ", TO_CHAR(PurchaseOrderMailingDate, 'YYYY/MM/DD')";
|
|
140 |
strcmd += ", TO_CHAR(PurchaseOrderReturnDate, 'YYYY/MM/DD')";
|
|
141 |
strcmd += ", TO_CHAR(PurchaseOrderReturnCheckDate, 'YYYY/MM/DD')";
|
|
132 |
strcmd += ", DATE_FORMAT(EstimatesExpirationDate, '%Y/%m/%d')";
|
|
133 |
strcmd += ", DATE_FORMAT(ConstructionPeriodStart, '%Y/%m/%d')";
|
|
134 |
strcmd += ", DATE_FORMAT(ConstructionPeriodEnd, '%Y/%m/%d')";
|
|
135 |
strcmd += ", DATE_FORMAT(ConstructionPeriodStart2, '%Y/%m/%d')";
|
|
136 |
strcmd += ", DATE_FORMAT(ConstructionPeriodEnd2, '%Y/%m/%d')";
|
|
137 |
strcmd += ", DATE_FORMAT(StartDate, '%Y/%m/%d')";
|
|
138 |
strcmd += ", DATE_FORMAT(EndDate, '%Y/%m/%d')";
|
|
139 |
strcmd += ", DATE_FORMAT(PurchaseOrderMailingDate, '%Y/%m/%d')";
|
|
140 |
strcmd += ", DATE_FORMAT(PurchaseOrderReturnDate, '%Y/%m/%d')";
|
|
141 |
strcmd += ", DATE_FORMAT(PurchaseOrderReturnCheckDate, '%Y/%m/%d')";
|
|
142 | 142 |
strcmd += ", ConsumptionTaxFlg"; |
143 | 143 |
strcmd += ", PrimeContractorFlg"; |
144 | 144 |
strcmd += ", SalesCostFlg"; |
145 | 145 |
strcmd += ", ConstructionStatusFlg"; |
146 | 146 |
strcmd += ", ConstructionType"; |
147 | 147 |
strcmd += ", EstimateType"; |
148 |
strcmd += ", TO_CHAR(BillingStartDate, 'YYYY/MM/DD')";
|
|
149 |
strcmd += ", TO_CHAR(BillingDate, 'YYYY/MM/DD')";
|
|
148 |
strcmd += ", DATE_FORMAT(BillingStartDate, '%Y/%m/%d')";
|
|
149 |
strcmd += ", DATE_FORMAT(BillingDate, '%Y/%m/%d')";
|
|
150 | 150 |
strcmd += ", BillingSplitFlg"; |
151 |
strcmd += ", TO_CHAR(BillingSendDate, 'YYYY/MM/DD HH24:MI:ss')";
|
|
152 |
strcmd += ", TO_CHAR(LedgerComplateDate, 'YYYY/MM/DD HH24:MI:ss')";
|
|
153 |
strcmd += ", TO_CHAR(EntryDate, 'YYYY/MM/DD HH24:MI:ss')";
|
|
154 |
strcmd += ", TO_CHAR(UpdateDate, 'YYYY/MM/DD HH24:MI:ss')";
|
|
151 |
strcmd += ", DATE_FORMAT(BillingSendDate, '%Y/%m/%d')";
|
|
152 |
strcmd += ", DATE_FORMAT(LedgerComplateDate, '%Y/%m/%d')";
|
|
153 |
strcmd += ", DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')";
|
|
154 |
strcmd += ", DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')";
|
|
155 | 155 |
strcmd += " FROM ConstructionBaseInfo"; |
156 | 156 |
|
157 | 157 |
return strcmd; |
... | ... | |
292 | 292 |
strcmd += string.Format(", {0}", data.ConstructionYear); |
293 | 293 |
strcmd += string.Format(", {0}", data.ConstructionPeriod); |
294 | 294 |
|
295 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.RequestedDate.ToShortDateString());
|
|
296 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.EstimatesSubmitDeadline.ToShortDateString());
|
|
297 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.EstimatesSubmittedDate.ToShortDateString());
|
|
298 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.ProvisionalOrderDate.ToShortDateString());
|
|
299 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.OrderDate.ToShortDateString());
|
|
300 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.OrderStartingDate.ToShortDateString());
|
|
301 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.OrderCompletionDate.ToShortDateString());
|
|
302 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.PreparationStartDate.ToShortDateString());
|
|
303 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.ConstructionStartingDate.ToShortDateString());
|
|
304 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.ConstructionCompletionDate.ToShortDateString());
|
|
305 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.NonOrderDate.ToShortDateString());
|
|
295 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.RequestedDate.ToShortDateString());
|
|
296 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.EstimatesSubmitDeadline.ToShortDateString());
|
|
297 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.EstimatesSubmittedDate.ToShortDateString());
|
|
298 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.ProvisionalOrderDate.ToShortDateString());
|
|
299 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.OrderDate.ToShortDateString());
|
|
300 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.OrderStartingDate.ToShortDateString());
|
|
301 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.OrderCompletionDate.ToShortDateString());
|
|
302 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.PreparationStartDate.ToShortDateString());
|
|
303 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.ConstructionStartingDate.ToShortDateString());
|
|
304 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.ConstructionCompletionDate.ToShortDateString());
|
|
305 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.NonOrderDate.ToShortDateString());
|
|
306 | 306 |
|
307 | 307 |
strcmd += string.Format(", {0}", data.OrdersDecisionPrice); |
308 | 308 |
strcmd += string.Format(", {0}", data.OrdersDecisionPriceInTax); |
... | ... | |
313 | 313 |
strcmd += string.Format(", {0}", data.ConstructionInstructor); |
314 | 314 |
|
315 | 315 |
strcmd += string.Format(", {0}", data.TransferConstruction); |
316 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.TransferConstructionDate.ToShortDateString());
|
|
316 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.TransferConstructionDate.ToShortDateString());
|
|
317 | 317 |
|
318 | 318 |
strcmd += string.Format(", {0}", data.OrderersDivision); |
319 | 319 |
strcmd += string.Format(", {0}", data.OrderersCode); |
320 | 320 |
|
321 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.EstimatesExpirationDate.ToShortDateString());
|
|
322 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.ConstructionPeriodStart.ToShortDateString());
|
|
323 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.ConstructionPeriodEnd.ToShortDateString());
|
|
324 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.ConstructionPeriodStart2.ToShortDateString());
|
|
325 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.ConstructionPeriodEnd2.ToShortDateString());
|
|
326 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.StartDate.ToShortDateString());
|
|
327 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.EndDate.ToShortDateString());
|
|
328 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.PurchaseOrderMailingDate.ToShortDateString());
|
|
329 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.PurchaseOrderReturnDate.ToShortDateString());
|
|
330 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.PurchaseOrderReturnCheckDate.ToShortDateString());
|
|
321 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.EstimatesExpirationDate.ToShortDateString());
|
|
322 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.ConstructionPeriodStart.ToShortDateString());
|
|
323 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.ConstructionPeriodEnd.ToShortDateString());
|
|
324 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.ConstructionPeriodStart2.ToShortDateString());
|
|
325 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.ConstructionPeriodEnd2.ToShortDateString());
|
|
326 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.StartDate.ToShortDateString());
|
|
327 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.EndDate.ToShortDateString());
|
|
328 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.PurchaseOrderMailingDate.ToShortDateString());
|
|
329 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.PurchaseOrderReturnDate.ToShortDateString());
|
|
330 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.PurchaseOrderReturnCheckDate.ToShortDateString());
|
|
331 | 331 |
|
332 | 332 |
strcmd += string.Format(", {0}", data.ConsumptionTaxFlg); |
333 | 333 |
strcmd += string.Format(", {0}", data.PrimeContractorFlg); |
... | ... | |
337 | 337 |
strcmd += string.Format(", {0}", data.ConstructionType); |
338 | 338 |
strcmd += string.Format(", {0}", data.EstimateType); |
339 | 339 |
|
340 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.BillingStartDate.ToShortDateString());
|
|
341 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.BillingDate.ToShortDateString());
|
|
340 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.BillingStartDate.ToShortDateString());
|
|
341 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.BillingDate.ToShortDateString());
|
|
342 | 342 |
strcmd += string.Format(", {0}", data.BillingSplitFlg); |
343 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.BillingSendDate.ToShortDateString());
|
|
344 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')", data.LedgerComplateDate.ToShortDateString());
|
|
343 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.BillingSendDate.ToShortDateString());
|
|
344 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')", data.LedgerComplateDate.ToShortDateString());
|
|
345 | 345 |
|
346 |
strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
347 |
strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
346 |
strcmd += ", DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
347 |
strcmd += ", DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
348 | 348 |
strcmd = strcmd + ")"; |
349 | 349 |
|
350 | 350 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
... | ... | |
406 | 406 |
strcmd += string.Format(", ConstructionYear = {0}", data.ConstructionYear); |
407 | 407 |
strcmd += string.Format(", ConstructionPeriod = {0}", data.ConstructionPeriod); |
408 | 408 |
|
409 |
strcmd += string.Format(", RequestedDate = TO_DATE('{0}','YYYY/MM/DD')", data.RequestedDate.ToShortDateString());
|
|
410 |
strcmd += string.Format(", EstimatesSubmitDeadline = TO_DATE('{0}','YYYY/MM/DD')", data.EstimatesSubmitDeadline.ToShortDateString());
|
|
411 |
strcmd += string.Format(", EstimatesSubmittedDate = TO_DATE('{0}','YYYY/MM/DD')", data.EstimatesSubmittedDate.ToShortDateString());
|
|
412 |
strcmd += string.Format(", ProvisionalOrderDate = TO_DATE('{0}','YYYY/MM/DD')", data.ProvisionalOrderDate.ToShortDateString());
|
|
413 |
strcmd += string.Format(", OrderDate = TO_DATE('{0}','YYYY/MM/DD')", data.OrderDate.ToShortDateString());
|
|
414 |
strcmd += string.Format(", OrderStartingDate = TO_DATE('{0}','YYYY/MM/DD')", data.OrderStartingDate.ToShortDateString());
|
|
415 |
strcmd += string.Format(", OrderCompletionDate = TO_DATE('{0}','YYYY/MM/DD')", data.OrderCompletionDate.ToShortDateString());
|
|
416 |
strcmd += string.Format(", PreparationStartDate = TO_DATE('{0}','YYYY/MM/DD')", data.PreparationStartDate.ToShortDateString());
|
|
417 |
strcmd += string.Format(", ConstructionStartingDate = TO_DATE('{0}','YYYY/MM/DD')", data.ConstructionStartingDate.ToShortDateString());
|
|
418 |
strcmd += string.Format(", ConstructionCompletionDate = TO_DATE('{0}','YYYY/MM/DD')", data.ConstructionCompletionDate.ToShortDateString());
|
|
419 |
strcmd += string.Format(", NonOrderDate = TO_DATE('{0}','YYYY/MM/DD')", data.NonOrderDate.ToShortDateString());
|
|
409 |
strcmd += string.Format(", RequestedDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.RequestedDate.ToShortDateString());
|
|
410 |
strcmd += string.Format(", EstimatesSubmitDeadline = DATE_FORMAT('{0}','%Y/%m/%d')", data.EstimatesSubmitDeadline.ToShortDateString());
|
|
411 |
strcmd += string.Format(", EstimatesSubmittedDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.EstimatesSubmittedDate.ToShortDateString());
|
|
412 |
strcmd += string.Format(", ProvisionalOrderDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.ProvisionalOrderDate.ToShortDateString());
|
|
413 |
strcmd += string.Format(", OrderDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.OrderDate.ToShortDateString());
|
|
414 |
strcmd += string.Format(", OrderStartingDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.OrderStartingDate.ToShortDateString());
|
|
415 |
strcmd += string.Format(", OrderCompletionDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.OrderCompletionDate.ToShortDateString());
|
|
416 |
strcmd += string.Format(", PreparationStartDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.PreparationStartDate.ToShortDateString());
|
|
417 |
strcmd += string.Format(", ConstructionStartingDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.ConstructionStartingDate.ToShortDateString());
|
|
418 |
strcmd += string.Format(", ConstructionCompletionDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.ConstructionCompletionDate.ToShortDateString());
|
|
419 |
strcmd += string.Format(", NonOrderDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.NonOrderDate.ToShortDateString());
|
|
420 | 420 |
|
421 | 421 |
strcmd += string.Format(", OrdersDecisionPrice = {0}", data.OrdersDecisionPrice); |
422 | 422 |
strcmd += string.Format(", OrdersDecisionPriceInTax = {0}", data.OrdersDecisionPriceInTax); |
... | ... | |
427 | 427 |
strcmd += string.Format(", ConstructionInstructor = {0}", data.ConstructionInstructor); |
428 | 428 |
|
429 | 429 |
strcmd += string.Format(", TransferConstruction = {0}", data.TransferConstruction); |
430 |
strcmd += string.Format(", TransferConstructionDate = TO_DATE('{0}','YYYY/MM/DD')", data.TransferConstructionDate.ToShortDateString());
|
|
430 |
strcmd += string.Format(", TransferConstructionDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.TransferConstructionDate.ToShortDateString());
|
|
431 | 431 |
|
432 | 432 |
strcmd += string.Format(", OrderersDivision = {0}", data.OrderersDivision); |
433 | 433 |
strcmd += string.Format(", OrderersCode = {0}", data.OrderersCode); |
434 | 434 |
|
435 |
strcmd += string.Format(", EstimatesExpirationDate = TO_DATE('{0}','YYYY/MM/DD')", data.EstimatesExpirationDate.ToShortDateString());
|
|
436 |
strcmd += string.Format(", ConstructionPeriodStart = TO_DATE('{0}','YYYY/MM/DD')", data.ConstructionPeriodStart.ToShortDateString());
|
|
437 |
strcmd += string.Format(", ConstructionPeriodEnd = TO_DATE('{0}','YYYY/MM/DD')", data.ConstructionPeriodEnd.ToShortDateString());
|
|
438 |
strcmd += string.Format(", ConstructionPeriodStart2 = TO_DATE('{0}','YYYY/MM/DD')", data.ConstructionPeriodStart2.ToShortDateString());
|
|
439 |
strcmd += string.Format(", ConstructionPeriodEnd2 = TO_DATE('{0}','YYYY/MM/DD')", data.ConstructionPeriodEnd2.ToShortDateString());
|
|
440 |
strcmd += string.Format(", StartDate = TO_DATE('{0}','YYYY/MM/DD')", data.StartDate.ToShortDateString());
|
|
441 |
strcmd += string.Format(", EndDate = TO_DATE('{0}','YYYY/MM/DD')", data.EndDate.ToShortDateString());
|
|
442 |
strcmd += string.Format(", PurchaseOrderMailingDate = TO_DATE('{0}','YYYY/MM/DD')", data.PurchaseOrderMailingDate.ToShortDateString());
|
|
443 |
strcmd += string.Format(", PurchaseOrderReturnDate = TO_DATE('{0}','YYYY/MM/DD')", data.PurchaseOrderReturnDate.ToShortDateString());
|
|
444 |
strcmd += string.Format(", PurchaseOrderReturnCheckDate = TO_DATE('{0}','YYYY/MM/DD')", data.PurchaseOrderReturnCheckDate.ToShortDateString());
|
|
435 |
strcmd += string.Format(", EstimatesExpirationDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.EstimatesExpirationDate.ToShortDateString());
|
|
436 |
strcmd += string.Format(", ConstructionPeriodStart = DATE_FORMAT('{0}','%Y/%m/%d')", data.ConstructionPeriodStart.ToShortDateString());
|
|
437 |
strcmd += string.Format(", ConstructionPeriodEnd = DATE_FORMAT('{0}','%Y/%m/%d')", data.ConstructionPeriodEnd.ToShortDateString());
|
|
438 |
strcmd += string.Format(", ConstructionPeriodStart2 = DATE_FORMAT('{0}','%Y/%m/%d')", data.ConstructionPeriodStart2.ToShortDateString());
|
|
439 |
strcmd += string.Format(", ConstructionPeriodEnd2 = DATE_FORMAT('{0}','%Y/%m/%d')", data.ConstructionPeriodEnd2.ToShortDateString());
|
|
440 |
strcmd += string.Format(", StartDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.StartDate.ToShortDateString());
|
|
441 |
strcmd += string.Format(", EndDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.EndDate.ToShortDateString());
|
|
442 |
strcmd += string.Format(", PurchaseOrderMailingDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.PurchaseOrderMailingDate.ToShortDateString());
|
|
443 |
strcmd += string.Format(", PurchaseOrderReturnDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.PurchaseOrderReturnDate.ToShortDateString());
|
|
444 |
strcmd += string.Format(", PurchaseOrderReturnCheckDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.PurchaseOrderReturnCheckDate.ToShortDateString());
|
|
445 | 445 |
|
446 | 446 |
strcmd += string.Format(", ConsumptionTaxFlg = {0}", data.ConsumptionTaxFlg); |
447 | 447 |
strcmd += string.Format(", PrimeContractorFlg = {0}", data.PrimeContractorFlg); |
... | ... | |
451 | 451 |
strcmd += string.Format(", ConstructionType = {0}", data.ConstructionType); |
452 | 452 |
strcmd += string.Format(", EstimateType = {0}", data.EstimateType); |
453 | 453 |
|
454 |
strcmd += string.Format(", BillingStartDate = TO_DATE('{0}','YYYY/MM/DD')", data.BillingStartDate.ToShortDateString());
|
|
455 |
strcmd += string.Format(", BillingDate = TO_DATE('{0}','YYYY/MM/DD')", data.BillingDate.ToShortDateString());
|
|
454 |
strcmd += string.Format(", BillingStartDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.BillingStartDate.ToShortDateString());
|
|
455 |
strcmd += string.Format(", BillingDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.BillingDate.ToShortDateString());
|
|
456 | 456 |
strcmd += string.Format(", BillingSplitFlg = {0}", data.BillingSplitFlg); |
457 |
strcmd += string.Format(", BillingSendDate = TO_DATE('{0}','YYYY/MM/DD')", data.BillingSendDate.ToShortDateString());
|
|
458 |
strcmd += string.Format(", LedgerComplateDate = TO_DATE('{0}','YYYY/MM/DD')", data.LedgerComplateDate.ToShortDateString());
|
|
457 |
strcmd += string.Format(", BillingSendDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.BillingSendDate.ToShortDateString());
|
|
458 |
strcmd += string.Format(", LedgerComplateDate = DATE_FORMAT('{0}','%Y/%m/%d')", data.LedgerComplateDate.ToShortDateString());
|
|
459 | 459 |
|
460 |
strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
460 |
strcmd += ", UpdateDate = DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
461 | 461 |
strcmd += AddSQLString; |
462 | 462 |
|
463 | 463 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
... | ... | |
571 | 571 |
wrk.EntryDate = DateTime.Parse(objwrk[(int)TableColumn.ENTRY_DATE].ToString()); |
572 | 572 |
wrk.UpdateDate = DateTime.Parse(objwrk[(int)TableColumn.UPDATE_DATE].ToString()); |
573 | 573 |
} |
574 |
catch (OracleException oraex)
|
|
574 |
catch (MySqlException myex)
|
|
575 | 575 |
{ |
576 |
logger.ErrorFormat("オラクルエラー:{0}:{1}", CommonMotions.GetMethodName(2), oraex.Message);
|
|
576 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(2), myex.Message);
|
|
577 | 577 |
} |
578 | 578 |
catch (Exception ex) |
579 | 579 |
{ |
... | ... | |
616 | 616 |
strcmd += string.Format(" ConstructionPeriod = {0}", ((int)value).ToString()); |
617 | 617 |
break; |
618 | 618 |
case (int)TableColumn.REQUESTED_DATE: |
619 |
strcmd += string.Format(" RequestedDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
619 |
strcmd += string.Format(" RequestedDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
620 | 620 |
break; |
621 | 621 |
case (int)TableColumn.ESTIMATESSUBMITDEADLINE: |
622 |
strcmd += string.Format(" EstimatesSubmitDeadline = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
622 |
strcmd += string.Format(" EstimatesSubmitDeadline = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
623 | 623 |
break; |
624 | 624 |
case (int)TableColumn.ESTIMATESSUBMITTED_DATE: |
625 |
strcmd += string.Format(" EstimatesSubmittedDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
625 |
strcmd += string.Format(" EstimatesSubmittedDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
626 | 626 |
break; |
627 | 627 |
case (int)TableColumn.PROVISIONALORDERDATE: |
628 |
strcmd += string.Format(" ProvisionalOrderDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
628 |
strcmd += string.Format(" ProvisionalOrderDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
629 | 629 |
break; |
630 | 630 |
case (int)TableColumn.ORDER_DATE: |
631 |
strcmd += string.Format(" OrderDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
631 |
strcmd += string.Format(" OrderDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
632 | 632 |
break; |
633 | 633 |
case (int)TableColumn.ORDERSTARTINGDATE: |
634 |
strcmd += string.Format(" OrderStartingDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
634 |
strcmd += string.Format(" OrderStartingDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
635 | 635 |
break; |
636 | 636 |
case (int)TableColumn.ORDERCOMPLETIONDATE: |
637 |
strcmd += string.Format(" OrderCompletionDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
637 |
strcmd += string.Format(" OrderCompletionDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
638 | 638 |
break; |
639 | 639 |
case (int)TableColumn.PREPARATIONSTARTDATE: |
640 |
strcmd += string.Format(" PreparationStartDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
640 |
strcmd += string.Format(" PreparationStartDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
641 | 641 |
break; |
642 | 642 |
case (int)TableColumn.CONSTRUCTIONSTARTINGDATE: |
643 |
strcmd += string.Format(" ConstructionStartingDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
643 |
strcmd += string.Format(" ConstructionStartingDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
644 | 644 |
break; |
645 | 645 |
case (int)TableColumn.CONSTRUCTIONCOMPLETION_DATE: |
646 |
strcmd += string.Format(" ConstructionCompletionDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
646 |
strcmd += string.Format(" ConstructionCompletionDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
647 | 647 |
break; |
648 | 648 |
case (int)TableColumn.NONORDERDATE: |
649 |
strcmd += string.Format(" NonOrderDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
649 |
strcmd += string.Format(" NonOrderDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
650 | 650 |
break; |
651 | 651 |
case (int)TableColumn.ORDERS_DECISION_PRICE: |
652 | 652 |
strcmd += string.Format(" OrdersDecisionPrice = {0}", ((int)value).ToString()); |
... | ... | |
670 | 670 |
strcmd += string.Format(" TransferConstruction = {0}", ((int)value).ToString()); |
671 | 671 |
break; |
672 | 672 |
case (int)TableColumn.TRANSFERCONSTRUCTIONDATE: |
673 |
strcmd += string.Format(" TransferConstructionDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
673 |
strcmd += string.Format(" TransferConstructionDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
674 | 674 |
break; |
675 | 675 |
case (int)TableColumn.ORDERERS_DIVISION: |
676 | 676 |
strcmd += string.Format(" OrderersDivision = {0}", ((int)value).ToString()); |
... | ... | |
679 | 679 |
strcmd += string.Format(" OrderersCode = {0}", ((int)value).ToString()); |
680 | 680 |
break; |
681 | 681 |
case (int)TableColumn.ESTIMATESEXPIRATIONDATE: |
682 |
strcmd += string.Format(" EstimatesExpirationDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
682 |
strcmd += string.Format(" EstimatesExpirationDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
683 | 683 |
break; |
684 | 684 |
case (int)TableColumn.CONSTRUCTIONPERIODSTART: |
685 |
strcmd += string.Format(" ConstructionPeriodStart = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
685 |
strcmd += string.Format(" ConstructionPeriodStart = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
686 | 686 |
break; |
687 | 687 |
case (int)TableColumn.CONSTRUCTIONPERIODEND: |
688 |
strcmd += string.Format(" ConstructionPeriodEnd = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
688 |
strcmd += string.Format(" ConstructionPeriodEnd = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
689 | 689 |
break; |
690 | 690 |
case (int)TableColumn.CONSTRUCTIONPERIODSTART2: |
691 |
strcmd += string.Format(" ConstructionPeriodStart2 = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
691 |
strcmd += string.Format(" ConstructionPeriodStart2 = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
692 | 692 |
break; |
693 | 693 |
case (int)TableColumn.CONSTRUCTIONPERIODEND2: |
694 |
strcmd += string.Format(" ConstructionPeriodEnd2 = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
694 |
strcmd += string.Format(" ConstructionPeriodEnd2 = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
695 | 695 |
break; |
696 | 696 |
case (int)TableColumn.START_DATE: |
697 |
strcmd += string.Format(" StartDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
697 |
strcmd += string.Format(" StartDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
698 | 698 |
break; |
699 | 699 |
case (int)TableColumn.END_DATE: |
700 |
strcmd += string.Format(" EndDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
700 |
strcmd += string.Format(" EndDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
701 | 701 |
break; |
702 | 702 |
case (int)TableColumn.PURCHASEORDERMAILINGDATE: |
703 |
strcmd += string.Format(" PurchaseOrderMailingDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
703 |
strcmd += string.Format(" PurchaseOrderMailingDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
704 | 704 |
break; |
705 | 705 |
case (int)TableColumn.PURCHASEORDERRETURNDATE: |
706 |
strcmd += string.Format(" PurchaseOrderReturnDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
706 |
strcmd += string.Format(" PurchaseOrderReturnDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
707 | 707 |
break; |
708 | 708 |
case (int)TableColumn.PURCHASEORDERRETURNCHECKDATE: |
709 |
strcmd += string.Format(" PurchaseOrderReturnCheckDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
709 |
strcmd += string.Format(" PurchaseOrderReturnCheckDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
710 | 710 |
break; |
711 | 711 |
case (int)TableColumn.CONSUMPTIONTAX_FLG: |
712 | 712 |
strcmd += string.Format(" ConsumptionTaxFlg = {0}", ((int)value).ToString()); |
... | ... | |
727 | 727 |
strcmd += string.Format(" EstimateType = {0}", ((int)value).ToString()); |
728 | 728 |
break; |
729 | 729 |
case (int)TableColumn.BILLINGSTARTDATE: |
730 |
strcmd += string.Format(" BillingStartDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
730 |
strcmd += string.Format(" BillingStartDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
731 | 731 |
break; |
732 | 732 |
case (int)TableColumn.BILLINGDATE: |
733 |
strcmd += string.Format(" BillingDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
733 |
strcmd += string.Format(" BillingDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
734 | 734 |
break; |
735 | 735 |
case (int)TableColumn.BILLINGSPLITFLG: |
736 | 736 |
strcmd += string.Format(" BillingSplitFlg = {0}", ((int)value).ToString()); |
737 | 737 |
break; |
738 | 738 |
case (int)TableColumn.BILLINGSENDDATE: |
739 |
strcmd += string.Format(" BillingSendDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
739 |
strcmd += string.Format(" BillingSendDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
740 | 740 |
break; |
741 | 741 |
case (int)TableColumn.LEDGERCOMPLATEDATE: |
742 |
strcmd += string.Format(" LedgerComplateDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
742 |
strcmd += string.Format(" LedgerComplateDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
743 | 743 |
break; |
744 | 744 |
} |
745 | 745 |
|
746 |
strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
746 |
strcmd += ", UpdateDate = DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
747 | 747 |
strcmd += CreatePrimarykeyString(ConstructionCode); |
748 | 748 |
|
749 | 749 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
... | ... | |
774 | 774 |
try |
775 | 775 |
{ |
776 | 776 |
// SQL作成 |
777 |
strcmd = "SELECT NVL(MAX(ConstructionCode), 0) FROM ConstructionBaseInfo" + AddSQLString;
|
|
777 |
strcmd = "SELECT IFNULL(MAX(ConstructionCode), 0) FROM ConstructionBaseInfo" + AddSQLString;
|
|
778 | 778 |
|
779 | 779 |
// SQL実行 |
780 | 780 |
if (!ExecuteReader(strcmd, ref arData, bConnect)) return iRet; |
... | ... | |
836 | 836 |
{ |
837 | 837 |
// SQL作成(oracleのDateTime型が変換できないのでCharに変換しておく) |
838 | 838 |
strcmd = "Insert Into ConstructionBaseInfo "; |
839 |
strcmd += CreateSelectSQL().Replace("ConstructionCode", ToCode.ToString()).Replace("TO_CHAR(", "").Replace(", 'YYYY/MM/DD')", "").Replace(", 'YYYY/MM/DD HH24:MI:ss')", "");
|
|
839 |
strcmd += CreateSelectSQL().Replace("ConstructionCode", ToCode.ToString()).Replace("DATE_FORMAT(", "").Replace(", '%Y/%m/%d')", "").Replace(", '%Y/%m/%d %H:%i:%s')", "");
|
|
840 | 840 |
strcmd += CreatePrimarykeyString(FromCode); |
841 | 841 |
|
842 | 842 |
// SQL実行 |
843 | 843 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
844 | 844 |
|
845 |
//strcmd = "UPDATE ConstructionBaseInfo SET EntryDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
846 |
//strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
845 |
//strcmd = "UPDATE ConstructionBaseInfo SET EntryDate = DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
846 |
//strcmd += ", UpdateDate = DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
847 | 847 |
//strcmd += CreatePrimarykeyString(FromCode); |
848 | 848 |
|
849 | 849 |
//// SQL実行 |
... | ... | |
988 | 988 |
int ConstructionCode = -1; |
989 | 989 |
|
990 | 990 |
// 枝番最大値の工事番号取得 |
991 |
string strSQL = "SELECT NVL(MAX(CONSTRUCTIONCODE), -1) FROM CONSTRUCTIONBASEINFO";
|
|
992 |
strSQL += string.Format(" WHERE TRUNC(CONSTRUCTIONCODE / 100) = {0}", CommonMotions.cnvTruncate(NowCode / 100));
|
|
991 |
string strSQL = "SELECT IFNULL(MAX(CONSTRUCTIONCODE), -1) FROM CONSTRUCTIONBASEINFO";
|
|
992 |
strSQL += string.Format(" WHERE TRUNCATE(CONSTRUCTIONCODE / 100, 0) = {0}", CommonMotions.cnvTruncate(NowCode / 100));
|
|
993 | 993 |
ArrayList arList = new ArrayList(); |
994 | 994 |
|
995 | 995 |
// データが無ければ抜ける |
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBaseInfoDetail.cs | ||
---|---|---|
6 | 6 |
using System.Collections; |
7 | 7 |
|
8 | 8 |
using log4net; |
9 |
using Oracle.ManagedDataAccess.Client;
|
|
9 |
using MySql.Data.MySqlClient;
|
|
10 | 10 |
|
11 |
using ProcessManagement.DB.Oracle;
|
|
11 |
using ProcessManagement.DB.MySql;
|
|
12 | 12 |
using ProcessManagement.DB.Core; |
13 | 13 |
using ProcessManagement.DataModel; |
14 | 14 |
using ProcessManagement.Common; |
... | ... | |
18 | 18 |
/// <summary> |
19 | 19 |
/// 工事基本情報明細DBアクセス |
20 | 20 |
/// </summary> |
21 |
public class IOConstructionBaseInfoDetail : OracleProcess
|
|
21 |
public class IOConstructionBaseInfoDetail : MySqlProcess
|
|
22 | 22 |
{ |
23 | 23 |
#region 定義部 |
24 | 24 |
/// <summary> |
... | ... | |
67 | 67 |
string strcmd = "SELECT"; |
68 | 68 |
strcmd += " ConstructionCode, DetailNo"; |
69 | 69 |
strcmd += ", DetailString"; |
70 |
strcmd += ", TO_CHAR(EntryDate, 'YYYY/MM/DD HH24:MI:ss')";
|
|
71 |
strcmd += ", TO_CHAR(UpdateDate, 'YYYY/MM/DD HH24:MI:ss')";
|
|
70 |
strcmd += ", DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')";
|
|
71 |
strcmd += ", DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')";
|
|
72 | 72 |
strcmd += " FROM ConstructionBaseInfoDetail"; |
73 | 73 |
|
74 | 74 |
return strcmd; |
... | ... | |
171 | 171 |
strcmd += string.Format(", {0}", data.DetailNo); |
172 | 172 |
strcmd += string.Format(",'{0}'", data.DetailString); |
173 | 173 |
|
174 |
strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
175 |
strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
174 |
strcmd += ", DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
175 |
strcmd += ", DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
176 | 176 |
strcmd = strcmd + ")"; |
177 | 177 |
|
178 | 178 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
... | ... | |
231 | 231 |
strcmd += string.Format(" ,DetailNo = {0}", data.DetailNo); |
232 | 232 |
strcmd += string.Format(" ,DetailString = '{0}'", data.DetailString); |
233 | 233 |
|
234 |
strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
234 |
strcmd += ", UpdateDate = DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
235 | 235 |
strcmd += AddSQLString; |
236 | 236 |
|
237 | 237 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
... | ... | |
291 | 291 |
wrk.EntryDate = DateTime.Parse(objwrk[(int)TableColumn.ENTRY_DATE].ToString()); |
292 | 292 |
wrk.UpdateDate = DateTime.Parse(objwrk[(int)TableColumn.UPDATE_DATE].ToString()); |
293 | 293 |
} |
294 |
catch (OracleException oraex)
|
|
294 |
catch (MySqlException myex)
|
|
295 | 295 |
{ |
296 |
logger.ErrorFormat("オラクルエラー:{0}:{1}", CommonMotions.GetMethodName(2), oraex.Message);
|
|
296 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(2), myex.Message);
|
|
297 | 297 |
} |
298 | 298 |
catch (Exception ex) |
299 | 299 |
{ |
... | ... | |
346 | 346 |
{ |
347 | 347 |
// SQL作成(oracleのDateTime型が変換できないのでCharに変換しておく) |
348 | 348 |
strcmd = "Insert Into ConstructionBaseInfoDetail "; |
349 |
strcmd += CreateSelectSQL().Replace("ConstructionCode", ToCode.ToString()).Replace("TO_CHAR(", "").Replace(", 'YYYY/MM/DD')", "").Replace(", 'YYYY/MM/DD HH24:MI:ss')", "");
|
|
349 |
strcmd += CreateSelectSQL().Replace("ConstructionCode", ToCode.ToString()).Replace("DATE_FORMAT(", "").Replace(", '%Y/%m/%d')", "").Replace(", '%Y/%m/%d %H:%i:%s')", "");
|
|
350 | 350 |
strcmd += CreatePrimarykeyString(FromCode); |
351 | 351 |
|
352 | 352 |
// SQL実行 |
353 | 353 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
354 | 354 |
|
355 |
//strcmd = "UPDATE ConstructionBaseInfoDetail SET EntryDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
356 |
//strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
355 |
//strcmd = "UPDATE ConstructionBaseInfoDetail SET EntryDate = DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
356 |
//strcmd += ", UpdateDate = DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
357 | 357 |
//strcmd += CreatePrimarykeyString(FromCode); |
358 | 358 |
|
359 | 359 |
//// SQL実行 |
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBudget.cs | ||
---|---|---|
6 | 6 |
using System.Collections; |
7 | 7 |
|
8 | 8 |
using log4net; |
9 |
using Oracle.ManagedDataAccess.Client;
|
|
9 |
using MySql.Data.MySqlClient;
|
|
10 | 10 |
|
11 |
using ProcessManagement.DB.Oracle;
|
|
11 |
using ProcessManagement.DB.MySql;
|
|
12 | 12 |
using ProcessManagement.DB.Core; |
13 | 13 |
using ProcessManagement.DataModel; |
14 | 14 |
using ProcessManagement.Common; |
... | ... | |
18 | 18 |
/// <summary> |
19 | 19 |
/// 工事予算書データDBアクセス |
20 | 20 |
/// </summary> |
21 |
public class IOConstructionBudget : OracleProcess
|
|
21 |
public class IOConstructionBudget : MySqlProcess
|
|
22 | 22 |
{ |
23 | 23 |
#region 定義部 |
24 | 24 |
/// <summary> |
... | ... | |
100 | 100 |
strcmd += " ,InstructorCode"; // 工事指導員コード |
101 | 101 |
strcmd += " ,InstructorName"; // 工事指導員名 |
102 | 102 |
strcmd += " ,InstructorCosts"; // 工事指導員給与 |
103 |
strcmd += " ,TO_CHAR(CreateDate, 'YYYY/MM/DD')"; // 作成日
|
|
103 |
strcmd += " ,DATE_FORMAT(CreateDate, '%Y/%m/%d')"; // 作成日
|
|
104 | 104 |
strcmd += " ,ConstructionTimes"; // 工期(単位・月) |
105 |
strcmd += " ,TO_CHAR(ConstructionStart, 'YYYY/MM/DD')"; // 契約工期開始
|
|
106 |
strcmd += " ,TO_CHAR(ConstructionEnd, 'YYYY/MM/DD')"; // 契約工期完了
|
|
105 |
strcmd += " ,DATE_FORMAT(ConstructionStart, '%Y/%m/%d')"; // 契約工期開始
|
|
106 |
strcmd += " ,DATE_FORMAT(ConstructionEnd, '%Y/%m/%d')"; // 契約工期完了
|
|
107 | 107 |
strcmd += " ,InstructorTimes"; // 指導員稼働月数 |
108 | 108 |
strcmd += " ,SalaryFlg"; // 給与振分区分 |
109 | 109 |
strcmd += " ,SalaryDays"; // 振分日数 |
... | ... | |
112 | 112 |
strcmd += " ,I_SalaryFlg"; // 指導員給与振分区分 |
113 | 113 |
strcmd += " ,I_SalaryDays"; // 指導員振分日数 |
114 | 114 |
|
115 |
strcmd += ", TO_CHAR(EntryDate, 'YYYY/MM/DD HH24:MI:ss')";
|
|
116 |
strcmd += ", TO_CHAR(UpdateDate, 'YYYY/MM/DD HH24:MI:ss')";
|
|
115 |
strcmd += ", DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')";
|
|
116 |
strcmd += ", DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')";
|
|
117 | 117 |
strcmd += " FROM ConstructionBudget"; |
118 | 118 |
|
119 | 119 |
return strcmd; |
... | ... | |
253 | 253 |
strcmd += string.Format(",'{0}'", work.InstructorName); // 工事指導員名 |
254 | 254 |
strcmd += string.Format(", {0}", work.InstructorCosts); // 工事指導員給与 |
255 | 255 |
|
256 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')",
|
|
256 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')",
|
|
257 | 257 |
work.CreateDate.ToShortDateString()); // 作成日 |
258 | 258 |
strcmd += string.Format(", {0}", work.ConstructionTimes); // 工期(単位・月) |
259 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')",
|
|
259 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')",
|
|
260 | 260 |
work.ConstructionStart.ToShortDateString()); // 契約工期開始 |
261 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')",
|
|
261 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')",
|
|
262 | 262 |
work.ConstructionEnd.ToShortDateString()); // 契約工期完了 |
263 | 263 |
|
264 | 264 |
strcmd += string.Format(", {0}", work.InstructorTimes); // 指導員稼働月数 |
... | ... | |
269 | 269 |
strcmd += string.Format(", {0}", work.I_SalaryFlg); // 指導員給与振分区分 |
270 | 270 |
strcmd += string.Format(", {0}", work.I_SalaryDays); // 指導員振分日数 |
271 | 271 |
|
272 |
strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
273 |
strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
272 |
strcmd += ", DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
273 |
strcmd += ", DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
274 | 274 |
strcmd = strcmd + ")"; |
275 | 275 |
|
276 | 276 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
... | ... | |
341 | 341 |
strcmd += string.Format(", InstructorCode = {0}", data.InstructorCode); // 工事指導員コード |
342 | 342 |
strcmd += string.Format(", InstructorName = '{0}'", data.InstructorName); // 工事指導員名 |
343 | 343 |
strcmd += string.Format(", InstructorCosts = {0}", data.InstructorCosts); // 工事指導員給与 |
344 |
strcmd += string.Format(", CreateDate = TO_DATE('{0}','YYYY/MM/DD')",
|
|
344 |
strcmd += string.Format(", CreateDate = DATE_FORMAT('{0}','%Y/%m/%d')",
|
|
345 | 345 |
data.CreateDate.ToShortDateString()); // 作成日 |
346 | 346 |
strcmd += string.Format(", ConstructionTimes = {0}", data.ConstructionTimes); // 工期(単位・月) |
347 |
strcmd += string.Format(", ConstructionStart = TO_DATE('{0}','YYYY/MM/DD')",
|
|
347 |
strcmd += string.Format(", ConstructionStart = DATE_FORMAT('{0}','%Y/%m/%d')",
|
|
348 | 348 |
data.ConstructionStart.ToShortDateString()); // 契約工期開始 |
349 |
strcmd += string.Format(", ConstructionEnd = TO_DATE('{0}','YYYY/MM/DD')",
|
|
349 |
strcmd += string.Format(", ConstructionEnd = DATE_FORMAT('{0}','%Y/%m/%d')",
|
|
350 | 350 |
data.ConstructionEnd.ToShortDateString()); // 契約工期完了 |
351 | 351 |
|
352 | 352 |
strcmd += string.Format(", InstructorTimes = {0}", data.InstructorTimes); // 指導員稼働月数 |
... | ... | |
358 | 358 |
strcmd += string.Format(", I_SalaryFlg = {0}", data.I_SalaryFlg); // 指導員給与振分区分 |
359 | 359 |
strcmd += string.Format(", I_SalaryDays = {0}", data.I_SalaryDays); // 指導員振分日数 |
360 | 360 |
|
361 |
strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
361 |
strcmd += ", UpdateDate = DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
362 | 362 |
strcmd += AddSQLString; |
363 | 363 |
|
364 | 364 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
... | ... | |
440 | 440 |
wrk.EntryDate = DateTime.Parse(objwrk[(int)ConstructionBudgetColumn.EntryDate].ToString()); |
441 | 441 |
wrk.UpdateDate = DateTime.Parse(objwrk[(int)ConstructionBudgetColumn.UpdateDate].ToString()); |
442 | 442 |
} |
443 |
catch (OracleException oraex)
|
|
443 |
catch (MySqlException myex)
|
|
444 | 444 |
{ |
445 |
logger.ErrorFormat("オラクルエラー:{0}:{1}", CommonMotions.GetMethodName(2), oraex.Message);
|
|
445 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(2), myex.Message);
|
|
446 | 446 |
} |
447 | 447 |
catch (Exception ex) |
448 | 448 |
{ |
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBudgetDetail.cs | ||
---|---|---|
6 | 6 |
using System.Collections; |
7 | 7 |
|
8 | 8 |
using log4net; |
9 |
using Oracle.ManagedDataAccess.Client;
|
|
9 |
using MySql.Data.MySqlClient;
|
|
10 | 10 |
|
11 |
using ProcessManagement.DB.Oracle;
|
|
11 |
using ProcessManagement.DB.MySql;
|
|
12 | 12 |
using ProcessManagement.DB.Core; |
13 | 13 |
using ProcessManagement.DataModel; |
14 | 14 |
using ProcessManagement.Common; |
... | ... | |
18 | 18 |
/// <summary> |
19 | 19 |
/// 工事予算データ明細DBアクセス |
20 | 20 |
/// </summary> |
21 |
public class IOConstructionBudgetDetail : OracleProcess
|
|
21 |
public class IOConstructionBudgetDetail : MySqlProcess
|
|
22 | 22 |
{ |
23 | 23 |
#region 定義部 |
24 | 24 |
/// <summary> |
... | ... | |
93 | 93 |
strcmd += ", AmountConfigRate"; // 金額構成率 |
94 | 94 |
strcmd += ", NegotiateFlg"; // 協力業者交渉フラグ |
95 | 95 |
|
96 |
strcmd += ", TO_CHAR(EntryDate, 'YYYY/MM/DD HH24:MI:ss')";
|
|
97 |
strcmd += ", TO_CHAR(UpdateDate, 'YYYY/MM/DD HH24:MI:ss')";
|
|
96 |
strcmd += ", DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')";
|
|
97 |
strcmd += ", DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')";
|
|
98 | 98 |
strcmd += " FROM ConstructionBudgetDetail"; |
99 | 99 |
|
100 | 100 |
return strcmd; |
... | ... | |
208 | 208 |
strcmd += string.Format(", {0}", work.NegotiateFlg); // 協力業者交渉フラグ |
209 | 209 |
|
210 | 210 |
|
211 |
strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
212 |
strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
211 |
strcmd += ", DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
212 |
strcmd += ", DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
213 | 213 |
strcmd = strcmd + ")"; |
214 | 214 |
|
215 | 215 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
... | ... | |
285 | 285 |
strcmd += string.Format(", NegotiateFlg = {0}", data.NegotiateFlg); // 協力業者交渉フラグ |
286 | 286 |
|
287 | 287 |
|
288 |
strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
288 |
strcmd += ", UpdateDate = DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
289 | 289 |
strcmd += AddSQLString; |
290 | 290 |
|
291 | 291 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
... | ... | |
359 | 359 |
wrk.EntryDate = DateTime.Parse(objwrk[(int)DataColumn.EntryDate].ToString()); |
360 | 360 |
wrk.UpdateDate = DateTime.Parse(objwrk[(int)DataColumn.UpdateDate].ToString()); |
361 | 361 |
} |
362 |
catch (OracleException oraex)
|
|
362 |
catch (MySqlException myex)
|
|
363 | 363 |
{ |
364 |
logger.ErrorFormat("オラクルエラー:{0}:{1}", CommonMotions.GetMethodName(2), oraex.Message);
|
|
364 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(2), myex.Message);
|
|
365 | 365 |
} |
366 | 366 |
catch (Exception ex) |
367 | 367 |
{ |
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedger.cs | ||
---|---|---|
6 | 6 |
using System.Collections; |
7 | 7 |
|
8 | 8 |
using log4net; |
9 |
using Oracle.ManagedDataAccess.Client;
|
|
9 |
using MySql.Data.MySqlClient;
|
|
10 | 10 |
|
11 |
using ProcessManagement.DB.Oracle;
|
|
11 |
using ProcessManagement.DB.MySql;
|
|
12 | 12 |
using ProcessManagement.DB.Core; |
13 | 13 |
using ProcessManagement.DataModel; |
14 | 14 |
using ProcessManagement.Common; |
... | ... | |
18 | 18 |
/// <summary> |
19 | 19 |
/// 工事詳細台帳データDBアクセス |
20 | 20 |
/// </summary> |
21 |
public class IOConstructionLedger : OracleProcess
|
|
21 |
public class IOConstructionLedger : MySqlProcess
|
|
22 | 22 |
{ |
23 | 23 |
#region 定義部 |
24 | 24 |
/// <summary> |
... | ... | |
86 | 86 |
strcmd += " ,CreatorName"; // 作成者名 |
87 | 87 |
strcmd += " ,CreateDate"; // 作成日 |
88 | 88 |
strcmd += " ,ConstructionTimes"; // 工期(単位・月) |
89 |
strcmd += " ,TO_CHAR(ConstructionStart, 'YYYY/MM/DD')"; // 契約工期開始
|
|
90 |
strcmd += " ,TO_CHAR(ConstructionEnd, 'YYYY/MM/DD')"; // 契約工期完了
|
|
89 |
strcmd += " ,DATE_FORMAT(ConstructionStart, '%Y/%m/%d')"; // 契約工期開始
|
|
90 |
strcmd += " ,DATE_FORMAT(ConstructionEnd, '%Y/%m/%d')"; // 契約工期完了
|
|
91 | 91 |
strcmd += " ,OrdersDecisionPrice"; // 税抜受注決定金額 |
92 | 92 |
strcmd += " ,CompanyExpenses"; // 会社経費合計 |
93 | 93 |
strcmd += " ,DepartmentExpenses"; // 部署経費合計 |
... | ... | |
99 | 99 |
strcmd += " ,ComplateFlg"; // 入力完了フラグ |
100 | 100 |
strcmd += " ,IntegrationFlg"; // 受注金額積算フラグ |
101 | 101 |
|
102 |
strcmd += ", TO_CHAR(EntryDate, 'YYYY/MM/DD HH24:MI:ss')";
|
|
103 |
strcmd += ", TO_CHAR(UpdateDate, 'YYYY/MM/DD HH24:MI:ss')";
|
|
102 |
strcmd += ", DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')";
|
|
103 |
strcmd += ", DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')";
|
|
104 | 104 |
strcmd += " FROM ConstructionLedger"; |
105 | 105 |
|
106 | 106 |
return strcmd; |
... | ... | |
228 | 228 |
strcmd += string.Format(", {0}", work.ConstructionPeriod); // 事業期 |
229 | 229 |
strcmd += string.Format(", {0}", work.CreatorCode); // 作成者コード |
230 | 230 |
strcmd += string.Format(",'{0}'", work.CreatorName); // 作成者名 |
231 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')",
|
|
231 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')",
|
|
232 | 232 |
work.CreateDate.ToShortDateString()); // 作成日 |
233 | 233 |
strcmd += string.Format(", {0}", work.ConstructionTimes); // 工期(単位・月) |
234 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')",
|
|
234 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')",
|
|
235 | 235 |
work.ConstructionStart.ToShortDateString()); // 契約工期開始 |
236 |
strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')",
|
|
236 |
strcmd += string.Format(", DATE_FORMAT('{0}','%Y/%m/%d')",
|
|
237 | 237 |
work.ConstructionEnd.ToShortDateString()); // 契約工期完了 |
238 | 238 |
|
239 | 239 |
strcmd += string.Format(",{0}", work.OrdersDecisionPrice); // 税抜受注決定金額 |
... | ... | |
248 | 248 |
strcmd += string.Format(",{0}", work.IntegrationFlg); // 受注金額積算フラグ |
249 | 249 |
|
250 | 250 |
|
251 |
strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
252 |
strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
251 |
strcmd += ", DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
252 |
strcmd += ", DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
253 | 253 |
strcmd = strcmd + ")"; |
254 | 254 |
|
255 | 255 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
... | ... | |
312 | 312 |
strcmd += string.Format(", ConstructionPeriod = {0}", data.ConstructionPeriod); // 事業期 |
313 | 313 |
strcmd += string.Format(", CreatorCode = {0}", data.CreatorCode); // 作成者コード |
314 | 314 |
strcmd += string.Format(", CreatorName = '{0}'", data.CreatorName); // 作成者名 |
315 |
strcmd += string.Format(", CreateDate = TO_DATE('{0}','YYYY/MM/DD')",
|
|
315 |
strcmd += string.Format(", CreateDate = DATE_FORMAT('{0}','%Y/%m/%d')",
|
|
316 | 316 |
data.CreateDate.ToShortDateString()); // 作成日 |
317 | 317 |
strcmd += string.Format(", ConstructionTimes = {0}", data.ConstructionTimes); // 工期(単位・月) |
318 |
strcmd += string.Format(", ConstructionStart = TO_DATE('{0}','YYYY/MM/DD')",
|
|
318 |
strcmd += string.Format(", ConstructionStart = DATE_FORMAT('{0}','%Y/%m/%d')",
|
|
319 | 319 |
data.ConstructionStart.ToShortDateString());// 契約工期開始 |
320 |
strcmd += string.Format(", ConstructionEnd = TO_DATE('{0}','YYYY/MM/DD')",
|
|
320 |
strcmd += string.Format(", ConstructionEnd = DATE_FORMAT('{0}','%Y/%m/%d')",
|
|
321 | 321 |
data.ConstructionEnd.ToShortDateString()); // 契約工期完了 |
322 | 322 |
|
323 | 323 |
strcmd += string.Format(", OrdersDecisionPrice = {0}", data.OrdersDecisionPrice); // 税抜受注決定金額 |
... | ... | |
331 | 331 |
strcmd += string.Format(", ComplateFlg = {0}", data.ComplateFlg); // 入力完了フラグ |
332 | 332 |
strcmd += string.Format(", IntegrationFlg = {0}", data.IntegrationFlg); // 受注金額積算フラグ |
333 | 333 |
|
334 |
strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
334 |
strcmd += ", UpdateDate = DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
335 | 335 |
strcmd += AddSQLString; |
336 | 336 |
|
337 | 337 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
... | ... | |
407 | 407 |
strcmd += string.Format(" CreatorName = '{0}'", value.ToString()); |
408 | 408 |
break; |
409 | 409 |
case (int)DataColumn.CreateDate: // 作成日 |
410 |
strcmd += string.Format(" CreateDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
410 |
strcmd += string.Format(" CreateDate = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
411 | 411 |
break; |
412 | 412 |
case (int)DataColumn.ConstructionTimes: // 工期(単位・月) |
413 | 413 |
strcmd += string.Format(" ConstructionTimes = {0}", ((int)value).ToString()); |
414 | 414 |
break; |
415 | 415 |
case (int)DataColumn.ConstructionStart: // 契約工期開始 |
416 |
strcmd += string.Format(" ConstructionStart = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
416 |
strcmd += string.Format(" ConstructionStart = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
417 | 417 |
break; |
418 | 418 |
case (int)DataColumn.ConstructionEnd: // 契約工期完了 |
419 |
strcmd += string.Format(" ConstructionEnd = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString());
|
|
419 |
strcmd += string.Format(" ConstructionEnd = DATE_FORMAT('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
|
|
420 | 420 |
break; |
421 | 421 |
case (int)DataColumn.OrdersDecisionPrice: // 税抜受注決定金額 |
422 | 422 |
strcmd += string.Format(" OrdersDecisionPrice = {0}", ((int)value).ToString()); |
... | ... | |
452 | 452 |
break; |
453 | 453 |
} |
454 | 454 |
|
455 |
strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
455 |
strcmd += ", UpdateDate = DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
456 | 456 |
strcmd += CreatePrimarykeyString(ConstructionCode); |
457 | 457 |
|
458 | 458 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
459 | 459 |
|
460 | 460 |
return true; |
461 | 461 |
} |
462 |
catch (OracleException oraex)
|
|
462 |
catch (MySqlException myex)
|
|
463 | 463 |
{ |
464 |
logger.ErrorFormat("オラクルエラー:{0}:{1}", CommonMotions.GetMethodName(2), oraex.Message);
|
|
464 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(2), myex.Message);
|
|
465 | 465 |
return false; |
466 | 466 |
} |
467 | 467 |
} |
... | ... | |
503 | 503 |
wrk.EntryDate = DateTime.Parse(objwrk[(int)DataColumn.EntryDate].ToString()); |
504 | 504 |
wrk.UpdateDate = DateTime.Parse(objwrk[(int)DataColumn.UpdateDate].ToString()); |
505 | 505 |
} |
506 |
catch (OracleException oraex)
|
|
506 |
catch (MySqlException myex)
|
|
507 | 507 |
{ |
508 |
logger.ErrorFormat("オラクルエラー:{0}:{1}", CommonMotions.GetMethodName(2), oraex.Message);
|
|
508 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(2), myex.Message);
|
|
509 | 509 |
} |
510 | 510 |
catch (Exception ex) |
511 | 511 |
{ |
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedgerDetail.cs | ||
---|---|---|
6 | 6 |
using System.Collections; |
7 | 7 |
|
8 | 8 |
using log4net; |
9 |
using Oracle.ManagedDataAccess.Client;
|
|
9 |
using MySql.Data.MySqlClient;
|
|
10 | 10 |
|
11 |
using ProcessManagement.DB.Oracle;
|
|
11 |
using ProcessManagement.DB.MySql;
|
|
12 | 12 |
using ProcessManagement.DB.Core; |
13 | 13 |
using ProcessManagement.DataModel; |
14 | 14 |
using ProcessManagement.Common; |
... | ... | |
18 | 18 |
/// <summary> |
19 | 19 |
/// 工事詳細台帳データ明細DBアクセス |
20 | 20 |
/// </summary> |
21 |
public class IOConstructionLedgerDetail : OracleProcess
|
|
21 |
public class IOConstructionLedgerDetail : MySqlProcess
|
|
22 | 22 |
{ |
23 | 23 |
#region 定義部 |
24 | 24 |
/// <summary> |
... | ... | |
101 | 101 |
strcmd += ", SalaryDays"; // 給与振分日数 |
102 | 102 |
strcmd += ", OperatingFlg"; // 担当中フラグ |
103 | 103 |
|
104 |
strcmd += ", TO_CHAR(EntryDate, 'YYYY/MM/DD HH24:MI:ss')";
|
|
105 |
strcmd += ", TO_CHAR(UpdateDate, 'YYYY/MM/DD HH24:MI:ss')";
|
|
104 |
strcmd += ", DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')";
|
|
105 |
strcmd += ", DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')";
|
|
106 | 106 |
strcmd += " FROM ConstructionLedgerDetail"; |
107 | 107 |
|
108 | 108 |
return strcmd; |
... | ... | |
245 | 245 |
strcmd += string.Format(", {0}", work.SalaryDays); // 給与振分日数 |
246 | 246 |
strcmd += string.Format(", {0}", work.OperatingFlg); // 担当中フラグ |
247 | 247 |
|
248 |
strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
249 |
strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
248 |
strcmd += ", DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
249 |
strcmd += ", DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
250 | 250 |
strcmd = strcmd + ")"; |
251 | 251 |
|
252 | 252 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
... | ... | |
327 | 327 |
strcmd += string.Format(", SalaryDays = {0}", data.SalaryDays); // 給与振分日数 |
328 | 328 |
strcmd += string.Format(", OperatingFlg = {0}", data.OperatingFlg); // 担当中フラグ |
329 | 329 |
|
330 |
strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
|
|
330 |
strcmd += ", UpdateDate = DATE_FORMAT(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')";
|
|
331 | 331 |
strcmd += AddSQLString; |
他の形式にエクスポート: Unified diff