プロジェクト

全般

プロフィール

リビジョン 252

堀内7年以上前に追加

交通費及び購入品選択月コンボバグ修正
IOクラスStringBuilder化追加

差分を表示:

branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs
14 14
        /// <summary>
15 15
        /// 本体バージョン
16 16
        /// </summary>
17
        public static int s_SystemVersion = 63;
17
        public static int s_SystemVersion = 64;
18 18

  
19 19
        /// <summary>
20 20
        /// コピー・環境バージョン
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMPersonSalary.cs
64 64
        /// <returns>true:成功 false:失敗</returns>
65 65
        private string CreateSelectSQL()
66 66
        {
67
            string strcmd = "SELECT";
68
            strcmd += "  PersonCode";
67
            StringBuilder strcmd = new StringBuilder();
68
            strcmd.Append("SELECT");
69
            strcmd.Append("  PersonCode");
69 70

  
70
            strcmd += ", DATE_FORMAT(StartDate, '%Y/%m/%d')";
71
            strcmd.Append(", DATE_FORMAT(StartDate, '%Y/%m/%d')");
71 72

  
72
            strcmd += ", MonthlySalary";
73
            strcmd += ", YearSalary";
73
            strcmd.Append(", MonthlySalary");
74
            strcmd.Append(", YearSalary");
74 75

  
75
            strcmd += ", DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')";
76
            strcmd += ", DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')";
77
            strcmd += " FROM PersonSalaryMaster";
76
            strcmd.Append(", DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')");
77
            strcmd.Append(", DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')");
78
            strcmd.Append(" FROM PersonSalaryMaster");
78 79

  
79
            return strcmd;
80
            return strcmd.ToString();
80 81
        }
81 82
        #endregion
82 83

  
......
91 92
        public bool SelectAction(string AddSQLString, ref List<PersonSalaryMaster> data, bool bConnect = true)
92 93
        {
93 94
            // インターフェース
94
            string strcmd = "";
95
            StringBuilder strcmd = new StringBuilder();
95 96
            ArrayList arData = new ArrayList();
96 97

  
97 98
            try
98 99
            {
99 100
                // SQL作成(DateTime型が変換できないのでCharに変換しておく)
100
                strcmd = CreateSelectSQL() + AddSQLString;
101
                strcmd.Append(CreateSelectSQL());
102
                strcmd.Append(AddSQLString);
101 103

  
102 104
                // SQL実行
103
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return false;
105
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
104 106

  
105 107
                // データセット
106 108
                foreach (object[] objwrk in arData)
......
114 116
            }
115 117
            catch (Exception ex)
116 118
            {
117
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
119
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
118 120
                return false;
119 121
            }
120 122
        }
......
131 133
        public bool SelectAction(string AddSQLString, ref PersonSalaryMaster data, bool bConnect = true)
132 134
        {
133 135
            // インターフェース
134
            string strcmd = "";
136
            StringBuilder strcmd = new StringBuilder();
135 137
            ArrayList arData = new ArrayList();
136 138

  
137 139
            try
138 140
            {
139 141
                // SQL作成(DateTime型が変換できないのでCharに変換しておく)
140
                strcmd = CreateSelectSQL() + AddSQLString;
142
                strcmd.Append(CreateSelectSQL());
143
                strcmd.Append(AddSQLString);
141 144

  
142 145
                // SQL実行
143
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return false;
146
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
144 147
                if (arData.Count == 0) return false;
145 148

  
146 149
                // データセット
......
151 154
            }
152 155
            catch (Exception ex)
153 156
            {
154
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
157
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
155 158
                return false;
156 159
            }
157 160
        }
......
165 168
        /// <returns>true:成功 false:失敗</returns>
166 169
        public bool InsertAction(PersonSalaryMaster data, bool bConnect = true)
