プロジェクト

全般

プロフィール

リビジョン 89

堀内7年以上前に追加

メニュー受注工事等の期選択バグ修正・非受注時申送りコメント追加・注文書選択画面表示修正

差分を表示:

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

  
19 19
        /// <summary>
20 20
        /// コピー・環境バージョン
trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs
80 80
            CostomerRegistList = 33,            // 33:発注者登録申請一覧
81 81
            CostomerRegist = 34,                // 34:発注者登録申請
82 82
            SubConstrRegistList = 35,           // 35:協力会社登録申請一覧
83
            SubConstrRegist = 36                // 36:協力会社登録申請
83
            SubConstrRegist = 36,               // 36:協力会社登録申請
84
            PriceOfBudget = 37,                 // 37:台帳状況確認画面
84 85
        }
85 86
        #endregion
86 87

  
......
177 178
                                                                                { (int)ProcessExecuteNo.RequestSummaryList,     "請求まとめ-入力"},
178 179
                                                                                { (int)ProcessExecuteNo.PaymentConfirmation,    "入金確認-入力"},
179 180
                                                                                { (int)ProcessExecuteNo.RequestInput,           "請求入力-入力"},
180
                                                                                { (int)ProcessExecuteNo.RequestPrint,           "請求書発行-印刷"},
181
                                                                                { (int)ProcessExecuteNo.RequestPrint,           "請求書-印刷"},
181 182
                                                                                { (int)ProcessExecuteNo.CostomerRegistList,     "発注者登録申請一覧-表示"},
182 183
                                                                                { (int)ProcessExecuteNo.CostomerRegist,         "発注者登録申請-入力"},
183 184
                                                                                { (int)ProcessExecuteNo.SubConstrRegistList,    "協力会社登録申請一覧-表示"},
184
                                                                                { (int)ProcessExecuteNo.SubConstrRegist,        "協力会社登録申請-入力"}
185
                                                                                { (int)ProcessExecuteNo.SubConstrRegist,        "協力会社登録申請-入力"},
186
                                                                                { (int)ProcessExecuteNo.PriceOfBudget,          "工事台帳状態確認-表示"},
185 187
        };
186 188

  
187 189
        #endregion
trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsSecurityPermission.cs
696 696
                {
697 697
                    bRet = GetExecutePermission(CommonMotions.LoginUserData.PersonCode, ExecCode, ref Editflg);
698 698
                }
699
                if (!bRet) Debug.Print("");
699

  
700 700
                return bRet;
701 701
            }
702 702
            catch (Exception ex)
trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsSystemOnceExecute.cs
36 36
        /// 非受注へ移す期間(受注できずに見積提出日より以下の日数を過ぎれば非受注へ移動)
37 37
        /// </summary>
38 38
        private const int s_NonOrderDay = 93;
39

  
40
        /// <summary>
41
        /// 非受注時メッセージ
42
        /// </summary>
43
        private const string s_NonOrderComment = "受注できずに見積提出日より{0}日を過ぎましたので非受注とします。";
39 44
        #endregion
40 45

  
41 46
        #region 変数
......
307 312
                               }
308 313
                            }
309 314
                        }
315
                        if (!procflg) break;
310 316
                    }
311 317
                    if (!procflg) break;
312 318
                }
......
592 598
        private bool ChangeNonOrdersData()
593 599
        {
594 600
            IOConstructionBaseInfo BaseDB = new IOConstructionBaseInfo();
601
            IOConstructionBaseInfoDetail DetailDB = new IOConstructionBaseInfoDetail();
595 602
            try
596 603
            {
597 604
                int iCode1 = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("非 受 注")).Key;
......
599 606
                int iCode3 = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("見積提出")).Key;
600 607

  
601 608
                // 対象データが存在するかを確認する
602
                string strSQL = "SELECT COUNT(*) FROM CONSTRUCTIONBASEINFO WHERE TRUNC(ESTIMATESSUBMITTEDDATE) != TO_DATE('0001/01/01','YYYY/MM/DD')";
603
                strSQL += string.Format(" AND TRUNC(ESTIMATESSUBMITTEDDATE + {0})", s_NonOrderDay);
604
                strSQL += string.Format(" < TO_DATE('{0}','YYYY/MM/DD')", DateTime.Now.ToShortDateString());
605
                strSQL += string.Format(" AND CONSTRUCTIONSTATUSFLG IN({0}, {1})", iCode2, iCode3);
606
                strSQL += string.Format(" AND ESTIMATETYPE IN ({0}, {1})", (int)CommonDefine.BaseInfoEstimateType.Normal, (int)CommonDefine.BaseInfoEstimateType.GetBudget);
609
                string strSQL = "SELECT A.CONSTRUCTIONCODE, B.DETAILSTRING FROM CONSTRUCTIONBASEINFO A";
610
                strSQL += " LEFT JOIN CONSTRUCTIONBASEINFODETAIL B ON B.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE";
