• R/O
  • SSH
  • HTTPS

mlapplication: Commit


Commit MetaInfo

Revision49 (tree)
Time2017-01-11 21:45:42
Authoryukio_miura

Log Message

(empty log message)

Change Summary

Incremental Difference

--- trunk/ML.Common.Extensions/Module/DataTableExtension.vb (revision 48)
+++ trunk/ML.Common.Extensions/Module/DataTableExtension.vb (revision 49)
@@ -3,113 +3,113 @@
33 Imports System.ComponentModel
44 Imports System.Reflection
55
6-''' <summary>
7-''' 【モジュール名】DataTableExtension
8-''' 【機能概要】DataTable型の拡張メソッド
9-''' </summary>
10-''' <remarks></remarks>
11-''' <history>
12-''' +------------+-----------+-----+-------------------------------------------+
13-''' |更新者 |日付 |連番 |変更内容 |
14-''' +------------+-----------+-----+-------------------------------------------+
15-''' y.miura 2015.01.11 001 新規作成
16-''' </history>
17-Public Module DataTableExtension
6+' ''' <summary>
7+' ''' 【モジュール名】DataTableExtension
8+' ''' 【機能概要】DataTable型の拡張メソッド
9+' ''' </summary>
10+' ''' <remarks></remarks>
11+' ''' <history>
12+' ''' +------------+-----------+-----+-------------------------------------------+
13+' ''' |更新者 |日付 |連番 |変更内容 |
14+' ''' +------------+-----------+-----+-------------------------------------------+
15+' ''' y.miura 2015.01.11 001 新規作成
16+' ''' </history>
17+'Public Module DataTableExtension
1818
19- ''' <summary>DataTableから条件に合致する値を返す</summary>
20- ''' <param name="dt">対象DataTable</param>
21- ''' <param name="sColumnName">ターゲット列</param>
22- ''' <param name="sWHR">WHERE条件</param>
23- <Extension()> _
24- Public Function DLookUp(ByVal dt As DataTable, _
25- ByVal sColumnName As String, _
26- Optional ByVal sWHR As String = "") As Object
19+' ''' <summary>DataTableから条件に合致する値を返す</summary>
20+' ''' <param name="dt">対象DataTable</param>
21+' ''' <param name="sColumnName">ターゲット列</param>
22+' ''' <param name="sWHR">WHERE条件</param>
23+' <Extension()> _
24+' Public Function DLookUp(ByVal dt As DataTable, _
25+' ByVal sColumnName As String, _
26+' Optional ByVal sWHR As String = "") As Object
2727
28- Dim dr() As DataRow
29- Dim oRet As Object = Nothing
28+' Dim dr() As DataRow
29+' Dim oRet As Object = Nothing
3030
31- dr = dt.Select(sWHR)
32- If dr.Length > 0 Then
33- oRet = dr(sColumnName)
34- End If
31+' dr = dt.Select(sWHR)
32+' If dr.Length > 0 Then
33+' oRet = dr(sColumnName)
34+' End If
3535
36- '' 戻り値を返す
37- Return oRet
36+' '' 戻り値を返す
37+' Return oRet
3838
39- End Function
39+' End Function
4040
41- ''' <summary>型無しDataTableから型付きDataSetクラスにコンバートする</summary>
42- ''' <param name="dtSrc">対象DataTable</param>
43- ''' <param name="dtDest">型付きDataSetクラス</param>
44- <Extension()> _
45- Public Sub Conv(ByVal dtSrc As DataTable, _
46- ByVal dtDest As IDataTable)
41+' ''' <summary>型無しDataTableから型付きDataSetクラスにコンバートする</summary>
42+' ''' <param name="dtSrc">対象DataTable</param>
43+' ''' <param name="dtDest">型付きDataSetクラス</param>
44+' <Extension()> _
45+' Public Sub Conv(ByVal dtSrc As DataTable, _
46+' ByVal dtDest As IDataTable)
4747
48- Dim rowType As Type = dtDest.GetRowType()
49- Dim rows As System.Collections.IList = CType(dtDest, IListSource).GetList()
50- For Each dr As DataRow In dtSrc.Rows
48+' Dim rowType As Type = dtDest.GetRowType()
49+' Dim rows As System.Collections.IList = CType(dtDest, IListSource).GetList()
50+' For Each dr As DataRow In dtSrc.Rows
5151
52- Dim item As Object = dtDest.CreateRow()
52+' Dim item As Object = dtDest.CreateRow()
5353
54- '' リフレクションを使って、列ごとにコピーする
55- For Each dc As DataColumn In dtSrc.Columns
54+' '' リフレクションを使って、列ごとにコピーする
55+' For Each dc As DataColumn In dtSrc.Columns
5656
57- '' 列名を取得する
58- Dim sKey As String = dc.ColumnName
59- Dim pi As PropertyInfo = rowType.GetProperty(sKey)
60- If Not pi Is Nothing Then
57+' '' 列名を取得する
58+' Dim sKey As String = dc.ColumnName
59+' Dim pi As PropertyInfo = rowType.GetProperty(sKey)
60+' If Not pi Is Nothing Then
6161
62- '' object型 -> 元の型のキャストでエラーになるため、
63- '' 一度元の型に ChangeType してから代入する。
64- If Not dr.Item(sKey) Is DBNull.Value Then
65- pi.SetValue(item, Convert.ChangeType(dr.Item(sKey), pi.PropertyType), Nothing)
66- End If
62+' '' object型 -> 元の型のキャストでエラーになるため、
63+' '' 一度元の型に ChangeType してから代入する。
64+' If Not dr.Item(sKey) Is DBNull.Value Then
65+' pi.SetValue(item, Convert.ChangeType(dr.Item(sKey), pi.PropertyType), Nothing)
66+' End If
6767
68- End If
69- Next
70- rows.Add(item)
71- Next
72- End Sub
68+' End If
69+' Next
70+' rows.Add(item)
71+' Next
72+' End Sub
7373
74- ''' <summary>型無しDataTableから型付きDataTableにコンバートする</summary>
75- ''' <param name="dtSrc">対象DataTable</param>
76- ''' <param name="dtDest">型付きDataTable</param>
77- <Extension()> _
78- Public Sub Conv(ByVal dtSrc As DataTable, _
79- ByVal dtDest As DataTable)
74+' ''' <summary>型無しDataTableから型付きDataTableにコンバートする</summary>
75+' ''' <param name="dtSrc">対象DataTable</param>
76+' ''' <param name="dtDest">型付きDataTable</param>
77+' <Extension()> _
78+' Public Sub Conv(ByVal dtSrc As DataTable, _
79+' ByVal dtDest As DataTable)
8080
81- '' 対象DataTableの行をループさせる
82- For Each dr As DataRow In dtSrc.Rows
81+' '' 対象DataTableの行をループさせる
82+' For Each dr As DataRow In dtSrc.Rows
8383
84- '' 型付きDataTableから行を生成
85- Dim drNewRow As DataRow = dtDest.NewRow
84+' '' 型付きDataTableから行を生成
85+' Dim drNewRow As DataRow = dtDest.NewRow
8686
87- '' 対象DataTableの列をループさせる
88- For iColIdxS As Integer = 0 To dtSrc.Columns.Count - 1
87+' '' 対象DataTableの列をループさせる
88+' For iColIdxS As Integer = 0 To dtSrc.Columns.Count - 1
8989
90- '' 型付きDataTableの列をループさせる
91- For iColIdxD As Integer = 0 To dtDest.Columns.Count - 1
90+' '' 型付きDataTableの列をループさせる
91+' For iColIdxD As Integer = 0 To dtDest.Columns.Count - 1
9292
93- Try
94- '' 列名を照合させて一致した場合は新規生成した行に値を代入する
95- If dtSrc.Columns(iColIdxS).ColumnName = dtDest.Columns(iColIdxD).ColumnName Then
96- drNewRow.Item(dtDest.Columns(iColIdxD).ColumnName) = dr.Item(dtSrc.Columns(iColIdxS).ColumnName)
97- Exit For
98- End If
93+' Try
94+' '' 列名を照合させて一致した場合は新規生成した行に値を代入する
95+' If dtSrc.Columns(iColIdxS).ColumnName = dtDest.Columns(iColIdxD).ColumnName Then
96+' drNewRow.Item(dtDest.Columns(iColIdxD).ColumnName) = dr.Item(dtSrc.Columns(iColIdxS).ColumnName)
97+' Exit For
98+' End If
9999
100- Catch ex As Exception
100+' Catch ex As Exception
101101
102- Throw ex
102+' Throw ex
103103
104- End Try
105- Next
106- Next
104+' End Try
105+' Next
106+' Next
107107
108- '' 型付きDataTableに行を追加
109- dtDest.Rows.Add(drNewRow)
108+' '' 型付きDataTableに行を追加
109+' dtDest.Rows.Add(drNewRow)
110110
111- Next
111+' Next
112112
113- End Sub
113+' End Sub
114114
115-End Module
115+'End Module
--- trunk/MLApp.Const/Module/DataTableExtension.vb (revision 0)
+++ trunk/MLApp.Const/Module/DataTableExtension.vb (revision 49)
@@ -0,0 +1,261 @@
1+
2+Imports System.Runtime.CompilerServices
3+
4+''' <summary>
5+''' 【モジュール名】DataTableExtension
6+''' 【機能概要】DataTable型の拡張メソッド
7+''' </summary>
8+''' <remarks></remarks>
9+''' <history>
10+''' +------------+-----------+-----+-------------------------------------------+
11+''' |更新者 |日付 |連番 |変更内容 |
12+''' +------------+-----------+-----+-------------------------------------------+
13+''' y.miura 2015.01.11 001 新規作成
14+''' y.miura 2016.01.29 002 GetDataメソッドにてFillメソッド実行前にターゲットDataTableをクリアする処理を追加
15+''' </history>
16+Public Module DataTableExtension
17+
18+ ''' <summary>DataTableから条件に合致する値を抽出する</summary>
19+ ''' <param name="dt">対象DataTable</param>
20+ ''' <param name="sColumnName">ターゲット列</param>
21+ ''' <param name="sWHR">WHERE条件</param>
22+ <Extension()> _
23+ Public Function DLookUp(ByVal dt As DataTable, _
24+ ByVal sColumnName As String, _
25+ Optional ByVal sWHR As String = "") As Object
26+
27+ Dim dr() As DataRow
28+ Dim oRet As Object = Nothing
29+
30+ dr = dt.Select(sWHR)
31+ If dr.Length > 0 Then
32+ oRet = dr(0).Item(sColumnName)
33+ End If
34+
35+ '' 戻り値を返す
36+ Return oRet
37+
38+ End Function
39+
40+ ''' <summary>DataTableから条件に合致するレコード数を返す</summary>
41+ ''' <param name="dt">対象DataTable</param>
42+ ''' <param name="sWHR">WHERE条件</param>
43+ <Extension()> _
44+ Public Function DCount(ByVal dt As DataTable, _
45+ Optional ByVal sWHR As String = "") As Integer
46+
47+ Dim dr() As DataRow
48+
49+ '' DatatableからDataRowを抽出する
50+ dr = dt.Select(sWHR)
51+
52+ '' 戻り値を返す
53+ Return dr.Length
54+
55+ End Function
56+
57+ ''' <summary>DataTableから特定列の最大値を取得する</summary>
58+ ''' <param name="dt">対象DataTable</param>
59+ ''' <param name="sWHR">WHERE条件</param>
60+ <Extension()> _
61+ Public Function DMax(ByVal dt As DataTable,
62+ ByVal sColName As String,
63+ Optional ByVal sWHR As String = "") As Object
64+
65+ Dim Ret As Object
66+
67+ '' DatatableからDataRowを抽出する
68+ Ret = dt.Compute("MAX(" & sColName & ")", sWHR)
69+
70+ '' 戻り値を返す
71+ Return Ret
72+
73+ End Function
74+
75+ ''' <summary>DataTableから特定列の最小値を取得する</summary>
76+ ''' <param name="dt">対象DataTable</param>
77+ ''' <param name="sWHR">WHERE条件</param>
78+ <Extension()> _
79+ Public Function DMin(ByVal dt As DataTable,
80+ ByVal sColName As String,
81+ Optional ByVal sWHR As String = "") As Object
82+
83+ Dim Ret As Object
84+
85+ '' DatatableからDataRowを抽出する
86+ Ret = dt.Compute("MIN(" & sColName & ")", sWHR)
87+
88+ '' 戻り値を返す
89+ Return Ret
90+
91+ End Function
92+
93+ ''' <summary>DataTableから特定列の合計値を取得する</summary>
94+ ''' <param name="dt">対象DataTable</param>
95+ ''' <param name="sWHR">WHERE条件</param>
96+ <Extension()> _
97+ Public Function DSum(ByVal dt As DataTable,
98+ ByVal sColName As String,
99+ Optional ByVal sWHR As String = "") As Object
100+
101+ Dim Ret As Object
102+
103+ '' DatatableからDataRowを抽出する
104+ Ret = dt.Compute("SUM(" & sColName & ")", sWHR)
105+
106+ '' 戻り値を返す
107+ Return Ret
108+
109+ End Function
110+
111+ ''' <summary>対象テーブルの全レコードをDataTableとして取得する</summary>
112+ ''' <param name="dt">対象DataTable</param>
113+ <Extension()> _
114+ Public Function GetData(ByVal dt As DataTable) As DataTable
115+ Return GetData(dt, "", "")
116+ End Function
117+
118+ ' ''' <summary>対象テーブルの全レコードをDataTableとして取得する</summary>
119+ ' ''' <param name="dt">対象DataTable</param>
120+ ' ''' <param name="sWHR">抽出条件</param>
121+ ' ''' <param name="sSORT">ソートキー</param>
122+ '<Extension()> _
123+ 'Public Function GetData(ByVal dt As DataTable, _
124+ ' ByVal sWHR As String, _
125+ ' ByVal sSORT As String) As DataTable
126+
127+ ' Dim sClassName As String = Mid(dt.GetType.ToString, 1, InStr(1, dt.GetType.ToString, "+") - 1)
128+ ' Dim invM As New ML.Common.Function.Invm("MLApp.DataModel", _
129+ ' Application.StartupPath, _
130+ ' ML.Common.Const.Ext.DLLFILE_EXT, _
131+ ' sClassName & "TableAdapters" & "." & dt.TableName & "TableAdapter")
132+ ' Try
133+ ' '' TableAdapterインスタンスを作成する
134+ ' invM.CreateInstance()
135+ ' Dim dtR As DataTable = invM.RunMethod("GetData")
136+ ' Dim drR() As DataRow = dtR.Select(sWHR, sSORT)
137+ ' Dim dtRet As New DataTable
138+ ' dt.Rows.Clear()
139+ ' For Each dr As DataRow In drR
140+ ' dt.ImportRow(dr)
141+ ' Next
142+
143+ ' Catch ex As Exception
144+
145+ ' Throw ex
146+
147+ ' End Try
148+
149+ ' Return dt
150+ 'End Function
151+
152+ ''' <summary>対象テーブルの全レコードをDataTableとして取得する</summary>
153+ ''' <param name="dt">対象DataTable</param>
154+ ''' <param name="sWHR">抽出条件</param>
155+ ''' <param name="sSORT">ソートキー</param>
156+ <Extension()> _
157+ Public Function GetData(ByVal dt As DataTable, _
158+ ByVal sWHR As String, _
159+ Optional ByVal sSORT As String = "") As DataTable
160+ Dim dbCon As ML.DBAccess.Base.Db5
161+ Dim sSQL As String
162+
163+ '' DB-Open
164+ dbCon = ML.DBAccess.Base.Db5.CurrentDb
165+ dbCon.Open()
166+
167+ '' SELECT
168+ sSQL = "SELECT * FROM " & dt.TableName
169+
170+ '' WHERE
171+ sSQL &= " WHERE 1=1"
172+ If sWHR <> String.Empty Then
173+ sSQL &= " AND "
174+ sSQL &= sWHR
175+ End If
176+
177+ '' ORDER BY
178+ If sSORT <> String.Empty Then
179+ sSQL &= " ORDER BY " & sSORT
180+ End If
181+
182+ '' ターゲットDataTableを一旦クリア
183+ ' ADD 002 y.miura 16.01.29 >>
184+ dt.Rows.Clear()
185+ ' ADD 002 y.miura 16.01.29 <<
186+
187+ '' Fillメソッドを実行
188+ dbCon.Fill(dt, sSQL)
189+
190+ '' DB-Close
191+ dbCon.Close()
192+
193+ '' 戻り値を返す
194+ Return dt
195+ End Function
196+
197+ ''' <summary>テーブルのコピーを作成する</summary>
198+ ''' <param name="dt">対象DataTable</param>
199+ ''' <param name="sDestTable">コピー先テーブル名</param>
200+ ''' <param name="bRecordInclud">レコードをコピー対象とするか</param>
201+ <Extension()> _
202+ Public Sub CopyTable(ByVal dt As DataTable, _
203+ ByVal sDestTable As String, _
204+ Optional ByVal bRecordInclud As Boolean = False)
205+ Dim dbCon As ML.DBAccess.Base.Db5
206+ Dim sSQL As String
207+
208+ '' DB-Open
209+ dbCon = ML.DBAccess.Base.Db5.CurrentDb
210+ dbCon.Open()
211+
212+ Try
213+ '' コピー元テーブルが存在しない場合は処理を抜ける
214+ If dbCon.ExistTable(dt.TableName) = False Then
215+ Exit Sub
216+ End If
217+
218+ '' コピー先テーブルが存在する場合は削除する
219+ If dbCon.ExistTable(sDestTable) = True Then
220+
221+ sSQL = ""
222+ sSQL = "DROP TABLE " & sDestTable
223+ dbCon.Execute(sSQL)
224+
225+ End If
226+
227+ '' テーブルをコピーする
228+ sSQL = ""
229+ sSQL = "SELECT * INTO " & sDestTable & " FROM " & dt.TableName
230+ If bRecordInclud = False Then
231+ sSQL &= " WHERE 1=0"
232+ End If
233+ dbCon.Execute(sSQL)
234+
235+ '' コピー元テーブルの主キーを取得する
236+ Dim dcPKey() As DataColumn = dt.PrimaryKey
237+ Dim sPKeyArray As New List(Of String)
238+ For Each dc As DataColumn In dcPKey
239+ sPKeyArray.Add(dc.ColumnName)
240+ Next
241+ Dim sPKey As String = String.Join(ML.Common.Const.Fmt.fmtComma, sPKeyArray.ToArray)
242+
243+ '' コピー先テーブルの主キーを作成する
244+ sSQL = ""
245+ sSQL = "ALTER TABLE " & sDestTable & " ADD PRIMARY KEY (" & sPKey & ")"
246+ dbCon.Execute(sSQL)
247+
248+ Catch ex As Exception
249+
250+ Throw ex
251+
252+ Finally
253+
254+ '' DB-Close
255+ dbCon.Close()
256+
257+ End Try
258+
259+ End Sub
260+
261+End Module
--- trunk/MLApp.TRN7000/TRN7000.vb (revision 48)
+++ trunk/MLApp.TRN7000/TRN7000.vb (revision 49)
@@ -1,5 +1,5 @@
11 
2-Imports MLApp.DataModel.DataTableExtension
2+Imports MLApp.Const.DataTableExtension
33
44 ''' <summary>
55 ''' 【クラス名】TRN7000
--- trunk/MLApp.Base/TRNBaseCufoffSelect.vb (revision 48)
+++ trunk/MLApp.Base/TRNBaseCufoffSelect.vb (revision 49)
@@ -1,5 +1,5 @@
11 
2-Imports MLApp.DataModel.DataTableExtension
2+Imports MLApp.Const.DataTableExtension
33
44 ''' <summary>
55 ''' 【クラス名】TRNBaseCufoffSelect
--- trunk/MLApp.Base/ucSearchBox2Line.vb (revision 48)
+++ trunk/MLApp.Base/ucSearchBox2Line.vb (revision 49)
@@ -1,5 +1,6 @@
11 
2-Imports ML.Common.Extensions
2+Imports MLApp.Const.DataTableExtension
3+Imports ML.Common.Extensions.StringExtension
34
45 ''' <summary>
56 ''' 【クラス名】ucSearchBox2Line
--- trunk/MLApp.Base/ucSearchBox.vb (revision 48)
+++ trunk/MLApp.Base/ucSearchBox.vb (revision 49)
@@ -1,7 +1,7 @@
11 
2+Imports MLApp.Const.DataTableExtension
23 Imports ML.Common.Base.Form
34 Imports ML.Common.Extensions
4-Imports MLApp.DataModel.DataTableExtension
55
66 ''' <summary>
77 ''' 【クラス名】ucSearchBox
--- trunk/MLApp.Base/TRNBaseMenuForm.vb (revision 48)
+++ trunk/MLApp.Base/TRNBaseMenuForm.vb (revision 49)
@@ -1,6 +1,6 @@
11 
22 Imports MLApp.DataModel
3-Imports MLApp.DataModel.DataTableExtension
3+Imports MLApp.Const.DataTableExtension
44 Imports ML.Common.Extensions.StringExtension
55
66 ''' <summary>
--- trunk/MLApp.TRN9000/TRN9120.vb (revision 48)
+++ trunk/MLApp.TRN9000/TRN9120.vb (revision 49)
@@ -1,5 +1,5 @@
11 
2-Imports MLApp.DataModel.DataTableExtension
2+Imports MLApp.Const.DataTableExtension
33 Imports ML.Common.Extensions.StringExtension
44 Imports ML.Common.Extensions.DateTimeExtension
55
--- trunk/MLApp.DataModel/Class/DSS_M110_F.vb (revision 48)
+++ trunk/MLApp.DataModel/Class/DSS_M110_F.vb (revision 49)
@@ -1,5 +1,6 @@
11 
22 Imports System.Text
3+Imports MLApp.Const.DataTableExtension
34
45 ''' <summary>
56 ''' 【クラス名】DSS_M110_F
--- trunk/MLApp.DataModel/Class/DSS_M120_F.vb (revision 48)
+++ trunk/MLApp.DataModel/Class/DSS_M120_F.vb (revision 49)
@@ -1,5 +1,6 @@
11 
22 Imports System.Text
3+Imports MLApp.Const.DataTableExtension
34
45 ''' <summary>
56 ''' 【クラス名】DSS_M120_F
--- trunk/MLApp.DataModel/Class/DSS_M130_F.vb (revision 48)
+++ trunk/MLApp.DataModel/Class/DSS_M130_F.vb (revision 49)
@@ -1,5 +1,6 @@
11 
22 Imports System.Text
3+Imports MLApp.Const.DataTableExtension
34
45 ''' <summary>
56 ''' 【クラス名】DSS_M130_F
--- trunk/MLApp.DataModel/Class/DSS_M140_F.vb (revision 48)
+++ trunk/MLApp.DataModel/Class/DSS_M140_F.vb (revision 49)
@@ -1,5 +1,6 @@
11 
22 Imports System.Text
3+Imports MLApp.Const.DataTableExtension
34
45 ''' <summary>
56 ''' 【クラス名】DSS_M140_F
--- trunk/MLApp.DataModel/Class/DSS_M150_F.vb (revision 48)
+++ trunk/MLApp.DataModel/Class/DSS_M150_F.vb (revision 49)
@@ -1,4 +1,6 @@
11 
2+Imports MLApp.Const.DataTableExtension
3+
24 ''' <summary>
35 ''' 【クラス名】DSS_M150_F
46 ''' 【機能概要】データソースSQL取得クラス(M150_F)
--- trunk/MLApp.DataModel/Module/DataTableExtension.vb (revision 48)
+++ trunk/MLApp.DataModel/Module/DataTableExtension.vb (revision 49)
@@ -1,262 +1,262 @@
11 
2-Imports System.Runtime.CompilerServices
3-Imports System.Windows.Forms
2+'Imports System.Runtime.CompilerServices
3+'Imports System.Windows.Forms
44
5-''' <summary>
6-''' 【モジュール名】DataTableExtension
7-''' 【機能概要】DataTable型の拡張メソッド
8-''' </summary>
9-''' <remarks></remarks>
10-''' <history>
11-''' +------------+-----------+-----+-------------------------------------------+
12-''' |更新者 |日付 |連番 |変更内容 |
13-''' +------------+-----------+-----+-------------------------------------------+
14-''' y.miura 2015.01.11 001 新規作成
15-''' y.miura 2016.01.29 002 GetDataメソッドにてFillメソッド実行前にターゲットDataTableをクリアする処理を追加
16-''' </history>
17-Public Module DataTableExtension
5+' ''' <summary>
6+' ''' 【モジュール名】DataTableExtension
7+' ''' 【機能概要】DataTable型の拡張メソッド
8+' ''' </summary>
9+' ''' <remarks></remarks>
10+' ''' <history>
11+' ''' +------------+-----------+-----+-------------------------------------------+
12+' ''' |更新者 |日付 |連番 |変更内容 |
13+' ''' +------------+-----------+-----+-------------------------------------------+
14+' ''' y.miura 2015.01.11 001 新規作成
15+' ''' y.miura 2016.01.29 002 GetDataメソッドにてFillメソッド実行前にターゲットDataTableをクリアする処理を追加
16+' ''' </history>
17+'Public Module DataTableExtension
1818
19- ''' <summary>DataTableから条件に合致する値を抽出する</summary>
20- ''' <param name="dt">対象DataTable</param>
21- ''' <param name="sColumnName">ターゲット列</param>
22- ''' <param name="sWHR">WHERE条件</param>
23- <Extension()> _
24- Public Function DLookUp(ByVal dt As DataTable, _
25- ByVal sColumnName As String, _
26- Optional ByVal sWHR As String = "") As Object
19+' ''' <summary>DataTableから条件に合致する値を抽出する</summary>
20+' ''' <param name="dt">対象DataTable</param>
21+' ''' <param name="sColumnName">ターゲット列</param>
22+' ''' <param name="sWHR">WHERE条件</param>
23+' <Extension()> _
24+' Public Function DLookUp(ByVal dt As DataTable, _
25+' ByVal sColumnName As String, _
26+' Optional ByVal sWHR As String = "") As Object
2727
28- Dim dr() As DataRow
29- Dim oRet As Object = Nothing
28+' Dim dr() As DataRow
29+' Dim oRet As Object = Nothing
3030
31- dr = dt.Select(sWHR)
32- If dr.Length > 0 Then
33- oRet = dr(0).Item(sColumnName)
34- End If
31+' dr = dt.Select(sWHR)
32+' If dr.Length > 0 Then
33+' oRet = dr(0).Item(sColumnName)
34+' End If
3535
36- '' 戻り値を返す
37- Return oRet
36+' '' 戻り値を返す
37+' Return oRet
3838
39- End Function
39+' End Function
4040
41- ''' <summary>DataTableから条件に合致するレコード数を返す</summary>
42- ''' <param name="dt">対象DataTable</param>
43- ''' <param name="sWHR">WHERE条件</param>
44- <Extension()> _
45- Public Function DCount(ByVal dt As DataTable, _
46- Optional ByVal sWHR As String = "") As Integer
41+' ''' <summary>DataTableから条件に合致するレコード数を返す</summary>
42+' ''' <param name="dt">対象DataTable</param>
43+' ''' <param name="sWHR">WHERE条件</param>
44+' <Extension()> _
45+' Public Function DCount(ByVal dt As DataTable, _
46+' Optional ByVal sWHR As String = "") As Integer
4747
48- Dim dr() As DataRow
48+' Dim dr() As DataRow
4949
50- '' DatatableからDataRowを抽出する
51- dr = dt.Select(sWHR)
50+' '' DatatableからDataRowを抽出する
51+' dr = dt.Select(sWHR)
5252
53- '' 戻り値を返す
54- Return dr.Length
53+' '' 戻り値を返す
54+' Return dr.Length
5555
56- End Function
56+' End Function
5757
58- ''' <summary>DataTableから特定列の最大値を取得する</summary>
59- ''' <param name="dt">対象DataTable</param>
60- ''' <param name="sWHR">WHERE条件</param>
61- <Extension()> _
62- Public Function DMax(ByVal dt As DataTable,
63- ByVal sColName As String,
64- Optional ByVal sWHR As String = "") As Object
58+' ''' <summary>DataTableから特定列の最大値を取得する</summary>
59+' ''' <param name="dt">対象DataTable</param>
60+' ''' <param name="sWHR">WHERE条件</param>
61+' <Extension()> _
62+' Public Function DMax(ByVal dt As DataTable,
63+' ByVal sColName As String,
64+' Optional ByVal sWHR As String = "") As Object
6565
66- Dim Ret As Object
66+' Dim Ret As Object
6767
68- '' DatatableからDataRowを抽出する
69- Ret = dt.Compute("MAX(" & sColName & ")", sWHR)
68+' '' DatatableからDataRowを抽出する
69+' Ret = dt.Compute("MAX(" & sColName & ")", sWHR)
7070
71- '' 戻り値を返す
72- Return Ret
71+' '' 戻り値を返す
72+' Return Ret
7373
74- End Function
74+' End Function
7575
76- ''' <summary>DataTableから特定列の最小値を取得する</summary>
77- ''' <param name="dt">対象DataTable</param>
78- ''' <param name="sWHR">WHERE条件</param>
79- <Extension()> _
80- Public Function DMin(ByVal dt As DataTable,
81- ByVal sColName As String,
82- Optional ByVal sWHR As String = "") As Object
76+' ''' <summary>DataTableから特定列の最小値を取得する</summary>
77+' ''' <param name="dt">対象DataTable</param>
78+' ''' <param name="sWHR">WHERE条件</param>
79+' <Extension()> _
80+' Public Function DMin(ByVal dt As DataTable,
81+' ByVal sColName As String,
82+' Optional ByVal sWHR As String = "") As Object
8383
84- Dim Ret As Object
84+' Dim Ret As Object
8585
86- '' DatatableからDataRowを抽出する
87- Ret = dt.Compute("MIN(" & sColName & ")", sWHR)
86+' '' DatatableからDataRowを抽出する
87+' Ret = dt.Compute("MIN(" & sColName & ")", sWHR)
8888
89- '' 戻り値を返す
90- Return Ret
89+' '' 戻り値を返す
90+' Return Ret
9191
92- End Function
92+' End Function
9393
94- ''' <summary>DataTableから特定列の合計値を取得する</summary>
95- ''' <param name="dt">対象DataTable</param>
96- ''' <param name="sWHR">WHERE条件</param>
97- <Extension()> _
98- Public Function DSum(ByVal dt As DataTable,
99- ByVal sColName As String,
100- Optional ByVal sWHR As String = "") As Object
94+' ''' <summary>DataTableから特定列の合計値を取得する</summary>
95+' ''' <param name="dt">対象DataTable</param>
96+' ''' <param name="sWHR">WHERE条件</param>
97+' <Extension()> _
98+' Public Function DSum(ByVal dt As DataTable,
99+' ByVal sColName As String,
100+' Optional ByVal sWHR As String = "") As Object
101101
102- Dim Ret As Object
102+' Dim Ret As Object
103103
104- '' DatatableからDataRowを抽出する
105- Ret = dt.Compute("SUM(" & sColName & ")", sWHR)
104+' '' DatatableからDataRowを抽出する
105+' Ret = dt.Compute("SUM(" & sColName & ")", sWHR)
106106
107- '' 戻り値を返す
108- Return Ret
107+' '' 戻り値を返す
108+' Return Ret
109109
110- End Function
110+' End Function
111111
112- ''' <summary>対象テーブルの全レコードをDataTableとして取得する</summary>
113- ''' <param name="dt">対象DataTable</param>
114- <Extension()> _
115- Public Function GetData(ByVal dt As DataTable) As DataTable
116- Return GetData(dt, "", "")
117- End Function
112+' ''' <summary>対象テーブルの全レコードをDataTableとして取得する</summary>
113+' ''' <param name="dt">対象DataTable</param>
114+' <Extension()> _
115+' Public Function GetData(ByVal dt As DataTable) As DataTable
116+' Return GetData(dt, "", "")
117+' End Function
118118
119- ' ''' <summary>対象テーブルの全レコードをDataTableとして取得する</summary>
120- ' ''' <param name="dt">対象DataTable</param>
121- ' ''' <param name="sWHR">抽出条件</param>
122- ' ''' <param name="sSORT">ソートキー</param>
123- '<Extension()> _
124- 'Public Function GetData(ByVal dt As DataTable, _
125- ' ByVal sWHR As String, _
126- ' ByVal sSORT As String) As DataTable
119+' ' ''' <summary>対象テーブルの全レコードをDataTableとして取得する</summary>
120+' ' ''' <param name="dt">対象DataTable</param>
121+' ' ''' <param name="sWHR">抽出条件</param>
122+' ' ''' <param name="sSORT">ソートキー</param>
123+' '<Extension()> _
124+' 'Public Function GetData(ByVal dt As DataTable, _
125+' ' ByVal sWHR As String, _
126+' ' ByVal sSORT As String) As DataTable
127127
128- ' Dim sClassName As String = Mid(dt.GetType.ToString, 1, InStr(1, dt.GetType.ToString, "+") - 1)
129- ' Dim invM As New ML.Common.Function.Invm("MLApp.DataModel", _
130- ' Application.StartupPath, _
131- ' ML.Common.Const.Ext.DLLFILE_EXT, _
132- ' sClassName & "TableAdapters" & "." & dt.TableName & "TableAdapter")
133- ' Try
134- ' '' TableAdapterインスタンスを作成する
135- ' invM.CreateInstance()
136- ' Dim dtR As DataTable = invM.RunMethod("GetData")
137- ' Dim drR() As DataRow = dtR.Select(sWHR, sSORT)
138- ' Dim dtRet As New DataTable
139- ' dt.Rows.Clear()
140- ' For Each dr As DataRow In drR
141- ' dt.ImportRow(dr)
142- ' Next
128+' ' Dim sClassName As String = Mid(dt.GetType.ToString, 1, InStr(1, dt.GetType.ToString, "+") - 1)
129+' ' Dim invM As New ML.Common.Function.Invm("MLApp.DataModel", _
130+' ' Application.StartupPath, _
131+' ' ML.Common.Const.Ext.DLLFILE_EXT, _
132+' ' sClassName & "TableAdapters" & "." & dt.TableName & "TableAdapter")
133+' ' Try
134+' ' '' TableAdapterインスタンスを作成する
135+' ' invM.CreateInstance()
136+' ' Dim dtR As DataTable = invM.RunMethod("GetData")
137+' ' Dim drR() As DataRow = dtR.Select(sWHR, sSORT)
138+' ' Dim dtRet As New DataTable
139+' ' dt.Rows.Clear()
140+' ' For Each dr As DataRow In drR
141+' ' dt.ImportRow(dr)
142+' ' Next
143143
144- ' Catch ex As Exception
144+' ' Catch ex As Exception
145145
146- ' Throw ex
146+' ' Throw ex
147147
148- ' End Try
148+' ' End Try
149149
150- ' Return dt
151- 'End Function
150+' ' Return dt
151+' 'End Function
152152
153- ''' <summary>対象テーブルの全レコードをDataTableとして取得する</summary>
154- ''' <param name="dt">対象DataTable</param>
155- ''' <param name="sWHR">抽出条件</param>
156- ''' <param name="sSORT">ソートキー</param>
157- <Extension()> _
158- Public Function GetData(ByVal dt As DataTable, _
159- ByVal sWHR As String, _
160- Optional ByVal sSORT As String = "") As DataTable
161- Dim dbCon As ML.DBAccess.Base.Db5
162- Dim sSQL As String
153+' ''' <summary>対象テーブルの全レコードをDataTableとして取得する</summary>
154+' ''' <param name="dt">対象DataTable</param>
155+' ''' <param name="sWHR">抽出条件</param>
156+' ''' <param name="sSORT">ソートキー</param>
157+' <Extension()> _
158+' Public Function GetData(ByVal dt As DataTable, _
159+' ByVal sWHR As String, _
160+' Optional ByVal sSORT As String = "") As DataTable
161+' Dim dbCon As ML.DBAccess.Base.Db5
162+' Dim sSQL As String
163163
164- '' DB-Open
165- dbCon = ML.DBAccess.Base.Db5.CurrentDb
166- dbCon.Open()
164+' '' DB-Open
165+' dbCon = ML.DBAccess.Base.Db5.CurrentDb
166+' dbCon.Open()
167167
168- '' SELECT
169- sSQL = "SELECT * FROM " & dt.TableName
168+' '' SELECT
169+' sSQL = "SELECT * FROM " & dt.TableName
170170
171- '' WHERE
172- sSQL &= " WHERE 1=1"
173- If sWHR <> String.Empty Then
174- sSQL &= " AND "
175- sSQL &= sWHR
176- End If
171+' '' WHERE
172+' sSQL &= " WHERE 1=1"
173+' If sWHR <> String.Empty Then
174+' sSQL &= " AND "
175+' sSQL &= sWHR
176+' End If
177177
178- '' ORDER BY
179- If sSORT <> String.Empty Then
180- sSQL &= " ORDER BY " & sSORT
181- End If
178+' '' ORDER BY
179+' If sSORT <> String.Empty Then
180+' sSQL &= " ORDER BY " & sSORT
181+' End If
182182
183- '' ターゲットDataTableを一旦クリア
184- ' ADD 002 y.miura 16.01.29 >>
185- dt.Rows.Clear()
186- ' ADD 002 y.miura 16.01.29 <<
183+' '' ターゲットDataTableを一旦クリア
184+' ' ADD 002 y.miura 16.01.29 >>
185+' dt.Rows.Clear()
186+' ' ADD 002 y.miura 16.01.29 <<
187187
188- '' Fillメソッドを実行
189- dbCon.Fill(dt, sSQL)
188+' '' Fillメソッドを実行
189+' dbCon.Fill(dt, sSQL)
190190
191- '' DB-Close
192- dbCon.Close()
191+' '' DB-Close
192+' dbCon.Close()
193193
194- '' 戻り値を返す
195- Return dt
196- End Function
194+' '' 戻り値を返す
195+' Return dt
196+' End Function
197197
198- ''' <summary>テーブルのコピーを作成する</summary>
199- ''' <param name="dt">対象DataTable</param>
200- ''' <param name="sDestTable">コピー先テーブル名</param>
201- ''' <param name="bRecordInclud">レコードをコピー対象とするか</param>
202- <Extension()> _
203- Public Sub CopyTable(ByVal dt As DataTable, _
204- ByVal sDestTable As String, _
205- Optional ByVal bRecordInclud As Boolean = False)
206- Dim dbCon As ML.DBAccess.Base.Db5
207- Dim sSQL As String
198+' ''' <summary>テーブルのコピーを作成する</summary>
199+' ''' <param name="dt">対象DataTable</param>
200+' ''' <param name="sDestTable">コピー先テーブル名</param>
201+' ''' <param name="bRecordInclud">レコードをコピー対象とするか</param>
202+' <Extension()> _
203+' Public Sub CopyTable(ByVal dt As DataTable, _
204+' ByVal sDestTable As String, _
205+' Optional ByVal bRecordInclud As Boolean = False)
206+' Dim dbCon As ML.DBAccess.Base.Db5
207+' Dim sSQL As String
208208
209- '' DB-Open
210- dbCon = ML.DBAccess.Base.Db5.CurrentDb
211- dbCon.Open()
209+' '' DB-Open
210+' dbCon = ML.DBAccess.Base.Db5.CurrentDb
211+' dbCon.Open()
212212
213- Try
214- '' コピー元テーブルが存在しない場合は処理を抜ける
215- If dbCon.ExistTable(dt.TableName) = False Then
216- Exit Sub
217- End If
213+' Try
214+' '' コピー元テーブルが存在しない場合は処理を抜ける
215+' If dbCon.ExistTable(dt.TableName) = False Then
216+' Exit Sub
217+' End If
218218
219- '' コピー先テーブルが存在する場合は削除する
220- If dbCon.ExistTable(sDestTable) = True Then
219+' '' コピー先テーブルが存在する場合は削除する
220+' If dbCon.ExistTable(sDestTable) = True Then
221221
222- sSQL = ""
223- sSQL = "DROP TABLE " & sDestTable
224- dbCon.Execute(sSQL)
222+' sSQL = ""
223+' sSQL = "DROP TABLE " & sDestTable
224+' dbCon.Execute(sSQL)
225225
226- End If
226+' End If
227227
228- '' テーブルをコピーする
229- sSQL = ""
230- sSQL = "SELECT * INTO " & sDestTable & " FROM " & dt.TableName
231- If bRecordInclud = False Then
232- sSQL &= " WHERE 1=0"
233- End If
234- dbCon.Execute(sSQL)
228+' '' テーブルをコピーする
229+' sSQL = ""
230+' sSQL = "SELECT * INTO " & sDestTable & " FROM " & dt.TableName
231+' If bRecordInclud = False Then
232+' sSQL &= " WHERE 1=0"
233+' End If
234+' dbCon.Execute(sSQL)
235235
236- '' コピー元テーブルの主キーを取得する
237- Dim dcPKey() As DataColumn = dt.PrimaryKey
238- Dim sPKeyArray As New List(Of String)
239- For Each dc As DataColumn In dcPKey
240- sPKeyArray.Add(dc.ColumnName)
241- Next
242- Dim sPKey As String = String.Join(ML.Common.Const.Fmt.fmtComma, sPKeyArray.ToArray)
236+' '' コピー元テーブルの主キーを取得する
237+' Dim dcPKey() As DataColumn = dt.PrimaryKey
238+' Dim sPKeyArray As New List(Of String)
239+' For Each dc As DataColumn In dcPKey
240+' sPKeyArray.Add(dc.ColumnName)
241+' Next
242+' Dim sPKey As String = String.Join(ML.Common.Const.Fmt.fmtComma, sPKeyArray.ToArray)
243243
244- '' コピー先テーブルの主キーを作成する
245- sSQL = ""
246- sSQL = "ALTER TABLE " & sDestTable & " ADD PRIMARY KEY (" & sPKey & ")"
247- dbCon.Execute(sSQL)
244+' '' コピー先テーブルの主キーを作成する
245+' sSQL = ""
246+' sSQL = "ALTER TABLE " & sDestTable & " ADD PRIMARY KEY (" & sPKey & ")"
247+' dbCon.Execute(sSQL)
248248
249- Catch ex As Exception
249+' Catch ex As Exception
250250
251- Throw ex
251+' Throw ex
252252
253- Finally
253+' Finally
254254
255- '' DB-Close
256- dbCon.Close()
255+' '' DB-Close
256+' dbCon.Close()
257257
258- End Try
258+' End Try
259259
260- End Sub
260+' End Sub
261261
262-End Module
262+'End Module
--- trunk/MLApp.TRNLib/Class/LogOnInfo.vb (revision 48)
+++ trunk/MLApp.TRNLib/Class/LogOnInfo.vb (revision 49)
@@ -1,6 +1,6 @@
11 
2+Imports MLApp.Const.DataTableExtension
23 Imports ML.Common.Extensions.StringExtension
3-Imports MLApp.DataModel.DataTableExtension
44
55 ''' <summary>
66 ''' 【クラス名】LoginInfo
--- trunk/MLApp.TRNLib/Class/ExlAppReportBase.vb (revision 48)
+++ trunk/MLApp.TRNLib/Class/ExlAppReportBase.vb (revision 49)
@@ -1,6 +1,6 @@
11 
22 Imports MLApp.Const
3-Imports MLApp.DataModel.DataTableExtension
3+Imports MLApp.Const.DataTableExtension
44
55 ''' <summary>
66 ''' 【クラス名】ExlAppReportBase
--- trunk/MLApp.TRNLib/Class/dba/Trigger.vb (revision 48)
+++ trunk/MLApp.TRNLib/Class/dba/Trigger.vb (revision 49)
@@ -1,6 +1,6 @@
11 
2+Imports MLApp.Const.DataTableExtension
23 Imports ML.Common.Extensions.StringExtension
3-Imports MLApp.DataModel.DataTableExtension
44
55 ''' <summary>
66 ''' 【クラス名】Trigger
--- trunk/MLApp.TRN0000/TRN0000.Designer.vb (revision 48)
+++ trunk/MLApp.TRN0000/TRN0000.Designer.vb (revision 49)
@@ -27,8 +27,7 @@
2727 Me.tslCaption = New System.Windows.Forms.ToolStripStatusLabel()
2828 Me.MenuStrip1 = New System.Windows.Forms.MenuStrip()
2929 Me.デバッグToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
30- Me.ToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
31- Me.ToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem()
30+ Me.tsmDebug = New System.Windows.Forms.ToolStripMenuItem()
3231 Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
3332 Me.tsmiAppQuit = New System.Windows.Forms.ToolStripMenuItem()
3433 Me.ツールTToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
@@ -37,12 +36,14 @@
3736 Me.tsmiProgramMaster = New System.Windows.Forms.ToolStripMenuItem()
3837 Me.tsmiAuthorityMaster = New System.Windows.Forms.ToolStripMenuItem()
3938 Me.tsmiAuthorityDiffProgramMaster = New System.Windows.Forms.ToolStripMenuItem()
39+ Me.tsmiKubunCategoryMaster = New System.Windows.Forms.ToolStripMenuItem()
40+ Me.tsmiKubunGroupMaster = New System.Windows.Forms.ToolStripMenuItem()
41+ Me.tsmiKubunMaster = New System.Windows.Forms.ToolStripMenuItem()
4042 Me.ToolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator()
4143 Me.tsmiOpenLogFilePlace = New System.Windows.Forms.ToolStripMenuItem()
4244 Me.tsmiOpenExcelFilePlace = New System.Windows.Forms.ToolStripMenuItem()
4345 Me.ToolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator()
4446 Me.tsmiOption = New System.Windows.Forms.ToolStripMenuItem()
45- Me.tsmiKubunCategoryMaster = New System.Windows.Forms.ToolStripMenuItem()
4647 Me.StatusStrip.SuspendLayout()
4748 Me.MenuStrip1.SuspendLayout()
4849 Me.SuspendLayout()
@@ -86,38 +87,33 @@
8687 Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.デバッグToolStripMenuItem, Me.ツールTToolStripMenuItem})
8788 Me.MenuStrip1.Location = New System.Drawing.Point(0, 0)
8889 Me.MenuStrip1.Name = "MenuStrip1"
89- Me.MenuStrip1.Size = New System.Drawing.Size(914, 26)
90+ Me.MenuStrip1.Size = New System.Drawing.Size(914, 24)
9091 Me.MenuStrip1.TabIndex = 3
9192 Me.MenuStrip1.Text = "MenuStrip1"
9293 '
9394 'デバッグToolStripMenuItem
9495 '
95- Me.デバッグToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripMenuItem1, Me.ToolStripMenuItem2, Me.ToolStripSeparator1, Me.tsmiAppQuit})
96+ Me.デバッグToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tsmDebug, Me.ToolStripSeparator1, Me.tsmiAppQuit})
9697 Me.デバッグToolStripMenuItem.Name = "デバッグToolStripMenuItem"
97- Me.デバッグToolStripMenuItem.Size = New System.Drawing.Size(87, 22)
98- Me.デバッグToolStripMenuItem.Text = "デバッグ(&D)"
98+ Me.デバッグToolStripMenuItem.Size = New System.Drawing.Size(66, 20)
99+ Me.デバッグToolStripMenuItem.Text = "ファイル(&F)"
99100 '
100- 'ToolStripMenuItem1
101+ 'tsmDebug
101102 '
102- Me.ToolStripMenuItem1.Name = "ToolStripMenuItem1"
103- Me.ToolStripMenuItem1.Size = New System.Drawing.Size(250, 22)
104- Me.ToolStripMenuItem1.Text = "Form1"
103+ Me.tsmDebug.Name = "tsmDebug"
104+ Me.tsmDebug.Size = New System.Drawing.Size(210, 22)
105+ Me.tsmDebug.Text = "デバッグ用フォーム"
106+ Me.tsmDebug.Visible = False
105107 '
106- 'ToolStripMenuItem2
107- '
108- Me.ToolStripMenuItem2.Name = "ToolStripMenuItem2"
109- Me.ToolStripMenuItem2.Size = New System.Drawing.Size(250, 22)
110- Me.ToolStripMenuItem2.Text = "Form2"
111- '
112108 'ToolStripSeparator1
113109 '
114110 Me.ToolStripSeparator1.Name = "ToolStripSeparator1"
115- Me.ToolStripSeparator1.Size = New System.Drawing.Size(247, 6)
111+ Me.ToolStripSeparator1.Size = New System.Drawing.Size(207, 6)
116112 '
117113 'tsmiAppQuit
118114 '
119115 Me.tsmiAppQuit.Name = "tsmiAppQuit"
120- Me.tsmiAppQuit.Size = New System.Drawing.Size(250, 22)
116+ Me.tsmiAppQuit.Size = New System.Drawing.Size(210, 22)
121117 Me.tsmiAppQuit.Text = "アプリケーションを終了する(&X)"
122118 '
123119 'ツールTToolStripMenuItem
@@ -124,74 +120,86 @@
124120 '
125121 Me.ツールTToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tsmiAuth, Me.ToolStripSeparator3, Me.tsmiOpenLogFilePlace, Me.tsmiOpenExcelFilePlace, Me.ToolStripSeparator2, Me.tsmiOption})
126122 Me.ツールTToolStripMenuItem.Name = "ツールTToolStripMenuItem"
127- Me.ツールTToolStripMenuItem.Size = New System.Drawing.Size(74, 22)
123+ Me.ツールTToolStripMenuItem.Size = New System.Drawing.Size(60, 20)
128124 Me.ツールTToolStripMenuItem.Text = "ツール(&T)"
129125 '
130126 'tsmiAuth
131127 '
132- Me.tsmiAuth.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tsmiSubSystemMaster, Me.tsmiProgramMaster, Me.tsmiAuthorityMaster, Me.tsmiAuthorityDiffProgramMaster, Me.tsmiKubunCategoryMaster})
128+ Me.tsmiAuth.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tsmiSubSystemMaster, Me.tsmiProgramMaster, Me.tsmiAuthorityMaster, Me.tsmiAuthorityDiffProgramMaster, Me.tsmiKubunCategoryMaster, Me.tsmiKubunGroupMaster, Me.tsmiKubunMaster})
133129 Me.tsmiAuth.Name = "tsmiAuth"
134- Me.tsmiAuth.Size = New System.Drawing.Size(226, 22)
130+ Me.tsmiAuth.Size = New System.Drawing.Size(198, 22)
135131 Me.tsmiAuth.Text = "権限設定"
136132 '
137133 'tsmiSubSystemMaster
138134 '
139135 Me.tsmiSubSystemMaster.Name = "tsmiSubSystemMaster"
140- Me.tsmiSubSystemMaster.Size = New System.Drawing.Size(208, 22)
136+ Me.tsmiSubSystemMaster.Size = New System.Drawing.Size(180, 22)
141137 Me.tsmiSubSystemMaster.Text = "サブシステムマスタ"
142138 '
143139 'tsmiProgramMaster
144140 '
145141 Me.tsmiProgramMaster.Name = "tsmiProgramMaster"
146- Me.tsmiProgramMaster.Size = New System.Drawing.Size(208, 22)
142+ Me.tsmiProgramMaster.Size = New System.Drawing.Size(180, 22)
147143 Me.tsmiProgramMaster.Text = "プログラムマスタ"
148144 '
149145 'tsmiAuthorityMaster
150146 '
151147 Me.tsmiAuthorityMaster.Name = "tsmiAuthorityMaster"
152- Me.tsmiAuthorityMaster.Size = New System.Drawing.Size(208, 22)
148+ Me.tsmiAuthorityMaster.Size = New System.Drawing.Size(180, 22)
153149 Me.tsmiAuthorityMaster.Text = "権限マスタ"
154150 '
155151 'tsmiAuthorityDiffProgramMaster
156152 '
157153 Me.tsmiAuthorityDiffProgramMaster.Name = "tsmiAuthorityDiffProgramMaster"
158- Me.tsmiAuthorityDiffProgramMaster.Size = New System.Drawing.Size(208, 22)
154+ Me.tsmiAuthorityDiffProgramMaster.Size = New System.Drawing.Size(180, 22)
159155 Me.tsmiAuthorityDiffProgramMaster.Text = "権限別プログラムマスタ"
160156 '
157+ 'tsmiKubunCategoryMaster
158+ '
159+ Me.tsmiKubunCategoryMaster.Name = "tsmiKubunCategoryMaster"
160+ Me.tsmiKubunCategoryMaster.Size = New System.Drawing.Size(180, 22)
161+ Me.tsmiKubunCategoryMaster.Text = "区分カテゴリマスタ"
162+ '
163+ 'tsmiKubunGroupMaster
164+ '
165+ Me.tsmiKubunGroupMaster.Name = "tsmiKubunGroupMaster"
166+ Me.tsmiKubunGroupMaster.Size = New System.Drawing.Size(180, 22)
167+ Me.tsmiKubunGroupMaster.Text = "区分グループマスタ"
168+ '
169+ 'tsmiKubunMaster
170+ '
171+ Me.tsmiKubunMaster.Name = "tsmiKubunMaster"
172+ Me.tsmiKubunMaster.Size = New System.Drawing.Size(180, 22)
173+ Me.tsmiKubunMaster.Text = "区分マスタ"
174+ '
161175 'ToolStripSeparator3
162176 '
163177 Me.ToolStripSeparator3.Name = "ToolStripSeparator3"
164- Me.ToolStripSeparator3.Size = New System.Drawing.Size(223, 6)
178+ Me.ToolStripSeparator3.Size = New System.Drawing.Size(195, 6)
165179 '
166180 'tsmiOpenLogFilePlace
167181 '
168182 Me.tsmiOpenLogFilePlace.Name = "tsmiOpenLogFilePlace"
169- Me.tsmiOpenLogFilePlace.Size = New System.Drawing.Size(226, 22)
183+ Me.tsmiOpenLogFilePlace.Size = New System.Drawing.Size(198, 22)
170184 Me.tsmiOpenLogFilePlace.Text = "ログファイルの場所を開く"
171185 '
172186 'tsmiOpenExcelFilePlace
173187 '
174188 Me.tsmiOpenExcelFilePlace.Name = "tsmiOpenExcelFilePlace"
175- Me.tsmiOpenExcelFilePlace.Size = New System.Drawing.Size(226, 22)
189+ Me.tsmiOpenExcelFilePlace.Size = New System.Drawing.Size(198, 22)
176190 Me.tsmiOpenExcelFilePlace.Text = "Excelファイル出力先を開く"
177191 '
178192 'ToolStripSeparator2
179193 '
180194 Me.ToolStripSeparator2.Name = "ToolStripSeparator2"
181- Me.ToolStripSeparator2.Size = New System.Drawing.Size(223, 6)
195+ Me.ToolStripSeparator2.Size = New System.Drawing.Size(195, 6)
182196 '
183197 'tsmiOption
184198 '
185199 Me.tsmiOption.Name = "tsmiOption"
186- Me.tsmiOption.Size = New System.Drawing.Size(226, 22)
200+ Me.tsmiOption.Size = New System.Drawing.Size(198, 22)
187201 Me.tsmiOption.Text = "オプション"
188202 '
189- 'tsmiKubunCategoryMaster
190- '
191- Me.tsmiKubunCategoryMaster.Name = "tsmiKubunCategoryMaster"
192- Me.tsmiKubunCategoryMaster.Size = New System.Drawing.Size(208, 22)
193- Me.tsmiKubunCategoryMaster.Text = "区分カテゴリマスタ"
194- '
195203 'TRN0000
196204 '
197205 Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
@@ -219,8 +227,7 @@
219227 Friend WithEvents tslCaption As System.Windows.Forms.ToolStripStatusLabel
220228 Friend WithEvents MenuStrip1 As System.Windows.Forms.MenuStrip
221229 Friend WithEvents デバッグToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
222- Friend WithEvents ToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
223- Friend WithEvents ToolStripMenuItem2 As System.Windows.Forms.ToolStripMenuItem
230+ Friend WithEvents tsmDebug As System.Windows.Forms.ToolStripMenuItem
224231 Friend WithEvents ツールTToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
225232 Friend WithEvents tsmiOpenLogFilePlace As System.Windows.Forms.ToolStripMenuItem
226233 Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator
@@ -235,4 +242,6 @@
235242 Friend WithEvents tsmiAuthorityMaster As System.Windows.Forms.ToolStripMenuItem
236243 Friend WithEvents tsmiAuthorityDiffProgramMaster As System.Windows.Forms.ToolStripMenuItem
237244 Friend WithEvents tsmiKubunCategoryMaster As System.Windows.Forms.ToolStripMenuItem
245+ Friend WithEvents tsmiKubunGroupMaster As System.Windows.Forms.ToolStripMenuItem
246+ Friend WithEvents tsmiKubunMaster As System.Windows.Forms.ToolStripMenuItem
238247 End Class
--- trunk/MLApp.TRN0000/TRN0000.vb (revision 48)
+++ trunk/MLApp.TRN0000/TRN0000.vb (revision 49)
@@ -1,5 +1,6 @@
11 
22 Imports ML.Common.Extensions
3+Imports ML.Common.Message.Resource
34
45 ''' <summary>
56 ''' 【クラス名】TRN0000
@@ -44,10 +45,20 @@
4445 '' タイトルバー
4546 Me.Text = My.Application.Info.Title
4647
48+#If debug Then
49+
50+ '' タイトルバーをデバッグモード表示とする
51+ Me.Text = My.Application.Info.Title & " (デバッグモード)"
52+
53+ '' デバッグ用フォームコンテキストメニューを可視化する
54+ Me.tsmDebug.Visible = True
55+
56+#End If
57+
4758 End Sub
4859
4960 ''' <summary>フォーム1表示</summary>
50- Private Sub ToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem1.Click
61+ Private Sub tsmDebug_Click(sender As System.Object, e As System.EventArgs) Handles tsmDebug.Click
5162 Dim f As New Form1
5263 f.MdiParent = Me
5364 f.Show()
@@ -144,9 +155,27 @@
144155 Private Sub tsmiKubunCategoryMaster_Click(sender As System.Object, e As System.EventArgs) Handles tsmiKubunCategoryMaster.Click
145156
146157 '' 区分カテゴリマスタ画面を開く
147- Dim frmTRN8934 As New TRN8000.TRN8921
148- frmTRN8934.ShowDialog()
158+ Dim frmTRN8921 As New TRN8000.TRN8921
159+ frmTRN8921.ShowDialog()
149160
150161 End Sub
151162
163+ ''' <summary>区分グループマスタクリック時イベント</summary>
164+ Private Sub tsmiKubunGroupMaster_Click(sender As System.Object, e As System.EventArgs) Handles tsmiKubunGroupMaster.Click
165+
166+ '' 区分グループマスタ画面を開く
167+ Dim frmTRN8910 As New TRN8000.TRN8910
168+ frmTRN8910.ShowDialog()
169+
170+ End Sub
171+
172+ ''' <summary>区分マスタクリック時イベント</summary>
173+ Private Sub tsmiKubunMaster_Click(sender As System.Object, e As System.EventArgs) Handles tsmiKubunMaster.Click
174+
175+ '' 区分マスタ画面を開く
176+ Dim frmTRN8920 As New TRN8000.TRN8920
177+ frmTRN8920.ShowDialog()
178+
179+ End Sub
180+
152181 End Class
\ No newline at end of file
--- trunk/MLApp.TRN0000/TRN0010.vb (revision 48)
+++ trunk/MLApp.TRN0000/TRN0010.vb (revision 49)
@@ -1,5 +1,5 @@
11 
2-Imports MLApp.DataModel.DataTableExtension
2+Imports MLApp.Const.DataTableExtension
33 Imports ML.Common.Extensions.StringExtension
44
55 ''' <summary>
@@ -22,7 +22,7 @@
2222 Protected m_dtM120F As New MLApp.DataModel.M1_TRNDataSet.M120_FDataTable
2323
2424 ''' <summary>ログイン情報クラス</summary>
25- Protected m_logInInfo As New MLApp.TRNLib.LoginInfo
25+ Protected m_logInInfo As MLApp.TRNLib.LoginInfo
2626
2727 ''' <summary>フォームロード時</summary>
2828 Protected Overridable Sub TRN0010_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
@@ -30,6 +30,9 @@
3030 '' デザインモード時は処理を抜ける
3131 If Me.DesignMode = True Then Exit Sub
3232
33+ '' ログイン情報クラスインスタンス生成
34+ Me.m_logInInfo = New MLApp.TRNLib.LoginInfo
35+
3336 '' DBタイプを取得する
3437 Dim gdt As New ML.DBAccess.GetDbType
3538 gdt.SettingDbAccessConfig()
--- trunk/MLApp.TRN0000/TRN0020.vb (revision 48)
+++ trunk/MLApp.TRN0000/TRN0020.vb (revision 49)
@@ -1,6 +1,6 @@
11 
22 Imports MLApp.DataModel
3-Imports MLApp.DataModel.DataTableExtension
3+Imports MLApp.Const.DataTableExtension
44 Imports ML.Common.Extensions.StringExtension
55
66 ''' <summary>
--- trunk/MLApp.TRN0000/Form1.vb (revision 48)
+++ trunk/MLApp.TRN0000/Form1.vb (revision 49)
@@ -1,5 +1,5 @@
11 
2-Imports MLApp.DataModel.DataTableExtension
2+Imports MLApp.Const.DataTableExtension
33
44 Public Class Form1
55
--- trunk/MLApp.TRN8000/TRN8110.vb (revision 48)
+++ trunk/MLApp.TRN8000/TRN8110.vb (revision 49)
@@ -1,5 +1,5 @@
11 
2-Imports MLApp.DataModel.DataTableExtension
2+Imports MLApp.Const.DataTableExtension
33 Imports ML.Common.Extensions.StringExtension
44
55 ''' <summary>
--- trunk/MLApp.TRN8000/TRN8910.vb (revision 48)
+++ trunk/MLApp.TRN8000/TRN8910.vb (revision 49)
@@ -1,5 +1,5 @@
11 
2-Imports MLApp.DataModel.DataTableExtension
2+Imports MLApp.Const.DataTableExtension
33 Imports ML.Common.Extensions.StringExtension
44
55 ''' <summary>
--- trunk/MLApp.TRN8000/TRN8920.designer.vb (revision 48)
+++ trunk/MLApp.TRN8000/TRN8920.designer.vb (revision 49)
@@ -388,7 +388,7 @@
388388 Me.Controls.Add(Me.lblDispMode)
389389 Me.Controls.Add(Me.dgvTRN8920S1)
390390 Me.Name = "TRN8920"
391- Me.Text = "AMK8920"
391+ Me.Text = "区分マスタ"
392392 Me.Controls.SetChildIndex(Me.MenuBtnPanel, 0)
393393 Me.Controls.SetChildIndex(Me.dgvTRN8920S1, 0)
394394 Me.Controls.SetChildIndex(Me.lblDispMode, 0)
--- trunk/MLApp.TRN8000/TRN8920.vb (revision 48)
+++ trunk/MLApp.TRN8000/TRN8920.vb (revision 49)
@@ -1,5 +1,5 @@
11 
2-Imports MLApp.DataModel.DataTableExtension
2+Imports MLApp.Const.DataTableExtension
33 Imports ML.Common.Extensions.StringExtension
44
55 ''' <summary>
--- trunk/MLApp.TRN8000/TRN8930.vb (revision 48)
+++ trunk/MLApp.TRN8000/TRN8930.vb (revision 49)
@@ -1,5 +1,5 @@
11 
2-Imports MLApp.DataModel.DataTableExtension
2+Imports MLApp.Const.DataTableExtension
33 Imports ML.Common.Extensions.StringExtension
44
55 ''' <summary>
--- trunk/MLApp.TRN8000/TRN8932.vb (revision 48)
+++ trunk/MLApp.TRN8000/TRN8932.vb (revision 49)
@@ -1,5 +1,5 @@
11 
2-Imports MLApp.DataModel.DataTableExtension
2+Imports MLApp.Const.DataTableExtension
33 Imports ML.Common.Extensions.StringExtension
44
55 ''' <summary>
--- trunk/MLApp.TRN8000/TRN8210.vb (revision 48)
+++ trunk/MLApp.TRN8000/TRN8210.vb (revision 49)
@@ -1,5 +1,5 @@
11 
2-Imports MLApp.DataModel.DataTableExtension
2+Imports MLApp.Const.DataTableExtension
33 Imports ML.Common.Extensions.StringExtension
44
55 ''' <summary>
@@ -29,7 +29,7 @@
2929 #Region " イベント"
3030
3131 ''' <summary>フォームロード時イベント</summary>
32- Private Sub AMK8210_Load(sender As Object, e As System.EventArgs) Handles Me.Load
32+ Private Sub TRN8210_Load(sender As Object, e As System.EventArgs) Handles Me.Load
3333
3434 '' 元に戻すボタン押下処理
3535 Me.CancelProc()
@@ -40,7 +40,7 @@
4040 End Sub
4141
4242 ''' <summary>フォーム表示時イベント</summary>
43- Private Sub AMK8210_Shown(sender As Object, e As System.EventArgs) Handles Me.Shown
43+ Private Sub TRN8210_Shown(sender As Object, e As System.EventArgs) Handles Me.Shown
4444
4545 '' 初期フォーカスのセット
4646 Me.txtFurigana.Focus()
--- trunk/MLApp.TRN8000/TRN8220.vb (revision 48)
+++ trunk/MLApp.TRN8000/TRN8220.vb (revision 49)
@@ -1,5 +1,5 @@
11 
2-Imports MLApp.DataModel.DataTableExtension
2+Imports MLApp.Const.DataTableExtension
33 Imports ML.Common.Extensions.StringExtension
44
55 ''' <summary>
--- trunk/MLApp.TRN8000/TRN8910.designer.vb (revision 48)
+++ trunk/MLApp.TRN8000/TRN8910.designer.vb (revision 49)
@@ -614,7 +614,7 @@
614614 Me.Controls.Add(Me.Uc6GroupBox1)
615615 Me.Controls.Add(Me.dgvTRN8910S1)
616616 Me.Name = "TRN8910"
617- Me.Text = "TRN8910"
617+ Me.Text = "区分グループマスタ"
618618 Me.Controls.SetChildIndex(Me.MenuBtnPanel, 0)
619619 Me.Controls.SetChildIndex(Me.dgvTRN8910S1, 0)
620620 Me.Controls.SetChildIndex(Me.Uc6GroupBox1, 0)
--- trunk/MLApp.TRN8000/TRN8921.vb (revision 48)
+++ trunk/MLApp.TRN8000/TRN8921.vb (revision 49)
@@ -1,5 +1,5 @@
11 
2-Imports MLApp.DataModel.DataTableExtension
2+Imports MLApp.Const.DataTableExtension
33 Imports ML.Common.Extensions.StringExtension
44
55 ''' <summary>
--- trunk/MLApp.TRN8000/TRN8931.vb (revision 48)
+++ trunk/MLApp.TRN8000/TRN8931.vb (revision 49)
@@ -1,5 +1,5 @@
11 
2-Imports MLApp.DataModel.DataTableExtension
2+Imports MLApp.Const.DataTableExtension
33 Imports ML.Common.Extensions.StringExtension
44
55 ''' <summary>
--- trunk/MLApp.TRN8000/TRN8933.vb (revision 48)
+++ trunk/MLApp.TRN8000/TRN8933.vb (revision 49)
@@ -1,5 +1,5 @@
11 
2-Imports MLApp.DataModel.DataTableExtension
2+Imports MLApp.Const.DataTableExtension
33 Imports ML.Common.Extensions.StringExtension
44 Imports System.Text
55
Show on old repository browser