プロジェクト

全般

プロフィール

リビジョン 326

堀内ほぼ7年前に追加

DataModel:EntryDate・UpDateDate初期値がMinValueのものをNowへ修正
工事情報入力:増減工事時に増減工事データ作成・データ登録の順番をデータ登録・増減工事データ作成に変更
請求まとめ修正中
プロジェクトに不足していたDataModel・IOAccessを追加
工事情報サブフォーム、表示数の設定バグ修正
カスタムメッセージボックス追加
試作時間待ちダイアログ追加

差分を表示:

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

  
19 19
        /// <summary>
20 20
        /// コピー・環境バージョン
branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs
1433 1433

  
1434 1434
                // パラメータセット
1435 1435
                frm.ConstructionCode = CurrentPara.IntExecParameter[0];
1436
                if (CurrentPara.BoolExecParameter.Count > 0) frm.ReqSumDspFlag = CurrentPara.BoolExecParameter[0];
1436
                //if (CurrentPara.BoolExecParameter.Count > 0) frm.ReqSumDspFlag = CurrentPara.BoolExecParameter[0];
1437 1437

  
1438 1438
                // フォーム表示
1439 1439
                frm.ShowDialog();
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBaseInfo.cs
1057 1057
        }
1058 1058
        #endregion
1059 1059

  
1060
        #region 工事番号の枝番が最大値のものを取得する
1060
        #region 工事番号の枝番が最大値+1を取得する
1061 1061
        /// <summary>
1062
        /// 工事番号の枝番が最大値のものを取得する
1062
        /// 工事番号の枝番が最大値+1を取得する
1063 1063
        /// </summary>
1064 1064
        /// <param name="NowCode"></param>
