プロジェクト

全般

プロフィール

リビジョン 339

堀内ほぼ7年前に追加

管理マスタ:営業期の参照を共通クラスのメソッドを介して行うように変更
numカウントコントロールのValue取得を修正
カレンダーマスタ:期首を変動するように変更・印刷機能追加
銀行マスタ:読込み表示ロジック修正
部署毎出納帳作成中

差分を表示:

branches/src/ProcessManagement/ProcessManagement/Common/CommonMotions.cs
1670 1670
        }
1671 1671
        #endregion
1672 1672

  
1673
        #region 期の最大・最少を取得する
1673
        #region 工事情報より期の最大・最少を取得する
1674 1674
        /// <summary>
1675
        /// 期の最大・最少を取得する
1675
        /// 工事情報より期の最大・最少を取得する
1676 1676
        /// </summary>
1677 1677
        /// <param name="StartDate"></param>
1678 1678
        /// <returns></returns>
1679
        public static void GetPeriodYear(ref int min, ref int max)
1679
        public static void GetPeriodYearMinMax(ref int min, ref int max)
1680 1680
        {
1681 1681
            IOConstructionBaseInfo cbiDB = new IOConstructionBaseInfo();
1682 1682
            try
1683 1683
            {
1684
                string strSQL = "SELECT MIN(CONSTRUCTIONPERIOD), MAX(CONSTRUCTIONPERIOD) FROM CONSTRUCTIONBASEINFO";
1684
                StringBuilder strSQL = new StringBuilder();
1685
                if (CommonMotions.SystemMasterData.ConstructionNoBase == (int)SystemMaster.ConstrNoBaseDef.BusinessPeriod)
1686
                {   // ----- 営業期ベースの時
1687
                    strSQL.Append("SELECT MIN(CONSTRUCTIONPERIOD), MAX(CONSTRUCTIONPERIOD) FROM CONSTRUCTIONBASEINFO");
1688
                }
1689
                else
1690
                {   // ----- 工事年度ベースの時
1691
                    strSQL.Append("SELECT MIN(ConstructionYear), MAX(ConstructionYear) FROM CONSTRUCTIONBASEINFO");
1692
                }
1693

  
1685 1694
                ArrayList arList = new ArrayList();
1686
                if (!cbiDB.ExecuteReader(strSQL, ref arList)) return;
1695
                if (!cbiDB.ExecuteReader(strSQL.ToString(), ref arList)) return;
1696

  
1687 1697
                object[] wrkobj = (object[])arList[0];
1688 1698
                min = cnvInt(wrkobj[0]);
1689 1699
                max = cnvInt(wrkobj[1]);
......
1700 1710
        }
1701 1711
        #endregion
1702 1712

  
1713
        #region 管理マスタの現在年を取得する
1714
        /// <summary>
1715
        /// 管理マスタの現在年を取得する
1716
        /// </summary>
1717
        /// <returns></returns>
1718
        public static int GetPeriodYear()
1719
        {
1720
            try
1721
            {
1722
                int nYearVal = DateTime.Now.Year;
1723

  
1724
                if (CommonMotions.SystemMasterData.ConstructionNoBase == (int)SystemMaster.ConstrNoBaseDef.BusinessPeriod)
1725
                {
1726
                    // ----- 営業期ベースの時
1727
                    nYearVal = CommonMotions.SystemMasterData.BusinessPeriod;
1728
                }
1729
                else
1730
                {
1731
                    // ----- 工事年度ベースの時
1732
                    nYearVal = CommonMotions.SystemMasterData.ConstrYear;
1733
                }
1734

  
1735
                return nYearVal;
1736
            }
1737
            catch (System.Exception ex)
1738
            {
1739
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
1740
                return 0;
1741
            }
1742
        }
1743
        #endregion
1744

  
1703 1745
        #region 対象日より営業期・工事年度を取得する
1704 1746
        /// <summary>
1705 1747
        /// 対象日より営業期・工事年度を取得する
......
2217 2259
        }
2218 2260
        #endregion
2219 2261

  
2220
        #region 現在年取得
2262
        #region 現在年を西暦で求める
2221 2263
        /// <summary>
2222
        /// 現在年を求める
2264
        /// 現在年を西暦で求める
2223 2265
        /// </summary>
2224
        /// <param name="bPeriod"></param>
2225
        /// <param name="MinCode"></param>
2226
        /// <param name="MaxCode"></param>
2227
        public static int GetBaseCounstructionYear(bool bPeriod, int years)
2266
        public static int GetBaseCounstructionYear(int years)
2228 2267
        {
2229 2268
            try
2230 2269
            {
2231 2270
                int Beginning = 0;
2232 2271
                int diffwork = 0;
2233 2272
                string strwork = string.Empty;
2234
                if (bPeriod)
2273
                if (CommonMotions.SystemMasterData.ConstructionNoBase == (int)SystemMaster.ConstrNoBaseDef.BusinessPeriod)
2235 2274
                {   // ----- 営業期ベースの時
2236 2275

  
2237 2276
                    // 現在期との差分を求める
2238
                    diffwork = years - CommonMotions.SystemMasterData.BusinessPeriod;
2277
                    diffwork = years - SystemMasterData.BusinessPeriod;
2239 2278

  
2240 2279
                    // 期首月を取得する
2241
                    Beginning = CommonMotions.SystemMasterData.BusinessBeginDate.Month;
2280
                    Beginning = SystemMasterData.BusinessBeginDate.Month;
2242 2281
                }
2243 2282
                else
2244 2283
                {   // ----- 営業年度ベースの時
2245 2284

  
2246 2285
                    // 現在期との差分を求める
2247
                    diffwork = years - CommonMotions.SystemMasterData.ConstrYear;
2286
                    diffwork = years - SystemMasterData.ConstrYear;
2248 2287

  
2249 2288
                    // 期首月を取得する
2250
                    Beginning = CommonMotions.SystemMasterData.ConstrBeginDate.Month;
2289
                    Beginning = SystemMasterData.ConstrBeginDate.Month;
2251 2290
                }
2252 2291

  
2253 2292
                // 年数を求める
......
2265 2304
            }
2266 2305
            catch (System.Exception ex)
2267 2306
            {
2268
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
2307
                logger.ErrorFormat("システムエラー:{0}:{1}", GetMethodName(), ex.Message);
2269 2308
                return 0;
2270 2309
            }
2271 2310
        }
2272 2311
        #endregion
2273 2312

  
2274
        #region 期首の月日を取得する
2275
        /// <summary>
2276
        /// 期首の月日を取得する
2277
        /// </summary>
2278
        /// <param name="bPeriod"></param>
2279
        /// <param name="Mounth"></param>
2280
        /// <param name="Days"></param>
2281
        public static void GetNowBeginMonthDay(bool bPeriod, ref int Mounth, ref int Days)
2282
        {
2283
            try
2284
            {
2285
                if (bPeriod)
2286
                {   // 営業期
2287
                    Mounth = CommonMotions.SystemMasterData.BusinessBeginDate.Month;
2288
                    Days = CommonMotions.SystemMasterData.BusinessBeginDate.Day;
2289
                }
2290
                else
2291
                {   // 工事年度
2292
                    Mounth = CommonMotions.SystemMasterData.ConstrBeginDate.Month;
2293
                    Days = CommonMotions.SystemMasterData.ConstrBeginDate.Day;
2294
                }
2295
            }
2296
            catch (System.Exception ex)
2297
            {
2298
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
2299
            }
2300
        }
2301
        #endregion
2302

  
2303 2313
        #region 指定期・指定年度の期首日・期末日を取得する
2304 2314
        /// <summary>
2305 2315
        /// 指定期・指定年度の期首日・期末日を取得する
......
2308 2318
        /// <param name="bOpen"></param>
2309 2319
        /// <param name="bPeriod"></param>
2310 2320
        /// <returns></returns>
2311
        public static DateTime GetOpeningEndDate(int nYear, bool bOpen = true, bool bPeriod = true)
