• R/O
  • SSH
  • HTTPS

mlapplication: Commit


Commit MetaInfo

Revision48 (tree)
Time2017-01-11 20:32:08
Authoryukio_miura

Log Message

(empty log message)

Change Summary

Incremental Difference

--- trunk/MLApp.TRN0000/TRN0020.vb (revision 47)
+++ trunk/MLApp.TRN0000/TRN0020.vb (revision 48)
@@ -1,6 +1,7 @@
11 
22 Imports MLApp.DataModel
33 Imports MLApp.DataModel.DataTableExtension
4+Imports ML.Common.Extensions.StringExtension
45
56 ''' <summary>
67 ''' 【クラス名】TRN0020
@@ -11,12 +12,24 @@
1112 ''' |更新者 |日付 |連番 |変更内容 |
1213 ''' +------------+-----------+-----+-------------------------------------------+
1314 ''' y.miura 2015.05.17 001 新規作成
15+''' y.miura 2017.01.11 002 ロード時にトリガーチェックを追加
1416 ''' </history>
1517 Public Class TRN0020
1618
19+ ''' <summary>メニューボタンの数</summary>
20+ Protected Const BUTTON_COUNT As Integer = 14
21+
22+ ''' <summary>ログオン情報クラス</summary>
23+ Protected m_LInfo As MLApp.TRNLib.LoginInfo
24+
1725 ''' <summary>フォームロード時</summary>
1826 Private Sub TRN0020_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
1927
28+ If Me.DesignMode = True Then Exit Sub
29+
30+ '' ログオン情報クラスインスタンス生成
31+ Me.m_LInfo = New MLApp.TRNLib.LoginInfo
32+
2033 '' メニューボタンキャプションをプログラムマスタから取得して表示
2134 Me.SetMenuCaption()
2235
@@ -28,6 +41,59 @@
2841 ''' <summary>権限設定をメニューボタンの使用可否に反映</summary>
2942 Protected Overridable Sub SetAuthority()
3043
44+ '' 一旦すべてのメニューボタンを非活性とする
45+ For iButtonIdx As Integer = 1 To BUTTON_COUNT
46+
47+ Dim btnControl As MLApp.Base.ucMenuBtn
48+ btnControl = CType(Me.Controls("cmdEXEC" & String.Format(ML.Common.Const.Fmt.fmtZero2, iButtonIdx)), _
49+ MLApp.Base.ucMenuBtn)
50+
51+ btnControl.Enabled = False
52+ Next
53+
54+ '' トリガーチェック
55+ If Me.CheckTrigger = False Then
56+ Exit Sub
57+ End If
58+
59+ '' 権限により使用可能なサブシステムのボタンコントロールを活性化する
60+ Dim db As ML.DBAccess.Base.Db5 = ML.DBAccess.Base.Db5.CurrentDb
61+ Dim rM910 As ML.DBAccess.Base.Rs5
62+ Dim sSQL As String
63+
64+ '' DB-Open
65+ db.Open()
66+
67+ '' 権限情報から使用可能なボタンを活性化する
68+ sSQL = "SELECT M910.M910_ORDER1 FROM " & TRNLib.TRNConst.TableName.M.M910_F & " M910"
69+ sSQL &= " INNER JOIN ("
70+ sSQL &= " SELECT M911_M910CD1 "
71+ sSQL &= " FROM " & TRNLib.TRNConst.TableName.M.M911_F & " M911"
72+ sSQL &= " INNER JOIN " & TRNLib.TRNConst.TableName.M.M913_F & " M913"
73+ sSQL &= " ON M911.M911_CODE1 = M913.M913_M911CD1"
74+ sSQL &= " WHERE M913.M913_M912CD1=" & Me.m_LInfo.AuthorityLevel.ToTextStr
75+ sSQL &= " AND M913.M913_LEVEL1<>" & MLApp.Const.KubunMGCode.AuthorityLevel.enAuthorityLevel.Unusable
76+ sSQL &= " GROUP BY M911_M910CD1) PK"
77+ sSQL &= " ON M910.M910_CODE1=PK.M911_M910CD1"
78+ rM910 = db.OpenRecordset(sSQL)
79+ Do Until rM910.EOF
80+
81+ '' 表示順取得
82+ Dim iM910_ORDER1 As Integer = rM910.Fields("M910_ORDER1").Value
83+
84+ '' メニューボタンを活性化する
85+ Dim btnControl As MLApp.Base.ucMenuBtn
86+ btnControl = CType(Me.Controls("cmdEXEC" & String.Format(ML.Common.Const.Fmt.fmtZero2, iM910_ORDER1)), _
87+ MLApp.Base.ucMenuBtn)
88+
89+ btnControl.Enabled = True
90+
91+ Loop
92+ rM910.Close()
93+
94+ '' DB-Close
95+ db.Close()
96+
3197 End Sub
3298
3399 ''' <summary>フォーム表示時</summary>
@@ -94,7 +160,7 @@
94160 '' ターゲットサブシステムコード
95161 btnControl.TargetSubSystemCode = dr.M910_CODE1
96162
97- '' メニューフォームを活性化する
163+ '' ボタンコントロールを活性化する
98164 btnControl.Enabled = True
99165
100166 '' メニュー数の最大値を超えたらループを抜ける
--- trunk/MLApp.TRN0000/Form1.Designer.vb (revision 47)
+++ trunk/MLApp.TRN0000/Form1.Designer.vb (revision 48)
@@ -1,6 +1,6 @@
11 <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
22 Partial Class Form1
3- Inherits MLApp.Base.TRNStandardForm
3+ Inherits MLApp.Base.TRNBaseForm
44
55 'フォームがコンポーネントの一覧をクリーンアップするために dispose をオーバーライドします。
66 <System.Diagnostics.DebuggerNonUserCode()> _
@@ -81,6 +81,10 @@
8181 Me.Uc6OpenFileDialog2 = New ML.Controls.uc6OpenFileDialog()
8282 Me.Uc6Button11 = New ML.Controls.uc6Button()
8383 Me.UcSearchBox2Line1 = New MLApp.Base.ucSearchBox2Line()
84+ Me.Button2 = New System.Windows.Forms.Button()
85+ Me.Uc6Button12 = New ML.Controls.uc6Button()
86+ Me.Uc6Button13 = New ML.Controls.uc6Button()
87+ Me.MenuBtnPanel.SuspendLayout()
8488 CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
8589 Me.Uc6GroupBox1.SuspendLayout()
8690 CType(Me.Uc6DatetimePicker1, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -94,6 +98,58 @@
9498 CType(Me.M9_TRNDataSet1, System.ComponentModel.ISupportInitialize).BeginInit()
9599 Me.SuspendLayout()
96100 '
101+ 'cmdF1
102+ '
103+ Me.cmdF1.Text = ""
104+ '
105+ 'MenuBtnPanel
106+ '
107+ Me.MenuBtnPanel.Size = New System.Drawing.Size(1207, 43)
108+ '
109+ 'cmdF11
110+ '
111+ Me.cmdF11.Text = ""
112+ '
113+ 'cmdF10
114+ '
115+ Me.cmdF10.Text = ""
116+ '
117+ 'cmdF9
118+ '
119+ Me.cmdF9.Text = ""
120+ '
121+ 'cmdF8
122+ '
123+ Me.cmdF8.Text = ""
124+ '
125+ 'cmdF7
126+ '
127+ Me.cmdF7.Text = ""
128+ '
129+ 'cmdF6
130+ '
131+ Me.cmdF6.Text = ""
132+ '
133+ 'cmdF5
134+ '
135+ Me.cmdF5.Text = ""
136+ '
137+ 'cmdF4
138+ '
139+ Me.cmdF4.Text = ""
140+ '
141+ 'cmdF3
142+ '
143+ Me.cmdF3.Text = ""
144+ '
145+ 'cmdF2
146+ '
147+ Me.cmdF2.Text = ""
148+ '
149+ 'cmdF12
150+ '
151+ Me.cmdF12.Text = ""
152+ '
97153 'Uc6Button8
98154 '
99155 Me.Uc6Button8.Location = New System.Drawing.Point(12, 81)
@@ -291,7 +347,7 @@
291347 Me.Uc6DatetimePicker1.Name = "Uc6DatetimePicker1"
292348 Me.Uc6DatetimePicker1.Size = New System.Drawing.Size(150, 20)
293349 Me.Uc6DatetimePicker1.TabIndex = 19
294- Me.Uc6DatetimePicker1.Value = New Date(2016, 12, 23, 0, 0, 0, 0)
350+ Me.Uc6DatetimePicker1.Value = New Date(2017, 1, 11, 0, 0, 0, 0)
295351 '
296352 'Uc6Button4
297353 '
@@ -634,7 +690,7 @@
634690 Me.Uc6Date2.Name = "Uc6Date2"
635691 Me.Uc6Date2.Size = New System.Drawing.Size(159, 20)
636692 Me.Uc6Date2.TabIndex = 36
637- Me.Uc6Date2.Value = New Date(2016, 12, 23, 0, 0, 0, 0)
693+ Me.Uc6Date2.Value = New Date(2017, 1, 11, 0, 0, 0, 0)
638694 '
639695 'Uc6Date3
640696 '
@@ -646,7 +702,7 @@
646702 Me.Uc6Date3.Name = "Uc6Date3"
647703 Me.Uc6Date3.Size = New System.Drawing.Size(118, 20)
648704 Me.Uc6Date3.TabIndex = 37
649- Me.Uc6Date3.Value = New Date(2016, 12, 23, 0, 0, 0, 0)
705+ Me.Uc6Date3.Value = New Date(2017, 1, 11, 0, 0, 0, 0)
650706 '
651707 'Uc6Date1
652708 '
@@ -657,7 +713,7 @@
657713 Me.Uc6Date1.Name = "Uc6Date1"
658714 Me.Uc6Date1.Size = New System.Drawing.Size(134, 20)
659715 Me.Uc6Date1.TabIndex = 38
660- Me.Uc6Date1.Value = New Date(2016, 12, 23, 0, 0, 0, 0)
716+ Me.Uc6Date1.Value = New Date(2017, 1, 11, 0, 0, 0, 0)
661717 '
662718 'Uc6Button9
663719 '
@@ -734,10 +790,12 @@
734790 Me.UcSearchBox2Line1.FuriganaFieldName = Nothing
735791 Me.UcSearchBox2Line1.Location = New System.Drawing.Point(832, 135)
736792 Me.UcSearchBox2Line1.Name = "UcSearchBox2Line1"
793+ Me.UcSearchBox2Line1.NameControl2Enabled = True
737794 Me.UcSearchBox2Line1.NameControlEnabled = True
738795 Me.UcSearchBox2Line1.NameControlLengthCheckMode = ML.Common.[Const].En.enLengthCheckMode.ByteMode
739796 Me.UcSearchBox2Line1.NameControlMaxLength = 12
740797 Me.UcSearchBox2Line1.NameControlText = ""
798+ Me.UcSearchBox2Line1.NameControlText2 = ""
741799 Me.UcSearchBox2Line1.NameControlWidth = 220
742800 Me.UcSearchBox2Line1.NameFieldName = "M130_NAME1"
743801 Me.UcSearchBox2Line1.NameFieldName2 = "M130_NAME2"
@@ -744,11 +802,41 @@
744802 Me.UcSearchBox2Line1.Size = New System.Drawing.Size(363, 39)
745803 Me.UcSearchBox2Line1.TabIndex = 45
746804 '
805+ 'Button2
806+ '
807+ Me.Button2.Location = New System.Drawing.Point(887, 360)
808+ Me.Button2.Name = "Button2"
809+ Me.Button2.Size = New System.Drawing.Size(132, 86)
810+ Me.Button2.TabIndex = 46
811+ Me.Button2.Text = "閉じる"
812+ Me.Button2.UseVisualStyleBackColor = True
813+ '
814+ 'Uc6Button12
815+ '
816+ Me.Uc6Button12.Location = New System.Drawing.Point(854, 202)
817+ Me.Uc6Button12.Name = "Uc6Button12"
818+ Me.Uc6Button12.Size = New System.Drawing.Size(75, 23)
819+ Me.Uc6Button12.TabIndex = 47
820+ Me.Uc6Button12.Text = "トリガー起動"
821+ Me.Uc6Button12.UseVisualStyleBackColor = True
822+ '
823+ 'Uc6Button13
824+ '
825+ Me.Uc6Button13.Location = New System.Drawing.Point(944, 202)
826+ Me.Uc6Button13.Name = "Uc6Button13"
827+ Me.Uc6Button13.Size = New System.Drawing.Size(75, 23)
828+ Me.Uc6Button13.TabIndex = 48
829+ Me.Uc6Button13.Text = "トリガー停止"
830+ Me.Uc6Button13.UseVisualStyleBackColor = True
831+ '
747832 'Form1
748833 '
749834 Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
750835 Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
751836 Me.ClientSize = New System.Drawing.Size(1207, 486)
837+ Me.Controls.Add(Me.Uc6Button13)
838+ Me.Controls.Add(Me.Uc6Button12)
839+ Me.Controls.Add(Me.Button2)
752840 Me.Controls.Add(Me.UcSearchBox2Line1)
753841 Me.Controls.Add(Me.Uc6Button11)
754842 Me.Controls.Add(Me.Uc6OpenFileDialog2)
@@ -793,6 +881,53 @@
793881 Me.Controls.Add(Me.Uc6SaveFileDialog1)
794882 Me.Name = "Form1"
795883 Me.Text = "Form1"
884+ Me.Controls.SetChildIndex(Me.Uc6SaveFileDialog1, 0)
885+ Me.Controls.SetChildIndex(Me.UcSearchBox1, 0)
886+ Me.Controls.SetChildIndex(Me.Uc6OpenFileDialog1, 0)
887+ Me.Controls.SetChildIndex(Me.Uc6TextBox1, 0)
888+ Me.Controls.SetChildIndex(Me.Uc6TextBox2, 0)
889+ Me.Controls.SetChildIndex(Me.Uc6DataGridView1, 0)
890+ Me.Controls.SetChildIndex(Me.Uc6Button1, 0)
891+ Me.Controls.SetChildIndex(Me.Col1, 0)
892+ Me.Controls.SetChildIndex(Me.Row1, 0)
893+ Me.Controls.SetChildIndex(Me.Uc6Button2, 0)
894+ Me.Controls.SetChildIndex(Me.Uc6Label1, 0)
895+ Me.Controls.SetChildIndex(Me.Uc6Label2, 0)
896+ Me.Controls.SetChildIndex(Me.Uc6Num1, 0)
897+ Me.Controls.SetChildIndex(Me.Uc6Button3, 0)
898+ Me.Controls.SetChildIndex(Me.Uc6Label3, 0)
899+ Me.Controls.SetChildIndex(Me.TabControl1, 0)
900+ Me.Controls.SetChildIndex(Me.Uc6Num2, 0)
901+ Me.Controls.SetChildIndex(Me.Uc6Button4, 0)
902+ Me.Controls.SetChildIndex(Me.Uc6DatetimePicker1, 0)
903+ Me.Controls.SetChildIndex(Me.Uc6Button6, 0)
904+ Me.Controls.SetChildIndex(Me.Uc6Num3, 0)
905+ Me.Controls.SetChildIndex(Me.Uc6GroupBox1, 0)
906+ Me.Controls.SetChildIndex(Me.Uc6Button7, 0)
907+ Me.Controls.SetChildIndex(Me.Button1, 0)
908+ Me.Controls.SetChildIndex(Me.Uc6Num4, 0)
909+ Me.Controls.SetChildIndex(Me.UcSearchBox2, 0)
910+ Me.Controls.SetChildIndex(Me.Uc6TextBox5, 0)
911+ Me.Controls.SetChildIndex(Me.DataGridView1, 0)
912+ Me.Controls.SetChildIndex(Me.Uc6FolderBrowserDialog1, 0)
913+ Me.Controls.SetChildIndex(Me.Uc6Button8, 0)
914+ Me.Controls.SetChildIndex(Me.Uc6ComboBox1, 0)
915+ Me.Controls.SetChildIndex(Me.DateTimePicker1, 0)
916+ Me.Controls.SetChildIndex(Me.Uc6Date2, 0)
917+ Me.Controls.SetChildIndex(Me.Uc6Date3, 0)
918+ Me.Controls.SetChildIndex(Me.Uc6Date1, 0)
919+ Me.Controls.SetChildIndex(Me.Uc6Button9, 0)
920+ Me.Controls.SetChildIndex(Me.Uc6ComboBox2, 0)
921+ Me.Controls.SetChildIndex(Me.Uc6TextBox6, 0)
922+ Me.Controls.SetChildIndex(Me.Uc6Button10, 0)
923+ Me.Controls.SetChildIndex(Me.Uc6OpenFileDialog2, 0)
924+ Me.Controls.SetChildIndex(Me.Uc6Button11, 0)
925+ Me.Controls.SetChildIndex(Me.UcSearchBox2Line1, 0)
926+ Me.Controls.SetChildIndex(Me.Button2, 0)
927+ Me.Controls.SetChildIndex(Me.MenuBtnPanel, 0)
928+ Me.Controls.SetChildIndex(Me.Uc6Button12, 0)
929+ Me.Controls.SetChildIndex(Me.Uc6Button13, 0)
930+ Me.MenuBtnPanel.ResumeLayout(False)
796931 CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()
797932 Me.Uc6GroupBox1.ResumeLayout(False)
798933 Me.Uc6GroupBox1.PerformLayout()
@@ -869,4 +1004,7 @@
8691004 Friend WithEvents Uc6OpenFileDialog2 As ML.Controls.uc6OpenFileDialog
8701005 Friend WithEvents Uc6Button11 As ML.Controls.uc6Button
8711006 Friend WithEvents UcSearchBox2Line1 As MLApp.Base.ucSearchBox2Line
1007+ Friend WithEvents Button2 As System.Windows.Forms.Button
1008+ Friend WithEvents Uc6Button12 As ML.Controls.uc6Button
1009+ Friend WithEvents Uc6Button13 As ML.Controls.uc6Button
8721010 End Class
--- trunk/MLApp.TRN0000/Form1.vb (revision 47)
+++ trunk/MLApp.TRN0000/Form1.vb (revision 48)
@@ -174,4 +174,18 @@
174174 Private Sub UcSearchBox2_Load(sender As System.Object, e As System.EventArgs) Handles UcSearchBox2.Load
175175
176176 End Sub
177+
178+ Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
179+ Me.Close()
180+ End Sub
181+
182+ Private Sub Uc6Button13_Click(sender As System.Object, e As System.EventArgs) Handles Uc6Button13.Click
183+ Dim tri As New TRNLib.Trigger
184+ tri.Proc.ChangeEnableTrigger(TRNLib.Base.Trigger.TriggerEnable.DISABLED)
185+ End Sub
186+
187+ Private Sub Uc6Button12_Click(sender As System.Object, e As System.EventArgs) Handles Uc6Button12.Click
188+ Dim tri As New TRNLib.Trigger
189+ tri.Proc.ChangeEnableTrigger(TRNLib.Base.Trigger.TriggerEnable.ENABLED)
190+ End Sub
177191 End Class
\ No newline at end of file
--- trunk/ML.Common.Message/My Project/MsgResource_E.Designer.vb (revision 47)
+++ trunk/ML.Common.Message/My Project/MsgResource_E.Designer.vb (revision 48)
@@ -1,7 +1,7 @@
11 '------------------------------------------------------------------------------
22 ' <auto-generated>
33 ' このコードはツールによって生成されました。
4-' ランタイム バージョン:4.0.30319.34209
4+' ランタイム バージョン:4.0.30319.42000
55 '
66 ' このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
77 ' コードが再生成されるときに損失したりします。
@@ -144,5 +144,23 @@
144144 Return ResourceManager.GetString("MSG_E_0009", resourceCulture)
145145 End Get
146146 End Property
147+
148+ '''<summary>
149+ ''' エントリーされているトリガーの取得に失敗しました に類似しているローカライズされた文字列を検索します。
150+ '''</summary>
151+ Public Shared ReadOnly Property MSG_E_0010() As String
152+ Get
153+ Return ResourceManager.GetString("MSG_E_0010", resourceCulture)
154+ End Get
155+ End Property
156+
157+ '''<summary>
158+ ''' 以下のトリガーが起動されていません。システム管理者に問い合わせてください {0} に類似しているローカライズされた文字列を検索します。
159+ '''</summary>
160+ Public Shared ReadOnly Property MSG_E_0011() As String
161+ Get
162+ Return ResourceManager.GetString("MSG_E_0011", resourceCulture)
163+ End Get
164+ End Property
147165 End Class
148166 End Namespace
--- trunk/MLApp.Base/TRNBaseForm.vb (revision 47)
+++ trunk/MLApp.Base/TRNBaseForm.vb (revision 48)
@@ -41,7 +41,7 @@
4141 '' フォーム上にDataGridViewコントロールが存在する場合、列情報ファイルを出力する
4242 For Each c As Control In Me.Controls
4343
44- If TypeOf c Is DataGridView Then
44+ If TypeOf c Is ML.Controls.uc6DataGridView Then
4545
4646 CType(c, ML.Controls.uc6DataGridView).SaveColumnSettingXml(Me.Name)
4747
@@ -95,6 +95,17 @@
9595 End If
9696 Next
9797
98+ '' DataGridViewの列幅情報XMLを読み込む
99+ For Each c As Control In Me.Controls
100+
101+ If TypeOf c Is ML.Controls.uc6DataGridView Then
102+
103+ CType(c, ML.Controls.uc6DataGridView).LoadColumnSettingXml(Me.Name)
104+
105+ End If
106+
107+ Next
108+
98109 End Sub
99110
100111 ''' <summary>F1ボタンクリック時イベント</summary>
@@ -167,4 +178,31 @@
167178
168179 End Sub
169180
181+ ''' <summary>トリガーチェック処理</summary>
182+ Protected Overridable Function CheckTrigger() As Boolean
183+ Dim ckTri As New MLApp.TRNLib.Trigger
184+ Dim iResult As ML.Common.Const.En.enResult = ckTri.Proc.CheckTriggerEnabled
185+ If iResult = ML.Common.Const.En.enResult.Warning Then
186+
187+ '' 無効トリガーのリストをメッセージボックスに表示する
188+ Dim sDisabledTrigger As String = "+-------+" & Environment.NewLine
189+ For Each sTriggerName As String In ckTri.Proc.DisabledTriggerList
190+ sDisabledTrigger &= sTriggerName & Environment.NewLine
191+ Next
192+ sDisabledTrigger &= "+-------+"
193+
194+ '' エラーメッセージ表示
195+ Me.Messenger.WarnOKOnly.Show(
196+ ML.Common.Message.Resource.E.MSG_E_0011,
197+ "トリガーチェックエラー",
198+ sDisabledTrigger)
199+
200+ Return False
201+ ElseIf iResult = ML.Common.Const.En.enResult.Critical Then
202+ Return False
203+ End If
204+
205+ Return True
206+ End Function
207+
170208 End Class
\ No newline at end of file
--- trunk/MLApp.Base/TRNBaseMenuForm.vb (revision 47)
+++ trunk/MLApp.Base/TRNBaseMenuForm.vb (revision 48)
@@ -12,6 +12,7 @@
1212 ''' |更新者 |日付 |連番 |変更内容 |
1313 ''' +------------+-----------+-----+-------------------------------------------+
1414 ''' y.miura 2015.09.18 001 新規作成
15+''' y.miura 2017.01.11 002 ロード時にトリガーチェックを追加
1516 ''' </history>
1617 Public Class TRNBaseMenuForm
1718
@@ -67,6 +68,11 @@
6768 btnControl.Enabled = False
6869 Next
6970
71+ '' トリガーチェック
72+ If Me.CheckTrigger = False Then
73+ Exit Sub
74+ End If
75+
7076 '' DB-Open
7177 db.Open()
7278
@@ -83,7 +89,7 @@
8389 Dim iM913_LEVEL1 As Integer = rM913.Fields("M913_LEVEL1").Value
8490
8591 '' 権限レベル判定
86- If iM913_LEVEL1 <> MLApp.TRNLib.KubnMaster.AuthorityLevel.enAuthorityLevel.Unusable Then
92+ If iM913_LEVEL1 <> MLApp.Const.KubunMGCode.AuthorityLevel.enAuthorityLevel.Unusable Then
8793
8894 '' 表示順取得
8995 Dim iM911_ORDER1 As Integer = rM913.Fields("M911_ORDER1").Value
--- trunk/MLApp.TRN8000/TRN8930.Designer.vb (revision 47)
+++ trunk/MLApp.TRN8000/TRN8930.Designer.vb (revision 48)
@@ -231,7 +231,7 @@
231231 Me.txtM910_FORMID1.Font = New System.Drawing.Font("MS UI Gothic", 9.5!)
232232 Me.txtM910_FORMID1.ImeMode = System.Windows.Forms.ImeMode.Hiragana
233233 Me.txtM910_FORMID1.LengthCheckMode = ML.Common.[Const].En.enLengthCheckMode.ByteMode
234- Me.txtM910_FORMID1.Location = New System.Drawing.Point(116, 60)
234+ Me.txtM910_FORMID1.Location = New System.Drawing.Point(116, 59)
235235 Me.txtM910_FORMID1.MaxLength = 20
236236 Me.txtM910_FORMID1.Name = "txtM910_FORMID1"
237237 Me.txtM910_FORMID1.PermitChars = New Char(-1) {}
--- trunk/MLApp.TRN8000/TRN8932.vb (revision 47)
+++ trunk/MLApp.TRN8000/TRN8932.vb (revision 48)
@@ -604,7 +604,7 @@
604604 .AddNew()
605605 .Fields("M913_M912CD1").Value = Me.txtM912_CODE1.Text
606606 .Fields("M913_M911CD1").Value = drM911.M911_CODE1
607- .Fields("M913_LEVEL1").Value = MLApp.TRNLib.KubnMaster.AuthorityLevel.enAuthorityLevel.Unusable
607+ .Fields("M913_LEVEL1").Value = MLApp.Const.KubunMGCode.AuthorityLevel.enAuthorityLevel.Unusable
608608 .Fields("M913_UPD1").Value = Me.m_LInfo.GetUpdInfo
609609 .Update()
610610 End With
--- trunk/MLApp.TRN8000/TRN8931.vb (revision 47)
+++ trunk/MLApp.TRN8000/TRN8931.vb (revision 48)
@@ -657,7 +657,7 @@
657657 .AddNew()
658658 .Fields("M913_M912CD1").Value = drM913.M913_M912CD1
659659 .Fields("M913_M911CD1").Value = sM911CD1
660- .Fields("M913_LEVEL1").Value = MLApp.TRNLib.KubnMaster.AuthorityLevel.enAuthorityLevel.Unusable
660+ .Fields("M913_LEVEL1").Value = MLApp.Const.KubunMGCode.AuthorityLevel.enAuthorityLevel.Unusable
661661 .Fields("M913_UPD1").Value = Me.m_LInfo.GetUpdInfo
662662 .Update()
663663
--- trunk/MLApp.TRN8000/TRN8933.vb (revision 47)
+++ trunk/MLApp.TRN8000/TRN8933.vb (revision 48)
@@ -255,7 +255,7 @@
255255 (New MLApp.DataModel.M9_TRNDataSet.M912_FDataTable).GetData(sWHR, "M912_ORDER1"))
256256
257257 '' 権限レベル
258- sWHR = "M921_M920CD1=" & TRNLib.KubnMaster.AuthorityLevel.KUBN_CODE.ToTextStr
258+ sWHR = "M921_M920CD1=" & MLApp.Const.KubunMGCode.AuthorityLevel.GroupCode.ToTextStr
259259 Me.cmbM913_LEVEL1.SetValueList(
260260 (New MLApp.DataModel.M9_TRNDataSet.M921_FDataTable).GetData(sWHR, "M921_ORDER1"))
261261
@@ -511,7 +511,7 @@
511511 sbSQL.AppendLine(" ON M913.M913_M911CD1 = M911.M911_CODE1")
512512 sbSQL.AppendLine(" LEFT JOIN ")
513513 sbSQL.AppendLine(" (SELECT * FROM M921_F")
514- sbSQL.AppendLine(" WHERE M921_M920CD1=" & TRNLib.KubnMaster.AuthorityLevel.KUBN_CODE.ToTextStr & ") M921")
514+ sbSQL.AppendLine(" WHERE M921_M920CD1=" & MLApp.Const.KubunMGCode.AuthorityLevel.GroupCode.ToTextStr & ") M921")
515515 sbSQL.AppendLine(" ON M913.M913_LEVEL1 = M921.M921_CODE1")
516516
517517 sbSQL.AppendLine(" WHERE 1=1")
--- trunk/MLApp.Const/KubunMGCode.vb (revision 47)
+++ trunk/MLApp.Const/KubunMGCode.vb (revision 48)
@@ -11,7 +11,7 @@
1111 ''' </history>
1212 Public Class KubunMGCode
1313
14- ''' <summary>システム設定</summary>
14+ ''' <summary>(001)システム設定</summary>
1515 Public Class SystemConfig
1616
1717 ''' <summary>グループコード</summary>
@@ -23,9 +23,34 @@
2323 ''' <summary>区分マスタキーコード:Excelファイル出力先パス</summary>
2424 Public Const MasterKeyCode006 As String = "6"
2525
26+ ''' <summary>区分マスタキーコード:トリガー作成バッチファイルパス</summary>
27+ Public Const MasterKeyCode007 As String = "7"
28+
2629 End Class
2730
28- ''' <summary>カレンダー設定</summary>
31+ ''' <summary>(002)権限レベル</summary>
32+ Public Class AuthorityLevel
33+
34+ ''' <summary>区分マスタコード</summary>
35+ Public Const GroupCode As String = "002"
36+
37+ ''' <summary>権限レベル - コード列挙体</summary>
38+ Public Enum enAuthorityLevel
39+
40+ ''' <summary>フルコントロール</summary>
41+ FullControl = 0
42+
43+ ''' <summary>参照のみ</summary>
44+ IsReadOnly = 1
45+
46+ ''' <summary>使用不可</summary>
47+ Unusable = 9
48+
49+ End Enum
50+
51+ End Class
52+
53+ ''' <summary>(003)カレンダー設定</summary>
2954 Public Class CalSetting
3055
3156 ''' <summary>グループコード</summary>
@@ -33,7 +58,7 @@
3358
3459 End Class
3560
36- ''' <summary>カレンダー区分</summary>
61+ ''' <summary>(004)カレンダー区分</summary>
3762 Public Class CalKubn
3863
3964 ''' <summary>グループコード</summary>
@@ -50,7 +75,7 @@
5075
5176 End Class
5277
53- ''' <summary>稼働区分</summary>
78+ ''' <summary>(005)稼働区分</summary>
5479 Public Class WorkKubn
5580
5681 ''' <summary>グループコード</summary>
@@ -58,7 +83,7 @@
5883
5984 End Class
6085
61- ''' <summary>ユーザー区分</summary>
86+ ''' <summary>(204)ユーザー区分</summary>
6287 Public Class UserKubun
6388
6489 ''' <summary>グループコード</summary>
--- trunk/MLApp.TRNLib/Class/KubnMaster.vb (revision 47)
+++ trunk/MLApp.TRNLib/Class/KubnMaster.vb (revision 48)
@@ -1,36 +0,0 @@
1-
2-''' <summary>
3-''' 【クラス名】KubnMaster
4-''' 【機能概要】区分マスタ定義クラス
5-''' </summary>
6-''' <history>
7-''' +------------+-----------+-----+-------------------------------------------+
8-''' |更新者 |日付 |連番 |変更内容 |
9-''' +------------+-----------+-----+-------------------------------------------+
10-''' y.miura 2016.03.31 001 新規作成
11-''' </history>
12-Public Class KubnMaster
13-
14- ''' <summary>(002)権限レベル</summary>
15- Public Class AuthorityLevel
16-
17- ''' <summary>区分マスタコード</summary>
18- Public Const KUBN_CODE As String = "002"
19-
20- ''' <summary>権限レベル - コード列挙体</summary>
21- Public Enum enAuthorityLevel
22-
23- ''' <summary>フルコントロール</summary>
24- FullControl = 0
25-
26- ''' <summary>参照のみ</summary>
27- IsReadOnly = 1
28-
29- ''' <summary>使用不可</summary>
30- Unusable = 9
31-
32- End Enum
33-
34- End Class
35-
36-End Class
--- trunk/MLApp.TRNLib/Class/dba/Trigger.vb (revision 0)
+++ trunk/MLApp.TRNLib/Class/dba/Trigger.vb (revision 48)
@@ -0,0 +1,409 @@
1+
2+Imports ML.Common.Extensions.StringExtension
3+Imports MLApp.DataModel.DataTableExtension
4+
5+''' <summary>
6+''' 【クラス名】Trigger
7+''' 【機能概要】トリガー関連の操作・チェック処理
8+''' </summary>
9+''' <history>
10+''' +------------+-----------+-----+-------------------------------------------+
11+''' |更新者 |日付 |連番 |変更内容 |
12+''' +------------+-----------+-----+-------------------------------------------+
13+''' y.miura 2017.01.11 001 新規作成
14+''' </history>
15+Public Class Trigger
16+
17+ ''' <summary>トリガー操作クラスインスタンス</summary>
18+ Private m_Trigger As Base.Trigger
19+
20+ ''' <summary>トリガー操作クラスインスタンス</summary>
21+ Public ReadOnly Property Proc As Base.Trigger
22+ Get
23+ Return Me.m_Trigger
24+ End Get
25+ End Property
26+
27+ ''' <summary>
28+ ''' コンストラクタ
29+ ''' </summary>
30+ Public Sub New()
31+
32+ '' データベースタイプを判定してインスタンスを生成する
33+ If ML.Common.Const.DbInfo.DbType = ML.Common.Const.En.enDBMode.MdbFile Then
34+
35+ '' MdbFile
36+ Me.m_Trigger = Nothing
37+
38+ ElseIf ML.Common.Const.DbInfo.DbType = ML.Common.Const.En.enDBMode.SqlServer Then
39+
40+ '' SqlServer
41+ Me.m_Trigger = New SqlSrv.Trigger
42+
43+ ElseIf ML.Common.Const.DbInfo.DbType = ML.Common.Const.En.enDBMode.Oracle Then
44+
45+ '' Oracle
46+ Me.m_Trigger = New Orcl.Trigger
47+
48+ Else
49+
50+ Throw New Exception
51+
52+ End If
53+
54+ End Sub
55+
56+End Class
57+
58+Namespace Base
59+
60+ ''' <summary>
61+ ''' 【クラス名】Trigger
62+ ''' 【機能概要】トリガー関連の操作・チェック処理(基底)
63+ ''' </summary>
64+ ''' <history>
65+ ''' +------------+-----------+-----+-------------------------------------------+
66+ ''' |更新者 |日付 |連番 |変更内容 |
67+ ''' +------------+-----------+-----+-------------------------------------------+
68+ ''' y.miura 2017.01.11 001 新規作成
69+ ''' </history>
70+ Public MustInherit Class Trigger
71+ Inherits ML.Common.Base.BaseClass
72+
73+ ''' <summary>メッセージクラスのインスタンス</summary>
74+ Protected Messenger As New ML.Common.Message.ShowDialog
75+
76+ ''' <summary>区分マスタDataTable</summary>
77+ Protected m_dtM9 As New MLApp.DataModel.M9_TRNDataSet.M921_FDataTable
78+
79+ ''' <summary>トリガー起動チェック</summary>
80+ Public MustOverride Function CheckTriggerEnabled() As ML.Common.Const.En.enResult
81+
82+ ''' <summary>チェック対象トリガー取得</summary>
83+ Protected MustOverride Function GetEntryTrigger() As List(Of String)
84+
85+ ''' <summary>トリガーを有効/無効化する</summary>
86+ Public MustOverride Sub ChangeEnableTrigger(sTriggerEnable As String)
87+
88+ ''' <summary>無効トリガーリスト</summary>
89+ Protected m_DisabledTriggerList As List(Of String)
90+
91+ ''' <summary>トリガーの有効/無効切り替え用のSQL</summary>
92+ Public Class TriggerEnable
93+
94+ ''' <summary>有効時</summary>
95+ Public Const ENABLED As String = "ENABLE TRIGGER "
96+
97+ ''' <summary>無効時</summary>
98+ Public Const DISABLED As String = "DISABLE TRIGGER "
99+
100+ End Class
101+
102+ ''' <summary>無効トリガーリスト</summary>
103+ Public ReadOnly Property DisabledTriggerList As List(Of String)
104+ Get
105+ Return Me.m_DisabledTriggerList
106+ End Get
107+ End Property
108+
109+ End Class
110+
111+End Namespace
112+
113+Namespace SqlSrv
114+
115+ ''' <summary>
116+ ''' 【クラス名】Trigger
117+ ''' 【機能概要】トリガー関連の操作・チェック処理(SqlServer)
118+ ''' </summary>
119+ ''' <history>
120+ ''' +------------+-----------+-----+-------------------------------------------+
121+ ''' |更新者 |日付 |連番 |変更内容 |
122+ ''' +------------+-----------+-----+-------------------------------------------+
123+ ''' y.miura 2017.01.11 001 新規作成
124+ ''' </history>
125+ Public Class Trigger
126+ Inherits Base.Trigger
127+
128+ ''' <summary>トリガー名取得用開始タグ</summary>
129+ Private Const START_TAG As String = "('"
130+
131+ ''' <summary>トリガー名取得用終了タグ</summary>
132+ Private Const END_TAG As String = "')"
133+
134+ ''' <summary>sys.triggersにおけるトリガーが保持しているtype列の値</summary>
135+ Private Const TRIGGER_TYPE As String = "TR"
136+
137+ ''' <summary>トリガー起動チェック</summary>
138+ ''' <returns>判定結果</returns>
139+ Public Overrides Function CheckTriggerEnabled() As ML.Common.Const.En.enResult
140+ Dim db As ML.DBAccess.Base.Db5 = ML.DBAccess.Base.Db5.CurrentDb
141+ Dim sSQL As String = String.Empty
142+ Dim iResult As ML.Common.Const.En.enResult = ML.Common.Const.En.enResult.Other
143+ Dim sTriggerList As List(Of String)
144+
145+ Try
146+ '' 無効トリガーリスト初期化
147+ Me.m_DisabledTriggerList = New List(Of String)
148+
149+ '' DB-Open
150+ db.Open()
151+
152+ '' チェック対象トリガー取得
153+ sTriggerList = Me.GetEntryTrigger
154+
155+ '' チェック対象トリガーが取得できない場合
156+ If sTriggerList.Count = 0 Then
157+
158+ '' エラーメッセージ表示
159+ Me.Messenger.WarnOKOnly.Show(
160+ ML.Common.Message.Resource.E.MSG_E_0010,
161+ "トリガーチェックエラー")
162+
163+ iResult = ML.Common.Const.En.enResult.Critical
164+
165+ Exit Try
166+
167+ End If
168+
169+ '' 無効化されているトリガーの一覧をリストに格納
170+ For Each sTriggerName As String In sTriggerList
171+
172+ Dim rSys As ML.DBAccess.Base.Rs5
173+ Dim bTriggerEnabled As Boolean
174+
175+ '' トリガーの有効/無効を判定する
176+ sSQL = "SELECT is_disabled FROM sys.triggers"
177+ sSQL &= " WHERE type=" & TRIGGER_TYPE.ToTextStr
178+ sSQL &= " AND name=" & sTriggerName.ToTextStr
179+ rSys = db.OpenRecordset(sSQL)
180+ If Not rSys.EOF Then
181+
182+ If rSys.Fields("is_disabled").Value = 0 Then
183+ bTriggerEnabled = True
184+ Else
185+ bTriggerEnabled = False
186+ End If
187+
188+ Else
189+ bTriggerEnabled = False
190+ End If
191+ rSys.Close()
192+
193+ '' 無効トリガーをリストに追加する
194+ If bTriggerEnabled = False Then
195+ Me.m_DisabledTriggerList.Add(sTriggerName)
196+ End If
197+
198+ Next
199+
200+ '' 判定結果をセットする
201+ If Me.m_DisabledTriggerList.Count = 0 Then
202+ iResult = ML.Common.Const.En.enResult.Successful
203+ Else
204+ iResult = ML.Common.Const.En.enResult.Warning
205+ End If
206+
207+ Catch ex As Exception
208+
209+ '' エラーログを出力する
210+ Me.WriteErrorLog(ex.Message)
211+
212+ iResult = ML.Common.Const.En.enResult.Critical
213+
214+ Finally
215+
216+ '' DB-Close
217+ db.Close()
218+
219+ End Try
220+
221+ '' 判定結果を返す
222+ Return iResult
223+ End Function
224+
225+ ''' <summary>チェック対象トリガー取得</summary>
226+ ''' <returns>チェック対象トリガーリスト</returns>
227+ Protected Overrides Function GetEntryTrigger() As List(Of String)
228+ Dim sList As New List(Of String)
229+
230+ Try
231+ '' トリガー作成バッチファイルが格納されているディレクトリを取得する
232+ Dim sWHR As String
233+ Dim sBatTriggerFilePath As String
234+ sWHR = MLApp.Const.MLAppConst.TableName.GetKubnMTblWhereSQL(
235+ MLApp.Const.KubunMGCode.SystemConfig.GroupCode,
236+ MLApp.Const.KubunMGCode.SystemConfig.MasterKeyCode007)
237+ Me.m_dtM9.GetData()
238+ sBatTriggerFilePath = Me.m_dtM9.DLookUp("M921_KBVAL2", sWHR)
239+
240+ '' トリガー作成バッチファイルを読み込みトリガーリストを作成する
241+ Using sr As New System.IO.StreamReader(sBatTriggerFilePath,
242+ System.Text.Encoding.GetEncoding(ML.Common.Const.ChrCode.SHIFT_JIS))
243+ While sr.Peek > -1
244+
245+ '' SQLファイル名を取得する
246+ Dim sSQLFileName As String = sr.ReadLine.Replace("@", String.Empty) & ML.Common.Const.Ext.SQLFILE_EXT
247+ '' SQLファイルが格納されているディレクトリを取得する
248+ Dim sBatTriggerFileDir As String = System.IO.Path.GetDirectoryName(sBatTriggerFilePath)
249+ '' SQLファイルパスを取得する
250+ Dim sSQLFilePath As String = System.IO.Path.Combine(sBatTriggerFileDir, sSQLFileName)
251+
252+ '' SQLファイルに記述されているトリガーを取得する
253+ Me.GetTriggerList(sList, sSQLFilePath)
254+
255+ End While
256+
257+ End Using
258+
259+ Catch ex As Exception
260+
261+ '' エラーログを出力する
262+ Me.WriteErrorLog(ex.Message)
263+
264+ End Try
265+
266+ '' 戻り値を返す
267+ Return sList
268+ End Function
269+
270+ ''' <summary>SQLファイル内に記述されているトリガーを取得する</summary>
271+ ''' <param name="sList">チェック対象トリガーリスト</param>
272+ ''' <param name="sSQLFilePath">SQLファイルパス</param>
273+ Private Sub GetTriggerList(sList As List(Of String),
274+ sSQLFilePath As String)
275+ Dim sSQLFileString As String
276+ Dim iStartFlg As Integer
277+ Dim iTagStartPoint As Integer
278+ Dim iTagEndPoint As Integer
279+
280+ Using sr As New System.IO.StreamReader(sSQLFilePath,
281+ System.Text.Encoding.GetEncoding(ML.Common.Const.ChrCode.SHIFT_JIS))
282+
283+ iStartFlg = 0
284+ While sr.Peek > 1
285+
286+ Dim sTriggerName As String = String.Empty
287+
288+ '' 行を読み込む
289+ sSQLFileString = sr.ReadLine
290+
291+ '' トリガー名開始地点を取得
292+ If iStartFlg <> 0 Then
293+ iTagStartPoint = InStr(sSQLFileString, START_TAG)
294+ If iTagStartPoint > 0 Then
295+ iStartFlg = 0
296+ sList.Add(sTriggerName.Replace(START_TAG, String.Empty))
297+ End If
298+ End If
299+ If iStartFlg = 0 Then
300+ iTagStartPoint = InStr(sSQLFileString, START_TAG)
301+ If iTagStartPoint > 0 Then
302+ iTagEndPoint = InStr(sSQLFileString, END_TAG)
303+ If iTagEndPoint > 0 Then
304+ sTriggerName &= Mid(sSQLFileString, iTagStartPoint, iTagEndPoint - iTagStartPoint)
305+ sList.Add(sTriggerName.Replace(START_TAG, String.Empty))
306+ Else
307+ sTriggerName = Mid(sSQLFileString, iTagStartPoint)
308+ iStartFlg = 1
309+ End If
310+ End If
311+ Else
312+ iTagStartPoint = InStr(sSQLFileString, END_TAG)
313+ If iTagStartPoint > 0 Then
314+ sTriggerName &= Mid(sSQLFileString, 1, iTagStartPoint - 1)
315+ iStartFlg = 0
316+ sList.Add(sTriggerName.Replace(START_TAG, String.Empty))
317+ Else
318+ sTriggerName &= sSQLFileString
319+ End If
320+ End If
321+
322+ End While
323+
324+ End Using
325+
326+ End Sub
327+
328+ ''' <summary>トリガーを有効/無効化する</summary>
329+ Public Overrides Sub ChangeEnableTrigger(sTriggerEnable As String)
330+ Dim db As ML.DBAccess.Base.Db5 = ML.DBAccess.Base.Db5.CurrentDb
331+ Dim rSys As ML.DBAccess.Base.Rs5
332+ Dim sSQL As String = String.Empty
333+
334+ Try
335+ '' DB-Open
336+ db.Open()
337+
338+ '' システムテーブルからトリガー名と親テーブル名を取得する
339+ sSQL = "SELECT sys_tbl.name tablename,sys_trg.name triggername "
340+ sSQL &= " FROM sys.triggers sys_trg"
341+ sSQL &= " INNER JOIN sys.tables sys_tbl"
342+ sSQL &= " ON sys_trg.parent_id = sys_tbl.object_id"
343+ rSys = db.OpenRecordset(sSQL)
344+ Do Until rSys.EOF
345+
346+ '' トリガーを有効/無効化する
347+ sSQL = "ALTER TABLE " & rSys.Fields("tablename").Value & " "
348+ sSQL &= sTriggerEnable & rSys.Fields("triggername").Value
349+ db.Execute(sSQL)
350+
351+ Loop
352+ rSys.Close()
353+
354+ Catch ex As Exception
355+
356+ '' エラーログを出力する
357+ Me.WriteErrorLog(ex.Message)
358+
359+ '' エラーメッセージを表示する
360+ Me.Messenger.ErrorOKOnly.Show(ex.Message)
361+
362+ Finally
363+
364+ '' DB-Close
365+ db.Close()
366+
367+ End Try
368+
369+ End Sub
370+
371+ End Class
372+
373+End Namespace
374+
375+Namespace Orcl
376+
377+ ''' <summary>
378+ ''' 【クラス名】Trigger
379+ ''' 【機能概要】トリガー関連の操作・チェック処理(Oracle)
380+ ''' </summary>
381+ ''' <history>
382+ ''' +------------+-----------+-----+-------------------------------------------+
383+ ''' |更新者 |日付 |連番 |変更内容 |
384+ ''' +------------+-----------+-----+-------------------------------------------+
385+ ''' y.miura 2017.01.11 001 新規作成
386+ ''' </history>
387+ Public Class Trigger
388+ Inherits Base.Trigger
389+
390+ ''' <summary>トリガー起動チェック</summary>
391+ ''' <returns>判定結果</returns>
392+ Public Overrides Function CheckTriggerEnabled() As ML.Common.Const.En.enResult
393+ Return ML.Common.Const.En.enResult.Other
394+ End Function
395+
396+ ''' <summary>チェック対象トリガー取得</summary>
397+ Protected Overrides Function GetEntryTrigger() As System.Collections.Generic.List(Of String)
398+ Return Nothing
399+ End Function
400+
401+ ''' <summary>トリガーを有効化する</summary>
402+ Public Overrides Sub ChangeEnableTrigger(sTriggerEnable As String)
403+
404+ End Sub
405+
406+ End Class
407+
408+
409+End Namespace
\ No newline at end of file
--- trunk/ML.Common.Const/Const/Ext.vb (revision 47)
+++ trunk/ML.Common.Const/Const/Ext.vb (revision 48)
@@ -40,4 +40,7 @@
4040 ''' <summary>ログファイル拡張子</summary>
4141 Public Const LOGFILE_EXT As String = ".log"
4242
43+ ''' <summary>SQLファイル拡張子</summary>
44+ Public Const SQLFILE_EXT As String = ".sql"
45+
4346 End Class
Show on old repository browser