611
                strSQL += string.Format(" AND B.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DetailDataNo.OrdersDecisionComment);
612
                
613
                string strWHERE = " WHERE TRUNC(A.ESTIMATESSUBMITTEDDATE) != TO_DATE('0001/01/01','YYYY/MM/DD')";
614
                strWHERE += string.Format(" AND TRUNC(A.ESTIMATESSUBMITTEDDATE + {0})", s_NonOrderDay);
615
                strWHERE += string.Format(" < TO_DATE('{0}','YYYY/MM/DD')", DateTime.Now.ToShortDateString());
616
                strWHERE += string.Format(" AND A.CONSTRUCTIONSTATUSFLG IN({0}, {1})", iCode2, iCode3);
617
                strWHERE += string.Format(" AND A.ESTIMATETYPE IN ({0}, {1})", (int)CommonDefine.BaseInfoEstimateType.Normal, (int)CommonDefine.BaseInfoEstimateType.GetBudget);
618
                strSQL += strWHERE;
607 619
                ArrayList arList = new ArrayList();
608 620
                if (!BaseDB.ExecuteReader(strSQL, ref arList))
609 621
                {
610
                    logger.ErrorFormat("工事基本情報更新エラー 非受注案件移行処理失敗:{0}:{1}", CommonMotions.GetMethodName(), strSQL);
622
                    logger.ErrorFormat("工事基本情報読込エラー 非受注案件移行処理失敗:{0}:{1}", CommonMotions.GetMethodName(), strSQL);
611 623
                    return false;
612 624
                }
613
                object[] wrkcount = (object[])arList[0];
614
                if (Common.CommonMotions.cnvInt(wrkcount[0]) == 0) return true;
625
                // ----- 対象データが存在しなければ抜ける
626
                if (arList.Count == 0) return true;
615 627

  
616
                // 対象データが存在すれば更新する
628
                // ----- 対象データが存在すれば更新する
629
                BaseDB.connect(); BaseDB.beginTran();
630
                DetailDB.connect(); DetailDB.beginTran();
631

  
632
                // 工事基本情報データ
617 633
                strSQL = string.Format("UPDATE CONSTRUCTIONBASEINFO SET CONSTRUCTIONSTATUSFLG = {0},", iCode1);
618 634
                strSQL += string.Format(" NONORDERDATE = TO_DATE('{0}','YYYY/MM/DD')", DateTime.Today.ToShortDateString());
619
                strSQL += " WHERE CONSTRUCTIONCODE IN";
620
                strSQL += " (SELECT CONSTRUCTIONCODE FROM CONSTRUCTIONBASEINFO WHERE TRUNC(ESTIMATESSUBMITTEDDATE) != TO_DATE('0001/01/01','YYYY/MM/DD')";
621
                strSQL += string.Format(" AND TRUNC(ESTIMATESSUBMITTEDDATE + {0})", s_NonOrderDay);
622
                strSQL += string.Format(" < TO_DATE('{0}','YYYY/MM/DD')", DateTime.Now.ToShortDateString());
623
                strSQL += string.Format(" AND CONSTRUCTIONSTATUSFLG IN({0}, {1})", iCode2, iCode3);
624
                strSQL += string.Format(" AND ESTIMATETYPE IN ({0}, {1}))", (int)CommonDefine.BaseInfoEstimateType.Normal, (int)CommonDefine.BaseInfoEstimateType.GetBudget);
625
                if (!BaseDB.ExecuteNonQuery(strSQL))
635
                strSQL += string.Format(" WHERE CONSTRUCTIONCODE IN (SELECT A.CONSTRUCTIONCODE FROM CONSTRUCTIONBASEINFO A {0})", strWHERE);
636
                if (!BaseDB.ExecuteNonQuery(strSQL, false))
626 637
                {
638
                    BaseDB.rollback();
627 639
                    logger.ErrorFormat("工事基本情報更新エラー 非受注案件移行処理失敗:{0}:{1}", CommonMotions.GetMethodName(), strSQL);
628 640
                    return false;
629 641
                }
630 642

  
643
                // 工事基本情報明細データ
644
                string strMsg = string.Format(s_NonOrderComment, s_NonOrderDay);
645
                string strOrgMsg = string.Empty;
646
                foreach (object[] objRec in arList)
647
                {
648
                    strOrgMsg = string.Empty;
649
                    strOrgMsg = CommonMotions.cnvString(objRec[1]);
650
                    if (strOrgMsg.Length != 0)
651
                    {
652
                        strOrgMsg += "\n";
653
                        strOrgMsg += strMsg;
654
                        if (strOrgMsg.Length > 120) strOrgMsg = strOrgMsg.Substring(0, 120);
655
                        if (!DetailDB.UpdateFeild(CommonMotions.cnvInt(objRec[0]),
656
                                                    (int)IOConstructionBaseInfoDetail.TableColumn.DETAIL_STRING,
657
                                                    strOrgMsg,
658
                                                    false,
659
                                                    (int)ConstructionBaseInfoDetail.DetailDataNo.OrdersDecisionComment))
660
                        {
661
                            BaseDB.rollback();
662
                            DetailDB.rollback();
663
                            logger.ErrorFormat("工事基本情報明細更新エラー 非受注案件移行処理失敗:{0}:{1}", CommonMotions.GetMethodName(), strSQL);
664
                            return false;
665
                        }
666
                    }
667
                    else
668
                    {
669
                        if (!CreateBaseInfoDetail(DetailDB, CommonMotions.cnvInt(objRec[0]), strMsg))
670
                        {
671
                            BaseDB.rollback();
672
                            DetailDB.rollback();
673
                            logger.ErrorFormat("工事基本情報明細作成エラー 非受注案件移行処理失敗:{0}:{1}", CommonMotions.GetMethodName(), strSQL);
674
                            return false;
675
                        }
676
                    }
677
                }
678

  
631 679
                return true;
632 680
            }
633 681
            catch (Exception ex)
......
637 685
            }
638 686
            finally
639 687
            {
688
                BaseDB.commit();
689
                DetailDB.commit();
640 690
                BaseDB.close(); BaseDB = null;
691
                DetailDB.close(); DetailDB = null;
641 692
            }
642 693
        }
643 694
        #endregion
644 695

  
696
        #region 工事基本情報明細作成(受注決定申送りコメント)
697
        /// <summary>
698
        /// 工事基本情報明細作成(受注決定申送りコメント)
699
        /// </summary>
700
        /// <returns></returns>
701
        private bool CreateBaseInfoDetail(IOConstructionBaseInfoDetail DetailDB, int ConstrCode, string strMsg)
702
        {
703
            try
704
            {
705
                ConstructionBaseInfoDetail work = new ConstructionBaseInfoDetail();
706
                work.ConstructionCode = ConstrCode;
707
                work.DetailNo = (int)ConstructionBaseInfoDetail.DetailDataNo.OrdersDecisionComment;
708
                work.DetailString = strMsg;
709

  
710
                if (!DetailDB.InsertAction(work, false)) return false;
711

  
712
                return true;
713
            }
714
            catch (Exception ex)
715
            {
716
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
717
                return false;
718
            }
719
        }
720
        #endregion
721

  
645 722
        #region 工事詳細台帳の給与を加算する
646 723
        /// <summary>
647 724
        /// 工事詳細台帳の給与を加算する
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionLedger.cs
497 497
                wrk.GrossProfit = double.Parse(objwrk[(int)TableColumn.GrossProfit].ToString());                   // 粗利
498 498
                wrk.Allowance = double.Parse(objwrk[(int)TableColumn.Allowance].ToString());                       // 給与
499 499
                wrk.NetProfit = double.Parse(objwrk[(int)TableColumn.NetProfit].ToString());                       // 純利益
500
                wrk.ComplateFlg = double.Parse(objwrk[(int)TableColumn.ComplateFlg].ToString());                   // 入力完了フラグ
501
                wrk.IntegrationFlg = int.Parse(objwrk[(int)TableColumn.IntegrationFlg].ToString());                // 受注金額積算フラグ
500
                wrk.ComplateFlg = int.Parse(objwrk[(int)TableColumn.ComplateFlg].ToString());                       // 入力完了フラグ
501
                wrk.IntegrationFlg = int.Parse(objwrk[(int)TableColumn.IntegrationFlg].ToString());                 // 受注金額積算フラグ
502 502

  
503 503
                wrk.EntryDate = DateTime.Parse(objwrk[(int)TableColumn.EntryDate].ToString());