2321
        public static DateTime GetOpeningEndDate(int nYear, bool bOpen = true, bool bAuto = true, int nConstrNoBase = 0)
2312 2322
        {
2313 2323
            IOMBizPeriodHistory BizHisDB = new IOMBizPeriodHistory();
2314 2324
            try
......
2318 2328
                StringBuilder strSQL = new StringBuilder();
2319 2329
                BizPeriodHistory BizHisRec = new BizPeriodHistory();
2320 2330

  
2331
                // システム基準自動判定
2332
                int nCheckFlag = -1;
2333
                if (bAuto)
2334
                {
2335
                    nCheckFlag = m_systemMaster.ConstructionNoBase;
2336
                }
2337
                else
2338
                {
2339
                    nCheckFlag = nConstrNoBase;
2340
                }
2341

  
2342
                // 対象設定
2343
                bool bPeriod = true;
2344
                switch (nCheckFlag)
2345
                {
2346
                    case (int)SystemMaster.ConstrNoBaseDef.BusinessPeriod:
2347
                        bPeriod = true;
2348
                        break;
2349
                    case (int)SystemMaster.ConstrNoBaseDef.ConstructionYear:
2350
                        bPeriod = false;
2351
                        break;
2352
                }
2353

  
2321 2354
                if (bPeriod)
2322 2355
                {   // 営業期
2323 2356
                    strSQL.Append(BizHisDB.CreatePrimarykeyString(nYear, (int)BizPeriodHistory.PeriodFlagDef.BizPeriod));
......
2966 2999
        /// 今期の判定を行う
2967 3000
        /// </summary>
2968 3001
        /// <returns></returns>
2969
        private static bool CheckNowSeason(int nTarget)
3002
        public static bool CheckNowSeason(int nTarget)
2970 3003
        {
2971 3004
            try
2972 3005
            {
......
2993 3026
        /// 部署コンボボックスデータ取得SQL作成
2994 3027
        /// </summary>
2995 3028
        /// <param name="strSQL"></param>
2996
        public static void CreateDepCombBoxSQL(ref StringBuilder strSQL, int nTargetCount)
3029
        public static void CreateDepCombBoxSQL(ref StringBuilder strSQL, int nTargetCount, bool bInput = false)
2997 3030
        {
2998 3031
            try
2999 3032
            {
......
3068 3101
                    strSQL.Append(") As A");
3069 3102
                }
3070 3103

  
3071
                //strSQL.Append(", PERSONINCHARGEMASTER B");
3072
                strSQL.Append(", CONSTRUCTIONBASEINFO C");
3073
                strSQL.Append(" WHERE");
3104
                if (bNowSeason)
3105
                {   // 対象が今期の場合
3106
                    if (!bInput) strSQL.Append(", CONSTRUCTIONBASEINFO C");
3107
                    strSQL.Append(" WHERE");
3074 3108

  
3075
                if (bNowSeason)
3076
                {   // 今期は削除されていないもの
3109
                    // 削除されていないもの
3077 3110
                    strSQL.Append(" A.DELETEFLG = 0");
3078 3111
                    DateTime dtDefaultEnd = CommonMotions.GetOpeningEndDate(nTargetCount, false);
3079 3112

  
3080 3113
                    strSQL.AppendFormat(" And DATE(A.StartDate) <= DATE('{0}')", dtDefaultEnd.ToShortDateString());
3114
                    if (!bInput) strSQL.Append(" And C.ConstrDepCode = A.DepartmentCode");
3081 3115

  
3082 3116
                    // システム管理者以外は部署参照マスタよりデータ取得
3083 3117
                    if (CommonMotions.LoginUserData.PersonCode != CommonDefine.AdminCode)
......
3087 3121
                        strSQL.Append(" IN (SELECT A1.DEPARTMENTCODE FROM PERSONDEPARTMENTMASTER A1");
3088 3122
                        strSQL.AppendFormat(" WHERE A1.PERSONCODE = {0})", CommonMotions.LoginUserData.PersonCode);
3089 3123
                    }
3090
//                    strSQL.Append(" AND");
3091 3124
                }
3092 3125
                else
3093
                {
3094
                    strSQL.AppendFormat(" C.ConstructionPeriod = {0}", nTargetCount);
3095
                    strSQL.Append(" And A.DepartmentCode IN(C.SalesDepCode, C.ConstrDepCode, C.ConstrSubDepCode, C.ConstrInstrDepCode)");
3126
                {   // 対象が過去の場合
3127
                    strSQL.Append(", CONSTRUCTIONBASEINFO C");
3128
                    strSQL.Append(" WHERE");
3129

  
3130
                    strSQL.AppendFormat(" (C.ConstructionPeriod = {0}", nTargetCount);
3131
                    strSQL.Append(" And A.DepartmentCode IN(C.SalesDepCode, C.ConstrDepCode, C.ConstrSubDepCode, C.ConstrInstrDepCode))");
3096 3132
                }
3097
                //strSQL.Append(" A.DEPARTMENTCODE = B.DEPARTMENTCODE");
3098
                //strSQL.Append(" AND B.PERSONCODE = C.CONSTRUCTIONPERSONCODE");
3099 3133
                strSQL.Append(" GROUP BY A.DEPARTMENTCODE, A.DEPARTMENTSTRING, A.DISPLAYORDER");
3100 3134
                strSQL.Append(" ORDER BY A.DISPLAYORDER ASC");
3101 3135
            }
......
3137 3171
                else if (nLEDGERFLG > -1) strSQL.AppendFormat(" AND A.LEDGERFLG = {0}", nLEDGERFLG);
3138 3172

  
3139 3173
                // 今期のデータかどうかを判定する
3140
                bool bNowSeason = true;
3141 3174
                string FieldName = string.Empty;
3142 3175
                if (CommonMotions.SystemMasterData.ConstructionNoBase == (int)SystemMaster.ConstrNoBaseDef.BusinessPeriod)
3143 3176
                {
3144 3177
                    FieldName = "ConstructionPeriod";
3145
                    if (nTargetYear != CommonMotions.SystemMasterData.BusinessPeriod) bNowSeason = false;
3146 3178
                }
3147 3179
                else
3148 3180
                {
3149 3181
                    FieldName = "ConstructionYear";
3150
                    if (nTargetYear != CommonMotions.SystemMasterData.ConstrYear) bNowSeason = false;
3151 3182
                }
3152
                if (!bNowSeason)
3183
                if (!CheckNowSeason(nTargetYear))
3153 3184
                {
3154 3185
                    strSQL.Append(" AND B.DepartmentCode IN(SELECT InDep.DEPARTMENTCODE FROM (");
3155 3186
                    strSQL.Append(" Select A1.SalesDepCode As DEPARTMENTCODE From Constructionbaseinfo As A1");
branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs
14 14
        /// <summary>
15 15
        /// 本体バージョン
16 16
        /// </summary>
17
        public static int s_SystemVersion = 172;
17
        public static int s_SystemVersion = 175;
18 18

  
19 19
        /// <summary>
20 20
        /// コピー・環境バージョン
branches/src/ProcessManagement/ProcessManagement/Common/Office/UsedExcel.cs
530 530
        }
531 531
        #endregion
532 532

  
533
        #region セル色セット
534
        public void ExcelCellColorSet(string FromColum, string ToColum, Color ForeColor, Color BackColor)
535
        {
536
            object xlsRange = null;
537
            object[] Parameters = null;
538
            object Fonts = null;
539
            object Interior = null;
540
            try
541
            {
542
                // レンジでセルを指定
543
                Parameters = new Object[2];
544
                Parameters[0] = FromColum;
545
                Parameters[1] = Missing.Value;
546
                Parameters[1] = ToColum;
547
                xlsRange = xlsWorkSheet.GetType().InvokeMember("Range"
548
                                                                , BindingFlags.GetProperty
549
                                                                , null
550
                                                                , xlsWorkSheet
551
                                                                , Parameters);
552

  
553
                // 背景色を変更する。
554
                Interior = xlsRange.GetType().InvokeMember("Interior", BindingFlags.GetProperty, null, xlsRange, null);
555
                Interior.GetType().InvokeMember("Color", BindingFlags.SetProperty, null, Interior, new object[] { Color.FromArgb(BackColor.R
556
                                                                                                                            , BackColor.G
557
                                                                                                                            , BackColor.B) });
558

  
559
                // フォント色を変える
560
                Fonts = xlsRange.GetType().InvokeMember("Font", BindingFlags.GetProperty, null, xlsRange, null);
561
                Fonts.GetType().InvokeMember("Color", BindingFlags.SetProperty, null, Fonts, new object[] { Color.FromArgb(ForeColor.R
562
                                                                                                                            , ForeColor.G
563
                                                                                                                            , ForeColor.B) });
564
            }
565
            catch (Exception ex)
566
            {
567
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", ex.Message, FromColum, ToColum);
568
            }
569
            finally
570
            {
571
                CommonMotions.ReleaseCom(ref xlsRange);
572
                CommonMotions.ReleaseCom(ref Interior);
573
                CommonMotions.ReleaseCom(ref Fonts);
574
            }
575
        }
576
        #endregion
577

  
533 578
        #region シートオブジェクト取得
534 579
        /// <summary>
535 580
        /// シートオブジェクト取得
......
609 654
                                                , BindingFlags.SetProperty
610 655
                                                , null
611 656
                                                , xlsApp
612
                                                , new object[] { false });;
657
                                                , new object[] { false });
613 658
                if (xlsBooks != null)
614 659
                {
615 660
                    CommonMotions.ReleaseCom(ref xlsBooks);
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionBaseInfo.cs
1015 1015
        /// <param name="bPeriod"></param>
1016 1016
        /// <param name="MinCode"></param>
1017 1017
        /// <param name="MaxCode"></param>
1018
        private void GetBaseCounstrYear(bool bPeriod, int PeriodValue, ref int MinCode, ref int MaxCode)
1018
        private void GetBaseCounstrYear(int PeriodValue, ref int MinCode, ref int MaxCode)
1019 1019
        {
1020 1020
            try
1021 1021
            {
1022
                int Beginning = 0;
1023
                int diffwork = 0;
1024
                string strwork = string.Empty;
1025
                if (bPeriod)
1026
                {   // ----- 営業期ベースの時
1027

  
1028
                    // 現在期との差分を求める
1029
                    diffwork = PeriodValue - CommonMotions.SystemMasterData.BusinessPeriod;
1030

  
1031
                    // 期首月を取得する
1032
                    Beginning = CommonMotions.SystemMasterData.BusinessBeginDate.Month;
1033
                }
1034
                else
1035
                {   // ----- 営業年度ベースの時
1036

  
1037
                    // 現在期との差分を求める
1038
                    diffwork = PeriodValue - CommonMotions.SystemMasterData.ConstrYear;
1039

  
1040
                    // 期首月を取得する
1041
                    Beginning = CommonMotions.SystemMasterData.ConstrBeginDate.Month;
1042
                }
1043

  
1044
                // 年数を求める
1045
                DateTime dateWork = DateTime.Now;
1046
                int nowMounth = DateTime.Now.Month;
1047
                // 期首月を境に年度を計算する
1048
                int iYear = 0;
1049
                if (nowMounth < Beginning)
1050
                    iYear = dateWork.AddYears(-1).Year;
1051
                else
1052
                    iYear = dateWork.Year;
1053

  
1054 1022
                // ベース年を求める
1055
                MinCode = iYear + diffwork;
1023
                MinCode = CommonMotions.GetBaseCounstructionYear(PeriodValue);
1056 1024
                // ベース年の翌年を求める
1057 1025
                MaxCode = MinCode + 1;
1058 1026
            }
......
1075 1043
                int iRetCode = 0;
1076 1044
                int MinCode = 0;
1077 1045
                int MaxCode = 0;
1078
                // 営業期・工事年は管理マスタの選択により設定する
1046

  
1047
                // ベースとなる年度を取得する
1048
                GetBaseCounstrYear(PeriodValue, ref MinCode, ref MaxCode);
1079 1049
                StringBuilder strWhere = new StringBuilder();
1080
                if (CommonMotions.SystemMasterData.ConstructionNoBase == (int)SystemMaster.ConstrNoBaseDef.BusinessPeriod)
1081
                {   // 営業期
1082
                    GetBaseCounstrYear(true, PeriodValue,ref MinCode, ref  MaxCode);
1083
                }
1084
                else
1085
                {   // 工事年度
1086
                    GetBaseCounstrYear(false, PeriodValue, ref MinCode, ref  MaxCode);
1087
                }
1088 1050
                strWhere.AppendFormat(" WHERE {0} <= CONSTRUCTIONCODE AND CONSTRUCTIONCODE < {1}", (MinCode * 1000000), (MaxCode * 1000000));
1089 1051

  
1090 1052
                int icnt = SelectMaxConstructionCodeCount(strWhere.ToString());
......
1125 1087
            try
1126 1088
            {
1127 1089
                int ConstructionCode = -1;
1128
                
1090

  
1129 1091
                // 枝番最大値の工事番号取得
1130 1092
                StringBuilder strSQL = new StringBuilder();
1131 1093
                strSQL.Append("SELECT IFNULL(MAX(CONSTRUCTIONCODE), -1) FROM CONSTRUCTIONBASEINFO");
......
1134 1096

  
1135 1097
                // データが無ければ抜ける
1136 1098
                if (!cbDB.ExecuteReader(strSQL.ToString(), ref arList)) return ConstructionCode;
1137
                
1099

  
1138 1100
                object[] wrkobj = (object[])arList[0];
1139 1101
                ConstructionCode = CommonMotions.cnvInt(wrkobj[0]);
1140 1102
                if (ConstructionCode > 1) ConstructionCode++;
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODepartmentCostData.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 MySql.Data.MySqlClient;           // Data Provider for MySql
10

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

  
16
namespace ProcessManagement.DB.IOAccess
17
{
18
    /// <summary>
19
    /// 部署毎出納データDBアクセス
20
    /// </summary>
21
    public class IODepartmentCostData : 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 TableColumn
35
        {
36
            DepartmentCode = 0,     // 部署コード
37
            ConstructionPeriod,     // 工事期数
38
            DataCount,              // データ番号
39
            EntryPersonCode,        // 入力担当者コード
40
            SuppliersCode,          // 支払先コード
41
            SuppliersName,          // 支払先名称
42
            PaymentContent,         // 支払内容
43
            DateOfBilling,          // 請求日
44
            DateOfPayment,          // 支払日
45
            EntryPrice,             // 金額(税抜)
46
            EntryPriceInTax,        // 金額(税込)
47
            SlipNumber,             // 伝票番号
48
            ComplateFlg,            // 引込済みフラグ
49
            ApprovalFlg,            // 承認フラグ
50
            EntryDate,
51
            UpdateDate,
52
        }
53
        #endregion
54

  
55
        #region コンストラクタ
56
        /// <summary>
57
        /// コンストラクタ
58
        /// </summary>
59
        /// <param name="ConnectionString"></param>
60
        public IODepartmentCostData()
61
            : base(DBCommon.Instance.DBConnectString)
62
        {
63
        }
64

  
65
        #endregion
66

  
67
        #region SQL作成
68
        /// <summary>
69
        /// SQL作成
70
        /// </summary>
71
        private string CreateSelectSQL()
72
        {
73
            // SQL作成
74
            StringBuilder strcmd = new StringBuilder();
75
            strcmd.Append("SELECT");
76

  
77
            strcmd.Append("  DepartmentCode");                          // 部署コード
78
            strcmd.Append(", ConstructionPeriod");                      // 工事期数
79
            strcmd.Append(", DataCount");                               // データ番号
80
            strcmd.Append(", EntryPersonCode");                         // 入力担当者コード
81
            strcmd.Append(", SuppliersCode");                           // 支払先コード
82
            strcmd.Append(", SuppliersName");                           // 支払先名称
83
            strcmd.Append(", PaymentContent");                          // 支払内容
84
            strcmd.Append(", DATE_FORMAT(DateOfBilling, '%Y/%m/%d')");  // 請求日
85
            strcmd.Append(", DATE_FORMAT(DateOfPayment, '%Y/%m/%d')");  // 支払日
86
            strcmd.Append(", EntryPrice");                              // 金額(税抜)
87
            strcmd.Append(", EntryPriceInTax");                         // 金額(税込)
88
            strcmd.Append(", SlipNumber");                              // 伝票番号
89
            strcmd.Append(", ComplateFlg");                             // 引込済みフラグ
90
            strcmd.Append(", ApprovalFlg");                             // 承認フラグ
91

  
92
            strcmd.Append(", DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')");
93
            strcmd.Append(", DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')");
94

  
95
            strcmd.Append(" FROM DepartmentCostData");
96

  
97
            return strcmd.ToString();
98
        }
99
        #endregion
100

  
101
        #region 複数読込み処理
102
        /// <summary>
103
        /// 複数読込み処理
104
        /// </summary>
105
        /// <returns></returns>
106
        public bool SelectAction(string AddSQLString, ref List<DepartmentCostData> data, bool bConnect = true)
107
        {
108
            // インターフェース
109
            StringBuilder strcmd = new StringBuilder();
110
            ArrayList arData = new ArrayList();
111

  
112
            try
113
            {
114
                // SQL作成
115
                strcmd.Append(CreateSelectSQL());
116
                strcmd.Append(AddSQLString);
117

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

  
121
                // データセット
122
                foreach (object[] objwrk in arData)
123
                {
124
                    DepartmentCostData work = new DepartmentCostData();
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.ToString());
134
                return false;
135
            }
136
        }
137
        #endregion
138

  
139
        #region 1件読込み処理
140
        /// <summary>
141
        /// 1件読込み処理
142
        /// </summary>
143
        /// <returns></returns>
144
        public bool SelectAction(string AddSQLString, ref DepartmentCostData data, bool bConnect = true)
145
        {
146
            // インターフェース
147
            StringBuilder strcmd = new StringBuilder();
148
            ArrayList arData = new ArrayList();
149

  
150
            try
151
            {
152
                strcmd.Append(CreateSelectSQL());
153
                strcmd.Append(AddSQLString);
154

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

  
159
                // データセット
160
                foreach (object[] objwrk in arData)
161
                {
162
                    Reader2Struct(objwrk, ref data);
163
                    break;
164
                }
165

  
166
                return true;
167
            }
168
            catch (Exception ex)
169
            {
170
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
171
                return false;
172
            }
173
        }
174
        #endregion
175

  
176
        #region 1件追加処理
177
        /// <summary>
178
        /// 担当者毎経費データ追加
179
        /// </summary>
180
        /// <param name="data">担当者毎経費データデータ</param>
181
        /// <returns>true:成功 false:失敗</returns>
182
        public bool InsertAction(DepartmentCostData work, bool bConnect = true)
183
        {
184
            StringBuilder strcmd = new StringBuilder();
185
            try
186
            {
187
                bool bColFirst = true;
188
                strcmd.Append("INSERT INTO DepartmentCostData");
189
                strcmd.Append(" (");
190
                foreach (var gender in Enum.GetValues(typeof(TableColumn)))
191
                {
192
                    if (!bColFirst) strcmd.Append(", ");
193
                    strcmd.Append(gender.ToString());
194
                    bColFirst = false;
195
                }
196
                strcmd.Append(") VALUES (");
197

  
198
                strcmd.AppendFormat("  {0}", work.DepartmentCode);                  // 部署コード
199
                strcmd.AppendFormat(", {0}", work.ConstructionPeriod);              // 工事期数
200
                strcmd.AppendFormat(", {0}", work.DataCount);                       // データ番号
201
                strcmd.AppendFormat(", {0}", work.EntryPersonCode);                 // 入力担当者コード
202
                strcmd.AppendFormat(", {0}", work.SuppliersCode);                   // 支払先コード
203
                strcmd.AppendFormat(", {0}", work.SuppliersName);                   // 支払先名称
204
                strcmd.AppendFormat(", {0}", work.PaymentContent);                  // 支払内容
205
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d')"
206
                                        , work.DateOfBilling.ToShortDateString());  // 請求日
207
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d')"
208
                                        , work.DateOfPayment.ToShortDateString());  // 支払日
209
                strcmd.AppendFormat(", {0}", work.EntryPrice);                      // 金額(税抜)
210
                strcmd.AppendFormat(", {0}", work.EntryPriceInTax);                 // 金額(税込)
211
                strcmd.AppendFormat(", {0}", work.SlipNumber);                      // 伝票番号
212
                strcmd.AppendFormat(", {0}", work.ComplateFlg);                     // 引込済みフラグ
213
                strcmd.AppendFormat(", {0}", work.ApprovalFlg);                     // 承認フラグ
214

  
215
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
216
                strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
217
                strcmd.Append(")");
218

  
219
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
220

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

  
231
        #region 複数追加処理
232
        public bool InsertAction(List<DepartmentCostData> data, bool bConnect = true)
233
        {
234
            StringBuilder strcmd = new StringBuilder();
235
            try
236
            {
237
                bool bColFirst = true;
238
                strcmd.Append("INSERT INTO DepartmentCostData");
239
                strcmd.Append(" (");
240
                foreach (var gender in Enum.GetValues(typeof(TableColumn)))
241
                {
242
                    if (!bColFirst) strcmd.Append(", ");
243
                    strcmd.Append(gender.ToString());
244
                    bColFirst = false;
245
                }
246
                strcmd.Append(") VALUES");
247

  
248
                bool bDataFirst = true;
249
                foreach (DepartmentCostData work in data)
250
                {
251
                    if (bDataFirst) strcmd.Append(" (");
252
                    else strcmd.Append(", (");
253

  
254
                    strcmd.AppendFormat("  {0}", work.DepartmentCode);                  // 部署コード
255
                    strcmd.AppendFormat(", {0}", work.ConstructionPeriod);              // 工事期数
256
                    strcmd.AppendFormat(", {0}", work.DataCount);                       // データ番号
257
                    strcmd.AppendFormat(", {0}", work.EntryPersonCode);                 // 入力担当者コード
258
                    strcmd.AppendFormat(", {0}", work.SuppliersCode);                   // 支払先コード
259
                    strcmd.AppendFormat(", {0}", work.SuppliersName);                   // 支払先名称
260
                    strcmd.AppendFormat(", {0}", work.PaymentContent);                  // 支払内容
261
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d')"
262
                                            , work.DateOfBilling.ToShortDateString());  // 請求日
263
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d')"
264
                                            , work.DateOfPayment.ToShortDateString());  // 支払日
265
                    strcmd.AppendFormat(", {0}", work.EntryPrice);                      // 金額(税抜)
266
                    strcmd.AppendFormat(", {0}", work.EntryPriceInTax);                 // 金額(税込)
267
                    strcmd.AppendFormat(", {0}", work.SlipNumber);                      // 伝票番号
268
                    strcmd.AppendFormat(", {0}", work.ComplateFlg);                     // 引込済みフラグ
269
                    strcmd.AppendFormat(", {0}", work.ApprovalFlg);                     // 承認フラグ
270

  
271
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
272
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
273
                    strcmd.Append(")");
274

  
275
                    bDataFirst = false;
276
                }
277

  
278
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
279
                return true;
280
            }
281
            catch (Exception ex)
282
            {
283
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
284
                return false;
285
            }
286
        }
287
        #endregion
288

  
289
        #region 更新処理
290
        /// <summary>
291
        /// 担当者毎経費データ更新
292
        /// </summary>
293
        /// <param name="AddSQLString">更新条件SQL文字列</param>
294
        /// <param name="data">担当者毎経費データデータ</param>
295
        /// <returns>true:成功 false:失敗</returns>
296
        public bool UpdateAction(string AddSQLString, DepartmentCostData data, bool bConnect = true)
297
        {
298
            StringBuilder strcmd = new StringBuilder();
299
            try
300
            {
301

  
302
                strcmd.Append("UPDATE DepartmentCostData");
303

  
304
                strcmd.Append(" SET");
305

  
306
                strcmd.AppendFormat(" DepartmentCode = {0}", data.DepartmentCode);              // 部署コード
307
                strcmd.AppendFormat(", ConstructionPeriod = {0}", data.ConstructionPeriod);     // 工事期数
308
                strcmd.AppendFormat(", DataCount = {0}", data.DataCount);                       // データ番号
309
                strcmd.AppendFormat(", EntryPersonCode = {0}", data.EntryPersonCode);           // 入力担当者コード
310
                strcmd.AppendFormat(", SuppliersCode = {0}", data.SuppliersCode);               // 支払先コード
311
                strcmd.AppendFormat(", SuppliersName = {0}", data.SuppliersName);               // 支払先名称
312
                strcmd.AppendFormat(", PaymentContent = {0}", data.PaymentContent);             // 支払内容
313
                strcmd.AppendFormat(", DateOfBilling = STR_TO_DATE('{0}','%Y/%m/%d')"
314
                                        , data.DateOfBilling.ToShortDateString());              // 請求日
315
                strcmd.AppendFormat(", DateOfPayment = STR_TO_DATE('{0}','%Y/%m/%d')"
316
                                        , data.DateOfPayment.ToShortDateString());              // 支払日
317
                strcmd.AppendFormat(", EntryPrice = {0}", data.EntryPrice);                     // 金額(税抜)
318
                strcmd.AppendFormat(", EntryPriceInTax = {0}", data.EntryPriceInTax);           // 金額(税込)
319
                strcmd.AppendFormat(", SlipNumber = {0}", data.SlipNumber);                     // 伝票番号
320
                strcmd.AppendFormat(", ComplateFlg = {0}", data.ComplateFlg);                   // 引込済みフラグ
321
                strcmd.AppendFormat(", ApprovalFlg = {0}", data.ApprovalFlg);                   // 承認フラグ
322

  
323
                strcmd.Append(", UpdateDate = NOW()");
324
                strcmd.Append(AddSQLString);
325

  
326
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
327

  
328
                return true;
329
            }
330
            catch (Exception ex)
331
            {
332
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
333
                return false;
334
            }
335
        }
336
        #endregion
337

  
338
        #region 削除処理
339
        /// <summary>
340
        /// 担当者毎経費データ削除
341
        /// </summary>
342
        /// <param name="AddSQLString">削除条件SQL文字列</param>
343
        /// <param name="data">担当者毎経費データデータ</param>
344
        /// <returns>true:成功 false:失敗</returns>
345
        public bool DeleteAction(string AddSQLString, bool bConnect = true)
346
        {
347
            // インターフェース
348
            StringBuilder strcmd = new StringBuilder();
349
            try
350
            {
351
                strcmd.AppendFormat("{0}{1}", "DELETE FROM DepartmentCostData", AddSQLString);
352

  
353
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
354

  
355
                return true;
356
            }
357
            catch (Exception ex)
358
            {
359
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
360
                return false;
361
            }
362
        }
363
        #endregion
364

  
365
        #region データセット処理
366
        /// <summary>
367
        /// MySQLDataReaderより構造体へセットする
368
        /// </summary>
369
        /// <param name="reader">MySQLDataReader</param>
370
        /// <param name="wrk">構造体</param>
371
        public void Reader2Struct(object[] objwrk, ref DepartmentCostData wrk)
372
        {
373
            try
374
            {
375
                // データ取得
376
                wrk.DepartmentCode = int.Parse(objwrk[(int)TableColumn.EntryDate].ToString());          // 部署コード
377
                wrk.ConstructionPeriod = int.Parse(objwrk[(int)TableColumn.EntryDate].ToString());      // 工事期数
378
                wrk.DataCount = int.Parse(objwrk[(int)TableColumn.EntryDate].ToString());               // データ番号
379
                wrk.EntryPersonCode = int.Parse(objwrk[(int)TableColumn.EntryDate].ToString());         // 入力担当者コード
380
                wrk.SuppliersCode = int.Parse(objwrk[(int)TableColumn.EntryDate].ToString());           // 支払先コード
381
                wrk.SuppliersName = objwrk[(int)TableColumn.EntryDate].ToString();                      // 支払先名称
382
                wrk.PaymentContent = objwrk[(int)TableColumn.EntryDate].ToString();                     // 支払内容
383
                wrk.DateOfBilling = DateTime.Parse(objwrk[(int)TableColumn.EntryDate].ToString());      // 請求日
384
                wrk.DateOfPayment = DateTime.Parse(objwrk[(int)TableColumn.EntryDate].ToString());      // 支払日
385
                wrk.EntryPrice = long.Parse(objwrk[(int)TableColumn.EntryDate].ToString());             // 金額(税抜)
386
                wrk.EntryPriceInTax = long.Parse(objwrk[(int)TableColumn.EntryDate].ToString());        // 金額(税込)
387
                wrk.SlipNumber = objwrk[(int)TableColumn.EntryDate].ToString();                         // 伝票番号
388
                wrk.ComplateFlg = int.Parse(objwrk[(int)TableColumn.EntryDate].ToString());             // 引込済みフラグ
389
                wrk.ApprovalFlg = int.Parse(objwrk[(int)TableColumn.EntryDate].ToString());             // 承認フラグ
390

  
391
                wrk.EntryDate = DateTime.Parse(objwrk[(int)TableColumn.EntryDate].ToString());
392
                wrk.UpdateDate = DateTime.Parse(objwrk[(int)TableColumn.UpdateDate].ToString());
393
            }
394
            catch (MySqlException myex)
395
            {
396
                logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(2), myex.Message);
397
            }
398
            catch (Exception ex)
399
            {
400
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(2), ex.Message);
401
            }
402
        }
403
        #endregion
404

  
405
        #region 検索文字列作成処理
406
        /// <summary>
407
        /// 主キー検索の文字列を返す
408
        /// </summary>
409
        /// <returns></returns>
410
        public string CreatePrimarykeyString(int DepartmentCode, int ConstructionPeriod, int DataCount)
411
        {
412
            StringBuilder strWork = new StringBuilder();
413
            try
414
            {
415
                strWork.AppendFormat(" WHERE DepartmentCode = {0}", DepartmentCode);
416
                if (ConstructionPeriod > 0)
417
                    strWork.AppendFormat(" AND ConstructionPeriod = {0}", ConstructionPeriod);
418
                if (DataCount > 0)
419
                    strWork.AppendFormat(" AND DataCount = {0}", DataCount);
420

  
421
                return strWork.ToString();
422
            }
423
            catch (Exception ex)
424
            {
425
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork.ToString());
426
                return string.Empty;
427
            }
428
        }
429
        #endregion
430

  
431
        #region 追加番号の最大値を取得
432
        /// <summary>
433
        /// 追加番号の最大値を取得する
434
        /// </summary>
435
        /// <param name="AddSQLString"></param>
436
        /// <param name="bConnect"></param>
437
        /// <returns></returns>
438
        public int SelectMaxAddDataCount(string AddSQLString, bool bConnect = true)
439
        {
440
            // インターフェース
441
            StringBuilder strcmd = new StringBuilder();
442
            ArrayList arData = new ArrayList();
443
            int iRet = 0;
444
            try
445
            {
446
                // SQL作成
447
                strcmd.AppendFormat("SELECT IFNULL(MAX(DataCount), 0) FROM DepartmentCostData{0}", AddSQLString);
448

  
449
                // SQL実行
450
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return iRet;
451

  
452
                // データセット
453
                foreach (object[] objwrk in arData)
454
                {
455
                    if (objwrk[0].ToString().Equals("null"))
456
                        iRet = 0;
457
                    else
458
                        iRet = int.Parse(objwrk[0].ToString());
459
                }
460

  
461
            }
462
            catch (Exception ex)
463
            {
464
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
465
            }
466
            return iRet;
467
        }
468
        #endregion
469
    }
470
}
branches/src/ProcessManagement/ProcessManagement/DataModel/DepartmentCostData.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 DepartmentCostData
12
    {
13
        #region 定数
14
        #endregion
15

  
16
        #region メンバ変数
17
        /// <summary>
18
        /// 部署コード
19
        /// </summary>
20
        private int m_DepartmentCode = 0;
21
        /// <summary>
22
        /// 工事期数
23
        /// </summary>
24
        private int m_ConstructionPeriod = 0;
25
        /// <summary>
26
        /// データ番号
27
        /// </summary>
28
        private int m_DataCount = 0;
29
        /// <summary>
30
        /// 入力担当者コード
31
        /// </summary>
32
        private int m_EntryPersonCode = 0;
33
        /// <summary>
34
        /// 支払先コード
35
        /// </summary>
36
        private int m_SuppliersCode = 0;
37
        /// <summary>
38
        /// 支払先名称
39
        /// </summary>
40
        private string m_SuppliersName = string.Empty;
41
        /// <summary>
42
        /// 支払内容
43
        /// </summary>
44
        private string m_PaymentContent = string.Empty;
45
        /// <summary>
46
        /// 請求日
47
        /// </summary>
48
        private DateTime m_DateOfBilling = DateTime.MinValue.Date;
49
        /// <summary>
50
        /// 支払日
51
        /// </summary>
52
        private DateTime m_DateOfPayment = DateTime.MinValue.Date;
53
        /// <summary>
54
        /// 金額(税抜)
55
        /// </summary>
56
        private long m_EntryPrice = 0;
57
        /// <summary>
58
        /// 金額(税込)
59
        /// </summary>
60
        private long m_EntryPriceInTax = 0;
61
        /// <summary>
62
        /// 伝票番号
63
        /// </summary>
64
        private string m_SlipNumber = string.Empty;
65
        /// <summary>
66
        /// 引込済みフラグ
67
        /// </summary>
68
        private int m_ComplateFlg = 0;
69
        /// <summary>
70
        /// 承認フラグ
71
        /// </summary>
72
        private int m_ApprovalFlg = 0;
73

  
74
        /// <summary>
75
        /// 登録日付
76
        /// </summary>
77
        private DateTime    m_EntryDate = DateTime.Now;
78
        /// <summary>
79
        /// 更新日付
80
        /// </summary>
81
        private DateTime    m_UpdateDate = DateTime.Now;
82
        #endregion
83

  
84
        #region コンストラクタ
85
        #endregion
86

  
87
        #region プロパティ
88
        /// <summary>
89
        /// 部署コード
90
        /// </summary>
91
        public int DepartmentCode
92
        {
93
            get { return m_DepartmentCode; }
94
            set { m_DepartmentCode = value; }
95
        }
96
        /// <summary>
97
        /// 工事期数
98
        /// </summary>
99
        public int ConstructionPeriod
100
        {
101
            get { return m_ConstructionPeriod; }
102
            set { m_ConstructionPeriod = value; }
103
        }
104
        /// <summary>
105
        /// データ番号
106
        /// </summary>
107
        public int DataCount
108
        {
109
            get { return m_DataCount; }
110
            set { m_DataCount = value; }
111
        }
112
        /// <summary>
113
        /// 入力担当者コード
114
        /// </summary>
115
        public int EntryPersonCode
116
        {
117
            get { return m_EntryPersonCode; }
118
            set { m_EntryPersonCode = value; }
119
        }
120
        /// <summary>
121
        /// 支払先コード
122
        /// </summary>
123
        public int SuppliersCode
124
        {
125
            get { return m_SuppliersCode; }
126
            set { m_SuppliersCode = value; }
127
        }
128
        /// <summary>
129
        /// 支払先名称
130
        /// </summary>
131
        public string SuppliersName
132
        {
133
            get { return m_SuppliersName; }
134
            set { m_SuppliersName = value; }
135
        }
136
        /// <summary>
137
        /// 支払内容
138
        /// </summary>
139
        public string PaymentContent
140
        {
141
            get { return m_PaymentContent; }
142
            set { m_PaymentContent = value; }
143
        }
144
        /// <summary>
145
        /// 請求日
146
        /// </summary>
147
        public DateTime DateOfBilling
148
        {
149
            get { return m_DateOfBilling; }
150
            set { m_DateOfBilling = value; }
151
        }
152
        /// <summary>
153
        /// 支払日
154
        /// </summary>
155
        public DateTime DateOfPayment
156
        {
157
            get { return m_DateOfPayment; }
158
            set { m_DateOfPayment = value; }
159
        }
160
        /// <summary>
161
        /// 金額(税抜)
162
        /// </summary>
163
        public long EntryPrice
164
        {
165
            get { return m_EntryPrice; }
166
            set { m_EntryPrice = value; }
167
        }
168
        /// <summary>
169
        /// 金額(税込)
170
        /// </summary>
171
        public long EntryPriceInTax
172
        {
173
            get { return m_EntryPriceInTax; }
174
            set { m_EntryPriceInTax = value; }
175
        }
176
        /// <summary>
177
        /// 伝票番号
178
        /// </summary>
179
        public string SlipNumber
180
        {
181
            get { return m_SlipNumber; }
182
            set { m_SlipNumber = value; }
183
        }
184
        /// <summary>
185
        /// 引込済みフラグ
186
        /// </summary>
187
        public int ComplateFlg
188
        {
189
            get { return m_ComplateFlg; }
190
            set { m_ComplateFlg = value; }
191
        }
192
        /// <summary>
193
        /// 承認フラグ
194
        /// </summary>
195
        public int ApprovalFlg
196
        {
197
            get { return m_ApprovalFlg; }
198
            set { m_ApprovalFlg = value; }
199
        }
200

  
201
        /// <summary>
202
        /// 登録日付
203
        /// </summary>
204
        public DateTime EntryDate
205
        {
206
            set { m_EntryDate = value; }
207
            get { return m_EntryDate; }
208
        }
209
        /// <summary>
210
        /// 更新日付
211
        /// </summary>
212
        public DateTime UpdateDate
213
        {
214
            set { m_UpdateDate = value; }
215
            get { return m_UpdateDate; }
216
        }
217
        #endregion
218
    }
