From c90ae947518c2eb964007c26fb55d23225f6e32e Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Fri, 24 Nov 2023 11:45:37 +0100 Subject: [PATCH] Warenorte-ReadOnly eingebaut --- Aviso/frmHauptfenster.Designer.vb | 28 ++++---- Aviso/frmHauptfenster.vb | 11 ++- Aviso/frmWarenorte.Designer.vb | 113 +++++++++++++++--------------- Aviso/frmWarenorte.vb | 41 ++++++++++- 4 files changed, 112 insertions(+), 81 deletions(-) diff --git a/Aviso/frmHauptfenster.Designer.vb b/Aviso/frmHauptfenster.Designer.vb index a55010b..312d24e 100644 --- a/Aviso/frmHauptfenster.Designer.vb +++ b/Aviso/frmHauptfenster.Designer.vb @@ -22,7 +22,6 @@ Partial Class frmHauptfenster 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmHauptfenster)) Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() @@ -35,7 +34,7 @@ Partial Class frmHauptfenster Dim DataGridViewCellStyle9 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Me.mnuInfo = New System.Windows.Forms.ToolStripMenuItem() Me.conÜbernehmen = New System.Windows.Forms.ToolStripMenuItem() - Me.conMenuAviso = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.conMenuAviso = New System.Windows.Forms.ContextMenuStrip() Me.ToolStripSeparator5 = New System.Windows.Forms.ToolStripSeparator() Me.conFertig = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() @@ -256,7 +255,7 @@ Partial Class frmHauptfenster Me.Label2 = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() - Me.Timer1 = New System.Windows.Forms.Timer(Me.components) + Me.Timer1 = New System.Windows.Forms.Timer() Me.btnWichtige = New System.Windows.Forms.Button() Me.btnWichtigeStandort = New System.Windows.Forms.Button() Me.btnMinimieren = New System.Windows.Forms.Button() @@ -275,13 +274,13 @@ Partial Class frmHauptfenster Me.Label22 = New System.Windows.Forms.Label() Me.Button12 = New System.Windows.Forms.Button() Me.btnNeu = New System.Windows.Forms.Button() - Me.cntxtAtilla = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.cntxtAtilla = New System.Windows.Forms.ContextMenuStrip() Me.ToolStripMenuItem17 = New System.Windows.Forms.ToolStripMenuItem() Me.SplitContainer3 = New System.Windows.Forms.SplitContainer() Me.UsrCntlBenachrichtigungen1 = New AVISO.usrCntlBenachrichtigungen() Me.pnl = New System.Windows.Forms.Panel() Me.Button10 = New System.Windows.Forms.Button() - Me.gridMyAviso = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) + Me.gridMyAviso = New VERAG_PROG_ALLGEMEIN.MyDatagridview() Me.Panel6 = New System.Windows.Forms.Panel() Me.cbx_My_Brexit = New System.Windows.Forms.CheckBox() Me.btnColor = New System.Windows.Forms.Button() @@ -295,7 +294,7 @@ Partial Class frmHauptfenster Me.lblMySND_Anzeige = New System.Windows.Forms.Label() Me.lblAkte = New System.Windows.Forms.Label() Me.btnClose = New System.Windows.Forms.Button() - Me.TimerAkte = New System.Windows.Forms.Timer(Me.components) + Me.TimerAkte = New System.Windows.Forms.Timer() Me.tabVorgeschrieben = New System.Windows.Forms.TabPage() Me.tabFreigegeben = New System.Windows.Forms.TabPage() Me.tabNichtEingetroffen = New System.Windows.Forms.TabPage() @@ -312,7 +311,7 @@ Partial Class frmHauptfenster Me.SplitContainer1 = New System.Windows.Forms.SplitContainer() Me.pnlDetailsLinks = New System.Windows.Forms.Panel() Me.splitMain = New System.Windows.Forms.SplitContainer() - Me.gridAviso = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) + Me.gridAviso = New VERAG_PROG_ALLGEMEIN.MyDatagridview() Me.Panel1 = New System.Windows.Forms.Panel() Me.txtBestimmungszollstelle = New VERAG_PROG_ALLGEMEIN.MySearchBox() Me.Label10 = New System.Windows.Forms.Label() @@ -354,17 +353,17 @@ Partial Class frmHauptfenster Me.lblErwAuftraggeber = New System.Windows.Forms.Label() Me.cbxAlle = New System.Windows.Forms.CheckBox() Me.btnSmall = New System.Windows.Forms.Button() - Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components) + Me.ToolTip1 = New System.Windows.Forms.ToolTip() Me.BackgroundWorker1 = New System.ComponentModel.BackgroundWorker() - Me.timerStandzeit = New System.Windows.Forms.Timer(Me.components) + Me.timerStandzeit = New System.Windows.Forms.Timer() Me.Label9 = New System.Windows.Forms.Label() - Me.TimerUPDATE = New System.Windows.Forms.Timer(Me.components) + Me.TimerUPDATE = New System.Windows.Forms.Timer() Me.ToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem() Me.pnlOptionen = New System.Windows.Forms.Panel() Me.btnKasse_User = New System.Windows.Forms.Button() Me.btnKasse_LG = New System.Windows.Forms.Button() Me.btnTV = New System.Windows.Forms.Button() - Me.cntxt = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.cntxt = New System.Windows.Forms.ContextMenuStrip() Me.BundesanzeigerToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.EUTaricToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ZugelassenerAusführerToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() @@ -373,9 +372,9 @@ Partial Class frmHauptfenster Me.BrexitToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem() Me.EmbargosLänderToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.GüterlisteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.Timer_REFRESH = New System.Windows.Forms.Timer(Me.components) + Me.Timer_REFRESH = New System.Windows.Forms.Timer() Me.ColorDialog = New System.Windows.Forms.ColorDialog() - Me.ctxtFarben = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.ctxtFarben = New System.Windows.Forms.ContextMenuStrip() Me.ALLEToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripMenuItem19 = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripMenuItem20 = New System.Windows.Forms.ToolStripMenuItem() @@ -383,7 +382,7 @@ Partial Class frmHauptfenster Me.Panel3 = New System.Windows.Forms.Panel() Me.Panel4 = New System.Windows.Forms.Panel() Me.UsrCntlTestsystem1 = New VERAG_PROG_ALLGEMEIN.usrCntlTestsystem() - Me.cntVerag = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.cntVerag = New System.Windows.Forms.ContextMenuStrip() Me.ZertifikateToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.HomepageToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.conMenuAviso.SuspendLayout() @@ -1059,7 +1058,6 @@ Partial Class frmHauptfenster Me.WarenorteToolStripMenuItem.Name = "WarenorteToolStripMenuItem" Me.WarenorteToolStripMenuItem.Size = New System.Drawing.Size(383, 22) Me.WarenorteToolStripMenuItem.Text = "Warenorte" - Me.WarenorteToolStripMenuItem.Visible = False ' 'DatevBuchungsexportToolStripMenuItem ' diff --git a/Aviso/frmHauptfenster.vb b/Aviso/frmHauptfenster.vb index f9bf411..db07a3b 100644 --- a/Aviso/frmHauptfenster.vb +++ b/Aviso/frmHauptfenster.vb @@ -575,12 +575,6 @@ Public Class frmHauptfenster DatevBuchungsexportToolStripMenuItem.Visible = True End If - If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("WARENORTE", "AVISO") Then - WarenorteToolStripMenuItem.Visible = True - End If - - - Panel1.Height -= pnlSearch.Height @@ -4494,7 +4488,10 @@ Public Class frmHauptfenster End Sub Private Sub WarenorteToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles WarenorteToolStripMenuItem.Click - Dim f As New frmWarenorte() + Dim enableWritepermissions As Boolean + If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("WARENORTE", "AVISO") Then enableWritepermissions = True + + Dim f As New frmWarenorte(enableWritepermissions) f.ShowDialog(Me) End Sub diff --git a/Aviso/frmWarenorte.Designer.vb b/Aviso/frmWarenorte.Designer.vb index d181fa9..9d304b2 100644 --- a/Aviso/frmWarenorte.Designer.vb +++ b/Aviso/frmWarenorte.Designer.vb @@ -22,13 +22,11 @@ Partial Class frmWarenorte 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmWarenorte)) Me.pnlTop = New System.Windows.Forms.Panel() Me.lblWarning = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() - Me.cbxFirma = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.btnAdd = New System.Windows.Forms.Button() Me.btnDelete = New System.Windows.Forms.Button() Me.txtWarenort = New System.Windows.Forms.TextBox() @@ -51,14 +49,15 @@ Partial Class frmWarenorte Me.cxZV = New System.Windows.Forms.CheckBox() Me.txtStrasse = New System.Windows.Forms.TextBox() Me.Label10 = New System.Windows.Forms.Label() - Me.cbxFirmaChange = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.Label = New System.Windows.Forms.Label() Me.Label9 = New System.Windows.Forms.Label() Me.txtReihenfolge = New System.Windows.Forms.TextBox() Me.btnSave = New System.Windows.Forms.Button() - Me.cbxGrenzstelle = New VERAG_PROG_ALLGEMEIN.MyComboBox() - Me.dgvWarenorteNew = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) Me.UsrcntlPDFScanList1 = New VERAG_PROG_ALLGEMEIN.usrcntlPDFScanList() + Me.cbxFirmaChange = New VERAG_PROG_ALLGEMEIN.MyComboBox() + Me.cbxGrenzstelle = New VERAG_PROG_ALLGEMEIN.MyComboBox() + Me.cbxFirma = New VERAG_PROG_ALLGEMEIN.MyComboBox() + Me.dgvWarenorteNew = New VERAG_PROG_ALLGEMEIN.MyDatagridview() Me.pnlTop.SuspendLayout() Me.mainPanel.SuspendLayout() Me.GroupBoxFK.SuspendLayout() @@ -109,18 +108,6 @@ Partial Class frmWarenorte Me.Label3.TabIndex = 5 Me.Label3.Text = "Firma" ' - 'cbxFirma - ' - Me.cbxFirma._allowedValuesFreiText = Nothing - Me.cbxFirma._allowFreiText = False - Me.cbxFirma._value = "" - Me.cbxFirma.DropDownWidth = 150 - Me.cbxFirma.FormattingEnabled = True - Me.cbxFirma.Location = New System.Drawing.Point(595, 24) - Me.cbxFirma.Name = "cbxFirma" - Me.cbxFirma.Size = New System.Drawing.Size(128, 21) - Me.cbxFirma.TabIndex = 13 - ' 'btnAdd ' Me.btnAdd.BackgroundImage = Global.AVISO.My.Resources.Resources.plus @@ -342,20 +329,6 @@ Partial Class frmWarenorte Me.Label10.TabIndex = 23 Me.Label10.Text = "Strasse" ' - 'cbxFirmaChange - ' - Me.cbxFirmaChange._allowedValuesFreiText = Nothing - Me.cbxFirmaChange._allowFreiText = False - Me.cbxFirmaChange._value = "" - Me.cbxFirmaChange.DropDownWidth = 120 - Me.cbxFirmaChange.Enabled = False - Me.cbxFirmaChange.FormattingEnabled = True - Me.cbxFirmaChange.Location = New System.Drawing.Point(298, 175) - Me.cbxFirmaChange.Name = "cbxFirmaChange" - Me.cbxFirmaChange.Size = New System.Drawing.Size(100, 21) - Me.cbxFirmaChange.TabIndex = 21 - Me.cbxFirmaChange.Visible = False - ' 'Label ' Me.Label.AutoSize = True @@ -391,30 +364,6 @@ Partial Class frmWarenorte Me.btnSave.Text = "Speichern" Me.btnSave.UseVisualStyleBackColor = True ' - 'cbxGrenzstelle - ' - Me.cbxGrenzstelle._allowedValuesFreiText = Nothing - Me.cbxGrenzstelle._allowFreiText = False - Me.cbxGrenzstelle._value = "" - Me.cbxGrenzstelle.DropDownWidth = 120 - Me.cbxGrenzstelle.FormattingEnabled = True - Me.cbxGrenzstelle.Location = New System.Drawing.Point(295, 130) - Me.cbxGrenzstelle.Name = "cbxGrenzstelle" - Me.cbxGrenzstelle.Size = New System.Drawing.Size(100, 21) - Me.cbxGrenzstelle.TabIndex = 9 - ' - 'dgvWarenorteNew - ' - Me.dgvWarenorteNew.AKTUALISIERUNGS_INTERVALL = -1 - Me.dgvWarenorteNew.AllowUserToAddRows = False - Me.dgvWarenorteNew.AllowUserToDeleteRows = False - Me.dgvWarenorteNew.BackgroundColor = System.Drawing.Color.White - Me.dgvWarenorteNew.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.dgvWarenorteNew.Location = New System.Drawing.Point(0, 49) - Me.dgvWarenorteNew.Name = "dgvWarenorteNew" - Me.dgvWarenorteNew.Size = New System.Drawing.Size(314, 331) - Me.dgvWarenorteNew.TabIndex = 98 - ' 'UsrcntlPDFScanList1 ' Me.UsrcntlPDFScanList1._DATENSERVER_KATEGORIE = "DOKUMENTE" @@ -428,12 +377,62 @@ Partial Class frmWarenorte Me.UsrcntlPDFScanList1.BackColor = System.Drawing.Color.White Me.UsrcntlPDFScanList1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.UsrcntlPDFScanList1.Cursor = System.Windows.Forms.Cursors.Default - Me.UsrcntlPDFScanList1.Location = New System.Drawing.Point(335, 299) + Me.UsrcntlPDFScanList1.Location = New System.Drawing.Point(320, 299) Me.UsrcntlPDFScanList1.Margin = New System.Windows.Forms.Padding(0) Me.UsrcntlPDFScanList1.Name = "UsrcntlPDFScanList1" - Me.UsrcntlPDFScanList1.Size = New System.Drawing.Size(367, 81) + Me.UsrcntlPDFScanList1.Size = New System.Drawing.Size(368, 81) Me.UsrcntlPDFScanList1.TabIndex = 99 ' + 'cbxFirmaChange + ' + Me.cbxFirmaChange._allowedValuesFreiText = Nothing + Me.cbxFirmaChange._allowFreiText = False + Me.cbxFirmaChange._value = "" + Me.cbxFirmaChange.DropDownWidth = 120 + Me.cbxFirmaChange.Enabled = False + Me.cbxFirmaChange.FormattingEnabled = True + Me.cbxFirmaChange.Location = New System.Drawing.Point(298, 175) + Me.cbxFirmaChange.Name = "cbxFirmaChange" + Me.cbxFirmaChange.Size = New System.Drawing.Size(100, 21) + Me.cbxFirmaChange.TabIndex = 21 + Me.cbxFirmaChange.Visible = False + ' + 'cbxGrenzstelle + ' + Me.cbxGrenzstelle._allowedValuesFreiText = Nothing + Me.cbxGrenzstelle._allowFreiText = False + Me.cbxGrenzstelle._value = "" + Me.cbxGrenzstelle.DropDownWidth = 120 + Me.cbxGrenzstelle.FormattingEnabled = True + Me.cbxGrenzstelle.Location = New System.Drawing.Point(295, 130) + Me.cbxGrenzstelle.Name = "cbxGrenzstelle" + Me.cbxGrenzstelle.Size = New System.Drawing.Size(100, 21) + Me.cbxGrenzstelle.TabIndex = 9 + ' + 'cbxFirma + ' + Me.cbxFirma._allowedValuesFreiText = Nothing + Me.cbxFirma._allowFreiText = False + Me.cbxFirma._value = "" + Me.cbxFirma.DropDownWidth = 150 + Me.cbxFirma.FormattingEnabled = True + Me.cbxFirma.Location = New System.Drawing.Point(595, 24) + Me.cbxFirma.Name = "cbxFirma" + Me.cbxFirma.Size = New System.Drawing.Size(128, 21) + Me.cbxFirma.TabIndex = 13 + ' + 'dgvWarenorteNew + ' + Me.dgvWarenorteNew.AKTUALISIERUNGS_INTERVALL = -1 + Me.dgvWarenorteNew.AllowUserToAddRows = False + Me.dgvWarenorteNew.AllowUserToDeleteRows = False + Me.dgvWarenorteNew.BackgroundColor = System.Drawing.Color.White + Me.dgvWarenorteNew.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dgvWarenorteNew.Location = New System.Drawing.Point(0, 49) + Me.dgvWarenorteNew.Name = "dgvWarenorteNew" + Me.dgvWarenorteNew.Size = New System.Drawing.Size(314, 331) + Me.dgvWarenorteNew.TabIndex = 98 + ' 'frmWarenorte ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) diff --git a/Aviso/frmWarenorte.vb b/Aviso/frmWarenorte.vb index 7d71336..525705a 100644 --- a/Aviso/frmWarenorte.vb +++ b/Aviso/frmWarenorte.vb @@ -1,12 +1,49 @@  -Imports com Imports VERAG_PROG_ALLGEMEIN Public Class frmWarenorte - Dim warenort As New cWarenorte + Dim writepermission As Boolean + + Sub New(writepermission As Boolean) + InitializeComponent() + Me.writepermission = writepermission + + End Sub Private Sub Warenorte_Load(sender As Object, e As EventArgs) Handles MyBase.Load + + If Not writepermission Then + btnSave.Enabled = False + btnDelete.Enabled = False + btnAdd.Enabled = False + UsrcntlPDFScanList1.cntxt.Enabled = False + UsrcntlPDFScanList1.picAdd.Enabled = False + + For Each c As Control In mainPanel.Controls + If TypeOf c Is MyTextBox Then + Dim mytxtb As MyTextBox = c + mytxtb.ReadOnly = True + ElseIf TypeOf c Is TextBox Then + Dim txtb As TextBox = c + txtb.ReadOnly = True + ElseIf TypeOf c Is CheckBox Then + Dim cbx As CheckBox = c + cbx.Enabled = False + ElseIf TypeOf c Is MyComboBox Then + Dim mycbx As MyComboBox = c + mycbx.Enabled = False + ElseIf TypeOf c Is GroupBox Then + Dim gb As GroupBox = c + gb.Enabled = False + End If + + Next + End If + + + + initDGVWarenort() cbxGrenzstelle.fillWithSQL("SELECT [grz_Grenzstelle],[grz_BezeichnungCBO] FROM tblGrenzstelle where grz_Aktiv=1 order by grz_Reihenfolge, grz_Grenzstelle", False, "AVISO", True) cbxGrenzstelle.changeItem("")