167 170
        {
168
            string strcmd = "";
171
            StringBuilder strcmd = new StringBuilder();
169 172
            try
170 173
            {
171 174

  
172 175
                bool bColFirst = true;
173
                strcmd = "INSERT INTO PersonSalaryMaster";
174
                strcmd += " (";
176
                strcmd.Append("INSERT INTO PersonSalaryMaster");
177
                strcmd.Append(" (");
175 178
                foreach (var gender in Enum.GetValues(typeof(NameColumn)))
176 179
                {
177
                    if (!bColFirst) strcmd += ", ";
178
                    strcmd += gender.ToString();
180
                    if (!bColFirst) strcmd.Append(", ");
181
                    strcmd.Append(gender.ToString());
179 182
                    bColFirst = false;
180 183
                }
181
                strcmd += ") VALUES (";
184
                strcmd.Append(") VALUES (");
182 185

  
183
                strcmd += string.Format("  {0}", data.PersonCode);
186
                strcmd.AppendFormat("  {0}", data.PersonCode);
184 187

  
185
                strcmd += string.Format(", STR_TO_DATE('{0}' ,'%Y/%m/%d')", data.StartDate.ToShortDateString());
188
                strcmd.AppendFormat(", STR_TO_DATE('{0}' ,'%Y/%m/%d')", data.StartDate.ToShortDateString());
186 189

  
187
                strcmd += string.Format(", {0}", data.MonthlySalary);
188
                strcmd += string.Format(", {0}", data.YearSalary);
190
                strcmd.AppendFormat(", {0}", data.MonthlySalary);
191
                strcmd.AppendFormat(", {0}", data.YearSalary);
189 192

  
190
                strcmd += string.Format(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", data.EntryDate);
191
                strcmd += string.Format(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", data.UpdateDate);
192
                strcmd += ")";
193
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", data.EntryDate);
194
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", data.UpdateDate);
195
                strcmd.Append(")");
193 196

  
194
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
197
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
195 198

  
196 199
                return true;
197 200
            }
198 201
            catch (Exception ex)
199 202
            {
200
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
203
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
201 204
                return false;
202 205
            }
203 206
        }
......
211 214
        /// <returns>true:成功 false:失敗</returns>
212 215
        public bool InsertAction(List<PersonSalaryMaster> data, bool bConnect = true)
213 216
        {
214
            string strcmd = "";
217
            StringBuilder strcmd = new StringBuilder();
215 218
            try
216 219
            {
217 220
                bool bColFirst = true;
218
                strcmd = "INSERT INTO PersonSalaryMaster";
219
                strcmd += " (";
221
                strcmd.Append("INSERT INTO PersonSalaryMaster");
222
                strcmd.Append(" (");
220 223
                foreach (var gender in Enum.GetValues(typeof(NameColumn)))
221 224
                {
222
                    if (!bColFirst) strcmd += ", ";
223
                    strcmd += gender.ToString();
225
                    if (!bColFirst) strcmd.Append(", ");
226
                    strcmd.Append(gender.ToString());
224 227
                    bColFirst = false;
225 228
                }
226
                strcmd += ") VALUES";
229
                strcmd.Append(") VALUES");
227 230

  
228 231
                bool bDataFirst = true;
229 232
                foreach (PersonSalaryMaster work in data)
230 233
                {
231
                    if (bDataFirst) strcmd += " (";
232
                    else strcmd += ", (";
234
                    if (bDataFirst) strcmd.Append(" (");
235
                    else strcmd.Append(", (");
233 236

  
234
                    strcmd += string.Format("  {0}", work.PersonCode);
235
                    strcmd += string.Format(", STR_TO_DATE('{0}' ,'%Y/%m/%d')", work.StartDate.ToShortDateString());
236
                    strcmd += string.Format(", {0}", work.MonthlySalary);
237
                    strcmd += string.Format(", {0}", work.YearSalary);
237
                    strcmd.AppendFormat("  {0}", work.PersonCode);
238
                    strcmd.AppendFormat(", STR_TO_DATE('{0}' ,'%Y/%m/%d')", work.StartDate.ToShortDateString());
239
                    strcmd.AppendFormat(", {0}", work.MonthlySalary);
240
                    strcmd.AppendFormat(", {0}", work.YearSalary);
238 241

  
239
                    strcmd += string.Format(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
240
                    strcmd += string.Format(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
241
                    strcmd += ")";
242
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
243
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
244
                    strcmd.Append(")");
242 245

  
243 246
                    bDataFirst = false;
244 247
                }
245 248

  
246
                if (!ExecuteNonQuery(strcmd, false)) return false;
249
                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
247 250

  
248 251
                return true;
249 252
            }
250 253
            catch (Exception ex)
251 254
            {
252
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
255
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
253 256
                return false;
254 257
            }
255 258
        }
......
264 267
        /// <returns>true:成功 false:失敗</returns>
265 268
        public bool UpdateAction(string AddSQLString, PersonSalaryMaster data, bool bConnect = true)
266 269
        {
267
            string strcmd = "";
270
            StringBuilder strcmd = new StringBuilder();
268 271
            try
269 272
            {
270 273

  
271
                strcmd = "UPDATE PersonSalaryMaster";
274
                strcmd.Append("UPDATE PersonSalaryMaster");
272 275

  
273
                strcmd += " SET";
276
                strcmd.Append(" SET");
274 277

  
275
                strcmd += string.Format("  PersonCode = {0}", data.PersonCode.ToString());
278
                strcmd.AppendFormat("  PersonCode = {0}", data.PersonCode.ToString());
276 279
                
277
                strcmd += string.Format(", StartDate = STR_TO_DATE('{0}','%Y/%m/%d')", data.StartDate.ToShortDateString());
280
                strcmd.AppendFormat(", StartDate = STR_TO_DATE('{0}','%Y/%m/%d')", data.StartDate.ToShortDateString());
278 281
                
279
                strcmd += string.Format(", MonthlySalary = {0}", data.MonthlySalary.ToString());
280
                strcmd += string.Format(", YearSalary = {0}", data.YearSalary.ToString());
282
                strcmd.AppendFormat(", MonthlySalary = {0}", data.MonthlySalary.ToString());
283
                strcmd.AppendFormat(", YearSalary = {0}", data.YearSalary.ToString());
281 284

  
282
                strcmd += ", UpdateDate = NOW()";
283
                strcmd += AddSQLString;
285
                strcmd.Append(", UpdateDate = NOW()");
286
                strcmd.Append(AddSQLString);
284 287

  
285
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
288
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
286 289

  
287 290
                return true;
288 291
            }
289 292
            catch (Exception ex)
290 293
            {
291
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
294
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
292 295
                return false;
293 296
            }
294 297
        }
......
304 307
        public bool DeleteAction(string AddSQLString, bool bConnect = true)
305 308
        {
306 309
            // インターフェース
307
            string strcmd = "";
310
            StringBuilder strcmd = new StringBuilder();
308 311
            try
309 312
            {
310
                strcmd = string.Format("{0}{1}", "DELETE FROM PersonSalaryMaster", AddSQLString);
313
                strcmd.AppendFormat("{0}{1}", "DELETE FROM PersonSalaryMaster", AddSQLString);
311 314

  
312
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
315
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
313 316

  
314 317
                return true;
315 318
            }
316 319
            catch (Exception ex)
317 320
            {
318
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
321
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
319 322
                return false;
320 323
            }
321 324
        }
......
377 380
        /// <returns>Where文字列</returns>
378 381
        public string CreatePrimarykeyString(int PersonCode, DateTime StartDate)
379 382
        {
380
            string strWork = "";
383
            StringBuilder strWork = new StringBuilder();
381 384
            try
382 385
            {
383
                strWork = string.Format(" Where PersonCode = {0}", PersonCode);
386
                strWork.AppendFormat(" Where PersonCode = {0}", PersonCode);
384 387
                if (StartDate.Date != DateTime.MinValue)
385
                    strWork = string.Format(" AND StartDate = STR_TO_DATE('{0}','%Y/%m/%d')", StartDate.ToShortDateString());
388
                    strWork.AppendFormat(" AND StartDate = STR_TO_DATE('{0}','%Y/%m/%d')", StartDate.ToShortDateString());
386 389
            }
387 390
            catch (Exception ex)
388 391
            {
389
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork);
392
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork.ToString());
390 393
            }
391 394

  
392
            return strWork;
395
            return strWork.ToString();
393 396
        }
394 397
        #endregion
395 398
    }
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMProcessExcute.cs
64 64
        private string CreateSelectSQL()
65 65
        {
66 66
            // SQL作成(DateTime型が変換できないのでCharに変換しておく)
67
            string strcmd = "SELECT";
68
            strcmd += "  SecCode";
69
            strcmd += " ,ExecCode";
70
            strcmd += " ,EditFlg";
71
            strcmd += " ,DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')";
72
            strcmd += " ,DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')";
73
            strcmd += " FROM ProcessExcuteMaster";
67
            StringBuilder strcmd = new StringBuilder();
68
            strcmd.Append("SELECT");
69
            strcmd.Append("  SecCode");
70
            strcmd.Append(" ,ExecCode");
71
            strcmd.Append(" ,EditFlg");
72
            strcmd.Append(" ,DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')");
73
            strcmd.Append(" ,DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')");
74
            strcmd.Append(" FROM ProcessExcuteMaster");
74 75

  
75
            return strcmd;
76
            return strcmd.ToString();
76 77
        }
77 78
        #endregion
78 79

  
......
87 88
        public bool SelectAction(string AddSQLString, ref List<ProcessExcute> data, bool bConnect = true)
88 89
        {
89 90
            // インターフェース
90
            string strcmd = "";
91
            StringBuilder strcmd = new StringBuilder();
91 92
            ArrayList arData = new ArrayList();
92 93

  
93 94
            try
94 95
            {
95 96
                // SQL作成(DateTime型が変換できないのでCharに変換しておく)
96
                strcmd = CreateSelectSQL() + AddSQLString;
97
                strcmd.Append(CreateSelectSQL());
98
                strcmd.Append(AddSQLString);
97 99

  
98 100
                // SQL実行
99
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return false;
101
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
100 102

  
101 103
                // データセット
102 104
                foreach (object[] objwrk in arData)
......
110 112
            }
111 113
            catch (Exception ex)
112 114
            {
113
                logger.ErrorFormat("起動対象エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
115
                logger.ErrorFormat("起動対象エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
114 116
                return false;
115 117
            }
116 118
        }
......
127 129
        public bool SelectAction(string AddSQLString, ref ProcessExcute data, bool bConnect = true)
128 130
        {
129 131
            // インターフェース
130
            string strcmd = "";
132
            StringBuilder strcmd = new StringBuilder();
131 133
            ArrayList arData = new ArrayList();
132 134

  
133 135
            try
134 136
            {
135 137
                // SQL作成(DateTime型が変換できないのでCharに変換しておく)
136
                strcmd = CreateSelectSQL() + AddSQLString;
138
                strcmd.Append(CreateSelectSQL());
139
                strcmd.Append(AddSQLString);
137 140

  
138 141
                // SQL実行
139
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return false;
142
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
140 143
                if (arData.Count == 0) return false;
141 144
                // データセット
142 145
                foreach (object[] objwrk in arData)
......
149 152
            }
150 153
            catch (Exception ex)
151 154
            {
152
                logger.ErrorFormat("起動対象エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
155
                logger.ErrorFormat("起動対象エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
153 156
                return false;
154 157
            }
155 158
        }
......
163 166
        /// <returns>true:成功 false:失敗</returns>
164 167
        public bool InsertAction(ProcessExcute data, bool bConnect = true)
165 168
        {
166
            string strcmd = "";
169
            StringBuilder strcmd = new StringBuilder();
167 170
            try
168 171
            {
169 172

  
170 173
                bool bColFirst = true;
171
                strcmd = "INSERT INTO ProcessExcuteMaster";
172
                strcmd += " (";
174
                strcmd.Append("INSERT INTO ProcessExcuteMaster");
175
                strcmd.Append(" (");
173 176
                foreach (var gender in Enum.GetValues(typeof(TableColumn)))
174 177
                {
175
                    if (!bColFirst) strcmd += ", ";
176
                    strcmd += gender.ToString();
178
                    if (!bColFirst) strcmd.Append(", ");
179
                    strcmd.Append(gender.ToString());
177 180
                    bColFirst = false;
178 181
                }
179
                strcmd += ") VALUES (";
182
                strcmd.Append(") VALUES (");
180 183

  
181
                strcmd += data.SecCode.ToString();
184
                strcmd.AppendFormat(" {0}", data.SecCode.ToString());
182 185

  
183
                strcmd += ", " + data.ExecCode.ToString();
184
                strcmd += ", " + data.EditFlg.ToString();
186
                strcmd.AppendFormat(", {0}", data.ExecCode.ToString());
187
                strcmd.AppendFormat(", {0}", data.EditFlg.ToString());
185 188

  
186
                strcmd += string.Format(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", data.EntryDate);
187
                strcmd += string.Format(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", data.UpdateDate);
188
                strcmd += ")";
189
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", data.EntryDate);
190
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", data.UpdateDate);
191
                strcmd.Append(")");
189 192

  
190
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
193
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
191 194

  
192 195
                return true;
193 196
            }
194 197
            catch (Exception ex)
195 198
            {
196
                logger.ErrorFormat("起動対象エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
199
                logger.ErrorFormat("起動対象エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
197 200
                return false;
198 201
            }
199 202
        }
......
207 210
        /// <returns>true:成功 false:失敗</returns>
208 211
        public bool InsertAction(List<ProcessExcute> data, bool bConnect = true)
209 212
        {
210
            string strcmd = "";
213
            StringBuilder strcmd = new StringBuilder();
211 214
            try
212 215
            {
213 216
                bool bColFirst = true;
214
                strcmd = "INSERT INTO ProcessExcuteMaster";
215
                strcmd += " (";
217
                strcmd.Append("INSERT INTO ProcessExcuteMaster");
218
                strcmd.Append(" (");
216 219
                foreach (var gender in Enum.GetValues(typeof(TableColumn)))
217 220
                {
218
                    if (!bColFirst) strcmd += ", ";
219
                    strcmd += gender.ToString();
221
                    if (!bColFirst) strcmd.Append(", ");
222
                    strcmd.Append(gender.ToString());
220 223
                    bColFirst = false;
221 224
                }
222
                strcmd += ") VALUES";
225
                strcmd.Append(") VALUES");
223 226

  
224 227
                bool bDataFirst = true;
225 228
                foreach (ProcessExcute work in data)
226 229
                {
227
                    if (bDataFirst) strcmd += " (";
228
                    else strcmd += ", (";
230
                    if (bDataFirst) strcmd.Append(" (");
231
                    else strcmd.Append(", (");
229 232

  
230
                    strcmd += work.SecCode.ToString();
231
                    strcmd += ", " + work.ExecCode.ToString();
232
                    strcmd += ", " + work.EditFlg.ToString();
233
                    strcmd.AppendFormat(" {0}", work.SecCode.ToString());
234
                    strcmd.AppendFormat(",{0}", work.ExecCode.ToString());
235
                    strcmd.AppendFormat(",{0}", work.EditFlg.ToString());
233 236

  
234
                    strcmd += string.Format(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
235
                    strcmd += string.Format(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
236
                    strcmd += ")";
237
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
238
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
239
                    strcmd.Append(")");
237 240

  
238 241
                    bDataFirst = false;
239 242
                }
240 243

  
241
                if (!ExecuteNonQuery(strcmd, false)) return false;
244
                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
242 245

  
243 246
                return true;
244 247
            }
245 248
            catch (Exception ex)
246 249
            {
247
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
250
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
248 251
                return false;
249 252
            }
250 253
        }
......
259 262
        /// <returns>true:成功 false:失敗</returns>
260 263
        public bool UpdateAction(string AddSQLString, ProcessExcute data, bool bConnect = true)
261 264
        {
262
            string strcmd = "";
265
            StringBuilder strcmd = new StringBuilder();
263 266
            try
264 267
            {
265 268

  
266
                strcmd = "UPDATE ProcessExcuteMaster";
269
                strcmd.Append("UPDATE ProcessExcuteMaster");
267 270

  
268
                strcmd += " SET";
271
                strcmd.Append(" SET");
269 272

  
270
                strcmd += string.Format(" SecCode = {0}", data.SecCode.ToString());
273
                strcmd.AppendFormat(" SecCode = {0}", data.SecCode.ToString());
271 274

  
272
                strcmd += string.Format(",ExecCode = {0}", data.ExecCode.ToString());
275
                strcmd.AppendFormat(",ExecCode = {0}", data.ExecCode.ToString());
273 276

  
274
                strcmd += string.Format(",EditFlg = {0}", data.EditFlg.ToString());
277
                strcmd.AppendFormat(",EditFlg = {0}", data.EditFlg.ToString());
275 278

  
276
                strcmd += " ,UpdateDate = NOW()";
279
                strcmd.Append(" ,UpdateDate = NOW()");
277 280

  
278
                strcmd += AddSQLString;
281
                strcmd.Append(AddSQLString);
279 282

  
280
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
283
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
281 284

  
282 285
                return true;
283 286
            }
284 287
            catch (Exception ex)
285 288
            {
286
                logger.ErrorFormat("起動対象エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
289
                logger.ErrorFormat("起動対象エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
287 290
                return false;
288 291
            }
289 292
        }
......
299 302
        public bool DeleteAction(string AddSQLString, bool bConnect = true)
300 303
        {
301 304
            // インターフェース
302
            string strcmd = "";
305
            StringBuilder strcmd = new StringBuilder();
303 306
            try
304 307
            {
305
                strcmd = string.Format("{0}{1}", "DELETE FROM ProcessExcuteMaster", AddSQLString);
308
                strcmd.AppendFormat("{0}{1}", "DELETE FROM ProcessExcuteMaster", AddSQLString);
306 309

  
307
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
310
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
308 311

  
309 312
                return true;
310 313
            }
311 314
            catch (Exception ex)
312 315
            {
313
                logger.ErrorFormat("起動対象エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
316
                logger.ErrorFormat("起動対象エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
314 317
                return false;
315 318
            }
316 319
        }
......
352 355
        /// </summary>
353 356
        public string CreatePrimarykeyString(int SecCode, int ExecCode = 0)
354 357
        {
355
            string strWork = "";
358
            StringBuilder strWork = new StringBuilder();
356 359
            try
357 360
            {
358
                strWork = string.Format(" Where SecCode = {0}", SecCode);
361
                strWork.AppendFormat(" Where SecCode = {0}", SecCode);
359 362
                if (ExecCode != 0)
360
                    strWork = string.Format(" And ExecCode = {0}", ExecCode);
363
                    strWork.AppendFormat(" And ExecCode = {0}", ExecCode);
361 364
            }
362 365
            catch (Exception ex)
363 366
            {
364
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork);
367
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork.ToString());
365 368
            }
366 369

  
367
            return strWork;
370
            return strWork.ToString();
368 371
        }
369 372
        #endregion
370 373
    }
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSecurity.cs
65 65
        private string CreateSelectSQL()
66 66
        {
67 67
            // SQL作成(DateTime型が変換できないのでCharに変換しておく)
68
            string strcmd = "SELECT";
69
            strcmd += "  SecCode";
70
            strcmd += " ,DisplayOrder";
71
            strcmd += " ,SecName";
72
            strcmd += " ,SecRank";
73
            strcmd += " ,SecRange";
74
            strcmd += " ,GeneralAffairs";
75
            strcmd += " ,SelectBackColor";
68
            StringBuilder strcmd = new StringBuilder();
69
            strcmd.Append("SELECT");
70
            strcmd.Append("  SecCode");
71
            strcmd.Append(" ,DisplayOrder");
72
            strcmd.Append(" ,SecName");
73
            strcmd.Append(" ,SecRank");
74
            strcmd.Append(" ,SecRange");
75
            strcmd.Append(" ,GeneralAffairs");
76
            strcmd.Append(" ,SelectBackColor");
76 77

  
77
            strcmd += " ,DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')";
78
            strcmd += " ,DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')";
79
            strcmd += " FROM SecurityMaster";
78
            strcmd.Append(" ,DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')");
79
            strcmd.Append(" ,DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')");
80
            strcmd.Append(" FROM SecurityMaster");
80 81

  
81
            return strcmd;
82
            return strcmd.ToString();
82 83
        }
83 84
        #endregion
84 85

  
......
93 94
        public bool SelectAction(string AddSQLString, ref List<SecurityMaster> data, bool bConnect = true)
94 95
        {
95 96
            // インターフェース
96
            string strcmd = "";
97
            StringBuilder strcmd = new StringBuilder();
97 98
            ArrayList arData = new ArrayList();
98 99

  
99 100
            try
100 101
            {
101 102
                // SQL作成(DateTime型が変換できないのでCharに変換しておく)
102
                strcmd = CreateSelectSQL() + AddSQLString;
103
                strcmd.Append(CreateSelectSQL());
104
                strcmd.Append(AddSQLString);
103 105

  
104 106
                // SQL実行
105
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return false;
107
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
106 108

  
107 109
                // データセット
108 110
                foreach (object[] objwrk in arData)
......
116 118
            }
117 119
            catch (Exception ex)
118 120
            {
119
                logger.ErrorFormat("保護区分エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
121
                logger.ErrorFormat("保護区分エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
120 122
                return false;
121 123
            }
122 124
        }
......
133 135
        public bool SelectAction(string AddSQLString, ref SecurityMaster data, bool bConnect = true)
134 136
        {
135 137
            // インターフェース
136
            string strcmd = "";
138
            StringBuilder strcmd = new StringBuilder();
137 139
            ArrayList arData = new ArrayList();
138 140

  
139 141
            try
140 142
            {
141 143
                // SQL作成(DateTime型が変換できないのでCharに変換しておく)
142
                strcmd = CreateSelectSQL() + AddSQLString;
144
                strcmd.Append(CreateSelectSQL());
145
                strcmd.Append(AddSQLString);
143 146

  
144 147
                // SQL実行
145
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return false;
148
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
146 149
                if (arData.Count == 0) return false;
147 150
                // データセット
148 151
                foreach (object[] objwrk in arData)
......
155 158
            }
156 159
            catch (Exception ex)
157 160
            {
158
                logger.ErrorFormat("保護区分エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
161
                logger.ErrorFormat("保護区分エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
159 162
                return false;
160 163
            }
161 164
        }
......
169 172
        /// <returns>true:成功 false:失敗</returns>
170 173
        public bool InsertAction(SecurityMaster work, bool bConnect = true)
171 174
        {
172
            string strcmd = "";
175
            StringBuilder strcmd = new StringBuilder();
173 176
            try
174 177
            {
175 178

  
176 179
                bool bColFirst = true;
177
                strcmd = "INSERT INTO SecurityMaster";
178
                strcmd += " (";
180
                strcmd.Append("INSERT INTO SecurityMaster");
181
                strcmd.Append(" (");
179 182
                foreach (var gender in Enum.GetValues(typeof(TableColumn)))
180 183
                {
181
                    if (!bColFirst) strcmd += ", ";
182
                    strcmd += gender.ToString();
184
                    if (!bColFirst) strcmd.Append(", ");
185
                    strcmd.Append(gender.ToString());
183 186
                    bColFirst = false;
184 187
                }
185
                strcmd += ") VALUES (";
188
                strcmd.Append(") VALUES (");
186 189

  
187
                strcmd += work.SecCode.ToString();
188
                strcmd += string.Format(", {0}", work.DisplayOrder);
189
                strcmd += string.Format(",'{0}'", work.SecName);
190
                strcmd += string.Format(", {0}", work.SecRank);
191
                strcmd += string.Format(", {0}", work.SecRange);
192
                strcmd += string.Format(", {0}", work.GeneralAffairs);
193
                strcmd += string.Format(",'{0}'", work.SelectBackColor);
190
                strcmd.AppendFormat(" {0}", work.SecCode.ToString());
191
                strcmd.AppendFormat(", {0}", work.DisplayOrder);
192
                strcmd.AppendFormat(",'{0}'", work.SecName);
193
                strcmd.AppendFormat(", {0}", work.SecRank);
194
                strcmd.AppendFormat(", {0}", work.SecRange);
195
                strcmd.AppendFormat(", {0}", work.GeneralAffairs);
196
                strcmd.AppendFormat(",'{0}'", work.SelectBackColor);
194 197

  
195
                strcmd += string.Format(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
196
                strcmd += string.Format(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
197
                strcmd += ")";
198
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
199
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
200
                strcmd.Append(")");
198 201

  
199
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
202
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
200 203

  
201 204
                return true;
202 205
            }
203 206
            catch (Exception ex)
204 207
            {
205
                logger.ErrorFormat("保護区分エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
208
                logger.ErrorFormat("保護区分エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
206 209
                return false;
207 210
            }
208 211
        }
......
216 219
        /// <returns>true:成功 false:失敗</returns>
217 220
        public bool InsertAction(List<SecurityMaster> data, bool bConnect = true)
218 221
        {
219
            string strcmd = "";
222
            StringBuilder strcmd = new StringBuilder();
220 223
            try
221 224
            {
222 225
                bool bColFirst = true;
223
                strcmd = "INSERT INTO SecurityMaster";
224
                strcmd += " (";
226
                strcmd.Append("INSERT INTO SecurityMaster");
227
                strcmd.Append(" (");
225 228
                foreach (var gender in Enum.GetValues(typeof(TableColumn)))
226 229
                {
227
                    if (!bColFirst) strcmd += ", ";
228
                    strcmd += gender.ToString();
230
                    if (!bColFirst) strcmd.Append(", ");
231
                    strcmd.Append(gender.ToString());
229 232
                    bColFirst = false;
230 233
                }
231
                strcmd += ") VALUES";
234
                strcmd.Append(") VALUES");
232 235

  
233 236
                bool bDataFirst = true;
234 237
                foreach (SecurityMaster work in data)
235 238
                {
236
                    if (bDataFirst) strcmd += " (";
237
                    else strcmd += ", (";
239
                    if (bDataFirst) strcmd.Append(" (");
240
                    else strcmd.Append(", (");
238 241

  
239
                    strcmd += string.Format("  {0}", work.SecCode);
240
                    strcmd += string.Format(", {0}", work.DisplayOrder);
241
                    strcmd += string.Format(",'{0}'", work.SecName);
242
                    strcmd += string.Format(", {0}", work.SecRank);
243
                    strcmd += string.Format(", {0}", work.SecRange);
244
                    strcmd += string.Format(", {0}", work.GeneralAffairs);
245
                    strcmd += string.Format(",'{0}'", work.SelectBackColor);
242
                    strcmd.AppendFormat("  {0}", work.SecCode);
243
                    strcmd.AppendFormat(", {0}", work.DisplayOrder);
244
                    strcmd.AppendFormat(",'{0}'", work.SecName);
245
                    strcmd.AppendFormat(", {0}", work.SecRank);
246
                    strcmd.AppendFormat(", {0}", work.SecRange);
247
                    strcmd.AppendFormat(", {0}", work.GeneralAffairs);
248
                    strcmd.AppendFormat(",'{0}'", work.SelectBackColor);
246 249

  
247
                    strcmd += string.Format(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
248
                    strcmd += string.Format(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
249
                    strcmd += ")";
250
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
251
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
252
                    strcmd.Append(")");
250 253

  
251 254
                    bDataFirst = false;
252 255
                }
253 256

  
254
                if (!ExecuteNonQuery(strcmd, false)) return false;
257
                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
255 258

  
256 259
                return true;
257 260
            }
258 261
            catch (Exception ex)
259 262
            {
260
                logger.ErrorFormat("保護区分エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
263
                logger.ErrorFormat("保護区分エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
261 264
                return false;
262 265
            }
263 266
        }
......
272 275
        /// <returns>true:成功 false:失敗</returns>
273 276
        public bool UpdateAction(string AddSQLString, SecurityMaster data, bool bConnect = true)
274 277
        {
275
            string strcmd = "";
278
            StringBuilder strcmd = new StringBuilder();
276 279
            try
277 280
            {
278 281

  
279
                strcmd = "UPDATE SecurityMaster";
282
                strcmd.Append("UPDATE SecurityMaster");
280 283

  
281
                strcmd += " SET";
284
                strcmd.Append(" SET");
282 285

  
283
                strcmd += string.Format(" SecCode = {0}", data.SecCode);
284
                strcmd += string.Format(",DisplayOrder = {0}", data.DisplayOrder);
285
                strcmd += string.Format(",SecName = '{0}'", data.SecName);
286
                strcmd += string.Format(",SecRank = {0}", data.SecRank);
287
                strcmd += string.Format(",SecRange = {0}", data.SecRange);
288
                strcmd += string.Format(",GeneralAffairs = {0}", data.GeneralAffairs);
289
                strcmd += string.Format(",SelectBackColor = '{0}'", data.SelectBackColor);
286
                strcmd.AppendFormat(" SecCode = {0}", data.SecCode);
287
                strcmd.AppendFormat(",DisplayOrder = {0}", data.DisplayOrder);
288
                strcmd.AppendFormat(",SecName = '{0}'", data.SecName);
289
                strcmd.AppendFormat(",SecRank = {0}", data.SecRank);
290
                strcmd.AppendFormat(",SecRange = {0}", data.SecRange);
291
                strcmd.AppendFormat(",GeneralAffairs = {0}", data.GeneralAffairs);
292
                strcmd.AppendFormat(",SelectBackColor = '{0}'", data.SelectBackColor);
290 293

  
291
                strcmd += ", UpdateDate = NOW()";
292
                strcmd += AddSQLString;
294
                strcmd.Append(", UpdateDate = NOW()");
295
                strcmd.Append(AddSQLString);
293 296

  
294
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
297
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
295 298

  
296 299
                return true;
297 300
            }
298 301
            catch (Exception ex)
299 302
            {
300
                logger.ErrorFormat("保護区分エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
303
                logger.ErrorFormat("保護区分エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
301 304
                return false;
302 305
            }
303 306
        }
......
313 316
        public bool DeleteAction(string AddSQLString, bool bConnect = true)
314 317
        {
315 318
            // インターフェース
316
            string strcmd = "";
319
            StringBuilder strcmd = new StringBuilder();
317 320
            try
318 321
            {
319
                strcmd = string.Format("{0}{1}", "DELETE FROM SecurityMaster", AddSQLString);
322
                strcmd.AppendFormat("{0}{1}", "DELETE FROM SecurityMaster", AddSQLString);
320 323

  
321
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
324
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
322 325

  
323 326
                return true;
324 327
            }
325 328
            catch (Exception ex)
326 329
            {
327
                logger.ErrorFormat("保護区分エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
330
                logger.ErrorFormat("保護区分エラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
328 331
                return false;
329 332
            }
330 333
        }
......
341 344
        /// <returns></returns>
342 345
        public bool UpdateFeild(int SecurityCode, int FeildNo, object value, bool bConnect = true)
343 346
        {
344
            string strcmd = "";
347
            StringBuilder strcmd = new StringBuilder();
345 348
            try
346 349
            {
347
                strcmd = "UPDATE SecurityMaster";
350
                strcmd.Append("UPDATE SecurityMaster");
348 351

  
349
                strcmd += " SET";
352
                strcmd.Append(" SET");
350 353
                switch (FeildNo)
351 354
                {
352 355
                    case (int) TableColumn.SecCode:
353
                        strcmd += string.Format(" SecurityCode = {0}", ((int)value).ToString());
356
                        strcmd.AppendFormat(" SecurityCode = {0}", ((int)value).ToString());
354 357
                        break;
355 358
                    case (int)TableColumn.DisplayOrder:
356
                        strcmd += string.Format(" DisplayOrder = {0}", ((int)value).ToString());
359
                        strcmd.AppendFormat(" DisplayOrder = {0}", ((int)value).ToString());
357 360
                        break;
358 361
                    case (int)TableColumn.SecName:
359
                        strcmd += string.Format(" SecurityName = '{0}'", value.ToString());
362
                        strcmd.AppendFormat(" SecurityName = '{0}'", value.ToString());
360 363
                        break;
361 364
                    case (int)TableColumn.SecRank:
362
                        strcmd += string.Format(" SecurityRank = {0}", ((int)value).ToString());
365
                        strcmd.AppendFormat(" SecurityRank = {0}", ((int)value).ToString());
363 366
                        break;
364 367
                    case (int)TableColumn.SecRange:
365
                        strcmd += string.Format(" SecurityRange = {0}", ((int)value).ToString());
368
                        strcmd.AppendFormat(" SecurityRange = {0}", ((int)value).ToString());
366 369
                        break;
367 370
                    case (int)TableColumn.GeneralAffairs:
368
                        strcmd += string.Format(" GeneralAffairs = {0}", ((int)value).ToString());
371
                        strcmd.AppendFormat(" GeneralAffairs = {0}", ((int)value).ToString());
369 372
                        break;
370 373

  
371 374
                    case (int)TableColumn.SelectBackColor:
372
                        strcmd += string.Format(" SelectBackColor = '{0}'", value.ToString());
375
                        strcmd.AppendFormat(" SelectBackColor = '{0}'", value.ToString());
373 376
                        break;
374 377
                }
375 378

  
376
                strcmd += ", UpdateDate = NOW()";
377
                strcmd += CreatePrimarykeyString(SecurityCode);
379
                strcmd.Append(", UpdateDate = NOW()");
380
                strcmd.Append(CreatePrimarykeyString(SecurityCode));
378 381

  
379
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
382
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
380 383

  
381 384
                return true;
382 385
            }
383 386
            catch (Exception ex)
384 387
            {
385
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
388
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
386 389
                return false;
387 390
            }
388 391
        }
......
429 432
        /// <returns>Where文字列</returns>
430 433
        public string CreatePrimarykeyString(int SecurityCode)
431 434
        {
432
            string strWork = "";
435
            StringBuilder strWork = new StringBuilder(); ;
433 436
            try
434 437
            {
435
                strWork = string.Format(" Where SecCode = {0}", SecurityCode);
438
                strWork.AppendFormat(" Where SecCode = {0}", SecurityCode);
436 439
            }
437 440
            catch (Exception ex)
438 441
            {
439
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork);
442
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork.ToString());
440 443
            }
441 444

  
442
            return strWork;
445
            return strWork.ToString();
443 446
        }
444 447
        #endregion
445 448

  
......
453 456
        public int SelectMaxSecurityCount(string AddSQLString, bool bConnect = true)
454 457
        {
455 458
            // インターフェース
456
            string strcmd = "";
459
            StringBuilder strcmd = new StringBuilder();
457 460
            ArrayList arData = new ArrayList();
458 461
            int iRet = 0;
459 462
            try
460 463
            {
461 464
                // SQL作成
462
                strcmd = "SELECT IFNULL(MAX(SecCode), 0) FROM SecurityMaster" + AddSQLString;
465
                strcmd.AppendFormat("SELECT IFNULL(MAX(SecCode), 0) FROM SecurityMaster{0}", AddSQLString);
463 466

  
464 467
                // SQL実行
465
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return iRet;
468
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return iRet;
466 469

  
467 470
                // データセット
468 471
                object[] objwrk = (object[])arData[0];
......
472 475
            }
473 476
            catch (Exception ex)
474 477
            {
475
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
478
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
476 479
                return -1;
477 480
            }
478 481
        }
......
488 491
        public int SelectMaxDisplayCount(string AddSQLString, bool bConnect = true)
489 492
        {
490 493
            // インターフェース
491
            string strcmd = "";
494
            StringBuilder strcmd = new StringBuilder();
492 495
            ArrayList arData = new ArrayList();
493 496
            int iRet = 0;
494 497
            try
495 498
            {
496 499
                // SQL作成
497
                strcmd = "SELECT IFNULL(MAX(DISPLAYORDER), 0) FROM SecurityMaster" + AddSQLString;
500
                strcmd.AppendFormat("SELECT IFNULL(MAX(DISPLAYORDER), 0) FROM SecurityMaster{0}", AddSQLString);
498 501

  
499 502
                // SQL実行
500
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return iRet;
503
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return iRet;
501 504

  
502 505
                // データセット
503 506
                object[] objwrk = (object[])arData[0];
......
507 510
            }
508 511
            catch (Exception ex)
509 512
            {
510
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
513
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
511 514
                return -1;
512 515
            }
513 516
        }
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractor.cs
639 639
        /// <returns>Where文字列</returns>
640 640
        public string CreatePrimarykeyString(int CompanyCode)
641 641
        {
642
            string strWork = "";
642
            StringBuilder strWork = new StringBuilder();
643 643
            try
644 644
            {
645
                strWork = string.Format(" Where CompanyCode = {0}", CompanyCode);
646
                return strWork;
645
                strWork.AppendFormat(" Where CompanyCode = {0}", CompanyCode);
646
                return strWork.ToString();
647 647
            }
648 648
            catch (Exception ex)
649 649
            {
650
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork);
650
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork.ToString());
651 651
                return string.Empty;
652 652
            }
653 653

  
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractorItem.cs
54 54

  
55 55
        #endregion
56 56

  
57
        #region パブリックメソッド
57
        #region 協力会社工種マスタ検索SQL
58 58
        /// <summary>
59
        /// 協力会社工種マスタ検索
59
        /// 協力会社工種マスタ検索SQL
60 60
        /// </summary>
61 61
        /// <param name="AddSQLString">検索条件SQL文字列</param>
62 62
        /// <param name="data">協力会社工種マスタデータ</param>
......
64 64
        private string CreateSelectSQL()
65 65
        {
66 66
            // SQL作成(DateTime型が変換できないのでCharに変換しておく)
67
            string strcmd = "SELECT";
68
            strcmd += "  ItemCode";
69
            strcmd += " ,DisplayOrder";
70
            strcmd += " ,ItemName";
71
            strcmd += " ,DeleteFlg";
72
            strcmd += " ,DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')";
73
            strcmd += " ,DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')";
74
            strcmd += " FROM SubContractorItemMaster";
67
            StringBuilder strcmd = new StringBuilder();
68
            strcmd.Append("SELECT");
69
            strcmd.Append("  ItemCode");
70
            strcmd.Append(" ,DisplayOrder");
71
            strcmd.Append(" ,ItemName");
72
            strcmd.Append(" ,DeleteFlg");
73
            strcmd.Append(" ,DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')");
74
            strcmd.Append(" ,DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')");
75
            strcmd.Append(" FROM SubContractorItemMaster");
75 76

  
76
            return strcmd;
77
            return strcmd.ToString();
77 78
        }
79
        #endregion
80

  
81
        #region 協力会社工種マスタ検索
82
        /// <summary>
83
        /// 協力会社工種マスタ検索
84
        /// </summary>
85
        /// <param name="AddSQLString"></param>
86
        /// <param name="data"></param>
87
        /// <param name="bConnect"></param>
88
        /// <returns></returns>
78 89
        public bool SelectAction(string AddSQLString, ref List<SubContractorItemMaster> data, bool bConnect = true)
79 90
        {
80 91
            // インターフェース
81
            string strcmd = "";
92
            StringBuilder strcmd = new StringBuilder();
82 93
            ArrayList arData = new ArrayList();
83 94

  
84 95
            try
85 96
            {
86 97
                // SQL作成(DateTime型が変換できないのでCharに変換しておく)
87
                strcmd = CreateSelectSQL() + AddSQLString;
98
                strcmd.Append(CreateSelectSQL());
99
                strcmd.Append(AddSQLString);
88 100

  
89 101
                // SQL実行
90
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return false;
102
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
91 103

  
92 104
                // データセット
93 105
                foreach (object[] objwrk in arData)
......
101 113
            }
102 114
            catch (Exception ex)
103 115
            {
104
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
116
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
105 117
                return false;
106 118
            }
107 119

  
108 120
        }
121
        #endregion
122

  
123
        #region 協力会社工種マスタ検索(1件)
124
        /// <summary>
125
        /// 協力会社工種マスタ検索(1件)
126
        /// </summary>
127
        /// <param name="AddSQLString"></param>
128
        /// <param name="data"></param>
129
        /// <param name="bConnect"></param>
130
        /// <returns></returns>
109 131
        public bool SelectAction(string AddSQLString, ref SubContractorItemMaster data, bool bConnect = true)
110 132
        {
111 133
            // インターフェース
112
            string strcmd = "";
134
            StringBuilder strcmd = new StringBuilder();
113 135
            ArrayList arData = new ArrayList();
114 136

  
115 137
            try
116 138
            {
117 139
                // SQL作成(DateTime型が変換できないのでCharに変換しておく)
118
                strcmd = CreateSelectSQL() + AddSQLString;
140
                strcmd.Append(CreateSelectSQL());
141
                strcmd.Append(AddSQLString);
119 142

  
120 143
                // SQL実行
121
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return false;
144
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
122 145
                // データ無
123 146
                if (arData.Count == 0) return false;
124 147

  
......
133 156
            }
134 157
            catch (Exception ex)
135 158
            {
136
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
159
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
137 160
                return false;
138 161
            }
139 162

  
140 163
        }
164
        #endregion
141 165

  
166
        #region 協力会社工種マスタ追加
142 167
        /// <summary>
143 168
        /// 協力会社工種マスタ追加
144 169
        /// </summary>
......
146 171
        /// <returns>true:成功 false:失敗</returns>
147 172
        public bool InsertAction(List<SubContractorItemMaster> data, bool bConnect = true)
148 173
        {
149
            string strcmd = "";
174
            StringBuilder strcmd = new StringBuilder();
150 175
            try
151 176
            {
152 177
                bool bColFirst = true;
153
                strcmd = "INSERT INTO SubContractorItemMaster";
154
                strcmd += " (";
178
                strcmd.Append("INSERT INTO SubContractorItemMaster");
179
                strcmd.Append(" (");
155 180
                foreach (var gender in Enum.GetValues(typeof(NameColumn)))
156 181
                {
157
                    if (!bColFirst) strcmd += ", ";
158
                    strcmd += gender.ToString();
182
                    if (!bColFirst) strcmd.Append(", ");
183
                    strcmd.Append(gender.ToString());
159 184
                    bColFirst = false;
160 185
                }
161
                strcmd += ") VALUES";
186
                strcmd.Append(") VALUES");
162 187

  
163 188
                bool bDataFirst = true;
164 189
                foreach (SubContractorItemMaster work in data)
165 190
                {
166
                    if (bDataFirst) strcmd += " (";
167
                    else strcmd += ", (";
191
                    if (bDataFirst) strcmd.Append(" (");
192
                    else strcmd.Append(", (");
168 193

  
169
                    strcmd += string.Format(" {0}", work.ItemCode.ToString());
170
                    strcmd += string.Format(" ,{0}", work.DisplayOrder.ToString());
171
                    strcmd += string.Format(" ,'{0}'", work.ItemName);
172
                    strcmd += string.Format(" ,{0}", work.DeleteFlg.ToString());
194
                    strcmd.AppendFormat(" {0}", work.ItemCode.ToString());
195
                    strcmd.AppendFormat(" ,{0}", work.DisplayOrder.ToString());
196
                    strcmd.AppendFormat(" ,'{0}'", work.ItemName);
197
                    strcmd.AppendFormat(" ,{0}", work.DeleteFlg.ToString());
173 198

  
174
                    strcmd += string.Format(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
175
                    strcmd += string.Format(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
176
                    strcmd += ")";
199
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
200
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
201
                    strcmd.Append(")");
177 202

  
178 203
                    bDataFirst = false;
179 204
                }
180 205

  
181
                if (!ExecuteNonQuery(strcmd, false)) return false;
206
                if (!ExecuteNonQuery(strcmd.ToString(), false)) return false;
182 207

  
183 208
                return true;
184 209
            }
185 210
            catch (Exception ex)
186 211
            {
187
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
212
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
188 213
                return false;
189 214
            }
190 215
        }
216
        #endregion
191 217

  
218
        #region 協力会社工種マスタ更新
192 219
        /// <summary>
193 220
        /// 協力会社工種マスタ更新
194 221
        /// </summary>
......
197 224
        /// <returns>true:成功 false:失敗</returns>
198 225
        public bool UpdateAction(string AddSQLString, SubContractorItemMaster data, bool bConnect = true)
199 226
        {
200
            string strcmd = "";
227
            StringBuilder strcmd = new StringBuilder();
201 228
            try
202 229
            {
203 230

  
204
                strcmd = "UPDATE SubContractorItemMaster";
231
                strcmd.Append("UPDATE SubContractorItemMaster");
205 232

  
206
                strcmd += " SET";
233
                strcmd.Append(" SET");
207 234

  
208
                strcmd += string.Format("  ItemCode = {0}", data.ItemCode.ToString());
209
                strcmd += string.Format(", DisplayOrder = {0}", data.DisplayOrder.ToString());
210
                strcmd += string.Format(", ItemName = '{0}'", data.ItemName);
211
                strcmd += string.Format(", DeleteFlg = {0}", data.DeleteFlg.ToString());
235
                strcmd.AppendFormat("  ItemCode = {0}", data.ItemCode.ToString());
236
                strcmd.AppendFormat(", DisplayOrder = {0}", data.DisplayOrder.ToString());
237
                strcmd.AppendFormat(", ItemName = '{0}'", data.ItemName);
238
                strcmd.AppendFormat(", DeleteFlg = {0}", data.DeleteFlg.ToString());
212 239

  
213
                strcmd += ", UpdateDate = NOW()";
214
                strcmd += AddSQLString;
240
                strcmd.Append(", UpdateDate = NOW()");
241
                strcmd.Append(AddSQLString);
215 242

  
216
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
243
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
217 244

  
218 245
                return true;
219 246
            }
220 247
            catch (Exception ex)
221 248
            {
222
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
249
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
223 250
                return false;
224 251
            }
225 252
        }
253
        #endregion
226 254

  
227

  
255
        #region 協力会社工種マスタ削除
228 256
        /// <summary>
229 257
        /// 協力会社工種マスタ削除
230 258
        /// </summary>
......
234 262
        public bool DeleteAction(string AddSQLString, bool bConnect = true)
235 263
        {
236 264
            // インターフェース
237
            string strcmd = "";
265
            StringBuilder strcmd = new StringBuilder();
238 266
            try
239 267
            {
240
                strcmd = string.Format("{0}{1}", "DELETE FROM SubContractorItemMaster", AddSQLString);
268
                strcmd.AppendFormat("{0}{1}", "DELETE FROM SubContractorItemMaster", AddSQLString);
241 269

  
242
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
270
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
243 271

  
244 272
                return true;
245 273
            }
246 274
            catch (Exception ex)
247 275
            {
248
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
276
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
249 277
                return false;
250 278
            }
251 279
        }
280
        #endregion
252 281

  
282
        #region OracleDataReaderより構造体へセットする
253 283
        /// <summary>
254 284
        /// OracleDataReaderより構造体へセットする
255 285
        /// </summary>
......
277 307
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
278 308
            }
279 309
        }
280

  
281 310
        #endregion
282 311

  
283
        #region パブリックメソッド(特殊処理)
284

  
312
        #region 最大値を取得する
285 313
        /// <summary>
286 314
        /// 最大値を取得する
287 315
        /// </summary>
......
291 319
        public int SelectMaxItemCodeCount(string AddSQLString, bool bConnect = true)
292 320
        {
293 321
            // インターフェース
294
            string strcmd = "";
322
            StringBuilder strcmd = new StringBuilder();
295 323
            ArrayList arData = new ArrayList();
296 324
            int iRet = 0;
297 325
            try
298 326
            {
299 327
                // SQL作成
300
                strcmd = "SELECT IFNULL(MAX(ItemCode), 0) FROM SubContractorItemMaster" + AddSQLString;
328
                strcmd.AppendFormat("SELECT IFNULL(MAX(ItemCode), 0) FROM SubContractorItemMaster{0}", AddSQLString);
301 329

  
302 330
                // SQL実行
303
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return iRet;
331
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return iRet;
304 332

  
305 333
                // データセット
306 334
                foreach (object[] objwrk in arData)
......
313 341
            }
314 342
            catch (Exception ex)
315 343
            {
316
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
344
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
317 345
            }
318 346

  
319 347
            return iRet;
320 348
        }
349
        #endregion
321 350

  
351
        #region 主キー検索の文字列を返す
322 352
        /// <summary>
323 353
        /// 主キー検索の文字列を返す
324 354
        /// </summary>
......
326 356
        /// <returns>Where文字列</returns>
327 357
        public string CreatePrimarykeyString(int ItemCode)
328 358
        {
329
            string strWork = "";
359
            StringBuilder strWork = new StringBuilder();
330 360
            try
331 361
            {
332
                strWork += string.Format(" Where ItemCode = {0}", ItemCode);
362
                strWork.AppendFormat(" Where ItemCode = {0}", ItemCode);
333 363
            }
334 364
            catch (Exception ex)
335 365
            {
336
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork);
366
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork.ToString());
337 367
            }
338 368

  
339
            return strWork;
369
            return strWork.ToString();
340 370
        }
341 371
        #endregion
342 372
    }
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMSubContractorJobCategory.cs
64 64
        private string CreateSelectSQL()
65 65
        {
66 66
            // SQL作成(DateTime型が変換できないのでCharに変換しておく)
67
            string strcmd = "SELECT";
68
            strcmd += "  JobCategoryCode";
69
            strcmd += " ,DisplayOrder";
70
            strcmd += " ,JobCategoryName";
71
            strcmd += " ,DeleteFlg";
72
            strcmd += " ,DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')";
73
            strcmd += " ,DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')";
74
            strcmd += " FROM SubContractorJobCategory";
67
            StringBuilder strcmd = new StringBuilder();
68
            strcmd.Append("SELECT");
69
            strcmd.Append("  JobCategoryCode");
70
            strcmd.Append(" ,DisplayOrder");
71
            strcmd.Append(" ,JobCategoryName");
72
            strcmd.Append(" ,DeleteFlg");
73
            strcmd.Append(" ,DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')");
74
            strcmd.Append(" ,DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')");
75
            strcmd.Append(" FROM SubContractorJobCategory");
75 76

  
76
            return strcmd;
77
            return strcmd.ToString();
77 78
        }
78 79
        #endregion
79 80

  
......
88 89
        public bool SelectAction(string AddSQLString, ref List<SubContractorJobCategory> data, bool bConnect = true)
89 90
        {
90 91
            // インターフェース
91
            string strcmd = "";
92
            StringBuilder strcmd = new StringBuilder();
92 93
            ArrayList arData = new ArrayList();
93 94

  
94 95
            try
95 96
            {
96 97
                // SQL作成(DateTime型が変換できないのでCharに変換しておく)
97
                strcmd = CreateSelectSQL() + AddSQLString;
98
                strcmd.Append(CreateSelectSQL());
99
                strcmd.Append(AddSQLString);
98 100

  
99 101
                // SQL実行
100
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return false;
102
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
101 103

  
102 104
                // データセット
103 105
                foreach (object[] objwrk in arData)
......
111 113
            }
112 114
            catch (Exception ex)
113 115
            {
114
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
116
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
115 117
                return false;
116 118
            }
117 119

  
......
129 131
        public bool SelectAction(string AddSQLString, ref SubContractorJobCategory data, bool bConnect = true)
130 132
        {
131 133
            // インターフェース
132
            string strcmd = "";
134
            StringBuilder strcmd = new StringBuilder();
133 135
            ArrayList arData = new ArrayList();
134 136

  
135 137
            try
136 138
            {
137 139
                // SQL作成(DateTime型が変換できないのでCharに変換しておく)
138
                strcmd = CreateSelectSQL() + AddSQLString;
140
                strcmd.Append(CreateSelectSQL());
141
                strcmd.Append(AddSQLString);
139 142

  
140 143
                // SQL実行
141
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return false;
144
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
142 145
                // データ無
143 146
                if (arData.Count == 0) return false;
144 147

  
......
153 156
            }
154 157
            catch (Exception ex)
155 158
            {
... 差分の行数が表示可能な上限を超えました。超過分は表示しません。

他の形式にエクスポート: Unified diff