219
}
branches/src/ProcessManagement/ProcessManagement/DataModel/DepartmentMaster.cs
17 17
        private int         m_ActionScheduleFlg = 0;	        // 行動予定表示フラグ
18 18
        private int         m_StaffAssignFlg = 0;               // 人員配置表示フラグ
19 19
        private DateTime    m_StartDate = DateTime.Now;         // 開始日付
20
        private DateTime    m_CompDate = DateTime.MinValue;     // 終了日付
20
        private DateTime    m_CompDate = DateTime.MinValue;     // 終了日付
21 21
        private int         m_DeleteFlg = 0;	                // 削除フラグ
22 22
        private DateTime    m_EntryDate = DateTime.Now;         // 登録日付
23 23
        private DateTime    m_UpdateDate = DateTime.Now;        // 更新日付
......
90 90
        {
91 91
            get { return m_CompDate; }
92 92
            set { m_CompDate = value; }
93
        }
93
        }
94 94
        /// <summary>
95 95
        /// 登録日付
96 96
        /// </summary>
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ApprovalList/FrmApprovalListAuxiliary.cs
297 297
                cmbDepartment.Items.Clear();
298 298
                cmbDepartment.Text = "";
299 299

  
300
                int nTargetCount = CommonMotions.cnvInt(numUDConstPro.Value);
