プロジェクト

全般

プロフィール

リビジョン 101

堀内7年以上前に追加

年マスタ・月マスタ・日マスタ追加・コンバートツール修正・Create文追加

差分を表示:

branches/ddl/DataConert/DataConert/DataConvertAuxiliary.cs
520 520
                bRet = CnvVehiclescheduledata(ino++, ref strMsg);
521 521
                this.Invoke(m_progressDlg, new object[] { strMsg });
522 522
                if (!bRet) return;
523

  
524
                // 88:年マスタ(YearMaster)
525
                bRet = CnvYearMaster(ino++, ref strMsg);
526
                this.Invoke(m_progressDlg, new object[] { strMsg });
527
                if (!bRet) return;
528

  
529
                // 89:月マスタ(Monthmaster)
530
                bRet = CnvMonthmaster(ino++, ref strMsg);
531
                this.Invoke(m_progressDlg, new object[] { strMsg });
532
                if (!bRet) return;
533

  
534
                // 90:日マスタ(Daymaster)
535
                bRet = CnvDaymaster(ino++, ref strMsg);
536
                this.Invoke(m_progressDlg, new object[] { strMsg });
537
                if (!bRet) return;
538

  
523 539
                #endregion
524 540
            }
525 541
            catch (Exception ex)
......
6869 6885
            }
6870 6886
        }
6871 6887
        #endregion
6888

  
6889
        #region 年マスタ(YearMaster)
6890
        /// <summary>
6891
        /// 年マスタ(YearMaster)
6892
        /// </summary>
6893
        /// <param name="strMsg"></param>
6894
        /// <returns></returns>
6895
        private bool CnvYearMaster(int ino, ref string strMsg)
