You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
549 lines
24 KiB
549 lines
24 KiB
Imports System.Data.SqlClient
|
|
Imports System.Data.SqlTypes
|
|
Public Class frmsbpartnerdetail
|
|
Inherits System.Windows.Forms.Form
|
|
|
|
#Region " Vom Windows Form Designer generierter Code "
|
|
|
|
Public Sub New()
|
|
MyBase.New()
|
|
|
|
' Dieser Aufruf ist für den Windows Form-Designer erforderlich.
|
|
InitializeComponent()
|
|
|
|
' Initialisierungen nach dem Aufruf InitializeComponent() hinzufügen
|
|
|
|
End Sub
|
|
|
|
' Die Form überschreibt den Löschvorgang der Basisklasse, um Komponenten zu bereinigen.
|
|
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
|
|
If disposing Then
|
|
If Not (components Is Nothing) Then
|
|
components.Dispose()
|
|
End If
|
|
End If
|
|
MyBase.Dispose(disposing)
|
|
End Sub
|
|
|
|
' Für Windows Form-Designer erforderlich
|
|
Private components As System.ComponentModel.IContainer
|
|
|
|
'HINWEIS: Die folgende Prozedur ist für den Windows Form-Designer erforderlich
|
|
'Sie kann mit dem Windows Form-Designer modifiziert werden.
|
|
'Verwenden Sie nicht den Code-Editor zur Bearbeitung.
|
|
Friend WithEvents Label1 As System.Windows.Forms.Label
|
|
Friend WithEvents Label2 As System.Windows.Forms.Label
|
|
Friend WithEvents Label3 As System.Windows.Forms.Label
|
|
Friend WithEvents Label4 As System.Windows.Forms.Label
|
|
Friend WithEvents Label5 As System.Windows.Forms.Label
|
|
Friend WithEvents Label6 As System.Windows.Forms.Label
|
|
Friend WithEvents Label7 As System.Windows.Forms.Label
|
|
Friend WithEvents Label8 As System.Windows.Forms.Label
|
|
Friend WithEvents Panel1 As System.Windows.Forms.Panel
|
|
Friend WithEvents Label9 As System.Windows.Forms.Label
|
|
Friend WithEvents Button1 As System.Windows.Forms.Button
|
|
Friend WithEvents txtnrpar00 As System.Windows.Forms.TextBox
|
|
Friend WithEvents txtkurzbezeichnung As System.Windows.Forms.TextBox
|
|
Friend WithEvents txtname As System.Windows.Forms.TextBox
|
|
Friend WithEvents txtvorname As System.Windows.Forms.TextBox
|
|
Friend WithEvents txtstrasse As System.Windows.Forms.TextBox
|
|
Friend WithEvents txtplz As System.Windows.Forms.TextBox
|
|
Friend WithEvents txtort As System.Windows.Forms.TextBox
|
|
Friend WithEvents txtanrede2 As System.Windows.Forms.TextBox
|
|
Friend WithEvents txtzustelladresse As System.Windows.Forms.TextBox
|
|
Friend WithEvents Button2 As System.Windows.Forms.Button
|
|
Friend WithEvents Label10 As System.Windows.Forms.Label
|
|
Friend WithEvents txtAnrede As System.Windows.Forms.TextBox
|
|
Friend WithEvents Label11 As System.Windows.Forms.Label
|
|
Friend WithEvents txtanrede1 As System.Windows.Forms.TextBox
|
|
Friend WithEvents WertList As C1.Win.C1TrueDBGrid.C1TrueDBGrid
|
|
Friend WithEvents btnPartnerInfo As System.Windows.Forms.Button
|
|
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
|
|
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmsbpartnerdetail))
|
|
Dim GridLines1 As C1.Win.C1TrueDBGrid.Util.GridLines = New C1.Win.C1TrueDBGrid.Util.GridLines()
|
|
Me.Label1 = New System.Windows.Forms.Label()
|
|
Me.Label2 = New System.Windows.Forms.Label()
|
|
Me.Label3 = New System.Windows.Forms.Label()
|
|
Me.Label4 = New System.Windows.Forms.Label()
|
|
Me.Label5 = New System.Windows.Forms.Label()
|
|
Me.Label6 = New System.Windows.Forms.Label()
|
|
Me.Label7 = New System.Windows.Forms.Label()
|
|
Me.Label8 = New System.Windows.Forms.Label()
|
|
Me.txtnrpar00 = New System.Windows.Forms.TextBox()
|
|
Me.txtkurzbezeichnung = New System.Windows.Forms.TextBox()
|
|
Me.txtname = New System.Windows.Forms.TextBox()
|
|
Me.txtvorname = New System.Windows.Forms.TextBox()
|
|
Me.txtstrasse = New System.Windows.Forms.TextBox()
|
|
Me.txtplz = New System.Windows.Forms.TextBox()
|
|
Me.txtort = New System.Windows.Forms.TextBox()
|
|
Me.txtanrede1 = New System.Windows.Forms.TextBox()
|
|
Me.txtanrede2 = New System.Windows.Forms.TextBox()
|
|
Me.txtzustelladresse = New System.Windows.Forms.TextBox()
|
|
Me.Panel1 = New System.Windows.Forms.Panel()
|
|
Me.WertList = New C1.Win.C1TrueDBGrid.C1TrueDBGrid()
|
|
Me.Label9 = New System.Windows.Forms.Label()
|
|
Me.Button1 = New System.Windows.Forms.Button()
|
|
Me.Button2 = New System.Windows.Forms.Button()
|
|
Me.txtAnrede = New System.Windows.Forms.TextBox()
|
|
Me.Label10 = New System.Windows.Forms.Label()
|
|
Me.Label11 = New System.Windows.Forms.Label()
|
|
Me.btnPartnerInfo = New System.Windows.Forms.Button()
|
|
Me.Panel1.SuspendLayout()
|
|
CType(Me.WertList, System.ComponentModel.ISupportInitialize).BeginInit()
|
|
Me.SuspendLayout()
|
|
'
|
|
'Label1
|
|
'
|
|
Me.Label1.Location = New System.Drawing.Point(8, 16)
|
|
Me.Label1.Name = "Label1"
|
|
Me.Label1.Size = New System.Drawing.Size(88, 16)
|
|
Me.Label1.TabIndex = 0
|
|
Me.Label1.Text = "Partnernr"
|
|
'
|
|
'Label2
|
|
'
|
|
Me.Label2.Location = New System.Drawing.Point(8, 160)
|
|
Me.Label2.Name = "Label2"
|
|
Me.Label2.Size = New System.Drawing.Size(96, 16)
|
|
Me.Label2.TabIndex = 1
|
|
Me.Label2.Text = "Kurzbezeichnung"
|
|
'
|
|
'Label3
|
|
'
|
|
Me.Label3.Location = New System.Drawing.Point(8, 64)
|
|
Me.Label3.Name = "Label3"
|
|
Me.Label3.Size = New System.Drawing.Size(88, 16)
|
|
Me.Label3.TabIndex = 2
|
|
Me.Label3.Text = "Vorname"
|
|
'
|
|
'Label4
|
|
'
|
|
Me.Label4.Location = New System.Drawing.Point(8, 112)
|
|
Me.Label4.Name = "Label4"
|
|
Me.Label4.Size = New System.Drawing.Size(88, 16)
|
|
Me.Label4.TabIndex = 3
|
|
Me.Label4.Text = "Strasse"
|
|
'
|
|
'Label5
|
|
'
|
|
Me.Label5.Location = New System.Drawing.Point(8, 136)
|
|
Me.Label5.Name = "Label5"
|
|
Me.Label5.Size = New System.Drawing.Size(88, 16)
|
|
Me.Label5.TabIndex = 4
|
|
Me.Label5.Text = "PLZ/Ort"
|
|
'
|
|
'Label6
|
|
'
|
|
Me.Label6.Location = New System.Drawing.Point(8, 232)
|
|
Me.Label6.Name = "Label6"
|
|
Me.Label6.Size = New System.Drawing.Size(88, 16)
|
|
Me.Label6.TabIndex = 5
|
|
Me.Label6.Text = "Zustelladresse"
|
|
'
|
|
'Label7
|
|
'
|
|
Me.Label7.Location = New System.Drawing.Point(8, 184)
|
|
Me.Label7.Name = "Label7"
|
|
Me.Label7.Size = New System.Drawing.Size(88, 16)
|
|
Me.Label7.TabIndex = 6
|
|
Me.Label7.Text = "Briefanrede 1"
|
|
'
|
|
'Label8
|
|
'
|
|
Me.Label8.Location = New System.Drawing.Point(8, 208)
|
|
Me.Label8.Name = "Label8"
|
|
Me.Label8.Size = New System.Drawing.Size(88, 16)
|
|
Me.Label8.TabIndex = 7
|
|
Me.Label8.Text = "Briefanrede 2"
|
|
'
|
|
'txtnrpar00
|
|
'
|
|
Me.txtnrpar00.Location = New System.Drawing.Point(112, 16)
|
|
Me.txtnrpar00.Name = "txtnrpar00"
|
|
Me.txtnrpar00.Size = New System.Drawing.Size(144, 20)
|
|
Me.txtnrpar00.TabIndex = 1
|
|
Me.txtnrpar00.Text = ""
|
|
'
|
|
'txtkurzbezeichnung
|
|
'
|
|
Me.txtkurzbezeichnung.Location = New System.Drawing.Point(112, 160)
|
|
Me.txtkurzbezeichnung.Name = "txtkurzbezeichnung"
|
|
Me.txtkurzbezeichnung.Size = New System.Drawing.Size(296, 20)
|
|
Me.txtkurzbezeichnung.TabIndex = 8
|
|
Me.txtkurzbezeichnung.Text = ""
|
|
'
|
|
'txtname
|
|
'
|
|
Me.txtname.Location = New System.Drawing.Point(112, 88)
|
|
Me.txtname.Name = "txtname"
|
|
Me.txtname.Size = New System.Drawing.Size(296, 20)
|
|
Me.txtname.TabIndex = 4
|
|
Me.txtname.Text = ""
|
|
'
|
|
'txtvorname
|
|
'
|
|
Me.txtvorname.Location = New System.Drawing.Point(112, 64)
|
|
Me.txtvorname.Name = "txtvorname"
|
|
Me.txtvorname.Size = New System.Drawing.Size(296, 20)
|
|
Me.txtvorname.TabIndex = 3
|
|
Me.txtvorname.Text = ""
|
|
'
|
|
'txtstrasse
|
|
'
|
|
Me.txtstrasse.Location = New System.Drawing.Point(112, 112)
|
|
Me.txtstrasse.Name = "txtstrasse"
|
|
Me.txtstrasse.Size = New System.Drawing.Size(296, 20)
|
|
Me.txtstrasse.TabIndex = 5
|
|
Me.txtstrasse.Text = ""
|
|
'
|
|
'txtplz
|
|
'
|
|
Me.txtplz.Location = New System.Drawing.Point(112, 136)
|
|
Me.txtplz.Name = "txtplz"
|
|
Me.txtplz.Size = New System.Drawing.Size(72, 20)
|
|
Me.txtplz.TabIndex = 6
|
|
Me.txtplz.Text = ""
|
|
'
|
|
'txtort
|
|
'
|
|
Me.txtort.Location = New System.Drawing.Point(192, 136)
|
|
Me.txtort.Name = "txtort"
|
|
Me.txtort.Size = New System.Drawing.Size(216, 20)
|
|
Me.txtort.TabIndex = 7
|
|
Me.txtort.Text = ""
|
|
'
|
|
'txtanrede1
|
|
'
|
|
Me.txtanrede1.Location = New System.Drawing.Point(112, 184)
|
|
Me.txtanrede1.Name = "txtanrede1"
|
|
Me.txtanrede1.Size = New System.Drawing.Size(296, 20)
|
|
Me.txtanrede1.TabIndex = 9
|
|
Me.txtanrede1.Text = ""
|
|
'
|
|
'txtanrede2
|
|
'
|
|
Me.txtanrede2.Location = New System.Drawing.Point(112, 208)
|
|
Me.txtanrede2.Name = "txtanrede2"
|
|
Me.txtanrede2.Size = New System.Drawing.Size(296, 20)
|
|
Me.txtanrede2.TabIndex = 10
|
|
Me.txtanrede2.Text = ""
|
|
'
|
|
'txtzustelladresse
|
|
'
|
|
Me.txtzustelladresse.Location = New System.Drawing.Point(112, 232)
|
|
Me.txtzustelladresse.Multiline = True
|
|
Me.txtzustelladresse.Name = "txtzustelladresse"
|
|
Me.txtzustelladresse.Size = New System.Drawing.Size(296, 104)
|
|
Me.txtzustelladresse.TabIndex = 11
|
|
Me.txtzustelladresse.Text = ""
|
|
'
|
|
'Panel1
|
|
'
|
|
Me.Panel1.BackColor = System.Drawing.SystemColors.Control
|
|
Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
|
|
Me.Panel1.Controls.AddRange(New System.Windows.Forms.Control() {Me.WertList})
|
|
Me.Panel1.Location = New System.Drawing.Point(112, 344)
|
|
Me.Panel1.Name = "Panel1"
|
|
Me.Panel1.Size = New System.Drawing.Size(296, 128)
|
|
Me.Panel1.TabIndex = 49
|
|
'
|
|
'WertList
|
|
'
|
|
Me.WertList.AllowFilter = False
|
|
Me.WertList.AllowRowSizing = C1.Win.C1TrueDBGrid.RowSizingEnum.AllRows
|
|
Me.WertList.AllowSort = False
|
|
Me.WertList.AlternatingRows = True
|
|
Me.WertList.CaptionHeight = 17
|
|
Me.WertList.CollapseColor = System.Drawing.Color.Black
|
|
Me.WertList.Cursor = System.Windows.Forms.Cursors.Default
|
|
Me.WertList.DataChanged = False
|
|
Me.WertList.DeadAreaBackColor = System.Drawing.Color.Empty
|
|
Me.WertList.Dock = System.Windows.Forms.DockStyle.Fill
|
|
Me.WertList.ExpandColor = System.Drawing.Color.Black
|
|
Me.WertList.FetchRowStyles = True
|
|
Me.WertList.FilterBar = True
|
|
Me.WertList.GroupByCaption = "Drag a column header here to group by that column"
|
|
Me.WertList.Images.Add(CType(resources.GetObject("resource.Images"), System.Drawing.Bitmap))
|
|
Me.WertList.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.DottedCellBorder
|
|
Me.WertList.MultiSelect = C1.Win.C1TrueDBGrid.MultiSelectEnum.None
|
|
Me.WertList.Name = "WertList"
|
|
Me.WertList.PreviewInfo.Location = New System.Drawing.Point(0, 0)
|
|
Me.WertList.PreviewInfo.Size = New System.Drawing.Size(0, 0)
|
|
Me.WertList.PreviewInfo.ZoomFactor = 75
|
|
Me.WertList.PrintInfo.ShowOptionsDialog = False
|
|
Me.WertList.RecordSelectorWidth = 16
|
|
GridLines1.Color = System.Drawing.Color.DarkGray
|
|
GridLines1.Style = C1.Win.C1TrueDBGrid.LineStyleEnum.Single
|
|
Me.WertList.RowDivider = GridLines1
|
|
Me.WertList.RowHeight = 15
|
|
Me.WertList.RowSubDividerColor = System.Drawing.Color.DarkGray
|
|
Me.WertList.ScrollTips = True
|
|
Me.WertList.Size = New System.Drawing.Size(292, 124)
|
|
Me.WertList.TabIndex = 28
|
|
Me.WertList.Text = "C1TrueDBGrid1"
|
|
Me.WertList.PropBag = "<?xml version=""1.0""?><Blob><Styles type=""C1.Win.C1TrueDBGrid.Design.ContextWrappe" & _
|
|
"r""><Data>Style11{}Style12{}Style13{}Style5{}Style4{}Style7{}Style6{}EvenRow{Back" & _
|
|
"Color:White;}Selected{ForeColor:HighlightText;BackColor:Highlight;}Heading{Wrap:" & _
|
|
"True;AlignVert:Center;Border:Raised,,1, 1, 1, 1;ForeColor:ControlText;BackColor:" & _
|
|
"Control;}Inactive{ForeColor:InactiveCaptionText;BackColor:InactiveCaption;}Filte" & _
|
|
"rBar{BackColor:255, 255, 192;}OddRow{BackColor:224, 224, 224;}Footer{}Caption{Al" & _
|
|
"ignHorz:Center;}Style27{}Normal{BackColor:Control;}Style26{}HighlightRow{ForeCol" & _
|
|
"or:HighlightText;BackColor:Highlight;}Style10{AlignHorz:Near;}Editor{}RecordSele" & _
|
|
"ctor{AlignImage:Center;}Style9{}Style8{}Style3{}Style2{}Group{BackColor:ControlD" & _
|
|
"ark;Border:None,,0, 0, 0, 0;AlignVert:Center;}Style1{}</Data></Styles><Splits><C" & _
|
|
"1.Win.C1TrueDBGrid.MergeView Name="""" AlternatingRowStyle=""True"" CaptionHeight=""1" & _
|
|
"7"" ColumnCaptionHeight=""17"" ColumnFooterHeight=""17"" FetchRowStyles=""True"" Filter" & _
|
|
"Bar=""True"" MarqueeStyle=""DottedCellBorder"" RecordSelectorWidth=""16"" DefRecSelWid" & _
|
|
"th=""16"" VerticalScrollGroup=""1"" HorizontalScrollGroup=""1""><ClientRect>0, 0, 288," & _
|
|
" 120</ClientRect><BorderSide>0</BorderSide><CaptionStyle parent=""Heading"" me=""St" & _
|
|
"yle10"" /><EditorStyle parent=""Editor"" me=""Style2"" /><EvenRowStyle parent=""EvenRo" & _
|
|
"w"" me=""Style8"" /><FilterBarStyle parent=""FilterBar"" me=""Style27"" /><FooterStyle " & _
|
|
"parent=""Footer"" me=""Style4"" /><GroupStyle parent=""Group"" me=""Style12"" /><Heading" & _
|
|
"Style parent=""Heading"" me=""Style3"" /><HighLightRowStyle parent=""HighlightRow"" me" & _
|
|
"=""Style7"" /><InactiveStyle parent=""Inactive"" me=""Style6"" /><OddRowStyle parent=""" & _
|
|
"OddRow"" me=""Style9"" /><RecordSelectorStyle parent=""RecordSelector"" me=""Style11"" " & _
|
|
"/><SelectedStyle parent=""Selected"" me=""Style5"" /><Style parent=""Normal"" me=""Styl" & _
|
|
"e1"" /></C1.Win.C1TrueDBGrid.MergeView></Splits><NamedStyles><Style parent="""" me=" & _
|
|
"""Normal"" /><Style parent=""Normal"" me=""Heading"" /><Style parent=""Heading"" me=""Foo" & _
|
|
"ter"" /><Style parent=""Heading"" me=""Caption"" /><Style parent=""Heading"" me=""Inacti" & _
|
|
"ve"" /><Style parent=""Normal"" me=""Selected"" /><Style parent=""Normal"" me=""Editor"" " & _
|
|
"/><Style parent=""Normal"" me=""HighlightRow"" /><Style parent=""Normal"" me=""EvenRow""" & _
|
|
" /><Style parent=""Normal"" me=""OddRow"" /><Style parent=""Heading"" me=""RecordSelect" & _
|
|
"or"" /><Style parent=""Normal"" me=""FilterBar"" /><Style parent=""Caption"" me=""Group""" & _
|
|
" /></NamedStyles><vertSplits>1</vertSplits><horzSplits>1</horzSplits><Layout>Mod" & _
|
|
"ified</Layout><DefaultRecSelWidth>16</DefaultRecSelWidth><ClientArea>0, 0, 288, " & _
|
|
"120</ClientArea></Blob>"
|
|
'
|
|
'Label9
|
|
'
|
|
Me.Label9.Location = New System.Drawing.Point(8, 344)
|
|
Me.Label9.Name = "Label9"
|
|
Me.Label9.Size = New System.Drawing.Size(96, 32)
|
|
Me.Label9.TabIndex = 50
|
|
Me.Label9.Text = "Dokument-spezifische Werte"
|
|
'
|
|
'Button1
|
|
'
|
|
Me.Button1.DialogResult = System.Windows.Forms.DialogResult.Abort
|
|
Me.Button1.Location = New System.Drawing.Point(8, 480)
|
|
Me.Button1.Name = "Button1"
|
|
Me.Button1.Size = New System.Drawing.Size(112, 24)
|
|
Me.Button1.TabIndex = 12
|
|
Me.Button1.Text = "Abbruch"
|
|
'
|
|
'Button2
|
|
'
|
|
Me.Button2.DialogResult = System.Windows.Forms.DialogResult.OK
|
|
Me.Button2.Location = New System.Drawing.Point(296, 480)
|
|
Me.Button2.Name = "Button2"
|
|
Me.Button2.Size = New System.Drawing.Size(112, 24)
|
|
Me.Button2.TabIndex = 13
|
|
Me.Button2.Text = "Speichern"
|
|
'
|
|
'txtAnrede
|
|
'
|
|
Me.txtAnrede.Location = New System.Drawing.Point(112, 40)
|
|
Me.txtAnrede.Name = "txtAnrede"
|
|
Me.txtAnrede.Size = New System.Drawing.Size(144, 20)
|
|
Me.txtAnrede.TabIndex = 2
|
|
Me.txtAnrede.Text = ""
|
|
'
|
|
'Label10
|
|
'
|
|
Me.Label10.Location = New System.Drawing.Point(8, 40)
|
|
Me.Label10.Name = "Label10"
|
|
Me.Label10.Size = New System.Drawing.Size(88, 16)
|
|
Me.Label10.TabIndex = 53
|
|
Me.Label10.Text = "Anrede"
|
|
'
|
|
'Label11
|
|
'
|
|
Me.Label11.Location = New System.Drawing.Point(8, 88)
|
|
Me.Label11.Name = "Label11"
|
|
Me.Label11.Size = New System.Drawing.Size(88, 16)
|
|
Me.Label11.TabIndex = 55
|
|
Me.Label11.Text = "Name/Firma"
|
|
'
|
|
'btnPartnerInfo
|
|
'
|
|
Me.btnPartnerInfo.Image = CType(resources.GetObject("btnPartnerInfo.Image"), System.Drawing.Bitmap)
|
|
Me.btnPartnerInfo.Location = New System.Drawing.Point(256, 16)
|
|
Me.btnPartnerInfo.Name = "btnPartnerInfo"
|
|
Me.btnPartnerInfo.Size = New System.Drawing.Size(24, 24)
|
|
Me.btnPartnerInfo.TabIndex = 56
|
|
'
|
|
'frmsbpartnerdetail
|
|
'
|
|
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
|
|
Me.ClientSize = New System.Drawing.Size(416, 509)
|
|
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnPartnerInfo, Me.Label11, Me.txtAnrede, Me.Label10, Me.Button2, Me.Button1, Me.Label9, Me.Panel1, Me.txtzustelladresse, Me.txtanrede2, Me.txtanrede1, Me.txtort, Me.txtplz, Me.txtstrasse, Me.txtvorname, Me.txtname, Me.txtkurzbezeichnung, Me.txtnrpar00, Me.Label8, Me.Label7, Me.Label6, Me.Label5, Me.Label4, Me.Label3, Me.Label2, Me.Label1})
|
|
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
|
Me.Name = "frmsbpartnerdetail"
|
|
Me.ShowInTaskbar = False
|
|
Me.Text = "Empfänger-Details"
|
|
Me.Panel1.ResumeLayout(False)
|
|
CType(Me.WertList, System.ComponentModel.ISupportInitialize).EndInit()
|
|
Me.ResumeLayout(False)
|
|
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
#Region "Deklarationen"
|
|
Dim dr As DataRow()
|
|
Dim dt As New DataTable()
|
|
Dim AddNew As Boolean = False
|
|
Dim nrpar00 As Integer = 0
|
|
Dim adressarray(6) As String
|
|
|
|
#End Region
|
|
|
|
#Region "Datenbankzugriffe"
|
|
Private Function Generic_Select(ByVal typ As Integer) As DataTable
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
Select Case typ
|
|
Case 1
|
|
scmCmdToExecute.CommandText = "dbo.SP_get_ort"
|
|
Case 2
|
|
scmCmdToExecute.CommandText = "dbo.SP_check_partner"
|
|
Case Else
|
|
End Select
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
Dim dtToReturn As DataTable = New DataTable()
|
|
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
|
scmCmdToExecute.Connection = conn.scoDBConnection
|
|
Try
|
|
Select Case typ
|
|
Case 1
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@plz", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, Me.txtplz.Text))
|
|
Case Else
|
|
End Select
|
|
If typ = 1 Then
|
|
End If
|
|
sdaAdapter.Fill(dtToReturn)
|
|
Return dtToReturn
|
|
Catch ex As Exception
|
|
' // some error occured. Bubble it to caller and encapsulate Exception object
|
|
Throw New Exception("Dokumenterstellung::Generic_Select::" & scmCmdToExecute.CommandText & "::Error occured." & ex.Message, ex)
|
|
Finally
|
|
scmCmdToExecute.Dispose()
|
|
sdaAdapter.Dispose()
|
|
End Try
|
|
End Function
|
|
|
|
#End Region
|
|
|
|
Public Sub New(ByVal add As Boolean, ByVal dt As DataTable, ByVal nrpar00 As String)
|
|
MyBase.New()
|
|
InitializeComponent()
|
|
Try
|
|
Me.nrpar00 = nrpar00
|
|
Catch
|
|
Me.nrpar00 = -1
|
|
End Try
|
|
Me.AddNew = add
|
|
Me.dt = dt
|
|
End Sub
|
|
|
|
Private Sub frmsbpartnerdetail_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
|
Me.btnPartnerInfo.Visible = False
|
|
If Me.AddNew Then
|
|
Me.txtnrpar00.Text = ""
|
|
Me.txtnrpar00.Enabled = False
|
|
Else
|
|
If Me.nrpar00 = -1 Then
|
|
Me.txtnrpar00.Text = ""
|
|
Else
|
|
Me.txtnrpar00.Text = Me.nrpar00.ToString
|
|
End If
|
|
If Me.txtnrpar00.Text <> "" Then
|
|
Me.txtnrpar00.Enabled = False
|
|
' Me.txtAnrede.Enabled = False
|
|
' Me.txtname.Enabled = False
|
|
' Me.txtvorname.Enabled = False
|
|
' Me.txtstrasse.Enabled = False
|
|
' Me.txtplz.Enabled = False
|
|
' Me.txtort.Enabled = False
|
|
' Me.txtkurzbezeichnung.Enabled = False
|
|
End If
|
|
Me.txtanrede1.Focus()
|
|
End If
|
|
If Me.txtnrpar00.Text <> "" Then Me.btnPartnerInfo.Visible = True
|
|
End Sub
|
|
|
|
Private Sub txtplz_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtplz.Leave
|
|
Dim plz As DataTable
|
|
plz = Generic_Select(1)
|
|
If plz.Rows.Count > 0 And Me.txtort.Text = "" Then
|
|
Me.txtort.Text = plz.Rows(0).Item(2)
|
|
End If
|
|
plz.Dispose()
|
|
End Sub
|
|
|
|
Private Sub txtname_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtname.Leave, txtort.Leave, txtAnrede.Leave, txtvorname.Leave, txtstrasse.Leave, txtplz.Leave, txtAnrede.Enter
|
|
If Me.txtnrpar00.Text <> "" Then Exit Sub
|
|
If Me.txtvorname.Text = "" Then
|
|
Me.txtkurzbezeichnung.Text = Me.txtname.Text
|
|
Me.txtanrede1.Text = "Damen und Herren"
|
|
Else
|
|
Me.txtkurzbezeichnung.Text = Me.txtvorname.Text + " " + Me.txtname.Text
|
|
Me.txtanrede1.Text = Me.txtAnrede.Text + " " + Me.txtname.Text
|
|
End If
|
|
If Me.txtort.Text <> "" Then
|
|
Me.txtkurzbezeichnung.Text = Me.txtkurzbezeichnung.Text + ", " + Me.txtort.Text
|
|
End If
|
|
|
|
'Adresse
|
|
Dim i As Integer
|
|
For i = 0 To 6
|
|
Me.adressarray(i) = ""
|
|
Next
|
|
i = 0
|
|
If Me.txtAnrede.Text <> "" Then
|
|
Me.adressarray(i) = Me.txtAnrede.Text
|
|
i = i + 1
|
|
End If
|
|
If Me.txtvorname.Text <> "" Then
|
|
Me.adressarray(i) = Me.txtvorname.Text + " " + Me.txtname.Text
|
|
i = i + 1
|
|
Else
|
|
Me.adressarray(i) = Me.txtname.Text
|
|
i = i + 1
|
|
End If
|
|
|
|
If Me.txtstrasse.Text <> "" Then
|
|
Me.adressarray(i) = Me.txtstrasse.Text
|
|
i = i + 1
|
|
End If
|
|
Me.adressarray(i) = Me.txtplz.Text + " " + Me.txtort.Text
|
|
|
|
Me.txtzustelladresse.Text = ""
|
|
Me.txtzustelladresse.Text = Me.adressarray(0) + vbCrLf + Me.adressarray(1) + vbCrLf + Me.adressarray(2) + vbCrLf + Me.adressarray(3) + vbCrLf + Me.adressarray(4) + vbCrLf + Me.adressarray(5) + vbCrLf + Me.adressarray(6)
|
|
End Sub
|
|
|
|
Private Sub btnPartnerInfo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPartnerInfo.Click
|
|
Try
|
|
If Me.txtnrpar00.Text > 91000000 Then
|
|
Dim f As New frmInteressent()
|
|
f.Partnernr = Me.txtnrpar00.Text
|
|
f.Display = True
|
|
f.ShowDialog()
|
|
f.Dispose()
|
|
Else
|
|
Dim f As New frmPartnerDetails()
|
|
f.Partnernr = Me.txtnrpar00.Text
|
|
f.ShowDialog()
|
|
f.Dispose()
|
|
End If
|
|
Catch
|
|
Finally
|
|
End Try
|
|
|
|
End Sub
|
|
|
|
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
|
|
Me.DialogResult = DialogResult.OK
|
|
Me.Close()
|
|
End Sub
|
|
End Class
|