504 504
                wrk.UpdateDate = DateTime.Parse(objwrk[(int)TableColumn.UpdateDate].ToString());
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOProceedingsDataAttend.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Data;
6
using System.Collections;
7

  
8
using log4net;
9
using Oracle.ManagedDataAccess.Client;
10

  
11
using ProcessManagement.DB.Oracle;
12
using ProcessManagement.DB.Core;
13
using ProcessManagement.DataModel;
14
using ProcessManagement.Common;
15

  
16
namespace ProcessManagement.DB.IOAccess
17
{
18
    /// <summary>
19
    /// 発注者打ち合わせ議事録データアクセス(出席者)
20
    /// </summary>
21
    public class IOProceedingsDataAttend : OracleProcess
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 TableColumn
35
        {
36
            /// <summary>
37
            /// 工事番号
38
            /// </summary>
39
            ConstructionCode,
40
            /// <summary>
41
            /// 議事録作成日
42
            /// </summary>
43
            ProceedingsDataDate,
44
            /// <summary>
45
            /// 会議時間開始
46
            /// </summary>
47
            StartMeetingTime,
48
            /// <summary>
49
            /// データ行番号
50
            /// </summary>
51
            SeqNo,
52
            /// <summary>
53
            /// 出席者所属
54
            /// </summary>
55
            Department,
56
            /// <summary>
57
            /// 出席者氏名
58
            /// </summary>
59
            AttendName,
60
            /// <summary>
61
            /// 登録年月日
62
            /// </summary>
63
            EntryDate,
64
            /// <summary>
65
            /// 更新年月日
66
            /// </summary>
67
            UpdateDate,
68
        }
69
        #endregion
70

  
71
        #region コンストラクタ
72
        /// <summary>
73
        /// コンストラクタ
74
        /// </summary>
75
        /// <param name="ConnectionString"></param>
76
        public IOProceedingsDataAttend()
77
            : base(DBCommon.Instance.DBConnectString)
78
        {
79
        }
80

  
81
        #endregion
82

  
83
        #region SQL作成
84
        /// <summary>
85
        /// SQL作成
86
        /// </summary>
87
        private string CreateSelectSQL()
88
        {
89
            // SQL作成(oracleのDateTime型が変換できないのでCharに変換しておく)
90
            string strcmd = "SELECT";
91

  
92
            strcmd += " ConstructionCode";                                  // 工事番号
93
            strcmd += " ,TO_CHAR(ProceedingsDataDate, 'YYYY/MM/DD')";       // 議事録作成日
94
            strcmd += " ,StartMeetingTime";                                 // 会議時間開始
95
            strcmd += " ,SeqNo";                                            // データ行番号
96
            strcmd += " ,Department";                                       // 出席者所属
97
            strcmd += " ,AttendName";                                       // 出席者氏名
98
            strcmd += ", TO_CHAR(EntryDate, 'YYYY/MM/DD HH24:MI:ss')";      // 登録年月日
99
            strcmd += ", TO_CHAR(UpdateDate, 'YYYY/MM/DD HH24:MI:ss')";     // 更新年月日
100
            strcmd += " FROM ProceedingsDataAttend";
101

  
102
            return strcmd;
103
        }
104
        #endregion
105

  
106
        #region 複数読込み処理
107
        public bool SelectAction(string AddSQLString, ref List<ProceedingsDataAttend> data, bool bConnect = true)
108
        {
109
            //Oracle インターフェース
110
            string strcmd = "";
111
            ArrayList arData = new ArrayList();
112

  
113
            try
114
            {
115
                // SQL作成
116
                strcmd = CreateSelectSQL() + AddSQLString;
117

  
118
                // SQL実行
119
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return false;
120

  
121
                // データセット
122
                foreach (object[] objwrk in arData)
123
                {
124
                    ProceedingsDataAttend work = new ProceedingsDataAttend();
125
                    Reader2Struct(objwrk, ref work);
126
                    data.Add(work);
127
                }
128

  
129
                return true;
130
            }
131
            catch (Exception ex)
132
            {
133
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
134
                return false;
135
            }
136
        }
137
        #endregion
138

  
139
        #region 1件読込み処理
140
        public bool SelectAction(string AddSQLString, ref ProceedingsDataAttend data, bool bConnect = true)
141
        {
142
            //Oracle インターフェース
143
            string strcmd = "";
144
            ArrayList arData = new ArrayList();
145

  
146
            try
147
            {
148
                strcmd = CreateSelectSQL() + AddSQLString;
149

  
150
                // SQL実行
151
                if (!ExecuteReader(strcmd, ref arData, bConnect)) return false;
152
                if (arData.Count == 0) return false;
153

  
154
                // データセット
155
                foreach (object[] objwrk in arData)
156
                {
157
                    Reader2Struct(objwrk, ref data);
158
                    break;
159
                }
160

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

  
171
        #region 1件追加処理
172
        /// <summary>
173
        /// 担当者毎経費データ追加
174
        /// </summary>
175
        /// <param name="data">担当者毎経費データデータ</param>
176
        /// <returns>true:成功 false:失敗</returns>
177
        public bool InsertAction(ProceedingsDataAttend work, bool bConnect = true)
178
        {
179
            string strcmd = "";
180
            try
181
            {
182
                strcmd = "INSERT INTO ProceedingsDataAttend";
183

  
184
                strcmd += " (";
185
                bool bFirst = true;
186
                foreach (var gender in Enum.GetValues(typeof(TableColumn)))
187
                {
188
                    if (!bFirst) strcmd += " ,";
189
                    strcmd += gender.ToString();
190
                    bFirst = false;
191
                }
192
                strcmd += ") VALUES (";
193

  
194
                strcmd += string.Format(" {0}", work.ConstructionCode);                     // 工事番号
195
                
196
                strcmd += string.Format(", TO_DATE('{0}','YYYY/MM/DD')"
197
                                            , work.ProceedingsDataDate.ToShortDateString());// 議事録作成日
198

  
199
                strcmd += string.Format(", {0}", work.StartMeetingTime);                    // 会議時間開始
200
                strcmd += string.Format(", {0}", work.SeqNo);                               // データ行番号
201

  
202
                strcmd += string.Format(",'{0}'", work.Department);                         // 出席者所属
203
                strcmd += string.Format(",'{0}'", work.AttendName);                         // 出席者氏名
204

  
205
                strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
206
                strcmd += ", TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
207
                strcmd = strcmd + ")";
208

  
209
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
210

  
211
                return true;
212
            }
213
            catch (Exception ex)
214
            {
215
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
216
                return false;
217
            }
218
        }
219
        #endregion
220

  
221
        #region 複数追加処理
222
        public bool InsertAction(List<ProceedingsDataAttend> data, bool bConnect = true)
223
        {
224
            string strcmd = "";
225
            try
226
            {
227

  
228
                foreach (ProceedingsDataAttend work in data)
229
                {
230
                    if (!InsertAction(work, bConnect)) return false;
231
                }
232
                return true;
233
            }
234
            catch (Exception ex)
235
            {
236
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
237
                return false;
238
            }
239
        }
240
        #endregion
241

  
242
        #region 更新処理
243
        /// <summary>
244
        /// 担当者毎経費データ更新
245
        /// </summary>
246
        /// <param name="AddSQLString">更新条件SQL文字列</param>
247
        /// <param name="data">担当者毎経費データデータ</param>
248
        /// <returns>true:成功 false:失敗</returns>
249
        public bool UpdateAction(string AddSQLString, ProceedingsDataAttend data, bool bConnect = true)
250
        {
251
            string strcmd = "";
252
            try
253
            {
254

  
255
                strcmd = "UPDATE ProceedingsDataAttend";
256

  
257
                strcmd += " SET";
258

  
259
                strcmd += string.Format(" ConstructionCode = {0}", data.ConstructionCode);      // 工事番号
260
                
261
                strcmd += string.Format(",ProceedingsDataDate = TO_DATE('{0}','YYYY/MM/DD')"
262
                                        , data.ProceedingsDataDate.ToShortDateString());        // 議事録作成日
263

  
264
                strcmd += string.Format(",StartMeetingTime = {0}", data.StartMeetingTime);      // 会議時間開始
265
                strcmd += string.Format(",SeqNo = {0}", data.SeqNo);                            // データ行番号
266

  
267
                strcmd += string.Format(",Department = '{0}'", data.Department);                // 出席者所属
268
                strcmd += string.Format(",AttendName = '{0}'", data.AttendName);                // 出席者氏名
269

  
270
                strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')";
271
                strcmd += AddSQLString;
272

  
273
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
274

  
275
                return true;
276
            }
277
            catch (Exception ex)
278
            {
279
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
280
                return false;
281
            }
282
        }
283
        #endregion
284

  
285
        #region 削除処理
286
        /// <summary>
287
        /// 担当者毎経費データ削除
288
        /// </summary>
289
        /// <param name="AddSQLString">削除条件SQL文字列</param>
290
        /// <param name="data">担当者毎経費データデータ</param>
291
        /// <returns>true:成功 false:失敗</returns>
292
        public bool DeleteAction(string AddSQLString, bool bConnect = true)
293
        {
294
            //Oracle インターフェース
295
            string strcmd = "";
296
            try
297
            {
298
                strcmd = string.Format("{0}{1}", "DELETE FROM ProceedingsDataAttend", AddSQLString);
299

  
300
                if (!ExecuteNonQuery(strcmd, bConnect)) return false;
301

  
302
                return true;
303
            }
304
            catch (Exception ex)
305
            {
306
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
307
                return false;
308
            }
309
        }
310
        #endregion
311

  
312
        #region データセット処理
313
        /// <summary>
314
        /// OracleDataReaderより構造体へセットする
315
        /// </summary>
316
        /// <param name="reader">OracleDataReader</param>
317
        /// <param name="wrk">構造体</param>
318
        public void Reader2Struct(object[] objwrk, ref ProceedingsDataAttend wrk)
319
        {
320
            try
321
            {
322
                // データ取得
323
                wrk.ConstructionCode = int.Parse(objwrk[(int)TableColumn.ConstructionCode].ToString());      // 工事番号
324
                wrk.ProceedingsDataDate = DateTime.Parse(objwrk[(int)TableColumn.ProceedingsDataDate].ToString());       // 議事録作成日
325
                wrk.StartMeetingTime = int.Parse(objwrk[(int)TableColumn.StartMeetingTime].ToString());      // 会議時間開始
326
                wrk.SeqNo = int.Parse(objwrk[(int)TableColumn.SeqNo].ToString());                            // データ行番号
327

  
328
                wrk.Department = objwrk[(int)TableColumn.Department].ToString();                             // 出席者所属
329
                wrk.AttendName = objwrk[(int)TableColumn.AttendName].ToString();                             // 出席者氏名
330

  
331
                wrk.EntryDate = DateTime.Parse(objwrk[(int)TableColumn.EntryDate].ToString());
332
                wrk.UpdateDate = DateTime.Parse(objwrk[(int)TableColumn.UpdateDate].ToString());
333
            }
334
            catch (OracleException oraex)
335
            {
336
                logger.ErrorFormat("オラクルエラー:{0}:{1}", CommonMotions.GetMethodName(2), oraex.Message);
337
            }
338
            catch (Exception ex)
339
            {
340
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(2), ex.Message);
341
            }
342
        }
343
        #endregion
344

  
345
        #region 検索文字列作成処理
346
        /// <summary>
347
        /// 主キー検索の文字列を返す
348
        /// </summary>
349
        /// <param name="PersonCode"></param>
350
        /// <param name="ActionDate"></param>
351
        /// <param name="DataType"></param>
352
        /// <param name="DataAddCount"></param>
353
        /// <returns></returns>
354
        public string CreatePrimarykeyString(int ConstructionCode, DateTime ProceedingsDataDate, int StartMeetingTime = 0, int SeqNo = 0)
355
        {
356
            string strWork = "";
357
            try
358
            {
359
                strWork = string.Format(" WHERE ConstructionCode = {0}", ConstructionCode);
360
                if (ProceedingsDataDate != DateTime.MinValue)
361
                    strWork += string.Format(" AND ProceedingsDataDate = TO_DATE('{0}','YYYY/MM/DD')", ProceedingsDataDate.ToShortDateString());
362
                if (StartMeetingTime != 0)
363
                    strWork += string.Format(" AND StartMeetingTime = {0}", StartMeetingTime);
364
                if (SeqNo != 0)
365
                    strWork += string.Format(" AND SeqNo = {0}", SeqNo);
366
            }
367
            catch (Exception ex)
368
            {
369
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork);
370
            }
371

  
372
            return strWork;
373
        }
374
        #endregion
375

  
376
    }
