'* ' Objekct Selektion_mandant ' ' Dieses Formular wird für die Mandanten-Selektion beim Anwendugnsstart verwendet. ' ' Autor: Stefan Hutter ' Datum: 2.12.2002 '* Public Class Selektion_Mandant Inherits System.Windows.Forms.Form #Region "Deklarationen" Private _mandantnr As Long Private _mandant As String Property mandantnr() As Long Get Return _mandantnr End Get Set(ByVal Value As Long) _mandantnr = Value End Set End Property Property mandant() As String Get Return _mandant End Get Set(ByVal Value As String) _mandant = Value End Set End Property #End Region #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 MandantList As C1.Win.C1List.C1List Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents BtnOK As System.Windows.Forms.Button Friend WithEvents BtnAbbruch As System.Windows.Forms.Button Private Sub InitializeComponent() Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Selektion_Mandant)) Me.MandantList = New C1.Win.C1List.C1List() Me.Label1 = New System.Windows.Forms.Label() Me.BtnOK = New System.Windows.Forms.Button() Me.BtnAbbruch = New System.Windows.Forms.Button() CType(Me.MandantList, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'MandantList ' Me.MandantList.AccessibleDescription = CType(resources.GetObject("MandantList.AccessibleDescription"), String) Me.MandantList.AccessibleName = CType(resources.GetObject("MandantList.AccessibleName"), String) Me.MandantList.AddItemCols = 0 Me.MandantList.AddItemSeparator = Microsoft.VisualBasic.ChrW(59) Me.MandantList.AllowSort = True Me.MandantList.AlternatingRows = True Me.MandantList.Anchor = CType(resources.GetObject("MandantList.Anchor"), System.Windows.Forms.AnchorStyles) Me.MandantList.BackgroundImage = CType(resources.GetObject("MandantList.BackgroundImage"), System.Drawing.Image) Me.MandantList.Caption = "C1List .Net" Me.MandantList.CaptionHeight = 17 Me.MandantList.ColumnCaptionHeight = 17 Me.MandantList.ColumnFooterHeight = 17 Me.MandantList.ColumnHeaders = False Me.MandantList.DataMode = C1.Win.C1List.DataModeEnum.Normal Me.MandantList.DeadAreaBackColor = System.Drawing.SystemColors.ControlDark Me.MandantList.Dock = CType(resources.GetObject("MandantList.Dock"), System.Windows.Forms.DockStyle) Me.MandantList.Enabled = CType(resources.GetObject("MandantList.Enabled"), Boolean) Me.MandantList.FetchRowStyles = True Me.MandantList.Font = CType(resources.GetObject("MandantList.Font"), System.Drawing.Font) Me.MandantList.Images.Add(CType(resources.GetObject("resource.Images"), System.Drawing.Bitmap)) Me.MandantList.ImeMode = CType(resources.GetObject("MandantList.ImeMode"), System.Windows.Forms.ImeMode) Me.MandantList.ItemHeight = 15 Me.MandantList.Location = CType(resources.GetObject("MandantList.Location"), System.Drawing.Point) Me.MandantList.MatchCol = C1.Win.C1List.MatchColEnum.CurrentMousePos Me.MandantList.MatchCompare = C1.Win.C1List.MatchCompareEnum.PartiallyEqual Me.MandantList.MatchEntry = C1.Win.C1List.MatchEntryEnum.None Me.MandantList.MatchEntryTimeout = CType(2000, Long) Me.MandantList.Name = "MandantList" Me.MandantList.RightToLeft = CType(resources.GetObject("MandantList.RightToLeft"), System.Windows.Forms.RightToLeft) Me.MandantList.RowDivider.Color = System.Drawing.Color.DarkGray Me.MandantList.RowDivider.Style = C1.Win.C1List.LineStyleEnum.None Me.MandantList.RowSubDividerColor = System.Drawing.Color.DarkGray Me.MandantList.ScrollTips = False Me.MandantList.Size = CType(resources.GetObject("MandantList.Size"), System.Drawing.Size) Me.MandantList.TabIndex = CType(resources.GetObject("MandantList.TabIndex"), Integer) Me.MandantList.Text = resources.GetString("MandantList.Text") Me.MandantList.Visible = CType(resources.GetObject("MandantList.Visible"), Boolean) Me.MandantList.PropBag = CType(resources.GetObject("MandantList.PropBag"), String) ' 'Label1 ' Me.Label1.AccessibleDescription = CType(resources.GetObject("Label1.AccessibleDescription"), String) Me.Label1.AccessibleName = CType(resources.GetObject("Label1.AccessibleName"), String) Me.Label1.Anchor = CType(resources.GetObject("Label1.Anchor"), System.Windows.Forms.AnchorStyles) Me.Label1.AutoSize = CType(resources.GetObject("Label1.AutoSize"), Boolean) Me.Label1.Dock = CType(resources.GetObject("Label1.Dock"), System.Windows.Forms.DockStyle) Me.Label1.Enabled = CType(resources.GetObject("Label1.Enabled"), Boolean) Me.Label1.Font = CType(resources.GetObject("Label1.Font"), System.Drawing.Font) Me.Label1.Image = CType(resources.GetObject("Label1.Image"), System.Drawing.Image) Me.Label1.ImageAlign = CType(resources.GetObject("Label1.ImageAlign"), System.Drawing.ContentAlignment) Me.Label1.ImageIndex = CType(resources.GetObject("Label1.ImageIndex"), Integer) Me.Label1.ImeMode = CType(resources.GetObject("Label1.ImeMode"), System.Windows.Forms.ImeMode) Me.Label1.Location = CType(resources.GetObject("Label1.Location"), System.Drawing.Point) Me.Label1.Name = "Label1" Me.Label1.RightToLeft = CType(resources.GetObject("Label1.RightToLeft"), System.Windows.Forms.RightToLeft) Me.Label1.Size = CType(resources.GetObject("Label1.Size"), System.Drawing.Size) Me.Label1.TabIndex = CType(resources.GetObject("Label1.TabIndex"), Integer) Me.Label1.Text = resources.GetString("Label1.Text") Me.Label1.TextAlign = CType(resources.GetObject("Label1.TextAlign"), System.Drawing.ContentAlignment) Me.Label1.Visible = CType(resources.GetObject("Label1.Visible"), Boolean) ' 'BtnOK ' Me.BtnOK.AccessibleDescription = CType(resources.GetObject("BtnOK.AccessibleDescription"), String) Me.BtnOK.AccessibleName = CType(resources.GetObject("BtnOK.AccessibleName"), String) Me.BtnOK.Anchor = CType(resources.GetObject("BtnOK.Anchor"), System.Windows.Forms.AnchorStyles) Me.BtnOK.BackgroundImage = CType(resources.GetObject("BtnOK.BackgroundImage"), System.Drawing.Image) Me.BtnOK.Dock = CType(resources.GetObject("BtnOK.Dock"), System.Windows.Forms.DockStyle) Me.BtnOK.Enabled = CType(resources.GetObject("BtnOK.Enabled"), Boolean) Me.BtnOK.FlatStyle = CType(resources.GetObject("BtnOK.FlatStyle"), System.Windows.Forms.FlatStyle) Me.BtnOK.Font = CType(resources.GetObject("BtnOK.Font"), System.Drawing.Font) Me.BtnOK.Image = CType(resources.GetObject("BtnOK.Image"), System.Drawing.Image) Me.BtnOK.ImageAlign = CType(resources.GetObject("BtnOK.ImageAlign"), System.Drawing.ContentAlignment) Me.BtnOK.ImageIndex = CType(resources.GetObject("BtnOK.ImageIndex"), Integer) Me.BtnOK.ImeMode = CType(resources.GetObject("BtnOK.ImeMode"), System.Windows.Forms.ImeMode) Me.BtnOK.Location = CType(resources.GetObject("BtnOK.Location"), System.Drawing.Point) Me.BtnOK.Name = "BtnOK" Me.BtnOK.RightToLeft = CType(resources.GetObject("BtnOK.RightToLeft"), System.Windows.Forms.RightToLeft) Me.BtnOK.Size = CType(resources.GetObject("BtnOK.Size"), System.Drawing.Size) Me.BtnOK.TabIndex = CType(resources.GetObject("BtnOK.TabIndex"), Integer) Me.BtnOK.Text = resources.GetString("BtnOK.Text") Me.BtnOK.TextAlign = CType(resources.GetObject("BtnOK.TextAlign"), System.Drawing.ContentAlignment) Me.BtnOK.Visible = CType(resources.GetObject("BtnOK.Visible"), Boolean) ' 'BtnAbbruch ' Me.BtnAbbruch.AccessibleDescription = CType(resources.GetObject("BtnAbbruch.AccessibleDescription"), String) Me.BtnAbbruch.AccessibleName = CType(resources.GetObject("BtnAbbruch.AccessibleName"), String) Me.BtnAbbruch.Anchor = CType(resources.GetObject("BtnAbbruch.Anchor"), System.Windows.Forms.AnchorStyles) Me.BtnAbbruch.BackgroundImage = CType(resources.GetObject("BtnAbbruch.BackgroundImage"), System.Drawing.Image) Me.BtnAbbruch.Dock = CType(resources.GetObject("BtnAbbruch.Dock"), System.Windows.Forms.DockStyle) Me.BtnAbbruch.Enabled = CType(resources.GetObject("BtnAbbruch.Enabled"), Boolean) Me.BtnAbbruch.FlatStyle = CType(resources.GetObject("BtnAbbruch.FlatStyle"), System.Windows.Forms.FlatStyle) Me.BtnAbbruch.Font = CType(resources.GetObject("BtnAbbruch.Font"), System.Drawing.Font) Me.BtnAbbruch.Image = CType(resources.GetObject("BtnAbbruch.Image"), System.Drawing.Image) Me.BtnAbbruch.ImageAlign = CType(resources.GetObject("BtnAbbruch.ImageAlign"), System.Drawing.ContentAlignment) Me.BtnAbbruch.ImageIndex = CType(resources.GetObject("BtnAbbruch.ImageIndex"), Integer) Me.BtnAbbruch.ImeMode = CType(resources.GetObject("BtnAbbruch.ImeMode"), System.Windows.Forms.ImeMode) Me.BtnAbbruch.Location = CType(resources.GetObject("BtnAbbruch.Location"), System.Drawing.Point) Me.BtnAbbruch.Name = "BtnAbbruch" Me.BtnAbbruch.RightToLeft = CType(resources.GetObject("BtnAbbruch.RightToLeft"), System.Windows.Forms.RightToLeft) Me.BtnAbbruch.Size = CType(resources.GetObject("BtnAbbruch.Size"), System.Drawing.Size) Me.BtnAbbruch.TabIndex = CType(resources.GetObject("BtnAbbruch.TabIndex"), Integer) Me.BtnAbbruch.Text = resources.GetString("BtnAbbruch.Text") Me.BtnAbbruch.TextAlign = CType(resources.GetObject("BtnAbbruch.TextAlign"), System.Drawing.ContentAlignment) Me.BtnAbbruch.Visible = CType(resources.GetObject("BtnAbbruch.Visible"), Boolean) ' 'Selektion_Mandant ' Me.AccessibleDescription = CType(resources.GetObject("$this.AccessibleDescription"), String) Me.AccessibleName = CType(resources.GetObject("$this.AccessibleName"), String) Me.Anchor = CType(resources.GetObject("$this.Anchor"), System.Windows.Forms.AnchorStyles) Me.AutoScaleBaseSize = CType(resources.GetObject("$this.AutoScaleBaseSize"), System.Drawing.Size) Me.AutoScroll = CType(resources.GetObject("$this.AutoScroll"), Boolean) Me.AutoScrollMargin = CType(resources.GetObject("$this.AutoScrollMargin"), System.Drawing.Size) Me.AutoScrollMinSize = CType(resources.GetObject("$this.AutoScrollMinSize"), System.Drawing.Size) Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image) Me.ClientSize = CType(resources.GetObject("$this.ClientSize"), System.Drawing.Size) Me.ControlBox = False Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.BtnAbbruch, Me.BtnOK, Me.Label1, Me.MandantList}) Me.Dock = CType(resources.GetObject("$this.Dock"), System.Windows.Forms.DockStyle) Me.Enabled = CType(resources.GetObject("$this.Enabled"), Boolean) Me.Font = CType(resources.GetObject("$this.Font"), System.Drawing.Font) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.ImeMode = CType(resources.GetObject("$this.ImeMode"), System.Windows.Forms.ImeMode) Me.Location = CType(resources.GetObject("$this.Location"), System.Drawing.Point) Me.MaximumSize = CType(resources.GetObject("$this.MaximumSize"), System.Drawing.Size) Me.MinimumSize = CType(resources.GetObject("$this.MinimumSize"), System.Drawing.Size) Me.Name = "Selektion_Mandant" Me.RightToLeft = CType(resources.GetObject("$this.RightToLeft"), System.Windows.Forms.RightToLeft) Me.ShowInTaskbar = False Me.StartPosition = CType(resources.GetObject("$this.StartPosition"), System.Windows.Forms.FormStartPosition) Me.Text = resources.GetString("$this.Text") Me.Visible = CType(resources.GetObject("$this.Visible"), Boolean) CType(Me.MandantList, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub #End Region ' vorhandene aktive Mandanten laden Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim ts As New EDOKA.Tabellenspalte() Dim titel As New EDOKA.MySpaltenTitel() Dim mandanten As New edokadb.clsMyMandat() Dim i As Integer mandantnr = 0 mandant = "" mandanten.cpMainConnectionProvider = conn ' Lesen der vorhandenen Daten ' Aufbereitung im Datagrid Mandantlist Me.MandantList.DataSource = mandanten.SelectAll Me.MandantList.Caption = "" Me.MandantList.SelectedIndex = 0 For i = 0 To Me.MandantList.Columns.Count - 1 ts.Tabelle = "Mandant" ts.Feld = Me.MandantList.Columns(i).Caption ts.getspalte() Me.MandantList.Columns(i).Caption = ts.spaltenname Next End Sub 'Prüfung, ob ein Mandant ausgewählt wurde. Wenn nicht, dann Fehlermeldung ausgeben Private Sub BtnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOK.Click If Me.MandantList.GetItemText(Me.MandantList.SelectedIndex, 0) = "" Then MyMsg.show_standardmessage(1, MsgBoxStyle.Question) Else mandantnr = Me.MandantList.GetItemText(Me.MandantList.SelectedIndex, 0) mandant = Me.MandantList.GetItemText(Me.MandantList.SelectedIndex, 1) Globals.MandantNr = mandantnr Globals.MandantText = mandant Me.Close() End If End Sub 'Bei Abbruch Anwendung schliessen Private Sub BtnAbbruch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnAbbruch.Click If MyMsg.Show_MessageYesNo(1) = MsgBoxResult.Yes Then End End If End Sub Private Sub MandantList_Doubleclick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MandantList.DoubleClick BtnOK_Click(sender, e) End Sub End Class