300
                int nTargetCount = (int)numUDConstPro.Value;
301 301
                // ?????}?X?^??????????
302 302
                StringBuilder strSQL = new StringBuilder();
303 303
                CommonMotions.CreateDepCombBoxSQL(ref strSQL, nTargetCount);
......
402 402
                cmbConstructionPerson.Items.Clear();
403 403
                cmbConstructionPerson.Text = "";
404 404

  
405
                int nTargetCount = CommonMotions.cnvInt(numUDConstPro.Value);
405
                int nTargetCount = (int)numUDConstPro.Value;
406 406
                int DepartmentCode = GetDepartmentCode();
407 407
                StringBuilder strSQL = new StringBuilder();
408 408
                CommonMotions.CreateManCombBoxSQL(ref strSQL, nTargetCount, DepartmentCode);
......
1213 1213
                // ?f?[?^?????????????????Z?b?g
1214 1214
                int minval = 0;
1215 1215
                int maxval = 0;
1216
                CommonMotions.GetPeriodYear(ref minval, ref maxval);
1216
                CommonMotions.GetPeriodYearMinMax(ref minval, ref maxval);
1217 1217
                numUDConstPro.Minimum = minval;
1218 1218
                numUDConstPro.Maximum = maxval;
1219
                numUDConstPro.Value = CommonMotions.SystemMasterData.BusinessPeriod;