1065 1065
        /// <returns></returns>
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPersonApprovalDetail.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Collections;
6

  
7
using log4net;
8
using MySql.Data.MySqlClient;           // Data Provider for MySql
9

  
10
using ProcessManagement.DB.MySql;
11
using ProcessManagement.DB.Core;
12
using ProcessManagement.DataModel;
13

  
14
using ProcessManagement.Common;
15

  
16
namespace ProcessManagement.DB.IOAccess
17
{
18
    /// <summary>
19
    /// 担当者承認明細データアクセスクラス
20
    /// </summary>
21
    public class IOPersonApprovalDetail : MySqlProcess
22
    {
23
        #region 定義部
24
        /// <summary>
25
        /// log4netログを使用する
26
        /// </summary>
27
        private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
28
        #endregion
29

  
30
        #region 定数
31
        /// <summary>
32
        /// 承認データフィールド並び
33
        /// </summary>
34
        public enum ColumnName
35
        {
36
            PersonCode = 0,
37
            ApprovalCode,
38
            OrderDate,
39
            OrderNo,
40
            SeqNo,
41
            DetailData01,
42
            DetailData02,
43
            DetailData03,
44
            DetailData04,
45
            EntryDate,
46
            UpdateDate
47
        }
48
        #endregion
49

  
50
        #region コンストラクタ
51
        /// <summary>
52
        /// コンストラクタ
53
        /// </summary>
54
        /// <param name="ConnectionString"></param>
55
        public IOPersonApprovalDetail()
56
            : base(DBCommon.Instance.DBConnectString)
57
        {
58
        }
59

  
60
        #endregion
61

  
62
        #region 承認データ検索文字列作成
63
        /// <summary>
64
        /// 承認データ検索文字列作成
65
        /// </summary>
66
        /// <param name="AddSQLString">検索条件SQL文字列</param>
67
        /// <param name="data">承認データデータ</param>
68
        /// <returns>true:成功 false:失敗</returns>
69
        private string CreateSelectSQL()
70
        {
71
            // SQL作成(DateTime型が変換できないのでCharに変換しておく)
72
            StringBuilder strcmd = new StringBuilder();
73
            strcmd.Append("SELECT");
74
            strcmd.Append(" PersonCode");
75
            strcmd.Append(", ApprovalCode");
76
            strcmd.Append(", OrderDate");
77
            strcmd.Append(", OrderNo");
78
            strcmd.Append(", SeqNo");
79
            strcmd.Append(", DetailData01");
80
            strcmd.Append(", DetailData02");
81
            strcmd.Append(", DetailData03");
82
            strcmd.Append(", DetailData04");
83
            strcmd.Append(", DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')");
84
            strcmd.Append(", DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')");
85
            strcmd.Append(" FROM PersonApprovalDetail");
86

  
87
            return strcmd.ToString();
88
        }
89
        #endregion
90

  
91
        #region 承認データ検索(複数)
92
        /// <summary>
93
        /// 承認データ検索(複数)
94
        /// </summary>
95
        /// <param name="AddSQLString"></param>
96
        /// <param name="data"></param>
97
        /// <param name="bConnect"></param>
98
        /// <returns></returns>
99
        public bool SelectAction(string AddSQLString, ref List<PersonApprovalDetail> data, bool bConnect = true)
100
        {
101
            // インターフェース
102
            StringBuilder strcmd = new StringBuilder();
103
            ArrayList arData = new ArrayList();
104

  
105
            try
106
            {
107
                // SQL作成
108
                strcmd.Append(CreateSelectSQL());
109
                strcmd.Append(AddSQLString);
110

  
111
                // SQL実行
112
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
113

  
114
                // データセット
115
                foreach (object[] objwrk in arData)
116
                {
117
                    PersonApprovalDetail work = new PersonApprovalDetail();
118
                    Reader2Struct(objwrk, ref work);
119
                    data.Add(work);
120
                }
121

  
122
                return true;
123
            }
124
            catch (Exception ex)
125
            {
126
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
127
                return false;
128
            }
129

  
130
        }
131
        #endregion
132

  
133
        #region 承認データ検索(1件)
134
        /// <summary>
135
        /// 承認データ検索(1件)
136
        /// </summary>
137
        /// <param name="AddSQLString"></param>
138
        /// <param name="data"></param>
139
        /// <param name="bConnect"></param>
140
        /// <returns></returns>
141
        public bool SelectAction(string AddSQLString, ref PersonApprovalDetail data, bool bConnect = true)
142
        {
143
            // インターフェース
144
            StringBuilder strcmd = new StringBuilder();
145
            ArrayList arData = new ArrayList();
146

  
147
            try
148
            {
149
                // SQL作成
150
                strcmd.Append(CreateSelectSQL());
151
                strcmd.Append(AddSQLString);
152

  
153
                // SQL実行
154
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
155
                if (arData.Count == 0) return false;
156

  
157
                // データセット
158
                object[] objwrk = (object[])arData[0];
159
                Reader2Struct(objwrk, ref data);
160

  
161
                return true;
162
            }
163
            catch (Exception ex)
164
            {
165
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
166
                return false;
167
            }
168

  
169
        }
170
        #endregion
171

  
172
        #region 承認データ追加(複数)
173
        /// <summary>
174
        /// 承認データ追加(複数)
175
        /// </summary>
176
        /// <param name="data">承認データデータ</param>
177
        /// <returns>true:成功 false:失敗</returns>
178
        public bool InsertAction(List<PersonApprovalDetail> data, bool bConnect = true)
179
        {
180
            StringBuilder strcmd = new StringBuilder();
181
            try
182
            {
183
                bool bColFirst = true;
184
                strcmd.Append("INSERT INTO PersonApprovalDetail");
185
                strcmd.Append(" (");
186
                foreach (var gender in Enum.GetValues(typeof(ColumnName)))
187
                {
188
                    if (!bColFirst) strcmd.Append(", ");
189
                    strcmd.Append(gender.ToString());
190
                    bColFirst = false;
191
                }
192
                strcmd.Append(") VALUES");
193

  
194
                bool bDataFirst = true;
195
                foreach (PersonApprovalDetail work in data)
196
                {
197
                    if (bDataFirst) strcmd.Append(" (");
198
                    else strcmd.Append(", (");
199

  
200
                    strcmd.AppendFormat("  {0}", work.PersonCode);
201
                    strcmd.AppendFormat(", {0}", work.ApprovalCode);
202
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d')", work.OrderDate.ToShortDateString());
203
                    strcmd.AppendFormat(", {0}", work.OrderNo);
204
                    strcmd.AppendFormat(", {0}", work.SeqNo);
205
                    strcmd.AppendFormat(", {0}", work.DetailData01);
206
                    strcmd.AppendFormat(", {0}", work.DetailData02);
207
                    strcmd.AppendFormat(", {0}", work.DetailData03);
208
                    strcmd.AppendFormat(", {0}", work.DetailData04);
209
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
210
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
211
                    strcmd.Append(")");
212

  
213
                    bDataFirst = false;
214
                }
215

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

  
218
                return true;
219
            }
220
            catch (Exception ex)
221
            {
222
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
223
                return false;
224
            }
225
        }
226
        #endregion
227

  
228
        #region 承認データ追加(1件)
229
        /// <summary>
230
        /// 承認データ追加(1件)
231
        /// </summary>
232
        /// <param name="data"></param>
233
        /// <param name="bConnect"></param>
234
        /// <returns></returns>
235
        public bool InsertAction(PersonApprovalDetail data, bool bConnect = true)
236
        {
237
            StringBuilder strcmd = new StringBuilder();
238
            try
239
            {
240

  
241
                strcmd.Append("INSERT INTO PersonApprovalDetail");
242

  
243
                strcmd.Append(" (");
244
                bool bFirst = true;
245
                foreach (var gender in Enum.GetValues(typeof(ColumnName)))
246
                {
247
                    if (!bFirst) strcmd.Append(" ,");
248
                    strcmd.Append(gender.ToString());
249
                    bFirst = false;
250
                }
251
                strcmd.Append(") VALUES (");
252

  
253
                strcmd.AppendFormat("  {0}", data.PersonCode);
254
                strcmd.AppendFormat(", {0}", data.ApprovalCode);
255
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d')", data.OrderDate.ToShortDateString());
256
                strcmd.AppendFormat(", {0}", data.OrderNo);
257
                strcmd.AppendFormat(", {0}", data.SeqNo);
258
                strcmd.AppendFormat(", {0}", data.DetailData01);
259
                strcmd.AppendFormat(", {0}", data.DetailData02);
260
                strcmd.AppendFormat(", {0}", data.DetailData03);
261
                strcmd.AppendFormat(", {0}", data.DetailData04);
262

  
263
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", data.EntryDate);
264
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", data.UpdateDate);
265
                strcmd.Append(")");
266

  
267
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
268

  
269
                return true;
270
            }
271
            catch (Exception ex)
272
            {
273
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
274
                return false;
275
            }
276
        }
277
        #endregion
278

  
279
        #region 承認データ更新
280
        /// <summary>
281
        /// 承認データ更新
282
        /// </summary>
283
        /// <param name="AddSQLString">更新条件SQL文字列</param>
284
        /// <param name="data">承認データデータ</param>
285
        /// <returns>true:成功 false:失敗</returns>
286
        public bool UpdateAction(string AddSQLString, PersonApprovalDetail data, bool bConnect = true)
287
        {
288
            StringBuilder strcmd = new StringBuilder();
289
            try
290
            {
291

  
292
                strcmd.Append("UPDATE PersonApprovalDetail");
293

  
294
                strcmd.Append(" SET");
295

  
296
                strcmd.AppendFormat(" PersonCode = {0}", data.PersonCode);
297
                strcmd.AppendFormat(", ApprovalCode = {0}", data.ApprovalCode);
298
                strcmd.AppendFormat(", OrderDate = STR_TO_DATE('{0}','%Y/%m/%d')", data.OrderDate.ToShortDateString());
299
                strcmd.AppendFormat(", SeqNo = {0}", data.SeqNo);
300
                strcmd.AppendFormat(", OrderNo = {0}", data.OrderNo);
301
                strcmd.AppendFormat(", DetailData01 = {0}", data.DetailData01);
302
                strcmd.AppendFormat(", DetailData02 = {0}", data.DetailData02);
303
                strcmd.AppendFormat(", DetailData03 = {0}", data.DetailData03);
304
                strcmd.AppendFormat(", DetailData04 = {0}", data.DetailData04);
305

  
306
                strcmd.Append(", UpdateDate = NOW()");
307
                strcmd.Append(AddSQLString);
308

  
309
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
310

  
311
                return true;
312
            }
313
            catch (Exception ex)
314
            {
315
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
316
                return false;
317
            }
318
        }
319
        #endregion
320

  
321
        #region 承認データ削除
322
        /// <summary>
323
        /// 承認データ削除
324
        /// </summary>
325
        /// <param name="AddSQLString">削除条件SQL文字列</param>
326
        /// <param name="data">承認データデータ</param>
327
        /// <returns>true:成功 false:失敗</returns>
328
        public bool DeleteAction(string AddSQLString, bool bConnect = true)
329
        {
330
            // インターフェース
331
            StringBuilder strcmd = new StringBuilder();
332
            try
333
            {
334
                strcmd.AppendFormat("{0}{1}", "DELETE FROM PersonApprovalDetail", AddSQLString);
335

  
336
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
337

  
338
                return true;
339
            }
340
            catch (Exception ex)
341
            {
342
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
343
                return false;
344
            }
345
        }
346
        #endregion
347

  
348
        #region 1項目更新処理
349
        /// <summary>
350
        /// 1項目の更新を行う
351
        /// </summary>
352
        /// <returns></returns>
353
        public bool UpdateFeild(int PersonCode, int ApprovalCode, DateTime OrderDate, int FeildNo, object value, bool bConnect = true, int OrderNo = 0, int SeqNo = 0)
354
        {
355
            StringBuilder strcmd = new StringBuilder();
356
            try
357
            {
358
                strcmd.Append("UPDATE PersonApprovalDetail");
359

  
360
                strcmd.Append(" SET");
361
                switch (FeildNo)
362
                {
363
                    case (int)ColumnName.PersonCode:
364
                        strcmd.AppendFormat(" PersonCode = {0}", ((int)value).ToString());
365
                        break;
366
                    case (int)ColumnName.ApprovalCode:
367
                        strcmd.AppendFormat(" ApprovalCode = {0}", ((int)value).ToString());
368
                        break;
369
                    case (int)ColumnName.OrderDate:
370
                        strcmd.AppendFormat(" OrderDate = STR_TO_DATE('{0}','%Y/%m/%d')", ((DateTime)value).ToShortDateString());
371
                        break;
372
                    case (int)ColumnName.OrderNo:
373
                        strcmd.AppendFormat(" OrderNo = {0}", ((int)value).ToString());
374
                        break;
375
                    case (int)ColumnName.SeqNo:
376
                        strcmd.AppendFormat(" SeqNo = {0}", ((int)value).ToString());
377
                        break;
378
                    case (int)ColumnName.DetailData01:
379
                        strcmd.AppendFormat(" DetailData01 = {0}", ((int)value).ToString());
380
                        break;
381
                    case (int)ColumnName.DetailData02:
382
                        strcmd.AppendFormat(" DetailData02 = {0}", ((int)value).ToString());
383
                        break;
384
                    case (int)ColumnName.DetailData03:
385
                        strcmd.AppendFormat(" DetailData03 = {0}", ((int)value).ToString());
386
                        break;
387
                    case (int)ColumnName.DetailData04:
388
                        strcmd.AppendFormat(" DetailData04 = {0}", ((int)value).ToString());
389
                        break;
390
                }
391

  
392
                strcmd.Append(", UpdateDate = NOW()");
393
                strcmd.Append(CreatePrimarykeyString(PersonCode, ApprovalCode, OrderDate, OrderNo, SeqNo));
394

  
395
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
396

  
397
                return true;
398
            }
399
            catch (Exception ex)
400
            {
401
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
402
                return false;
403
            }
404
        }
405
        #endregion
406

  
407
        #region MySQLDataReaderより構造体へセットする
408
        /// <summary>
409
        /// MySQLDataReaderより構造体へセットする
410
        /// </summary>
411
        /// <param name="reader">MySQLDataReader</param>
412
        /// <param name="wrk">構造体</param>
413
        public void Reader2Struct(object[] objwrk, ref PersonApprovalDetail wrk)
414
        {
415
            try
416
            {
417
                // データ取得
418
                wrk.PersonCode = int.Parse(objwrk[(int)ColumnName.PersonCode].ToString());
419
                wrk.ApprovalCode = int.Parse(objwrk[(int)ColumnName.ApprovalCode].ToString());
420
                wrk.OrderDate = DateTime.Parse(objwrk[(int)ColumnName.OrderDate].ToString());
421
                wrk.OrderNo = int.Parse(objwrk[(int)ColumnName.OrderNo].ToString());
422
                wrk.SeqNo = int.Parse(objwrk[(int)ColumnName.SeqNo].ToString());
423
                wrk.DetailData01 = ulong.Parse(objwrk[(int)ColumnName.DetailData01].ToString());
424
                wrk.DetailData02 = ulong.Parse(objwrk[(int)ColumnName.DetailData02].ToString());
425
                wrk.DetailData03 = ulong.Parse(objwrk[(int)ColumnName.DetailData03].ToString());
426
                wrk.DetailData04 = ulong.Parse(objwrk[(int)ColumnName.DetailData04].ToString());
427

  
428
                wrk.EntryDate = DateTime.Parse(objwrk[(int)ColumnName.EntryDate].ToString());
429
                wrk.UpdateDate = DateTime.Parse(objwrk[(int)ColumnName.UpdateDate].ToString());
430
            }
431
            catch (MySqlException myex)
432
            {
433
                logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), myex.Message);
434
            }
435
            catch (Exception ex)
436
            {
437
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
438
            }
439
        }