377
}
trunk/src/ProcessManagement/ProcessManagement/DataModel/ConstructionLedger.cs
30 30
        private double      m_GrossProfit = 0;                          // 粗利
31 31
        private double      m_Allowance = 0;                            // 給与
32 32
        private double      m_NetProfit = 0;                            // 純利益
33
        private double      m_ComplateFlg = 0;                          // 入力完了フラグ
33
        private int         m_ComplateFlg = 0;                          // 入力完了フラグ
34 34
        private int         m_IntegrationFlg = 0;                       // 受注金額積算フラグ
35 35

  
36 36
        private DateTime m_EntryDate = DateTime.Now;                    // 登録日付
......
173 173
        /// <summary>
174 174
        /// 入力完了フラグ
175 175
        /// </summary>
176
        public double ComplateFlg
176
        public int ComplateFlg
177 177
        {
178 178
            get { return m_ComplateFlg; }
179 179
            set { m_ComplateFlg = value; }
trunk/src/ProcessManagement/ProcessManagement/DataModel/ProceedingsDataAttend.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 ProceedingsDataAttend
12
    {
13
        #region メンバ変数
14
        /// <summary>
15
        /// 工事番号
16
        /// </summary>
17
        private int         m_ConstructionCode = 0;
18
        /// <summary>
19
        /// 議事録作成日
20
        /// </summary>
21
        private DateTime    m_ProceedingsDataDate = DateTime.Now;
22
        /// <summary>
23
        /// 会議時間開始
24
        /// </summary>
25
        private int         m_StartMeetingTime = 0;
26
        /// <summary>
27
        /// データ行番号
28
        /// </summary>
29
        private int         m_SeqNo = 0;
30
        /// <summary>
31
        /// 出席者所属
32
        /// </summary>
33
        private string      m_Department = string.Empty;
34
        /// <summary>
35
        /// 出席者氏名
36
        /// </summary>
37
        private string      m_AttendName = string.Empty;
38
        /// <summary>
39
        /// 登録年月日
40
        /// </summary>
41
        private DateTime    m_EntryDate = DateTime.Now;
42
        /// <summary>
43
        /// 更新年月日
44
        /// </summary>
45
        private DateTime    m_UpdateDate = DateTime.Now;
46
        #endregion
47

  
48
        #region プロパティ
49
        /// <summary>
50
        /// 工事番号
51
        /// </summary>
52
        public int ConstructionCode
53
        {
54
            get { return m_ConstructionCode; }
55
            set { m_ConstructionCode = value; }
56
        }
57
        /// <summary>
58
        /// 議事録作成日
59
        /// </summary>
60
        public DateTime ProceedingsDataDate
61
        {
62
            get { return m_ProceedingsDataDate; }
63
            set { m_ProceedingsDataDate = value; }
64
        }
65
        /// <summary>
66
        /// 会議時間開始
67
        /// </summary>
68
        public int StartMeetingTime
69
        {
70
            get { return m_StartMeetingTime; }
71
            set { m_StartMeetingTime = value; }
72
        }
73
        /// <summary>
74
        /// データ行番号
75
        /// </summary>
76
        public int SeqNo
77
        {
78
            get { return m_SeqNo; }
79
            set { m_SeqNo = value; }
80
        }
81
        /// <summary>
82
        /// 出席者所属
83
        /// </summary>
84
        public string Department
85
        {
86
            get { return m_Department; }
87
            set { m_Department = value; }
88
        }
89
        /// <summary>
90
        /// 出席者氏名
91
        /// </summary>
92
        public string AttendName
93
        {
94
            get { return m_AttendName; }
95
            set { m_AttendName = value; }
96
        }
97
        /// <summary>
98
        /// 登録年月日
99
        /// </summary>
100
        public DateTime EntryDate
101
        {
102
            get { return m_EntryDate; }
103
            set { m_EntryDate = value; }
104
        }
105
        /// <summary>
106
        /// 更新年月日
107
        /// </summary>
108
        public DateTime UpdateDate
109
        {
110
            get { return m_UpdateDate; }
111
            set { m_UpdateDate = value; }
112
        }
113
        #endregion
114
    }
115
}
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfo.cs
1563 1563
                DateTime dtToday = GetPrevDateFieldValue(sender);
1564 1564

  
1565 1565
                // ??????o????J?E???g
1566
                // int sepStrCnt = txtbox.Text.Length - txtbox.Text.Replace("/", "").Length;
1567 1566
                if (CommonMotions.chkNumeric(txtbox.Text))