6896
        {
6897
            ProcessManagement.DB.IOAccess.IOSystemExecute OutDB = new ProcessManagement.DB.IOAccess.IOSystemExecute();
6898
            strMsg = string.Format("№{0}:テーブル:{1}({2})", (ino + 1).ToString("00"), s_OracleTables[ino].Value, s_OracleTables[ino].Key);
6899
            try
6900
            {
6901
                EditDspLength(ref strMsg);
6902

  
6903
                OutDB.connect(); OutDB.beginTran();
6904
                string strSQL = string.Format("TRUNCATE TABLE {0}", s_OracleTables[ino].Key);
6905
                OutDB.ExecuteNonQuery(strSQL, false);
6906

  
6907
                bool bDataFirst = true;
6908
                int DataCnt = 0;
6909
                string BuffList = string.Format("INSERT INTO {0} (years) VALUES", s_OracleTables[ino].Key);
6910

  
6911
                for (int i = 0; i < 100; i++, DataCnt++)
6912
                {
6913
                    if (bDataFirst) BuffList += " (";
6914
                    else BuffList += ", (";
6915

  
6916
                    BuffList += string.Format("{0}", 2015 + i);
6917
                    BuffList += ")";
6918

  
6919
                    bDataFirst = false;
6920
                }
6921

  
6922
                if (!OutDB.ExecuteNonQuery(BuffList, false))
6923
                {
6924
                    OutDB.rollback();
6925
                    strMsg += " DB処理異常";
6926
                    return false;
6927
                }
6928

  
6929
                strMsg += string.Format(" 処理件数={0}", DataCnt.ToString("#,0"));
6930

  
6931
                return true;
6932
            }
6933
            catch (Exception ex)
6934
            {
6935
                OutDB.rollback();
6936

  
6937
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
6938
                strMsg += string.Format(" システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
6939
                return false;
6940
            }
6941
            finally
6942
            {
6943
                OutDB.commit();
6944
                OutDB.close(); OutDB = null;
6945
            }
6946
        }
6947
        #endregion
6948

  
6949
        #region 月マスタ(Monthmaster)
6950
        /// <summary>
6951
        /// 月マスタ(Monthmaster)
6952
        /// </summary>
6953
        /// <param name="strMsg"></param>
6954
        /// <returns></returns>
6955
        private bool CnvMonthmaster(int ino, ref string strMsg)
6956
        {
6957
            ProcessManagement.DB.IOAccess.IOSystemExecute OutDB = new ProcessManagement.DB.IOAccess.IOSystemExecute();
6958
            strMsg = string.Format("№{0}:テーブル:{1}({2})", (ino + 1).ToString("00"), s_OracleTables[ino].Value, s_OracleTables[ino].Key);
6959
            try
6960
            {
6961
                EditDspLength(ref strMsg);
6962

  
6963
                OutDB.connect(); OutDB.beginTran();
6964
                string strSQL = string.Format("TRUNCATE TABLE {0}", s_OracleTables[ino].Key);
6965
                OutDB.ExecuteNonQuery(strSQL, false);
6966

  
6967
                bool bDataFirst = true;
6968
                int DataCnt = 0;
6969
                string BuffList = string.Format("INSERT INTO {0} (month) VALUES", s_OracleTables[ino].Key);
6970

  
6971
                for (int i = 0; i < 12; i++, DataCnt++)
6972
                {
6973
                    if (bDataFirst) BuffList += " (";
6974
                    else BuffList += ", (";
6975

  
6976
                    BuffList += string.Format("{0}", 1 + i);
6977
                    BuffList += ")";
6978

  
6979
                    bDataFirst = false;
6980
                }
6981

  
6982
                if (!OutDB.ExecuteNonQuery(BuffList, false))
6983
                {
6984
                    OutDB.rollback();
6985
                    strMsg += " DB処理異常";
6986
                    return false;
6987
                }
6988

  
6989
                strMsg += string.Format(" 処理件数={0}", DataCnt.ToString("#,0"));
6990

  
6991
                return true;
6992
            }
6993
            catch (Exception ex)
6994
            {
6995
                OutDB.rollback();
6996

  
6997
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
6998
                strMsg += string.Format(" システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
6999
                return false;
7000
            }
7001
            finally
7002
            {
7003
                OutDB.commit();
7004
                OutDB.close(); OutDB = null;
7005
            }
7006
        }
7007
        #endregion
7008

  
7009
        #region 日マスタ(Daymaster)
7010
        /// <summary>
7011
        /// 日マスタ(Daymaster)
7012
        /// </summary>
7013
        /// <param name="strMsg"></param>
7014
        /// <returns></returns>
7015
        private bool CnvDaymaster(int ino, ref string strMsg)
7016
        {
7017
            ProcessManagement.DB.IOAccess.IOSystemExecute OutDB = new ProcessManagement.DB.IOAccess.IOSystemExecute();
7018
            strMsg = string.Format("№{0}:テーブル:{1}({2})", (ino + 1).ToString("00"), s_OracleTables[ino].Value, s_OracleTables[ino].Key);
7019
            try
7020
            {
7021
                EditDspLength(ref strMsg);
7022

  
7023
                OutDB.connect(); OutDB.beginTran();
7024
                string strSQL = string.Format("TRUNCATE TABLE {0}", s_OracleTables[ino].Key);
7025
                OutDB.ExecuteNonQuery(strSQL, false);
7026

  
7027
                bool bDataFirst = true;
7028
                int DataCnt = 0;
7029
                string BuffList = string.Format("INSERT INTO {0} (days) VALUES", s_OracleTables[ino].Key);
7030

  
7031
                for (int i = 0; i < 31; i++, DataCnt++)
7032
                {
7033
                    if (bDataFirst) BuffList += " (";
7034
                    else BuffList += ", (";
7035

  
7036
                    BuffList += string.Format("{0}", 1 + i);
7037
                    BuffList += ")";
7038

  
7039
                    bDataFirst = false;
7040
                }
7041

  
7042
                if (!OutDB.ExecuteNonQuery(BuffList, false))
7043
                {
7044
                    OutDB.rollback();
7045
                    strMsg += " DB処理異常";
7046
                    return false;
7047
                }
7048

  
7049
                strMsg += string.Format(" 処理件数={0}", DataCnt.ToString("#,0"));
7050

  
7051
                return true;
7052
            }
7053
            catch (Exception ex)
7054
            {
7055
                OutDB.rollback();
7056

  
7057
                logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
7058
                strMsg += string.Format(" システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
7059
                return false;
7060
            }
7061
            finally
7062
            {
7063
                OutDB.commit();
7064
                OutDB.close(); OutDB = null;
7065
            }
7066
        }
7067
        #endregion
6872 7068
    }
6873 7069
}
branches/ddl/DataConert/DataConert/FrmDataConvert.cs
133 133
                                                                                                            new  KeyValuePair<string,string>("unitmaster"                   ,"単位マスタ                      "),
134 134
                                                                                                            new  KeyValuePair<string,string>("vehiclemaster"                ,"車両マスタ                      "),
135 135
                                                                                                            new  KeyValuePair<string,string>("vehiclerecorddata"            ,"車両記録データ                  "),
136
                                                                                                            new  KeyValuePair<string,string>("vehiclescheduledata"          ,"車両予約データ                  ")};