440
        #endregion
441

  
442
        #region 主キー検索の文字列を返す
443
        /// <summary>
444
        /// 主キー検索の文字列を返す
445
        /// </summary>
446
        /// <param name="BusinessTypeCode"></param>
447
        /// <returns>Where文字列</returns>
448
        public string CreatePrimarykeyString(int PersonCode, int ApprovalCode, DateTime OrderDate, int OrderNo = 0, int SeqNo = 0, string APara = "")
449
        {
450
            StringBuilder strWork = new StringBuilder();
451
            try
452
            {
453
                strWork.AppendFormat(" Where {0}PersonCode = {1}", APara, PersonCode.ToString());
454
                strWork.AppendFormat(" And {0}ApprovalCode = {1}", APara, ApprovalCode.ToString());
455
                strWork.AppendFormat(" And DATE({0}OrderDate) = DATE(STR_TO_DATE('{1}','%Y/%m/%d'))", APara, OrderDate.ToShortDateString());
456
                if (OrderNo != 0)
457
                    strWork.AppendFormat(" And {0}OrderNo = {1}", APara, OrderNo.ToString());
458
                if (SeqNo != 0)
459
                    strWork.AppendFormat(" And {0}SeqNo = {1}", APara, SeqNo.ToString());
460
            }
461
            catch (Exception ex)
462
            {
463
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork.ToString());
464
            }
465

  
466
            return strWork.ToString();
467
        }
468
        #endregion
469

  
470
        #region 受付番号の最大値を取得する
471
        /// <summary>
472
        /// 受付番号の最大値を取得する
473
        /// </summary>
474
        /// <param name="AddSQLString"></param>
475
        /// <param name="bConnect"></param>
476
        /// <returns></returns>
477
        public int SelectMaxOrderNoCount(string AddSQLString, bool bConnect = true)
478
        {
479
            // インターフェース
480
            StringBuilder strcmd = new StringBuilder();
481
            ArrayList arData = new ArrayList();
482
            int iRet = 0;
483
            try
484
            {
485
                // SQL作成
486
                strcmd.AppendFormat("SELECT IFNULL(MAX(OrderNo), 0) FROM PersonApprovalDetail{0}", AddSQLString);
487

  
488
                // SQL実行
489
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return iRet;
490

  
491
                // データセット
492
                object[] wrkobj = (object[])arData[0];
493
                iRet = CommonMotions.cnvInt(wrkobj[0]);
494
            }
495
            catch (Exception ex)
496
            {
497
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
498
            }
499
            return iRet;
500
        }
501
        #endregion
502

  
503
        #region 枝番の最大値を取得する
504
        /// <summary>
505
        /// 枝番の最大値を取得する
506
        /// </summary>
507
        /// <param name="AddSQLString"></param>
508
        /// <param name="bConnect"></param>
509
        /// <returns></returns>
510
        public int SelectMaxSeqNoCount(string AddSQLString, bool bConnect = true)
511
        {
512
            // インターフェース
513
            StringBuilder strcmd = new StringBuilder();
514
            ArrayList arData = new ArrayList();
515
            int iRet = 0;
516
            try
517
            {
518
                // SQL作成
519
                strcmd.AppendFormat("SELECT IFNULL(MAX(SeqNo), 0) FROM PersonApprovalDetail{0}", AddSQLString);
520

  
521
                // SQL実行
522
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return iRet;
523

  
524
                // データセット
525
                foreach (object[] objwrk in arData)
526
                {
527
                    if (objwrk[0].ToString().Equals("null"))
528
                        iRet = 0;
529
                    else
530
                        iRet = int.Parse(objwrk[0].ToString());
531
                }
532

  
533
            }
534
            catch (Exception ex)
535
            {
536
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
537
            }
538
            return iRet;
539
        }
540
        #endregion
541
    }