1568 1567
                {   // ??????????
1569 1568
                    if (txtbox.Text.ToString().Length <= 4)
1570 1569
                    {
1571
                        //txtbox.Text = m_dispControl[(int)Dispcount.ConstructionYear].Text
1572 1570
                        txtbox.Text = dtToday.Year.ToString()
1573 1571
                                        + "/" + CommonMotions.cnvInt(txtbox.Text.Substring(0, 2)).ToString("00")
1574 1572
                                        + "/" + CommonMotions.cnvInt(txtbox.Text.Substring(2)).ToString("00");
......
1578 1576
                {   // 99/99?????
1579 1577
                    if (txtbox.Text.ToString().Length <= 5)
1580 1578
                    {
1581
                        //txtbox.Text = m_dispControl[(int)Dispcount.ConstructionYear].Text
1582 1579
                        txtbox.Text = dtToday.Year.ToString()
1583 1580
                                        + "/" + CommonMotions.cnvInt(txtbox.Text.Substring(0, txtbox.Text.IndexOf("/"))).ToString("00")
1584 1581
                                        + "/" + CommonMotions.cnvInt(txtbox.Text.Substring(txtbox.Text.IndexOf("/") + 1)).ToString("00");
......
1588 1585

  
1589 1586
                // ???N?x?`?F?b?N
1590 1587
                txtbox.Text = DTNextYearChange(txtbox).ToShortDateString();
1591
                //txtbox.Text = DTNextYearChange(ClsCommon.cnvDate(txtbox.Text)).ToShortDateString();
1592 1588

  
1593 1589
                if (!CommonMotions.chkDate(txtbox.Text.ToString())) return;
1594 1590

  
1595 1591
                txtbox.Text = DateTime.Parse(txtbox.Text.ToString()).ToShortDateString();
1596 1592

  
1593
                ValidatedDate(txtbox);
1594

  
1597 1595
                m_bChengeAns = true;
1598 1596
            }
1599 1597
            catch (Exception ex)
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfoAuxiliary.cs
339 339
                if (m_DspCtrl[(int)DspCnt.SalesPersonCode].Text.Length != 0) iLength++;
340 340
                if (!CommonMotions.DispFieldIndispensable(m_DspCtrl[(int)DspCnt.SalesPersonCode]))
341 341
                    iNGno = (int)DspCnt.SalesPersonCode;
342
                if (m_DspCtrl[(int)DspCnt.SalesPersonCode].Text.Trim().Equals(CommonDefine.s_UndecidedString))
343
                {
344
                    iNGno = (int)DspCnt.SalesPersonCode;
345
                    // ?w?i?F??X
346
                    CommonMotions.chgBackColor(m_DspCtrl[(int)DspCnt.SalesPersonCode], false);
347
                }
342 348

  
343 349
                // ???????
344 350
                if (m_DspCtrl[(int)DspCnt.OrderersDivision].Text.Length != 0) iLength++;
......
4104 4110
            }
4105 4111
        }
4106 4112
        #endregion
4113

  
4114
        #region ?_??H???????????z???????????
4115
        /// <summary>
4116
        /// ?_??H???????????z???????????
4117
        /// </summary>
4118
        /// <param name="txtbox"></param>
4119
        private void ValidatedDate(TextBox txtbox)
4120
        {
4121
            try
4122
            {
4123
                bool bTarget = false;
4124
                if (txtbox.Name.Equals(m_DspCtrl[(int)DspCnt.ConstructionPeriodStart].Name)) bTarget = true;    // 48: ?_??H???J?n
4125
                if (txtbox.Name.Equals(m_DspCtrl[(int)DspCnt.ConstructionPeriodEnd].Name)) bTarget = true;      // 49: ?_??H??????
4126
                if (txtbox.Name.Equals(m_DspCtrl[(int)DspCnt.ConstructionPeriodStart2].Name)) bTarget = true;	// 62: ?_??H???J?n?i???????j
4127
                if (txtbox.Name.Equals(m_DspCtrl[(int)DspCnt.ConstructionPeriodEnd2].Name)) bTarget = true;		// 63: ?_??H???????i???????j
4128

  
4129
                // ????O??????????
4130
                if (!bTarget) return;
4131

  
4132
                // ?w????????
4133
                int Period = CommonMotions.cnvInt(m_DspCtrl[(int)DspCnt.ConstructionPeriod].Text);              //  2: ?H????
4134
                DateTime dtStart = DateTime.Now;
4135
                DateTime dtEnd = DateTime.Now;
4136
                int iYear = 0;
4137
                int month = 0;
4138
                int day = 0;
4139
                bool bPeriod = true;
4140
                if (CommonMotions.SystemMasterData.ConstructionNoBase == (int)CommonDefine.SystemConstructionNoBase.BusinessPeriod)
4141
                {   // ?c???
4142
                    iYear = CommonMotions.PeriodCountToYear(Period);
4143
                    bPeriod = true;
4144
                }
4145
                CommonMotions.GetBeginningMonthDay(bPeriod, ref month, ref day);
4146
                dtStart = new DateTime(iYear, month, day);
4147
                dtEnd = dtStart.AddYears(1).AddDays(-1);     // ?I????{1?N?|1??
4148

  
4149
                // ?{?H?????
4150
                DateTime dtCStart = CommonMotions.cnvDate(m_DspCtrl[(int)DspCnt.ConstructionPeriodStart].Text);     // 48: ?_??H???J?n
4151
                DateTime dtCStart2 = CommonMotions.cnvDate(m_DspCtrl[(int)DspCnt.ConstructionPeriodStart2].Text);   // 62: ?_??H???J?n?i???????j
4152
                if (dtCStart2 == DateTime.MinValue) dtCStart2 = dtCStart;
4153
                if (dtCStart2 < dtCStart) dtCStart = dtCStart2;
4154

  
4155
                DateTime dtCEnd = CommonMotions.cnvDate(m_DspCtrl[(int)DspCnt.ConstructionPeriodEnd].Text);         // 49: ?_??H??????
4156
                DateTime dtCEnd2 = CommonMotions.cnvDate(m_DspCtrl[(int)DspCnt.ConstructionPeriodEnd2].Text);		// 63: ?_??H???????i???????j
4157
                if (dtCEnd2 == DateTime.MinValue) dtCEnd2 = dtCEnd;
4158
                if (dtCEnd < dtCEnd2) dtCEnd = dtCEnd2;
4159

  
4160
                // ???????????O
4161
                if (dtCStart < dtStart)
4162
                {
4163
                    if(MessageBox.Show("?_??H?????H????\n????v???????????O???w????????\n?v??????X????????H",
4164
                                    "?_??H?????H???`?F?b?N",
4165
                                    MessageBoxButtons.YesNo, MessageBoxIcon.Information)==DialogResult.Yes)
4166
                    {
4167
                        int NewPeriod = Period;
4168
                        for (int i = 1; i < 10; i++)
4169
                        {
4170
                            dtStart = new DateTime((iYear - i), month, day);
4171
                            dtEnd = dtStart.AddYears(1).AddDays(-1);
4172
                            if (dtStart <= dtCStart && dtCStart <= dtEnd)
4173
                            {
4174
                                NewPeriod -= i;
4175
                                break;
4176
                            }
4177
                        }
4178
                        m_DspCtrl[(int)DspCnt.ConstructionPeriod].Text = NewPeriod.ToString();
4179
                        return;
4180
                    }
4181
                }
4182
                if (dtEnd < dtCEnd)
4183
                {
4184
                    if (MessageBox.Show("?_??H??????????\n????v????????????~???w????????\n?v??????X????????H",
4185
                                    "?_??H?????????`?F?b?N",
4186
                                    MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
4187
                    {
4188
                        int NewPeriod = Period;
4189
                        for (int i = 1; i < 10; i++)
4190
                        {
4191
                            dtStart = new DateTime((iYear + i), month, day);
4192
                            dtEnd = dtStart.AddYears(1).AddDays(-1);
4193
                            if (dtStart <= dtCEnd && dtCEnd <= dtEnd)
4194
                            {
4195
                                NewPeriod += i;
4196
                                break;
4197
                            }
4198
                        }
4199
                        m_DspCtrl[(int)DspCnt.ConstructionPeriod].Text = NewPeriod.ToString();
4200
                        return;
4201
                    }
4202
                }
4203
            }
4204
            catch (Exception ex)
4205
            {
4206
                logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", CommonMotions.GetMethodName(), ex.Message);
4207
            }
4208
        }
4209
        #endregion
4107 4210
    }
4108 4211
}
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerList.cs
171 171
                                                            "?w ?? ?? ?U ??",
172 172
                                                            "?S??????^???z"};
