Validation and stuff
This commit is contained in:
8
MultiTool.Form/GlobalSuppressions.vb
Normal file
8
MultiTool.Form/GlobalSuppressions.vb
Normal file
@@ -0,0 +1,8 @@
|
||||
' This file is used by Code Analysis to maintain SuppressMessage
|
||||
' attributes that are applied to this project.
|
||||
' Project-level suppressions either have no target or are given
|
||||
' a specific target and scoped to a namespace, type, member, etc.
|
||||
|
||||
Imports System.Diagnostics.CodeAnalysis
|
||||
|
||||
<Assembly: SuppressMessage("Style", "IDE1006:Benennungsstile", Justification:="<Ausstehend>", Scope:="member", Target:="~M:MultiTool.Form.frmRowEditor.btnApplyFromWinline_ItemClick(System.Object,DevExpress.XtraBars.ItemClickEventArgs)")>
|
||||
@@ -8,11 +8,8 @@ Imports MultiTool.Shared.Constants
|
||||
Public Class GridLoader
|
||||
Inherits BaseClass
|
||||
|
||||
Private ReadOnly TemplateConfig As Winline.Configuration
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pTemplateConfig As Winline.Configuration)
|
||||
MyBase.New(pLogConfig, pLogConfig.GetLogger())
|
||||
TemplateConfig = pTemplateConfig
|
||||
End Sub
|
||||
|
||||
Public Function GetGridFromElement(pGrid As GridControl, pTable As Schemas.Schema.Table) As GridControl
|
||||
|
||||
@@ -181,6 +181,7 @@
|
||||
<Compile Include="frmRowEditor.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GlobalSuppressions.vb" />
|
||||
<Compile Include="Reports\OrderReport.Designer.vb">
|
||||
<DependentUpon>OrderReport.vb</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
@@ -5,8 +5,7 @@ Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class frmConfig
|
||||
Public Property ConfigManager As ConfigManager(Of MultiTool.Shared.Config)
|
||||
Private LogConfig As LogConfig
|
||||
Private FormHelper As FormHelper
|
||||
Private ReadOnly FormHelper As FormHelper
|
||||
|
||||
Private ReadOnly Property Config As MultiTool.Shared.Config
|
||||
Get
|
||||
@@ -19,14 +18,14 @@ Public Class frmConfig
|
||||
InitializeComponent()
|
||||
|
||||
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
||||
LogConfig = pLogConfig
|
||||
FormHelper = New FormHelper(pLogConfig)
|
||||
End Sub
|
||||
|
||||
Private Sub frmConfig_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Dim oConnectionString = MSSQLServer.DecryptConnectionString(Config.ConnectionString)
|
||||
Dim oBuilder As New SqlConnectionStringBuilder(oConnectionString)
|
||||
oBuilder.InitialCatalog = "DD_ECM"
|
||||
Dim oBuilder As New SqlConnectionStringBuilder(oConnectionString) With {
|
||||
.InitialCatalog = "DD_ECM"
|
||||
}
|
||||
|
||||
TBEDI_XML_ITEMSTableAdapter.Connection.ConnectionString = oBuilder.ToString()
|
||||
TBEDI_XML_ITEMSTableAdapter.Fill(Me.DS_DD_ECM.TBEDI_XML_ITEMS)
|
||||
|
||||
@@ -247,23 +247,25 @@ Public Class frmRowEditor
|
||||
Private Sub GridView1_CustomDrawCell(sender As Object, e As DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs) Handles GridView1.CustomDrawCell
|
||||
Dim oDataRow As DataRow = GridView1.GetDataRow(e.RowHandle)
|
||||
Dim oKey As String = oDataRow.Item(COL_KEY)
|
||||
|
||||
If e.Column.FieldName = COL_VALUE_FINAL Then
|
||||
Dim oColumn = _Table.Columns.
|
||||
Dim oValue As String = oDataRow.Item(COL_VALUE_FINAL)
|
||||
Dim oColumn = _Table.Columns.
|
||||
Where(Function(c) c.Name = oKey).
|
||||
SingleOrDefault()
|
||||
|
||||
If e.Column.FieldName = COL_VALUE_FINAL Then
|
||||
If oColumn Is Nothing Then
|
||||
Exit Sub
|
||||
End If
|
||||
If oColumn.Config?.IsReadOnly Then
|
||||
e.Appearance.BackColor = Color.LightGray
|
||||
End If
|
||||
|
||||
If oColumn.Config?.IsReadOnly Then
|
||||
e.Appearance.BackColor = Color.LightGray
|
||||
If oColumn.Config?.IsRequired AndAlso e.CellValue.ToString.Length = 0 Then
|
||||
e.Appearance.BackColor = Color.LightCoral
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If (oColumn.IsRequired Or oColumn.Config?.IsRequired) AndAlso e.CellValue.ToString.Length = 0 Then
|
||||
e.Appearance.BackColor = Color.LightCoral
|
||||
End If
|
||||
If oColumn.Config?.IsRequired AndAlso oValue.ToString.Length = 0 Then
|
||||
e.Appearance.BackColor = Color.LightCoral
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user