542
}
branches/src/ProcessManagement/ProcessManagement/DataModel/BuilderPersonData.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6

  
7
namespace ProcessManagement.DataModel
8
{
9
    /// <summary>
10
    /// 工事担当者データ
11
    /// </summary>
12
    public class BuilderPersonData
13
    {
14
        #region 定数
15
        /// <summary>
16
        /// 設定区分定義
17
        /// </summary>
18
        public enum DivisionDef
19
        {
20
            /// <summary>
21
            /// 1:指導員給料行
22
            /// </summary>
23
            Instructor = 1,
24
            /// <summary>
25
            /// 2:副担当者給料行
26
            /// </summary>
27
            Assistant,
28
            /// <summary>
29
            /// 3:担当者給料行
30
            /// </summary>
31
            Payroll,
32
        }
33
        #endregion
34

  
35
        #region メンバ変数
36
        private int         m_PersonCode = 0;               // 担当者コード
37
        private int         m_Division = 0;                 // 設定区分
38
        private DateTime    m_StartDate = DateTime.Now;     // 担当開始年月日
39
        private DateTime    m_CompDate = DateTime.Now;      // 担当終了年月日
40
        private DateTime    m_EntryDate = DateTime.Now;     // 登録日付
41
        private DateTime    m_UpdateDate = DateTime.Now;    // 更新日付
42
        #endregion
43

  
44
        #region コンストラクタ
45
        #endregion
46

  
47
        #region プロパティ
48
        /// <summary>
49
        /// 担当者コード
50
        /// </summary>
51
        public int PersonCode
52
        {
53
            get { return m_PersonCode; }
54
            set { m_PersonCode = value; }
55
        }
56

  
57
        /// <summary>
58
        /// 設定区分
59
        /// </summary>
60
        public int Division
61
        {
62
            get { return m_Division; }
63
            set { m_Division = value; }
64
        }
65

  
66
        /// <summary>
67
        /// 担当開始年月日
68
        /// </summary>
69
        public DateTime StartDate
70
        {
71
            get { return m_StartDate; }
72
            set { m_StartDate = value; }
73
        }
74

  
75
        /// <summary>
76
        /// 担当終了年月日
77
        /// </summary>
78
        public DateTime CompDate
79
        {
80
            get { return m_CompDate; }
81
            set { m_CompDate = value; }
82
        }
83

  
84
        /// <summary>
85
        /// 登録日付
86
        /// </summary>
87
        public DateTime EntryDate
88
        {
89
            set { m_EntryDate = value; }
90
            get { return m_EntryDate; }
91
        }
92
        /// <summary>
93
        /// 更新日付
94
        /// </summary>
95
        public DateTime UpdateDate
96
        {
97
            set { m_UpdateDate = value; }
98
            get { return m_UpdateDate; }
99
        }
100
        #endregion
101

  
102
    }
103
}
branches/src/ProcessManagement/ProcessManagement/DataModel/PersonApprovalDetail.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5

  
6
namespace ProcessManagement.DataModel
7
{
8
    /// <summary>
9
    /// 担当者承認明細データ
10
    /// </summary>
11
    public class PersonApprovalDetail
12
    {
13
        #region メンバ変数
14
        /// <summary>
15
        /// 担当者コード
16
        /// </summary>
17
        private int         m_PersonCode = 0;
18
        /// <summary>
19
        /// 承認機能番号
20
        /// </summary>
21
        private int         m_ApprovalCode = 0;
22
        /// <summary>
23
        /// 受付日
24
        /// </summary>
25
        private DateTime    m_OrderDate = DateTime.MinValue;
26
        /// <summary>
27
        /// 受付番号
28
        /// </summary>
29
        private int         m_OrderNo = 0;
30
        /// <summary>
31
        /// 枝番
32
        /// </summary>
33
        private int         m_SeqNo = 0;
34
        /// <summary>
35
        /// 明細データ01
36
        /// </summary>
37
        private ulong       m_DetailData01 = 0;
38
        /// <summary>
39
        /// 明細データ02
40
        /// </summary>
41
        private ulong       m_DetailData02 = 0;
42
        /// <summary>
43
        /// 明細データ03
44
        /// </summary>
45
        private ulong       m_DetailData03 = 0;
46
        /// <summary>
47
        /// 明細データ04
48
        /// </summary>
49
        private ulong       m_DetailData04 = 0;
50
        /// <summary>
51
        /// 登録日付
52
        /// </summary>
53
        private DateTime    m_EntryDate = DateTime.Now;
54
        /// <summary>
55
        /// 更新日付
56
        /// </summary>
57
        private DateTime    m_UpdateDate = DateTime.Now;
58
        #endregion
59

  
60
        #region コンストラクタ
61
        #endregion
62

  
63
        #region プロパティ
64
        /// <summary>
65
        /// 担当者コード
66
        /// </summary>
67
        public int PersonCode
68
        {
69
            get { return m_PersonCode; }
70
            set { m_PersonCode = value; }
71
        }
72
        /// <summary>
73
        /// 承認機能番号
74
        /// </summary>
75
        public int ApprovalCode
76
        {
77
            get { return m_ApprovalCode; }
78
            set { m_ApprovalCode = value; }
79
        }
80
        /// <summary>
81
        /// 受付日
82
        /// </summary>
83
        public DateTime OrderDate
84
        {
85
            get { return m_OrderDate; }
86
            set { m_OrderDate = value; }
87
        }
88
        /// <summary>
89
        /// 受付番号
90
        /// </summary>
91
        public int OrderNo
92
        {
93
            get { return m_OrderNo; }
94
            set { m_OrderNo = value; }
95
        }
96
        /// <summary>
97
        /// 枝番
98
        /// </summary>
99
        public int SeqNo
100
        {
101
            get { return m_SeqNo; }
102
            set { m_SeqNo = value; }
103
        }
104
        /// <summary>
105
        /// 明細データ01
106
        /// </summary>
107
        public ulong DetailData01
108
        {
109
            get { return m_DetailData01; }
110
            set { m_DetailData01 = value; }
111
        }
112
        /// <summary>
113
        /// 明細データ02
114
        /// </summary>
115
        public ulong DetailData02
116
        {
117
            get { return m_DetailData02; }
118
            set { m_DetailData02 = value; }
119
        }
120
        /// <summary>
121
        /// 明細データ03
122
        /// </summary>
123
        public ulong DetailData03
124
        {
125
            get { return m_DetailData03; }
126
            set { m_DetailData03 = value; }
127
        }
128
        /// <summary>
129
        /// 明細データ04
130
        /// </summary>
131
        public ulong DetailData04
132
        {
133
            get { return m_DetailData04; }
134
            set { m_DetailData04 = value; }
135
        }
136
        /// <summary>
137
        /// 登録日付
138
        /// </summary>
139
        public DateTime EntryDate
140
        {
141
            set { m_EntryDate = value; }
142
            get { return m_EntryDate; }
143
        }
144
        /// <summary>
145
        /// 更新日付
146
        /// </summary>
147
        public DateTime UpdateDate
148
        {
149
            set { m_UpdateDate = value; }
150
            get { return m_UpdateDate; }
151
        }
152
        #endregion
153
    }
154
}
branches/src/ProcessManagement/ProcessManagement/DataModel/PersonDepartmentMaster.cs
16 16

  
17 17
        private int         m_AffiliationFlg = 0;               // 所属フラグ