173 173
        #endregion
174

  
175
        #region ???v???Z?X????
176
        /// <summary>
177
        /// ???v???Z?X????
178
        /// </summary>
179
        private static int s_CurrentProcessNo = (int)ClsExcute.ProcessExecuteNo.ConstructionLedgerList;
174 180
        #endregion
175 181

  
182
        #endregion
183

  
176 184
        #region ???
177 185
        /// <summary>
178 186
        /// ?t?B?[???h?l????t???O
......
259 267
        private bool m_NextProcFlg = false;
260 268
        #endregion
261 269

  
262
        #region ????m?F???
263
        /// <summary>
264
        /// ????m?F???
265
        /// </summary>
266
        private FrmPriceOfBudget m_PriceOfBudget = null;
267 270
        #endregion
268 271

  
269
        #endregion
270

  
271 272
        #region ?v???p?e?B
272 273

  
273 274
        #region ?N???t???O
......
389 390
        {
390 391
            try
391 392
            {
393
                // ?t?H?[????Close????????????N???[?Y????
394
                TerminatingProcess();
395

  
392 396
                if (m_CloseingProcessOff) return;
393 397

  
394
                // ????m?F?????\???????????N???[?Y????
395
                if (m_PriceOfBudget != null)
396
                {
397
                    m_PriceOfBudget.Dispose();
398
                    m_PriceOfBudget = null;
399
                }
400

  
401 398
                // ?O?v???Z?X????
402 399
                ClsExcute.BackProcess();
403 400
            }
......
445 442
        /// <param name="e"></param>
446 443
        private void btnLedgerStatus_Click(object sender, EventArgs e)
447 444
        {
448
            // ?t?H?[?????\?????????????O??\???????????
449
            if (m_PriceOfBudget != null)
450
            {
451
                m_PriceOfBudget.Activate();
452
                return;
453
            }
454
            // ?O??\??
445
            // ???\??
455 446
            DispPriceOfBudget();
456 447
        }
457 448
        #endregion
458 449

  
459
        #region ????m?F???N???[?Y
460
        /// <summary>
461
        /// ????m?F????N???[?Y????????
462
        /// </summary>
463
        /// <param name="sender"></param>
464
        /// <param name="e"></param>
465
        private void FrmPriceOfBudget_FormClosed(object sender, FormClosedEventArgs e)
466
        {
467
            try
468
            {
469
                this.Activate();
470

  
471
                // ?n???h???N???A
472
                m_PriceOfBudget.Dispose();
473
                m_PriceOfBudget = null;
474
            }
475
            catch (Exception ex)
476
            {
477
                logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", CommonMotions.GetMethodName(), ex.Message);
478
            }
479
        }
480
        #endregion
481

  
482 450
        #region ?t?H?[?????[?h
483 451
        /// <summary>
484 452
        /// ?????t?H?[?????[?h
485 453
        /// </summary>
486 454
        /// <param name="sender"></param>
487 455
        /// <param name="e"></param>
488
        private void FrmConstructionBaseInfoList_Load(object sender, EventArgs e)
456
        private void FrmLedgerStatus_Load(object sender, EventArgs e)
489 457
        {
490 458

  
491 459
            // ?R???{?{?b?N?X?Z?b?g
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerList.designer.cs
936 936
            this.ShowIcon = false;
937 937
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
938 938
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmConstructionLedgerList_FormClosing);
939
            this.Load += new System.EventHandler(this.FrmConstructionBaseInfoList_Load);
939
            this.Load += new System.EventHandler(this.FrmLedgerStatus_Load);
940 940
            this.SizeChanged += new System.EventHandler(this.FrmConstructionLedgerList_SizeChanged);
941 941
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FrmConstructionLedgerList_KeyDown);
942 942
            this.groupBox1.ResumeLayout(false);
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerListAuxiliary.cs
73 73
            else
74 74
            {
75 75
                int Master = CommonDefine.SecurityRankList[(int)CommonDefine.SecurityRankPos.SpecialAuthority].Key;
76
                if (CommonMotions.LoginUserSecurity.SecRank == Master) btnLedgerStatus.Visible = true;
77
                else btnLedgerStatus.Visible = false;
76
                // ??????{?^???\??
77
                int editflg = 0;
78
                btnLedgerStatus.Visible = ClsSecurityPermission.GetExecutePermission((int)ClsExcute.ProcessExecuteNo.PriceOfBudget, ref editflg);
78 79
            }
79 80
        }
80 81
        #endregion
......
146 147
        }
147 148
        #endregion
148 149

  
150
        #region ?I????????
151
        /// <summary>
152
        /// ?I?????T?u?t?H?[???N???[?Y
153
        /// </summary>
154
        private void TerminatingProcess()
155
        {
156
            try
157
            {
158
                // ?t?H?[????Close????????????N???[?Y????
159
                for (int i = 0; i < ClsExcute.SubFormHandleList.Length; i++)
160
                {
161
                    PreserveSubFormHandle Handle = ClsExcute.SubFormHandleList[i];
162

  
163
                    // ???????N???????????O??????????
164
                    if (Handle.ProcessNo != s_CurrentProcessNo) continue;
165

  
166
                    // ??????????????
167
                    if (i == s_CurrentProcessNo)
168
                    {
169
                        ClsExcute.SubFormHandleList[i].SubFormHandle = null;
170
                        ClsExcute.SubFormHandleList[i].ProcessNo = (int)ClsExcute.ProcessExecuteNo.MainMenu;
171
                        continue;
172
                    }
173

  
174
                    // ?N?????????????????????
175
                    if (Handle.SubFormHandle == null) continue;
176

  
177
                    // ???N???[?Y
178
                    Handle.SubFormHandle.Close();
179
                    if (Handle.SubFormHandle != null) Handle.SubFormHandle.Dispose();
180
                    ClsExcute.SubFormHandleList[i].SubFormHandle = null;
181

  
182
                }
183
            }
184
            catch (System.Exception ex)
185
            {
186
                logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", CommonMotions.GetMethodName(), ex.Message);
187
            }
188
        }
189
        #endregion
190

  
149 191
        #region ????SQL??Z?L?????e?B??????????????
150 192
        /// <summary>
151 193
        /// ????SQL??Z?L?????e?B??????????????