1219
                numUDConstPro.Value = CommonMotions.GetPeriodYear();
1220 1220

  
1221 1221
            }
1222 1222
            catch (Exception ex)
......
1234 1234
        {
1235 1235
            try
1236 1236
            {
1237
                // ?????N?x?Z?b?g
1238
                // ?f?[?^?????????????????Z?b?g
1239
                int minval = 0;
1240
                int maxval = 0;
1241
                CommonMotions.GetPeriodYear(ref minval, ref maxval);
1242
                numUDConstPro.Minimum = minval;
1243
                numUDConstPro.Maximum = maxval;
1244
                numUDConstPro.Value = CommonMotions.SystemMasterData.BusinessPeriod;
1245

  
1246 1237
                // ----- ????????f?[?^????????????Z?b?g????
1247 1238
                int NowPoint = ClsExcute.GetNowProcessPoint();
1248 1239
                //?@?N?x
......
1290 1281
                int PersonCode = GetConstructionPersonCode();
1291 1282
                if (PersonCode < 1) return true;
1292 1283

  
1293
                int nTargetCount = CommonMotions.cnvInt(numUDConstPro.Value);
1284
                int nTargetCount = (int)numUDConstPro.Value;
1294 1285
                int DepartmentCode = GetDepartmentCode();
1295 1286

  
1296 1287
                StringBuilder strSQL = new StringBuilder();
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstractionList/FrmConstructionListAuxiliary.cs
1452 1452
                // ?f?[?^?????????????????Z?b?g
1453 1453
                int minval = 0;
1454 1454
                int maxval = 0;
1455
                CommonMotions.GetPeriodYear(ref minval, ref maxval);
1455
                CommonMotions.GetPeriodYearMinMax(ref minval, ref maxval);
1456 1456
                numUDConstPro.Minimum = minval;
1457 1457
                numUDConstPro.Maximum = maxval;
1458
                numUDConstPro.Value = CommonMotions.SystemMasterData.BusinessPeriod;
1458
                numUDConstPro.Value = CommonMotions.GetPeriodYear();
1459 1459

  
1460 1460
            }
1461 1461
            catch (Exception ex)
......
1473 1473
        {
1474 1474
            try
1475 1475
            {
1476
                // ?????N?x?Z?b?g
1477
                // ?f?[?^?????????????????Z?b?g
1478
                int minval = 0;
1479
                int maxval = 0;
1480
                CommonMotions.GetPeriodYear(ref minval, ref maxval);
1481
                numUDConstPro.Minimum = minval;
1482
                numUDConstPro.Maximum = maxval;
1483
                numUDConstPro.Value = CommonMotions.SystemMasterData.BusinessPeriod;
1484

  
1485 1476
                // ----- ????????f?[?^????????????Z?b?g????
1486 1477
                int NowPoint = ClsExcute.GetNowProcessPoint();
1487 1478
                //?@?N?x
......
2100 2091
                cmbDepartment.Items.Clear();
2101 2092
                cmbDepartment.Text = "";
2102 2093

  
2103
                int nTargetCount = CommonMotions.cnvInt(numUDConstPro.Value);
2094
                int nTargetCount = (int)numUDConstPro.Value;
2104 2095
                // ?????}?X?^??????????
2105 2096
                StringBuilder strSQL = new StringBuilder();
2106 2097
                CommonMotions.CreateDepCombBoxSQL(ref strSQL, nTargetCount);
......
2156 2147
                cmbConstructionPerson.Items.Clear();
2157 2148
                cmbConstructionPerson.Text = "";
2158 2149

  
2159
                int nTargetCount = CommonMotions.cnvInt(numUDConstPro.Value);
2150
                int nTargetCount = (int)numUDConstPro.Value;
2160 2151
                int DepartmentCode = GetDepartmentCode();
2161 2152
                StringBuilder strSQL = new StringBuilder();
2162 2153
                CommonMotions.CreateManCombBoxSQL(ref strSQL, nTargetCount, DepartmentCode);
......
2213 2204
                int PersonCode = GetConstructionPersonCode();
2214 2205
                if (PersonCode < 1) return true;
2215 2206

  
2216
                int nTargetCount = CommonMotions.cnvInt(numUDConstPro.Value);
2207
                int nTargetCount = (int)numUDConstPro.Value;
2217 2208
                int DepartmentCode = GetDepartmentCode();
2218 2209

  
2219 2210
                StringBuilder strSQL = new StringBuilder();
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfoAuxiliary.cs
2179 2179
                {
2180 2180
                    // ?H????
2181 2181
                    nTarget = CommonMotions.cnvInt(m_DspCtrl[(int)DspCnt.ConstructionPeriod].Text);
2182
                    if (nTarget < 1) nTarget = CommonMotions.SystemMasterData.BusinessPeriod;
2183 2182
                }
2184 2183
                else
2185 2184
                {
2186 2185
                    // ?H???N?x
2187 2186
                    nTarget = CommonMotions.cnvInt(m_DspCtrl[(int)DspCnt.ConstructionYear].Text);
2188
                    if (nTarget < 1) nTarget = CommonMotions.SystemMasterData.ConstrYear;
2189 2187
                }
2188
                if (nTarget < 1) nTarget = CommonMotions.GetPeriodYear();
2190 2189

  
2191 2190
                return nTarget;
2192 2191
            }
......
2487 2486
                // ?????}?X?^??????????
2488 2487
                int nPeriod = GetTargetYear();
2489 2488
                StringBuilder strSQL = new StringBuilder();
2490
                CommonMotions.CreateDepCombBoxSQL(ref strSQL, nPeriod);
2489
                CommonMotions.CreateDepCombBoxSQL(ref strSQL, nPeriod, true);
2491 2490

  
2492 2491
                ArrayList dmList = new ArrayList();
2493 2492
                // ?????}?X?^???
......
5222 5221
                int iYear = 0;
5223 5222
                int month = 0;
5224 5223
                int day = 0;
5225
                bool bPeriod = true;
5226
                if (CommonMotions.SystemMasterData.ConstructionNoBase == (int)SystemMaster.ConstrNoBaseDef.BusinessPeriod)
5227
                {   // ?c???
5228
                    bPeriod = true;
5229
                }
5230
                dtStart = CommonMotions.GetOpeningEndDate(Period, true, bPeriod);
5231
                dtEnd = CommonMotions.GetOpeningEndDate(Period, false, bPeriod);
5232 5224

  
5225
                dtStart = CommonMotions.GetOpeningEndDate(Period, true);
5226
                dtEnd = CommonMotions.GetOpeningEndDate(Period, false);
5227

  
5233 5228
                // ?{?H?????
5234 5229
                DateTime dtCStart = CommonMotions.cnvDate(m_DspCtrl[(int)DspCnt.ConstructionPeriodStart].Text);     // 48: ?_??H???J?n
5235 5230
                DateTime dtCStart2 = CommonMotions.cnvDate(m_DspCtrl[(int)DspCnt.ConstructionPeriodStart2].Text);   // 62: ?_??H???J?n?i???????j
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudgetAuxiliary.cs
1188 1188
                string strSQL = "SELECT A.TYPECODE, A.NAMESTRING, A.EXPENSESLINK, B.NAMECODE, B.EXPENSESRAITO";
1189 1189
                strSQL += " FROM CONSTRUCTIONTYPEMASTER A";
1190 1190
                strSQL += " LEFT JOIN TYPEEXPENSESMASTER B ON B.TYPECODE = A.TYPECODE";
1191
                strSQL += string.Format(" AND B.EXPENSESPERIOD = {0}", CommonMotions.SystemMasterData.BusinessPeriod);
1191
                strSQL += string.Format(" AND B.EXPENSESPERIOD = {0}", CommonMotions.GetPeriodYear());
1192 1192
                strSQL += string.Format(" WHERE A.TYPECODE = {0} AND A.EXPENSESLINK = 1", m_ConstructionBaseInfo.ConstructionType);
1193 1193

  
1194 1194
                ArrayList arList = new ArrayList();
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionJoin/FrmConstructionJoinAuxiliary.cs
265 265
                cmbDepartment.Items.Clear();
266 266
                cmbDepartment.Text = "";
267 267

  
268
                int nTargetCount = CommonMotions.cnvInt(numUDConstPro.Value);
268
                int nTargetCount = (int)numUDConstPro.Value;
269 269
                // 部署マスタを検索する
270 270
                StringBuilder strSQL = new StringBuilder();
271 271
                CommonMotions.CreateDepCombBoxSQL(ref strSQL, nTargetCount);
......
321 321
                cmbConstructionPerson.Items.Clear();
322 322
                cmbConstructionPerson.Text = "";
323 323

  
324
                int nTargetCount = CommonMotions.cnvInt(numUDConstPro.Value);
324
                int nTargetCount = (int)numUDConstPro.Value;
325 325
                int DepartmentCode = GetDepartmentCode();
326 326
                StringBuilder strSQL = new StringBuilder();
327 327
                CommonMotions.CreateManCombBoxSQL(ref strSQL, nTargetCount, DepartmentCode);
......
379 379
                int PersonCode = GetConstructionPersonCode();
380 380
                if (PersonCode < 1) return true;
381 381

  
382
                int nTargetCount = CommonMotions.cnvInt(numUDConstPro.Value);
382
                int nTargetCount = (int)numUDConstPro.Value;
383 383
                int DepartmentCode = GetDepartmentCode();
384 384

  
385 385
                StringBuilder strSQL = new StringBuilder();
......
432 432
                // データにある事業期と現在の事業セット
433 433
                int minval = 0;
434 434
                int maxval = 0;
435
                CommonMotions.GetPeriodYear(ref minval, ref maxval);
435
                CommonMotions.GetPeriodYearMinMax(ref minval, ref maxval);
436 436
                numUDConstPro.Minimum = minval;
437 437
                numUDConstPro.Maximum = maxval;
438
                numUDConstPro.Value = CommonMotions.SystemMasterData.BusinessPeriod;
438
                numUDConstPro.Value = CommonMotions.GetPeriodYear();
439 439
            }
440 440
            catch (Exception ex)
441 441
            {
......
1101 1101
            IOConstructionBaseInfo BaseDB = new IOConstructionBaseInfo();
1102 1102
            try
1103 1103
            {
1104
                int PeriodValue = 0;
1105
                if (CommonMotions.SystemMasterData.ConstructionNoBase == (int)SystemMaster.ConstrNoBaseDef.BusinessPeriod)
1106
                {   // ----- 営業期ベースの時
1107
                    // 期数をセット
1108
                    PeriodValue = CommonMotions.SystemMasterData.BusinessPeriod;
1109
                }
1110
                else
1111
                {   // ----- 営業年度ベースの時
1112

  
1113
                    // 営業年をセット
1114
                    PeriodValue = CommonMotions.SystemMasterData.ConstrYear;
1115
                }
1104
                // 年を取得する
1105
                int PeriodValue = CommonMotions.GetPeriodYear();
1116 1106
                // 工事番号を作成する
1117 1107
                return BaseDB.CreateNewCounstructionCode(PeriodValue);
1118 1108
            }
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedgerList/FrmConstructionLedgerListAuxiliary.cs
385 385
                DataGridView dgv = dgvMaster;
386 386

  
387 387
                int NowPoint = ClsExcute.GetNowProcessPoint();
388
                // ???g?p?????^???????????????????
389
                // ?V?Z?L?????e?B?f?[?^??????????m?F????
390
                if (CommonMotions.LoginUserData.SecCode == 0)
388
                // ???g?p?????^???????????????????i???^????????\???j
389
                if (CommonMotions.LoginUserSecurity.SecRank == CommonDefine.SecurityRankList[(int)CommonDefine.SecurityRankPos.NormalAuthority].Key)
391 390
                {
392
                    if (CommonMotions.LoginUserData.SecurityManagement == CommonDefine.SystemManageDiv[(int)CommonDefine.SysManaDivNo.UserAuthority].Key)
393
                    {
394
                        dgvMaster.Columns[(int)DispColumn.Allowance].Visible = false;
395
                        m_CellSize[(int)DispColumn.Allowance] = 0;
396
                    }
391
                    dgvMaster.Columns[(int)DispColumn.Allowance].Visible = false;
392
                    m_CellSize[(int)DispColumn.Allowance] = 0;
397 393
                }
398
                else
399
                {
400
                    if (CommonMotions.LoginUserSecurity.SecRank == CommonDefine.SecurityRankList[(int)CommonDefine.SecurityRankPos.NormalAuthority].Key)
401
                    {
402
                        dgvMaster.Columns[(int)DispColumn.Allowance].Visible = false;
403
                        m_CellSize[(int)DispColumn.Allowance] = 0;
404
                    }
405
                }
406 394

  
407 395
                // ?f?[?^?\??
408 396
                DataDisplay();
......
1550 1538
                cmbDepartment.Items.Clear();
1551 1539
                cmbDepartment.Text = "";
1552 1540

  
1553
                int nTargetCount = CommonMotions.cnvInt(numUDConstPro.Value);
1541
                int nTargetCount = (int)numUDConstPro.Value;
1554 1542
                // ?????}?X?^??????????
1555 1543
                StringBuilder strSQL = new StringBuilder();
1556 1544
                CommonMotions.CreateDepCombBoxSQL(ref strSQL, nTargetCount);
......
1606 1594
                cmbConstructionPerson.Items.Clear();
1607 1595
                cmbConstructionPerson.Text = "";
1608 1596

  
1609
                int nTargetCount = CommonMotions.cnvInt(numUDConstPro.Value);
1597
                int nTargetCount = (int)numUDConstPro.Value;
1610 1598
                int DepartmentCode = GetDepartmentCode();
1611 1599
                StringBuilder strSQL = new StringBuilder();
1612 1600
                CommonMotions.CreateManCombBoxSQL(ref strSQL, nTargetCount, DepartmentCode);
......
1662 1650
                int PersonCode = GetConstructionPersonCode();
1663 1651
                if (PersonCode < 1) return true;
1664 1652

  
1665
                int nTargetCount = CommonMotions.cnvInt(numUDConstPro.Value);
1653
                int nTargetCount = (int)numUDConstPro.Value;
1666 1654
                int DepartmentCode = GetDepartmentCode();
1667 1655

  
1668 1656
                StringBuilder strSQL = new StringBuilder();
......
1788 1776
                // ?f?[?^?????????????????Z?b?g
1789 1777
                int minval = 0;
1790 1778
                int maxval = 0;
1791
                CommonMotions.GetPeriodYear(ref minval, ref maxval);
1779
                CommonMotions.GetPeriodYearMinMax(ref minval, ref maxval);
1792 1780
                numUDConstPro.Minimum = minval;
1793 1781
                numUDConstPro.Maximum = maxval;
1794
                numUDConstPro.Value = CommonMotions.SystemMasterData.BusinessPeriod;
1782
                numUDConstPro.Value = CommonMotions.GetPeriodYear();
1795 1783

  
1796 1784
            }
1797 1785
            catch (Exception ex)
......
1809 1797
        {
1810 1798
            try
... 差分の行数が表示可能な上限を超えました。超過分は表示しません。

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