18 18

  
19
        private DateTime    m_EntryDate = DateTime.MinValue;    // 登録日付
20
        private DateTime    m_UpdateDate = DateTime.MinValue;   // 更新日付
19
        private DateTime    m_EntryDate = DateTime.Now;         // 登録日付
20
        private DateTime    m_UpdateDate = DateTime.Now;        // 更新日付
21 21
        #endregion
22 22

  
23 23
        #region コンストラクタ
branches/src/ProcessManagement/ProcessManagement/DataModel/PersonInChargeMaster.cs
96 96

  
97 97

  
98 98
        private int         m_DeleteFlg = 0;                    // 削除フラグ
99
        private DateTime    m_EntryDate = DateTime.MinValue;    // 登録日付
100
        private DateTime    m_UpdateDate = DateTime.MinValue;   // 更新日付
99
        private DateTime    m_EntryDate = DateTime.Now;    // 登録日付
100
        private DateTime    m_UpdateDate = DateTime.Now;   // 更新日付
101 101
        #endregion
102 102

  
103 103
        #region コンストラクタ
branches/src/ProcessManagement/ProcessManagement/DataModel/PersonSalaryMaster.cs
17 17
        private double      m_MonthlySalary = 0;                // 月給金額
18 18
        private double      m_YearSalary = 0;	                // 年棒金額
19 19

  
20
        private DateTime    m_EntryDate = DateTime.MinValue;    // 登録日付
21
        private DateTime    m_UpdateDate = DateTime.MinValue;   // 更新日付
20
        private DateTime    m_EntryDate = DateTime.Now;         // 登録日付
21
        private DateTime    m_UpdateDate = DateTime.Now;        // 更新日付
22 22
        #endregion
23 23

  
24 24
        #region コンストラクタ
branches/src/ProcessManagement/ProcessManagement/DataModel/ProcessExcuter.cs
29 29
        /// <summary>
30 30
        /// 登録年月日
31 31
        /// </summary>
32
        private DateTime    m_EntryDate = DateTime.MinValue;
32
        private DateTime    m_EntryDate = DateTime.Now;
33 33
        /// <summary>
34 34
        /// 更新年月日
35 35
        /// </summary>
36
        private DateTime    m_UpdateDate = DateTime.MinValue;
36
        private DateTime    m_UpdateDate = DateTime.Now;
37 37
        #endregion
38 38

  
39 39
        #region プロパティ
branches/src/ProcessManagement/ProcessManagement/DataModel/SecurityMaster.cs
73 73
        /// <summary>
74 74
        /// 登録年月日
75 75
        /// </summary>
76
        private DateTime    m_EntryDate = DateTime.MinValue;
76
        private DateTime    m_EntryDate = DateTime.Now;
77 77
        /// <summary>
78 78
        /// 更新年月日
79 79
        /// </summary>
80
        private DateTime    m_UpdateDate = DateTime.MinValue;
80
        private DateTime    m_UpdateDate = DateTime.Now;
81 81
        #endregion
82 82

  
83 83
        #region プロパティ
branches/src/ProcessManagement/ProcessManagement/DataModel/SystemExecute.cs
35 35
        /// <summary>
36 36
        /// 登録年月日
37 37
        /// </summary>
38
        private DateTime m_EntryDate = DateTime.MinValue;
38
        private DateTime m_EntryDate = DateTime.Now;
39 39
        /// <summary>
40 40
        /// 更新年月日
41 41
        /// </summary>
42
        private DateTime m_UpdateDate = DateTime.MinValue;
42
        private DateTime m_UpdateDate = DateTime.Now;
43 43
        #endregion
44 44

  
45 45
        #region プロパティ
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/DataChange.cs
140 140
                // ?V?K??????????????
141 141
                if (m_ConstructionCode < 1) return false;
142 142

  
143
                if (MessageBox.Show("?????H??????????????????B", "?????H?????m?F",
144
                                    MessageBoxButtons.OKCancel, MessageBoxIcon.Information) != DialogResult.OK) return false;
143
                //if (MessageBox.Show("?????H??????????????????B", "?????H?????m?F",
144
                //                    MessageBoxButtons.OKCancel, MessageBoxIcon.Information) != DialogResult.OK) return false;
145 145

  
146 146
                // ?p???H???????
147 147
                int NewCode = BaseDB.CreateNextBranchCounstructionCode(m_ConstructionCode);
......
453 453
                    {   // ????H???????????N?f?[?^???????????????q?H???f?[?^?????????N?????????
454 454
                        strLink.Clear();
455 455
                        strLink.AppendFormat(" WHERE FLUCTUATIONCODE = {0}", m_ConstructionCode);
456
                        if (!cbLinkDB.SelectAction(strLink.ToString(), ref LinkRec, false)) return false;
457
                        // ???o??????e??H?????????????
458
                        ProcConstrCode = LinkRec.ConstructionCode;
456
                        if (cbLinkDB.SelectAction(strLink.ToString(), ref LinkRec, false))
457
                        {
458
                            // ???o??????e??H?????????????
459
                            ProcConstrCode = LinkRec.ConstructionCode;
460
                        }
461
                        else
462
                        {
463
                            // ????????????????H?????????????????
464
                            int nwkCode = (m_ConstructionCode / 100) * 100;
465
                            int iCode1 = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("?? ?? ??")).Key;
466
                            StringBuilder strSQL = new StringBuilder();
467
                            strSQL.Append("Select Min(ConstructionCode) From constructionbaseinfo");
468
                            strSQL.AppendFormat(" Where {0} < ConstructionCode", nwkCode);
469
                            strSQL.AppendFormat(" And ConstructionCode <= {0}", nwkCode + 99);
470
                            strSQL.AppendFormat(" And ConstructionStatusFlg != {0}", iCode1);
471
                            ArrayList CodeArr = new ArrayList();
472
                            cbiDB.ExecuteReader(strSQL.ToString(), ref CodeArr, false);
473

  
474
                            if (CodeArr.Count > 0)
475
                            {
476
                                object[] objRec = (object[])CodeArr[0];
477
                                ProcConstrCode = CommonMotions.cnvInt(objRec[0]);
478
                            }
479
                            else
480
                            {
481
                                ProcConstrCode = m_ConstructionCode;
482
                            }
483
                        }
459 484
                    }
460 485
                }
461 486
                else
......
495 520
            FrmConstructionBudget frm = new FrmConstructionBudget();
496 521
            try