......
2349 2391
        {
2350 2392
            try
2351 2393
            {
2352
                // ????m?F???\??
2353
                m_PriceOfBudget = new FrmPriceOfBudget();
2394
                int ProcessNo = (int)ClsExcute.ProcessExecuteNo.PriceOfBudget;
2395
                // ?t?H?[??????????O???
2396
                FrmPriceOfBudget frm = (FrmPriceOfBudget)ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle;
2354 2397

  
2398
                // ?\???S?????????????????????
2399
                if (frm != null)
2400
                {
2401
                    frm.Activate();
2402
                    return;
2403
                }
2404

  
2405
                // ????m?F???
2406
                frm = new FrmPriceOfBudget();
2407
                ClsExcute.SubFormHandleList[ProcessNo].ProcessNo = s_CurrentProcessNo;
2408
                ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle = (Form)frm;
2409

  
2355 2410
                // ??u???
2356
                m_PriceOfBudget.LocationPoint = new Point(this.Right, this.Top);
2411
                frm.LocationPoint = new Point(this.Right, this.Top);
2357 2412

  
2358 2413
                // ?^?X?N?o?[??\???????
2359 2414
                //m_PriceOfBudget.ShowInTaskbar = false;
2360 2415

  
2361 2416
                // ?N???[?X?h?n???h????????????`????
2362
                m_PriceOfBudget.FormClosed += new FormClosedEventHandler(FrmPriceOfBudget_FormClosed);
2363
                m_PriceOfBudget.Show();
2417
                frm.FormClosed += new FormClosedEventHandler(FrmPriceOfBudget_FormClosed);
2418
                frm.Show();
2364 2419
            }
2365 2420
            catch (System.Exception ex)
2366 2421
            {
......
2369 2424
        }
2370 2425
        #endregion
2371 2426

  
2427
        #region ????m?F???N???[?Y
2428
        /// <summary>
2429
        /// ????m?F????N???[?Y????????
2430
        /// </summary>
2431
        /// <param name="sender"></param>
2432
        /// <param name="e"></param>
2433
        private void FrmPriceOfBudget_FormClosed(object sender, FormClosedEventArgs e)
2434
        {
2435
            try
2436
            {
2437
                int ProcessNo = (int)ClsExcute.ProcessExecuteNo.PriceOfBudget;
2438
                FrmPriceOfBudget frm = (FrmPriceOfBudget)ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle;
2439

  
2440
                // ?n???h???N???A
2441
                if (ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle != null)
2442
                {
2443
                    ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle.Dispose();
2444
                    ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle = null;
2445
                    ClsExcute.SubFormHandleList[ProcessNo].ProcessNo = (int)ClsExcute.ProcessExecuteNo.MainMenu;
2446
                }
2447

  
2448
                this.Activate();
2449
            }
2450
            catch (Exception ex)
2451
            {
2452
                logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", CommonMotions.GetMethodName(), ex.Message);
2453
            }
2454
        }
2455
        #endregion
2456

  
2372 2457
        #region ??????????O?C???S??????Z?b?g????
2373 2458
        /// <summary>
2374 2459
        /// ??????????O?C???S??????Z?b?g????
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/CopyTargetList/FrmNewOrContinueCopy.cs
69 69
        /// 新規工事番号取得
70 70
        /// </summary>
71 71
        private bool m_NewConstruction = false;
72

  
73
        /// <summary>
74
        /// 工事基本情報
75
        /// </summary>
76
        private ConstructionBaseInfo m_BaseRec = new ConstructionBaseInfo();
77

  
72 78
        #endregion
73 79

  
74 80
        #region プロパティ
......
451 457

  
452 458
                // 工事基本情報取得
453 459
                string strSQL = cbDB.CreatePrimarykeyString(m_ConstructionCode);
454
                ConstructionBaseInfo cbRec = new ConstructionBaseInfo();
455
                if (!cbDB.SelectAction(strSQL, ref cbRec)) return false;
460
                if (!cbDB.SelectAction(strSQL, ref m_BaseRec))
461
                {
462
                    MessageBox.Show("工事基本情報が存在しません。", "データ存在エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
463
                    return false;
464
                }
456 465

  
457 466
                // 積算見積データ取得(見積データが無くてもコピーを行う 2016/07/19)
458 467
                //strSQL = edDB.CreatePrimarykeyString(m_ConstructionCode);
......
467 476
                toolTip1.SetToolTip(m_dispControl[(int)Dispcount.ConstructionName], cbdRec.DetailString);
468 477

  
469 478
                // 担当者表示
470
                m_dispControl[(int)Dispcount.SalesPerson].Text = GetPersonName(cbRec.SalesPersonCode);
479
                m_dispControl[(int)Dispcount.SalesPerson].Text = GetPersonName(m_BaseRec.SalesPersonCode);
471 480
                toolTip1.SetToolTip(m_dispControl[(int)Dispcount.SalesPerson], m_dispControl[(int)Dispcount.SalesPerson].Text);
472
                cmbSalesPerson.SelectedValue = cbRec.SalesPersonCode;
481
                cmbSalesPerson.SelectedValue = m_BaseRec.SalesPersonCode;
473 482

  
474
                m_dispControl[(int)Dispcount.ConstructionPerson].Text = GetPersonName(cbRec.ConstructionPersonCode);
483
                m_dispControl[(int)Dispcount.ConstructionPerson].Text = GetPersonName(m_BaseRec.ConstructionPersonCode);
475 484
                toolTip1.SetToolTip(m_dispControl[(int)Dispcount.ConstructionPerson], m_dispControl[(int)Dispcount.ConstructionPerson].Text);
476
                cmbConstructionPerson.SelectedValue = cbRec.ConstructionPersonCode;
485
                cmbConstructionPerson.SelectedValue = m_BaseRec.ConstructionPersonCode;
477 486

  
478 487
                // 工事番号表示
479 488
                SetConstructionCode();
......
571 580
                    return;
572 581
                }
573 582

  
574
                // 現在データを取得する
575
                string strExistsData = cbDB.CreatePrimarykeyString(m_ConstructionCode);
576
                ConstructionBaseInfo BaseRec = new ConstructionBaseInfo();
577
                if (!cbDB.SelectAction(strExistsData, ref BaseRec)) return;
578

  
579 583
                // ----- 見積データのみコピー・工事情報のみコピー
580 584
                int PeriodValue = 0;
581 585
                if (CommonMotions.SystemMasterData.ConstructionNoBase == (int)CommonDefine.SystemConstructionNoBase.BusinessPeriod)
582
                    PeriodValue = BaseRec.ConstructionPeriod;
586
                    PeriodValue = m_BaseRec.ConstructionPeriod;
583 587
                else
584
                    PeriodValue = BaseRec.ConstructionYear;
588
                    PeriodValue = m_BaseRec.ConstructionYear;
585 589

  
586 590
                // 新規工事番号の表示
587 591
                int ConstructionCode = cbDB.CreateNewCounstructionCode(PeriodValue);
......
731 735
            IOEstimateDataBody DB4 = new IOEstimateDataBody();                          // 積算見積ボディ
732 736
            IOEstimateDataDetail DB5 = new IOEstimateDataDetail();                      // 積算見積明細
733 737
            IOConstructionProgressDate DB6 = new IOConstructionProgressDate();          // 案件進捗日付データ
738
            IOConstructionLink DB7 = new IOConstructionLink();                          // 工事リンク情報
734 739
            try
735 740
            {
736 741
                int iToCode = 0;
......
758 763
                DB4.connect(); DB4.beginTran();
759 764
                DB5.connect(); DB5.beginTran();
760 765
                DB6.connect(); DB6.beginTran();
766
                DB7.connect(); DB7.beginTran();
761 767

  
762 768
                // デフォルトは新規工事にしておく
763 769
                m_NewConstruction = true;
......
773 779
                        DB5.rollback();
774 780
                        return false;
775 781
                    }
776

  
782
                    // 工事基本情報コピー
777 783
                    if (!RecordCopyTypeA(m_ConstructionCode, iToCode, DB1, DB2))
778 784
                    {
779 785
                        DB1.rollback();
......
804 810
                        return false;
805 811
                    }
806 812

  
813
                    // 工事リンク情報作成処理
814
                    if(!CreateConstructionLink(iToCode,  DB7))
815
                    {
816
                        DB1.rollback();
817
                        DB2.rollback();
818
                        DB3.rollback();
819
                        DB4.rollback();
820
                        DB5.rollback();
821
                        DB7.rollback();
822
                        return false;
823
                    }
807 824
                    // 継続案件の場合は新規工事フラグを落とす
808 825
                    m_NewConstruction = false;
809 826
                }
......
818 835
                        DB5.rollback();
819 836
                        return false;
820 837
                    }
821

  
822 838
                }
823 839
                // ----- 工事基本情報コピー
824 840
                else if (radioButton3.Checked)