136
                                                                                                            new  KeyValuePair<string,string>("vehiclescheduledata"          ,"車両予約データ                  "),
137
                                                                                                            new  KeyValuePair<string,string>("YearMaster"                   ,"年マスタ                        "),
138
                                                                                                            new  KeyValuePair<string,string>("Monthmaster"                  ,"月マスタ                        "),
139
                                                                                                            new  KeyValuePair<string,string>("Daymaster"                    ,"日マスタ                        ")};
137 140
        #endregion
138 141

  
139 142
        #endregion
branches/ddl/ProcessManagement.sql
119 119
DROP TABLE IF EXISTS DailyDataMaterials;
120 120
DROP TABLE IF EXISTS DailyDataSubcontractors;
121 121
DROP TABLE IF EXISTS DailyDataVehicles;
122
DROP TABLE IF EXISTS DayMaster;
122 123
DROP TABLE IF EXISTS DepartmentExpensesMaster;
123 124
DROP TABLE IF EXISTS DepartmentMaster;
124 125
DROP TABLE IF EXISTS DivisionMaster;
......
132 133
DROP TABLE IF EXISTS MessageBoardData;
133 134
DROP TABLE IF EXISTS MessageBoardTerget;
134 135
DROP TABLE IF EXISTS MessageBrowsingHistory;
136
DROP TABLE IF EXISTS MonthMaster;
135 137
DROP TABLE IF EXISTS OrderersMaster;
136 138
DROP TABLE IF EXISTS OrdersPriceData;
137 139
DROP TABLE IF EXISTS PersonApproval;
......
168 170
DROP TABLE IF EXISTS VehicleMaster;
169 171
DROP TABLE IF EXISTS VehicleRecordData;
170 172
DROP TABLE IF EXISTS VehicleScheduleData;
173
DROP TABLE IF EXISTS YearMaster;
171 174

  
172 175

  
173 176

  
......
926 929
) COMMENT = '日報データ (車両)';
927 930

  
928 931

  
932
-- 日マスタ
933
CREATE TABLE DayMaster
934
(
935
	days smallint NOT NULL COMMENT '日'
936
) COMMENT = '日マスタ';
937

  
938

  
929 939
-- 部署経費率マスタ
930 940
CREATE TABLE DepartmentExpensesMaster
931 941
(
......
1147 1157
) COMMENT = '掲示板メッセージ閲覧履歴';
1148 1158

  
1149 1159

  
1160
-- 月マスタ
1161
CREATE TABLE MonthMaster
1162
(
1163
	month smallint NOT NULL COMMENT '月'
1164
) COMMENT = '月マスタ';
1165

  
1166

  
1150 1167
-- 発注者マスタ
1151 1168
CREATE TABLE OrderersMaster
1152 1169
(
......
1816 1833
) COMMENT = '車両予約データ';
1817 1834

  
1818 1835

  
1836
-- 年マスタ
1837
CREATE TABLE YearMaster
1838
(
1839
	years smallint NOT NULL COMMENT '年'
1840
) COMMENT = '年マスタ';
1819 1841

  
1842

  
1843

  
1820 1844
/* Create Indexes */
1821 1845

  
1822 1846
CREATE INDEX ActionScheduleData_Index1 ON ActionScheduleData (TargetYear ASC);

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