497 522
            {
498
                // ???F?f?[?^??
523
                // ?H???\?Z?????F?f?[?^??
499 524
                StringBuilder strSQL = new StringBuilder();
500 525
                strSQL.Append(ApprovalDB.CreatePrimarykeyString(m_ConstructionCode,
501 526
                                                                (int)ClsExcute.ApprovalListNo.ConstructionBudgetApproval,
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfo.cs
1285 1285
        /// <param name="e"></param>
1286 1286
        private void btnFluctuation_Click(object sender, EventArgs e)
1287 1287
        {
1288
            // ?f?[?^?o?^????
1289
            if (!DataEntryProcess(false)) return;
1290

  
1288 1291
            // ?H???????f?[?^??
1289 1292
            if (!CreateFluctuationData()) return;
1290 1293

  
1291
            // ?f?[?^?o?^????
1292
            if (!DataEntryProcess(false)) return;
1293

  
1294 1294
            // ??X?t???OOFF
1295 1295
            m_bChengeAns = false;
1296 1296
            // ?N???[?Y??????OFF?????B
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfoAuxiliary.cs
4972 4972
        {
4973 4973
            try
4974 4974
            {
4975
                // ?????C???????????
4976
                int SRank = (int)CommonDefine.SecurityRankPos.SpecialAuthority;
4977
                if (CommonMotions.LoginUserSecurity.SecRank != CommonDefine.SecurityRankList[SRank].Key) return;
4978

  
4975 4979
                // ??????????`?F?b?N?????{?^??????????\??(?V?K????\???????)
4976 4980
                if (m_ConstructionCode > 0) btnPA.Visible = true;
4977 4981

  
4978 4982
                // ?????m?F?????O??????????
4979 4983
                if (!rdbStatus10.Checked) return;
4980 4984

  
4981
                // ?????C???????????
4982
                int SRank = (int)CommonDefine.SecurityRankPos.SpecialAuthority;
4983
                if (CommonMotions.LoginUserSecurity.SecRank != CommonDefine.SecurityRankList[SRank].Key) return;
4984

  
4985 4985
                // ?????????{?^???\??
4986 4986
                btnRestore.Enabled = true;
4987 4987
                btnRestore.Visible = true;
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedger.cs
646 646
        /// </summary>
647 647
        private bool m_RollBackJoinLedger = false;
648 648

  
649
        // *-----* ????????????A?g *-----*
650
        
649
        #region // *-----* ????????????A?g *-----*????
650

  
651 651
        /// <summary>
652
        /// ????????I???g?p???t???O
652
        /// ????????s?I???g?p???t???O
653 653
        /// </summary>
654
        private bool m_ReqSumSelFlag = false;
654
        private bool m_ReqSumDialogFlag = false;
655 655
        /// <summary>
656 656
        /// ????????\?????t???O
657 657
        /// </summary>
......
672 672
        /// <summary>
673 673
        /// ??????J??????u
674 674
        /// </summary>
675
        private int m_TargetColumn = 0;
675
        private int m_TargetColumn = -1;
676 676
        /// <summary>
677 677
        /// ?????????A?g???z
678 678
        /// </summary>
679
        private int m_AddingRequestPrice = 0;
679
        private int m_AddingRequestPrice = -1;
680 680

  
681 681
        /// <summary>
682 682
        /// ???????X?g
683 683
        /// </summary>
684 684
        private List<BillingDataDetail> m_BillDetailList = new List<BillingDataDetail>();
685 685

  
686
        // *-----* ????????????A?g *-----*
687
        
686
        #endregion // *-----* ????????????A?g *-----*????
687

  
688 688
        #endregion
689 689

  
690 690
        #region ?v???p?e?B
......
830 830
            set { m_RollBackJoinLedger = value; }
831 831
        }
832 832

  
833
        // *-----* ????????????A?g *-----*
833
        #region *-----* ????????????A?g *-----* ????
834 834

  
835 835
        /// <summary>
836
        /// ????????I???g?p???t???O
836
        /// ????????s?I???g?p???t???O
837 837
        /// </summary>
838
        public bool ReqSumSelFlag
838
        public bool ReqSumDialogFlag
839 839
        {
840
            get { return m_ReqSumSelFlag; }
841
            set { m_ReqSumSelFlag = value; }
840
            get { return m_ReqSumDialogFlag; }
841
            set { m_ReqSumDialogFlag = value; }
842 842
        }
843 843
        /// <summary>
844 844
        /// ????????\?????t???O
......
897 897
            get { return m_BillDetailList; }
898 898
            set { m_BillDetailList = value; }
899 899
        }
900
        // *-----* ?????????? *-----*
900
        /// <summary>
901
        /// ?O???b?h???s?f?[?^?Z?b?g
902
        /// </summary>
903
        public bool SetGridData
904
        {
905
            get { return SetSumReqData(); }
906
        }
901 907

  
908
        #endregion *-----* ?????????? *-----*????
909

  
902 910
        #endregion
903 911

  
904 912
        #region ?R???X?g???N?^
......
934 942
                // ??\?????????????????????I???
935 943
                if (!this.Visible) return;
936 944

  
945
                // ???????????\????o?^?????
946
                if (m_ReqSumDspFlag || m_ReqSumDialogFlag) goto NotSave;
947

  
937 948
                if (m_bChengeAns)
938 949
                {
939 950
                    if (MessageBox.Show("?f?[?^???X?????????A?o?^??????I????????????????H?B", "?I???m?F"
......
943 954
                        return;
944 955
                    }
945 956
                }
957

  
958
            NotSave:
946 959
                // ?T?u?t?H?[???N????v???Z?X?J?E???^???X?????
947 960
                if (m_SubForm) m_CloseingProcessOn = false;
948 961

  
......
1048 1061
                // ??X?t???OOFF
1049 1062
                m_bChengeAns = false;
1050 1063

  
1051
                // ??????????????o??
1052
                if (m_ReqSumSelFlag)
1064
                if (m_ReqSumDialogFlag)
1053 1065
                {
1054
                    InitReqSum();
1066
                    // ????????????_?C?A???O???o??
1067
                    InitReqSumDialog();
1055 1068
                }
1069
                else if (m_ReqSumDspFlag)
1070
                {
1071
                    // ????????????Q????o??
1072
                    InitReqSumDsp();
1073
                }
1056 1074

  
1057 1075
                // ?Q????[?h
1058 1076
                if (m_EditLock)
......
1276 1294
            if (CommonMotions.cnvInt(dgv.CurrentRow.Cells[(int)GridColumn.TitleFlg].Value) == 1) return;
1277 1295

  
1278 1296
            // ?????????A?g
1279
            if (m_ReqSumSelFlag)
1297
            if (m_ReqSumDialogFlag)
1280 1298
            {
1281 1299
                EventArgs wkE = new EventArgs();
1282 1300
                btnSelect_Click(sender, wkE);
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedgerAuxiliary.cs
916 916
                    // カラムの設定
917 917
                    m_GridPaymentColList[i].CellTemplate = new DataGridViewTextBoxCell();
918 918
                    m_GridPaymentColList[i].DefaultCellStyle = m_GridPaymentCellStyleList[i];
919
                    m_GridPaymentColList[i].HeaderText = string.Format(s_TargetYmFormt, dtTitleDate.AddMonths(i).Year, dtTitleDate.AddMonths(i).Month);
919
                    m_GridPaymentColList[i].HeaderText = YearMonthFormat(dtTitleDate.AddMonths(i).Year, dtTitleDate.AddMonths(i).Month);
920 920

  
921 921
                    m_GridPaymentColList[i].Name = string.Format("ColPayment{0}", i);
922 922
                    m_GridPaymentColList[i].ReadOnly = false;
......
964 964
        }
965 965
        #endregion
966 966

  
967
        #region 年月を指定フォーマットで返す
968
        /// <summary>
969
        /// 年月を指定フォーマットで返す
970
        /// </summary>
971
        private string YearMonthFormat(int nYear, int nMonth)
972
        {
973
            try
974
            {
975
                return string.Format(s_TargetYmFormt, nYear, nMonth.ToString("00"));
976
            }
977
            catch (Exception ex)
978
            {
979
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
980
                return string.Empty;
981
            }
982
        }
983
        #endregion
984

  
967 985
        #region 最大支払月のカウントを取得する
968 986
        /// <summary>
969 987
        /// 最大支払月のカウントを取得する
......
1229 1247
                }
1230 1248
                else
1231 1249
                {   // 明細行を請求まとめよりの起動時は分ける
1232
                    if (m_ReqSumSelFlag)
1250
                    if (m_ReqSumDialogFlag)
1233 1251
                    {
1234 1252
                        int nGroupCnt = CommonMotions.cnvInt(CurRow.Cells[(int)GridColumn.GroupCount].Value);
1235 1253
                        if (nGroupCnt == (int)DataGroup.Empty
......
1241 1259
                        else
1242 1260
                        {
1243 1261
                            // 請求まとめ行色変更処理
1244
                            SetReqSumRowColor(CurRow);
1262
                            SetReqSumDialogRowColor(CurRow);
1245 1263
                        }
1246 1264
                    }
1247 1265
                    else
......
2561 2579
                foreach (ConstructionLedgerExcute ExcRec in ExcList)
2562 2580
                {
2563 2581
                    //グリッドの対象列を取得する(データのカラム数から年月に変更する)
2564
                    string CurMounth = string.Format(s_TargetYmFormt, ExcRec.TargetMonth.Year, ExcRec.TargetMonth.Month);
2582
                    string CurMounth = YearMonthFormat(ExcRec.TargetMonth.Year, ExcRec.TargetMonth.Month);
2565 2583
                    for (int ix = (int)GridColumn.Payment; ix < dgv.ColumnCount; ix++)
2566 2584
                    {
2567 2585
                        // グリッドの対象列を探す
......
2941 2959
                        if (ExcuteRec_TargetMonth == DateTime.MinValue) break;
2942 2960

  
2943 2961
                        //グリッドの対象列を取得する(データのカラム数から年月に変更する)
2944
                        string CurMounth = string.Format(s_TargetYmFormt, ExcuteRec_TargetMonth.Year, ExcuteRec_TargetMonth.Month);
2962
                        string CurMounth = YearMonthFormat(ExcuteRec_TargetMonth.Year, ExcuteRec_TargetMonth.Month);
2945 2963
                        for (int ix = (int)GridColumn.Payment; ix < dgv.ColumnCount; ix++)
2946 2964
                        {
2947 2965
                            // グリッドの対象列を探す
......
3577 3595
                SetData.Cells[(int)GridColumn.DetailNo].Value = MaxCount;
3578 3596

  
3579 3597
                // 請求まとめ選択時
3580
                if (m_ReqSumSelFlag)
3598
                if (m_ReqSumDialogFlag)
3581 3599
                {
3582 3600
                    // 協力業者セット
3583 3601
                    SetCompanyData(SetData);
......
6896 6914
                    foreach (ConstructionLedgerExcute ExcuteRec in ExcuteList)
6897 6915
                    {
6898 6916
                        //グリッドの対象列を取得する(データのカラム数から年月に変更する)
6899
                        string CurMounth = string.Format(s_TargetYmFormt, ExcuteRec.TargetMonth.Year, ExcuteRec.TargetMonth.Month);
6917
                        string CurMounth = YearMonthFormat(ExcuteRec.TargetMonth.Year, ExcuteRec.TargetMonth.Month);
6900 6918
                        for (int ix = (int)GridColumn.Payment; ix < dgv.ColumnCount; ix++)
6901 6919
                        {
6902 6920
                            // グリッドの対象列を探す
......
7089 7107
                    foreach (ConstructionLedgerExcute ExcuteRec in ExcuteList)
7090 7108
                    {
7091 7109
                        //グリッドの対象列を取得する(データのカラム数から年月に変更する)
7092
                        string CurMounth = string.Format(s_TargetYmFormt, ExcuteRec.TargetMonth.Year, ExcuteRec.TargetMonth.Month);
7110
                        string CurMounth = YearMonthFormat(ExcuteRec.TargetMonth.Year, ExcuteRec.TargetMonth.Month);
7093 7111
                        for (int ix = (int)GridColumn.Payment; ix < dgv.ColumnCount; ix++)
7094 7112
                        {
7095 7113
                            // グリッドの対象列を探す
......
7350 7368
                    foreach (ConstructionLedgerExcute ExcuteRec in ExcuteList)
7351 7369
                    {
7352 7370
                        //グリッドの対象列を取得する(データのカラム数から年月に変更する)
7353
                        string CurMounth = string.Format(s_TargetYmFormt, ExcuteRec.TargetMonth.Year, ExcuteRec.TargetMonth.Month);
7371
                        string CurMounth = YearMonthFormat(ExcuteRec.TargetMonth.Year, ExcuteRec.TargetMonth.Month);
7354 7372
                        for (int ix = (int)GridColumn.Payment; ix < dgv.ColumnCount; ix++)
7355 7373
                        {
7356 7374
                            // グリッドの対象列を探す
......
7475 7493
                foreach (ConstructionLedgerExcute ExcuteRec in ExcuteList)
7476 7494
                {
7477 7495
                    //グリッドの対象列を取得する(データのカラム数から年月に変更する)
7478
                    string CurMounth = string.Format(s_TargetYmFormt, ExcuteRec.TargetMonth.Year, ExcuteRec.TargetMonth.Month);
7496
                    string CurMounth = YearMonthFormat(ExcuteRec.TargetMonth.Year, ExcuteRec.TargetMonth.Month);
7479 7497
                    for (int ix = (int)GridColumn.Payment; ix < dgv.ColumnCount; ix++)
7480 7498
                    {
7481 7499
                        // グリッドの対象列を探す
......
7629 7647
        /// </summary>
7630 7648
        private bool ReqSumSelectOutPut()
7631 7649
        {
7650
            FrmCustomMsgBox frm = new FrmCustomMsgBox();
7632 7651
            try
7633 7652
            {
7634 7653
                m_TargetDetailNo = -1;
......
7651 7670

  
7652 7671
                // 行セット
7653 7672
                m_TargetDetailNo = CommonMotions.cnvInt(CurRow.Cells[(int)GridColumn.DetailNo].Value);
7673

  
7674
                // Type1表示文字表示/非表示
7675
                frm.DisplayVisbleType1 = true;
7676
                // Type1表示文字
7677
                frm.DisplayTextType1 = string.Format("協力会社:{0}:{1}を\r\n選択します。"
7678
                                                        , CommonMotions.cnvString(CurRow.Cells[(int)GridColumn.CompanyName].Value)
7679
                                                        , CommonMotions.cnvString(CurRow.Cells[(int)GridColumn.TextName].Value));
7680
                // Type1表示文字フォント
7681
                frm.DisplayTextFontType1 = new Font(frm.DisplayTextFontType1.Name, 16f, FontStyle.Bold);
7682

  
7683
                frm.ShowDialog();
7684
                if (frm.ReturnValue == DialogResult.Cancel) return false;
7654 7685
                
7655 7686
                // 列セット
7656 7687
                DateTime dtStWork = CommonMotions.cnvDate(m_DspLabelCtrl[(int)DspLblCtrlName.StartingDate].Text);
......
7664 7695
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
7665 7696
                return false;
7666 7697
            }
7698
            finally
7699
            {
7700
                frm.Dispose(); frm = null;
7701
            }
7667 7702
        }
7668 7703
        #endregion
7669 7704

  
......
7673 7708
        /// </summary>
7674 7709
        private bool ReqSumNewMakeOutPut()
7675 7710
        {
7711
            FrmCustomMsgBox frm = new FrmCustomMsgBox();
7712
            IOMSubContractor SubDB = new IOMSubContractor();
7676 7713
            try
7677 7714
            {
7678 7715
                // 追加判定
7679 7716
                int nWkCnt = 0;
7680 7717
                if (!CheckNewMakeRow(ref nWkCnt)) return false;
7681 7718

  
7682
                DialogResult dtRet = MessageBox.Show("工事台帳に新規で協力会社を追加します。",
7683
                                                        "追加確認",
7684
                                                        MessageBoxButtons.OKCancel,
7685
                                                        MessageBoxIcon.Exclamation);
7686
                
7687
                if (dtRet == DialogResult.Cancel) return true;
7719
                // ----- メッセージボックス起動パラメータセット
7720
                // 協力業者名取得
7721
                StringBuilder strSQL = new StringBuilder();
7722
                strSQL.Append(SubDB.CreatePrimarykeyString(m_ReqSumCompany));
7723
                SubContractorMaster SubRec = new SubContractorMaster();
7724
                SubDB.SelectAction(strSQL.ToString(), ref SubRec);
7725

  
7726
                // Type2表示文字表示/非表示
7727
                frm.DisplayVisbleType2 = true;
7728
                // Type2_1表示文字
7729
                frm.DisplayTextType2_1 = string.Format("工事台帳に協力会社:{0}を\r\n新規追加します。", SubRec.CompanyName);
7730
                // Type2_1表示文字フォント
7731
                frm.DisplayTextFontType2_1 = new Font(frm.DisplayTextFontType2_1.Name, 16f, FontStyle.Bold);
7732
                // Type2_2表示文字
7733
                frm.DisplayTextType2_2 = "※指定行の下に追加されます。";
7734
                // Type2_2表示文字色
7735
                frm.DisplayTextForeColorType2_2 = Color.Red;
7736
                // Type2_1表示文字フォント
7737
                frm.DisplayTextFontType2_2 = new Font(frm.DisplayTextFontType2_2.Name, 20f, FontStyle.Bold);
7738

  
7739
                frm.ShowDialog();
7740
                if (frm.ReturnValue == DialogResult.Cancel) return false;
7741

  
7688 7742
                // 行を追加する(返信パラメタ行・列もセットする)
7689 7743
                AddLineData();
7690 7744
                // 行色変更
......
7699 7753
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
7700 7754
                return false;
7701 7755
            }
7756
            finally
7757
            {
7758
                SubDB.close(); SubDB = null;
7759
                frm.Dispose(); frm = null;
7760
            }
7702 7761
        }
7703 7762
        #endregion
7704 7763

  
......
7747 7806
        /// <summary>
7748 7807
        /// 請求処理連携時インプット処理
7749 7808
        /// </summary>
7750
        public void BillingLinkInPut(int SetRow, int SetCol)
7809
        public bool SetSumReqData()
7751 7810
        {
7752 7811
            try
7753 7812
            {
7754
                // 請求処理連携以外は処理しない
7755
                if (!m_ReqSumSelFlag) return;
7756
                
7757
                // 支払カラム以外は処理しない
7758
                int FixColCnt = Enum.GetNames(typeof(GridColumn)).Length;
7759
                if (SetCol < FixColCnt) return;
7813
                // 請求処理表示連携以外は処理しない
7814
                if (!m_ReqSumDspFlag) return false;
7815
                // 請求まとめ対象業者コード
7816
                if (m_ReqSumCompany < 1) return false;
7817
                // 明細番号
7818
                if (m_TargetDetailNo < 0) return false;
7819
                // 書込みカラム位置
7820
                if (m_TargetColumn < 0) return false;
7821
                // 請求処理連携金額
7822
                if (m_AddingRequestPrice < 0) return false;
7760 7823

  
7761 7824
                DataGridView dgv = dgvAllDisplay;
7762
                // 明細行以外は処理しない
7763
                if (CommonMotions.cnvInt(dgv.Rows[SetRow].Cells[(int)GridColumn.TitleFlg].Value) == 0
7764
                    && CommonMotions.cnvInt(dgv.Rows[SetRow].Cells[(int)GridColumn.TotalFlg].Value) == 0
7765
                    && CommonMotions.cnvInt(dgv.Rows[SetRow].Cells[(int)GridColumn.BlankFlg].Value) == 0)
7766
                {
7767
                    // 明細データ行
7768
                }
7769
                else
7770
                {   // それ以外
7771
                    return;
7772
                }
7773 7825

  
7774
                // データセット
7775
                dgv.Rows[SetRow].Cells[SetCol].Value = m_AddingRequestPrice;
7776
                dgv.EndEdit();
7777
                // 変更フラグON
7778
                m_bChengeAns = true;
7826
                DataGridViewRow SelectRow = dgv.Rows.Cast<DataGridViewRow>().Where(x => CommonMotions.cnvInt(x.Cells[(int)GridColumn.CompanyCode].Value) == m_ReqSumCompany
7827
                                                                                && CommonMotions.cnvInt(x.Cells[(int)GridColumn.DetailNo].Value) == m_TargetDetailNo)
7828
                                                                            .First();
7829
                SelectRow.Cells[m_TargetColumn].Value = m_AddingRequestPrice.ToString("0,0");
7830

  
7831
                // 再計算処理
7832
                RowReCalculate(SelectRow, SelectRow.Index, m_TargetColumn);
7833

  
7834
                return true;
7779 7835
            }
7780 7836
            catch (Exception ex)
7781 7837
            {
7782 7838
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
7839
                return false;
7783 7840
            }
7784 7841
        }
7785 7842
        #endregion
7786 7843

  
7787
        #region 初期表示処理
7844
        #region 初期表示処理(請求まとめからの行選択呼出)
7788 7845
        /// <summary>
7789
        /// 初期表示処理
7846
        /// 初期表示処理(請求まとめからの行選択呼出)
7790 7847
        /// </summary>
7791
        private void InitReqSum()
7848
        private void InitReqSumDialog()
7792 7849
        {
7793 7850
            try
7794 7851
            {
......
7796 7853
                SeeModeLock();
7797 7854

  
7798 7855
                // 請求まとめ時使用ボタン表示
7799
                ReqSumButton(true);
7856
                ReqSumDialogButton();
7800 7857

  
7801 7858
                // 請求まとめ表示スタイルセット
7802
                InitReqSumStyle();
7859
                InitReqSumDialogStyle();
7803 7860

  
7804 7861
            }
7805 7862
            catch (System.Exception ex)
......
7809 7866
        }
7810 7867
        #endregion
7811 7868

  
7812
        #region 請求まとめ時使用ボタン表示
... 差分の行数が表示可能な上限を超えました。超過分は表示しません。

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