825 841
                {
842
                    // 工事基本情報コピー
826 843
                    if (!RecordCopyTypeA(m_ConstructionCode, iToCode, DB1, DB2))
827 844
                    {
828 845
                        DB1.rollback();
......
864 881
                        DB5.rollback();
865 882
                        return false;
866 883
                    }
867

  
884
                    // 工事基本情報コピー
868 885
                    if (!RecordCopyTypeA(m_ConstructionCode, iToCode, DB1, DB2))
869 886
                    {
870 887
                        DB1.rollback();
......
905 922
                    DB4.rollback();
906 923
                    DB5.rollback();
907 924
                    DB6.rollback();
925
                    DB7.rollback();
908 926
                    return false;
909 927
                }
910 928

  
......
917 935
                DB4.commit();
918 936
                DB5.commit();
919 937
                DB6.commit();
938
                DB7.commit();
920 939

  
921 940
                return true;
922 941
            }
......
933 952
                DB4.close(); DB4 = null;
934 953
                DB5.close(); DB5 = null;
935 954
                DB6.close(); DB6 = null;
955
                DB7.close(); DB7 = null;
936 956
            }
937 957
        }
938 958
        #endregion
......
949 969
                // 工事基本情報の設定
950 970
                string strSQL = cbDB.CreatePrimarykeyString(ToCode);
951 971
                ConstructionBaseInfo cbRec = new ConstructionBaseInfo();
952
                if (!cbDB.SelectAction(strSQL, ref cbRec, false)) return false;
972
                if (!cbDB.SelectAction(strSQL, ref cbRec, false))
973
                {
974
                    MessageBox.Show("工事基本情報が存在しません。", "データ存在エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
975
                    return false;
976
                }
953 977

  
954 978
                // 営業期・工事年度を更新する
955 979
                int iPeriod = 0;
......
1034 1058
                }
1035 1059

  
1036 1060
                // 更新処理
1037
                if (!cbDB.UpdateAction(strSQL, cbRec, false)) return false;
1061
                if (!cbDB.UpdateAction(strSQL, cbRec, false))
1062
                {
1063
                    MessageBox.Show("工事基本情報、更新に失敗しました。", "コピー処理エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
1064
                    return false;
1065
                }
1038 1066

  
1039 1067
                return true;
1040 1068
            }
......
1058 1086
                // 工事基本情報明細の設定
1059 1087
                string strSQL = cbidDB.CreatePrimarykeyString(ToCode, (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
1060 1088
                ConstructionBaseInfoDetail cbidRec = new ConstructionBaseInfoDetail();
1061
                if (!cbidDB.SelectAction(strSQL, ref cbidRec, false)) return false;
1089
                if (!cbidDB.SelectAction(strSQL, ref cbidRec, false))
1090
                {
1091
                    MessageBox.Show("工事基本情報明細が存在しません。", "データ存在エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
1092
                    return false;
1093
                }
1062 1094

  
1063 1095
                // 工事名を更新する
1064 1096
                if (cbidRec.DetailString.Length < s_ConstructionNameLength - 2)
......
1082 1114
                }
1083 1115

  
1084 1116
                // 更新処理
1085
                if (!cbidDB.UpdateAction(strSQL, cbidRec, false)) return false;
1117
                if (!cbidDB.UpdateAction(strSQL, cbidRec, false))
1118
                {
1119
                    MessageBox.Show("工事基本情報明細、更新に失敗しました。", "コピー処理エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
1120
                    return false;
1121
                }
1086 1122

  
1087 1123
                return true;
1088 1124
            }
......
1111 1147
                DB1.DeleteAction(strSQL, false);
1112 1148
                DB2.DeleteAction(strSQL, false);
1113 1149

  
1114
                if (!DB1.RecordCopyAction(FromCode, ToCode, false)) return false;
1115
                if (!DB2.RecordCopyAction(FromCode, ToCode, false)) return false;
1150
                if (!DB1.RecordCopyAction(FromCode, ToCode, false))
1151
                {
1152
                    MessageBox.Show("工事基本情報、作成に失敗しました。", "コピー処理エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
1153
                    return false;
1154
                }
1155
                if (!DB2.RecordCopyAction(FromCode, ToCode, false))
1156
                {
1157
                    MessageBox.Show("工事基本情報明細、作成に失敗しました。", "コピー処理エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
1158
                    return false;
1159
                }
1116 1160

  
1117 1161
                return true;
1118 1162
            }
......
1143 1187
                DB2.DeleteAction(strSQL, false);
1144 1188
                DB3.DeleteAction(strSQL, false);
1145 1189

  
1146
                if (!DB1.RecordCopyAction(FromCode, ToCode, false)) return false;
1147
                if (!DB2.RecordCopyAction(FromCode, ToCode, false)) return false;
1148
                if (!DB3.RecordCopyAction(FromCode, ToCode, false)) return false;
1190
                if (!DB1.RecordCopyAction(FromCode, ToCode, false))
1191
                {
1192
                    MessageBox.Show("積算見積書データ、作成に失敗しました。", "コピー処理エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
1193
                    return false;
1194
                }
1149 1195

  
1196
                if (!DB2.RecordCopyAction(FromCode, ToCode, false))
1197
                {
1198
                    MessageBox.Show("積算見積書ページデータ、作成に失敗しました。", "コピー処理エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
1199
                    return false;
1200
                }
1201

  
1202
                if (!DB3.RecordCopyAction(FromCode, ToCode, false))
1203
                {
1204
                    MessageBox.Show("積算見積書明細データ、作成に失敗しました。", "コピー処理エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
1205
                    return false;
1206
                }
1207

  
1150 1208
                return true;
1151 1209
            }
1152 1210
            catch (Exception ex)
......
1199 1257
            }
1200 1258
        }
1201 1259
        #endregion
1260

  
1261
        #region 工事リンク情報作成処理
1262
        /// <summary>
1263
        /// 工事リンク情報作成処理
1264
        /// </summary>
1265
        /// <returns></returns>
1266
        private bool CreateConstructionLink(int ToCode, IOConstructionLink DB7)
1267
        {
1268
            try
1269
            {
1270
                string strSQL = DB7.CreatePrimarykeyString(m_ConstructionCode, ToCode);
1271
                DB7.DeleteAction(strSQL, false);
1272

  
1273
                // 増減工事の子データ以外はリンク情報を作成しない
1274
                if (m_BaseRec.TyingFlg != (int)CommonDefine.BaseInfoTyingFlg.Tying) return true;
1275

  
1276
                ConstructionLink LinkRec = new ConstructionLink();
1277
                LinkRec.ConstructionCode = m_ConstructionCode;
1278
                LinkRec.FluctuationCode = ToCode;
1279
                LinkRec.LinkType = 0;
1280

  
1281
                if (!DB7.InsertAction(LinkRec, false))
1282
                {
1283
                    MessageBox.Show("工事リンク情報、作成に失敗しました。", "コピー処理エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
1284
                    return false;
1285
                }
1286
                return true;
1287
            }
1288
            catch (System.Exception ex)
1289
            {
1290
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
1291
                return false;
1292
            }
1293
        }
1294
        #endregion
1202 1295
    }
1203 1296
}
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/DepExpenssList/FrmDepExpenssList.cs
17 17
using ProcessManagement.DB.Core;
18 18
using ProcessManagement.Forms.CustomControls;
19 19
using ProcessManagement.Forms.ControlsAction;
20
using ProcessManagement.Forms.SubForms;
20 21
//*---------------------------- ??????o?????? ----------------------------*
21 22
//  2016/09/23  Ver1.0.0.0      Create Source           
22 23
//
......
205 206
        /// </summary>
206 207
        private bool m_CloseingProcessOff = false;
207 208

  
209
        #endregion
210

  
208 211
        #region ?O???b?h?J?????T?C?Y
209 212
        /// <summary>
210 213
        /// ?O???b?h?J?????T?C?Y
......
226 229
        private int m_GridWidthSize = 0;
227 230
        #endregion
... 差分の行数が表示可能な上限を超えました。超過分は表示しません。

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