diff --git a/.gitignore b/.gitignore index a3021f4..b3aa5bb 100644 --- a/.gitignore +++ b/.gitignore @@ -147,3 +147,4 @@ BSMyLoadersLog/obj/Debug/BSMyLoadersLog.vbprojAssemblyReference.cache .vs/BSMyLoadersLog/v16/TestStore/0/000.testlog .vs/BSMyLoadersLog/v16/TestStore/0/testlog.manifest /packages +*.ldb diff --git a/BSMyLoadersLog/AboutBox1.Designer.vb b/BSMyLoadersLog/AboutBox1.Designer.vb index ca0ba98..b0d4bc1 100644 --- a/BSMyLoadersLog/AboutBox1.Designer.vb +++ b/BSMyLoadersLog/AboutBox1.Designer.vb @@ -40,15 +40,15 @@ Partial Class AboutBox1 Me.LabelCompanyName = New System.Windows.Forms.Label() Me.TextBoxDescription = New System.Windows.Forms.TextBox() Me.OKButton = New System.Windows.Forms.Button() - Me.TableLayoutPanel.SuspendLayout() - CType(Me.LogoPictureBox, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() + Me.TableLayoutPanel.SuspendLayout + CType(Me.LogoPictureBox,System.ComponentModel.ISupportInitialize).BeginInit + Me.SuspendLayout ' 'TableLayoutPanel ' Me.TableLayoutPanel.ColumnCount = 2 - Me.TableLayoutPanel.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.0!)) - Me.TableLayoutPanel.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 67.0!)) + Me.TableLayoutPanel.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33!)) + Me.TableLayoutPanel.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 67!)) Me.TableLayoutPanel.Controls.Add(Me.LogoPictureBox, 0, 0) Me.TableLayoutPanel.Controls.Add(Me.LabelProductName, 1, 0) Me.TableLayoutPanel.Controls.Add(Me.LabelVersion, 1, 1) @@ -60,26 +60,26 @@ Partial Class AboutBox1 Me.TableLayoutPanel.Location = New System.Drawing.Point(9, 9) Me.TableLayoutPanel.Name = "TableLayoutPanel" Me.TableLayoutPanel.RowCount = 6 - Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0!)) - Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0!)) - Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0!)) - Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0!)) - Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) - Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0!)) + Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10!)) + Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10!)) + Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10!)) + Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10!)) + Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50!)) + Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10!)) Me.TableLayoutPanel.Size = New System.Drawing.Size(396, 258) Me.TableLayoutPanel.TabIndex = 0 ' 'LogoPictureBox ' Me.LogoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill - Me.LogoPictureBox.Image = CType(resources.GetObject("LogoPictureBox.Image"), System.Drawing.Image) + Me.LogoPictureBox.Image = CType(resources.GetObject("LogoPictureBox.Image"),System.Drawing.Image) Me.LogoPictureBox.Location = New System.Drawing.Point(3, 3) Me.LogoPictureBox.Name = "LogoPictureBox" Me.TableLayoutPanel.SetRowSpan(Me.LogoPictureBox, 6) Me.LogoPictureBox.Size = New System.Drawing.Size(124, 252) Me.LogoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.LogoPictureBox.TabIndex = 0 - Me.LogoPictureBox.TabStop = False + Me.LogoPictureBox.TabStop = false ' 'LabelProductName ' @@ -134,18 +134,18 @@ Partial Class AboutBox1 Me.TextBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill Me.TextBoxDescription.Location = New System.Drawing.Point(136, 103) Me.TextBoxDescription.Margin = New System.Windows.Forms.Padding(6, 3, 3, 3) - Me.TextBoxDescription.Multiline = True + Me.TextBoxDescription.Multiline = true Me.TextBoxDescription.Name = "TextBoxDescription" - Me.TextBoxDescription.ReadOnly = True + Me.TextBoxDescription.ReadOnly = true Me.TextBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both Me.TextBoxDescription.Size = New System.Drawing.Size(257, 123) Me.TextBoxDescription.TabIndex = 0 - Me.TextBoxDescription.TabStop = False + Me.TextBoxDescription.TabStop = false Me.TextBoxDescription.Text = resources.GetString("TextBoxDescription.Text") ' 'OKButton ' - Me.OKButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.OKButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles) Me.OKButton.DialogResult = System.Windows.Forms.DialogResult.Cancel Me.OKButton.Location = New System.Drawing.Point(318, 232) Me.OKButton.Name = "OKButton" @@ -155,24 +155,24 @@ Partial Class AboutBox1 ' 'AboutBox1 ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 13!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.CancelButton = Me.OKButton Me.ClientSize = New System.Drawing.Size(414, 276) Me.Controls.Add(Me.TableLayoutPanel) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog - Me.MaximizeBox = False - Me.MinimizeBox = False + Me.MaximizeBox = false + Me.MinimizeBox = false Me.Name = "AboutBox1" Me.Padding = New System.Windows.Forms.Padding(9) - Me.ShowInTaskbar = False + Me.ShowInTaskbar = false Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent Me.Text = "About My Loaders Log" - Me.TableLayoutPanel.ResumeLayout(False) - Me.TableLayoutPanel.PerformLayout() - CType(Me.LogoPictureBox, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) + Me.TableLayoutPanel.ResumeLayout(false) + Me.TableLayoutPanel.PerformLayout + CType(Me.LogoPictureBox,System.ComponentModel.ISupportInitialize).EndInit + Me.ResumeLayout(false) - End Sub +End Sub End Class diff --git a/BSMyLoadersLog/AboutBox1.vb b/BSMyLoadersLog/AboutBox1.vb index 7877643..2a01ce1 100644 --- a/BSMyLoadersLog/AboutBox1.vb +++ b/BSMyLoadersLog/AboutBox1.vb @@ -1,4 +1,4 @@ -Imports BSMyLoadersLog.LoadersClass + ''' ''' Class AboutBox1. This class cannot be inherited. ''' Implements the @@ -27,7 +27,8 @@ Public NotInheritable Class AboutBox1 ' properties dialog (under the "Project" menu). LabelProductName.Text = My.Application.Info.ProductName Dim dbVersion As Long = BurnSoft.Applications.MLL.Database.GetDatabaseVersion(DatabasePath, errOut) - LabelVersion.Text = String.Format("App Version {0}", Application.ProductVersion.ToString) & " , " & String.Format("DB Version {0}", dbVersion) + LabelVersion.Text = String.Format("App Version {0}", Application.ProductVersion.ToString) & + " , " & String.Format("DB Version {0}", dbVersion) LabelCopyright.Text = My.Application.Info.Copyright LabelCompanyName.Text = My.Application.Info.CompanyName TextBoxDescription.Text = My.Application.Info.Description diff --git a/BSMyLoadersLog/Adding/frmAddBullets.vb b/BSMyLoadersLog/Adding/frmAddBullets.vb index bfd5572..7ef41d7 100644 --- a/BSMyLoadersLog/Adding/frmAddBullets.vb +++ b/BSMyLoadersLog/Adding/frmAddBullets.vb @@ -8,9 +8,9 @@ Namespace Adding ''' ''' Class FrmAddBullets. - ''' Implements the + ''' Implements the ''' - ''' + ''' Public Class FrmAddBullets ''' ''' From view @@ -23,7 +23,7 @@ Namespace Adding ''' ''' The bullet id ''' - Public Bid As Long + Public BulletId As Long ''' ''' The error out ''' @@ -34,7 +34,7 @@ Namespace Adding Sub LoadData() Try Dim values As List(Of BulletListings) = BulletsInventory.GetDetails(DatabasePath, - Bid, _errOut) + BulletId, _errOut) if _errOut.Length > 0 Then Throw New Exception(_errOut) For Each o As BulletListings In values txtManu.Text = o.Manufacturer @@ -61,7 +61,7 @@ Namespace Adding ''' ''' The source of the event. ''' The instance containing the event data. - Private Sub frmAddBullets_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load + Private Sub frmAddBullets_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load General_Ammunition_TypeTableAdapter.Fill(MLLDataSet.General_Ammunition_Type) Try List_CalibersTableAdapter.Fill(MLLDataSet.List_Calibers) @@ -75,8 +75,8 @@ Namespace Adding ''' Handles the Click event of the btnCancel control. ''' ''' The source of the event. - ''' The instance containing the event data. - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnCancel.Click + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click Close() End Sub ''' @@ -108,8 +108,8 @@ Namespace Adding ''' Handles the Click event of the btnAdd control. ''' ''' The source of the event. - ''' The instance containing the event data. - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnAdd.Click + ''' The instance containing the event data. + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click Try Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) Dim strName As String = GeneralHelpers.FluffContent(txtName.Text) @@ -135,7 +135,7 @@ Namespace Adding strSecDia, strPartNo, strBc, intBt, strQty, dbPrice, cal, _errOut) Then Throw new Exception(_errOut) End If - If FromView Then Call frmView_List_Bullets.LoadData() + If FromView Then Call FrmViewListBullets.LoadData() Close() Catch ex As Exception Call LogError(Name, "btnAdd.Click", Err.Number, ex.Message.ToString) diff --git a/BSMyLoadersLog/Adding/frmAddBushing_Powder.vb b/BSMyLoadersLog/Adding/frmAddBushing_Powder.vb index 3afc687..679d022 100644 --- a/BSMyLoadersLog/Adding/frmAddBushing_Powder.vb +++ b/BSMyLoadersLog/Adding/frmAddBushing_Powder.vb @@ -6,9 +6,9 @@ Namespace Adding ''' ''' Class FrmAddBushingPowder. - ''' Implements the + ''' Implements the ''' - ''' + ''' Public Class FrmAddBushingPowder ''' ''' The error out @@ -35,8 +35,8 @@ Namespace Adding ''' Handles the Load event of the frmAddChargeBushing control. ''' ''' The source of the event. - ''' The instance containing the event data. - Private Sub frmAddChargeBushing_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load + ''' The instance containing the event data. + Private Sub frmAddChargeBushing_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load Try Call PreloadData() Catch ex As Exception @@ -48,7 +48,7 @@ Namespace Adding ''' ''' The source of the event. ''' The instance containing the event data. - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnCancel.Click + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click Close() End Sub ''' @@ -92,7 +92,7 @@ Namespace Adding ''' ''' The source of the event. ''' The instance containing the event data. - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnAdd.Click + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click Call SaveData() End Sub ''' @@ -115,7 +115,7 @@ Namespace Adding ''' Handles the Enter event of the txtName control. ''' ''' The source of the event. - ''' The instance containing the event data. + ''' The instance containing the event data. Private Sub txtName_Enter(ByVal sender As Object, ByVal e As EventArgs) Handles txtName.Enter txtName.SelectAll() End Sub @@ -123,7 +123,7 @@ Namespace Adding ''' Handles the Enter event of the txtPowderName control. ''' ''' The source of the event. - ''' The instance containing the event data. + ''' The instance containing the event data. Private Sub txtPowderName_Enter(ByVal sender As Object, ByVal e As EventArgs) Handles txtPowderName.Enter txtPowderName.SelectAll() End Sub diff --git a/BSMyLoadersLog/Adding/frmAddBushing_Shot.vb b/BSMyLoadersLog/Adding/frmAddBushing_Shot.vb index a2d0744..42b2d6a 100644 --- a/BSMyLoadersLog/Adding/frmAddBushing_Shot.vb +++ b/BSMyLoadersLog/Adding/frmAddBushing_Shot.vb @@ -6,25 +6,25 @@ Namespace Adding ''' ''' Class frmAddBushing_Shot. - ''' Implements the + ''' Implements the ''' - ''' + ''' Public Class FrmAddBushingShot ''' ''' The error out ''' - Private errOut as String + Private _errOut as String ''' ''' Pres the load data. ''' Sub PreLoadData() Try - txtCharge.AutoCompleteCustomSource = ConfigShotgun.BushingShotCharge(DatabasePath, errOut) - If errOut.Length > 0 Then Throw New Exception(errOut) - txtManu.AutoCompleteCustomSource = ConfigShotgun.BushingShotManufacturer(DatabasePath, errOut) - If errOut.Length > 0 Then Throw New Exception(errOut) - txtName.AutoCompleteCustomSource = ConfigShotgun.BushingShotName(DatabasePath, errOut) - If errOut.Length > 0 Then Throw New Exception(errOut) + txtCharge.AutoCompleteCustomSource = ConfigShotgun.BushingShotCharge(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtManu.AutoCompleteCustomSource = ConfigShotgun.BushingShotManufacturer(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtName.AutoCompleteCustomSource = ConfigShotgun.BushingShotName(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) Catch ex As Exception Call LogError(Name, "PreLoadData", Err.Number, ex.Message.ToString) End Try @@ -43,8 +43,8 @@ Namespace Adding ''' Handles the Click event of the btnCancel control. ''' ''' The source of the event. - ''' The instance containing the event data. - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnCancel.Click + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click Close() End Sub ''' @@ -64,7 +64,7 @@ Namespace Adding If Not GeneralHelpers.IsRequired(sCharge, "Charge Amount", Text) Then Exit Sub If Not ShotgunShotInventory.Add(DatabasePath, manu, sName, sCharge, - sType, errOut) Then Throw New Exception(errOut) + sType, _errOut) Then Throw New Exception(_errOut) Call ClearFields() Catch ex As Exception Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) @@ -75,7 +75,7 @@ Namespace Adding ''' ''' The source of the event. ''' The instance containing the event data. - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnAdd.Click + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click Call SaveData() End Sub ''' @@ -98,7 +98,7 @@ Namespace Adding ''' Handles the Enter event of the txtName control. ''' ''' The source of the event. - ''' The instance containing the event data. + ''' The instance containing the event data. Private Sub txtName_Enter(ByVal sender As Object, ByVal e As EventArgs) Handles txtName.Enter txtName.SelectAll() End Sub @@ -107,7 +107,7 @@ Namespace Adding ''' ''' The source of the event. ''' The instance containing the event data. - Private Sub frmAddBushing_Shot_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load + Private Sub frmAddBushing_Shot_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load Call PreLoadData() End Sub End Class diff --git a/BSMyLoadersLog/Adding/frmAddCaliberToCollection.vb b/BSMyLoadersLog/Adding/frmAddCaliberToCollection.vb index 52b85b5..d82fd31 100644 --- a/BSMyLoadersLog/Adding/frmAddCaliberToCollection.vb +++ b/BSMyLoadersLog/Adding/frmAddCaliberToCollection.vb @@ -5,9 +5,9 @@ Imports BurnSoft.Applications.MLL.Inventory Namespace Adding ''' ''' Class FrmAddCaliberToCollection. - ''' Implements the + ''' Implements the ''' - ''' + ''' Public Class FrmAddCaliberToCollection ''' ''' The error out diff --git a/BSMyLoadersLog/Adding/frmAddDataSheet_RiflePistols_CFG.vb b/BSMyLoadersLog/Adding/frmAddDataSheet_RiflePistols_CFG.vb index d6873a0..e83fffe 100644 --- a/BSMyLoadersLog/Adding/frmAddDataSheet_RiflePistols_CFG.vb +++ b/BSMyLoadersLog/Adding/frmAddDataSheet_RiflePistols_CFG.vb @@ -1,17 +1,18 @@ -Imports System.Data.Odbc -Imports BSMyLoadersLog.LoadersClass +Imports BSMyLoadersLog.Viewing Imports BurnSoft.Applications.MLL.AutoFill +Imports BurnSoft.Applications.MLL.ConfigSheets Imports BurnSoft.Applications.MLL.Global Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory Imports BurnSoft.Applications.MLL.LoadersLog Imports BurnSoft.Applications.MLL.Types Namespace Adding ''' ''' Class FrmAddDataSheetRiflePistolsCfg. - ''' Implements the + ''' Implements the ''' - ''' + ''' Public Class FrmAddDataSheetRiflePistolsCfg ''' ''' From view @@ -24,7 +25,7 @@ Namespace Adding ''' ''' The error out ''' - Private _errOut as String + Private _errOut As String ''' ''' Loads the automatic fill. ''' @@ -32,11 +33,11 @@ Namespace Adding Sub LoadAutoFill() Try txtGroup.AutoCompleteCustomSource = ConfigMetalic.GroupSize(DatabasePath, _errOut) - if _errOut.Length > 0 Then Throw New Exception(_errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) txtCon.AutoCompleteCustomSource = ConfigMetalic.Conditions(DatabasePath, _errOut) - if _errOut.Length > 0 Then Throw New Exception(_errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) txtLen.AutoCompleteCustomSource = ConfigMetalic.TotalLenght(DatabasePath, _errOut) - if _errOut.Length > 0 Then Throw New Exception(_errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) Catch ex As Exception Call LogError(Name, "LoadAutoFill", Err.Number, ex.Message.ToString) End Try @@ -46,72 +47,99 @@ Namespace Adding ''' Sub SaveData() Try - Dim lngFid As Long = cmbFirearm.SelectedValue - Dim strFireArm As String = cmbFirearm.Text - Dim strDateTested As String = dtpTested.Value - Dim strGroup As String = GeneralHelpers.FluffContent(txtGroup.Text) - Dim lngNumShots As Integer = nudShots.Value - Dim lngYards As Integer = nudYards.Value + Dim firearmId As Long = cmbFirearm.SelectedValue + Dim firearmName As String = cmbFirearm.Text + Dim dateCreated As String = dtpTested.Value + Dim groupSize As String = GeneralHelpers.FluffContent(txtGroup.Text) + Dim numberOfShots As Integer = nudShots.Value + Dim yards As Integer = nudYards.Value Dim configId As Long = cmbConfig.SelectedValue Dim configName As String = cmbConfig.Text - Dim strCond As String = GeneralHelpers.FluffContent(txtCon.Text) - Dim strLen As String = GeneralHelpers.FluffContent(txtLen.Text) - Dim strNotes As String = GeneralHelpers.FluffContent(txtNotes.Text) - Dim strBarLen As String = "" - Dim powName As String = "" - Dim powWei As Double = 0 - Dim powManu As String = "" - Dim bulManu As String = "" - Dim bulName As String = "" - Dim bulWei As String = "" - Dim priManu As String = "" - Dim priName As String = "" + Dim condition As String = GeneralHelpers.FluffContent(txtCon.Text) + Dim oal As String = GeneralHelpers.FluffContent(txtLen.Text) + Dim notes As String = GeneralHelpers.FluffContent(txtNotes.Text) + Dim barrelLenght As String = "" + Dim powderName As String = "" + Dim powderWeight As Double = 0 + Dim powderManufacturer As String = "" + Dim bulletManufacturer As String = "" + Dim bulletName As String = "" + Dim bulletWeight As String = "" + Dim primerManufacturer As String = "" + Dim primerName As String = "" Dim caseName As String = "" Dim caseManu As String = "" Dim caseStatus As String = "" Dim caliber As String = "" - Dim obj As New BSDatabase - Dim objIm As New InventoryMath - Dim objGf As New GlobalFunctions - Dim prefferedPowderId As Long = objIm.GetPrefNSGPowderID(configId, powWei) - Call objGf.GetFirearmDetails(lngFid, 0, "", "", "", "", strBarLen) - Dim sql As String = "SELECT * from Config_List_Data_NSG where CLNID=" & configId - Call obj.ConnectDB() - Dim cmd As New OdbcCommand(sql, obj.Conn) - Dim rs As OdbcDataReader - rs = cmd.ExecuteReader - While rs.Read - caliber = objIm.GetCaliber(rs("CALID")) - Call objIm.LoadBulletInfo(rs("BID"), bulManu, bulName, "", _ - bulWei) - Call objIm.LoadPrimerInfo(rs("PRID"), priManu, priName) - Call objIm.LoadCaseInfo(rs("CAID"), caseManu, caseName, "", caseStatus) - Call objIm.GetPowderDetails(prefferedPowderId, powManu, powName) - End While - rs.Close() + Dim prefferedPowderId As Long = ConfigListDataPowder.GetDefaultPowderId(DatabasePath, configId, powderWeight, _errOut) + + Dim lst As List(Of FirearmCollection) = Firearms.GetDetails(DatabasePath, CInt(firearmId), _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As FirearmCollection In lst + barrelLenght = o.Barrel + Next + + Dim configList As List(Of ConfigListDataMetalicData) = ConfigListDataMetalic.GetDetails( + DatabasePath, configId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Dim bulletId As Long + Dim primerId As Long + Dim caseId As Long + For Each o As ConfigListDataMetalicData In configList + caliber = CaliberInventory.GetName(DatabasePath, o.CaliberId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + bulletId = o.BulletId + primerId = o.PrimerId + caseId = o.CaseId + Next + + Dim bulletList As List(Of BulletListings) = BulletsInventory.GetDetails(DatabasePath, bulletId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As BulletListings In bulletList + bulletManufacturer = o.Manufacturer + bulletName = o.Name + bulletWeight = o.Weight + Next + + Dim primerList As List(Of PrimerListings) = PrimerInventory.GetDetails(DatabasePath, primerId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As PrimerListings In primerList + primerManufacturer = o.Manufacturer + primerName = o.Name + Next + + Dim caseList As List(Of CaseListings) = CaseInventory.GetDetails(DatabasePath, caseId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As CaseListings In caseList + caseManu = o.Manufacturer + caseName = o.Name + caseStatus = o.TimesUsed + Next + + Dim powderList as List(Of PowderListing) = PowderInventory.GetDetails(DatabasePath, prefferedPowderId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As PowderListing In powderList + powderManufacturer = o.Manufacturer + powderName = o.Name + Next If CLng(caseStatus) = 0 Then caseStatus = "(NEW)" Else caseStatus = "(USED)" End If - Dim powderDetails as String = GeneralHelpers.FluffContent(powName & " - " & powWei & " - " & powManu) - Dim bulletDetails As String = GeneralHelpers.FluffContent(bulManu & " " & bulName) & " (" & bulWei & ")" - Dim primerDetails As String = priManu & " " & priName + Dim powderDetails As String = GeneralHelpers.FluffContent(powderName & " - " & powderWeight & " - " & powderManufacturer) + Dim bulletDetails As String = GeneralHelpers.FluffContent(bulletManufacturer & " " & bulletName) & " (" & bulletWeight & ")" + Dim primerDetails As String = primerManufacturer & " " & primerName Dim caseDetails As String = caseManu & " " & caseName & " " & caseStatus - If Not LoadersLogMetallic.Add(DatabasePath, firearmId := lngFid, dateCreated := strDateTested, - yards := lngYards, groupSize := strGroup, numberOfShots := lngNumShots, - powderDetails := powderDetails, bulletDetails := bulletDetails, - primerDetails := primerDetails, caseDetails := caseDetails, - condition := strCond, oal := strLen, notes := strNotes, - configName := configName, FirearmName := strFireArm, - caliber := caliber, BarrelLenght := strBarLen, _errOut) Then - Throw New Exception(_errOut) - End If + If Not LoadersLogMetallic.Add(DatabasePath, firearmId, dateCreated, yards, groupSize, numberOfShots, + powderDetails, bulletDetails, primerDetails, caseDetails, + condition, oal, notes, configName, firearmName, + caliber,barrelLenght, _errOut) Then Throw New Exception(_errOut) MsgBox("Information was saved to the Loaders Log!") - If FromView Then Call frmViewDataSheet_RiflePistols.LoadDataCur() + If FromView Then Call FrmViewDataSheetRiflePistols.LoadDataCur() Close() Catch ex As Exception Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) @@ -156,15 +184,15 @@ Namespace Adding Dim lngFid As Integer = cmbFirearm.SelectedValue Dim strCal As String = "" Dim values As List(Of FirearmCollection) = Firearms.GetDetails(DatabasePath, lngFid, _errOut) - if _errOut.Length > 0 Then Throw New Exception(_errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) For Each o As FirearmCollection In values strCal = o.Caliber Next - Dim calId As Long = GeneralFunctions.GetCaliberID(DatabasePath,strCal, _errOut) - if _errOut.Length > 0 Then Throw New Exception(_errOut) + Dim calId As Long = GeneralFunctions.GetCaliberID(DatabasePath, strCal, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) ConfigList_SimpleTableAdapter.FillBy_Caliber(MLLDataSet.ConfigList_Simple, calId) Catch ex As Exception - Call LogError(Name, "UpdateConfigList", Err.Number, + Call LogError(Name, "UpdateConfigList", Err.Number, ex.Message.ToString) End Try End Sub @@ -185,4 +213,4 @@ Namespace Adding End Sub End Class -End NameSpace \ No newline at end of file +End Namespace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddDataSheet_RiflePistols_MAN.Designer.vb b/BSMyLoadersLog/Adding/frmAddDataSheet_RiflePistols_MAN.Designer.vb index c6500c8..3086ab9 100644 --- a/BSMyLoadersLog/Adding/frmAddDataSheet_RiflePistols_MAN.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddDataSheet_RiflePistols_MAN.Designer.vb @@ -1,438 +1,440 @@ - _ -Partial Class FrmAddDataSheetRiflePistolsMan - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddDataSheetRiflePistolsMan + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmAddDataSheetRiflePistolsMan)) - Me.nudYards = New System.Windows.Forms.NumericUpDown - Me.Label9 = New System.Windows.Forms.Label - Me.nudShots = New System.Windows.Forms.NumericUpDown - Me.Label8 = New System.Windows.Forms.Label - Me.btnCancel = New System.Windows.Forms.Button - Me.btnAdd = New System.Windows.Forms.Button - Me.txtNotes = New System.Windows.Forms.TextBox - Me.txtLen = New System.Windows.Forms.TextBox - Me.txtCon = New System.Windows.Forms.TextBox - Me.txtGroup = New System.Windows.Forms.TextBox - Me.dtpTested = New System.Windows.Forms.DateTimePicker - Me.cmbFirearm = New System.Windows.Forms.ComboBox - Me.LoadersLogFirearmsBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.Label7 = New System.Windows.Forms.Label - Me.Label6 = New System.Windows.Forms.Label - Me.Label5 = New System.Windows.Forms.Label - Me.Label3 = New System.Windows.Forms.Label - Me.Label2 = New System.Windows.Forms.Label - Me.Label1 = New System.Windows.Forms.Label - Me.Loaders_Log_FirearmsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_FirearmsTableAdapter - Me.Label4 = New System.Windows.Forms.Label - Me.Label10 = New System.Windows.Forms.Label - Me.Label11 = New System.Windows.Forms.Label - Me.Label12 = New System.Windows.Forms.Label - Me.Label13 = New System.Windows.Forms.Label - Me.Label14 = New System.Windows.Forms.Label - Me.txtPowName = New System.Windows.Forms.TextBox - Me.txtPowWei = New System.Windows.Forms.TextBox - Me.txtPowManu = New System.Windows.Forms.TextBox - Me.txtBullet = New System.Windows.Forms.TextBox - Me.txtPrimer = New System.Windows.Forms.TextBox - Me.txtCase = New System.Windows.Forms.TextBox - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - CType(Me.nudYards, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.nudShots, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.LoadersLogFirearmsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'nudYards - ' - Me.nudYards.Location = New System.Drawing.Point(132, 69) - Me.nudYards.Maximum = New Decimal(New Integer() {5000, 0, 0, 0}) - Me.nudYards.Name = "nudYards" - Me.nudYards.Size = New System.Drawing.Size(200, 20) - Me.nudYards.TabIndex = 3 - ' - 'Label9 - ' - Me.Label9.AutoSize = True - Me.Label9.Location = New System.Drawing.Point(12, 71) - Me.Label9.Name = "Label9" - Me.Label9.Size = New System.Drawing.Size(81, 13) - Me.Label9.TabIndex = 38 - Me.Label9.Text = "Yards tested at:" - ' - 'nudShots - ' - Me.nudShots.Location = New System.Drawing.Point(132, 123) - Me.nudShots.Maximum = New Decimal(New Integer() {1000, 0, 0, 0}) - Me.nudShots.Name = "nudShots" - Me.nudShots.Size = New System.Drawing.Size(200, 20) - Me.nudShots.TabIndex = 5 - ' - 'Label8 - ' - Me.Label8.AutoSize = True - Me.Label8.Location = New System.Drawing.Point(12, 125) - Me.Label8.Name = "Label8" - Me.Label8.Size = New System.Drawing.Size(89, 13) - Me.Label8.TabIndex = 36 - Me.Label8.Text = "Number of Shots:" - ' - 'btnCancel - ' - Me.btnCancel.Location = New System.Drawing.Point(257, 463) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 16 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'btnAdd - ' - Me.btnAdd.Location = New System.Drawing.Point(15, 463) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(75, 23) - Me.btnAdd.TabIndex = 15 - Me.btnAdd.Text = "Add" - Me.btnAdd.UseVisualStyleBackColor = True - ' - 'txtNotes - ' - Me.txtNotes.Location = New System.Drawing.Point(15, 371) - Me.txtNotes.Multiline = True - Me.txtNotes.Name = "txtNotes" - Me.txtNotes.Size = New System.Drawing.Size(317, 84) - Me.txtNotes.TabIndex = 14 - ' - 'txtLen - ' - Me.txtLen.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtLen.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtLen.Location = New System.Drawing.Point(132, 330) - Me.txtLen.Name = "txtLen" - Me.txtLen.Size = New System.Drawing.Size(200, 20) - Me.txtLen.TabIndex = 13 - ' - 'txtCon - ' - Me.txtCon.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtCon.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtCon.Location = New System.Drawing.Point(132, 304) - Me.txtCon.Name = "txtCon" - Me.txtCon.Size = New System.Drawing.Size(200, 20) - Me.txtCon.TabIndex = 12 - ' - 'txtGroup - ' - Me.txtGroup.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtGroup.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtGroup.Location = New System.Drawing.Point(132, 95) - Me.txtGroup.Name = "txtGroup" - Me.txtGroup.Size = New System.Drawing.Size(200, 20) - Me.txtGroup.TabIndex = 4 - ' - 'dtpTested - ' - Me.dtpTested.Location = New System.Drawing.Point(132, 42) - Me.dtpTested.Name = "dtpTested" - Me.dtpTested.Size = New System.Drawing.Size(200, 20) - Me.dtpTested.TabIndex = 2 - ' - 'cmbFirearm - ' - Me.cmbFirearm.DataSource = Me.LoadersLogFirearmsBindingSource - Me.cmbFirearm.DisplayMember = "FullName" - Me.cmbFirearm.FormattingEnabled = True - Me.cmbFirearm.Location = New System.Drawing.Point(132, 15) - Me.cmbFirearm.Name = "cmbFirearm" - Me.cmbFirearm.Size = New System.Drawing.Size(200, 21) - Me.cmbFirearm.TabIndex = 1 - Me.cmbFirearm.ValueMember = "ID" - ' - 'LoadersLogFirearmsBindingSource - ' - Me.LoadersLogFirearmsBindingSource.DataMember = "Loaders_Log_Firearms" - Me.LoadersLogFirearmsBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'Label7 - ' - Me.Label7.AutoSize = True - Me.Label7.Location = New System.Drawing.Point(12, 355) - Me.Label7.Name = "Label7" - Me.Label7.Size = New System.Drawing.Size(35, 13) - Me.Label7.TabIndex = 26 - Me.Label7.Text = "Notes" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(12, 333) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(70, 13) - Me.Label6.TabIndex = 25 - Me.Label6.Text = "Total Length:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(12, 307) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(59, 13) - Me.Label5.TabIndex = 24 - Me.Label5.Text = "Conditions:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(12, 98) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(103, 13) - Me.Label3.TabIndex = 22 - Me.Label3.Text = "Group size or Score:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(12, 46) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(65, 13) - Me.Label2.TabIndex = 21 - Me.Label2.Text = "Date tested:" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(12, 18) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(98, 13) - Me.Label1.TabIndex = 20 - Me.Label1.Text = "Firearm tested with:" - ' - 'Loaders_Log_FirearmsTableAdapter - ' - Me.Loaders_Log_FirearmsTableAdapter.ClearBeforeFill = True - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(12, 152) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(77, 13) - Me.Label4.TabIndex = 40 - Me.Label4.Text = "Powder Name:" - ' - 'Label10 - ' - Me.Label10.AutoSize = True - Me.Label10.Location = New System.Drawing.Point(12, 177) - Me.Label10.Name = "Label10" - Me.Label10.Size = New System.Drawing.Size(123, 13) - Me.Label10.TabIndex = 41 - Me.Label10.Text = "Weight of Powder Used:" - ' - 'Label11 - ' - Me.Label11.AutoSize = True - Me.Label11.Location = New System.Drawing.Point(12, 203) - Me.Label11.Name = "Label11" - Me.Label11.Size = New System.Drawing.Size(112, 13) - Me.Label11.TabIndex = 42 - Me.Label11.Text = "Powder Manufacturer:" - ' - 'Label12 - ' - Me.Label12.AutoSize = True - Me.Label12.Location = New System.Drawing.Point(12, 229) - Me.Label12.Name = "Label12" - Me.Label12.Size = New System.Drawing.Size(36, 13) - Me.Label12.TabIndex = 43 - Me.Label12.Text = "Bullet:" - ' - 'Label13 - ' - Me.Label13.AutoSize = True - Me.Label13.Location = New System.Drawing.Point(12, 255) - Me.Label13.Name = "Label13" - Me.Label13.Size = New System.Drawing.Size(39, 13) - Me.Label13.TabIndex = 44 - Me.Label13.Text = "Primer:" - ' - 'Label14 - ' - Me.Label14.AutoSize = True - Me.Label14.Location = New System.Drawing.Point(12, 281) - Me.Label14.Name = "Label14" - Me.Label14.Size = New System.Drawing.Size(34, 13) - Me.Label14.TabIndex = 45 - Me.Label14.Text = "Case:" - ' - 'txtPowName - ' - Me.txtPowName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPowName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPowName.Location = New System.Drawing.Point(132, 149) - Me.txtPowName.Name = "txtPowName" - Me.txtPowName.Size = New System.Drawing.Size(200, 20) - Me.txtPowName.TabIndex = 6 - ' - 'txtPowWei - ' - Me.txtPowWei.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPowWei.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPowWei.Location = New System.Drawing.Point(132, 174) - Me.txtPowWei.Name = "txtPowWei" - Me.txtPowWei.Size = New System.Drawing.Size(200, 20) - Me.txtPowWei.TabIndex = 7 - ' - 'txtPowManu - ' - Me.txtPowManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPowManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPowManu.Location = New System.Drawing.Point(132, 200) - Me.txtPowManu.Name = "txtPowManu" - Me.txtPowManu.Size = New System.Drawing.Size(200, 20) - Me.txtPowManu.TabIndex = 8 - ' - 'txtBullet - ' - Me.txtBullet.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtBullet.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtBullet.Location = New System.Drawing.Point(132, 226) - Me.txtBullet.Name = "txtBullet" - Me.txtBullet.Size = New System.Drawing.Size(200, 20) - Me.txtBullet.TabIndex = 9 - ' - 'txtPrimer - ' - Me.txtPrimer.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPrimer.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPrimer.Location = New System.Drawing.Point(132, 252) - Me.txtPrimer.Name = "txtPrimer" - Me.txtPrimer.Size = New System.Drawing.Size(200, 20) - Me.txtPrimer.TabIndex = 10 - ' - 'txtCase - ' - Me.txtCase.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtCase.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtCase.Location = New System.Drawing.Point(132, 278) - Me.txtCase.Name = "txtCase" - Me.txtCase.Size = New System.Drawing.Size(200, 20) - Me.txtCase.TabIndex = 11 - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmAddDataSheet_RiflePistols_MAN - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(349, 495) - Me.Controls.Add(Me.txtCase) - Me.Controls.Add(Me.txtPrimer) - Me.Controls.Add(Me.txtBullet) - Me.Controls.Add(Me.txtPowManu) - Me.Controls.Add(Me.txtPowWei) - Me.Controls.Add(Me.txtPowName) - Me.Controls.Add(Me.Label14) - Me.Controls.Add(Me.Label13) - Me.Controls.Add(Me.Label12) - Me.Controls.Add(Me.Label11) - Me.Controls.Add(Me.Label10) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.nudYards) - Me.Controls.Add(Me.Label9) - Me.Controls.Add(Me.nudShots) - Me.Controls.Add(Me.Label8) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnAdd) - Me.Controls.Add(Me.txtNotes) - Me.Controls.Add(Me.txtLen) - Me.Controls.Add(Me.txtCon) - Me.Controls.Add(Me.txtGroup) - Me.Controls.Add(Me.dtpTested) - Me.Controls.Add(Me.cmbFirearm) - Me.Controls.Add(Me.Label7) - Me.Controls.Add(Me.Label6) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.HelpProvider1.SetHelpKeyword(Me, "Add to Loaders Log - Rifle & Pistol - Manual") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Add to Loaders Log - Rifle & Pistol - Manual") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "FrmAddDataSheetRiflePistolsMan" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Add To Loaders Log " - CType(Me.nudYards, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.nudShots, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.LoadersLogFirearmsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmAddDataSheetRiflePistolsMan)) + Me.nudYards = New System.Windows.Forms.NumericUpDown + Me.Label9 = New System.Windows.Forms.Label + Me.nudShots = New System.Windows.Forms.NumericUpDown + Me.Label8 = New System.Windows.Forms.Label + Me.btnCancel = New System.Windows.Forms.Button + Me.btnAdd = New System.Windows.Forms.Button + Me.txtNotes = New System.Windows.Forms.TextBox + Me.txtLen = New System.Windows.Forms.TextBox + Me.txtCon = New System.Windows.Forms.TextBox + Me.txtGroup = New System.Windows.Forms.TextBox + Me.dtpTested = New System.Windows.Forms.DateTimePicker + Me.cmbFirearm = New System.Windows.Forms.ComboBox + Me.LoadersLogFirearmsBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.Label7 = New System.Windows.Forms.Label + Me.Label6 = New System.Windows.Forms.Label + Me.Label5 = New System.Windows.Forms.Label + Me.Label3 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label1 = New System.Windows.Forms.Label + Me.Loaders_Log_FirearmsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_FirearmsTableAdapter + Me.Label4 = New System.Windows.Forms.Label + Me.Label10 = New System.Windows.Forms.Label + Me.Label11 = New System.Windows.Forms.Label + Me.Label12 = New System.Windows.Forms.Label + Me.Label13 = New System.Windows.Forms.Label + Me.Label14 = New System.Windows.Forms.Label + Me.txtPowName = New System.Windows.Forms.TextBox + Me.txtPowWei = New System.Windows.Forms.TextBox + Me.txtPowManu = New System.Windows.Forms.TextBox + Me.txtBullet = New System.Windows.Forms.TextBox + Me.txtPrimer = New System.Windows.Forms.TextBox + Me.txtCase = New System.Windows.Forms.TextBox + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + CType(Me.nudYards, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.nudShots, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LoadersLogFirearmsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'nudYards + ' + Me.nudYards.Location = New System.Drawing.Point(132, 69) + Me.nudYards.Maximum = New Decimal(New Integer() {5000, 0, 0, 0}) + Me.nudYards.Name = "nudYards" + Me.nudYards.Size = New System.Drawing.Size(200, 20) + Me.nudYards.TabIndex = 3 + ' + 'Label9 + ' + Me.Label9.AutoSize = True + Me.Label9.Location = New System.Drawing.Point(12, 71) + Me.Label9.Name = "Label9" + Me.Label9.Size = New System.Drawing.Size(81, 13) + Me.Label9.TabIndex = 38 + Me.Label9.Text = "Yards tested at:" + ' + 'nudShots + ' + Me.nudShots.Location = New System.Drawing.Point(132, 123) + Me.nudShots.Maximum = New Decimal(New Integer() {1000, 0, 0, 0}) + Me.nudShots.Name = "nudShots" + Me.nudShots.Size = New System.Drawing.Size(200, 20) + Me.nudShots.TabIndex = 5 + ' + 'Label8 + ' + Me.Label8.AutoSize = True + Me.Label8.Location = New System.Drawing.Point(12, 125) + Me.Label8.Name = "Label8" + Me.Label8.Size = New System.Drawing.Size(89, 13) + Me.Label8.TabIndex = 36 + Me.Label8.Text = "Number of Shots:" + ' + 'btnCancel + ' + Me.btnCancel.Location = New System.Drawing.Point(257, 463) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 16 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'btnAdd + ' + Me.btnAdd.Location = New System.Drawing.Point(15, 463) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(75, 23) + Me.btnAdd.TabIndex = 15 + Me.btnAdd.Text = "Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'txtNotes + ' + Me.txtNotes.Location = New System.Drawing.Point(15, 371) + Me.txtNotes.Multiline = True + Me.txtNotes.Name = "txtNotes" + Me.txtNotes.Size = New System.Drawing.Size(317, 84) + Me.txtNotes.TabIndex = 14 + ' + 'txtLen + ' + Me.txtLen.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtLen.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtLen.Location = New System.Drawing.Point(132, 330) + Me.txtLen.Name = "txtLen" + Me.txtLen.Size = New System.Drawing.Size(200, 20) + Me.txtLen.TabIndex = 13 + ' + 'txtCon + ' + Me.txtCon.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtCon.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtCon.Location = New System.Drawing.Point(132, 304) + Me.txtCon.Name = "txtCon" + Me.txtCon.Size = New System.Drawing.Size(200, 20) + Me.txtCon.TabIndex = 12 + ' + 'txtGroup + ' + Me.txtGroup.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtGroup.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtGroup.Location = New System.Drawing.Point(132, 95) + Me.txtGroup.Name = "txtGroup" + Me.txtGroup.Size = New System.Drawing.Size(200, 20) + Me.txtGroup.TabIndex = 4 + ' + 'dtpTested + ' + Me.dtpTested.Location = New System.Drawing.Point(132, 42) + Me.dtpTested.Name = "dtpTested" + Me.dtpTested.Size = New System.Drawing.Size(200, 20) + Me.dtpTested.TabIndex = 2 + ' + 'cmbFirearm + ' + Me.cmbFirearm.DataSource = Me.LoadersLogFirearmsBindingSource + Me.cmbFirearm.DisplayMember = "FullName" + Me.cmbFirearm.FormattingEnabled = True + Me.cmbFirearm.Location = New System.Drawing.Point(132, 15) + Me.cmbFirearm.Name = "cmbFirearm" + Me.cmbFirearm.Size = New System.Drawing.Size(200, 21) + Me.cmbFirearm.TabIndex = 1 + Me.cmbFirearm.ValueMember = "ID" + ' + 'LoadersLogFirearmsBindingSource + ' + Me.LoadersLogFirearmsBindingSource.DataMember = "Loaders_Log_Firearms" + Me.LoadersLogFirearmsBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'Label7 + ' + Me.Label7.AutoSize = True + Me.Label7.Location = New System.Drawing.Point(12, 355) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(35, 13) + Me.Label7.TabIndex = 26 + Me.Label7.Text = "Notes" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(12, 333) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(70, 13) + Me.Label6.TabIndex = 25 + Me.Label6.Text = "Total Length:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(12, 307) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(59, 13) + Me.Label5.TabIndex = 24 + Me.Label5.Text = "Conditions:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(12, 98) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(103, 13) + Me.Label3.TabIndex = 22 + Me.Label3.Text = "Group size or Score:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 46) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(65, 13) + Me.Label2.TabIndex = 21 + Me.Label2.Text = "Date tested:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 18) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(98, 13) + Me.Label1.TabIndex = 20 + Me.Label1.Text = "Firearm tested with:" + ' + 'Loaders_Log_FirearmsTableAdapter + ' + Me.Loaders_Log_FirearmsTableAdapter.ClearBeforeFill = True + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(12, 152) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(77, 13) + Me.Label4.TabIndex = 40 + Me.Label4.Text = "Powder Name:" + ' + 'Label10 + ' + Me.Label10.AutoSize = True + Me.Label10.Location = New System.Drawing.Point(12, 177) + Me.Label10.Name = "Label10" + Me.Label10.Size = New System.Drawing.Size(123, 13) + Me.Label10.TabIndex = 41 + Me.Label10.Text = "Weight of Powder Used:" + ' + 'Label11 + ' + Me.Label11.AutoSize = True + Me.Label11.Location = New System.Drawing.Point(12, 203) + Me.Label11.Name = "Label11" + Me.Label11.Size = New System.Drawing.Size(112, 13) + Me.Label11.TabIndex = 42 + Me.Label11.Text = "Powder Manufacturer:" + ' + 'Label12 + ' + Me.Label12.AutoSize = True + Me.Label12.Location = New System.Drawing.Point(12, 229) + Me.Label12.Name = "Label12" + Me.Label12.Size = New System.Drawing.Size(36, 13) + Me.Label12.TabIndex = 43 + Me.Label12.Text = "Bullet:" + ' + 'Label13 + ' + Me.Label13.AutoSize = True + Me.Label13.Location = New System.Drawing.Point(12, 255) + Me.Label13.Name = "Label13" + Me.Label13.Size = New System.Drawing.Size(39, 13) + Me.Label13.TabIndex = 44 + Me.Label13.Text = "Primer:" + ' + 'Label14 + ' + Me.Label14.AutoSize = True + Me.Label14.Location = New System.Drawing.Point(12, 281) + Me.Label14.Name = "Label14" + Me.Label14.Size = New System.Drawing.Size(34, 13) + Me.Label14.TabIndex = 45 + Me.Label14.Text = "Case:" + ' + 'txtPowName + ' + Me.txtPowName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPowName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPowName.Location = New System.Drawing.Point(132, 149) + Me.txtPowName.Name = "txtPowName" + Me.txtPowName.Size = New System.Drawing.Size(200, 20) + Me.txtPowName.TabIndex = 6 + ' + 'txtPowWei + ' + Me.txtPowWei.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPowWei.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPowWei.Location = New System.Drawing.Point(132, 174) + Me.txtPowWei.Name = "txtPowWei" + Me.txtPowWei.Size = New System.Drawing.Size(200, 20) + Me.txtPowWei.TabIndex = 7 + ' + 'txtPowManu + ' + Me.txtPowManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPowManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPowManu.Location = New System.Drawing.Point(132, 200) + Me.txtPowManu.Name = "txtPowManu" + Me.txtPowManu.Size = New System.Drawing.Size(200, 20) + Me.txtPowManu.TabIndex = 8 + ' + 'txtBullet + ' + Me.txtBullet.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtBullet.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtBullet.Location = New System.Drawing.Point(132, 226) + Me.txtBullet.Name = "txtBullet" + Me.txtBullet.Size = New System.Drawing.Size(200, 20) + Me.txtBullet.TabIndex = 9 + ' + 'txtPrimer + ' + Me.txtPrimer.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPrimer.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPrimer.Location = New System.Drawing.Point(132, 252) + Me.txtPrimer.Name = "txtPrimer" + Me.txtPrimer.Size = New System.Drawing.Size(200, 20) + Me.txtPrimer.TabIndex = 10 + ' + 'txtCase + ' + Me.txtCase.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtCase.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtCase.Location = New System.Drawing.Point(132, 278) + Me.txtCase.Name = "txtCase" + Me.txtCase.Size = New System.Drawing.Size(200, 20) + Me.txtCase.TabIndex = 11 + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmAddDataSheet_RiflePistols_MAN + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(349, 495) + Me.Controls.Add(Me.txtCase) + Me.Controls.Add(Me.txtPrimer) + Me.Controls.Add(Me.txtBullet) + Me.Controls.Add(Me.txtPowManu) + Me.Controls.Add(Me.txtPowWei) + Me.Controls.Add(Me.txtPowName) + Me.Controls.Add(Me.Label14) + Me.Controls.Add(Me.Label13) + Me.Controls.Add(Me.Label12) + Me.Controls.Add(Me.Label11) + Me.Controls.Add(Me.Label10) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.nudYards) + Me.Controls.Add(Me.Label9) + Me.Controls.Add(Me.nudShots) + Me.Controls.Add(Me.Label8) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.txtNotes) + Me.Controls.Add(Me.txtLen) + Me.Controls.Add(Me.txtCon) + Me.Controls.Add(Me.txtGroup) + Me.Controls.Add(Me.dtpTested) + Me.Controls.Add(Me.cmbFirearm) + Me.Controls.Add(Me.Label7) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.HelpProvider1.SetHelpKeyword(Me, "Add to Loaders Log - Rifle & Pistol - Manual") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Add to Loaders Log - Rifle & Pistol - Manual") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "FrmAddDataSheetRiflePistolsMan" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Add To Loaders Log " + CType(Me.nudYards, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.nudShots, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LoadersLogFirearmsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents nudYards As System.Windows.Forms.NumericUpDown - Friend WithEvents Label9 As System.Windows.Forms.Label - Friend WithEvents nudShots As System.Windows.Forms.NumericUpDown - Friend WithEvents Label8 As System.Windows.Forms.Label - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents txtNotes As System.Windows.Forms.TextBox - Friend WithEvents txtLen As System.Windows.Forms.TextBox - Friend WithEvents txtCon As System.Windows.Forms.TextBox - Friend WithEvents txtGroup As System.Windows.Forms.TextBox - Friend WithEvents dtpTested As System.Windows.Forms.DateTimePicker - Friend WithEvents cmbFirearm As System.Windows.Forms.ComboBox - Friend WithEvents Label7 As System.Windows.Forms.Label - Friend WithEvents Label6 As System.Windows.Forms.Label - Friend WithEvents Label5 As System.Windows.Forms.Label - Friend WithEvents Label3 As System.Windows.Forms.Label - Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents Label1 As System.Windows.Forms.Label - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents LoadersLogFirearmsBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents Loaders_Log_FirearmsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_FirearmsTableAdapter - Friend WithEvents Label4 As System.Windows.Forms.Label - Friend WithEvents Label10 As System.Windows.Forms.Label - Friend WithEvents Label11 As System.Windows.Forms.Label - Friend WithEvents Label12 As System.Windows.Forms.Label - Friend WithEvents Label13 As System.Windows.Forms.Label - Friend WithEvents Label14 As System.Windows.Forms.Label - Friend WithEvents txtPowName As System.Windows.Forms.TextBox - Friend WithEvents txtPowWei As System.Windows.Forms.TextBox - Friend WithEvents txtPowManu As System.Windows.Forms.TextBox - Friend WithEvents txtBullet As System.Windows.Forms.TextBox - Friend WithEvents txtPrimer As System.Windows.Forms.TextBox - Friend WithEvents txtCase As System.Windows.Forms.TextBox - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider -End Class + End Sub + Friend WithEvents nudYards As System.Windows.Forms.NumericUpDown + Friend WithEvents Label9 As System.Windows.Forms.Label + Friend WithEvents nudShots As System.Windows.Forms.NumericUpDown + Friend WithEvents Label8 As System.Windows.Forms.Label + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents txtNotes As System.Windows.Forms.TextBox + Friend WithEvents txtLen As System.Windows.Forms.TextBox + Friend WithEvents txtCon As System.Windows.Forms.TextBox + Friend WithEvents txtGroup As System.Windows.Forms.TextBox + Friend WithEvents dtpTested As System.Windows.Forms.DateTimePicker + Friend WithEvents cmbFirearm As System.Windows.Forms.ComboBox + Friend WithEvents Label7 As System.Windows.Forms.Label + Friend WithEvents Label6 As System.Windows.Forms.Label + Friend WithEvents Label5 As System.Windows.Forms.Label + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents LoadersLogFirearmsBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents Loaders_Log_FirearmsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_FirearmsTableAdapter + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents Label10 As System.Windows.Forms.Label + Friend WithEvents Label11 As System.Windows.Forms.Label + Friend WithEvents Label12 As System.Windows.Forms.Label + Friend WithEvents Label13 As System.Windows.Forms.Label + Friend WithEvents Label14 As System.Windows.Forms.Label + Friend WithEvents txtPowName As System.Windows.Forms.TextBox + Friend WithEvents txtPowWei As System.Windows.Forms.TextBox + Friend WithEvents txtPowManu As System.Windows.Forms.TextBox + Friend WithEvents txtBullet As System.Windows.Forms.TextBox + Friend WithEvents txtPrimer As System.Windows.Forms.TextBox + Friend WithEvents txtCase As System.Windows.Forms.TextBox + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddDataSheet_RiflePistols_MAN.vb b/BSMyLoadersLog/Adding/frmAddDataSheet_RiflePistols_MAN.vb index 3fcadff..2e570b8 100644 --- a/BSMyLoadersLog/Adding/frmAddDataSheet_RiflePistols_MAN.vb +++ b/BSMyLoadersLog/Adding/frmAddDataSheet_RiflePistols_MAN.vb @@ -1,112 +1,130 @@ -Imports BSMyLoadersLog.LoadersClass +Imports BSMyLoadersLog.Viewing +Imports BurnSoft.Applications.MLL.AutoFill Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.LoadersLog +Imports BurnSoft.Applications.MLL.Types -''' -''' Add Data sheet for Rifle or Pistol, aka metallic reloading data sheet -''' -Public Class FrmAddDataSheetRiflePistolsMan +Namespace Adding ''' - ''' This is from a view + ''' Add Data sheet for Rifle or Pistol, aka metallic reloading data sheet ''' - Public FromView As Boolean - ''' - ''' Firearm Id - ''' - Public Fid As Long - ''' - ''' Load the Auto Fill Fields - ''' - Sub LoadAutoFill() - Try - Dim objAf As New AutoFillCollections - txtGroup.AutoCompleteCustomSource = objAf.Loaders_Log_NSG_GroupSize - txtCon.AutoCompleteCustomSource = objAf.Loaders_Log_NSG_conditions - txtLen.AutoCompleteCustomSource = objAf.Loaders_Log_NSG_tl - txtPowName.AutoCompleteCustomSource = objAf.General_Powder_Name - txtPowManu.AutoCompleteCustomSource = objAf.General_Powder_Manufacturer - txtBullet.AutoCompleteCustomSource = objAf.Loaders_Log_NSG_Bullet - txtPrimer.AutoCompleteCustomSource = objAf.Loaders_Log_NSG_primer - txtCase.AutoCompleteCustomSource = objAf.Loaders_Log_NSG_case - Catch ex As Exception - Call LogError(Name, "LoadAutoFill", Err.Number, ex.Message.ToString) - End Try - End Sub - ''' - ''' Will the data table with durrent log information - ''' - Sub LoadData() - Try - Loaders_Log_FirearmsTableAdapter.Fill(MLLDataSet.Loaders_Log_Firearms) - cmbFirearm.SelectedValue = Fid - Catch ex As Exception - Call LogError(Name, "Load", Err.Number, ex.Message.ToString) - End Try - End Sub - ''' - ''' Save the informamtion to the database - ''' - Sub SaveData() - Try - Dim lngFid As Long = cmbFirearm.SelectedValue - Dim strFireArm As String = cmbFirearm.Text - Dim strDateTested As String = dtpTested.Value - Dim strGroup As String = GeneralHelpers.FluffContent(txtGroup.Text) - Dim lngNumShots As Long = nudShots.Value - Dim lngYards As Long = nudYards.Value - Dim strPowName As String = GeneralHelpers.FluffContent(txtPowName.Text) - Dim strPowWei As String = GeneralHelpers.FluffContent(txtPowWei.Text) - Dim strPowManu As String = GeneralHelpers.FluffContent(txtPowManu.Text) - Dim strBullet As String = GeneralHelpers.FluffContent(txtBullet.Text) - Dim strPrimer As String = GeneralHelpers.FluffContent(txtPrimer.Text) - Dim strCase As String = GeneralHelpers.FluffContent(txtCase.Text) - Dim strCond As String = GeneralHelpers.FluffContent(txtCon.Text) - Dim strLen As String = GeneralHelpers.FluffContent(txtLen.Text) - Dim strNotes As String = GeneralHelpers.FluffContent(txtNotes.Text) - Dim configName As String = "N/A" - Dim strBarLen As String = "" - Dim caliber As String = "" - Dim obj As New BSDatabase - Dim objGf As New GlobalFunctions - Call objGf.GetFirearmDetails(lngFid, 0, "", "", "", caliber, strBarLen) - Dim sql As String = "INSERT INTO Loaders_Log_NSG (fid,dt,yds,gs,ns,pwm,bullet," & _ - "primer,case,conditions,tl,notes,ConfigName,FirearmName,Caliber,BarrelLen)" & _ - " VALUES (" & lngFid & ",'" & strDateTested & "'," & lngYards & _ - ",'" & strGroup & "'," & lngNumShots & ",'" & strPowName & " - " & strPowWei & _ - " - " & strPowManu & "','" & strBullet & _ - "','" & strPrimer & "','" & strCase & _ - "','" & strCond & "','" & strLen & "','" & strNotes & "','" & _ - configName & "','" & strFireArm & "','" & caliber & "','" & strBarLen & "')" - obj.ConnExec(sql) - MsgBox("Information was saved to the Loaders Log!") - If FromView Then Call frmViewDataSheet_RiflePistols.LoadDataCur() + Public Class FrmAddDataSheetRiflePistolsMan + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' This is from a view + ''' + Public FromView As Boolean + ''' + ''' Firearm Id + ''' + Public Fid As Long + ''' + ''' Load the Auto Fill Fields + ''' + Sub LoadAutoFill() + Try + txtGroup.AutoCompleteCustomSource = ConfigMetalic.GroupSize(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtCon.AutoCompleteCustomSource = ConfigMetalic.Conditions(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtLen.AutoCompleteCustomSource = ConfigMetalic.TotalLenght(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtPowName.AutoCompleteCustomSource = Powder.Name(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtPowManu.AutoCompleteCustomSource = Powder.Manufacturer(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtBullet.AutoCompleteCustomSource = ConfigMetalic.Bullet(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtPrimer.AutoCompleteCustomSource = ConfigMetalic.Primer(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtCase.AutoCompleteCustomSource = ConfigMetalic.Case(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "LoadAutoFill", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Will the data table with durrent log information + ''' + Sub LoadData() + Try + Loaders_Log_FirearmsTableAdapter.Fill(MLLDataSet.Loaders_Log_Firearms) + cmbFirearm.SelectedValue = Fid + Catch ex As Exception + Call LogError(Name, "Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Save the informamtion to the database + ''' + Sub SaveData() + Try + Dim firearmId As Long = cmbFirearm.SelectedValue + Dim firearmName As String = cmbFirearm.Text + Dim dateCreated As String = dtpTested.Value + Dim groupSize As String = GeneralHelpers.FluffContent(txtGroup.Text) + Dim numShots As Long = nudShots.Value + Dim yards As Long = nudYards.Value + Dim powderName As String = GeneralHelpers.FluffContent(txtPowName.Text) + Dim powderWeight As String = GeneralHelpers.FluffContent(txtPowWei.Text) + Dim powderManufacturer As String = GeneralHelpers.FluffContent(txtPowManu.Text) + Dim bulletDetails As String = GeneralHelpers.FluffContent(txtBullet.Text) + Dim primerDetails As String = GeneralHelpers.FluffContent(txtPrimer.Text) + Dim caseDetails As String = GeneralHelpers.FluffContent(txtCase.Text) + Dim condition As String = GeneralHelpers.FluffContent(txtCon.Text) + Dim oal As String = GeneralHelpers.FluffContent(txtLen.Text) + Dim notes As String = GeneralHelpers.FluffContent(txtNotes.Text) + Dim configName As String = "N/A" + Dim barrelLenght As String = "" + Dim caliber As String = "" + + Dim lst As List(Of FirearmCollection) = Firearms.GetDetails(DatabasePath, CInt(firearmId), _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As FirearmCollection In lst + caliber = o.Caliber + barrelLenght = o.Barrel + Next + + If Not LoadersLogMetallic.Add(DatabasePath, firearmId, dateCreated, CInt(yards), groupSize, + CInt(numShots), $"{powderName} - {powderWeight} - {powderManufacturer}", + bulletDetails, primerDetails, caseDetails, condition, oal, notes, + configName, firearmName, caliber, barrelLenght, + _errOut) Then Throw New Exception(_errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + MsgBox("Information was saved to the Loaders Log!") + If FromView Then Call FrmViewDataSheetRiflePistols.LoadDataCur() + Close() + Catch ex As Exception + Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Manual Load view + ''' + ''' + ''' + Private Sub frmAddDataSheet_RiflePistols_MAN_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call LoadData() + Call LoadAutoFill() + End Sub + ''' + ''' Canel button + ''' + ''' + ''' + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click Close() - Catch ex As Exception - Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) - End Try - End Sub - ''' - ''' Manual Load view - ''' - ''' - ''' - Private Sub frmAddDataSheet_RiflePistols_MAN_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load - Call LoadData() - Call LoadAutoFill() - End Sub - ''' - ''' Canel button - ''' - ''' - ''' - Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click - Close() - End Sub - ''' - ''' Add Button - ''' - ''' - ''' - Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click - Call SaveData() - End Sub -End Class \ No newline at end of file + End Sub + ''' + ''' Add Button + ''' + ''' + ''' + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click + Call SaveData() + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddDataSheet_ShotGun_CFG.Designer.vb b/BSMyLoadersLog/Adding/frmAddDataSheet_ShotGun_CFG.Designer.vb index 5887145..0234289 100644 --- a/BSMyLoadersLog/Adding/frmAddDataSheet_ShotGun_CFG.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddDataSheet_ShotGun_CFG.Designer.vb @@ -1,251 +1,253 @@ - _ -Partial Class FrmAddDataSheetShotGunCfg - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddDataSheetShotGunCfg + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmAddDataSheetShotGunCfg)) - 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.cmbFirearm = New System.Windows.Forms.ComboBox() - Me.LoadersLogFirearmsBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet() - Me.Loaders_Log_FirearmsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_FirearmsTableAdapter() - Me.dtpTested = New System.Windows.Forms.DateTimePicker() - Me.nudYards = New System.Windows.Forms.NumericUpDown() - Me.cmbConfiguration = New System.Windows.Forms.ComboBox() - Me.ConfigListSimpleSGBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.txtPattern = New System.Windows.Forms.TextBox() - Me.txtNotes = New System.Windows.Forms.TextBox() - Me.btnAdd = New System.Windows.Forms.Button() - Me.btnCancel = New System.Windows.Forms.Button() - Me.ConfigList_Simple_SGTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.ConfigList_Simple_SGTableAdapter() - CType(Me.LoadersLogFirearmsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.nudYards, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.ConfigListSimpleSGBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(10, 23) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(98, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Firearm tested with:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(10, 53) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(65, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Date tested:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(10, 79) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(81, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Yards tested at:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(10, 102) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(100, 13) - Me.Label4.TabIndex = 3 - Me.Label4.Text = "Configuration Used:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(10, 129) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(82, 13) - Me.Label5.TabIndex = 4 - Me.Label5.Text = "Pattern Density:" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(10, 151) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(38, 13) - Me.Label6.TabIndex = 5 - Me.Label6.Text = "Notes:" - ' - 'cmbFirearm - ' - Me.cmbFirearm.DataSource = Me.LoadersLogFirearmsBindingSource - Me.cmbFirearm.DisplayMember = "FullName" - Me.cmbFirearm.FormattingEnabled = True - Me.cmbFirearm.Location = New System.Drawing.Point(115, 20) - Me.cmbFirearm.Name = "cmbFirearm" - Me.cmbFirearm.Size = New System.Drawing.Size(213, 21) - Me.cmbFirearm.TabIndex = 6 - Me.cmbFirearm.ValueMember = "ID" - ' - 'LoadersLogFirearmsBindingSource - ' - Me.LoadersLogFirearmsBindingSource.DataMember = "Loaders_Log_Firearms" - Me.LoadersLogFirearmsBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'Loaders_Log_FirearmsTableAdapter - ' - Me.Loaders_Log_FirearmsTableAdapter.ClearBeforeFill = True - ' - 'dtpTested - ' - Me.dtpTested.Location = New System.Drawing.Point(115, 47) - Me.dtpTested.Name = "dtpTested" - Me.dtpTested.Size = New System.Drawing.Size(213, 20) - Me.dtpTested.TabIndex = 7 - ' - 'nudYards - ' - Me.nudYards.Location = New System.Drawing.Point(115, 73) - Me.nudYards.Maximum = New Decimal(New Integer() {5000, 0, 0, 0}) - Me.nudYards.Name = "nudYards" - Me.nudYards.Size = New System.Drawing.Size(213, 20) - Me.nudYards.TabIndex = 8 - Me.nudYards.TextAlign = System.Windows.Forms.HorizontalAlignment.Center - ' - 'cmbConfiguration - ' - Me.cmbConfiguration.DataSource = Me.ConfigListSimpleSGBindingSource - Me.cmbConfiguration.DisplayMember = "ConfigName" - Me.cmbConfiguration.FormattingEnabled = True - Me.cmbConfiguration.Location = New System.Drawing.Point(115, 99) - Me.cmbConfiguration.Name = "cmbConfiguration" - Me.cmbConfiguration.Size = New System.Drawing.Size(213, 21) - Me.cmbConfiguration.TabIndex = 9 - Me.cmbConfiguration.ValueMember = "ID" - ' - 'ConfigListSimpleSGBindingSource - ' - Me.ConfigListSimpleSGBindingSource.DataMember = "ConfigList_Simple_SG" - Me.ConfigListSimpleSGBindingSource.DataSource = Me.MLLDataSet - ' - 'txtPattern - ' - Me.txtPattern.Location = New System.Drawing.Point(115, 126) - Me.txtPattern.Name = "txtPattern" - Me.txtPattern.Size = New System.Drawing.Size(213, 20) - Me.txtPattern.TabIndex = 10 - ' - 'txtNotes - ' - Me.txtNotes.Location = New System.Drawing.Point(13, 168) - Me.txtNotes.Multiline = True - Me.txtNotes.Name = "txtNotes" - Me.txtNotes.Size = New System.Drawing.Size(315, 102) - Me.txtNotes.TabIndex = 11 - ' - 'btnAdd - ' - Me.btnAdd.Location = New System.Drawing.Point(13, 277) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(75, 23) - Me.btnAdd.TabIndex = 12 - Me.btnAdd.Text = "Add" - Me.btnAdd.UseVisualStyleBackColor = True - ' - 'btnCancel - ' - Me.btnCancel.Location = New System.Drawing.Point(252, 278) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 13 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'ConfigList_Simple_SGTableAdapter - ' - Me.ConfigList_Simple_SGTableAdapter.ClearBeforeFill = True - ' - 'frmAddDataSheet_ShotGun_CFG - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(339, 313) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnAdd) - Me.Controls.Add(Me.txtNotes) - Me.Controls.Add(Me.txtPattern) - Me.Controls.Add(Me.cmbConfiguration) - Me.Controls.Add(Me.nudYards) - Me.Controls.Add(Me.dtpTested) - Me.Controls.Add(Me.cmbFirearm) - Me.Controls.Add(Me.Label6) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "FrmAddDataSheetShotGunCfg" - Me.Text = "Add to Loaders Log Using a Configuration" - CType(Me.LoadersLogFirearmsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.nudYards, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.ConfigListSimpleSGBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmAddDataSheetShotGunCfg)) + 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.cmbFirearm = New System.Windows.Forms.ComboBox() + Me.LoadersLogFirearmsBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet() + Me.Loaders_Log_FirearmsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_FirearmsTableAdapter() + Me.dtpTested = New System.Windows.Forms.DateTimePicker() + Me.nudYards = New System.Windows.Forms.NumericUpDown() + Me.cmbConfiguration = New System.Windows.Forms.ComboBox() + Me.ConfigListSimpleSGBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.txtPattern = New System.Windows.Forms.TextBox() + Me.txtNotes = New System.Windows.Forms.TextBox() + Me.btnAdd = New System.Windows.Forms.Button() + Me.btnCancel = New System.Windows.Forms.Button() + Me.ConfigList_Simple_SGTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.ConfigList_Simple_SGTableAdapter() + CType(Me.LoadersLogFirearmsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.nudYards, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ConfigListSimpleSGBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(10, 23) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(98, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Firearm tested with:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(10, 53) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(65, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Date tested:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(10, 79) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(81, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Yards tested at:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(10, 102) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(100, 13) + Me.Label4.TabIndex = 3 + Me.Label4.Text = "Configuration Used:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(10, 129) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(82, 13) + Me.Label5.TabIndex = 4 + Me.Label5.Text = "Pattern Density:" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(10, 151) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(38, 13) + Me.Label6.TabIndex = 5 + Me.Label6.Text = "Notes:" + ' + 'cmbFirearm + ' + Me.cmbFirearm.DataSource = Me.LoadersLogFirearmsBindingSource + Me.cmbFirearm.DisplayMember = "FullName" + Me.cmbFirearm.FormattingEnabled = True + Me.cmbFirearm.Location = New System.Drawing.Point(115, 20) + Me.cmbFirearm.Name = "cmbFirearm" + Me.cmbFirearm.Size = New System.Drawing.Size(213, 21) + Me.cmbFirearm.TabIndex = 6 + Me.cmbFirearm.ValueMember = "ID" + ' + 'LoadersLogFirearmsBindingSource + ' + Me.LoadersLogFirearmsBindingSource.DataMember = "Loaders_Log_Firearms" + Me.LoadersLogFirearmsBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'Loaders_Log_FirearmsTableAdapter + ' + Me.Loaders_Log_FirearmsTableAdapter.ClearBeforeFill = True + ' + 'dtpTested + ' + Me.dtpTested.Location = New System.Drawing.Point(115, 47) + Me.dtpTested.Name = "dtpTested" + Me.dtpTested.Size = New System.Drawing.Size(213, 20) + Me.dtpTested.TabIndex = 7 + ' + 'nudYards + ' + Me.nudYards.Location = New System.Drawing.Point(115, 73) + Me.nudYards.Maximum = New Decimal(New Integer() {5000, 0, 0, 0}) + Me.nudYards.Name = "nudYards" + Me.nudYards.Size = New System.Drawing.Size(213, 20) + Me.nudYards.TabIndex = 8 + Me.nudYards.TextAlign = System.Windows.Forms.HorizontalAlignment.Center + ' + 'cmbConfiguration + ' + Me.cmbConfiguration.DataSource = Me.ConfigListSimpleSGBindingSource + Me.cmbConfiguration.DisplayMember = "ConfigName" + Me.cmbConfiguration.FormattingEnabled = True + Me.cmbConfiguration.Location = New System.Drawing.Point(115, 99) + Me.cmbConfiguration.Name = "cmbConfiguration" + Me.cmbConfiguration.Size = New System.Drawing.Size(213, 21) + Me.cmbConfiguration.TabIndex = 9 + Me.cmbConfiguration.ValueMember = "ID" + ' + 'ConfigListSimpleSGBindingSource + ' + Me.ConfigListSimpleSGBindingSource.DataMember = "ConfigList_Simple_SG" + Me.ConfigListSimpleSGBindingSource.DataSource = Me.MLLDataSet + ' + 'txtPattern + ' + Me.txtPattern.Location = New System.Drawing.Point(115, 126) + Me.txtPattern.Name = "txtPattern" + Me.txtPattern.Size = New System.Drawing.Size(213, 20) + Me.txtPattern.TabIndex = 10 + ' + 'txtNotes + ' + Me.txtNotes.Location = New System.Drawing.Point(13, 168) + Me.txtNotes.Multiline = True + Me.txtNotes.Name = "txtNotes" + Me.txtNotes.Size = New System.Drawing.Size(315, 102) + Me.txtNotes.TabIndex = 11 + ' + 'btnAdd + ' + Me.btnAdd.Location = New System.Drawing.Point(13, 277) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(75, 23) + Me.btnAdd.TabIndex = 12 + Me.btnAdd.Text = "Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'btnCancel + ' + Me.btnCancel.Location = New System.Drawing.Point(252, 278) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 13 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'ConfigList_Simple_SGTableAdapter + ' + Me.ConfigList_Simple_SGTableAdapter.ClearBeforeFill = True + ' + 'frmAddDataSheet_ShotGun_CFG + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(339, 313) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.txtNotes) + Me.Controls.Add(Me.txtPattern) + Me.Controls.Add(Me.cmbConfiguration) + Me.Controls.Add(Me.nudYards) + Me.Controls.Add(Me.dtpTested) + Me.Controls.Add(Me.cmbFirearm) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "FrmAddDataSheetShotGunCfg" + Me.Text = "Add to Loaders Log Using a Configuration" + CType(Me.LoadersLogFirearmsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.nudYards, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ConfigListSimpleSGBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - 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 cmbFirearm As System.Windows.Forms.ComboBox - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents LoadersLogFirearmsBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents Loaders_Log_FirearmsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_FirearmsTableAdapter - Friend WithEvents dtpTested As System.Windows.Forms.DateTimePicker - Friend WithEvents nudYards As System.Windows.Forms.NumericUpDown - Friend WithEvents cmbConfiguration As System.Windows.Forms.ComboBox - Friend WithEvents txtPattern As System.Windows.Forms.TextBox - Friend WithEvents txtNotes As System.Windows.Forms.TextBox - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents ConfigListSimpleSGBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents ConfigList_Simple_SGTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.ConfigList_Simple_SGTableAdapter -End Class + End Sub + 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 cmbFirearm As System.Windows.Forms.ComboBox + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents LoadersLogFirearmsBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents Loaders_Log_FirearmsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_FirearmsTableAdapter + Friend WithEvents dtpTested As System.Windows.Forms.DateTimePicker + Friend WithEvents nudYards As System.Windows.Forms.NumericUpDown + Friend WithEvents cmbConfiguration As System.Windows.Forms.ComboBox + Friend WithEvents txtPattern As System.Windows.Forms.TextBox + Friend WithEvents txtNotes As System.Windows.Forms.TextBox + Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents ConfigListSimpleSGBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents ConfigList_Simple_SGTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.ConfigList_Simple_SGTableAdapter + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddDataSheet_ShotGun_CFG.vb b/BSMyLoadersLog/Adding/frmAddDataSheet_ShotGun_CFG.vb index 710dae7..73ea731 100644 --- a/BSMyLoadersLog/Adding/frmAddDataSheet_ShotGun_CFG.vb +++ b/BSMyLoadersLog/Adding/frmAddDataSheet_ShotGun_CFG.vb @@ -1,164 +1,297 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc -Public Class FrmAddDataSheetShotGunCfg - Public Fid As Long - Public FromView As Boolean - Sub LoadAutoFill() - Try - - Dim objAf As New AutoFillCollections.ShotGun - 'Put in things that you want to autofill in this box - txtPattern.AutoCompleteCustomSource = objAf.List_SG_Log_SG_Patterns() - - Catch ex As Exception - Call LogError(Name, "LoadAutoFill", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub SaveData() - Try - Dim lngFid As Long = cmbFirearm.SelectedValue - Dim strFireArm As String = cmbFirearm.Text - Dim strdateTested As String = dtpTested.Value - Dim strPattern As String = txtPattern.Text - Dim lngYards As Long = nudYards.Value - Dim configId As Long = cmbConfiguration.SelectedValue - Dim configName As String = cmbConfiguration.Text - Dim strNotes As String = txtNotes.Text - Dim strBarLen As String = "" - Dim powName As String = "" - Dim powWei As Double = 0 - Dim powManu As String = "" - Dim shotWt As String = "" - Dim shotSizeNo As String = "" - Dim hullName As String = "" - Dim hullManufacturer As String = "" - Dim hullLength As String = "" - Dim hullDram As String = "" - Dim pbm As String = "" - Dim wad As String = "" - Dim primerName As String = "" - Dim priManu As String = "" - Dim pd As String = "" - Dim caliber As String = "" - Dim obj As New BSDatabase - Dim objIm As New InventoryMath - Dim objGf As New GlobalFunctions - - Dim shotDetailsManu As String = "" - Dim shotDetailsName As String = "" - Dim shotDetailsQty As Double - Dim shotDetailsEpps As Double - Dim shotDetailsGr As Double - Dim isSlug As Boolean = False - Dim shotMaterial As String = "" - Dim shotShotNo As String = "" - Dim slugWeight As String = "" - Dim instockShotOz As Double - Dim prefLoad As String - Dim shotPrefload As Double - Dim costSlug As Double - Dim costShot As Double - Dim instockShot As Double - Dim instockSlug As Double - Dim wadManu As String = "" - Dim wadName As String = "" - Dim powderId As Long = 0 - Dim powderDefault As Double - Dim powderManu As String = "" - Dim powderName As String = "" - - Dim shotSize As String = "" - Dim caseDetails As String = "" - Dim primerDetails As String = "" - - Dim prefferedPowderId As Long = objIm.GetPrefSGPowderID(configId, powWei) - Call objGf.GetFirearmDetails(lngFid, 0, "", "", "", "", strBarLen) - Call obj.ConnectDB() - - Dim sql As String = "SELECT * from Config_List_Data_SG where CLNID=" & configId - Dim cmd As New OdbcCommand(sql, obj.Conn) - Dim rs As OdbcDataReader - rs = cmd.ExecuteReader - While rs.Read - 'LEFTOFF - adding config data to log - 'Subs are normally in the InvetoryMathSection - caliber = objIm.GetCaliber(rs("CALID")) - - Call objIm.LoadPrimerInfo(rs("PRID"), priManu, primerName) - primerDetails = priManu & " " & primerName - - Call objIm.LoadHullInfo(rs("CAID"), hullManufacturer, hullName, hullLength, 0, 0, hullDram) - caseDetails = "DRAM: " & hullDram & " - " & hullManufacturer & " " & hullName - - Call objIm.LoadSG_ShotType_Details(rs("SCL"), shotDetailsManu, shotDetailsName, isSlug, _ - shotMaterial, shotShotNo, slugWeight, "", shotDetailsQty, shotDetailsEpps, _ - 0, instockShotOz, shotDetailsGr) - If Not IsDBNull(rs("SW_t")) Then prefLoad = rs("SW_t") - shotPrefload = rs("SW") - If Not isSlug Then - costShot = shotDetailsEpps - instockShot = shotDetailsGr - shotSize = "SLUG - " & shotDetailsManu & " - " & shotDetailsName - Else - costSlug = shotDetailsEpps - instockSlug = shotDetailsQty - shotSize = shotSizeNo & " - " & shotDetailsManu & " - " & shotDetailsName - End If - - 'TODO: FINISHS THIS!!! - 'Loaders_Log_SG - 'THE SCL column is used for both Slug and Shot - 'load wad information - Call objIm.LoadWADInfo(rs("WAD"), wadManu, wadName, "", 0, 0, 0) - wad = wadManu & " " & wadName - 'load powder details into vars - powderId = objIm.GetPrefSGPowderIDID(configId, powderDefault) - Call objIm.GetPowderDetails(powderId, powderManu, powderName, 0, 0, 0, "", 0) - pbm = powderDefault & " - " & "Bushing" & powderManu & " " & powderName - - End While - - rs.Close() - rs = Nothing - cmd = Nothing - sql = "INSERT INTO Loaders_Log_SG(fid,FirearmName,Caliber,BarrelLen,ConfigName,Shotwt,ShotSize,case,pbm,wad,primer,pd,yds,notes) VALUES(" & _ - lngFid & ",'" & strFireArm & "','" & caliber & "','" & strBarLen & "','" & configName & "','" & shotWt & "','" & shotSize & _ - "','" & caseDetails & "','" & pbm & "','" & wad & "','" & primerDetails & "','" & pd & "'," & lngYards & ",'" & strNotes & "')" - - - Catch ex As Exception - Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub UpdateConfigList() - Try - Dim objGf As New GlobalFunctions - Dim lngFid As Long = cmbFirearm.SelectedValue - Dim strFireArm As String = "" - Dim strCal As String = "" - Call objGf.GetFirearmDetails(lngFid, 0, "", "", "", strCal) - Dim calId As Long = objGf.GetCaliberID(strCal) - ConfigList_Simple_SGTableAdapter.FillBy_Caliber(MLLDataSet.ConfigList_Simple_SG, calId) - Catch ex As Exception - Call LogError(Name, "UpdateConfigList", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmAddDataSheet_ShotGun_CFG_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load - Loaders_Log_FirearmsTableAdapter.FillByFullNameShotgunOnly(MLLDataSet.Loaders_Log_Firearms) - cmbFirearm.SelectedValue = Fid - Call UpdateConfigList() - Call LoadAutoFill() - End Sub - - Private Sub cmbFirearm_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles cmbFirearm.SelectedIndexChanged - Call UpdateConfigList() - End Sub - - Private Sub btnCancel_Click(sender As System.Object, e As System.EventArgs) Handles btnCancel.Click - Close() - End Sub - - Private Sub btnAdd_Click(sender As System.Object, e As System.EventArgs) Handles btnAdd.Click - Call SaveData() - End Sub -End Class \ No newline at end of file +'Imports System.Data.Odbc +'Imports BSMyLoadersLog.LoadersClass +Imports BurnSoft.Applications.MLL.AutoFill +Imports BurnSoft.Applications.MLL.ConfigSheets +Imports BurnSoft.Applications.MLL.Global +Imports BurnSoft.Applications.MLL.Inventory +Imports BurnSoft.Applications.MLL.LoadersLog +Imports BurnSoft.Applications.MLL.Types + +Namespace Adding + ''' + ''' Class FrmAddDataSheetShotGunCfg. + ''' Implements the + ''' + ''' + Public Class FrmAddDataSheetShotGunCfg + 'TODO: #20 Clean up Code + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' The firearm identifier + ''' + Public FirearmId As Long + ''' + ''' From view + ''' + Public FromView As Boolean + ''' + ''' Loads the automatic fill. + ''' + ''' + Sub LoadAutoFill() + Try + + 'Dim objAf As New AutoFillCollections.ShotGun + ''Put in things that you want to autofill in this box + 'txtPattern.AutoCompleteCustomSource = objAf.List_SG_Log_SG_Patterns() + txtPattern.AutoCompleteCustomSource = ConfigShotgun.LogPattern(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "LoadAutoFill", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Saves the data. + ''' + Sub SaveData() + Try + FirearmId = cmbFirearm.SelectedValue + Dim firearmName As String = cmbFirearm.Text + Dim dateCreated As String = dtpTested.Value + Dim pattern As String = txtPattern.Text + Dim yards As Long = nudYards.Value + Dim configId As Long = cmbConfiguration.SelectedValue + Dim configName As String = cmbConfiguration.Text + Dim notes As String = txtNotes.Text + Dim barrelLenght As String = "" + 'Dim powderName As String = "" + Dim powderWeight As Double = 0 + 'Dim powderManufacturer As String = "" + Dim shotWt As String = "" + Dim shotSizeNo As String = "" + 'Dim hullName As String = "" + 'Dim hullManufacturer As String = "" + 'Dim hullLength As String = "" + 'Dim hullDram As String = "" + Dim hullId as Long = 0 + Dim powderDetails As String = "" + Dim wad As String = "" + Dim primerId as Long = 0 + 'Dim primerName As String = "" + 'Dim primerManufacturer As String = "" + 'Dim pd As String = "" + Dim caliber As String = "" + 'Dim obj As New BSDatabase + 'Dim objIm As New InventoryMath + 'Dim objGf As New GlobalFunctions + + 'Dim shotDetailsManu As String = "" + 'Dim shotDetailsName As String = "" + 'Dim shotDetailsQty As Double + 'Dim shotDetailsEpps As Double + 'Dim shotDetailsGr As Double + 'Dim isSlug As Boolean = False + 'Dim shotMaterial As String = "" + 'Dim shotShotNo As String = "" + 'Dim slugWeight As String = "" + 'Dim instockShotOz As Double + 'Dim prefLoad As String + 'Dim shotPrefload As Double + 'Dim costSlug As Double + 'Dim costShot As Double + 'Dim instockShot As Double + 'Dim instockSlug As Double + 'Dim wadManu As String = "" + 'Dim wadName As String = "" + 'Dim powderId As Long = 0 + Dim powderDefault As Double + 'Dim powderManu As String = "" + 'Dim powderName As String = "" + 'Dim powderWeight As Double = 0 + Dim shotSize As String = "" + Dim caseDetails As String = "" + Dim primerDetails As String = "" + Dim shotTypeId as Long = 0 + Dim wadId As Long = 0 + + 'Dim prefferedPowderId As Long = objIm.GetPrefSGPowderID(configId, powWei) + Dim prefferedPowderId As Long = ConfigListDataPowder.GetDefaultPowderId(DatabasePath, configId, powderWeight, _errOut) + Dim lst As List(Of FirearmCollection) = Firearms.GetDetails(DatabasePath, CInt(FirearmId), _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As FirearmCollection In lst + barrelLenght = o.Barrel + Next + + + ConfigListDataPowderShotGun.GetDefaultPowderId(DatabasePath, configId, powderDefault, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Dim powderList as List(Of PowderListing) = PowderInventory.GetDetails(DatabasePath, prefferedPowderId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As PowderListing In powderList + powderDetails = $"{powderDefault} - {o.Manufacturer} {o.Name}" + Next + + Dim configList As List(Of ConfigListDataShotgunData) = ConfigListDataShotgun.GetDetails(DatabasePath, + CInt(FirearmId), _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As ConfigListDataShotgunData In configList + caliber = CaliberInventory.GetName(DatabasePath, o.CaliberId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + 'shotPrefload = o.ShotWeight + 'prefLoad = o.ShotWeightText + primerId = o.PrimerId + hullId = o.CaseId + shotTypeId = o.ShotChargeLoad + wadId = o.Wad + Next + + Dim primerList As List(Of PrimerListings) = PrimerInventory.GetDetails(DatabasePath, primerId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each p As PrimerListings In primerList + primerDetails = $"{p.Manufacturer} {p.Name}" + Next + + Dim hullList As List(Of ShotgunHullData) = ShotgunHullInventory.GetDetails(DatabasePath, hullId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As ShotgunHullData In hullList + caseDetails = $"DRAM: {o.DRAM} - {o.Manufacturer} - {o.Name}" + Next + + Dim shotType as List(Of ShotgunShotTypeData) = ShotgunShotTypeInventory.GetDetails(DatabasePath, shotTypeId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As ShotgunShotTypeData In shotType + If Not o.IsSlug Then + 'costShot = o.EstimatedPricePerItem + 'instockShot = o.Grams + shotSize = $"SLUG - {o.Manufacturer} - {o.Name}" + Else + 'costSlug = o.EstimatedPricePerItem + 'instockSlug = o.Qty + shotSize = shotSizeNo & $"{o.ShotNumber} - {o.Manufacturer} {o.Name}" + End If + Next + + Dim wadList As List(Of WadData) = WadInventory.GetDetails(DatabasePath, wadId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As WadData In wadList + wad = $"{o.Manufacturer} {o.Name}" + Next + + + 'Call objGf.GetFirearmDetails(lngFid, 0, "", "", "", "", strBarLen) + 'Call obj.ConnectDB() + + 'Dim sql As String = "SELECT * from Config_List_Data_SG where CLNID=" & configId + 'Dim cmd As New OdbcCommand(sql, obj.Conn) + 'Dim rs As OdbcDataReader + 'rs = cmd.ExecuteReader + 'While rs.Read + ' 'LEFTOFF - adding config data to log + ' 'Subs are normally in the InvetoryMathSection + ' 'caliber = objIm.GetCaliber(rs("CALID")) + + ' 'Call objIm.LoadPrimerInfo(rs("PRID"), primerManufacturer, primerName) + ' 'primerDetails = primerManufacturer & " " & primerName + + ' 'Call objIm.LoadHullInfo(rs("CAID"), hullManufacturer, hullName, hullLength, 0, 0, hullDram) + ' 'caseDetails = "DRAM: " & hullDram & " - " & hullManufacturer & " " & hullName + + ' 'Call objIm.LoadSG_ShotType_Details(rs("SCL"), shotDetailsManu, shotDetailsName, isSlug, _ + ' ' shotMaterial, shotShotNo, slugWeight, "", shotDetailsQty, shotDetailsEpps, _ + ' ' 0, instockShotOz, shotDetailsGr) + ' 'If Not IsDBNull(rs("SW_t")) Then prefLoad = rs("SW_t") + ' 'shotPrefload = rs("SW") + ' 'If Not isSlug Then + ' ' costShot = shotDetailsEpps + ' ' instockShot = shotDetailsGr + ' ' shotSize = "SLUG - " & shotDetailsManu & " - " & shotDetailsName + ' 'Else + ' ' costSlug = shotDetailsEpps + ' ' instockSlug = shotDetailsQty + ' ' shotSize = shotSizeNo & " - " & shotDetailsManu & " - " & shotDetailsName + ' 'End If + + ' 'TODO: FINISHS THIS!!! + ' 'Loaders_Log_SG + ' 'THE SCL column is used for both Slug and Shot + ' 'load wad information + ' 'Call objIm.LoadWADInfo(rs("WAD"), wadManu, wadName, "", 0, 0, 0) + ' 'wad = wadManu & " " & wadName + ' 'load powder details into vars + ' powderId = objIm.GetPrefSGPowderIDID(configId, powderDefault) + ' Call objIm.GetPowderDetails(powderId, powderManu, powderName, 0, 0, 0, "", 0) + ' pbm = powderDefault & " - " & "Bushing" & powderManu & " " & powderName + + 'End While + + 'rs.Close() + 'rs = Nothing + 'cmd = Nothing + 'Dim sql = "INSERT INTO Loaders_Log_SG(fid,FirearmName,Caliber,BarrelLen,ConfigName,Shotwt,ShotSize,case,pbm,wad,primer,pd,yds,notes) VALUES(" & _ + ' FirearmId & ",'" & firearmName & "','" & caliber & "','" & barrelLenght & "','" & configName & "','" & shotWt & "','" & shotSize & _ + ' "','" & caseDetails & "','" & powderDetails & "','" & wad & "','" & primerDetails & "','" & pd & "'," & yards & ",'" & notes & "')" + If Not LoadersLogShotgun.Add(DatabasePath, FirearmId, firearmName, caliber, barrelLenght, + configName, dateCreated,shotWt,shotSize, caseDetails, + powderDetails,wad, primerDetails, pattern, yards, + notes, _errOut) Then Throw New Exception(_errOut) + + Catch ex As Exception + Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Updates the configuration list. + ''' + Sub UpdateConfigList() + Try + 'Dim objGf As New GlobalFunctions + Dim lngFid As Long = cmbFirearm.SelectedValue + 'Dim strFireArm As String = "" + 'Dim strCal As String = "" + 'Call objGf.GetFirearmDetails(lngFid, 0, "", "", "", strCal) + Dim calId As Long = 0 + Dim lst As List(Of FirearmCollection) = Firearms.GetDetails(DatabasePath, CInt(lngFid), _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As FirearmCollection In lst + calId = GeneralFunctions.GetCaliberID(DatabasePath, o.Caliber, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Next + ConfigList_Simple_SGTableAdapter.FillBy_Caliber(MLLDataSet.ConfigList_Simple_SG, calId) + Catch ex As Exception + Call LogError(Name, "UpdateConfigList", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmAddDataSheet_ShotGun_CFG control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmAddDataSheet_ShotGun_CFG_Load(sender As Object, e As EventArgs) Handles MyBase.Load + Try + Loaders_Log_FirearmsTableAdapter.FillByFullNameShotgunOnly(MLLDataSet.Loaders_Log_Firearms) + cmbFirearm.SelectedValue = FirearmId + Call UpdateConfigList() + Call LoadAutoFill() + Catch ex As Exception + Call LogError(Name, "frmAddDataSheet_ShotGun_CFG_Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the SelectedIndexChanged event of the cmbFirearm control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub cmbFirearm_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbFirearm.SelectedIndexChanged + Call UpdateConfigList() + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnAdd control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click + Call SaveData() + End Sub + End Class +End Namespace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddEquipment.Designer.vb b/BSMyLoadersLog/Adding/frmAddEquipment.Designer.vb index 3e8b4d9..c970fb7 100644 --- a/BSMyLoadersLog/Adding/frmAddEquipment.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddEquipment.Designer.vb @@ -1,194 +1,196 @@ - _ -Partial Class frmAddEquipment - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddEquipment + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - MyBase.Dispose(disposing) - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + MyBase.Dispose(disposing) + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddEquipment)) - 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.txtManu = New System.Windows.Forms.TextBox - Me.txtName = New System.Windows.Forms.TextBox - Me.txtUse = New System.Windows.Forms.TextBox - Me.txtPrice = New System.Windows.Forms.TextBox - Me.txtNotes = New System.Windows.Forms.TextBox - Me.btnAdd = New System.Windows.Forms.Button - Me.btnCancel = New System.Windows.Forms.Button - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - Me.SuspendLayout() - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(12, 9) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(73, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Manufacturer:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(12, 34) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(38, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Name:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(12, 60) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(29, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Use:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(12, 86) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(34, 13) - Me.Label4.TabIndex = 3 - Me.Label4.Text = "Price:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(12, 106) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(38, 13) - Me.Label5.TabIndex = 4 - Me.Label5.Text = "Notes:" - ' - 'txtManu - ' - Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtManu.Location = New System.Drawing.Point(91, 6) - Me.txtManu.Name = "txtManu" - Me.txtManu.Size = New System.Drawing.Size(208, 20) - Me.txtManu.TabIndex = 1 - ' - 'txtName - ' - Me.txtName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtName.Location = New System.Drawing.Point(91, 31) - Me.txtName.Name = "txtName" - Me.txtName.Size = New System.Drawing.Size(208, 20) - Me.txtName.TabIndex = 2 - ' - 'txtUse - ' - Me.txtUse.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtUse.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtUse.Location = New System.Drawing.Point(91, 57) - Me.txtUse.Name = "txtUse" - Me.txtUse.Size = New System.Drawing.Size(208, 20) - Me.txtUse.TabIndex = 3 - ' - 'txtPrice - ' - Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPrice.Location = New System.Drawing.Point(91, 83) - Me.txtPrice.Name = "txtPrice" - Me.txtPrice.Size = New System.Drawing.Size(208, 20) - Me.txtPrice.TabIndex = 4 - ' - 'txtNotes - ' - Me.txtNotes.Location = New System.Drawing.Point(14, 122) - Me.txtNotes.Multiline = True - Me.txtNotes.Name = "txtNotes" - Me.txtNotes.Size = New System.Drawing.Size(285, 89) - Me.txtNotes.TabIndex = 5 - ' - 'btnAdd - ' - Me.btnAdd.Location = New System.Drawing.Point(38, 224) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(75, 23) - Me.btnAdd.TabIndex = 6 - Me.btnAdd.Text = "Add" - Me.btnAdd.UseVisualStyleBackColor = True - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(189, 224) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 7 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmAddEquipment - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(308, 259) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnAdd) - Me.Controls.Add(Me.txtNotes) - Me.Controls.Add(Me.txtPrice) - Me.Controls.Add(Me.txtUse) - Me.Controls.Add(Me.txtName) - Me.Controls.Add(Me.txtManu) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.HelpProvider1.SetHelpKeyword(Me, "Adding Reloading Equipment") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Adding Reloading Equipment") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmAddEquipment" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Add Equipment to Inventory" - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddEquipment)) + 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.txtManu = New System.Windows.Forms.TextBox + Me.txtName = New System.Windows.Forms.TextBox + Me.txtUse = New System.Windows.Forms.TextBox + Me.txtPrice = New System.Windows.Forms.TextBox + Me.txtNotes = New System.Windows.Forms.TextBox + Me.btnAdd = New System.Windows.Forms.Button + Me.btnCancel = New System.Windows.Forms.Button + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 9) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(73, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Manufacturer:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 34) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(38, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Name:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(12, 60) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(29, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Use:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(12, 86) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(34, 13) + Me.Label4.TabIndex = 3 + Me.Label4.Text = "Price:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(12, 106) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(38, 13) + Me.Label5.TabIndex = 4 + Me.Label5.Text = "Notes:" + ' + 'txtManu + ' + Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtManu.Location = New System.Drawing.Point(91, 6) + Me.txtManu.Name = "txtManu" + Me.txtManu.Size = New System.Drawing.Size(208, 20) + Me.txtManu.TabIndex = 1 + ' + 'txtName + ' + Me.txtName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtName.Location = New System.Drawing.Point(91, 31) + Me.txtName.Name = "txtName" + Me.txtName.Size = New System.Drawing.Size(208, 20) + Me.txtName.TabIndex = 2 + ' + 'txtUse + ' + Me.txtUse.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtUse.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtUse.Location = New System.Drawing.Point(91, 57) + Me.txtUse.Name = "txtUse" + Me.txtUse.Size = New System.Drawing.Size(208, 20) + Me.txtUse.TabIndex = 3 + ' + 'txtPrice + ' + Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPrice.Location = New System.Drawing.Point(91, 83) + Me.txtPrice.Name = "txtPrice" + Me.txtPrice.Size = New System.Drawing.Size(208, 20) + Me.txtPrice.TabIndex = 4 + ' + 'txtNotes + ' + Me.txtNotes.Location = New System.Drawing.Point(14, 122) + Me.txtNotes.Multiline = True + Me.txtNotes.Name = "txtNotes" + Me.txtNotes.Size = New System.Drawing.Size(285, 89) + Me.txtNotes.TabIndex = 5 + ' + 'btnAdd + ' + Me.btnAdd.Location = New System.Drawing.Point(38, 224) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(75, 23) + Me.btnAdd.TabIndex = 6 + Me.btnAdd.Text = "Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(189, 224) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 7 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmAddEquipment + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(308, 259) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.txtNotes) + Me.Controls.Add(Me.txtPrice) + Me.Controls.Add(Me.txtUse) + Me.Controls.Add(Me.txtName) + Me.Controls.Add(Me.txtManu) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.HelpProvider1.SetHelpKeyword(Me, "Adding Reloading Equipment") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Adding Reloading Equipment") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmAddEquipment" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Add Equipment to Inventory" + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - 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 txtManu As System.Windows.Forms.TextBox - Friend WithEvents txtName As System.Windows.Forms.TextBox - Friend WithEvents txtUse As System.Windows.Forms.TextBox - Friend WithEvents txtPrice As System.Windows.Forms.TextBox - Friend WithEvents txtNotes As System.Windows.Forms.TextBox - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider -End Class + End Sub + 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 txtManu As System.Windows.Forms.TextBox + Friend WithEvents txtName As System.Windows.Forms.TextBox + Friend WithEvents txtUse As System.Windows.Forms.TextBox + Friend WithEvents txtPrice As System.Windows.Forms.TextBox + Friend WithEvents txtNotes As System.Windows.Forms.TextBox + Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddEquipment.vb b/BSMyLoadersLog/Adding/frmAddEquipment.vb index 98a5adf..7f59b5d 100644 --- a/BSMyLoadersLog/Adding/frmAddEquipment.vb +++ b/BSMyLoadersLog/Adding/frmAddEquipment.vb @@ -1,59 +1,100 @@ -Imports BSMyLoadersLog.LoadersClass +Imports BurnSoft.Applications.MLL.AutoFill Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory +Imports BSMyLoadersLog.Viewing -Public Class frmAddEquipment - Public FromView As Boolean - Sub AutoFill() - Try - Dim ObjAF As New AutoFillCollections - txtManu.AutoCompleteCustomSource = ObjAF.General_Equipment_Manufacturer - txtName.AutoCompleteCustomSource = ObjAF.General_Equipment_Name - txtUse.AutoCompleteCustomSource = ObjAF.General_Equipment_Use - txtPrice.AutoCompleteCustomSource = ObjAF.General_Equipment_Cost - Catch ex As Exception - Call LogError(Me.Name, "AutoFill", Err.Number, ex.Message.ToString) - End Try - End Sub +Namespace Adding + ''' + ''' Class frmAddEquipment. + ''' Implements the + ''' + ''' + Public Class FrmAddEquipment + ''' + ''' The error out + ''' + Dim _errOut as String + ''' + ''' From view + ''' + Public FromView As Boolean + ''' + ''' Automatics the fill. + ''' + ''' + Sub AutoFill() + Try + txtManu.AutoCompleteCustomSource = Equipment.Manufacturer(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtName.AutoCompleteCustomSource = Equipment.Name(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtUse.AutoCompleteCustomSource = Equipment.Use(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtPrice.AutoCompleteCustomSource = Equipment.Cost(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "AutoFill", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmAddEquipment control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmAddEquipment_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call AutoFill() + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Clears the fields. + ''' + Private Sub ClearFields() + txtManu.Text = "" + txtName.Text = "" + txtUse.Text = "" + txtPrice.Text = "" + txtNotes.Text = "" + End Sub + ''' + ''' Handles the Click event of the btnAdd control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click + Try + Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) + Dim strName As String = GeneralHelpers.FluffContent(txtName.Text) + Dim strUse As String = GeneralHelpers.FluffContent(txtUse.Text) + Dim strPrice As Double = GeneralHelpers.FluffContent(txtPrice.Text, 0) + Dim strNotes As String = GeneralHelpers.FluffContent(txtNotes.Text) - Private Sub frmAddEquipment_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call AutoFill() - End Sub + If Not GeneralHelpers.IsRequired(strManu, "Manufacturer", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(strName, "Name", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(strUse, "Use", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(strPrice, 0, "Price", Text) Then Exit Sub - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub + If Not EquipmentInventory.Add(DatabasePath, strManu, strName, strUse, strPrice, + strNotes, _errOut) Then Throw New Exception(_errOut) - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click - Try - Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) - Dim strName As String = GeneralHelpers.FluffContent(txtName.Text) - Dim strUse As String = GeneralHelpers.FluffContent(txtUse.Text) - Dim strPrice As Double = GeneralHelpers.FluffContent(CDbl(txtPrice.Text), 0) - Dim strNotes As String = GeneralHelpers.FluffContent(txtNotes.Text) - - If Not GeneralHelpers.IsRequired(strManu, "Manufacturer", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strName, "Name", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strUse, "Use", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strPrice, 0, "Price", Me.Text) Then Exit Sub - - Dim Obj As New BSDatabase - Dim SQL As String = "INSERT INTO General_Equipment(Manufacturer,Name,Use,Cost,Notes) VALUES('" & _ - strManu & "','" & strName & "','" & strUse & "'," & strPrice & ",'" & strNotes & "')" - Obj.ConnExec(SQL) - Obj = Nothing - Dim sAns As String = MsgBox("Equipment was added to the database, do you with to add another?", MsgBoxStyle.YesNo, Me.Text) - If FromView Then Call frmView_List_Equipment.LoadData() - If sAns = vbYes Then - txtManu.Text = "" - txtName.Text = "" - txtUse.Text = "" - txtPrice.Text = "" - txtNotes.Text = "" - Else - Me.Close() - End If - Catch ex As Exception - Call LogError(Me.Name, "btnAdd.Click", Err.Number, ex.Message.ToString) - End Try - End Sub -End Class \ No newline at end of file + Dim sAns As String = MsgBox("Equipment was added to the database, do you with to add another?", + MsgBoxStyle.YesNo, Text) + If FromView Then Call FrmViewListEquipment.LoadData() + If sAns = vbYes Then + ClearFields() + Else + Close() + End If + Catch ex As Exception + Call LogError(Name, "btnAdd.Click", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddFirearm.Designer.vb b/BSMyLoadersLog/Adding/frmAddFirearm.Designer.vb index f5407fe..a25300e 100644 --- a/BSMyLoadersLog/Adding/frmAddFirearm.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddFirearm.Designer.vb @@ -1,240 +1,242 @@ - _ -Partial Class frmAddFirearm - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddFirearm + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - MyBase.Dispose(disposing) - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + MyBase.Dispose(disposing) + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddFirearm)) - 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.txtManu = New System.Windows.Forms.TextBox() - Me.txtModel = New System.Windows.Forms.TextBox() - Me.txtSerial = New System.Windows.Forms.TextBox() - Me.txtCal = New System.Windows.Forms.TextBox() - Me.txtType = New System.Windows.Forms.TextBox() - Me.txtBarrel = New System.Windows.Forms.TextBox() - Me.btnAdd = New System.Windows.Forms.Button() - Me.btnCancel = New System.Windows.Forms.Button() - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider() - Me.Label7 = New System.Windows.Forms.Label() - Me.chkExlude = New System.Windows.Forms.CheckBox() - Me.SuspendLayout() - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(13, 13) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(73, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Manufacturer:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(13, 39) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(39, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Model:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(13, 91) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(42, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Caliber:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(13, 142) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(73, 13) - Me.Label4.TabIndex = 3 - Me.Label4.Text = "Barrel Lenght:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(13, 65) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(56, 13) - Me.Label5.TabIndex = 4 - Me.Label5.Text = "Serial No.:" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(13, 117) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(31, 13) - Me.Label6.TabIndex = 5 - Me.Label6.Text = "Type" - ' - 'txtManu - ' - Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtManu.Location = New System.Drawing.Point(92, 10) - Me.txtManu.Name = "txtManu" - Me.txtManu.Size = New System.Drawing.Size(149, 20) - Me.txtManu.TabIndex = 1 - ' - 'txtModel - ' - Me.txtModel.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtModel.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtModel.Location = New System.Drawing.Point(92, 36) - Me.txtModel.Name = "txtModel" - Me.txtModel.Size = New System.Drawing.Size(149, 20) - Me.txtModel.TabIndex = 2 - ' - 'txtSerial - ' - Me.txtSerial.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtSerial.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtSerial.Location = New System.Drawing.Point(92, 62) - Me.txtSerial.Name = "txtSerial" - Me.txtSerial.Size = New System.Drawing.Size(149, 20) - Me.txtSerial.TabIndex = 3 - ' - 'txtCal - ' - Me.txtCal.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtCal.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtCal.Location = New System.Drawing.Point(92, 88) - Me.txtCal.Name = "txtCal" - Me.txtCal.Size = New System.Drawing.Size(149, 20) - Me.txtCal.TabIndex = 4 - ' - 'txtType - ' - Me.txtType.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtType.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtType.Location = New System.Drawing.Point(92, 114) - Me.txtType.Name = "txtType" - Me.txtType.Size = New System.Drawing.Size(149, 20) - Me.txtType.TabIndex = 5 - ' - 'txtBarrel - ' - Me.txtBarrel.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtBarrel.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtBarrel.Location = New System.Drawing.Point(92, 139) - Me.txtBarrel.Name = "txtBarrel" - Me.txtBarrel.Size = New System.Drawing.Size(149, 20) - Me.txtBarrel.TabIndex = 6 - ' - 'btnAdd - ' - Me.btnAdd.Location = New System.Drawing.Point(30, 187) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(75, 23) - Me.btnAdd.TabIndex = 8 - Me.btnAdd.Text = "Add" - Me.btnAdd.UseVisualStyleBackColor = True - ' - 'btnCancel - ' - Me.btnCancel.Location = New System.Drawing.Point(155, 186) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 9 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'Label7 - ' - Me.Label7.AutoSize = True - Me.Label7.Location = New System.Drawing.Point(13, 165) - Me.Label7.Name = "Label7" - Me.Label7.Size = New System.Drawing.Size(51, 13) - Me.Label7.TabIndex = 9 - Me.Label7.Text = "Exclude?" - ' - 'chkExlude - ' - Me.chkExlude.AutoSize = True - Me.chkExlude.Location = New System.Drawing.Point(92, 164) - Me.chkExlude.Name = "chkExlude" - Me.chkExlude.Size = New System.Drawing.Size(44, 17) - Me.chkExlude.TabIndex = 7 - Me.chkExlude.Text = "Yes" - Me.chkExlude.UseVisualStyleBackColor = True - ' - 'frmAddFirearm - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(261, 228) - Me.Controls.Add(Me.chkExlude) - Me.Controls.Add(Me.Label7) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnAdd) - Me.Controls.Add(Me.txtBarrel) - Me.Controls.Add(Me.txtType) - Me.Controls.Add(Me.txtCal) - Me.Controls.Add(Me.txtSerial) - Me.Controls.Add(Me.txtModel) - Me.Controls.Add(Me.txtManu) - Me.Controls.Add(Me.Label6) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.HelpProvider1.SetHelpKeyword(Me, "Adding a Firearm") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Adding a Firearm") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmAddFirearm" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Add Firearm" - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddFirearm)) + 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.txtManu = New System.Windows.Forms.TextBox() + Me.txtModel = New System.Windows.Forms.TextBox() + Me.txtSerial = New System.Windows.Forms.TextBox() + Me.txtCal = New System.Windows.Forms.TextBox() + Me.txtType = New System.Windows.Forms.TextBox() + Me.txtBarrel = New System.Windows.Forms.TextBox() + Me.btnAdd = New System.Windows.Forms.Button() + Me.btnCancel = New System.Windows.Forms.Button() + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider() + Me.Label7 = New System.Windows.Forms.Label() + Me.chkExlude = New System.Windows.Forms.CheckBox() + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(13, 13) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(73, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Manufacturer:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(13, 39) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(39, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Model:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(13, 91) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(42, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Caliber:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(13, 142) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(73, 13) + Me.Label4.TabIndex = 3 + Me.Label4.Text = "Barrel Lenght:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(13, 65) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(56, 13) + Me.Label5.TabIndex = 4 + Me.Label5.Text = "Serial No.:" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(13, 117) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(31, 13) + Me.Label6.TabIndex = 5 + Me.Label6.Text = "Type" + ' + 'txtManu + ' + Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtManu.Location = New System.Drawing.Point(92, 10) + Me.txtManu.Name = "txtManu" + Me.txtManu.Size = New System.Drawing.Size(149, 20) + Me.txtManu.TabIndex = 1 + ' + 'txtModel + ' + Me.txtModel.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtModel.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtModel.Location = New System.Drawing.Point(92, 36) + Me.txtModel.Name = "txtModel" + Me.txtModel.Size = New System.Drawing.Size(149, 20) + Me.txtModel.TabIndex = 2 + ' + 'txtSerial + ' + Me.txtSerial.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtSerial.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtSerial.Location = New System.Drawing.Point(92, 62) + Me.txtSerial.Name = "txtSerial" + Me.txtSerial.Size = New System.Drawing.Size(149, 20) + Me.txtSerial.TabIndex = 3 + ' + 'txtCal + ' + Me.txtCal.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtCal.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtCal.Location = New System.Drawing.Point(92, 88) + Me.txtCal.Name = "txtCal" + Me.txtCal.Size = New System.Drawing.Size(149, 20) + Me.txtCal.TabIndex = 4 + ' + 'txtType + ' + Me.txtType.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtType.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtType.Location = New System.Drawing.Point(92, 114) + Me.txtType.Name = "txtType" + Me.txtType.Size = New System.Drawing.Size(149, 20) + Me.txtType.TabIndex = 5 + ' + 'txtBarrel + ' + Me.txtBarrel.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtBarrel.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtBarrel.Location = New System.Drawing.Point(92, 139) + Me.txtBarrel.Name = "txtBarrel" + Me.txtBarrel.Size = New System.Drawing.Size(149, 20) + Me.txtBarrel.TabIndex = 6 + ' + 'btnAdd + ' + Me.btnAdd.Location = New System.Drawing.Point(30, 187) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(75, 23) + Me.btnAdd.TabIndex = 8 + Me.btnAdd.Text = "Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'btnCancel + ' + Me.btnCancel.Location = New System.Drawing.Point(155, 186) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 9 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'Label7 + ' + Me.Label7.AutoSize = True + Me.Label7.Location = New System.Drawing.Point(13, 165) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(51, 13) + Me.Label7.TabIndex = 9 + Me.Label7.Text = "Exclude?" + ' + 'chkExlude + ' + Me.chkExlude.AutoSize = True + Me.chkExlude.Location = New System.Drawing.Point(92, 164) + Me.chkExlude.Name = "chkExlude" + Me.chkExlude.Size = New System.Drawing.Size(44, 17) + Me.chkExlude.TabIndex = 7 + Me.chkExlude.Text = "Yes" + Me.chkExlude.UseVisualStyleBackColor = True + ' + 'frmAddFirearm + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(261, 228) + Me.Controls.Add(Me.chkExlude) + Me.Controls.Add(Me.Label7) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.txtBarrel) + Me.Controls.Add(Me.txtType) + Me.Controls.Add(Me.txtCal) + Me.Controls.Add(Me.txtSerial) + Me.Controls.Add(Me.txtModel) + Me.Controls.Add(Me.txtManu) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.HelpProvider1.SetHelpKeyword(Me, "Adding a Firearm") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Adding a Firearm") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.Name = "frmAddFirearm" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Add Firearm" + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - 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 txtManu As System.Windows.Forms.TextBox - Friend WithEvents txtModel As System.Windows.Forms.TextBox - Friend WithEvents txtSerial As System.Windows.Forms.TextBox - Friend WithEvents txtCal As System.Windows.Forms.TextBox - Friend WithEvents txtType As System.Windows.Forms.TextBox - Friend WithEvents txtBarrel As System.Windows.Forms.TextBox - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider - Friend WithEvents Label7 As System.Windows.Forms.Label - Friend WithEvents chkExlude As System.Windows.Forms.CheckBox -End Class + End Sub + 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 txtManu As System.Windows.Forms.TextBox + Friend WithEvents txtModel As System.Windows.Forms.TextBox + Friend WithEvents txtSerial As System.Windows.Forms.TextBox + Friend WithEvents txtCal As System.Windows.Forms.TextBox + Friend WithEvents txtType As System.Windows.Forms.TextBox + Friend WithEvents txtBarrel As System.Windows.Forms.TextBox + Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + Friend WithEvents Label7 As System.Windows.Forms.Label + Friend WithEvents chkExlude As System.Windows.Forms.CheckBox + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddFirearm.vb b/BSMyLoadersLog/Adding/frmAddFirearm.vb index 1933d55..283ee43 100644 --- a/BSMyLoadersLog/Adding/frmAddFirearm.vb +++ b/BSMyLoadersLog/Adding/frmAddFirearm.vb @@ -1,48 +1,58 @@ -Imports BSMyLoadersLog.LoadersClass Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.LoadersLog -Public Class frmAddFirearm - Public FromView As Boolean - Sub AutoFill() - Try - Dim ObjAF As New AutoFillCollections - Catch ex As Exception - Call LogError(Me.Name, "AutoFill", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub +Namespace Adding + ''' + ''' Class FrmAddFirearm. + ''' Implements the + ''' + ''' + Public Class FrmAddFirearm + ''' + ''' The error out + ''' + Dim _errOut as String + ''' + ''' From view + ''' + Public FromView As Boolean + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnAdd control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click + Try + Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) + Dim strModel As String = GeneralHelpers.FluffContent(txtModel.Text) + Dim strSerial As String = GeneralHelpers.FluffContent(txtSerial.Text) + Dim strCal As String = GeneralHelpers.FluffContent(txtCal.Text) + Dim strBarrel As String = GeneralHelpers.FluffContent(txtBarrel.Text) + Dim strType As String = GeneralHelpers.FluffContent(txtType.Text) - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click - Try - Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) - Dim strModel As String = GeneralHelpers.FluffContent(txtModel.Text) - Dim strSerial As String = GeneralHelpers.FluffContent(txtSerial.Text) - Dim strCal As String = GeneralHelpers.FluffContent(txtCal.Text) - Dim strBarrel As String = GeneralHelpers.FluffContent(txtBarrel.Text) - Dim strType As String = GeneralHelpers.FluffContent(txtType.Text) - Dim MGCID As Integer = 0 - Dim iExclude As Integer = 0 - If chkExlude.Checked Then iExclude = 1 + If Not GeneralHelpers.IsRequired(strManu, "Manufacturer", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(strModel, "model", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(strSerial, "Serial Number", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(strCal, "Caliber", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(strType, "Type", Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strManu, "Manufacturer", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strModel, "model", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strSerial, "Serial Number", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strCal, "Caliber", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strType, "Type", Me.Text) Then Exit Sub + If Not Firearms.Add(DatabasePath, strManu, strModel, strSerial, strCal, + strType, strBarrel, _errOut) Then Throw New Exception(_errOut) - Dim strFullName As String = strManu & " " & strModel - Dim Obj As New BSDatabase - Dim SQL As String = "INSERT INTO Loaders_Log_Firearms (MGCID,FullName,Manu,Model,Cal,Barrel,SerialNo,GType,exclude)" & _ - " VALUES (" & MGCID & ",'" & strFullName & "','" & strManu & "','" & _ - strModel & "','" & strCal & "','" & strBarrel & "','" & strSerial & _ - "','" & strType & "'" & iExclude & ")" - Obj.ConnExec(SQL) - MsgBox(strFullName & " was added to the database!") - Me.Close() - Catch ex As Exception - Call LogError(Me.Name, "btnAdd.Click", Err.Number, ex.Message.ToString) - End Try - End Sub -End Class \ No newline at end of file + MsgBox(strManu & " " & strModel & " was added to the database!") + Close() + Catch ex As Exception + Call LogError(Name, "btnAdd.Click", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddPowder.Designer.vb b/BSMyLoadersLog/Adding/frmAddPowder.Designer.vb index b57e5a7..2b63734 100644 --- a/BSMyLoadersLog/Adding/frmAddPowder.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddPowder.Designer.vb @@ -1,197 +1,199 @@ - _ -Partial Class frmAddPowder - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddPowder + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddPowder)) - 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.txtManu = New System.Windows.Forms.TextBox - Me.txtName = New System.Windows.Forms.TextBox - Me.txtwei = New System.Windows.Forms.TextBox - Me.txtPrice = New System.Windows.Forms.TextBox - Me.txtNotes = New System.Windows.Forms.TextBox - Me.btnAdd = New System.Windows.Forms.Button - Me.btnCancel = New System.Windows.Forms.Button - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - Me.SuspendLayout() - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(12, 15) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(73, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Manufacturer:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(12, 40) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(38, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Name:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(12, 66) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(117, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Weight In Pounds (lbs):" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(12, 92) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(34, 13) - Me.Label4.TabIndex = 3 - Me.Label4.Text = "Price:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(12, 115) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(38, 13) - Me.Label5.TabIndex = 4 - Me.Label5.Text = "Notes:" - ' - 'txtManu - ' - Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtManu.Location = New System.Drawing.Point(138, 12) - Me.txtManu.Name = "txtManu" - Me.txtManu.Size = New System.Drawing.Size(171, 20) - Me.txtManu.TabIndex = 1 - ' - 'txtName - ' - Me.txtName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtName.Location = New System.Drawing.Point(138, 37) - Me.txtName.Name = "txtName" - Me.txtName.Size = New System.Drawing.Size(171, 20) - Me.txtName.TabIndex = 2 - ' - 'txtwei - ' - Me.txtwei.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtwei.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtwei.Location = New System.Drawing.Point(138, 63) - Me.txtwei.Name = "txtwei" - Me.txtwei.Size = New System.Drawing.Size(171, 20) - Me.txtwei.TabIndex = 3 - ' - 'txtPrice - ' - Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPrice.Location = New System.Drawing.Point(138, 89) - Me.txtPrice.Name = "txtPrice" - Me.txtPrice.Size = New System.Drawing.Size(171, 20) - Me.txtPrice.TabIndex = 4 - ' - 'txtNotes - ' - Me.txtNotes.Location = New System.Drawing.Point(15, 132) - Me.txtNotes.Multiline = True - Me.txtNotes.Name = "txtNotes" - Me.txtNotes.Size = New System.Drawing.Size(294, 71) - Me.txtNotes.TabIndex = 5 - ' - 'btnAdd - ' - Me.btnAdd.Location = New System.Drawing.Point(54, 209) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(75, 23) - Me.btnAdd.TabIndex = 6 - Me.btnAdd.Text = "Add" - Me.btnAdd.UseVisualStyleBackColor = True - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(188, 209) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 7 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmAddPowder - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(318, 240) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnAdd) - Me.Controls.Add(Me.txtNotes) - Me.Controls.Add(Me.txtPrice) - Me.Controls.Add(Me.txtwei) - Me.Controls.Add(Me.txtName) - Me.Controls.Add(Me.txtManu) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.HelpProvider1.SetHelpKeyword(Me, "Add Powder To Inventory") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Add Powder To Inventory") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmAddPowder" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Add Powder to Inventory" - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddPowder)) + 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.txtManu = New System.Windows.Forms.TextBox + Me.txtName = New System.Windows.Forms.TextBox + Me.txtwei = New System.Windows.Forms.TextBox + Me.txtPrice = New System.Windows.Forms.TextBox + Me.txtNotes = New System.Windows.Forms.TextBox + Me.btnAdd = New System.Windows.Forms.Button + Me.btnCancel = New System.Windows.Forms.Button + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 15) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(73, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Manufacturer:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 40) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(38, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Name:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(12, 66) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(117, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Weight In Pounds (lbs):" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(12, 92) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(34, 13) + Me.Label4.TabIndex = 3 + Me.Label4.Text = "Price:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(12, 115) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(38, 13) + Me.Label5.TabIndex = 4 + Me.Label5.Text = "Notes:" + ' + 'txtManu + ' + Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtManu.Location = New System.Drawing.Point(138, 12) + Me.txtManu.Name = "txtManu" + Me.txtManu.Size = New System.Drawing.Size(171, 20) + Me.txtManu.TabIndex = 1 + ' + 'txtName + ' + Me.txtName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtName.Location = New System.Drawing.Point(138, 37) + Me.txtName.Name = "txtName" + Me.txtName.Size = New System.Drawing.Size(171, 20) + Me.txtName.TabIndex = 2 + ' + 'txtwei + ' + Me.txtwei.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtwei.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtwei.Location = New System.Drawing.Point(138, 63) + Me.txtwei.Name = "txtwei" + Me.txtwei.Size = New System.Drawing.Size(171, 20) + Me.txtwei.TabIndex = 3 + ' + 'txtPrice + ' + Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPrice.Location = New System.Drawing.Point(138, 89) + Me.txtPrice.Name = "txtPrice" + Me.txtPrice.Size = New System.Drawing.Size(171, 20) + Me.txtPrice.TabIndex = 4 + ' + 'txtNotes + ' + Me.txtNotes.Location = New System.Drawing.Point(15, 132) + Me.txtNotes.Multiline = True + Me.txtNotes.Name = "txtNotes" + Me.txtNotes.Size = New System.Drawing.Size(294, 71) + Me.txtNotes.TabIndex = 5 + ' + 'btnAdd + ' + Me.btnAdd.Location = New System.Drawing.Point(54, 209) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(75, 23) + Me.btnAdd.TabIndex = 6 + Me.btnAdd.Text = "Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(188, 209) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 7 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmAddPowder + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(318, 240) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.txtNotes) + Me.Controls.Add(Me.txtPrice) + Me.Controls.Add(Me.txtwei) + Me.Controls.Add(Me.txtName) + Me.Controls.Add(Me.txtManu) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.HelpProvider1.SetHelpKeyword(Me, "Add Powder To Inventory") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Add Powder To Inventory") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmAddPowder" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Add Powder to Inventory" + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - 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 txtManu As System.Windows.Forms.TextBox - Friend WithEvents txtName As System.Windows.Forms.TextBox - Friend WithEvents txtwei As System.Windows.Forms.TextBox - Friend WithEvents txtPrice As System.Windows.Forms.TextBox - Friend WithEvents txtNotes As System.Windows.Forms.TextBox - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider -End Class + End Sub + 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 txtManu As System.Windows.Forms.TextBox + Friend WithEvents txtName As System.Windows.Forms.TextBox + Friend WithEvents txtwei As System.Windows.Forms.TextBox + Friend WithEvents txtPrice As System.Windows.Forms.TextBox + Friend WithEvents txtNotes As System.Windows.Forms.TextBox + Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddPowder.vb b/BSMyLoadersLog/Adding/frmAddPowder.vb index c08d4f2..9efd55e 100644 --- a/BSMyLoadersLog/Adding/frmAddPowder.vb +++ b/BSMyLoadersLog/Adding/frmAddPowder.vb @@ -1,54 +1,81 @@ -Imports BSMyLoadersLog.LoadersClass Imports BSMyLoadersLog.Viewing -Imports BurnSoft.Applications.MLL.Global +Imports BurnSoft.Applications.MLL.AutoFill Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory -Public Class frmAddPowder - Dim errOut As String - Public FromView As Boolean - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub - Sub AutoFill() - Try - Dim ObjAF As New AutoFillCollections - txtManu.AutoCompleteCustomSource = ObjAF.General_Powder_Manufacturer - txtName.AutoCompleteCustomSource = ObjAF.General_Powder_Name - txtPrice.AutoCompleteCustomSource = ObjAF.General_Powder_Price - txtwei.AutoCompleteCustomSource = ObjAF.General_Powder_WeightInPounds - Catch ex As Exception - Call LogError(Me.Name, "AutoFill", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click - Try - Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) - Dim strName As String = GeneralHelpers.FluffContent(txtName.Text) - Dim dbWei As Double = GeneralHelpers.FluffContent(CDbl(txtwei.Text), 0) - Dim dbWeiGrn As Double =Converters.ConvertWeight(dbWei, WeightValues.WeightType.Grains, - WeightValues.WeightType.Pounds, errOut) - Dim dbPrice As Double = GeneralHelpers.FluffContent(CDbl(txtPrice.Text), 0) - Dim strNotes As String = GeneralHelpers.FluffContent(txtNotes.Text) - If Not GeneralHelpers.IsRequired(strManu, "Manufacturer", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strName, "Name", Me.Text) Then Exit Sub - Dim EstCostPerItem As Double = 0 - If dbPrice <> 0 Then - EstCostPerItem = (dbPrice / dbWeiGrn) - End If - Dim Obj As New BSDatabase - Dim SQL As String = "INSERT INTO General_Powder(Manufacturer,Name," & _ - "weightlbs,weightgn,Price,Notes,ePPP) VALUES ('" & strManu & "','" & _ - strName & "'," & dbWei & "," & dbWeiGrn & "," & dbPrice & ",'" & _ - strNotes & "'," & EstCostPerItem & ")" - Obj.ConnExec(SQL) - If FromView Then Call frmView_List_Powder.LoadData() - Me.Close() - Catch ex As Exception - Call LogError(Me.Name, "btnAdd.Click", Err.Number, ex.Message.ToString) - End Try - End Sub +Namespace Adding + ''' + ''' Class FrmAddPowder. + ''' Implements the + ''' + ''' + Public Class FrmAddPowder + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' From view + ''' + Public FromView As Boolean + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Automatics the fill. + ''' + ''' + Sub AutoFill() + Try + txtManu.AutoCompleteCustomSource = Powder.Manufacturer(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtName.AutoCompleteCustomSource = Powder.Name(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtPrice.AutoCompleteCustomSource = Powder.Price(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtwei.AutoCompleteCustomSource = Powder.Weightlbs(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "AutoFill", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the btnAdd control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click + Try + Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) + Dim strName As String = GeneralHelpers.FluffContent(txtName.Text) + Dim dbWei As Double = GeneralHelpers.FluffContent(txtwei.Text, 0) + Dim dbPrice As Double = GeneralHelpers.FluffContent(txtPrice.Text, 0) + Dim strNotes As String = GeneralHelpers.FluffContent(txtNotes.Text) + If Not GeneralHelpers.IsRequired(strManu, "Manufacturer", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(strName, "Name", Text) Then Exit Sub + + If Not PowderInventory.Add(DatabasePath, strManu, strName, dbWei, + dbPrice, strNotes, _errOut) Then Throw New Exception(_errOut) - Private Sub frmAddPowder_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call AutoFill() - End Sub -End Class \ No newline at end of file + If FromView Then Call FrmViewListPowder.LoadData() + Close() + Catch ex As Exception + Call LogError(Name, "btnAdd.Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmAddPowder control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmAddPowder_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call AutoFill() + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddPrimer.Designer.vb b/BSMyLoadersLog/Adding/frmAddPrimer.Designer.vb index 407d8bd..511bdd1 100644 --- a/BSMyLoadersLog/Adding/frmAddPrimer.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddPrimer.Designer.vb @@ -1,226 +1,228 @@ - _ -Partial Class frmAddPrimer - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddPrimer + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddPrimer)) - 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.txtManu = New System.Windows.Forms.TextBox - Me.txtName = New System.Windows.Forms.TextBox - Me.cmbPriType = New System.Windows.Forms.ComboBox - Me.GeneralPrimerTypeBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.nudQty = New System.Windows.Forms.NumericUpDown - Me.txtPrice = New System.Windows.Forms.TextBox - Me.btnAdd = New System.Windows.Forms.Button - Me.btnCancel = New System.Windows.Forms.Button - Me.General_Primer_TypeTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.General_Primer_TypeTableAdapter - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - CType(Me.GeneralPrimerTypeBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.nudQty, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(9, 12) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(73, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Manufacturer:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(9, 38) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(38, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Name:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(9, 65) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(66, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Primer Type:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(9, 91) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(26, 13) - Me.Label4.TabIndex = 3 - Me.Label4.Text = "Qty:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(9, 118) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(34, 13) - Me.Label5.TabIndex = 4 - Me.Label5.Text = "Price:" - ' - 'txtManu - ' - Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtManu.Location = New System.Drawing.Point(89, 9) - Me.txtManu.Name = "txtManu" - Me.txtManu.Size = New System.Drawing.Size(166, 20) - Me.txtManu.TabIndex = 1 - ' - 'txtName - ' - Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtName.Location = New System.Drawing.Point(89, 35) - Me.txtName.Name = "txtName" - Me.txtName.Size = New System.Drawing.Size(166, 20) - Me.txtName.TabIndex = 2 - ' - 'cmbPriType - ' - Me.cmbPriType.DataSource = Me.GeneralPrimerTypeBindingSource - Me.cmbPriType.DisplayMember = "Name" - Me.cmbPriType.FormattingEnabled = True - Me.cmbPriType.Location = New System.Drawing.Point(89, 62) - Me.cmbPriType.Name = "cmbPriType" - Me.cmbPriType.Size = New System.Drawing.Size(166, 21) - Me.cmbPriType.TabIndex = 3 - Me.cmbPriType.ValueMember = "ID" - ' - 'GeneralPrimerTypeBindingSource - ' - Me.GeneralPrimerTypeBindingSource.DataMember = "General_Primer_Type" - Me.GeneralPrimerTypeBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'nudQty - ' - Me.nudQty.Location = New System.Drawing.Point(89, 89) - Me.nudQty.Maximum = New Decimal(New Integer() {10000000, 0, 0, 0}) - Me.nudQty.Name = "nudQty" - Me.nudQty.Size = New System.Drawing.Size(166, 20) - Me.nudQty.TabIndex = 4 - ' - 'txtPrice - ' - Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPrice.Location = New System.Drawing.Point(89, 115) - Me.txtPrice.Name = "txtPrice" - Me.txtPrice.Size = New System.Drawing.Size(166, 20) - Me.txtPrice.TabIndex = 5 - ' - 'btnAdd - ' - Me.btnAdd.Location = New System.Drawing.Point(36, 156) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(75, 23) - Me.btnAdd.TabIndex = 6 - Me.btnAdd.Text = "Add" - Me.btnAdd.UseVisualStyleBackColor = True - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(154, 156) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 7 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'General_Primer_TypeTableAdapter - ' - Me.General_Primer_TypeTableAdapter.ClearBeforeFill = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmAddPrimer - ' - Me.AcceptButton = Me.btnAdd - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(266, 191) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnAdd) - Me.Controls.Add(Me.txtPrice) - Me.Controls.Add(Me.nudQty) - Me.Controls.Add(Me.cmbPriType) - Me.Controls.Add(Me.txtName) - Me.Controls.Add(Me.txtManu) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.HelpProvider1.SetHelpKeyword(Me, "Add Primers to Inventory") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Add Primers to Inventory") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmAddPrimer" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Add Primer to Inventory" - CType(Me.GeneralPrimerTypeBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.nudQty, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddPrimer)) + 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.txtManu = New System.Windows.Forms.TextBox + Me.txtName = New System.Windows.Forms.TextBox + Me.cmbPriType = New System.Windows.Forms.ComboBox + Me.GeneralPrimerTypeBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.nudQty = New System.Windows.Forms.NumericUpDown + Me.txtPrice = New System.Windows.Forms.TextBox + Me.btnAdd = New System.Windows.Forms.Button + Me.btnCancel = New System.Windows.Forms.Button + Me.General_Primer_TypeTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.General_Primer_TypeTableAdapter + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + CType(Me.GeneralPrimerTypeBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.nudQty, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(9, 12) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(73, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Manufacturer:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(9, 38) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(38, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Name:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(9, 65) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(66, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Primer Type:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(9, 91) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(26, 13) + Me.Label4.TabIndex = 3 + Me.Label4.Text = "Qty:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(9, 118) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(34, 13) + Me.Label5.TabIndex = 4 + Me.Label5.Text = "Price:" + ' + 'txtManu + ' + Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtManu.Location = New System.Drawing.Point(89, 9) + Me.txtManu.Name = "txtManu" + Me.txtManu.Size = New System.Drawing.Size(166, 20) + Me.txtManu.TabIndex = 1 + ' + 'txtName + ' + Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtName.Location = New System.Drawing.Point(89, 35) + Me.txtName.Name = "txtName" + Me.txtName.Size = New System.Drawing.Size(166, 20) + Me.txtName.TabIndex = 2 + ' + 'cmbPriType + ' + Me.cmbPriType.DataSource = Me.GeneralPrimerTypeBindingSource + Me.cmbPriType.DisplayMember = "Name" + Me.cmbPriType.FormattingEnabled = True + Me.cmbPriType.Location = New System.Drawing.Point(89, 62) + Me.cmbPriType.Name = "cmbPriType" + Me.cmbPriType.Size = New System.Drawing.Size(166, 21) + Me.cmbPriType.TabIndex = 3 + Me.cmbPriType.ValueMember = "ID" + ' + 'GeneralPrimerTypeBindingSource + ' + Me.GeneralPrimerTypeBindingSource.DataMember = "General_Primer_Type" + Me.GeneralPrimerTypeBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'nudQty + ' + Me.nudQty.Location = New System.Drawing.Point(89, 89) + Me.nudQty.Maximum = New Decimal(New Integer() {10000000, 0, 0, 0}) + Me.nudQty.Name = "nudQty" + Me.nudQty.Size = New System.Drawing.Size(166, 20) + Me.nudQty.TabIndex = 4 + ' + 'txtPrice + ' + Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPrice.Location = New System.Drawing.Point(89, 115) + Me.txtPrice.Name = "txtPrice" + Me.txtPrice.Size = New System.Drawing.Size(166, 20) + Me.txtPrice.TabIndex = 5 + ' + 'btnAdd + ' + Me.btnAdd.Location = New System.Drawing.Point(36, 156) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(75, 23) + Me.btnAdd.TabIndex = 6 + Me.btnAdd.Text = "Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(154, 156) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 7 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'General_Primer_TypeTableAdapter + ' + Me.General_Primer_TypeTableAdapter.ClearBeforeFill = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmAddPrimer + ' + Me.AcceptButton = Me.btnAdd + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(266, 191) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.txtPrice) + Me.Controls.Add(Me.nudQty) + Me.Controls.Add(Me.cmbPriType) + Me.Controls.Add(Me.txtName) + Me.Controls.Add(Me.txtManu) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.HelpProvider1.SetHelpKeyword(Me, "Add Primers to Inventory") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Add Primers to Inventory") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmAddPrimer" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Add Primer to Inventory" + CType(Me.GeneralPrimerTypeBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.nudQty, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - 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 txtManu As System.Windows.Forms.TextBox - Friend WithEvents txtName As System.Windows.Forms.TextBox - Friend WithEvents cmbPriType As System.Windows.Forms.ComboBox - Friend WithEvents nudQty As System.Windows.Forms.NumericUpDown - Friend WithEvents txtPrice As System.Windows.Forms.TextBox - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents GeneralPrimerTypeBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents General_Primer_TypeTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.General_Primer_TypeTableAdapter - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider -End Class + End Sub + 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 txtManu As System.Windows.Forms.TextBox + Friend WithEvents txtName As System.Windows.Forms.TextBox + Friend WithEvents cmbPriType As System.Windows.Forms.ComboBox + Friend WithEvents nudQty As System.Windows.Forms.NumericUpDown + Friend WithEvents txtPrice As System.Windows.Forms.TextBox + Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents GeneralPrimerTypeBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents General_Primer_TypeTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.General_Primer_TypeTableAdapter + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddPrimer.vb b/BSMyLoadersLog/Adding/frmAddPrimer.vb index c395021..d6a6864 100644 --- a/BSMyLoadersLog/Adding/frmAddPrimer.vb +++ b/BSMyLoadersLog/Adding/frmAddPrimer.vb @@ -1,56 +1,90 @@ -Imports BSMyLoadersLog.LoadersClass Imports BSMyLoadersLog.Viewing +Imports BurnSoft.Applications.MLL.AutoFill Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory -Public Class frmAddPrimer - Public FromView As Boolean - Sub LoadData() - Try - Call AutoFill() - Me.General_Primer_TypeTableAdapter.Fill(Me.MLLDataSet.General_Primer_Type) - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmAddPrimer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call LoadData() - End Sub - Sub AutoFill() - Try - Dim ObjAF As New AutoFillCollections - txtManu.AutoCompleteCustomSource = ObjAF.General_Primer_Type_ManuFacturers - txtName.AutoCompleteCustomSource = ObjAF.General_Primer_Type_Name - txtPrice.AutoCompleteCustomSource = ObjAF.General_Primer_Type_Price - Catch ex As Exception - Call LogError(Me.Name, "AutoFill", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click - Try - Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) - Dim strName As String = GeneralHelpers.FluffContent(txtName.Text) - Dim intPriType As Integer = cmbPriType.SelectedValue - Dim intQty As Integer = nudQty.Value - Dim dbPrice As Double = GeneralHelpers.FluffContent(CDbl(txtPrice.Text), 0) +Namespace Adding + ''' + ''' Class FrmAddPrimer. + ''' Implements the + ''' + ''' + Public Class FrmAddPrimer + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' From view + ''' + Public FromView As Boolean + ''' + ''' Loads the data. + ''' + Sub LoadData() + Try + Call AutoFill() + General_Primer_TypeTableAdapter.Fill(MLLDataSet.General_Primer_Type) + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmAddPrimer control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmAddPrimer_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call LoadData() + End Sub + ''' + ''' Automatics the fill. + ''' + Sub AutoFill() + Try + txtManu.AutoCompleteCustomSource = Primers.Manufacturer(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtName.AutoCompleteCustomSource = Primers.Name(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtPrice.AutoCompleteCustomSource = Primers.Price(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "AutoFill", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnAdd control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click + Try + Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) + Dim strName As String = GeneralHelpers.FluffContent(txtName.Text) + Dim intPriType As Integer = cmbPriType.SelectedValue + Dim intQty As Integer = nudQty.Value + Dim dbPrice As Double = GeneralHelpers.FluffContent(txtPrice.Text, 0) - If Not GeneralHelpers.IsRequired(strManu, "Manufacturer", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strName, "Name", Me.Text) Then Exit Sub - Dim EstCostPerItem As Double = 0 - If dbPrice <> 0 Then - EstCostPerItem = (dbPrice / intQty) - End If - Dim Obj As New BSDatabase - Dim SQL As String = "INSERT INTO General_Primer(Manufacturer,Name,Primer_Type," & _ - "Qty,Price, ePPP) VALUES('" & strManu & "','" & strName & "'," & intPriType & "," & _ - intQty & "," & dbPrice & "," & EstCostPerItem & ")" - Obj.ConnExec(SQL) - If FromView Then Call frmView_List_Primer.LoadData() - Me.Close() - Catch ex As Exception - Call LogError(Me.Name, "btnAdd.Click", Err.Number, ex.Message.ToString) - End Try - End Sub -End Class \ No newline at end of file + If Not GeneralHelpers.IsRequired(strManu, "Manufacturer", + Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(strName, "Name", + Text) Then Exit Sub + If Not PrimerInventory.Add(DatabasePath, strManu, strName, intPriType, + dbPrice, intQty, _errOut) Then Throw New Exception(_errOut) + + If FromView Then Call FrmViewListPrimer.LoadData() + Close() + Catch ex As Exception + Call LogError(Name, "btnAdd.Click", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddQtyBullets.Designer.vb b/BSMyLoadersLog/Adding/frmAddQtyBullets.Designer.vb index cae988d..7c3b0e6 100644 --- a/BSMyLoadersLog/Adding/frmAddQtyBullets.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddQtyBullets.Designer.vb @@ -1,256 +1,258 @@ - _ -Partial Class frmAddQtyBullets - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddQtyBullets + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddQtyBullets)) - Me.GroupBox1 = New System.Windows.Forms.GroupBox - Me.txtCPrice = New System.Windows.Forms.TextBox - Me.txtCQty = New System.Windows.Forms.TextBox - Me.txtCPPI = New System.Windows.Forms.TextBox - Me.Label3 = New System.Windows.Forms.Label - Me.Label2 = New System.Windows.Forms.Label - Me.Label1 = New System.Windows.Forms.Label - Me.GroupBox2 = New System.Windows.Forms.GroupBox - Me.btnViewCalc = New System.Windows.Forms.Button - Me.txtUPrice = New System.Windows.Forms.TextBox - Me.txtUQty = New System.Windows.Forms.TextBox - Me.txtUPPI = New System.Windows.Forms.TextBox - Me.Label4 = New System.Windows.Forms.Label - Me.Label5 = New System.Windows.Forms.Label - Me.Label6 = New System.Windows.Forms.Label - Me.btnUpdate = New System.Windows.Forms.Button - Me.btnCancel = New System.Windows.Forms.Button - Me.GroupBox1.SuspendLayout() - Me.GroupBox2.SuspendLayout() - Me.SuspendLayout() - ' - 'GroupBox1 - ' - Me.GroupBox1.Controls.Add(Me.txtCPrice) - Me.GroupBox1.Controls.Add(Me.txtCQty) - Me.GroupBox1.Controls.Add(Me.txtCPPI) - Me.GroupBox1.Controls.Add(Me.Label3) - Me.GroupBox1.Controls.Add(Me.Label2) - Me.GroupBox1.Controls.Add(Me.Label1) - Me.GroupBox1.Location = New System.Drawing.Point(3, 2) - Me.GroupBox1.Name = "GroupBox1" - Me.GroupBox1.Size = New System.Drawing.Size(217, 91) - Me.GroupBox1.TabIndex = 0 - Me.GroupBox1.TabStop = False - Me.GroupBox1.Text = "Current Status" - ' - 'txtCPrice - ' - Me.txtCPrice.Enabled = False - Me.txtCPrice.Location = New System.Drawing.Point(91, 39) - Me.txtCPrice.Name = "txtCPrice" - Me.txtCPrice.ReadOnly = True - Me.txtCPrice.Size = New System.Drawing.Size(107, 20) - Me.txtCPrice.TabIndex = 5 - Me.txtCPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtCQty - ' - Me.txtCQty.Enabled = False - Me.txtCQty.Location = New System.Drawing.Point(91, 17) - Me.txtCQty.Name = "txtCQty" - Me.txtCQty.ReadOnly = True - Me.txtCQty.Size = New System.Drawing.Size(107, 20) - Me.txtCQty.TabIndex = 4 - Me.txtCQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtCPPI - ' - Me.txtCPPI.Enabled = False - Me.txtCPPI.Location = New System.Drawing.Point(91, 61) - Me.txtCPPI.Name = "txtCPPI" - Me.txtCPPI.ReadOnly = True - Me.txtCPPI.Size = New System.Drawing.Size(107, 20) - Me.txtCPPI.TabIndex = 3 - Me.txtCPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(9, 64) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(76, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Price Per Item:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(10, 42) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(34, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Price:" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(10, 20) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(26, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Qty:" - ' - 'GroupBox2 - ' - Me.GroupBox2.Controls.Add(Me.btnViewCalc) - Me.GroupBox2.Controls.Add(Me.txtUPrice) - Me.GroupBox2.Controls.Add(Me.txtUQty) - Me.GroupBox2.Controls.Add(Me.txtUPPI) - Me.GroupBox2.Controls.Add(Me.Label4) - Me.GroupBox2.Controls.Add(Me.Label5) - Me.GroupBox2.Controls.Add(Me.Label6) - Me.GroupBox2.Location = New System.Drawing.Point(3, 99) - Me.GroupBox2.Name = "GroupBox2" - Me.GroupBox2.Size = New System.Drawing.Size(217, 120) - Me.GroupBox2.TabIndex = 1 - Me.GroupBox2.TabStop = False - Me.GroupBox2.Text = "Update Status" - ' - 'btnViewCalc - ' - Me.btnViewCalc.Location = New System.Drawing.Point(53, 88) - Me.btnViewCalc.Name = "btnViewCalc" - Me.btnViewCalc.Size = New System.Drawing.Size(110, 26) - Me.btnViewCalc.TabIndex = 3 - Me.btnViewCalc.Text = "View Calculation" - Me.btnViewCalc.UseVisualStyleBackColor = True - ' - 'txtUPrice - ' - Me.txtUPrice.Location = New System.Drawing.Point(96, 40) - Me.txtUPrice.Name = "txtUPrice" - Me.txtUPrice.Size = New System.Drawing.Size(107, 20) - Me.txtUPrice.TabIndex = 2 - Me.txtUPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtUQty - ' - Me.txtUQty.Location = New System.Drawing.Point(96, 18) - Me.txtUQty.Name = "txtUQty" - Me.txtUQty.Size = New System.Drawing.Size(107, 20) - Me.txtUQty.TabIndex = 1 - Me.txtUQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtUPPI - ' - Me.txtUPPI.Enabled = False - Me.txtUPPI.Location = New System.Drawing.Point(96, 62) - Me.txtUPPI.Name = "txtUPPI" - Me.txtUPPI.ReadOnly = True - Me.txtUPPI.Size = New System.Drawing.Size(107, 20) - Me.txtUPPI.TabIndex = 9 - Me.txtUPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(14, 65) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(76, 13) - Me.Label4.TabIndex = 8 - Me.Label4.Text = "Price Per Item:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(15, 43) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(34, 13) - Me.Label5.TabIndex = 7 - Me.Label5.Text = "Price:" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(15, 21) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(26, 13) - Me.Label6.TabIndex = 6 - Me.Label6.Text = "Qty:" - ' - 'btnUpdate - ' - Me.btnUpdate.Location = New System.Drawing.Point(12, 225) - Me.btnUpdate.Name = "btnUpdate" - Me.btnUpdate.Size = New System.Drawing.Size(75, 23) - Me.btnUpdate.TabIndex = 4 - Me.btnUpdate.Text = "Update" - Me.btnUpdate.UseVisualStyleBackColor = True - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(131, 225) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 5 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'frmAddQtyBullets - ' - Me.AcceptButton = Me.btnUpdate - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(224, 260) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnUpdate) - Me.Controls.Add(Me.GroupBox2) - Me.Controls.Add(Me.GroupBox1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmAddQtyBullets" - Me.Text = "Update Bullet Qty" - Me.GroupBox1.ResumeLayout(False) - Me.GroupBox1.PerformLayout() - Me.GroupBox2.ResumeLayout(False) - Me.GroupBox2.PerformLayout() - Me.ResumeLayout(False) + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddQtyBullets)) + Me.GroupBox1 = New System.Windows.Forms.GroupBox + Me.txtCPrice = New System.Windows.Forms.TextBox + Me.txtCQty = New System.Windows.Forms.TextBox + Me.txtCPPI = New System.Windows.Forms.TextBox + Me.Label3 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label1 = New System.Windows.Forms.Label + Me.GroupBox2 = New System.Windows.Forms.GroupBox + Me.btnViewCalc = New System.Windows.Forms.Button + Me.txtUPrice = New System.Windows.Forms.TextBox + Me.txtUQty = New System.Windows.Forms.TextBox + Me.txtUPPI = New System.Windows.Forms.TextBox + Me.Label4 = New System.Windows.Forms.Label + Me.Label5 = New System.Windows.Forms.Label + Me.Label6 = New System.Windows.Forms.Label + Me.btnUpdate = New System.Windows.Forms.Button + Me.btnCancel = New System.Windows.Forms.Button + Me.GroupBox1.SuspendLayout() + Me.GroupBox2.SuspendLayout() + Me.SuspendLayout() + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.txtCPrice) + Me.GroupBox1.Controls.Add(Me.txtCQty) + Me.GroupBox1.Controls.Add(Me.txtCPPI) + Me.GroupBox1.Controls.Add(Me.Label3) + Me.GroupBox1.Controls.Add(Me.Label2) + Me.GroupBox1.Controls.Add(Me.Label1) + Me.GroupBox1.Location = New System.Drawing.Point(3, 2) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(217, 91) + Me.GroupBox1.TabIndex = 0 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "Current Status" + ' + 'txtCPrice + ' + Me.txtCPrice.Enabled = False + Me.txtCPrice.Location = New System.Drawing.Point(91, 39) + Me.txtCPrice.Name = "txtCPrice" + Me.txtCPrice.ReadOnly = True + Me.txtCPrice.Size = New System.Drawing.Size(107, 20) + Me.txtCPrice.TabIndex = 5 + Me.txtCPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtCQty + ' + Me.txtCQty.Enabled = False + Me.txtCQty.Location = New System.Drawing.Point(91, 17) + Me.txtCQty.Name = "txtCQty" + Me.txtCQty.ReadOnly = True + Me.txtCQty.Size = New System.Drawing.Size(107, 20) + Me.txtCQty.TabIndex = 4 + Me.txtCQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtCPPI + ' + Me.txtCPPI.Enabled = False + Me.txtCPPI.Location = New System.Drawing.Point(91, 61) + Me.txtCPPI.Name = "txtCPPI" + Me.txtCPPI.ReadOnly = True + Me.txtCPPI.Size = New System.Drawing.Size(107, 20) + Me.txtCPPI.TabIndex = 3 + Me.txtCPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(9, 64) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(76, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Price Per Item:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(10, 42) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(34, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Price:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(10, 20) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(26, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Qty:" + ' + 'GroupBox2 + ' + Me.GroupBox2.Controls.Add(Me.btnViewCalc) + Me.GroupBox2.Controls.Add(Me.txtUPrice) + Me.GroupBox2.Controls.Add(Me.txtUQty) + Me.GroupBox2.Controls.Add(Me.txtUPPI) + Me.GroupBox2.Controls.Add(Me.Label4) + Me.GroupBox2.Controls.Add(Me.Label5) + Me.GroupBox2.Controls.Add(Me.Label6) + Me.GroupBox2.Location = New System.Drawing.Point(3, 99) + Me.GroupBox2.Name = "GroupBox2" + Me.GroupBox2.Size = New System.Drawing.Size(217, 120) + Me.GroupBox2.TabIndex = 1 + Me.GroupBox2.TabStop = False + Me.GroupBox2.Text = "Update Status" + ' + 'btnViewCalc + ' + Me.btnViewCalc.Location = New System.Drawing.Point(53, 88) + Me.btnViewCalc.Name = "btnViewCalc" + Me.btnViewCalc.Size = New System.Drawing.Size(110, 26) + Me.btnViewCalc.TabIndex = 3 + Me.btnViewCalc.Text = "View Calculation" + Me.btnViewCalc.UseVisualStyleBackColor = True + ' + 'txtUPrice + ' + Me.txtUPrice.Location = New System.Drawing.Point(96, 40) + Me.txtUPrice.Name = "txtUPrice" + Me.txtUPrice.Size = New System.Drawing.Size(107, 20) + Me.txtUPrice.TabIndex = 2 + Me.txtUPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtUQty + ' + Me.txtUQty.Location = New System.Drawing.Point(96, 18) + Me.txtUQty.Name = "txtUQty" + Me.txtUQty.Size = New System.Drawing.Size(107, 20) + Me.txtUQty.TabIndex = 1 + Me.txtUQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtUPPI + ' + Me.txtUPPI.Enabled = False + Me.txtUPPI.Location = New System.Drawing.Point(96, 62) + Me.txtUPPI.Name = "txtUPPI" + Me.txtUPPI.ReadOnly = True + Me.txtUPPI.Size = New System.Drawing.Size(107, 20) + Me.txtUPPI.TabIndex = 9 + Me.txtUPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(14, 65) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(76, 13) + Me.Label4.TabIndex = 8 + Me.Label4.Text = "Price Per Item:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(15, 43) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(34, 13) + Me.Label5.TabIndex = 7 + Me.Label5.Text = "Price:" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(15, 21) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(26, 13) + Me.Label6.TabIndex = 6 + Me.Label6.Text = "Qty:" + ' + 'btnUpdate + ' + Me.btnUpdate.Location = New System.Drawing.Point(12, 225) + Me.btnUpdate.Name = "btnUpdate" + Me.btnUpdate.Size = New System.Drawing.Size(75, 23) + Me.btnUpdate.TabIndex = 4 + Me.btnUpdate.Text = "Update" + Me.btnUpdate.UseVisualStyleBackColor = True + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(131, 225) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 5 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'frmAddQtyBullets + ' + Me.AcceptButton = Me.btnUpdate + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(224, 260) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnUpdate) + Me.Controls.Add(Me.GroupBox2) + Me.Controls.Add(Me.GroupBox1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmAddQtyBullets" + Me.Text = "Update Bullet Qty" + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() + Me.GroupBox2.ResumeLayout(False) + Me.GroupBox2.PerformLayout() + Me.ResumeLayout(False) - End Sub - Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox - Friend WithEvents txtCPrice As System.Windows.Forms.TextBox - Friend WithEvents txtCQty As System.Windows.Forms.TextBox - Friend WithEvents txtCPPI As System.Windows.Forms.TextBox - Friend WithEvents Label3 As System.Windows.Forms.Label - Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents Label1 As System.Windows.Forms.Label - Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox - Friend WithEvents txtUPrice As System.Windows.Forms.TextBox - Friend WithEvents txtUQty As System.Windows.Forms.TextBox - Friend WithEvents txtUPPI As System.Windows.Forms.TextBox - 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 btnUpdate As System.Windows.Forms.Button - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents btnViewCalc As System.Windows.Forms.Button -End Class + End Sub + Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox + Friend WithEvents txtCPrice As System.Windows.Forms.TextBox + Friend WithEvents txtCQty As System.Windows.Forms.TextBox + Friend WithEvents txtCPPI As System.Windows.Forms.TextBox + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox + Friend WithEvents txtUPrice As System.Windows.Forms.TextBox + Friend WithEvents txtUQty As System.Windows.Forms.TextBox + Friend WithEvents txtUPPI As System.Windows.Forms.TextBox + 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 btnUpdate As System.Windows.Forms.Button + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents btnViewCalc As System.Windows.Forms.Button + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddQtyBullets.vb b/BSMyLoadersLog/Adding/frmAddQtyBullets.vb index 6695d13..6cdf688 100644 --- a/BSMyLoadersLog/Adding/frmAddQtyBullets.vb +++ b/BSMyLoadersLog/Adding/frmAddQtyBullets.vb @@ -1,93 +1,102 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc Imports BSMyLoadersLog.Viewing Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory +Imports BurnSoft.Applications.MLL.Types -Public Class frmAddQtyBullets - Public BID As Long - Public FromView As Boolean - Function PricePerItem(ByVal lQty As Long, ByVal dPrice As Double) As Double - Dim dAns As Double = 0 - Dim ObjIM As New InventoryMath - If lQty > 0 Then - dAns = dPrice / lQty - End If - ObjIM.ConvertToDollars(dAns) - Return dAns - End Function - Sub LoadData() - Try - Dim SQL As String = "SELECT * from List_Bullets where ID=" & BID - Dim Obj As New BSDatabase - Dim ObjIM As New InventoryMath - Call Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - Dim iQty As Integer = 0 - Dim eppo As Double = 0 - Dim dPrice As Double = 0 - While RS.Read - If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") - If Not IsDBNull(RS("Qty")) Then iQty = RS("Qty") - If Not IsDBNull(RS("ePPB")) Then eppo = RS("ePPB") - txtCQty.Text = iQty - txtCPrice.Text = ObjIM.ConvertToDollars(dPrice) - txtCPPI.Text = ObjIM.ConvertToDollars(eppo) - End While - RS.Close() - RS = Nothing - CMD = Nothing - Obj.CloseDB() - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub SaveData() - Try - Dim CQty As Long = CLng(GeneralHelpers.FluffContent(CDbl(txtCQty.Text), 0)) - Dim CPrice As Double = CDbl(GeneralHelpers.FluffContent(CDbl(txtCPrice.Text), 0)) - Dim CPPI As Double = CDbl(GeneralHelpers.FluffContent(CDbl(txtCPPI.Text), 0)) - Dim UQty As Long = CLng(GeneralHelpers.FluffContent(CDbl(txtUQty.Text), 0)) - Dim UPrice As Double = CDbl(GeneralHelpers.FluffContent(CDbl(txtUPrice.Text), 0)) - Dim UPPI As Double = PricePerItem(UQty, UPrice) - txtUPPI.Text = UPPI - If Not GeneralHelpers.IsRequired(UQty, "Update Qty", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(UPrice, "Update Price", Me.Text) Then Exit Sub +Namespace Adding + ''' + ''' Class FrmAddQtyBullets. + ''' Implements the + ''' + ''' + Public Class FrmAddQtyBullets + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' The bullet identifier + ''' + Public BulletId As Long + ''' + ''' From view + ''' + Public FromView As Boolean + + ''' + ''' Loads the data. + ''' + ''' + Sub LoadData() + Try + Dim lst as List(Of BulletListings) = BulletsInventory.GetDetails(DatabasePath, BulletId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As BulletListings In lst + txtCQty.Text = o.Qty + txtCPrice.Text = Converters.ConvertToDollars(o.Price) + txtCPPI.Text = Converters.ConvertToDollars(o.EsitmatedPricePerBullet) + Next + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Saves the data. + ''' + ''' + Sub SaveData() + Try + Dim currentQty As Long = CLng(GeneralHelpers.FluffContent(txtCQty.Text, 0)) + Dim currentPrice As Double = CDbl(GeneralHelpers.FluffContent(txtCPrice.Text, 0)) + Dim currentPricePerItem As Double = CDbl(GeneralHelpers.FluffContent(txtCPPI.Text, 0)) + Dim newQty As Long = CLng(GeneralHelpers.FluffContent(txtUQty.Text, 0)) + Dim newPrice As Double = CDbl(GeneralHelpers.FluffContent(txtUPrice.Text, 0)) + If Not GeneralHelpers.IsRequired(newQty, "Update Qty", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(newPrice, "Update Price", Text) Then Exit Sub - Dim NQty As Long = CQty + UQty - Dim NPrice As Double = (CQty * CPPI) + UPrice - Dim NPPI As Double = PricePerItem(NQty, NPrice) - Dim SQL As String = "" - Dim Obj As New BSDatabase - If CPPI = UPPI Then - SQL = "UPDATE List_Bullets set QTY=" & NQty & ", Price=" & NPrice & " where ID=" & BID - ElseIf UPrice = 0 And UQty = 0 Then - SQL = "UPDATE List_Bullets set QTY=0, Price=0, eppb=0 where ID=" & BID - Else - SQL = "UPDATE List_Bullets set QTY=" & NQty & ", Price=" & NPrice & ", eppb=" & NPPI & " where ID=" & BID - End If - Obj.ConnExec(SQL) - Catch ex As Exception - Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmAddQtyBullets_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call LoadData() - End Sub - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub - Private Sub btnViewCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnViewCalc.Click - txtUPPI.Text = PricePerItem(CLng(txtUQty.Text), CDbl(txtUPrice.Text)) - End Sub - Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click - Try - Call SaveData() - If FromView Then Call frmView_List_Bullets.LoadData() - Me.Close() - Catch ex As Exception - Call LogError(Me.Name, "btnUpdate.Click", Err.Number, ex.Message.ToString) - End Try - End Sub -End Class \ No newline at end of file + If Not BulletsInventory.UpdateQty(DatabasePath, BulletId, currentQty, currentPrice, currentPricePerItem, + newQty, newPrice, _errOut) Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmAddQtyBullets control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmAddQtyBullets_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call LoadData() + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnViewCalc control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnViewCalc_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnViewCalc.Click + txtUPPI.Text = CDbl(txtUPrice.Text) / CLng(txtUQty.Text) + End Sub + ''' + ''' Handles the Click event of the btnUpdate control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdate.Click + Try + Call SaveData() + If FromView Then Call FrmViewListBullets.LoadData() + Close() + Catch ex As Exception + Call LogError(Name, "btnUpdate.Click", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddQtyHulls.Designer.vb b/BSMyLoadersLog/Adding/frmAddQtyHulls.Designer.vb index 2625b52..1b7539d 100644 --- a/BSMyLoadersLog/Adding/frmAddQtyHulls.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddQtyHulls.Designer.vb @@ -1,255 +1,257 @@ - _ -Partial Class frmAddQtyHulls - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddQtyHulls + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddQtyHulls)) - Me.btnCancel = New System.Windows.Forms.Button() - Me.btnUpdate = New System.Windows.Forms.Button() - Me.GroupBox2 = New System.Windows.Forms.GroupBox() - Me.btnViewCalc = New System.Windows.Forms.Button() - Me.txtUPrice = New System.Windows.Forms.TextBox() - Me.txtUQty = New System.Windows.Forms.TextBox() - Me.txtUPPI = New System.Windows.Forms.TextBox() - Me.Label4 = New System.Windows.Forms.Label() - Me.Label5 = New System.Windows.Forms.Label() - Me.Label6 = New System.Windows.Forms.Label() - Me.GroupBox1 = New System.Windows.Forms.GroupBox() - Me.txtCPrice = New System.Windows.Forms.TextBox() - Me.txtCQty = New System.Windows.Forms.TextBox() - Me.txtCPPI = New System.Windows.Forms.TextBox() - Me.Label3 = New System.Windows.Forms.Label() - Me.Label2 = New System.Windows.Forms.Label() - Me.Label1 = New System.Windows.Forms.Label() - Me.GroupBox2.SuspendLayout() - Me.GroupBox1.SuspendLayout() - Me.SuspendLayout() - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(140, 235) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 17 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'btnUpdate - ' - Me.btnUpdate.Location = New System.Drawing.Point(23, 235) - Me.btnUpdate.Name = "btnUpdate" - Me.btnUpdate.Size = New System.Drawing.Size(75, 23) - Me.btnUpdate.TabIndex = 16 - Me.btnUpdate.Text = "Update" - Me.btnUpdate.UseVisualStyleBackColor = True - ' - 'GroupBox2 - ' - Me.GroupBox2.Controls.Add(Me.btnViewCalc) - Me.GroupBox2.Controls.Add(Me.txtUPrice) - Me.GroupBox2.Controls.Add(Me.txtUQty) - Me.GroupBox2.Controls.Add(Me.txtUPPI) - Me.GroupBox2.Controls.Add(Me.Label4) - Me.GroupBox2.Controls.Add(Me.Label5) - Me.GroupBox2.Controls.Add(Me.Label6) - Me.GroupBox2.Location = New System.Drawing.Point(12, 109) - Me.GroupBox2.Name = "GroupBox2" - Me.GroupBox2.Size = New System.Drawing.Size(217, 120) - Me.GroupBox2.TabIndex = 15 - Me.GroupBox2.TabStop = False - Me.GroupBox2.Text = "Update Status" - ' - 'btnViewCalc - ' - Me.btnViewCalc.Location = New System.Drawing.Point(53, 88) - Me.btnViewCalc.Name = "btnViewCalc" - Me.btnViewCalc.Size = New System.Drawing.Size(110, 26) - Me.btnViewCalc.TabIndex = 3 - Me.btnViewCalc.Text = "View Calculation" - Me.btnViewCalc.UseVisualStyleBackColor = True - ' - 'txtUPrice - ' - Me.txtUPrice.Location = New System.Drawing.Point(96, 40) - Me.txtUPrice.Name = "txtUPrice" - Me.txtUPrice.Size = New System.Drawing.Size(107, 20) - Me.txtUPrice.TabIndex = 2 - Me.txtUPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtUQty - ' - Me.txtUQty.Location = New System.Drawing.Point(96, 18) - Me.txtUQty.Name = "txtUQty" - Me.txtUQty.Size = New System.Drawing.Size(107, 20) - Me.txtUQty.TabIndex = 1 - Me.txtUQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtUPPI - ' - Me.txtUPPI.Enabled = False - Me.txtUPPI.Location = New System.Drawing.Point(96, 62) - Me.txtUPPI.Name = "txtUPPI" - Me.txtUPPI.ReadOnly = True - Me.txtUPPI.Size = New System.Drawing.Size(107, 20) - Me.txtUPPI.TabIndex = 9 - Me.txtUPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(14, 65) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(76, 13) - Me.Label4.TabIndex = 8 - Me.Label4.Text = "Price Per Item:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(15, 43) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(34, 13) - Me.Label5.TabIndex = 7 - Me.Label5.Text = "Price:" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(15, 21) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(26, 13) - Me.Label6.TabIndex = 6 - Me.Label6.Text = "Qty:" - ' - 'GroupBox1 - ' - Me.GroupBox1.Controls.Add(Me.txtCPrice) - Me.GroupBox1.Controls.Add(Me.txtCQty) - Me.GroupBox1.Controls.Add(Me.txtCPPI) - Me.GroupBox1.Controls.Add(Me.Label3) - Me.GroupBox1.Controls.Add(Me.Label2) - Me.GroupBox1.Controls.Add(Me.Label1) - Me.GroupBox1.Location = New System.Drawing.Point(12, 12) - Me.GroupBox1.Name = "GroupBox1" - Me.GroupBox1.Size = New System.Drawing.Size(217, 91) - Me.GroupBox1.TabIndex = 14 - Me.GroupBox1.TabStop = False - Me.GroupBox1.Text = "Current Status" - ' - 'txtCPrice - ' - Me.txtCPrice.Enabled = False - Me.txtCPrice.Location = New System.Drawing.Point(91, 39) - Me.txtCPrice.Name = "txtCPrice" - Me.txtCPrice.ReadOnly = True - Me.txtCPrice.Size = New System.Drawing.Size(107, 20) - Me.txtCPrice.TabIndex = 5 - Me.txtCPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtCQty - ' - Me.txtCQty.Enabled = False - Me.txtCQty.Location = New System.Drawing.Point(91, 17) - Me.txtCQty.Name = "txtCQty" - Me.txtCQty.ReadOnly = True - Me.txtCQty.Size = New System.Drawing.Size(107, 20) - Me.txtCQty.TabIndex = 4 - Me.txtCQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtCPPI - ' - Me.txtCPPI.Enabled = False - Me.txtCPPI.Location = New System.Drawing.Point(91, 61) - Me.txtCPPI.Name = "txtCPPI" - Me.txtCPPI.ReadOnly = True - Me.txtCPPI.Size = New System.Drawing.Size(107, 20) - Me.txtCPPI.TabIndex = 3 - Me.txtCPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(9, 64) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(76, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Price Per Item:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(10, 42) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(34, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Price:" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(10, 20) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(26, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Qty:" - ' - 'frmAddQtyHulls - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(238, 262) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnUpdate) - Me.Controls.Add(Me.GroupBox2) - Me.Controls.Add(Me.GroupBox1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmAddQtyHulls" - Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent - Me.Text = "Update Hull Qty," - Me.GroupBox2.ResumeLayout(False) - Me.GroupBox2.PerformLayout() - Me.GroupBox1.ResumeLayout(False) - Me.GroupBox1.PerformLayout() - Me.ResumeLayout(False) + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddQtyHulls)) + Me.btnCancel = New System.Windows.Forms.Button() + Me.btnUpdate = New System.Windows.Forms.Button() + Me.GroupBox2 = New System.Windows.Forms.GroupBox() + Me.btnViewCalc = New System.Windows.Forms.Button() + Me.txtUPrice = New System.Windows.Forms.TextBox() + Me.txtUQty = New System.Windows.Forms.TextBox() + Me.txtUPPI = New System.Windows.Forms.TextBox() + Me.Label4 = New System.Windows.Forms.Label() + Me.Label5 = New System.Windows.Forms.Label() + Me.Label6 = New System.Windows.Forms.Label() + Me.GroupBox1 = New System.Windows.Forms.GroupBox() + Me.txtCPrice = New System.Windows.Forms.TextBox() + Me.txtCQty = New System.Windows.Forms.TextBox() + Me.txtCPPI = New System.Windows.Forms.TextBox() + Me.Label3 = New System.Windows.Forms.Label() + Me.Label2 = New System.Windows.Forms.Label() + Me.Label1 = New System.Windows.Forms.Label() + Me.GroupBox2.SuspendLayout() + Me.GroupBox1.SuspendLayout() + Me.SuspendLayout() + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(140, 235) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 17 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'btnUpdate + ' + Me.btnUpdate.Location = New System.Drawing.Point(23, 235) + Me.btnUpdate.Name = "btnUpdate" + Me.btnUpdate.Size = New System.Drawing.Size(75, 23) + Me.btnUpdate.TabIndex = 16 + Me.btnUpdate.Text = "Update" + Me.btnUpdate.UseVisualStyleBackColor = True + ' + 'GroupBox2 + ' + Me.GroupBox2.Controls.Add(Me.btnViewCalc) + Me.GroupBox2.Controls.Add(Me.txtUPrice) + Me.GroupBox2.Controls.Add(Me.txtUQty) + Me.GroupBox2.Controls.Add(Me.txtUPPI) + Me.GroupBox2.Controls.Add(Me.Label4) + Me.GroupBox2.Controls.Add(Me.Label5) + Me.GroupBox2.Controls.Add(Me.Label6) + Me.GroupBox2.Location = New System.Drawing.Point(12, 109) + Me.GroupBox2.Name = "GroupBox2" + Me.GroupBox2.Size = New System.Drawing.Size(217, 120) + Me.GroupBox2.TabIndex = 15 + Me.GroupBox2.TabStop = False + Me.GroupBox2.Text = "Update Status" + ' + 'btnViewCalc + ' + Me.btnViewCalc.Location = New System.Drawing.Point(53, 88) + Me.btnViewCalc.Name = "btnViewCalc" + Me.btnViewCalc.Size = New System.Drawing.Size(110, 26) + Me.btnViewCalc.TabIndex = 3 + Me.btnViewCalc.Text = "View Calculation" + Me.btnViewCalc.UseVisualStyleBackColor = True + ' + 'txtUPrice + ' + Me.txtUPrice.Location = New System.Drawing.Point(96, 40) + Me.txtUPrice.Name = "txtUPrice" + Me.txtUPrice.Size = New System.Drawing.Size(107, 20) + Me.txtUPrice.TabIndex = 2 + Me.txtUPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtUQty + ' + Me.txtUQty.Location = New System.Drawing.Point(96, 18) + Me.txtUQty.Name = "txtUQty" + Me.txtUQty.Size = New System.Drawing.Size(107, 20) + Me.txtUQty.TabIndex = 1 + Me.txtUQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtUPPI + ' + Me.txtUPPI.Enabled = False + Me.txtUPPI.Location = New System.Drawing.Point(96, 62) + Me.txtUPPI.Name = "txtUPPI" + Me.txtUPPI.ReadOnly = True + Me.txtUPPI.Size = New System.Drawing.Size(107, 20) + Me.txtUPPI.TabIndex = 9 + Me.txtUPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(14, 65) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(76, 13) + Me.Label4.TabIndex = 8 + Me.Label4.Text = "Price Per Item:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(15, 43) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(34, 13) + Me.Label5.TabIndex = 7 + Me.Label5.Text = "Price:" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(15, 21) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(26, 13) + Me.Label6.TabIndex = 6 + Me.Label6.Text = "Qty:" + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.txtCPrice) + Me.GroupBox1.Controls.Add(Me.txtCQty) + Me.GroupBox1.Controls.Add(Me.txtCPPI) + Me.GroupBox1.Controls.Add(Me.Label3) + Me.GroupBox1.Controls.Add(Me.Label2) + Me.GroupBox1.Controls.Add(Me.Label1) + Me.GroupBox1.Location = New System.Drawing.Point(12, 12) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(217, 91) + Me.GroupBox1.TabIndex = 14 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "Current Status" + ' + 'txtCPrice + ' + Me.txtCPrice.Enabled = False + Me.txtCPrice.Location = New System.Drawing.Point(91, 39) + Me.txtCPrice.Name = "txtCPrice" + Me.txtCPrice.ReadOnly = True + Me.txtCPrice.Size = New System.Drawing.Size(107, 20) + Me.txtCPrice.TabIndex = 5 + Me.txtCPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtCQty + ' + Me.txtCQty.Enabled = False + Me.txtCQty.Location = New System.Drawing.Point(91, 17) + Me.txtCQty.Name = "txtCQty" + Me.txtCQty.ReadOnly = True + Me.txtCQty.Size = New System.Drawing.Size(107, 20) + Me.txtCQty.TabIndex = 4 + Me.txtCQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtCPPI + ' + Me.txtCPPI.Enabled = False + Me.txtCPPI.Location = New System.Drawing.Point(91, 61) + Me.txtCPPI.Name = "txtCPPI" + Me.txtCPPI.ReadOnly = True + Me.txtCPPI.Size = New System.Drawing.Size(107, 20) + Me.txtCPPI.TabIndex = 3 + Me.txtCPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(9, 64) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(76, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Price Per Item:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(10, 42) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(34, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Price:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(10, 20) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(26, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Qty:" + ' + 'frmAddQtyHulls + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(238, 262) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnUpdate) + Me.Controls.Add(Me.GroupBox2) + Me.Controls.Add(Me.GroupBox1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmAddQtyHulls" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent + Me.Text = "Update Hull Qty," + Me.GroupBox2.ResumeLayout(False) + Me.GroupBox2.PerformLayout() + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() + Me.ResumeLayout(False) - End Sub - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents btnUpdate As System.Windows.Forms.Button - Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox - Friend WithEvents btnViewCalc As System.Windows.Forms.Button - Friend WithEvents txtUPrice As System.Windows.Forms.TextBox - Friend WithEvents txtUQty As System.Windows.Forms.TextBox - Friend WithEvents txtUPPI As System.Windows.Forms.TextBox - 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 GroupBox1 As System.Windows.Forms.GroupBox - Friend WithEvents txtCPrice As System.Windows.Forms.TextBox - Friend WithEvents txtCQty As System.Windows.Forms.TextBox - Friend WithEvents txtCPPI As System.Windows.Forms.TextBox - Friend WithEvents Label3 As System.Windows.Forms.Label - Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents Label1 As System.Windows.Forms.Label -End Class + End Sub + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents btnUpdate As System.Windows.Forms.Button + Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox + Friend WithEvents btnViewCalc As System.Windows.Forms.Button + Friend WithEvents txtUPrice As System.Windows.Forms.TextBox + Friend WithEvents txtUQty As System.Windows.Forms.TextBox + Friend WithEvents txtUPPI As System.Windows.Forms.TextBox + 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 GroupBox1 As System.Windows.Forms.GroupBox + Friend WithEvents txtCPrice As System.Windows.Forms.TextBox + Friend WithEvents txtCQty As System.Windows.Forms.TextBox + Friend WithEvents txtCPPI As System.Windows.Forms.TextBox + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label1 As System.Windows.Forms.Label + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddQtyHulls.vb b/BSMyLoadersLog/Adding/frmAddQtyHulls.vb index cbae083..9c63a68 100644 --- a/BSMyLoadersLog/Adding/frmAddQtyHulls.vb +++ b/BSMyLoadersLog/Adding/frmAddQtyHulls.vb @@ -1,98 +1,104 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc +Imports System.Data.Odbc +Imports BSMyLoadersLog.LoadersClass Imports BSMyLoadersLog.Viewing Imports BurnSoft.Applications.MLL.Helpers -Public Class frmAddQtyHulls - Public SID As Long - Public FromView As Boolean - Function PricePerItem(ByVal lQty As Long, ByVal dPrice As Double) As Double - Dim dAns As Double = 0 - Dim ObjIM As New InventoryMath - If lQty > 0 Then - dAns = dPrice / lQty - End If - ObjIM.ConvertToDollars(dAns) - Return dAns - End Function - Sub LoadData() - Try - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim SQL As String = "SELECT * from List_SG_Case where ID=" & SID - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - Dim TimesUsed As Long = 0 - Dim iQty As Integer = 0 - Dim eppo As Double = 0 - Dim dPrice As Double = 0 - While RS.Read - If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") - If Not IsDBNull(RS("Qty")) Then iQty = RS("Qty") - If Not IsDBNull(RS("ePPs")) Then eppo = RS("ePPs") - txtCQty.Text = iQty - txtCPPI.Text = eppo - Dim ObjIM As New InventoryMath - txtCPrice.Text = ObjIM.ConvertToDollars(dPrice) - End While - RS.Close() - RS = Nothing - CMD = Nothing - Call Obj.CloseDB() - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub SaveData() - Try - Dim CQty As Long = CLng(GeneralHelpers.FluffContent(CDbl(txtCQty.Text), 0)) - Dim CPrice As Double = CDbl(GeneralHelpers.FluffContent(CDbl(txtCPrice.Text), 0)) - Dim CPPI As Double = CDbl(GeneralHelpers.FluffContent(CDbl(txtCPPI.Text), 0)) - Dim UQty As Long = CLng(GeneralHelpers.FluffContent(CDbl(txtUQty.Text), 0)) - Dim UPrice As Double = CDbl(GeneralHelpers.FluffContent(CDbl(txtUPrice.Text), 0)) - Dim UPPI As Double = PricePerItem(UQty, UPrice) - txtUPPI.Text = UPPI - If Not GeneralHelpers.IsRequired(UQty, "Update Qty", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(UPrice, "Update Price", Me.Text) Then Exit Sub +Namespace Adding - Dim NQty As Long = CQty + UQty - Dim NPrice As Double = (CQty * CPPI) + UPrice - Dim NPPI As Double = PricePerItem(NQty, NPrice) - Dim SQL As String = "" - Dim Obj As New BSDatabase - If CPPI = UPPI Then - SQL = "UPDATE List_SG_Case set QTY=" & NQty & ", Price=" & NPrice & " where ID=" & SID - ElseIf UPrice = 0 And UQty = 0 Then - SQL = "UPDATE List_SG_Case set QTY=0, Price=0, epps=0 where ID=" & SID - Else - SQL = "UPDATE List_SG_Case set QTY=" & NQty & ", Price=" & NPrice & ", epps=" & NPPI & " where ID=" & SID + Public Class FrmAddQtyHulls + ' TODO: #33 Update when this function as been added to the library. + Dim errOut As String + Public SID As Long + Public FromView As Boolean + Function PricePerItem(ByVal lQty As Long, ByVal dPrice As Double) As Double + Dim dAns As Double = 0 + 'Dim ObjIM As New InventoryMath + If lQty > 0 Then + dAns = dPrice / lQty End If - Obj.ConnExec(SQL) - Catch ex As Exception - Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmAddQtyHulls_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load - Call LoadData() - End Sub + 'Converters.ConvertToDollars(dAns) + Return Converters.ConvertToDollars(dAns) + End Function + Sub LoadData() + Try + Dim Obj As New BSDatabase + Call Obj.ConnectDB() + Dim SQL As String = "SELECT * from List_SG_Case where ID=" & SID + Dim CMD As New OdbcCommand(SQL, Obj.Conn) + Dim RS As OdbcDataReader + RS = CMD.ExecuteReader + Dim TimesUsed As Long = 0 + Dim iQty As Integer = 0 + Dim eppo As Double = 0 + Dim dPrice As Double = 0 + While RS.Read + If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") + If Not IsDBNull(RS("Qty")) Then iQty = RS("Qty") + If Not IsDBNull(RS("ePPs")) Then eppo = RS("ePPs") + txtCQty.Text = iQty + txtCPPI.Text = eppo + Dim ObjIM As New InventoryMath + 'txtCPrice.Text = Converters.ConvertToDollars(dPrice) + txtCPrice.Text = Converters.ConvertToDollars(dPrice) + End While + RS.Close() + RS = Nothing + CMD = Nothing + Call Obj.CloseDB() + Catch ex As Exception + Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + Sub SaveData() + Try + Dim CQty As Long = CLng(GeneralHelpers.FluffContent(CDbl(txtCQty.Text), 0)) + Dim CPrice As Double = CDbl(GeneralHelpers.FluffContent(CDbl(txtCPrice.Text), 0)) + Dim CPPI As Double = CDbl(GeneralHelpers.FluffContent(CDbl(txtCPPI.Text), 0)) + Dim UQty As Long = CLng(GeneralHelpers.FluffContent(CDbl(txtUQty.Text), 0)) + Dim UPrice As Double = CDbl(GeneralHelpers.FluffContent(CDbl(txtUPrice.Text), 0)) + Dim UPPI As Double = PricePerItem(UQty, UPrice) + txtUPPI.Text = UPPI + If Not GeneralHelpers.IsRequired(UQty, "Update Qty", Me.Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(UPrice, "Update Price", Me.Text) Then Exit Sub - Private Sub btnViewCalc_Click(sender As System.Object, e As System.EventArgs) Handles btnViewCalc.Click - txtUPPI.Text = PricePerItem(CLng(GeneralHelpers.FluffContent(CDbl(txtUQty.Text), 0)), - CDbl(GeneralHelpers.FluffContent(CDbl(txtUPrice.Text), 0))) - End Sub + Dim NQty As Long = CQty + UQty + Dim NPrice As Double = (CQty * CPPI) + UPrice + Dim NPPI As Double = PricePerItem(NQty, NPrice) + Dim SQL As String = "" + Dim Obj As New BSDatabase + If CPPI = UPPI Then + SQL = "UPDATE List_SG_Case set QTY=" & NQty & ", Price=" & NPrice & " where ID=" & SID + ElseIf UPrice = 0 And UQty = 0 Then + SQL = "UPDATE List_SG_Case set QTY=0, Price=0, epps=0 where ID=" & SID + Else + SQL = "UPDATE List_SG_Case set QTY=" & NQty & ", Price=" & NPrice & ", epps=" & NPPI & " where ID=" & SID + End If + Obj.ConnExec(SQL) + Catch ex As Exception + Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) + End Try + End Sub + Private Sub frmAddQtyHulls_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load + Call LoadData() + End Sub - Private Sub btnUpdate_Click(sender As System.Object, e As System.EventArgs) Handles btnUpdate.Click - Try - Call SaveData() - If FromView Then Call FrmViewListShells.LoadData() - Me.Close() - Catch ex As Exception - Call LogError(Me.Name, "btnUpdate.Click", Err.Number, ex.Message.ToString) - End Try - End Sub + Private Sub btnViewCalc_Click(sender As System.Object, e As System.EventArgs) Handles btnViewCalc.Click + txtUPPI.Text = PricePerItem(CLng(GeneralHelpers.FluffContent(CDbl(txtUQty.Text), 0)), + CDbl(GeneralHelpers.FluffContent(CDbl(txtUPrice.Text), 0))) + End Sub + + Private Sub btnUpdate_Click(sender As System.Object, e As System.EventArgs) Handles btnUpdate.Click + Try + Call SaveData() + If FromView Then Call FrmViewListShells.LoadData() + Me.Close() + Catch ex As Exception + Call LogError(Me.Name, "btnUpdate.Click", Err.Number, ex.Message.ToString) + End Try + End Sub - Private Sub btnCancel_Click(sender As System.Object, e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub -End Class \ No newline at end of file + Private Sub btnCancel_Click(sender As System.Object, e As System.EventArgs) Handles btnCancel.Click + Me.Close() + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddQtyPowder.vb b/BSMyLoadersLog/Adding/frmAddQtyPowder.vb index bc1cd11..97b474e 100644 --- a/BSMyLoadersLog/Adding/frmAddQtyPowder.vb +++ b/BSMyLoadersLog/Adding/frmAddQtyPowder.vb @@ -10,19 +10,19 @@ Public Class frmAddQtyPowder Public FromView As Boolean Function PricePerItem(ByVal lValue As Long, ByVal dPrice As Double, ByVal sType As String) As Double Dim dAns As Double = 0 - Dim ObjIM As New InventoryMath + 'Dim ObjIM As New InventoryMath Dim lNewValue As Long = 0 Select Case sType Case "Grains (grs)" lNewValue = lValue Case "Pounds (lbs)" - lNewValue = lValue * WeightGrains1Lbs + lNewValue = lValue * WeightValues.WEIGHT_GRAINS_1LBS End Select If lValue > 0 Then dAns = dPrice / lNewValue End If - ObjIM.ConvertToDollars(dAns) - Return dAns + 'Converters.ConvertToDollars(dAns) + Return Converters.ConvertToDollars( dAns) End Function Sub LoadData() Try @@ -42,8 +42,9 @@ Public Class frmAddQtyPowder If Not IsDBNull(RS("eppp")) Then eppo = RS("eppp") txtCQty2.Text = iQty txtCPPI.Text = eppo - Dim ObjIM As New InventoryMath - txtCPrice.Text = ObjIM.ConvertToDollars(dPrice) + 'Dim ObjIM As New InventoryMath + 'txtCPrice.Text = Converters.ConvertToDollars(dPrice) + txtCPrice.Text = Converters.ConvertToDollars(dPrice) End While RS.Close() RS = Nothing @@ -102,7 +103,7 @@ Public Class frmAddQtyPowder End Sub Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click Call SaveData() - If FromView Then Call frmView_List_Powder.LoadData() + If FromView Then Call FrmViewListPowder.LoadData() Me.Close() End Sub Private Sub btnViewCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnViewCalc.Click diff --git a/BSMyLoadersLog/Adding/frmAddQtyPrimers.Designer.vb b/BSMyLoadersLog/Adding/frmAddQtyPrimers.Designer.vb index ce8fbaa..e9153f8 100644 --- a/BSMyLoadersLog/Adding/frmAddQtyPrimers.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddQtyPrimers.Designer.vb @@ -1,256 +1,258 @@ - _ -Partial Class frmAddQtyPrimers - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddQtyPrimers + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddQtyPrimers)) - Me.btnCancel = New System.Windows.Forms.Button - Me.btnUpdate = New System.Windows.Forms.Button - Me.GroupBox2 = New System.Windows.Forms.GroupBox - Me.btnViewCalc = New System.Windows.Forms.Button - Me.txtUPrice = New System.Windows.Forms.TextBox - Me.txtUQty = New System.Windows.Forms.TextBox - Me.txtUPPI = New System.Windows.Forms.TextBox - Me.Label4 = New System.Windows.Forms.Label - Me.Label5 = New System.Windows.Forms.Label - Me.Label6 = New System.Windows.Forms.Label - Me.GroupBox1 = New System.Windows.Forms.GroupBox - Me.txtCPrice = New System.Windows.Forms.TextBox - Me.txtCQty = New System.Windows.Forms.TextBox - Me.txtCPPI = New System.Windows.Forms.TextBox - Me.Label3 = New System.Windows.Forms.Label - Me.Label2 = New System.Windows.Forms.Label - Me.Label1 = New System.Windows.Forms.Label - Me.GroupBox2.SuspendLayout() - Me.GroupBox1.SuspendLayout() - Me.SuspendLayout() - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(129, 226) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 9 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'btnUpdate - ' - Me.btnUpdate.Location = New System.Drawing.Point(12, 226) - Me.btnUpdate.Name = "btnUpdate" - Me.btnUpdate.Size = New System.Drawing.Size(75, 23) - Me.btnUpdate.TabIndex = 8 - Me.btnUpdate.Text = "Update" - Me.btnUpdate.UseVisualStyleBackColor = True - ' - 'GroupBox2 - ' - Me.GroupBox2.Controls.Add(Me.btnViewCalc) - Me.GroupBox2.Controls.Add(Me.txtUPrice) - Me.GroupBox2.Controls.Add(Me.txtUQty) - Me.GroupBox2.Controls.Add(Me.txtUPPI) - Me.GroupBox2.Controls.Add(Me.Label4) - Me.GroupBox2.Controls.Add(Me.Label5) - Me.GroupBox2.Controls.Add(Me.Label6) - Me.GroupBox2.Location = New System.Drawing.Point(1, 100) - Me.GroupBox2.Name = "GroupBox2" - Me.GroupBox2.Size = New System.Drawing.Size(217, 120) - Me.GroupBox2.TabIndex = 7 - Me.GroupBox2.TabStop = False - Me.GroupBox2.Text = "Update Status" - ' - 'btnViewCalc - ' - Me.btnViewCalc.Location = New System.Drawing.Point(53, 88) - Me.btnViewCalc.Name = "btnViewCalc" - Me.btnViewCalc.Size = New System.Drawing.Size(110, 26) - Me.btnViewCalc.TabIndex = 3 - Me.btnViewCalc.Text = "View Calculation" - Me.btnViewCalc.UseVisualStyleBackColor = True - ' - 'txtUPrice - ' - Me.txtUPrice.Location = New System.Drawing.Point(96, 40) - Me.txtUPrice.Name = "txtUPrice" - Me.txtUPrice.Size = New System.Drawing.Size(107, 20) - Me.txtUPrice.TabIndex = 2 - Me.txtUPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtUQty - ' - Me.txtUQty.Location = New System.Drawing.Point(96, 18) - Me.txtUQty.Name = "txtUQty" - Me.txtUQty.Size = New System.Drawing.Size(107, 20) - Me.txtUQty.TabIndex = 1 - Me.txtUQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtUPPI - ' - Me.txtUPPI.Enabled = False - Me.txtUPPI.Location = New System.Drawing.Point(96, 62) - Me.txtUPPI.Name = "txtUPPI" - Me.txtUPPI.ReadOnly = True - Me.txtUPPI.Size = New System.Drawing.Size(107, 20) - Me.txtUPPI.TabIndex = 9 - Me.txtUPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(14, 65) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(76, 13) - Me.Label4.TabIndex = 8 - Me.Label4.Text = "Price Per Item:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(15, 43) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(34, 13) - Me.Label5.TabIndex = 7 - Me.Label5.Text = "Price:" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(15, 21) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(26, 13) - Me.Label6.TabIndex = 6 - Me.Label6.Text = "Qty:" - ' - 'GroupBox1 - ' - Me.GroupBox1.Controls.Add(Me.txtCPrice) - Me.GroupBox1.Controls.Add(Me.txtCQty) - Me.GroupBox1.Controls.Add(Me.txtCPPI) - Me.GroupBox1.Controls.Add(Me.Label3) - Me.GroupBox1.Controls.Add(Me.Label2) - Me.GroupBox1.Controls.Add(Me.Label1) - Me.GroupBox1.Location = New System.Drawing.Point(1, 3) - Me.GroupBox1.Name = "GroupBox1" - Me.GroupBox1.Size = New System.Drawing.Size(217, 91) - Me.GroupBox1.TabIndex = 6 - Me.GroupBox1.TabStop = False - Me.GroupBox1.Text = "Current Status" - ' - 'txtCPrice - ' - Me.txtCPrice.Enabled = False - Me.txtCPrice.Location = New System.Drawing.Point(91, 39) - Me.txtCPrice.Name = "txtCPrice" - Me.txtCPrice.ReadOnly = True - Me.txtCPrice.Size = New System.Drawing.Size(107, 20) - Me.txtCPrice.TabIndex = 5 - Me.txtCPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtCQty - ' - Me.txtCQty.Enabled = False - Me.txtCQty.Location = New System.Drawing.Point(91, 17) - Me.txtCQty.Name = "txtCQty" - Me.txtCQty.ReadOnly = True - Me.txtCQty.Size = New System.Drawing.Size(107, 20) - Me.txtCQty.TabIndex = 4 - Me.txtCQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtCPPI - ' - Me.txtCPPI.Enabled = False - Me.txtCPPI.Location = New System.Drawing.Point(91, 61) - Me.txtCPPI.Name = "txtCPPI" - Me.txtCPPI.ReadOnly = True - Me.txtCPPI.Size = New System.Drawing.Size(107, 20) - Me.txtCPPI.TabIndex = 3 - Me.txtCPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(9, 64) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(76, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Price Per Item:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(10, 42) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(34, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Price:" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(10, 20) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(26, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Qty:" - ' - 'frmAddQtyPrimers - ' - Me.AcceptButton = Me.btnUpdate - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(223, 258) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnUpdate) - Me.Controls.Add(Me.GroupBox2) - Me.Controls.Add(Me.GroupBox1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmAddQtyPrimers" - Me.Text = "Update Primer Qty" - Me.GroupBox2.ResumeLayout(False) - Me.GroupBox2.PerformLayout() - Me.GroupBox1.ResumeLayout(False) - Me.GroupBox1.PerformLayout() - Me.ResumeLayout(False) + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddQtyPrimers)) + Me.btnCancel = New System.Windows.Forms.Button + Me.btnUpdate = New System.Windows.Forms.Button + Me.GroupBox2 = New System.Windows.Forms.GroupBox + Me.btnViewCalc = New System.Windows.Forms.Button + Me.txtUPrice = New System.Windows.Forms.TextBox + Me.txtUQty = New System.Windows.Forms.TextBox + Me.txtUPPI = New System.Windows.Forms.TextBox + Me.Label4 = New System.Windows.Forms.Label + Me.Label5 = New System.Windows.Forms.Label + Me.Label6 = New System.Windows.Forms.Label + Me.GroupBox1 = New System.Windows.Forms.GroupBox + Me.txtCPrice = New System.Windows.Forms.TextBox + Me.txtCQty = New System.Windows.Forms.TextBox + Me.txtCPPI = New System.Windows.Forms.TextBox + Me.Label3 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label1 = New System.Windows.Forms.Label + Me.GroupBox2.SuspendLayout() + Me.GroupBox1.SuspendLayout() + Me.SuspendLayout() + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(129, 226) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 9 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'btnUpdate + ' + Me.btnUpdate.Location = New System.Drawing.Point(12, 226) + Me.btnUpdate.Name = "btnUpdate" + Me.btnUpdate.Size = New System.Drawing.Size(75, 23) + Me.btnUpdate.TabIndex = 8 + Me.btnUpdate.Text = "Update" + Me.btnUpdate.UseVisualStyleBackColor = True + ' + 'GroupBox2 + ' + Me.GroupBox2.Controls.Add(Me.btnViewCalc) + Me.GroupBox2.Controls.Add(Me.txtUPrice) + Me.GroupBox2.Controls.Add(Me.txtUQty) + Me.GroupBox2.Controls.Add(Me.txtUPPI) + Me.GroupBox2.Controls.Add(Me.Label4) + Me.GroupBox2.Controls.Add(Me.Label5) + Me.GroupBox2.Controls.Add(Me.Label6) + Me.GroupBox2.Location = New System.Drawing.Point(1, 100) + Me.GroupBox2.Name = "GroupBox2" + Me.GroupBox2.Size = New System.Drawing.Size(217, 120) + Me.GroupBox2.TabIndex = 7 + Me.GroupBox2.TabStop = False + Me.GroupBox2.Text = "Update Status" + ' + 'btnViewCalc + ' + Me.btnViewCalc.Location = New System.Drawing.Point(53, 88) + Me.btnViewCalc.Name = "btnViewCalc" + Me.btnViewCalc.Size = New System.Drawing.Size(110, 26) + Me.btnViewCalc.TabIndex = 3 + Me.btnViewCalc.Text = "View Calculation" + Me.btnViewCalc.UseVisualStyleBackColor = True + ' + 'txtUPrice + ' + Me.txtUPrice.Location = New System.Drawing.Point(96, 40) + Me.txtUPrice.Name = "txtUPrice" + Me.txtUPrice.Size = New System.Drawing.Size(107, 20) + Me.txtUPrice.TabIndex = 2 + Me.txtUPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtUQty + ' + Me.txtUQty.Location = New System.Drawing.Point(96, 18) + Me.txtUQty.Name = "txtUQty" + Me.txtUQty.Size = New System.Drawing.Size(107, 20) + Me.txtUQty.TabIndex = 1 + Me.txtUQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtUPPI + ' + Me.txtUPPI.Enabled = False + Me.txtUPPI.Location = New System.Drawing.Point(96, 62) + Me.txtUPPI.Name = "txtUPPI" + Me.txtUPPI.ReadOnly = True + Me.txtUPPI.Size = New System.Drawing.Size(107, 20) + Me.txtUPPI.TabIndex = 9 + Me.txtUPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(14, 65) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(76, 13) + Me.Label4.TabIndex = 8 + Me.Label4.Text = "Price Per Item:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(15, 43) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(34, 13) + Me.Label5.TabIndex = 7 + Me.Label5.Text = "Price:" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(15, 21) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(26, 13) + Me.Label6.TabIndex = 6 + Me.Label6.Text = "Qty:" + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.txtCPrice) + Me.GroupBox1.Controls.Add(Me.txtCQty) + Me.GroupBox1.Controls.Add(Me.txtCPPI) + Me.GroupBox1.Controls.Add(Me.Label3) + Me.GroupBox1.Controls.Add(Me.Label2) + Me.GroupBox1.Controls.Add(Me.Label1) + Me.GroupBox1.Location = New System.Drawing.Point(1, 3) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(217, 91) + Me.GroupBox1.TabIndex = 6 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "Current Status" + ' + 'txtCPrice + ' + Me.txtCPrice.Enabled = False + Me.txtCPrice.Location = New System.Drawing.Point(91, 39) + Me.txtCPrice.Name = "txtCPrice" + Me.txtCPrice.ReadOnly = True + Me.txtCPrice.Size = New System.Drawing.Size(107, 20) + Me.txtCPrice.TabIndex = 5 + Me.txtCPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtCQty + ' + Me.txtCQty.Enabled = False + Me.txtCQty.Location = New System.Drawing.Point(91, 17) + Me.txtCQty.Name = "txtCQty" + Me.txtCQty.ReadOnly = True + Me.txtCQty.Size = New System.Drawing.Size(107, 20) + Me.txtCQty.TabIndex = 4 + Me.txtCQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtCPPI + ' + Me.txtCPPI.Enabled = False + Me.txtCPPI.Location = New System.Drawing.Point(91, 61) + Me.txtCPPI.Name = "txtCPPI" + Me.txtCPPI.ReadOnly = True + Me.txtCPPI.Size = New System.Drawing.Size(107, 20) + Me.txtCPPI.TabIndex = 3 + Me.txtCPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(9, 64) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(76, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Price Per Item:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(10, 42) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(34, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Price:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(10, 20) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(26, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Qty:" + ' + 'frmAddQtyPrimers + ' + Me.AcceptButton = Me.btnUpdate + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(223, 258) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnUpdate) + Me.Controls.Add(Me.GroupBox2) + Me.Controls.Add(Me.GroupBox1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmAddQtyPrimers" + Me.Text = "Update Primer Qty" + Me.GroupBox2.ResumeLayout(False) + Me.GroupBox2.PerformLayout() + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() + Me.ResumeLayout(False) - End Sub - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents btnUpdate As System.Windows.Forms.Button - Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox - Friend WithEvents btnViewCalc As System.Windows.Forms.Button - Friend WithEvents txtUPrice As System.Windows.Forms.TextBox - Friend WithEvents txtUQty As System.Windows.Forms.TextBox - Friend WithEvents txtUPPI As System.Windows.Forms.TextBox - 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 GroupBox1 As System.Windows.Forms.GroupBox - Friend WithEvents txtCPrice As System.Windows.Forms.TextBox - Friend WithEvents txtCQty As System.Windows.Forms.TextBox - Friend WithEvents txtCPPI As System.Windows.Forms.TextBox - Friend WithEvents Label3 As System.Windows.Forms.Label - Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents Label1 As System.Windows.Forms.Label -End Class + End Sub + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents btnUpdate As System.Windows.Forms.Button + Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox + Friend WithEvents btnViewCalc As System.Windows.Forms.Button + Friend WithEvents txtUPrice As System.Windows.Forms.TextBox + Friend WithEvents txtUQty As System.Windows.Forms.TextBox + Friend WithEvents txtUPPI As System.Windows.Forms.TextBox + 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 GroupBox1 As System.Windows.Forms.GroupBox + Friend WithEvents txtCPrice As System.Windows.Forms.TextBox + Friend WithEvents txtCQty As System.Windows.Forms.TextBox + Friend WithEvents txtCPPI As System.Windows.Forms.TextBox + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label1 As System.Windows.Forms.Label + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddQtyPrimers.vb b/BSMyLoadersLog/Adding/frmAddQtyPrimers.vb index 77c42af..7cf7359 100644 --- a/BSMyLoadersLog/Adding/frmAddQtyPrimers.vb +++ b/BSMyLoadersLog/Adding/frmAddQtyPrimers.vb @@ -1,94 +1,155 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc +'Imports System.Data.Odbc +'Imports BSMyLoadersLog.LoadersClass Imports BSMyLoadersLog.Viewing Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory +Imports BurnSoft.Applications.MLL.Types -Public Class frmAddQtyPrimers - Public PID As Long - Public FromView As Boolean - Function PricePerItem(ByVal lQty As Long, ByVal dPrice As Double) As Double - Dim dAns As Double = 0 - Dim ObjIM As New InventoryMath - If lQty > 0 Then - dAns = dPrice / lQty - End If - ObjIM.ConvertToDollars(dAns) - Return dAns - End Function - Sub LoadData() - Try - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim SQL As String = "SELECT * from General_Primer where ID=" & PID - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - Dim iQty As Integer = 0 - Dim eppo As Double = 0 - Dim dPrice As Double = 0 - While RS.Read - If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") - If Not IsDBNull(RS("Qty")) Then iQty = RS("Qty") - If Not IsDBNull(RS("eppp")) Then eppo = RS("eppp") - txtCQty.Text = iQty - txtCPPI.Text = eppo - Dim ObjIM As New InventoryMath - txtCPrice.Text = ObjIM.ConvertToDollars(dPrice) - End While - RS.Close() - RS = Nothing - CMD = Nothing - Obj.CloseDB() - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub SaveData() - Try - Dim CQty As Long = GeneralHelpers.FluffContent(CLng(txtCQty.Text), 0) - Dim CPrice As Double = GeneralHelpers.FluffContent(CDbl(txtCPrice.Text), 0) - Dim CPPI As Double = GeneralHelpers.FluffContent(CDbl(txtCPPI.Text), 0) - Dim UQty As Long = GeneralHelpers.FluffContent(CLng(txtUQty.Text), 0) - Dim UPrice As Double = GeneralHelpers.FluffContent(CDbl(txtUPrice.Text), 0) - Dim UPPI As Double = PricePerItem(UQty, UPrice) - txtUPPI.Text = UPPI - If Not GeneralHelpers.IsRequired(UQty, "Update Qty", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(UPrice, "Update Price", Me.Text) Then Exit Sub +Namespace Adding + ' TODO: #20 clean up code + ''' + ''' Class frmAddQtyPrimers. + ''' Implements the + ''' + ''' + Public Class FrmAddQtyPrimers + ''' + ''' The error out + ''' + Dim _errOut as string + ''' + ''' The primer identifier + ''' + Public PrimerId As Long + ''' + ''' From view + ''' + Public FromView As Boolean - Dim NQty As Long = CQty + UQty - Dim NPrice As Double = (CQty * CPPI) + UPrice - Dim NPPI As Double = PricePerItem(NQty, NPrice) - Dim SQL As String = "" - Dim Obj As New BSDatabase - If CPPI = UPPI Then - SQL = "UPDATE General_Primer set QTY=" & NQty & ", Price=" & NPrice & " where ID=" & pID - ElseIf UPrice = 0 And UQty = 0 Then - SQL = "UPDATE General_Primer set QTY=0, Price=0, eppp=0 where ID=" & pID - Else - SQL = "UPDATE General_Primer set QTY=" & NQty & ", Price=" & NPrice & ", eppp=" & NPPI & " where ID=" & PID - End If - Obj.ConnExec(SQL) - Catch ex As Exception - Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub - Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click - Try - Call SaveData() - If FromView Then Call frmView_List_Primer.LoadData() - Me.Close() - Catch ex As Exception - Call LogError(Me.Name, "btnUpdate.Click", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmAddQtyPrimers_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call LoadData() - End Sub - Private Sub btnViewCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnViewCalc.Click - txtUPPI.Text = PricePerItem(CLng(GeneralHelpers.FluffContent(CDbl(txtUQty.Text), 0)), - CDbl(GeneralHelpers.FluffContent(CDbl(txtUPrice.Text), 0))) - End Sub -End Class \ No newline at end of file + 'Function PricePerItem(ByVal lQty As Long, ByVal dPrice As Double) As Double + ' Dim dAns As Double = 0 + ' Dim ObjIM As New InventoryMath + ' If lQty > 0 Then + ' dAns = dPrice / lQty + ' End If + ' Converters.ConvertToDollars(dAns) + ' Return dAns + 'End Function + ''' + ''' Loads the data. + ''' + Sub LoadData() + Try + Dim lst As List(Of PrimerListings) = PrimerInventory.GetDetails(DatabasePath, PrimerId, _errOut) + If _errOut.Length > 0 then Throw New Exception(_errOut) + For Each o As PrimerListings In lst + txtCQty.Text = o.Qty + txtCPPI.Text = o.PricePerPrimer + txtCPrice.Text = Converters.ConvertToDollars(o.Price) + Next + 'Dim Obj As New BSDatabase + 'Call Obj.ConnectDB() + 'Dim SQL As String = "SELECT * from General_Primer where ID=" & PrimerId + 'Dim CMD As New OdbcCommand(SQL, Obj.Conn) + 'Dim RS As OdbcDataReader + 'RS = CMD.ExecuteReader + 'Dim iQty As Integer = 0 + 'Dim eppo As Double = 0 + 'Dim dPrice As Double = 0 + 'While RS.Read + ' If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") + ' If Not IsDBNull(RS("Qty")) Then iQty = RS("Qty") + ' If Not IsDBNull(RS("eppp")) Then eppo = RS("eppp") + ' txtCQty.Text = iQty + ' txtCPPI.Text = eppo + ' Dim ObjIM As New InventoryMath + ' txtCPrice.Text = Converters.ConvertToDollars(dPrice) + 'End While + 'RS.Close() + 'RS = Nothing + 'CMD = Nothing + 'Obj.CloseDB() + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Saves the data. + ''' + Sub SaveData() + Try + Dim currentQty As Long = GeneralHelpers.FluffContent(CLng(txtCQty.Text), 0) + Dim currentPrice As Double = GeneralHelpers.FluffContent(CDbl(txtCPrice.Text), 0) + Dim currentPricePerItem As Double = GeneralHelpers.FluffContent(CDbl(txtCPPI.Text), 0) + Dim newQty As Long = GeneralHelpers.FluffContent(CLng(txtUQty.Text), 0) + Dim newPrice As Double = GeneralHelpers.FluffContent(CDbl(txtUPrice.Text), 0) + 'Dim UPPI As Double = PricePerItem(newQty, newPrice) + 'txtUPPI.Text = UPPI + If Not GeneralHelpers.IsRequired(newQty, "Update Qty", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(newPrice, "Update Price", Text) Then Exit Sub + If Not PrimerInventory.UpdateQty(DatabasePath, PrimerID, currentQty, currentPrice, currentPricePerItem, + newQty, newPrice, _errOut) Then throw new Exception(_errOut) + 'Dim NQty As Long = currentQty + newQty + 'Dim NPrice As Double = (currentQty * currentPricePerItem) + newPrice + 'Dim NPPI As Double = PricePerItem(NQty, NPrice) + 'Dim SQL As String = "" + 'Dim Obj As New BSDatabase + 'If currentPricePerItem = UPPI Then + ' SQL = "UPDATE General_Primer set QTY=" & NQty & ", Price=" & NPrice & " where ID=" & PrimerId + 'ElseIf newPrice = 0 And newQty = 0 Then + ' SQL = "UPDATE General_Primer set QTY=0, Price=0, eppp=0 where ID=" & PrimerId + 'Else + ' SQL = "UPDATE General_Primer set QTY=" & NQty & ", Price=" & NPrice & ", eppp=" & NPPI & " where ID=" & PrimerId + 'End If + 'Obj.ConnExec(SQL) + Catch ex As Exception + Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnUpdate control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdate.Click + Try + Call SaveData() + If FromView Then Call FrmViewListPrimer.LoadData() + Close() + Catch ex As Exception + Call LogError(Name, "btnUpdate.Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmAddQtyPrimers control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmAddQtyPrimers_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call LoadData() + End Sub + ''' + ''' Handles the Click event of the btnViewCalc control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnViewCalc_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnViewCalc.Click + try + 'txtUPPI.Text = PricePerItem(CLng(GeneralHelpers.FluffContent(CDbl(txtUQty.Text), 0)), + ' CDbl(GeneralHelpers.FluffContent(CDbl(txtUPrice.Text), 0))) + txtUPPI.Text = PrimerInventory.CalculatePricePerItem(CLng(GeneralHelpers.FluffContent(CDbl(txtUQty.Text), 0)), + CDbl(GeneralHelpers.FluffContent(CDbl(txtUPrice.Text), 0))) + Catch ex As Exception + Call LogError(Name, "btnViewCalc_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddQtyShellcase.Designer.vb b/BSMyLoadersLog/Adding/frmAddQtyShellcase.Designer.vb index fd10595..78a3b19 100644 --- a/BSMyLoadersLog/Adding/frmAddQtyShellcase.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddQtyShellcase.Designer.vb @@ -1,256 +1,258 @@ - _ -Partial Class frmAddQtyShellcase - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddQtyShellcase + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddQtyShellcase)) - Me.btnCancel = New System.Windows.Forms.Button - Me.btnUpdate = New System.Windows.Forms.Button - Me.GroupBox2 = New System.Windows.Forms.GroupBox - Me.btnViewCalc = New System.Windows.Forms.Button - Me.txtUPrice = New System.Windows.Forms.TextBox - Me.txtUQty = New System.Windows.Forms.TextBox - Me.txtUPPI = New System.Windows.Forms.TextBox - Me.Label4 = New System.Windows.Forms.Label - Me.Label5 = New System.Windows.Forms.Label - Me.Label6 = New System.Windows.Forms.Label - Me.GroupBox1 = New System.Windows.Forms.GroupBox - Me.txtCPrice = New System.Windows.Forms.TextBox - Me.txtCQty = New System.Windows.Forms.TextBox - Me.txtCPPI = New System.Windows.Forms.TextBox - Me.Label3 = New System.Windows.Forms.Label - Me.Label2 = New System.Windows.Forms.Label - Me.Label1 = New System.Windows.Forms.Label - Me.GroupBox2.SuspendLayout() - Me.GroupBox1.SuspendLayout() - Me.SuspendLayout() - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(130, 226) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 13 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'btnUpdate - ' - Me.btnUpdate.Location = New System.Drawing.Point(13, 226) - Me.btnUpdate.Name = "btnUpdate" - Me.btnUpdate.Size = New System.Drawing.Size(75, 23) - Me.btnUpdate.TabIndex = 12 - Me.btnUpdate.Text = "Update" - Me.btnUpdate.UseVisualStyleBackColor = True - ' - 'GroupBox2 - ' - Me.GroupBox2.Controls.Add(Me.btnViewCalc) - Me.GroupBox2.Controls.Add(Me.txtUPrice) - Me.GroupBox2.Controls.Add(Me.txtUQty) - Me.GroupBox2.Controls.Add(Me.txtUPPI) - Me.GroupBox2.Controls.Add(Me.Label4) - Me.GroupBox2.Controls.Add(Me.Label5) - Me.GroupBox2.Controls.Add(Me.Label6) - Me.GroupBox2.Location = New System.Drawing.Point(2, 100) - Me.GroupBox2.Name = "GroupBox2" - Me.GroupBox2.Size = New System.Drawing.Size(217, 120) - Me.GroupBox2.TabIndex = 11 - Me.GroupBox2.TabStop = False - Me.GroupBox2.Text = "Update Status" - ' - 'btnViewCalc - ' - Me.btnViewCalc.Location = New System.Drawing.Point(53, 88) - Me.btnViewCalc.Name = "btnViewCalc" - Me.btnViewCalc.Size = New System.Drawing.Size(110, 26) - Me.btnViewCalc.TabIndex = 3 - Me.btnViewCalc.Text = "View Calculation" - Me.btnViewCalc.UseVisualStyleBackColor = True - ' - 'txtUPrice - ' - Me.txtUPrice.Location = New System.Drawing.Point(96, 40) - Me.txtUPrice.Name = "txtUPrice" - Me.txtUPrice.Size = New System.Drawing.Size(107, 20) - Me.txtUPrice.TabIndex = 2 - Me.txtUPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtUQty - ' - Me.txtUQty.Location = New System.Drawing.Point(96, 18) - Me.txtUQty.Name = "txtUQty" - Me.txtUQty.Size = New System.Drawing.Size(107, 20) - Me.txtUQty.TabIndex = 1 - Me.txtUQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtUPPI - ' - Me.txtUPPI.Enabled = False - Me.txtUPPI.Location = New System.Drawing.Point(96, 62) - Me.txtUPPI.Name = "txtUPPI" - Me.txtUPPI.ReadOnly = True - Me.txtUPPI.Size = New System.Drawing.Size(107, 20) - Me.txtUPPI.TabIndex = 9 - Me.txtUPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(14, 65) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(76, 13) - Me.Label4.TabIndex = 8 - Me.Label4.Text = "Price Per Item:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(15, 43) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(34, 13) - Me.Label5.TabIndex = 7 - Me.Label5.Text = "Price:" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(15, 21) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(26, 13) - Me.Label6.TabIndex = 6 - Me.Label6.Text = "Qty:" - ' - 'GroupBox1 - ' - Me.GroupBox1.Controls.Add(Me.txtCPrice) - Me.GroupBox1.Controls.Add(Me.txtCQty) - Me.GroupBox1.Controls.Add(Me.txtCPPI) - Me.GroupBox1.Controls.Add(Me.Label3) - Me.GroupBox1.Controls.Add(Me.Label2) - Me.GroupBox1.Controls.Add(Me.Label1) - Me.GroupBox1.Location = New System.Drawing.Point(2, 3) - Me.GroupBox1.Name = "GroupBox1" - Me.GroupBox1.Size = New System.Drawing.Size(217, 91) - Me.GroupBox1.TabIndex = 10 - Me.GroupBox1.TabStop = False - Me.GroupBox1.Text = "Current Status" - ' - 'txtCPrice - ' - Me.txtCPrice.Enabled = False - Me.txtCPrice.Location = New System.Drawing.Point(91, 39) - Me.txtCPrice.Name = "txtCPrice" - Me.txtCPrice.ReadOnly = True - Me.txtCPrice.Size = New System.Drawing.Size(107, 20) - Me.txtCPrice.TabIndex = 5 - Me.txtCPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtCQty - ' - Me.txtCQty.Enabled = False - Me.txtCQty.Location = New System.Drawing.Point(91, 17) - Me.txtCQty.Name = "txtCQty" - Me.txtCQty.ReadOnly = True - Me.txtCQty.Size = New System.Drawing.Size(107, 20) - Me.txtCQty.TabIndex = 4 - Me.txtCQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtCPPI - ' - Me.txtCPPI.Enabled = False - Me.txtCPPI.Location = New System.Drawing.Point(91, 61) - Me.txtCPPI.Name = "txtCPPI" - Me.txtCPPI.ReadOnly = True - Me.txtCPPI.Size = New System.Drawing.Size(107, 20) - Me.txtCPPI.TabIndex = 3 - Me.txtCPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(9, 64) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(76, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Price Per Item:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(10, 42) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(34, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Price:" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(10, 20) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(26, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Qty:" - ' - 'frmAddQtyShellcase - ' - Me.AcceptButton = Me.btnUpdate - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(225, 257) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnUpdate) - Me.Controls.Add(Me.GroupBox2) - Me.Controls.Add(Me.GroupBox1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmAddQtyShellcase" - Me.Text = "Update Shell Case Qty" - Me.GroupBox2.ResumeLayout(False) - Me.GroupBox2.PerformLayout() - Me.GroupBox1.ResumeLayout(False) - Me.GroupBox1.PerformLayout() - Me.ResumeLayout(False) + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddQtyShellcase)) + Me.btnCancel = New System.Windows.Forms.Button + Me.btnUpdate = New System.Windows.Forms.Button + Me.GroupBox2 = New System.Windows.Forms.GroupBox + Me.btnViewCalc = New System.Windows.Forms.Button + Me.txtUPrice = New System.Windows.Forms.TextBox + Me.txtUQty = New System.Windows.Forms.TextBox + Me.txtUPPI = New System.Windows.Forms.TextBox + Me.Label4 = New System.Windows.Forms.Label + Me.Label5 = New System.Windows.Forms.Label + Me.Label6 = New System.Windows.Forms.Label + Me.GroupBox1 = New System.Windows.Forms.GroupBox + Me.txtCPrice = New System.Windows.Forms.TextBox + Me.txtCQty = New System.Windows.Forms.TextBox + Me.txtCPPI = New System.Windows.Forms.TextBox + Me.Label3 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label1 = New System.Windows.Forms.Label + Me.GroupBox2.SuspendLayout() + Me.GroupBox1.SuspendLayout() + Me.SuspendLayout() + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(130, 226) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 13 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'btnUpdate + ' + Me.btnUpdate.Location = New System.Drawing.Point(13, 226) + Me.btnUpdate.Name = "btnUpdate" + Me.btnUpdate.Size = New System.Drawing.Size(75, 23) + Me.btnUpdate.TabIndex = 12 + Me.btnUpdate.Text = "Update" + Me.btnUpdate.UseVisualStyleBackColor = True + ' + 'GroupBox2 + ' + Me.GroupBox2.Controls.Add(Me.btnViewCalc) + Me.GroupBox2.Controls.Add(Me.txtUPrice) + Me.GroupBox2.Controls.Add(Me.txtUQty) + Me.GroupBox2.Controls.Add(Me.txtUPPI) + Me.GroupBox2.Controls.Add(Me.Label4) + Me.GroupBox2.Controls.Add(Me.Label5) + Me.GroupBox2.Controls.Add(Me.Label6) + Me.GroupBox2.Location = New System.Drawing.Point(2, 100) + Me.GroupBox2.Name = "GroupBox2" + Me.GroupBox2.Size = New System.Drawing.Size(217, 120) + Me.GroupBox2.TabIndex = 11 + Me.GroupBox2.TabStop = False + Me.GroupBox2.Text = "Update Status" + ' + 'btnViewCalc + ' + Me.btnViewCalc.Location = New System.Drawing.Point(53, 88) + Me.btnViewCalc.Name = "btnViewCalc" + Me.btnViewCalc.Size = New System.Drawing.Size(110, 26) + Me.btnViewCalc.TabIndex = 3 + Me.btnViewCalc.Text = "View Calculation" + Me.btnViewCalc.UseVisualStyleBackColor = True + ' + 'txtUPrice + ' + Me.txtUPrice.Location = New System.Drawing.Point(96, 40) + Me.txtUPrice.Name = "txtUPrice" + Me.txtUPrice.Size = New System.Drawing.Size(107, 20) + Me.txtUPrice.TabIndex = 2 + Me.txtUPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtUQty + ' + Me.txtUQty.Location = New System.Drawing.Point(96, 18) + Me.txtUQty.Name = "txtUQty" + Me.txtUQty.Size = New System.Drawing.Size(107, 20) + Me.txtUQty.TabIndex = 1 + Me.txtUQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtUPPI + ' + Me.txtUPPI.Enabled = False + Me.txtUPPI.Location = New System.Drawing.Point(96, 62) + Me.txtUPPI.Name = "txtUPPI" + Me.txtUPPI.ReadOnly = True + Me.txtUPPI.Size = New System.Drawing.Size(107, 20) + Me.txtUPPI.TabIndex = 9 + Me.txtUPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(14, 65) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(76, 13) + Me.Label4.TabIndex = 8 + Me.Label4.Text = "Price Per Item:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(15, 43) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(34, 13) + Me.Label5.TabIndex = 7 + Me.Label5.Text = "Price:" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(15, 21) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(26, 13) + Me.Label6.TabIndex = 6 + Me.Label6.Text = "Qty:" + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.txtCPrice) + Me.GroupBox1.Controls.Add(Me.txtCQty) + Me.GroupBox1.Controls.Add(Me.txtCPPI) + Me.GroupBox1.Controls.Add(Me.Label3) + Me.GroupBox1.Controls.Add(Me.Label2) + Me.GroupBox1.Controls.Add(Me.Label1) + Me.GroupBox1.Location = New System.Drawing.Point(2, 3) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(217, 91) + Me.GroupBox1.TabIndex = 10 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "Current Status" + ' + 'txtCPrice + ' + Me.txtCPrice.Enabled = False + Me.txtCPrice.Location = New System.Drawing.Point(91, 39) + Me.txtCPrice.Name = "txtCPrice" + Me.txtCPrice.ReadOnly = True + Me.txtCPrice.Size = New System.Drawing.Size(107, 20) + Me.txtCPrice.TabIndex = 5 + Me.txtCPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtCQty + ' + Me.txtCQty.Enabled = False + Me.txtCQty.Location = New System.Drawing.Point(91, 17) + Me.txtCQty.Name = "txtCQty" + Me.txtCQty.ReadOnly = True + Me.txtCQty.Size = New System.Drawing.Size(107, 20) + Me.txtCQty.TabIndex = 4 + Me.txtCQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtCPPI + ' + Me.txtCPPI.Enabled = False + Me.txtCPPI.Location = New System.Drawing.Point(91, 61) + Me.txtCPPI.Name = "txtCPPI" + Me.txtCPPI.ReadOnly = True + Me.txtCPPI.Size = New System.Drawing.Size(107, 20) + Me.txtCPPI.TabIndex = 3 + Me.txtCPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(9, 64) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(76, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Price Per Item:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(10, 42) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(34, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Price:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(10, 20) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(26, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Qty:" + ' + 'frmAddQtyShellcase + ' + Me.AcceptButton = Me.btnUpdate + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(225, 257) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnUpdate) + Me.Controls.Add(Me.GroupBox2) + Me.Controls.Add(Me.GroupBox1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmAddQtyShellcase" + Me.Text = "Update Shell Case Qty" + Me.GroupBox2.ResumeLayout(False) + Me.GroupBox2.PerformLayout() + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() + Me.ResumeLayout(False) - End Sub - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents btnUpdate As System.Windows.Forms.Button - Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox - Friend WithEvents btnViewCalc As System.Windows.Forms.Button - Friend WithEvents txtUPrice As System.Windows.Forms.TextBox - Friend WithEvents txtUQty As System.Windows.Forms.TextBox - Friend WithEvents txtUPPI As System.Windows.Forms.TextBox - 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 GroupBox1 As System.Windows.Forms.GroupBox - Friend WithEvents txtCPrice As System.Windows.Forms.TextBox - Friend WithEvents txtCQty As System.Windows.Forms.TextBox - Friend WithEvents txtCPPI As System.Windows.Forms.TextBox - Friend WithEvents Label3 As System.Windows.Forms.Label - Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents Label1 As System.Windows.Forms.Label -End Class + End Sub + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents btnUpdate As System.Windows.Forms.Button + Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox + Friend WithEvents btnViewCalc As System.Windows.Forms.Button + Friend WithEvents txtUPrice As System.Windows.Forms.TextBox + Friend WithEvents txtUQty As System.Windows.Forms.TextBox + Friend WithEvents txtUPPI As System.Windows.Forms.TextBox + 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 GroupBox1 As System.Windows.Forms.GroupBox + Friend WithEvents txtCPrice As System.Windows.Forms.TextBox + Friend WithEvents txtCQty As System.Windows.Forms.TextBox + Friend WithEvents txtCPPI As System.Windows.Forms.TextBox + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label1 As System.Windows.Forms.Label + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddQtyShellcase.vb b/BSMyLoadersLog/Adding/frmAddQtyShellcase.vb index a1f5d39..0f054fe 100644 --- a/BSMyLoadersLog/Adding/frmAddQtyShellcase.vb +++ b/BSMyLoadersLog/Adding/frmAddQtyShellcase.vb @@ -1,95 +1,162 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc +'Imports BSMyLoadersLog.LoadersClass +'Imports System.Data.Odbc Imports BSMyLoadersLog.Viewing Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory +Imports BurnSoft.Applications.MLL.Types -Public Class frmAddQtyShellcase - Public SID As Long - Public FromView As Boolean - Function PricePerItem(ByVal lQty As Long, ByVal dPrice As Double) As Double - Dim dAns As Double = 0 - Dim ObjIM As New InventoryMath - If lQty > 0 Then - dAns = dPrice / lQty - End If - ObjIM.ConvertToDollars(dAns) - Return dAns - End Function - Sub LoadData() - Try - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim SQL As String = "SELECT * from List_Case where ID=" & SID - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - Dim TimesUsed As Long = 0 - Dim iQty As Integer = 0 - Dim eppo As Double = 0 - Dim dPrice As Double = 0 - While RS.Read - If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") - If Not IsDBNull(RS("Qty")) Then iQty = RS("Qty") - If Not IsDBNull(RS("ePPC")) Then eppo = RS("ePPC") - txtCQty.Text = iQty - txtCPPI.Text = eppo - Dim ObjIM As New InventoryMath - txtCPrice.Text = ObjIM.ConvertToDollars(dPrice) - End While - RS.Close() - RS = Nothing - CMD = Nothing - Call Obj.CloseDB() - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub SaveData() - Try - Dim CQty As Long = CLng(GeneralHelpers.FluffContent(txtCQty.Text, 0)) - Dim CPrice As Double = CDbl(GeneralHelpers.FluffContent(txtCPrice.Text, 0)) - Dim CPPI As Double = CDbl(GeneralHelpers.FluffContent(txtCPPI.Text, 0)) - Dim UQty As Long = CLng(GeneralHelpers.FluffContent(txtUQty.Text, 0)) - Dim UPrice As Double = CDbl(GeneralHelpers.FluffContent(txtUPrice.Text, 0)) - Dim UPPI As Double = PricePerItem(UQty, UPrice) - txtUPPI.Text = UPPI - If Not GeneralHelpers.IsRequired(UQty, "Update Qty", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(UPrice, "Update Price", Me.Text) Then Exit Sub +Namespace Adding - Dim NQty As Long = CQty + UQty - Dim NPrice As Double = (CQty * CPPI) + UPrice - Dim NPPI As Double = PricePerItem(NQty, NPrice) - Dim SQL As String = "" - Dim Obj As New BSDatabase - If CPPI = UPPI Then - SQL = "UPDATE List_Case set QTY=" & NQty & ", Price=" & NPrice & " where ID=" & SID - ElseIf UPrice = 0 And UQty = 0 Then - SQL = "UPDATE List_Case set QTY=0, Price=0, eppc=0 where ID=" & SID - Else - SQL = "UPDATE List_Case set QTY=" & NQty & ", Price=" & NPrice & ", eppc=" & NPPI & " where ID=" & SID - End If - Obj.ConnExec(SQL) - Catch ex As Exception - Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub btnViewCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnViewCalc.Click - txtUPPI.Text = PricePerItem(CLng(GeneralHelpers.FluffContent(txtUQty.Text, 0)), - CDbl(GeneralHelpers.FluffContent(txtUPrice.Text, 0))) - End Sub - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub - Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click - Try - Call SaveData() - If FromView Then Call FrmViewListShells.LoadData() - Me.Close() - Catch ex As Exception - Call LogError(Me.Name, "btnUpdate.Click", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmAddQtyShellcase_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call LoadData() - End Sub -End Class \ No newline at end of file + ''' + ''' Class frmAddQtyShellcase. + ''' Implements the + ''' + ''' + Public Class FrmAddQtyShellcase + ' TODO: #20 clean up code + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' The case identifier + ''' + Public CaseId As Long + ''' + ''' From view + ''' + Public FromView As Boolean + 'Function PricePerItem(ByVal lQty As Long, ByVal dPrice As Double) As Double + ' Dim dAns As Double = 0 + ' Dim ObjIM As New InventoryMath + ' If lQty > 0 Then + ' dAns = dPrice / lQty + ' End If + ' Converters.ConvertToDollars(dAns) + ' Return dAns + 'End Function + ''' + ''' Loads the data. + ''' + Sub LoadData() + Try + Dim lst As List(Of CaseListings) = CaseInventory.GetDetails(DatabasePath, CaseId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As CaseListings In lst + txtCQty.Text = o.Qty + txtCPrice.Text = Converters.ConvertToDollars(o.Price) + txtCPPI.Text = Converters.ConvertToDollars(o.EstimatedPricePerCase) + Next + 'Dim Obj As New BSDatabase + 'Call Obj.ConnectDB() + 'Dim SQL As String = "SELECT * from List_Case where ID=" & CaseId + 'Dim CMD As New OdbcCommand(SQL, Obj.Conn) + 'Dim RS As OdbcDataReader + 'RS = CMD.ExecuteReader + 'Dim TimesUsed As Long = 0 + 'Dim iQty As Integer = 0 + 'Dim eppo As Double = 0 + 'Dim dPrice As Double = 0 + 'While RS.Read + ' If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") + ' If Not IsDBNull(RS("Qty")) Then iQty = RS("Qty") + ' If Not IsDBNull(RS("ePPC")) Then eppo = RS("ePPC") + ' txtCQty.Text = iQty + ' txtCPPI.Text = eppo + ' Dim ObjIM As New InventoryMath + ' txtCPrice.Text = Converters.ConvertToDollars(dPrice) + 'End While + 'RS.Close() + 'RS = Nothing + 'CMD = Nothing + 'Call Obj.CloseDB() + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Saves the data. + ''' + Sub SaveData() + Try + Dim currentQty As Long = CLng(GeneralHelpers.FluffContent(txtCQty.Text, 0)) + Dim currentPrice As Double = CDbl(GeneralHelpers.FluffContent(txtCPrice.Text, 0)) + Dim currentPricePerItem As Double = CDbl(GeneralHelpers.FluffContent(txtCPPI.Text, 0)) + Dim newQty As Long = CLng(GeneralHelpers.FluffContent(txtUQty.Text, 0)) + Dim newPrice As Double = CDbl(GeneralHelpers.FluffContent(txtUPrice.Text, 0)) + 'Dim UPPI As Double = PricePerItem(newQty, newPrice) + 'txtUPPI.Text = UPPI + If Not GeneralHelpers.IsRequired(newQty, "Update Qty", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(newPrice, "Update Price", Text) Then Exit Sub + + If Not CaseInventory.UpdateQty(DatabasePath, CaseId, currentQty, currentPrice, + currentPricePerItem, newQty, newPrice, + _errOut) Then Throw New Exception(_errOut) + + 'Dim NQty As Long = currentQty + newQty + 'Dim NPrice As Double = (currentQty * currentPricePerItem) + newPrice + 'Dim NPPI As Double = PricePerItem(NQty, NPrice) + 'Dim SQL As String = "" + 'Dim Obj As New BSDatabase + 'If currentPricePerItem = UPPI Then + ' SQL = "UPDATE List_Case set QTY=" & NQty & ", Price=" & NPrice & " where ID=" & CaseId + 'ElseIf newPrice = 0 And newQty = 0 Then + ' SQL = "UPDATE List_Case set QTY=0, Price=0, eppc=0 where ID=" & CaseId + 'Else + ' SQL = "UPDATE List_Case set QTY=" & NQty & ", Price=" & NPrice & ", eppc=" & NPPI & " where ID=" & CaseId + 'End If + 'Obj.ConnExec(SQL) + Catch ex As Exception + Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the btnViewCalc control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnViewCalc_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnViewCalc.Click + 'txtUPPI.Text = PricePerItem(CLng(GeneralHelpers.FluffContent(txtUQty.Text, 0)), + ' CDbl(GeneralHelpers.FluffContent(txtUPrice.Text, 0))) + Try + If CLng(GeneralHelpers.FluffContent(txtUQty.Text, 0)) > 0 Then + txtUPPI.Text = Converters.ConvertToDollars( + CDbl(GeneralHelpers.FluffContent(txtUPrice.Text, 0)) / + CLng(GeneralHelpers.FluffContent(txtUQty.Text, 0))) + End If + Catch ex As Exception + Call LogError(Name, "btnViewCalc_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnUpdate control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdate.Click + Try + Call SaveData() + If FromView Then Call FrmViewListShells.LoadData() + Close() + Catch ex As Exception + Call LogError(Name, "btnUpdate.Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmAddQtyShellcase control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmAddQtyShellcase_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call LoadData() + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddQtyShot.Designer.vb b/BSMyLoadersLog/Adding/frmAddQtyShot.Designer.vb index 58c4e7d..d0c43d0 100644 --- a/BSMyLoadersLog/Adding/frmAddQtyShot.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddQtyShot.Designer.vb @@ -1,194 +1,196 @@ - _ -Partial Class frmAddQtyShot - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddQtyShot + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddQtyShot)) - Me.btnCancel = New System.Windows.Forms.Button - Me.btnUpdate = New System.Windows.Forms.Button - Me.GroupBox2 = New System.Windows.Forms.GroupBox - Me.txtUPrice = New System.Windows.Forms.TextBox - Me.txtUQty = New System.Windows.Forms.TextBox - Me.Label5 = New System.Windows.Forms.Label - Me.Label6 = New System.Windows.Forms.Label - Me.GroupBox1 = New System.Windows.Forms.GroupBox - Me.txtCPrice = New System.Windows.Forms.TextBox - Me.txtCQty = New System.Windows.Forms.TextBox - Me.Label2 = New System.Windows.Forms.Label - Me.Label1 = New System.Windows.Forms.Label - Me.GroupBox2.SuspendLayout() - Me.GroupBox1.SuspendLayout() - Me.SuspendLayout() - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(131, 160) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 17 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'btnUpdate - ' - Me.btnUpdate.Location = New System.Drawing.Point(16, 160) - Me.btnUpdate.Name = "btnUpdate" - Me.btnUpdate.Size = New System.Drawing.Size(75, 23) - Me.btnUpdate.TabIndex = 16 - Me.btnUpdate.Text = "Update" - Me.btnUpdate.UseVisualStyleBackColor = True - ' - 'GroupBox2 - ' - Me.GroupBox2.Controls.Add(Me.txtUPrice) - Me.GroupBox2.Controls.Add(Me.txtUQty) - Me.GroupBox2.Controls.Add(Me.Label5) - Me.GroupBox2.Controls.Add(Me.Label6) - Me.GroupBox2.Location = New System.Drawing.Point(3, 81) - Me.GroupBox2.Name = "GroupBox2" - Me.GroupBox2.Size = New System.Drawing.Size(217, 73) - Me.GroupBox2.TabIndex = 15 - Me.GroupBox2.TabStop = False - Me.GroupBox2.Text = "Update Status" - ' - 'txtUPrice - ' - Me.txtUPrice.Location = New System.Drawing.Point(96, 40) - Me.txtUPrice.Name = "txtUPrice" - Me.txtUPrice.Size = New System.Drawing.Size(107, 20) - Me.txtUPrice.TabIndex = 2 - Me.txtUPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtUQty - ' - Me.txtUQty.Location = New System.Drawing.Point(96, 18) - Me.txtUQty.Name = "txtUQty" - Me.txtUQty.Size = New System.Drawing.Size(107, 20) - Me.txtUQty.TabIndex = 1 - Me.txtUQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(15, 43) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(34, 13) - Me.Label5.TabIndex = 7 - Me.Label5.Text = "Price:" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(15, 21) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(66, 13) - Me.Label6.TabIndex = 6 - Me.Label6.Text = "Weight (lbs):" - ' - 'GroupBox1 - ' - Me.GroupBox1.Controls.Add(Me.txtCPrice) - Me.GroupBox1.Controls.Add(Me.txtCQty) - Me.GroupBox1.Controls.Add(Me.Label2) - Me.GroupBox1.Controls.Add(Me.Label1) - Me.GroupBox1.Location = New System.Drawing.Point(3, 3) - Me.GroupBox1.Name = "GroupBox1" - Me.GroupBox1.Size = New System.Drawing.Size(217, 72) - Me.GroupBox1.TabIndex = 14 - Me.GroupBox1.TabStop = False - Me.GroupBox1.Text = "Current Status" - ' - 'txtCPrice - ' - Me.txtCPrice.Enabled = False - Me.txtCPrice.Location = New System.Drawing.Point(91, 39) - Me.txtCPrice.Name = "txtCPrice" - Me.txtCPrice.ReadOnly = True - Me.txtCPrice.Size = New System.Drawing.Size(107, 20) - Me.txtCPrice.TabIndex = 5 - Me.txtCPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtCQty - ' - Me.txtCQty.Enabled = False - Me.txtCQty.Location = New System.Drawing.Point(91, 17) - Me.txtCQty.Name = "txtCQty" - Me.txtCQty.ReadOnly = True - Me.txtCQty.Size = New System.Drawing.Size(107, 20) - Me.txtCQty.TabIndex = 4 - Me.txtCQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(10, 42) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(34, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Price:" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(10, 20) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(66, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Weight (lbs):" - ' - 'frmAddQtyShot - ' - Me.AcceptButton = Me.btnUpdate - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(223, 192) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnUpdate) - Me.Controls.Add(Me.GroupBox2) - Me.Controls.Add(Me.GroupBox1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmAddQtyShot" - Me.Text = "Update Shot Qty." - Me.GroupBox2.ResumeLayout(False) - Me.GroupBox2.PerformLayout() - Me.GroupBox1.ResumeLayout(False) - Me.GroupBox1.PerformLayout() - Me.ResumeLayout(False) + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddQtyShot)) + Me.btnCancel = New System.Windows.Forms.Button + Me.btnUpdate = New System.Windows.Forms.Button + Me.GroupBox2 = New System.Windows.Forms.GroupBox + Me.txtUPrice = New System.Windows.Forms.TextBox + Me.txtUQty = New System.Windows.Forms.TextBox + Me.Label5 = New System.Windows.Forms.Label + Me.Label6 = New System.Windows.Forms.Label + Me.GroupBox1 = New System.Windows.Forms.GroupBox + Me.txtCPrice = New System.Windows.Forms.TextBox + Me.txtCQty = New System.Windows.Forms.TextBox + Me.Label2 = New System.Windows.Forms.Label + Me.Label1 = New System.Windows.Forms.Label + Me.GroupBox2.SuspendLayout() + Me.GroupBox1.SuspendLayout() + Me.SuspendLayout() + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(131, 160) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 17 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'btnUpdate + ' + Me.btnUpdate.Location = New System.Drawing.Point(16, 160) + Me.btnUpdate.Name = "btnUpdate" + Me.btnUpdate.Size = New System.Drawing.Size(75, 23) + Me.btnUpdate.TabIndex = 16 + Me.btnUpdate.Text = "Update" + Me.btnUpdate.UseVisualStyleBackColor = True + ' + 'GroupBox2 + ' + Me.GroupBox2.Controls.Add(Me.txtUPrice) + Me.GroupBox2.Controls.Add(Me.txtUQty) + Me.GroupBox2.Controls.Add(Me.Label5) + Me.GroupBox2.Controls.Add(Me.Label6) + Me.GroupBox2.Location = New System.Drawing.Point(3, 81) + Me.GroupBox2.Name = "GroupBox2" + Me.GroupBox2.Size = New System.Drawing.Size(217, 73) + Me.GroupBox2.TabIndex = 15 + Me.GroupBox2.TabStop = False + Me.GroupBox2.Text = "Update Status" + ' + 'txtUPrice + ' + Me.txtUPrice.Location = New System.Drawing.Point(96, 40) + Me.txtUPrice.Name = "txtUPrice" + Me.txtUPrice.Size = New System.Drawing.Size(107, 20) + Me.txtUPrice.TabIndex = 2 + Me.txtUPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtUQty + ' + Me.txtUQty.Location = New System.Drawing.Point(96, 18) + Me.txtUQty.Name = "txtUQty" + Me.txtUQty.Size = New System.Drawing.Size(107, 20) + Me.txtUQty.TabIndex = 1 + Me.txtUQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(15, 43) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(34, 13) + Me.Label5.TabIndex = 7 + Me.Label5.Text = "Price:" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(15, 21) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(66, 13) + Me.Label6.TabIndex = 6 + Me.Label6.Text = "Weight (lbs):" + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.txtCPrice) + Me.GroupBox1.Controls.Add(Me.txtCQty) + Me.GroupBox1.Controls.Add(Me.Label2) + Me.GroupBox1.Controls.Add(Me.Label1) + Me.GroupBox1.Location = New System.Drawing.Point(3, 3) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(217, 72) + Me.GroupBox1.TabIndex = 14 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "Current Status" + ' + 'txtCPrice + ' + Me.txtCPrice.Enabled = False + Me.txtCPrice.Location = New System.Drawing.Point(91, 39) + Me.txtCPrice.Name = "txtCPrice" + Me.txtCPrice.ReadOnly = True + Me.txtCPrice.Size = New System.Drawing.Size(107, 20) + Me.txtCPrice.TabIndex = 5 + Me.txtCPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtCQty + ' + Me.txtCQty.Enabled = False + Me.txtCQty.Location = New System.Drawing.Point(91, 17) + Me.txtCQty.Name = "txtCQty" + Me.txtCQty.ReadOnly = True + Me.txtCQty.Size = New System.Drawing.Size(107, 20) + Me.txtCQty.TabIndex = 4 + Me.txtCQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(10, 42) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(34, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Price:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(10, 20) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(66, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Weight (lbs):" + ' + 'frmAddQtyShot + ' + Me.AcceptButton = Me.btnUpdate + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(223, 192) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnUpdate) + Me.Controls.Add(Me.GroupBox2) + Me.Controls.Add(Me.GroupBox1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmAddQtyShot" + Me.Text = "Update Shot Qty." + Me.GroupBox2.ResumeLayout(False) + Me.GroupBox2.PerformLayout() + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() + Me.ResumeLayout(False) - End Sub - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents btnUpdate As System.Windows.Forms.Button - Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox - Friend WithEvents txtUPrice As System.Windows.Forms.TextBox - Friend WithEvents txtUQty As System.Windows.Forms.TextBox - Friend WithEvents Label5 As System.Windows.Forms.Label - Friend WithEvents Label6 As System.Windows.Forms.Label - Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox - Friend WithEvents txtCPrice As System.Windows.Forms.TextBox - Friend WithEvents txtCQty As System.Windows.Forms.TextBox - Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents Label1 As System.Windows.Forms.Label -End Class + End Sub + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents btnUpdate As System.Windows.Forms.Button + Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox + Friend WithEvents txtUPrice As System.Windows.Forms.TextBox + Friend WithEvents txtUQty As System.Windows.Forms.TextBox + Friend WithEvents Label5 As System.Windows.Forms.Label + Friend WithEvents Label6 As System.Windows.Forms.Label + Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox + Friend WithEvents txtCPrice As System.Windows.Forms.TextBox + Friend WithEvents txtCQty As System.Windows.Forms.TextBox + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label1 As System.Windows.Forms.Label + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddQtyShot.vb b/BSMyLoadersLog/Adding/frmAddQtyShot.vb index 70b93d1..ac4d315 100644 --- a/BSMyLoadersLog/Adding/frmAddQtyShot.vb +++ b/BSMyLoadersLog/Adding/frmAddQtyShot.vb @@ -1,77 +1,134 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc +'Imports System.Data.Odbc +'Imports BSMyLoadersLog.LoadersClass +Imports BSMyLoadersLog.Viewing +'Imports BurnSoft.Applications.MLL.Global Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory +Imports BurnSoft.Applications.MLL.Types -Public Class frmAddQtyShot - Public BID As Long - Public FromView As Boolean - Function PricePerItem(ByVal lQty As Long, ByVal dPrice As Double) As Double - Dim dAns As Double = 0 - Dim ObjIM As New InventoryMath - If lQty > 0 Then - dAns = dPrice / lQty - End If - ObjIM.ConvertToDollars(dAns) - Return dAns - End Function - Sub LoadData() - Try - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim SQL As String = "SELECT * from List_SG_ShotType_Details where ID=" & BID - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - Dim TimesUsed As Long = 0 - Dim iQty As Integer = 0 - Dim eppo As Double = 0 - Dim dPrice As Double = 0 - While RS.Read - If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") - If Not IsDBNull(RS("weight")) Then iQty = RS("weight") - txtCQty.Text = iQty - If iQty = 0 Then dPrice = 0 - Dim ObjIM As New InventoryMath - txtCPrice.Text = ObjIM.ConvertToDollars(dPrice) - End While - RS.Close() - RS = Nothing - CMD = Nothing - Call Obj.CloseDB() - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmAddQtyShot_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call LoadData() - End Sub +Namespace Adding - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub - Sub SaveData() - Try - '93.8 pellets per oz - 'BPI Nickel Plated Lead Shot #2 11 lb Box - Dim CQty As Long = CLng(GeneralHelpers.FluffContent(txtCQty.Text, 0)) - Dim CPrice As Double = CDbl(GeneralHelpers.FluffContent(txtCPrice.Text, 0)) - Dim UQty As Long = CDbl(GeneralHelpers.FluffContent(txtUQty.Text, 0)) - Dim UPrice As Double = CDbl(GeneralHelpers.FluffContent(txtUPrice.Text, 0)) - Dim SQL As String = "" - Dim Obj As New BSDatabase - Dim NQty As Long = CQty + UQty - Dim NPrice As Double = CPrice + UPrice - Dim ounces As Double = WeightOz1Lbs * NQty - SQL = "Update List_SG_ShotType_Details set Price=" & NPrice & ", weight='" & NQty & _ - "',ounces=" & ounces & " where ID=" & BID - Obj.ConnExec(SQL) - Catch ex As Exception - Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click - Call SaveData() - If FromView Then Call frmView_List_Shot.LoadData() - Me.Close() - End Sub -End Class \ No newline at end of file + ''' + ''' Class frmAddQtyShot. + ''' Implements the + ''' + ''' + Public Class FrmAddQtyShot + ' TODO: #20 clean up code + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' The shot identifier + ''' + Public ShotId As Long + ''' + ''' From view + ''' + Public FromView As Boolean + ''' + ''' The current price per item + ''' + Dim _currentPricePerItem as Double + 'Function PricePerItem(ByVal lQty As Long, ByVal dPrice As Double) As Double + ' Dim dAns As Double = 0 + ' Dim ObjIM As New InventoryMath + ' If lQty > 0 Then + ' dAns = dPrice / lQty + ' End If + ' Converters.ConvertToDollars(dAns) + ' Return dAns + 'End Function + ''' + ''' Loads the data. + ''' + Sub LoadData() + Try + Dim lst as List(Of ShotgunShotTypeData) = ShotgunShotTypeInventory.GetDetails(DatabasePath, ShotId, _errOut) + if _errOut.Length > 0 then Throw new Exception(_errOut) + For Each o As ShotgunShotTypeData In lst + txtCQty.Text = o.Qty + txtCPrice.Text = Converters.ConvertToDollars(o.Price) + _currentPricePerItem = o.EstimatedPricePerItem + Next + 'Dim Obj As New BSDatabase + 'Call Obj.ConnectDB() + 'Dim SQL As String = "SELECT * from List_SG_ShotType_Details where ID=" & ShotId + 'Dim CMD As New OdbcCommand(SQL, Obj.Conn) + 'Dim RS As OdbcDataReader + 'RS = CMD.ExecuteReader + 'Dim TimesUsed As Long = 0 + 'Dim iQty As Integer = 0 + 'Dim eppo As Double = 0 + 'Dim dPrice As Double = 0 + 'While RS.Read + ' If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") + ' If Not IsDBNull(RS("weight")) Then iQty = RS("weight") + ' txtCQty.Text = iQty + ' If iQty = 0 Then dPrice = 0 + ' Dim ObjIM As New InventoryMath + ' txtCPrice.Text = Converters.ConvertToDollars(dPrice) + 'End While + 'RS.Close() + 'RS = Nothing + 'CMD = Nothing + 'Call Obj.CloseDB() + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmAddQtyShot control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmAddQtyShot_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call LoadData() + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Saves the data. + ''' + Sub SaveData() + Try + '93.8 pellets per oz + 'BPI Nickel Plated Lead Shot #2 11 lb Box + Dim currentQty As Long = CLng(GeneralHelpers.FluffContent(txtCQty.Text, 0)) + Dim currentPrice As Double = CDbl(GeneralHelpers.FluffContent(txtCPrice.Text, 0)) + Dim newQty As Long = CDbl(GeneralHelpers.FluffContent(txtUQty.Text, 0)) + Dim newPrice As Double = CDbl(GeneralHelpers.FluffContent(txtUPrice.Text, 0)) + 'Dim currentPricePerItem as Double = 0 + If Not ShotgunShotTypeInventory.UpdateQty(DatabasePath, ShotId, currentQty, currentPrice, + _currentPricePerItem, newQty, newPrice, _errOut) Then throw new exception(_errOut) + 'Dim sql As String = "" + 'Dim obj As New BSDatabase + 'Dim nQty As Long = currentQty + newQty + 'Dim nPrice As Double = currentPrice + newPrice + 'Dim ounces As Double = WeightValues.WEIGHT_OZ_1LBS * nQty + 'sql = "Update List_SG_ShotType_Details set Price=" & nPrice & ", weight='" & nQty & _ + ' "',ounces=" & ounces & " where ID=" & ShotId + 'obj.ConnExec(sql) + Catch ex As Exception + Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the btnUpdate control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdate.Click + Call SaveData() + If FromView Then Call FrmViewListShot.LoadData() + Close() + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddQtySlug.Designer.vb b/BSMyLoadersLog/Adding/frmAddQtySlug.Designer.vb index 72f5d05..5f90471 100644 --- a/BSMyLoadersLog/Adding/frmAddQtySlug.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddQtySlug.Designer.vb @@ -1,256 +1,258 @@ - _ -Partial Class frmAddQtySlug - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddQtySlug + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddQtySlug)) - Me.btnCancel = New System.Windows.Forms.Button - Me.btnUpdate = New System.Windows.Forms.Button - Me.GroupBox2 = New System.Windows.Forms.GroupBox - Me.btnViewCalc = New System.Windows.Forms.Button - Me.txtUPrice = New System.Windows.Forms.TextBox - Me.txtUQty = New System.Windows.Forms.TextBox - Me.txtUPPI = New System.Windows.Forms.TextBox - Me.Label4 = New System.Windows.Forms.Label - Me.Label5 = New System.Windows.Forms.Label - Me.Label6 = New System.Windows.Forms.Label - Me.GroupBox1 = New System.Windows.Forms.GroupBox - Me.txtCPrice = New System.Windows.Forms.TextBox - Me.txtCQty = New System.Windows.Forms.TextBox - Me.txtCPPI = New System.Windows.Forms.TextBox - Me.Label3 = New System.Windows.Forms.Label - Me.Label2 = New System.Windows.Forms.Label - Me.Label1 = New System.Windows.Forms.Label - Me.GroupBox2.SuspendLayout() - Me.GroupBox1.SuspendLayout() - Me.SuspendLayout() - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(154, 226) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 9 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'btnUpdate - ' - Me.btnUpdate.Location = New System.Drawing.Point(12, 226) - Me.btnUpdate.Name = "btnUpdate" - Me.btnUpdate.Size = New System.Drawing.Size(75, 23) - Me.btnUpdate.TabIndex = 8 - Me.btnUpdate.Text = "Update" - Me.btnUpdate.UseVisualStyleBackColor = True - ' - 'GroupBox2 - ' - Me.GroupBox2.Controls.Add(Me.btnViewCalc) - Me.GroupBox2.Controls.Add(Me.txtUPrice) - Me.GroupBox2.Controls.Add(Me.txtUQty) - Me.GroupBox2.Controls.Add(Me.txtUPPI) - Me.GroupBox2.Controls.Add(Me.Label4) - Me.GroupBox2.Controls.Add(Me.Label5) - Me.GroupBox2.Controls.Add(Me.Label6) - Me.GroupBox2.Location = New System.Drawing.Point(12, 100) - Me.GroupBox2.Name = "GroupBox2" - Me.GroupBox2.Size = New System.Drawing.Size(217, 120) - Me.GroupBox2.TabIndex = 7 - Me.GroupBox2.TabStop = False - Me.GroupBox2.Text = "Update Status" - ' - 'btnViewCalc - ' - Me.btnViewCalc.Location = New System.Drawing.Point(53, 88) - Me.btnViewCalc.Name = "btnViewCalc" - Me.btnViewCalc.Size = New System.Drawing.Size(110, 26) - Me.btnViewCalc.TabIndex = 3 - Me.btnViewCalc.Text = "View Calculation" - Me.btnViewCalc.UseVisualStyleBackColor = True - ' - 'txtUPrice - ' - Me.txtUPrice.Location = New System.Drawing.Point(96, 40) - Me.txtUPrice.Name = "txtUPrice" - Me.txtUPrice.Size = New System.Drawing.Size(107, 20) - Me.txtUPrice.TabIndex = 2 - Me.txtUPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtUQty - ' - Me.txtUQty.Location = New System.Drawing.Point(96, 18) - Me.txtUQty.Name = "txtUQty" - Me.txtUQty.Size = New System.Drawing.Size(107, 20) - Me.txtUQty.TabIndex = 1 - Me.txtUQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtUPPI - ' - Me.txtUPPI.Enabled = False - Me.txtUPPI.Location = New System.Drawing.Point(96, 62) - Me.txtUPPI.Name = "txtUPPI" - Me.txtUPPI.ReadOnly = True - Me.txtUPPI.Size = New System.Drawing.Size(107, 20) - Me.txtUPPI.TabIndex = 9 - Me.txtUPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(14, 65) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(76, 13) - Me.Label4.TabIndex = 8 - Me.Label4.Text = "Price Per Item:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(15, 43) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(34, 13) - Me.Label5.TabIndex = 7 - Me.Label5.Text = "Price:" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(15, 21) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(26, 13) - Me.Label6.TabIndex = 6 - Me.Label6.Text = "Qty:" - ' - 'GroupBox1 - ' - Me.GroupBox1.Controls.Add(Me.txtCPrice) - Me.GroupBox1.Controls.Add(Me.txtCQty) - Me.GroupBox1.Controls.Add(Me.txtCPPI) - Me.GroupBox1.Controls.Add(Me.Label3) - Me.GroupBox1.Controls.Add(Me.Label2) - Me.GroupBox1.Controls.Add(Me.Label1) - Me.GroupBox1.Location = New System.Drawing.Point(12, 3) - Me.GroupBox1.Name = "GroupBox1" - Me.GroupBox1.Size = New System.Drawing.Size(217, 91) - Me.GroupBox1.TabIndex = 6 - Me.GroupBox1.TabStop = False - Me.GroupBox1.Text = "Current Status" - ' - 'txtCPrice - ' - Me.txtCPrice.Enabled = False - Me.txtCPrice.Location = New System.Drawing.Point(91, 39) - Me.txtCPrice.Name = "txtCPrice" - Me.txtCPrice.ReadOnly = True - Me.txtCPrice.Size = New System.Drawing.Size(107, 20) - Me.txtCPrice.TabIndex = 5 - Me.txtCPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtCQty - ' - Me.txtCQty.Enabled = False - Me.txtCQty.Location = New System.Drawing.Point(91, 17) - Me.txtCQty.Name = "txtCQty" - Me.txtCQty.ReadOnly = True - Me.txtCQty.Size = New System.Drawing.Size(107, 20) - Me.txtCQty.TabIndex = 4 - Me.txtCQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtCPPI - ' - Me.txtCPPI.Enabled = False - Me.txtCPPI.Location = New System.Drawing.Point(91, 61) - Me.txtCPPI.Name = "txtCPPI" - Me.txtCPPI.ReadOnly = True - Me.txtCPPI.Size = New System.Drawing.Size(107, 20) - Me.txtCPPI.TabIndex = 3 - Me.txtCPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(9, 64) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(76, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Price Per Item:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(10, 42) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(34, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Price:" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(10, 20) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(26, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Qty:" - ' - 'frmAddQtySlug - ' - Me.AcceptButton = Me.btnUpdate - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(244, 258) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnUpdate) - Me.Controls.Add(Me.GroupBox2) - Me.Controls.Add(Me.GroupBox1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmAddQtySlug" - Me.Text = "Update Slug Qty." - Me.GroupBox2.ResumeLayout(False) - Me.GroupBox2.PerformLayout() - Me.GroupBox1.ResumeLayout(False) - Me.GroupBox1.PerformLayout() - Me.ResumeLayout(False) + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddQtySlug)) + Me.btnCancel = New System.Windows.Forms.Button + Me.btnUpdate = New System.Windows.Forms.Button + Me.GroupBox2 = New System.Windows.Forms.GroupBox + Me.btnViewCalc = New System.Windows.Forms.Button + Me.txtUPrice = New System.Windows.Forms.TextBox + Me.txtUQty = New System.Windows.Forms.TextBox + Me.txtUPPI = New System.Windows.Forms.TextBox + Me.Label4 = New System.Windows.Forms.Label + Me.Label5 = New System.Windows.Forms.Label + Me.Label6 = New System.Windows.Forms.Label + Me.GroupBox1 = New System.Windows.Forms.GroupBox + Me.txtCPrice = New System.Windows.Forms.TextBox + Me.txtCQty = New System.Windows.Forms.TextBox + Me.txtCPPI = New System.Windows.Forms.TextBox + Me.Label3 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label1 = New System.Windows.Forms.Label + Me.GroupBox2.SuspendLayout() + Me.GroupBox1.SuspendLayout() + Me.SuspendLayout() + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(154, 226) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 9 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'btnUpdate + ' + Me.btnUpdate.Location = New System.Drawing.Point(12, 226) + Me.btnUpdate.Name = "btnUpdate" + Me.btnUpdate.Size = New System.Drawing.Size(75, 23) + Me.btnUpdate.TabIndex = 8 + Me.btnUpdate.Text = "Update" + Me.btnUpdate.UseVisualStyleBackColor = True + ' + 'GroupBox2 + ' + Me.GroupBox2.Controls.Add(Me.btnViewCalc) + Me.GroupBox2.Controls.Add(Me.txtUPrice) + Me.GroupBox2.Controls.Add(Me.txtUQty) + Me.GroupBox2.Controls.Add(Me.txtUPPI) + Me.GroupBox2.Controls.Add(Me.Label4) + Me.GroupBox2.Controls.Add(Me.Label5) + Me.GroupBox2.Controls.Add(Me.Label6) + Me.GroupBox2.Location = New System.Drawing.Point(12, 100) + Me.GroupBox2.Name = "GroupBox2" + Me.GroupBox2.Size = New System.Drawing.Size(217, 120) + Me.GroupBox2.TabIndex = 7 + Me.GroupBox2.TabStop = False + Me.GroupBox2.Text = "Update Status" + ' + 'btnViewCalc + ' + Me.btnViewCalc.Location = New System.Drawing.Point(53, 88) + Me.btnViewCalc.Name = "btnViewCalc" + Me.btnViewCalc.Size = New System.Drawing.Size(110, 26) + Me.btnViewCalc.TabIndex = 3 + Me.btnViewCalc.Text = "View Calculation" + Me.btnViewCalc.UseVisualStyleBackColor = True + ' + 'txtUPrice + ' + Me.txtUPrice.Location = New System.Drawing.Point(96, 40) + Me.txtUPrice.Name = "txtUPrice" + Me.txtUPrice.Size = New System.Drawing.Size(107, 20) + Me.txtUPrice.TabIndex = 2 + Me.txtUPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtUQty + ' + Me.txtUQty.Location = New System.Drawing.Point(96, 18) + Me.txtUQty.Name = "txtUQty" + Me.txtUQty.Size = New System.Drawing.Size(107, 20) + Me.txtUQty.TabIndex = 1 + Me.txtUQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtUPPI + ' + Me.txtUPPI.Enabled = False + Me.txtUPPI.Location = New System.Drawing.Point(96, 62) + Me.txtUPPI.Name = "txtUPPI" + Me.txtUPPI.ReadOnly = True + Me.txtUPPI.Size = New System.Drawing.Size(107, 20) + Me.txtUPPI.TabIndex = 9 + Me.txtUPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(14, 65) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(76, 13) + Me.Label4.TabIndex = 8 + Me.Label4.Text = "Price Per Item:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(15, 43) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(34, 13) + Me.Label5.TabIndex = 7 + Me.Label5.Text = "Price:" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(15, 21) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(26, 13) + Me.Label6.TabIndex = 6 + Me.Label6.Text = "Qty:" + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.txtCPrice) + Me.GroupBox1.Controls.Add(Me.txtCQty) + Me.GroupBox1.Controls.Add(Me.txtCPPI) + Me.GroupBox1.Controls.Add(Me.Label3) + Me.GroupBox1.Controls.Add(Me.Label2) + Me.GroupBox1.Controls.Add(Me.Label1) + Me.GroupBox1.Location = New System.Drawing.Point(12, 3) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(217, 91) + Me.GroupBox1.TabIndex = 6 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "Current Status" + ' + 'txtCPrice + ' + Me.txtCPrice.Enabled = False + Me.txtCPrice.Location = New System.Drawing.Point(91, 39) + Me.txtCPrice.Name = "txtCPrice" + Me.txtCPrice.ReadOnly = True + Me.txtCPrice.Size = New System.Drawing.Size(107, 20) + Me.txtCPrice.TabIndex = 5 + Me.txtCPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtCQty + ' + Me.txtCQty.Enabled = False + Me.txtCQty.Location = New System.Drawing.Point(91, 17) + Me.txtCQty.Name = "txtCQty" + Me.txtCQty.ReadOnly = True + Me.txtCQty.Size = New System.Drawing.Size(107, 20) + Me.txtCQty.TabIndex = 4 + Me.txtCQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtCPPI + ' + Me.txtCPPI.Enabled = False + Me.txtCPPI.Location = New System.Drawing.Point(91, 61) + Me.txtCPPI.Name = "txtCPPI" + Me.txtCPPI.ReadOnly = True + Me.txtCPPI.Size = New System.Drawing.Size(107, 20) + Me.txtCPPI.TabIndex = 3 + Me.txtCPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(9, 64) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(76, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Price Per Item:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(10, 42) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(34, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Price:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(10, 20) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(26, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Qty:" + ' + 'frmAddQtySlug + ' + Me.AcceptButton = Me.btnUpdate + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(244, 258) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnUpdate) + Me.Controls.Add(Me.GroupBox2) + Me.Controls.Add(Me.GroupBox1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmAddQtySlug" + Me.Text = "Update Slug Qty." + Me.GroupBox2.ResumeLayout(False) + Me.GroupBox2.PerformLayout() + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() + Me.ResumeLayout(False) - End Sub - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents btnUpdate As System.Windows.Forms.Button - Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox - Friend WithEvents btnViewCalc As System.Windows.Forms.Button - Friend WithEvents txtUPrice As System.Windows.Forms.TextBox - Friend WithEvents txtUQty As System.Windows.Forms.TextBox - Friend WithEvents txtUPPI As System.Windows.Forms.TextBox - 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 GroupBox1 As System.Windows.Forms.GroupBox - Friend WithEvents txtCPrice As System.Windows.Forms.TextBox - Friend WithEvents txtCQty As System.Windows.Forms.TextBox - Friend WithEvents txtCPPI As System.Windows.Forms.TextBox - Friend WithEvents Label3 As System.Windows.Forms.Label - Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents Label1 As System.Windows.Forms.Label -End Class + End Sub + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents btnUpdate As System.Windows.Forms.Button + Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox + Friend WithEvents btnViewCalc As System.Windows.Forms.Button + Friend WithEvents txtUPrice As System.Windows.Forms.TextBox + Friend WithEvents txtUQty As System.Windows.Forms.TextBox + Friend WithEvents txtUPPI As System.Windows.Forms.TextBox + 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 GroupBox1 As System.Windows.Forms.GroupBox + Friend WithEvents txtCPrice As System.Windows.Forms.TextBox + Friend WithEvents txtCQty As System.Windows.Forms.TextBox + Friend WithEvents txtCPPI As System.Windows.Forms.TextBox + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label1 As System.Windows.Forms.Label + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddQtySlug.vb b/BSMyLoadersLog/Adding/frmAddQtySlug.vb index 3f899eb..9d8be30 100644 --- a/BSMyLoadersLog/Adding/frmAddQtySlug.vb +++ b/BSMyLoadersLog/Adding/frmAddQtySlug.vb @@ -1,91 +1,151 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc +'Imports BSMyLoadersLog.LoadersClass +'Imports System.Data.Odbc +Imports BSMyLoadersLog.Viewing Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory +Imports BurnSoft.Applications.MLL.Types -Public Class frmAddQtySlug - Public SID As Long - Public FromView As Boolean - Function PricePerItem(ByVal lQty As Long, ByVal dPrice As Double) As Double - Dim dAns As Double = 0 - Dim ObjIM As New InventoryMath - If lQty > 0 Then - dAns = dPrice / lQty - End If - ObjIM.ConvertToDollars(dAns) - Return dAns - End Function - Public Sub LoadData() - Try - Dim SQL As String = "SELECT * from List_SG_ShotType_Details where ID=" & SID - Dim Obj As New BSDatabase - Dim ObjIM As New InventoryMath - Call Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - Dim iQty As Integer = 0 - Dim eppo As Double = 0 - Dim dPrice As Double = 0 - While RS.Read - If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") - If Not IsDBNull(RS("Qty")) Then iQty = RS("Qty") - If Not IsDBNull(RS("epps")) Then eppo = RS("epps") - txtCQty.Text = iQty - txtCPrice.Text = ObjIM.ConvertToDollars(dPrice) - txtCPPI.Text = ObjIM.ConvertToDollars(eppo) - End While - RS.Close() - RS = Nothing - CMD = Nothing - Obj.CloseDB() - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - Public Sub SaveData() - Try - Dim CQty As Long = CLng(GeneralHelpers.FluffContent(txtCQty.Text, 0)) - Dim CPrice As Double = CDbl(GeneralHelpers.FluffContent(txtCPrice.Text, 0)) - Dim CPPI As Double = CDbl(GeneralHelpers.FluffContent(txtCPPI.Text, 0)) - Dim UQty As Long = CLng(GeneralHelpers.FluffContent(txtUQty.Text, 0)) - Dim UPrice As Double = CDbl(GeneralHelpers.FluffContent(txtUPrice.Text, 0)) - Dim UPPI As Double = PricePerItem(UQty, UPrice) - txtUPPI.Text = UPPI - If Not GeneralHelpers.IsRequired(UQty, "Update Qty", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(UPrice, "Update Price", Me.Text) Then Exit Sub +Namespace Adding - Dim NQty As Long = CQty + UQty - Dim NPrice As Double = (CQty * CPPI) + UPrice - Dim NPPI As Double = PricePerItem(NQty, NPrice) - Dim SQL As String = "" - Dim Obj As New BSDatabase - If CPPI = UPPI Then - SQL = "UPDATE List_SG_ShotType_Details set QTY=" & NQty & ", Price=" & NPrice & " where ID=" & SID - ElseIf UPrice = 0 And UQty = 0 Then - SQL = "UPDATE List_SG_ShotType_Details set QTY=0, Price=0, epps=0 where ID=" & SID - Else - SQL = "UPDATE List_SG_ShotType_Details set QTY=" & NQty & ", Price=" & NPrice & ", epps=" & NPPI & " where ID=" & SID - End If - Obj.ConnExec(SQL) - Catch ex As Exception - Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmAddQtySlug_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call LoadData() - End Sub - - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub + ''' + ''' Class frmAddQtySlug. + ''' Implements the + ''' + ''' + Public Class FrmAddQtySlug + ' TODO: #20 clean up code + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' The slug identifier + ''' + Public SlugId As Long + ''' + ''' From view + ''' + Public FromView As Boolean - Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click - Call SaveData() - If FromView Then Call frmView_List_Slug.LoadData() - Me.Close() - End Sub + 'Function PricePerItem(ByVal lQty As Long, ByVal dPrice As Double) As Double + ' Dim dAns As Double = 0 + ' Dim ObjIM As New InventoryMath + ' If lQty > 0 Then + ' dAns = dPrice / lQty + ' End If + ' Converters.ConvertToDollars(dAns) + ' Return dAns + 'End Function + ''' + ''' Loads the data. + ''' + ''' + Public Sub LoadData() + Try + Dim lst as List(Of ShotgunShotTypeData) = ShotgunShotTypeInventory.GetDetails(DatabasePath, SlugId, _errOut) + if _errOut.Length > 0 then Throw new Exception(_errOut) + For Each o As ShotgunShotTypeData In lst + txtCQty.Text = o.Qty + txtCPrice.Text = Converters.ConvertToDollars(o.Price) + txtCPPI.Text = Converters.ConvertToDollars(o.EstimatedPricePerItem) + Next + 'Dim SQL As String = "SELECT * from List_SG_ShotType_Details where ID=" & SlugId + 'Dim Obj As New BSDatabase + 'Dim ObjIM As New InventoryMath + 'Call Obj.ConnectDB() + 'Dim CMD As New OdbcCommand(SQL, Obj.Conn) + 'Dim RS As OdbcDataReader + 'RS = CMD.ExecuteReader + 'Dim iQty As Integer = 0 + 'Dim eppo As Double = 0 + 'Dim dPrice As Double = 0 + 'While RS.Read + ' If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") + ' If Not IsDBNull(RS("Qty")) Then iQty = RS("Qty") + ' If Not IsDBNull(RS("epps")) Then eppo = RS("epps") + ' txtCQty.Text = iQty + ' txtCPrice.Text = Converters.ConvertToDollars(dPrice) + ' txtCPPI.Text = Converters.ConvertToDollars(eppo) + 'End While + 'RS.Close() + 'RS = Nothing + 'CMD = Nothing + 'Obj.CloseDB() + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Saves the data. + ''' + Public Sub SaveData() + Try + Dim currentQty As Long = CLng(GeneralHelpers.FluffContent(txtCQty.Text, 0)) + Dim currentPrice As Double = CDbl(GeneralHelpers.FluffContent(txtCPrice.Text, 0)) + Dim currentPricePerItem As Double = CDbl(GeneralHelpers.FluffContent(txtCPPI.Text, 0)) + Dim newQty As Long = CLng(GeneralHelpers.FluffContent(txtUQty.Text, 0)) + Dim newPrice As Double = CDbl(GeneralHelpers.FluffContent(txtUPrice.Text, 0)) + 'Dim newPricePerItem As Double = PricePerItem(newQty, newPrice) + 'txtUPPI.Text = newPricePerItem + If Not GeneralHelpers.IsRequired(newQty, "Update Qty", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(newPrice, "Update Price", Text) Then Exit Sub + ' TODO: #19 Remove comment below on net Library Update + 'If Not ShotgunShotTypeInventory.UpdateQtySlug(DatabasePath, SlugId, currentQty, currentPrice, + ' currentPricePerItem, newQty, newPrice, + ' _errOut) Then Throw new Exception(_errOut) - Private Sub btnViewCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnViewCalc.Click - txtUPPI.Text = PricePerItem(CLng(txtUQty.Text), CDbl(txtUPrice.Text)) - End Sub -End Class \ No newline at end of file + 'Dim NQty As Long = currentQty + newQty + 'Dim NPrice As Double = (currentQty * currentPricePerItem) + newPrice + 'Dim NPPI As Double = PricePerItem(NQty, NPrice) + 'Dim SQL As String = "" + 'Dim Obj As New BSDatabase + 'If currentPricePerItem = newPricePerItem Then + ' SQL = "UPDATE List_SG_ShotType_Details set QTY=" & NQty & ", Price=" & NPrice & " where ID=" & SlugId + 'ElseIf newPrice = 0 And newQty = 0 Then + ' SQL = "UPDATE List_SG_ShotType_Details set QTY=0, Price=0, epps=0 where ID=" & SlugId + 'Else + ' SQL = "UPDATE List_SG_ShotType_Details set QTY=" & NQty & ", Price=" & NPrice & ", epps=" & NPPI & " where ID=" & SlugId + 'End If + 'Obj.ConnExec(SQL) + Catch ex As Exception + Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmAddQtySlug control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmAddQtySlug_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call LoadData() + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnUpdate control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdate.Click + Call SaveData() + If FromView Then Call FrmViewListSlug.LoadData() + Close() + End Sub + ''' + ''' Handles the Click event of the btnViewCalc control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnViewCalc_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnViewCalc.Click + If CLng(txtUQty.Text) > 0 Then + txtUPPI.Text = Converters.ConvertToDollars(CDbl(txtUPrice.Text) / CLng(txtUQty.Text)) + End If + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddQtyWAD.Designer.vb b/BSMyLoadersLog/Adding/frmAddQtyWAD.Designer.vb index 8c78693..5525069 100644 --- a/BSMyLoadersLog/Adding/frmAddQtyWAD.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddQtyWAD.Designer.vb @@ -1,254 +1,256 @@ - _ -Partial Class frmAddQtyWAD - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddQtyWad + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddQtyWAD)) - Me.btnCancel = New System.Windows.Forms.Button - Me.btnUpdate = New System.Windows.Forms.Button - Me.GroupBox2 = New System.Windows.Forms.GroupBox - Me.btnViewCalc = New System.Windows.Forms.Button - Me.txtUPrice = New System.Windows.Forms.TextBox - Me.txtUQty = New System.Windows.Forms.TextBox - Me.txtUPPI = New System.Windows.Forms.TextBox - Me.Label4 = New System.Windows.Forms.Label - Me.Label5 = New System.Windows.Forms.Label - Me.Label6 = New System.Windows.Forms.Label - Me.GroupBox1 = New System.Windows.Forms.GroupBox - Me.txtCPrice = New System.Windows.Forms.TextBox - Me.txtCQty = New System.Windows.Forms.TextBox - Me.txtCPPI = New System.Windows.Forms.TextBox - Me.Label3 = New System.Windows.Forms.Label - Me.Label2 = New System.Windows.Forms.Label - Me.Label1 = New System.Windows.Forms.Label - Me.GroupBox2.SuspendLayout() - Me.GroupBox1.SuspendLayout() - Me.SuspendLayout() - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(131, 226) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 17 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'btnUpdate - ' - Me.btnUpdate.Location = New System.Drawing.Point(14, 226) - Me.btnUpdate.Name = "btnUpdate" - Me.btnUpdate.Size = New System.Drawing.Size(75, 23) - Me.btnUpdate.TabIndex = 16 - Me.btnUpdate.Text = "Update" - Me.btnUpdate.UseVisualStyleBackColor = True - ' - 'GroupBox2 - ' - Me.GroupBox2.Controls.Add(Me.btnViewCalc) - Me.GroupBox2.Controls.Add(Me.txtUPrice) - Me.GroupBox2.Controls.Add(Me.txtUQty) - Me.GroupBox2.Controls.Add(Me.txtUPPI) - Me.GroupBox2.Controls.Add(Me.Label4) - Me.GroupBox2.Controls.Add(Me.Label5) - Me.GroupBox2.Controls.Add(Me.Label6) - Me.GroupBox2.Location = New System.Drawing.Point(3, 100) - Me.GroupBox2.Name = "GroupBox2" - Me.GroupBox2.Size = New System.Drawing.Size(217, 120) - Me.GroupBox2.TabIndex = 15 - Me.GroupBox2.TabStop = False - Me.GroupBox2.Text = "Update Status" - ' - 'btnViewCalc - ' - Me.btnViewCalc.Location = New System.Drawing.Point(53, 88) - Me.btnViewCalc.Name = "btnViewCalc" - Me.btnViewCalc.Size = New System.Drawing.Size(110, 26) - Me.btnViewCalc.TabIndex = 3 - Me.btnViewCalc.Text = "View Calculation" - Me.btnViewCalc.UseVisualStyleBackColor = True - ' - 'txtUPrice - ' - Me.txtUPrice.Location = New System.Drawing.Point(96, 40) - Me.txtUPrice.Name = "txtUPrice" - Me.txtUPrice.Size = New System.Drawing.Size(107, 20) - Me.txtUPrice.TabIndex = 2 - Me.txtUPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtUQty - ' - Me.txtUQty.Location = New System.Drawing.Point(96, 18) - Me.txtUQty.Name = "txtUQty" - Me.txtUQty.Size = New System.Drawing.Size(107, 20) - Me.txtUQty.TabIndex = 1 - Me.txtUQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtUPPI - ' - Me.txtUPPI.Enabled = False - Me.txtUPPI.Location = New System.Drawing.Point(96, 62) - Me.txtUPPI.Name = "txtUPPI" - Me.txtUPPI.ReadOnly = True - Me.txtUPPI.Size = New System.Drawing.Size(107, 20) - Me.txtUPPI.TabIndex = 9 - Me.txtUPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(14, 65) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(76, 13) - Me.Label4.TabIndex = 8 - Me.Label4.Text = "Price Per Item:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(15, 43) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(34, 13) - Me.Label5.TabIndex = 7 - Me.Label5.Text = "Price:" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(15, 21) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(26, 13) - Me.Label6.TabIndex = 6 - Me.Label6.Text = "Qty:" - ' - 'GroupBox1 - ' - Me.GroupBox1.Controls.Add(Me.txtCPrice) - Me.GroupBox1.Controls.Add(Me.txtCQty) - Me.GroupBox1.Controls.Add(Me.txtCPPI) - Me.GroupBox1.Controls.Add(Me.Label3) - Me.GroupBox1.Controls.Add(Me.Label2) - Me.GroupBox1.Controls.Add(Me.Label1) - Me.GroupBox1.Location = New System.Drawing.Point(3, 3) - Me.GroupBox1.Name = "GroupBox1" - Me.GroupBox1.Size = New System.Drawing.Size(217, 91) - Me.GroupBox1.TabIndex = 14 - Me.GroupBox1.TabStop = False - Me.GroupBox1.Text = "Current Status" - ' - 'txtCPrice - ' - Me.txtCPrice.Enabled = False - Me.txtCPrice.Location = New System.Drawing.Point(91, 39) - Me.txtCPrice.Name = "txtCPrice" - Me.txtCPrice.ReadOnly = True - Me.txtCPrice.Size = New System.Drawing.Size(107, 20) - Me.txtCPrice.TabIndex = 5 - Me.txtCPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtCQty - ' - Me.txtCQty.Enabled = False - Me.txtCQty.Location = New System.Drawing.Point(91, 17) - Me.txtCQty.Name = "txtCQty" - Me.txtCQty.ReadOnly = True - Me.txtCQty.Size = New System.Drawing.Size(107, 20) - Me.txtCQty.TabIndex = 4 - Me.txtCQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'txtCPPI - ' - Me.txtCPPI.Enabled = False - Me.txtCPPI.Location = New System.Drawing.Point(91, 61) - Me.txtCPPI.Name = "txtCPPI" - Me.txtCPPI.ReadOnly = True - Me.txtCPPI.Size = New System.Drawing.Size(107, 20) - Me.txtCPPI.TabIndex = 3 - Me.txtCPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(9, 64) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(76, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Price Per Item:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(10, 42) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(34, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Price:" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(10, 20) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(26, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Qty:" - ' - 'frmAddQtyWAD - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(227, 257) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnUpdate) - Me.Controls.Add(Me.GroupBox2) - Me.Controls.Add(Me.GroupBox1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmAddQtyWAD" - Me.Text = "Update WAD Qty." - Me.GroupBox2.ResumeLayout(False) - Me.GroupBox2.PerformLayout() - Me.GroupBox1.ResumeLayout(False) - Me.GroupBox1.PerformLayout() - Me.ResumeLayout(False) + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddQtyWAD)) + Me.btnCancel = New System.Windows.Forms.Button + Me.btnUpdate = New System.Windows.Forms.Button + Me.GroupBox2 = New System.Windows.Forms.GroupBox + Me.btnViewCalc = New System.Windows.Forms.Button + Me.txtUPrice = New System.Windows.Forms.TextBox + Me.txtUQty = New System.Windows.Forms.TextBox + Me.txtUPPI = New System.Windows.Forms.TextBox + Me.Label4 = New System.Windows.Forms.Label + Me.Label5 = New System.Windows.Forms.Label + Me.Label6 = New System.Windows.Forms.Label + Me.GroupBox1 = New System.Windows.Forms.GroupBox + Me.txtCPrice = New System.Windows.Forms.TextBox + Me.txtCQty = New System.Windows.Forms.TextBox + Me.txtCPPI = New System.Windows.Forms.TextBox + Me.Label3 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label1 = New System.Windows.Forms.Label + Me.GroupBox2.SuspendLayout() + Me.GroupBox1.SuspendLayout() + Me.SuspendLayout() + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(131, 226) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 17 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'btnUpdate + ' + Me.btnUpdate.Location = New System.Drawing.Point(14, 226) + Me.btnUpdate.Name = "btnUpdate" + Me.btnUpdate.Size = New System.Drawing.Size(75, 23) + Me.btnUpdate.TabIndex = 16 + Me.btnUpdate.Text = "Update" + Me.btnUpdate.UseVisualStyleBackColor = True + ' + 'GroupBox2 + ' + Me.GroupBox2.Controls.Add(Me.btnViewCalc) + Me.GroupBox2.Controls.Add(Me.txtUPrice) + Me.GroupBox2.Controls.Add(Me.txtUQty) + Me.GroupBox2.Controls.Add(Me.txtUPPI) + Me.GroupBox2.Controls.Add(Me.Label4) + Me.GroupBox2.Controls.Add(Me.Label5) + Me.GroupBox2.Controls.Add(Me.Label6) + Me.GroupBox2.Location = New System.Drawing.Point(3, 100) + Me.GroupBox2.Name = "GroupBox2" + Me.GroupBox2.Size = New System.Drawing.Size(217, 120) + Me.GroupBox2.TabIndex = 15 + Me.GroupBox2.TabStop = False + Me.GroupBox2.Text = "Update Status" + ' + 'btnViewCalc + ' + Me.btnViewCalc.Location = New System.Drawing.Point(53, 88) + Me.btnViewCalc.Name = "btnViewCalc" + Me.btnViewCalc.Size = New System.Drawing.Size(110, 26) + Me.btnViewCalc.TabIndex = 3 + Me.btnViewCalc.Text = "View Calculation" + Me.btnViewCalc.UseVisualStyleBackColor = True + ' + 'txtUPrice + ' + Me.txtUPrice.Location = New System.Drawing.Point(96, 40) + Me.txtUPrice.Name = "txtUPrice" + Me.txtUPrice.Size = New System.Drawing.Size(107, 20) + Me.txtUPrice.TabIndex = 2 + Me.txtUPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtUQty + ' + Me.txtUQty.Location = New System.Drawing.Point(96, 18) + Me.txtUQty.Name = "txtUQty" + Me.txtUQty.Size = New System.Drawing.Size(107, 20) + Me.txtUQty.TabIndex = 1 + Me.txtUQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtUPPI + ' + Me.txtUPPI.Enabled = False + Me.txtUPPI.Location = New System.Drawing.Point(96, 62) + Me.txtUPPI.Name = "txtUPPI" + Me.txtUPPI.ReadOnly = True + Me.txtUPPI.Size = New System.Drawing.Size(107, 20) + Me.txtUPPI.TabIndex = 9 + Me.txtUPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(14, 65) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(76, 13) + Me.Label4.TabIndex = 8 + Me.Label4.Text = "Price Per Item:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(15, 43) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(34, 13) + Me.Label5.TabIndex = 7 + Me.Label5.Text = "Price:" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(15, 21) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(26, 13) + Me.Label6.TabIndex = 6 + Me.Label6.Text = "Qty:" + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.txtCPrice) + Me.GroupBox1.Controls.Add(Me.txtCQty) + Me.GroupBox1.Controls.Add(Me.txtCPPI) + Me.GroupBox1.Controls.Add(Me.Label3) + Me.GroupBox1.Controls.Add(Me.Label2) + Me.GroupBox1.Controls.Add(Me.Label1) + Me.GroupBox1.Location = New System.Drawing.Point(3, 3) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(217, 91) + Me.GroupBox1.TabIndex = 14 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "Current Status" + ' + 'txtCPrice + ' + Me.txtCPrice.Enabled = False + Me.txtCPrice.Location = New System.Drawing.Point(91, 39) + Me.txtCPrice.Name = "txtCPrice" + Me.txtCPrice.ReadOnly = True + Me.txtCPrice.Size = New System.Drawing.Size(107, 20) + Me.txtCPrice.TabIndex = 5 + Me.txtCPrice.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtCQty + ' + Me.txtCQty.Enabled = False + Me.txtCQty.Location = New System.Drawing.Point(91, 17) + Me.txtCQty.Name = "txtCQty" + Me.txtCQty.ReadOnly = True + Me.txtCQty.Size = New System.Drawing.Size(107, 20) + Me.txtCQty.TabIndex = 4 + Me.txtCQty.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'txtCPPI + ' + Me.txtCPPI.Enabled = False + Me.txtCPPI.Location = New System.Drawing.Point(91, 61) + Me.txtCPPI.Name = "txtCPPI" + Me.txtCPPI.ReadOnly = True + Me.txtCPPI.Size = New System.Drawing.Size(107, 20) + Me.txtCPPI.TabIndex = 3 + Me.txtCPPI.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(9, 64) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(76, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Price Per Item:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(10, 42) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(34, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Price:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(10, 20) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(26, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Qty:" + ' + 'frmAddQtyWAD + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(227, 257) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnUpdate) + Me.Controls.Add(Me.GroupBox2) + Me.Controls.Add(Me.GroupBox1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmAddQtyWAD" + Me.Text = "Update WAD Qty." + Me.GroupBox2.ResumeLayout(False) + Me.GroupBox2.PerformLayout() + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() + Me.ResumeLayout(False) - End Sub - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents btnUpdate As System.Windows.Forms.Button - Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox - Friend WithEvents btnViewCalc As System.Windows.Forms.Button - Friend WithEvents txtUPrice As System.Windows.Forms.TextBox - Friend WithEvents txtUQty As System.Windows.Forms.TextBox - Friend WithEvents txtUPPI As System.Windows.Forms.TextBox - 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 GroupBox1 As System.Windows.Forms.GroupBox - Friend WithEvents txtCPrice As System.Windows.Forms.TextBox - Friend WithEvents txtCQty As System.Windows.Forms.TextBox - Friend WithEvents txtCPPI As System.Windows.Forms.TextBox - Friend WithEvents Label3 As System.Windows.Forms.Label - Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents Label1 As System.Windows.Forms.Label -End Class + End Sub + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents btnUpdate As System.Windows.Forms.Button + Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox + Friend WithEvents btnViewCalc As System.Windows.Forms.Button + Friend WithEvents txtUPrice As System.Windows.Forms.TextBox + Friend WithEvents txtUQty As System.Windows.Forms.TextBox + Friend WithEvents txtUPPI As System.Windows.Forms.TextBox + 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 GroupBox1 As System.Windows.Forms.GroupBox + Friend WithEvents txtCPrice As System.Windows.Forms.TextBox + Friend WithEvents txtCQty As System.Windows.Forms.TextBox + Friend WithEvents txtCPPI As System.Windows.Forms.TextBox + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label1 As System.Windows.Forms.Label + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddQtyWAD.vb b/BSMyLoadersLog/Adding/frmAddQtyWAD.vb index 8ead01d..05966d6 100644 --- a/BSMyLoadersLog/Adding/frmAddQtyWAD.vb +++ b/BSMyLoadersLog/Adding/frmAddQtyWAD.vb @@ -1,92 +1,153 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc +'Imports BSMyLoadersLog.LoadersClass +'Imports System.Data.Odbc +Imports BSMyLoadersLog.Viewing Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory +Imports BurnSoft.Applications.MLL.Types -Public Class frmAddQtyWAD - Public FromView As Boolean - Public WID As Long - Function PricePerItem(ByVal lQty As Long, ByVal dPrice As Double) As Double - Dim dAns As Double = 0 - Dim ObjIM As New InventoryMath - If lQty > 0 Then - dAns = dPrice / lQty - End If - ObjIM.ConvertToDollars(dAns) - Return dAns - End Function - Sub LoadData() - Try - Dim SQL As String = "SELECT * from List_SG_WAD where ID=" & WID - Dim Obj As New BSDatabase - Dim ObjIM As New InventoryMath - Call Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - Dim iQty As Integer = 0 - Dim eppo As Double = 0 - Dim dPrice As Double = 0 - While RS.Read - If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") - If Not IsDBNull(RS("Qty")) Then iQty = RS("Qty") - If Not IsDBNull(RS("eppw")) Then eppo = RS("eppw") - txtCQty.Text = iQty - txtCPrice.Text = ObjIM.ConvertToDollars(dPrice) - txtCPPI.Text = ObjIM.ConvertToDollars(eppo) - End While - RS.Close() - RS = Nothing - CMD = Nothing - Obj.CloseDB() - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub SaveData() - Try - Dim CQty As Long = CLng(GeneralHelpers.FluffContent(txtCQty.Text, 0)) - Dim CPrice As Double = CDbl(GeneralHelpers.FluffContent(txtCPrice.Text, 0)) - Dim CPPI As Double = CDbl(GeneralHelpers.FluffContent(txtCPPI.Text, 0)) - Dim UQty As Long = CLng(GeneralHelpers.FluffContent(txtUQty.Text, 0)) - Dim UPrice As Double = CDbl(GeneralHelpers.FluffContent(txtUPrice.Text, 0)) - Dim UPPI As Double = PricePerItem(UQty, UPrice) - txtUPPI.Text = UPPI - If Not GeneralHelpers.IsRequired(UQty, "Update Qty", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(UPrice, "Update Price", Me.Text) Then Exit Sub +Namespace Adding - Dim NQty As Long = CQty + UQty - Dim NPrice As Double = (CQty * CPPI) + UPrice - Dim NPPI As Double = PricePerItem(NQty, NPrice) - Dim SQL As String = "" - Dim Obj As New BSDatabase - If CPPI = UPPI Then - SQL = "UPDATE List_SG_WAD set QTY=" & NQty & ", Price=" & NPrice & " where ID=" & WID - ElseIf UPrice = 0 And UQty = 0 Then - SQL = "UPDATE List_SG_WAD set QTY=0, Price=0, eppw=0 where ID=" & WID - Else - SQL = "UPDATE List_SG_WAD set QTY=" & NQty & ", Price=" & NPrice & ", eppw=" & NPPI & " where ID=" & WID - End If - Obj.ConnExec(SQL) - Catch ex As Exception - Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmAddQtyWAD_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call LoadData() - End Sub + Public Class FrmAddQtyWad + ' TODO: #20 clean up code + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' From view + ''' + Public FromView As Boolean + ''' + ''' The wad identifier + ''' + Public WadId As Long + 'Function PricePerItem(ByVal lQty As Long, ByVal dPrice As Double) As Double + ' Dim dAns As Double = 0 + ' Dim ObjIM As New InventoryMath + ' If lQty > 0 Then + ' dAns = dPrice / lQty + ' End If + ' Converters.ConvertToDollars(dAns) + ' Return dAns + 'End Function + ''' + ''' Loads the data. + ''' + ''' + Sub LoadData() + Try + Dim lst As List(Of WadData) = WadInventory.GetDetails(DatabasePath, WadId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As WadData In lst + txtCQty.Text = o.Qty + txtCPrice.Text = Converters.ConvertToDollars(o.Price) + txtCPPI.Text = Converters.ConvertToDollars(o.EstimatedPricePerItem) + Next - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub + 'Dim SQL As String = "SELECT * from List_SG_WAD where ID=" & WadId + 'Dim Obj As New BSDatabase + 'Dim ObjIM As New InventoryMath + 'Call Obj.ConnectDB() + 'Dim CMD As New OdbcCommand(SQL, Obj.Conn) + 'Dim RS As OdbcDataReader + 'RS = CMD.ExecuteReader + 'Dim iQty As Integer = 0 + 'Dim eppo As Double = 0 + 'Dim dPrice As Double = 0 + 'While RS.Read + ' If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") + ' If Not IsDBNull(RS("Qty")) Then iQty = RS("Qty") + ' If Not IsDBNull(RS("eppw")) Then eppo = RS("eppw") + ' txtCQty.Text = iQty + ' txtCPrice.Text = Converters.ConvertToDollars(dPrice) + ' txtCPPI.Text = Converters.ConvertToDollars(eppo) + 'End While + 'RS.Close() + 'RS = Nothing + 'CMD = Nothing + 'Obj.CloseDB() + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Saves the data. + ''' + Sub SaveData() + Try + Dim currentQty As Long = CLng(GeneralHelpers.FluffContent(txtCQty.Text, 0)) + Dim currentPrice As Double = CDbl(GeneralHelpers.FluffContent(txtCPrice.Text, 0)) + Dim currentPricePerItem As Double = CDbl(GeneralHelpers.FluffContent(txtCPPI.Text, 0)) + Dim newQty As Long = CLng(GeneralHelpers.FluffContent(txtUQty.Text, 0)) + Dim newPrice As Double = CDbl(GeneralHelpers.FluffContent(txtUPrice.Text, 0)) + 'Dim newPricePerItem As Double = PricePerItem(newQty, newPrice) + 'txtUPPI.Text = newPricePerItem + If Not GeneralHelpers.IsRequired(newQty, "Update Qty", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(newPrice, "Update Price", Text) Then Exit Sub - Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click - Call SaveData() - If FromView Then Call frmView_List_WADS.LoadData() - Me.Close() - End Sub + If Not WadInventory.UpdateQty(DatabasePath, WadId, currentQty, currentPrice, currentPricePerItem, + newQty, newPrice, _errOut) Then Throw New Exception(_errOut) - Private Sub btnViewCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnViewCalc.Click - txtUPPI.Text = PricePerItem(CLng(GeneralHelpers.FluffContent(txtUQty.Text, 0)), - CDbl(GeneralHelpers.FluffContent(txtUPrice.Text, 0))) - End Sub -End Class \ No newline at end of file + 'Dim NQty As Long = currentQty + newQty + 'Dim NPrice As Double = (currentQty * currentPricePerItem) + newPrice + 'Dim NPPI As Double = PricePerItem(NQty, NPrice) + 'Dim SQL As String = "" + 'Dim Obj As New BSDatabase + 'If currentPricePerItem = newPricePerItem Then + ' SQL = "UPDATE List_SG_WAD set QTY=" & NQty & ", Price=" & NPrice & " where ID=" & WadId + 'ElseIf newPrice = 0 And newQty = 0 Then + ' SQL = "UPDATE List_SG_WAD set QTY=0, Price=0, eppw=0 where ID=" & WadId + 'Else + ' SQL = "UPDATE List_SG_WAD set QTY=" & NQty & ", Price=" & NPrice & ", eppw=" & NPPI & " where ID=" & WadId + 'End If + 'Obj.ConnExec(SQL) + Catch ex As Exception + Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmAddQtyWAD control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmAddQtyWAD_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call LoadData() + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnUpdate control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdate.Click + Call SaveData() + If FromView Then Call FrmViewListWads.LoadData() + Close() + End Sub + ''' + ''' Handles the Click event of the btnViewCalc control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnViewCalc_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnViewCalc.Click + 'txtUPPI.Text = PricePerItem(CLng(GeneralHelpers.FluffContent(txtUQty.Text, 0)), + ' CDbl(GeneralHelpers.FluffContent(txtUPrice.Text, 0))) + Try + If CLng(GeneralHelpers.FluffContent(txtUQty.Text, 0)) > 0 Then + txtUPPI.Text = Converters.ConvertToDollars( + CDbl(GeneralHelpers.FluffContent(txtUPrice.Text, 0)) / + CLng(GeneralHelpers.FluffContent(txtUQty.Text, 0))) + End If + Catch ex As Exception + Call LogError(Name, "btnViewCalc_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddShell.Designer.vb b/BSMyLoadersLog/Adding/frmAddShell.Designer.vb index 4090f5b..05c8f5d 100644 --- a/BSMyLoadersLog/Adding/frmAddShell.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddShell.Designer.vb @@ -1,275 +1,277 @@ - _ -Partial Class frmAddShell - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddShell + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddShell)) - 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.txtManu = New System.Windows.Forms.TextBox - Me.txtName = New System.Windows.Forms.TextBox - Me.txtLen = New System.Windows.Forms.TextBox - Me.txtPrice = New System.Windows.Forms.TextBox - Me.nudQty = New System.Windows.Forms.NumericUpDown - Me.cmbGauge = New System.Windows.Forms.ComboBox - Me.ListSGGaugeBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.List_SG_GaugeTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_GaugeTableAdapter - Me.btnAdd = New System.Windows.Forms.Button - Me.btnCancel = New System.Windows.Forms.Button - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - Me.Label7 = New System.Windows.Forms.Label - Me.txtDRAM = New System.Windows.Forms.TextBox - CType(Me.nudQty, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.ListSGGaugeBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(13, 13) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(73, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Manufacturer:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(13, 42) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(38, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Name:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(13, 68) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(42, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Gauge:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(13, 95) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(43, 13) - Me.Label4.TabIndex = 3 - Me.Label4.Text = "Length:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(13, 146) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(26, 13) - Me.Label5.TabIndex = 4 - Me.Label5.Text = "Qty." - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(13, 173) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(34, 13) - Me.Label6.TabIndex = 5 - Me.Label6.Text = "Price:" - ' - 'txtManu - ' - Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtManu.Location = New System.Drawing.Point(105, 13) - Me.txtManu.Name = "txtManu" - Me.txtManu.Size = New System.Drawing.Size(167, 20) - Me.txtManu.TabIndex = 1 - ' - 'txtName - ' - Me.txtName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtName.Location = New System.Drawing.Point(105, 39) - Me.txtName.Name = "txtName" - Me.txtName.Size = New System.Drawing.Size(167, 20) - Me.txtName.TabIndex = 2 - ' - 'txtLen - ' - Me.txtLen.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtLen.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtLen.Location = New System.Drawing.Point(105, 92) - Me.txtLen.Name = "txtLen" - Me.txtLen.Size = New System.Drawing.Size(167, 20) - Me.txtLen.TabIndex = 4 - ' - 'txtPrice - ' - Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPrice.Location = New System.Drawing.Point(105, 170) - Me.txtPrice.Name = "txtPrice" - Me.txtPrice.Size = New System.Drawing.Size(167, 20) - Me.txtPrice.TabIndex = 7 - ' - 'nudQty - ' - Me.nudQty.Location = New System.Drawing.Point(105, 144) - Me.nudQty.Maximum = New Decimal(New Integer() {100000, 0, 0, 0}) - Me.nudQty.Name = "nudQty" - Me.nudQty.Size = New System.Drawing.Size(167, 20) - Me.nudQty.TabIndex = 6 - ' - 'cmbGauge - ' - Me.cmbGauge.DataSource = Me.ListSGGaugeBindingSource - Me.cmbGauge.DisplayMember = "ga" - Me.cmbGauge.FormattingEnabled = True - Me.cmbGauge.Location = New System.Drawing.Point(105, 65) - Me.cmbGauge.Name = "cmbGauge" - Me.cmbGauge.Size = New System.Drawing.Size(167, 21) - Me.cmbGauge.TabIndex = 3 - Me.cmbGauge.ValueMember = "ID" - ' - 'ListSGGaugeBindingSource - ' - Me.ListSGGaugeBindingSource.DataMember = "List_SG_Gauge" - Me.ListSGGaugeBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'List_SG_GaugeTableAdapter - ' - Me.List_SG_GaugeTableAdapter.ClearBeforeFill = True - ' - 'btnAdd - ' - Me.btnAdd.Location = New System.Drawing.Point(30, 206) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(75, 23) - Me.btnAdd.TabIndex = 8 - Me.btnAdd.Text = "Add" - Me.btnAdd.UseVisualStyleBackColor = True - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(168, 206) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 9 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'Label7 - ' - Me.Label7.AutoSize = True - Me.Label7.Location = New System.Drawing.Point(13, 119) - Me.Label7.Name = "Label7" - Me.Label7.Size = New System.Drawing.Size(42, 13) - Me.Label7.TabIndex = 9 - Me.Label7.Text = "DRAM:" - ' - 'txtDRAM - ' - Me.txtDRAM.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtDRAM.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtDRAM.Location = New System.Drawing.Point(105, 119) - Me.txtDRAM.Name = "txtDRAM" - Me.txtDRAM.Size = New System.Drawing.Size(167, 20) - Me.txtDRAM.TabIndex = 5 - ' - 'frmAddShell - ' - Me.AcceptButton = Me.btnAdd - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(287, 259) - Me.Controls.Add(Me.txtDRAM) - Me.Controls.Add(Me.Label7) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnAdd) - Me.Controls.Add(Me.cmbGauge) - Me.Controls.Add(Me.nudQty) - Me.Controls.Add(Me.txtPrice) - Me.Controls.Add(Me.txtLen) - Me.Controls.Add(Me.txtName) - Me.Controls.Add(Me.txtManu) - Me.Controls.Add(Me.Label6) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.HelpProvider1.SetHelpKeyword(Me, "Add Shell Hulls to Inventory") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Add Shell Hulls to Inventory") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmAddShell" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Add Shotshell Hulls" - CType(Me.nudQty, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.ListSGGaugeBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddShell)) + 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.txtManu = New System.Windows.Forms.TextBox + Me.txtName = New System.Windows.Forms.TextBox + Me.txtLen = New System.Windows.Forms.TextBox + Me.txtPrice = New System.Windows.Forms.TextBox + Me.nudQty = New System.Windows.Forms.NumericUpDown + Me.cmbGauge = New System.Windows.Forms.ComboBox + Me.ListSGGaugeBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.List_SG_GaugeTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_GaugeTableAdapter + Me.btnAdd = New System.Windows.Forms.Button + Me.btnCancel = New System.Windows.Forms.Button + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + Me.Label7 = New System.Windows.Forms.Label + Me.txtDRAM = New System.Windows.Forms.TextBox + CType(Me.nudQty, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ListSGGaugeBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(13, 13) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(73, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Manufacturer:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(13, 42) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(38, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Name:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(13, 68) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(42, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Gauge:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(13, 95) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(43, 13) + Me.Label4.TabIndex = 3 + Me.Label4.Text = "Length:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(13, 146) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(26, 13) + Me.Label5.TabIndex = 4 + Me.Label5.Text = "Qty." + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(13, 173) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(34, 13) + Me.Label6.TabIndex = 5 + Me.Label6.Text = "Price:" + ' + 'txtManu + ' + Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtManu.Location = New System.Drawing.Point(105, 13) + Me.txtManu.Name = "txtManu" + Me.txtManu.Size = New System.Drawing.Size(167, 20) + Me.txtManu.TabIndex = 1 + ' + 'txtName + ' + Me.txtName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtName.Location = New System.Drawing.Point(105, 39) + Me.txtName.Name = "txtName" + Me.txtName.Size = New System.Drawing.Size(167, 20) + Me.txtName.TabIndex = 2 + ' + 'txtLen + ' + Me.txtLen.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtLen.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtLen.Location = New System.Drawing.Point(105, 92) + Me.txtLen.Name = "txtLen" + Me.txtLen.Size = New System.Drawing.Size(167, 20) + Me.txtLen.TabIndex = 4 + ' + 'txtPrice + ' + Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPrice.Location = New System.Drawing.Point(105, 170) + Me.txtPrice.Name = "txtPrice" + Me.txtPrice.Size = New System.Drawing.Size(167, 20) + Me.txtPrice.TabIndex = 7 + ' + 'nudQty + ' + Me.nudQty.Location = New System.Drawing.Point(105, 144) + Me.nudQty.Maximum = New Decimal(New Integer() {100000, 0, 0, 0}) + Me.nudQty.Name = "nudQty" + Me.nudQty.Size = New System.Drawing.Size(167, 20) + Me.nudQty.TabIndex = 6 + ' + 'cmbGauge + ' + Me.cmbGauge.DataSource = Me.ListSGGaugeBindingSource + Me.cmbGauge.DisplayMember = "ga" + Me.cmbGauge.FormattingEnabled = True + Me.cmbGauge.Location = New System.Drawing.Point(105, 65) + Me.cmbGauge.Name = "cmbGauge" + Me.cmbGauge.Size = New System.Drawing.Size(167, 21) + Me.cmbGauge.TabIndex = 3 + Me.cmbGauge.ValueMember = "ID" + ' + 'ListSGGaugeBindingSource + ' + Me.ListSGGaugeBindingSource.DataMember = "List_SG_Gauge" + Me.ListSGGaugeBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'List_SG_GaugeTableAdapter + ' + Me.List_SG_GaugeTableAdapter.ClearBeforeFill = True + ' + 'btnAdd + ' + Me.btnAdd.Location = New System.Drawing.Point(30, 206) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(75, 23) + Me.btnAdd.TabIndex = 8 + Me.btnAdd.Text = "Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(168, 206) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 9 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'Label7 + ' + Me.Label7.AutoSize = True + Me.Label7.Location = New System.Drawing.Point(13, 119) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(42, 13) + Me.Label7.TabIndex = 9 + Me.Label7.Text = "DRAM:" + ' + 'txtDRAM + ' + Me.txtDRAM.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtDRAM.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtDRAM.Location = New System.Drawing.Point(105, 119) + Me.txtDRAM.Name = "txtDRAM" + Me.txtDRAM.Size = New System.Drawing.Size(167, 20) + Me.txtDRAM.TabIndex = 5 + ' + 'frmAddShell + ' + Me.AcceptButton = Me.btnAdd + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(287, 259) + Me.Controls.Add(Me.txtDRAM) + Me.Controls.Add(Me.Label7) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.cmbGauge) + Me.Controls.Add(Me.nudQty) + Me.Controls.Add(Me.txtPrice) + Me.Controls.Add(Me.txtLen) + Me.Controls.Add(Me.txtName) + Me.Controls.Add(Me.txtManu) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.HelpProvider1.SetHelpKeyword(Me, "Add Shell Hulls to Inventory") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Add Shell Hulls to Inventory") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmAddShell" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Add Shotshell Hulls" + CType(Me.nudQty, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ListSGGaugeBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - 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 txtManu As System.Windows.Forms.TextBox - Friend WithEvents txtName As System.Windows.Forms.TextBox - Friend WithEvents txtLen As System.Windows.Forms.TextBox - Friend WithEvents txtPrice As System.Windows.Forms.TextBox - Friend WithEvents nudQty As System.Windows.Forms.NumericUpDown - Friend WithEvents cmbGauge As System.Windows.Forms.ComboBox - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents ListSGGaugeBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_SG_GaugeTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_GaugeTableAdapter - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider - Friend WithEvents Label7 As System.Windows.Forms.Label - Friend WithEvents txtDRAM As System.Windows.Forms.TextBox -End Class + End Sub + 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 txtManu As System.Windows.Forms.TextBox + Friend WithEvents txtName As System.Windows.Forms.TextBox + Friend WithEvents txtLen As System.Windows.Forms.TextBox + Friend WithEvents txtPrice As System.Windows.Forms.TextBox + Friend WithEvents nudQty As System.Windows.Forms.NumericUpDown + Friend WithEvents cmbGauge As System.Windows.Forms.ComboBox + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents ListSGGaugeBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_SG_GaugeTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_GaugeTableAdapter + Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + Friend WithEvents Label7 As System.Windows.Forms.Label + Friend WithEvents txtDRAM As System.Windows.Forms.TextBox + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddShell.vb b/BSMyLoadersLog/Adding/frmAddShell.vb index e37af6b..b2372f8 100644 --- a/BSMyLoadersLog/Adding/frmAddShell.vb +++ b/BSMyLoadersLog/Adding/frmAddShell.vb @@ -1,72 +1,122 @@ -Imports BSMyLoadersLog.LoadersClass +'Imports BSMyLoadersLog.LoadersClass +Imports BurnSoft.Applications.MLL.AutoFill Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory -Public Class frmAddShell - Sub AutoLoad() - Try - Dim ObjAF As New AutoFillCollections.ShotGun - txtManu.AutoCompleteCustomSource = ObjAF.List_SG_Case_Manufacturer - txtName.AutoCompleteCustomSource = ObjAF.List_SG_Case_Name - txtLen.AutoCompleteCustomSource = ObjAF.List_SG_Case_Length - txtPrice.AutoCompleteCustomSource = ObjAF.List_SG_Case_Price - txtDRAM.AutoCompleteCustomSource = ObjAF.List_SG_Case_DRAM - Catch ex As Exception - Call LogError(Me.Name, "utoLoad", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub SaveData() - Try - Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) - Dim strName As String = GeneralHelpers.FluffContent(txtName.Text) - Dim GID As Long = cmbGauge.SelectedValue - Dim strGAName As String = cmbGauge.Text - Dim strLen As String = GeneralHelpers.FluffContent(txtLen.Text) - Dim sDRAM As String = GeneralHelpers.FluffContent(txtDRAM.Text) - Dim iQty As Long = nudQty.Value - Dim epps As Double = 0 - Dim dPrice As Double = GeneralHelpers.FluffContent(CDbl(txtPrice.Text), 0) +Namespace Adding + ''' + ''' Class FrmAddShell. + ''' Implements the + ''' + ''' + Public Class FrmAddShell + ' TODO: #20 clean up code + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' Automatics the load. + ''' + ''' + Sub AutoLoad() + Try + 'Dim ObjAF As New AutoFillCollections.ShotGun + 'txtManu.AutoCompleteCustomSource = ObjAF.List_SG_Case_Manufacturer + 'txtName.AutoCompleteCustomSource = ObjAF.List_SG_Case_Name + 'txtLen.AutoCompleteCustomSource = ObjAF.List_SG_Case_Length + 'txtPrice.AutoCompleteCustomSource = ObjAF.List_SG_Case_Price + 'txtDRAM.AutoCompleteCustomSource = ObjAF.List_SG_Case_DRAM + txtManu.AutoCompleteCustomSource = GeneralShotgun.CaseManufacturer(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtName.AutoCompleteCustomSource = GeneralShotgun.CaseName(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtLen.AutoCompleteCustomSource = GeneralShotgun.Length(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtPrice.AutoCompleteCustomSource = GeneralShotgun.Price(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtDRAM.AutoCompleteCustomSource = GeneralShotgun.Dram(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "utoLoad", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Saves the data. + ''' + Sub SaveData() + Try + Dim manufacturer As String = GeneralHelpers.FluffContent(txtManu.Text) + Dim itemName As String = GeneralHelpers.FluffContent(txtName.Text) + Dim gaugeId As Long = cmbGauge.SelectedValue + Dim gaugeName As String = cmbGauge.Text + Dim length As String = GeneralHelpers.FluffContent(txtLen.Text) + Dim dram As String = GeneralHelpers.FluffContent(txtDRAM.Text) + Dim qty As Long = nudQty.Value + 'Dim esitematedPricePerItem As Double = 0 + Dim price As Double = GeneralHelpers.FluffContent(CDbl(txtPrice.Text), 0) - If Not GeneralHelpers.IsRequired(strManu, "Manufacturer", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strName, "Name", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strLen, "Length", Me.Text) Then Exit Sub - If dPrice <> 0 Then - epps = (dPrice / iQty) - End If - Dim Obj As New BSDatabase - Dim SQL As String = "INSERT INTO List_SG_Case (Manufacturer,Name,Gauge," & _ - "GID,Length,Qty,Price,epps,DRAM) VALUES('" & _ - strManu & "','" & strName & "','" & strGAName & _ - "'," & GID & ",'" & strLen & "'," & iQty & _ - "," & dPrice & "," & epps & ",'" & sDRAM & "')" - Obj.ConnExec(SQL) - Dim sAns As String = MsgBox(strManu & " " & strName & " was added to the database." & Chr(10) & "Do you wish to add another?", MsgBoxStyle.YesNo, Me.Text) - If sAns = vbYes Then - txtManu.Text = "" - txtName.Text = "" - txtLen.Text = "" - nudQty.Value = 0 - txtPrice.Text = "" - Else - Me.Close() - End If - Catch ex As Exception - Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmAddShell_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Try - Me.List_SG_GaugeTableAdapter.Fill(Me.MLLDataSet.List_SG_Gauge) - Call AutoLoad() - Catch ex As Exception - Call LogError(Me.Name, "Load", Err.Number, ex.Message.ToString) - End Try - End Sub + If Not GeneralHelpers.IsRequired(manufacturer, "Manufacturer", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(itemName, "Name", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(length, "Length", Text) Then Exit Sub - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub - - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click - Call SaveData() - End Sub -End Class \ No newline at end of file + If Not ShotgunHullInventory.Add(DatabasePath, manufacturer, itemName, + gaugeName, gaugeId, length, qty, price, + dram, _errOut) Then Throw New Exception(_errOut) + 'If price <> 0 Then + ' esitematedPricePerItem = (price / qty) + 'End If + 'Dim Obj As New BSDatabase + 'Dim SQL As String = "INSERT INTO List_SG_Case (Manufacturer,Name,Gauge," & _ + ' "GID,Length,Qty,Price,epps,DRAM) VALUES('" & _ + ' manufacturer & "','" & itemName & "','" & gaugeName & _ + ' "'," & gaugeId & ",'" & length & "'," & qty & _ + ' "," & price & "," & esitematedPricePerItem & ",'" & dram & "')" + 'Obj.ConnExec(SQL) + Dim sAns As String = MsgBox($"{manufacturer} {itemName} was added to the database. +{Environment.NewLine} Do you wish to add another?", + MsgBoxStyle.YesNo, Text) + If sAns = vbYes Then + txtManu.Text = "" + txtName.Text = "" + txtLen.Text = "" + nudQty.Value = 0 + txtPrice.Text = "" + Else + Close() + End If + Catch ex As Exception + Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmAddShell control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmAddShell_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Try + List_SG_GaugeTableAdapter.Fill(MLLDataSet.List_SG_Gauge) + Call AutoLoad() + Catch ex As Exception + Call LogError(Name, "Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnAdd control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click + Call SaveData() + End Sub + End Class +End Namespace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddShells.Designer.vb b/BSMyLoadersLog/Adding/frmAddShells.Designer.vb index f4b4846..ebf97a0 100644 --- a/BSMyLoadersLog/Adding/frmAddShells.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddShells.Designer.vb @@ -1,303 +1,305 @@ - _ -Partial Class frmAddShells - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddShells + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddShells)) - 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.txtManu = New System.Windows.Forms.TextBox - Me.txtName = New System.Windows.Forms.TextBox - Me.txtTTL = New System.Windows.Forms.TextBox - Me.chkNew = New System.Windows.Forms.CheckBox - Me.nudUsed = New System.Windows.Forms.NumericUpDown - Me.nudQty = New System.Windows.Forms.NumericUpDown - Me.txtPrice = New System.Windows.Forms.TextBox - Me.btnAdd = New System.Windows.Forms.Button - Me.btnCancel = New System.Windows.Forms.Button - Me.Label8 = New System.Windows.Forms.Label - Me.cmbCal = New System.Windows.Forms.ComboBox - Me.ListCalibersBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.List_CalibersTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_CalibersTableAdapter - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - CType(Me.nudUsed, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.nudQty, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.ListCalibersBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(12, 9) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(73, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Manufacturer:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(12, 37) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(38, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Name:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(12, 89) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(78, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Trim to Length:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(12, 114) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(90, 13) - Me.Label4.TabIndex = 3 - Me.Label4.Text = "New Shell/Case?" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(12, 141) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(118, 13) - Me.Label5.TabIndex = 4 - Me.Label5.Text = "Number of Times Used:" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(12, 164) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(26, 13) - Me.Label6.TabIndex = 5 - Me.Label6.Text = "Qty:" - ' - 'Label7 - ' - Me.Label7.AutoSize = True - Me.Label7.Location = New System.Drawing.Point(12, 191) - Me.Label7.Name = "Label7" - Me.Label7.Size = New System.Drawing.Size(34, 13) - Me.Label7.TabIndex = 6 - Me.Label7.Text = "Price:" - ' - 'txtManu - ' - Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtManu.Location = New System.Drawing.Point(132, 8) - Me.txtManu.Name = "txtManu" - Me.txtManu.Size = New System.Drawing.Size(198, 20) - Me.txtManu.TabIndex = 1 - ' - 'txtName - ' - Me.txtName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtName.Location = New System.Drawing.Point(132, 34) - Me.txtName.Name = "txtName" - Me.txtName.Size = New System.Drawing.Size(198, 20) - Me.txtName.TabIndex = 2 - ' - 'txtTTL - ' - Me.txtTTL.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtTTL.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtTTL.Location = New System.Drawing.Point(132, 86) - Me.txtTTL.Name = "txtTTL" - Me.txtTTL.Size = New System.Drawing.Size(198, 20) - Me.txtTTL.TabIndex = 4 - ' - 'chkNew - ' - Me.chkNew.AutoSize = True - Me.chkNew.Location = New System.Drawing.Point(132, 113) - Me.chkNew.Name = "chkNew" - Me.chkNew.Size = New System.Drawing.Size(44, 17) - Me.chkNew.TabIndex = 5 - Me.chkNew.Text = "Yes" - Me.chkNew.UseVisualStyleBackColor = True - ' - 'nudUsed - ' - Me.nudUsed.Location = New System.Drawing.Point(132, 136) - Me.nudUsed.Maximum = New Decimal(New Integer() {100000, 0, 0, 0}) - Me.nudUsed.Name = "nudUsed" - Me.nudUsed.RightToLeft = System.Windows.Forms.RightToLeft.No - Me.nudUsed.Size = New System.Drawing.Size(198, 20) - Me.nudUsed.TabIndex = 6 - ' - 'nudQty - ' - Me.nudQty.Location = New System.Drawing.Point(132, 162) - Me.nudQty.Maximum = New Decimal(New Integer() {100000, 0, 0, 0}) - Me.nudQty.Name = "nudQty" - Me.nudQty.RightToLeft = System.Windows.Forms.RightToLeft.No - Me.nudQty.Size = New System.Drawing.Size(198, 20) - Me.nudQty.TabIndex = 7 - ' - 'txtPrice - ' - Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPrice.Location = New System.Drawing.Point(132, 188) - Me.txtPrice.Name = "txtPrice" - Me.txtPrice.Size = New System.Drawing.Size(198, 20) - Me.txtPrice.TabIndex = 8 - ' - 'btnAdd - ' - Me.btnAdd.Location = New System.Drawing.Point(44, 216) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(75, 23) - Me.btnAdd.TabIndex = 9 - Me.btnAdd.Text = "Add" - Me.btnAdd.UseVisualStyleBackColor = True - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(215, 216) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 10 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'Label8 - ' - Me.Label8.AutoSize = True - Me.Label8.Location = New System.Drawing.Point(12, 62) - Me.Label8.Name = "Label8" - Me.Label8.Size = New System.Drawing.Size(60, 13) - Me.Label8.TabIndex = 10 - Me.Label8.Text = "For Caliber:" - ' - 'cmbCal - ' - Me.cmbCal.DataSource = Me.ListCalibersBindingSource - Me.cmbCal.DisplayMember = "Cal" - Me.cmbCal.FormattingEnabled = True - Me.cmbCal.Location = New System.Drawing.Point(132, 59) - Me.cmbCal.Name = "cmbCal" - Me.cmbCal.Size = New System.Drawing.Size(198, 21) - Me.cmbCal.TabIndex = 3 - Me.cmbCal.ValueMember = "ID" - ' - 'ListCalibersBindingSource - ' - Me.ListCalibersBindingSource.DataMember = "List_Calibers" - Me.ListCalibersBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'List_CalibersTableAdapter - ' - Me.List_CalibersTableAdapter.ClearBeforeFill = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmAddShells - ' - Me.AcceptButton = Me.btnAdd - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(339, 251) - Me.Controls.Add(Me.cmbCal) - Me.Controls.Add(Me.Label8) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnAdd) - Me.Controls.Add(Me.txtPrice) - Me.Controls.Add(Me.nudQty) - Me.Controls.Add(Me.nudUsed) - Me.Controls.Add(Me.chkNew) - Me.Controls.Add(Me.txtTTL) - Me.Controls.Add(Me.txtName) - Me.Controls.Add(Me.txtManu) - Me.Controls.Add(Me.Label7) - Me.Controls.Add(Me.Label6) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.HelpProvider1.SetHelpKeyword(Me, "Add Cases to Inventory") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Add Cases to Inventory") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmAddShells" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Add Shells/Cases to Inventory" - CType(Me.nudUsed, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.nudQty, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.ListCalibersBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddShells)) + 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.txtManu = New System.Windows.Forms.TextBox + Me.txtName = New System.Windows.Forms.TextBox + Me.txtTTL = New System.Windows.Forms.TextBox + Me.chkNew = New System.Windows.Forms.CheckBox + Me.nudUsed = New System.Windows.Forms.NumericUpDown + Me.nudQty = New System.Windows.Forms.NumericUpDown + Me.txtPrice = New System.Windows.Forms.TextBox + Me.btnAdd = New System.Windows.Forms.Button + Me.btnCancel = New System.Windows.Forms.Button + Me.Label8 = New System.Windows.Forms.Label + Me.cmbCal = New System.Windows.Forms.ComboBox + Me.ListCalibersBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.List_CalibersTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_CalibersTableAdapter + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + CType(Me.nudUsed, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.nudQty, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ListCalibersBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 9) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(73, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Manufacturer:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 37) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(38, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Name:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(12, 89) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(78, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Trim to Length:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(12, 114) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(90, 13) + Me.Label4.TabIndex = 3 + Me.Label4.Text = "New Shell/Case?" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(12, 141) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(118, 13) + Me.Label5.TabIndex = 4 + Me.Label5.Text = "Number of Times Used:" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(12, 164) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(26, 13) + Me.Label6.TabIndex = 5 + Me.Label6.Text = "Qty:" + ' + 'Label7 + ' + Me.Label7.AutoSize = True + Me.Label7.Location = New System.Drawing.Point(12, 191) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(34, 13) + Me.Label7.TabIndex = 6 + Me.Label7.Text = "Price:" + ' + 'txtManu + ' + Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtManu.Location = New System.Drawing.Point(132, 8) + Me.txtManu.Name = "txtManu" + Me.txtManu.Size = New System.Drawing.Size(198, 20) + Me.txtManu.TabIndex = 1 + ' + 'txtName + ' + Me.txtName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtName.Location = New System.Drawing.Point(132, 34) + Me.txtName.Name = "txtName" + Me.txtName.Size = New System.Drawing.Size(198, 20) + Me.txtName.TabIndex = 2 + ' + 'txtTTL + ' + Me.txtTTL.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtTTL.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtTTL.Location = New System.Drawing.Point(132, 86) + Me.txtTTL.Name = "txtTTL" + Me.txtTTL.Size = New System.Drawing.Size(198, 20) + Me.txtTTL.TabIndex = 4 + ' + 'chkNew + ' + Me.chkNew.AutoSize = True + Me.chkNew.Location = New System.Drawing.Point(132, 113) + Me.chkNew.Name = "chkNew" + Me.chkNew.Size = New System.Drawing.Size(44, 17) + Me.chkNew.TabIndex = 5 + Me.chkNew.Text = "Yes" + Me.chkNew.UseVisualStyleBackColor = True + ' + 'nudUsed + ' + Me.nudUsed.Location = New System.Drawing.Point(132, 136) + Me.nudUsed.Maximum = New Decimal(New Integer() {100000, 0, 0, 0}) + Me.nudUsed.Name = "nudUsed" + Me.nudUsed.RightToLeft = System.Windows.Forms.RightToLeft.No + Me.nudUsed.Size = New System.Drawing.Size(198, 20) + Me.nudUsed.TabIndex = 6 + ' + 'nudQty + ' + Me.nudQty.Location = New System.Drawing.Point(132, 162) + Me.nudQty.Maximum = New Decimal(New Integer() {100000, 0, 0, 0}) + Me.nudQty.Name = "nudQty" + Me.nudQty.RightToLeft = System.Windows.Forms.RightToLeft.No + Me.nudQty.Size = New System.Drawing.Size(198, 20) + Me.nudQty.TabIndex = 7 + ' + 'txtPrice + ' + Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPrice.Location = New System.Drawing.Point(132, 188) + Me.txtPrice.Name = "txtPrice" + Me.txtPrice.Size = New System.Drawing.Size(198, 20) + Me.txtPrice.TabIndex = 8 + ' + 'btnAdd + ' + Me.btnAdd.Location = New System.Drawing.Point(44, 216) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(75, 23) + Me.btnAdd.TabIndex = 9 + Me.btnAdd.Text = "Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(215, 216) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 10 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'Label8 + ' + Me.Label8.AutoSize = True + Me.Label8.Location = New System.Drawing.Point(12, 62) + Me.Label8.Name = "Label8" + Me.Label8.Size = New System.Drawing.Size(60, 13) + Me.Label8.TabIndex = 10 + Me.Label8.Text = "For Caliber:" + ' + 'cmbCal + ' + Me.cmbCal.DataSource = Me.ListCalibersBindingSource + Me.cmbCal.DisplayMember = "Cal" + Me.cmbCal.FormattingEnabled = True + Me.cmbCal.Location = New System.Drawing.Point(132, 59) + Me.cmbCal.Name = "cmbCal" + Me.cmbCal.Size = New System.Drawing.Size(198, 21) + Me.cmbCal.TabIndex = 3 + Me.cmbCal.ValueMember = "ID" + ' + 'ListCalibersBindingSource + ' + Me.ListCalibersBindingSource.DataMember = "List_Calibers" + Me.ListCalibersBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'List_CalibersTableAdapter + ' + Me.List_CalibersTableAdapter.ClearBeforeFill = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmAddShells + ' + Me.AcceptButton = Me.btnAdd + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(339, 251) + Me.Controls.Add(Me.cmbCal) + Me.Controls.Add(Me.Label8) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.txtPrice) + Me.Controls.Add(Me.nudQty) + Me.Controls.Add(Me.nudUsed) + Me.Controls.Add(Me.chkNew) + Me.Controls.Add(Me.txtTTL) + Me.Controls.Add(Me.txtName) + Me.Controls.Add(Me.txtManu) + Me.Controls.Add(Me.Label7) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.HelpProvider1.SetHelpKeyword(Me, "Add Cases to Inventory") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Add Cases to Inventory") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmAddShells" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Add Shells/Cases to Inventory" + CType(Me.nudUsed, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.nudQty, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ListCalibersBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - 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 txtManu As System.Windows.Forms.TextBox - Friend WithEvents txtName As System.Windows.Forms.TextBox - Friend WithEvents txtTTL As System.Windows.Forms.TextBox - Friend WithEvents chkNew As System.Windows.Forms.CheckBox - Friend WithEvents nudUsed As System.Windows.Forms.NumericUpDown - Friend WithEvents nudQty As System.Windows.Forms.NumericUpDown - Friend WithEvents txtPrice As System.Windows.Forms.TextBox - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents Label8 As System.Windows.Forms.Label - Friend WithEvents cmbCal As System.Windows.Forms.ComboBox - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents ListCalibersBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_CalibersTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_CalibersTableAdapter - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider -End Class + End Sub + 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 txtManu As System.Windows.Forms.TextBox + Friend WithEvents txtName As System.Windows.Forms.TextBox + Friend WithEvents txtTTL As System.Windows.Forms.TextBox + Friend WithEvents chkNew As System.Windows.Forms.CheckBox + Friend WithEvents nudUsed As System.Windows.Forms.NumericUpDown + Friend WithEvents nudQty As System.Windows.Forms.NumericUpDown + Friend WithEvents txtPrice As System.Windows.Forms.TextBox + Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents Label8 As System.Windows.Forms.Label + Friend WithEvents cmbCal As System.Windows.Forms.ComboBox + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents ListCalibersBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_CalibersTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_CalibersTableAdapter + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddShells.vb b/BSMyLoadersLog/Adding/frmAddShells.vb index 3948ec5..6bf8844 100644 --- a/BSMyLoadersLog/Adding/frmAddShells.vb +++ b/BSMyLoadersLog/Adding/frmAddShells.vb @@ -1,60 +1,105 @@ -Imports BSMyLoadersLog.LoadersClass +'Imports BSMyLoadersLog.LoadersClass Imports BSMyLoadersLog.Viewing +Imports BurnSoft.Applications.MLL.AutoFill Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory -Public Class frmAddShells - Public FromView As Boolean - Sub AutoFill() - Try - Dim ObjAf As New AutoFillCollections - txtManu.AutoCompleteCustomSource = ObjAf.List_Case_Manufacturer - txtName.AutoCompleteCustomSource = ObjAf.List_Case_Name - txtTTL.AutoCompleteCustomSource = ObjAf.List_Case_Trim_to_length - txtPrice.AutoCompleteCustomSource = ObjAf.List_Case_Price - Catch ex As Exception - 'Dim ObjFS As New BSFileSystem - 'Dim sMessage As String = "frmAddShells.AutoFill" & "::" & Err.Number & "::" & ex.Message.ToString() - 'ObjFS.LogFile(MyLogFile, sMessage) - Call LogError(Name, "AutoFill", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmAddShells_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Me.List_CalibersTableAdapter.Fill(Me.MLLDataSet.List_Calibers) - Call AutoFill() - End Sub - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click - Try - Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) - Dim strName As String = GeneralHelpers.FluffContent(txtName.Text) - Dim strTrim As Double = GeneralHelpers.FluffContent(CDbl(txtTTL.Text), 0) - Dim intNew As Integer = 0 - Dim intUsed As Integer = nudUsed.Value - Dim intQty As Integer = nudQty.Value - Dim dbPrice As Double = GeneralHelpers.FluffContent(CDbl(txtPrice.Text), 0) - Dim LngCalID As Long = cmbCal.SelectedValue - If Not GeneralHelpers.IsRequired(strManu, "Manufacturer", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strName, "Name", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strTrim, "Trim to Lenght", Me.Text) Then Exit Sub - If chkNew.Checked Then intNew = 1 - Dim EstCostPerItem As Double = 0 - If dbPrice <> 0 Then - EstCostPerItem = (dbPrice / intQty) - End If - Dim Obj As New BSDatabase - Dim SQL As String = "INSERT INTO List_Case (Manufacturer,Name,ttl," & _ - "IsNew,Qty,Price,CID, ePPC,TimesUsed) VALUES('" & strManu & "','" & strName & "','" & strTrim & _ - "'," & intNew & "," & intQty & "," & dbPrice & "," & LngCalID & "," & EstCostPerItem & "," & intUsed & ")" - Obj.ConnExec(SQL) - If FromView Then Call FrmViewListShells.LoadData() - Me.Close() - Catch ex As Exception - 'Dim ObjFS As New BSFileSystem - 'Dim sMessage As String = "frmAddShells.btnAdd.Click" & "::" & Err.Number & "::" & ex.Message.ToString() - 'ObjFS.LogFile(MyLogFile, sMessage) - Call LogError(Name, "btnAdd_Click", Err.Number, ex.Message.ToString) - End Try - End Sub -End Class \ No newline at end of file +Namespace Adding + + ''' + ''' Class frmAddShells. + ''' Implements the + ''' + ''' + Public Class FrmAddShells + ' TODO: #20 clean up code + ''' + ''' The error out + ''' + Dim _errOut as String + ''' + ''' From view + ''' + Public FromView As Boolean + Sub AutoFill() + Try + 'Dim ObjAf As New AutoFillCollections + 'txtManu.AutoCompleteCustomSource = ObjAf.List_Case_Manufacturer + 'txtName.AutoCompleteCustomSource = ObjAf.List_Case_Name + 'txtTTL.AutoCompleteCustomSource = ObjAf.List_Case_Trim_to_length + 'txtPrice.AutoCompleteCustomSource = ObjAf.List_Case_Price + txtManu.AutoCompleteCustomSource = Cases.Manufacturer(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtName.AutoCompleteCustomSource = Cases.Name(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtTTL.AutoCompleteCustomSource = Cases.TrimToLength(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtPrice.AutoCompleteCustomSource = Cases.Price(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Catch ex As Exception + 'Dim ObjFS As New BSFileSystem + 'Dim sMessage As String = "frmAddShells.AutoFill" & "::" & Err.Number & "::" & ex.Message.ToString() + 'ObjFS.LogFile(MyLogFile, sMessage) + Call LogError(Name, "AutoFill", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmAddShells control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmAddShells_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + List_CalibersTableAdapter.Fill(MLLDataSet.List_Calibers) + Call AutoFill() + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnAdd control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click + Try + Dim manufacturer As String = GeneralHelpers.FluffContent(txtManu.Text) + Dim itemName As String = GeneralHelpers.FluffContent(txtName.Text) + Dim trimToLength As Double = GeneralHelpers.FluffContent(CDbl(txtTTL.Text), 0) + 'Dim intNew As Integer = 0 + Dim used As Integer = nudUsed.Value + Dim qty As Integer = nudQty.Value + Dim price As Double = GeneralHelpers.FluffContent(CDbl(txtPrice.Text), 0) + Dim caliberId As Long = cmbCal.SelectedValue + If Not GeneralHelpers.IsRequired(manufacturer, "Manufacturer", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(itemName, "Name", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(trimToLength, "Trim to Lenght", Text) Then Exit Sub + + If Not CaseInventory.Add(DatabasePath, manufacturer, itemName, trimToLength, chkNew.Checked, used, + qty, price, caliberId, _errOut) Then Throw new Exception(_errOut) + + 'If chkNew.Checked Then intNew = 1 + 'Dim EstCostPerItem As Double = 0 + 'If price <> 0 Then + ' EstCostPerItem = (price / qty) + 'End If + 'Dim Obj As New BSDatabase + 'Dim SQL As String = "INSERT INTO List_Case (Manufacturer,Name,ttl," & _ + ' "IsNew,Qty,Price,CID, ePPC,TimesUsed) VALUES('" & manufacturer & "','" & itemName & "','" & trimToLength & _ + ' "'," & intNew & "," & qty & "," & price & "," & caliberId & "," & EstCostPerItem & "," & used & ")" + 'Obj.ConnExec(SQL) + If FromView Then Call FrmViewListShells.LoadData() + Close() + Catch ex As Exception + 'Dim ObjFS As New BSFileSystem + 'Dim sMessage As String = "frmAddShells.btnAdd.Click" & "::" & Err.Number & "::" & ex.Message.ToString() + 'ObjFS.LogFile(MyLogFile, sMessage) + Call LogError(Name, "btnAdd_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddShot.Designer.vb b/BSMyLoadersLog/Adding/frmAddShot.Designer.vb index ed6eec7..beffffc 100644 --- a/BSMyLoadersLog/Adding/frmAddShot.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddShot.Designer.vb @@ -1,226 +1,228 @@ - _ -Partial Class frmAddShot - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddShot + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddShot)) - 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.txtManu = New System.Windows.Forms.TextBox - Me.txtName = New System.Windows.Forms.TextBox - Me.txtMat = New System.Windows.Forms.TextBox - Me.txtPounds = New System.Windows.Forms.TextBox - Me.txtPrice = New System.Windows.Forms.TextBox - Me.btnAdd = New System.Windows.Forms.Button - Me.btnCancel = New System.Windows.Forms.Button - Me.Label7 = New System.Windows.Forms.Label - Me.txtShotNo = New System.Windows.Forms.TextBox - Me.SuspendLayout() - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(13, 62) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(73, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Manufacturer:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(13, 88) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(38, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Name:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(13, 114) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(47, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Material:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(13, 165) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(88, 13) - Me.Label4.TabIndex = 3 - Me.Label4.Text = "Weight (pounds):" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(13, 191) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(34, 13) - Me.Label5.TabIndex = 4 - Me.Label5.Text = "Price:" - ' - 'Label6 - ' - Me.Label6.Location = New System.Drawing.Point(13, 1) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(293, 47) - Me.Label6.TabIndex = 5 - Me.Label6.Text = "This form will allow you to add the pounds of shot that you wish to add to the in" & _ - "ventory. Currently based on a brand new bag of shot being added to the inventor" & _ - "y." - ' - 'txtManu - ' - Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtManu.Location = New System.Drawing.Point(119, 59) - Me.txtManu.Name = "txtManu" - Me.txtManu.Size = New System.Drawing.Size(165, 20) - Me.txtManu.TabIndex = 1 - ' - 'txtName - ' - Me.txtName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtName.Location = New System.Drawing.Point(119, 85) - Me.txtName.Name = "txtName" - Me.txtName.Size = New System.Drawing.Size(165, 20) - Me.txtName.TabIndex = 2 - ' - 'txtMat - ' - Me.txtMat.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtMat.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtMat.Location = New System.Drawing.Point(119, 111) - Me.txtMat.Name = "txtMat" - Me.txtMat.Size = New System.Drawing.Size(165, 20) - Me.txtMat.TabIndex = 3 - ' - 'txtPounds - ' - Me.txtPounds.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPounds.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPounds.Location = New System.Drawing.Point(119, 162) - Me.txtPounds.Name = "txtPounds" - Me.txtPounds.Size = New System.Drawing.Size(165, 20) - Me.txtPounds.TabIndex = 5 - ' - 'txtPrice - ' - Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPrice.Location = New System.Drawing.Point(119, 188) - Me.txtPrice.Name = "txtPrice" - Me.txtPrice.Size = New System.Drawing.Size(165, 20) - Me.txtPrice.TabIndex = 6 - ' - 'btnAdd - ' - Me.btnAdd.Location = New System.Drawing.Point(33, 223) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(75, 23) - Me.btnAdd.TabIndex = 7 - Me.btnAdd.Text = "&Add" - Me.btnAdd.UseVisualStyleBackColor = True - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(187, 222) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 8 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'Label7 - ' - Me.Label7.AutoSize = True - Me.Label7.Location = New System.Drawing.Point(13, 139) - Me.Label7.Name = "Label7" - Me.Label7.Size = New System.Drawing.Size(72, 13) - Me.Label7.TabIndex = 13 - Me.Label7.Text = "Shot Number:" - ' - 'txtShotNo - ' - Me.txtShotNo.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtShotNo.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtShotNo.Location = New System.Drawing.Point(119, 136) - Me.txtShotNo.Name = "txtShotNo" - Me.txtShotNo.Size = New System.Drawing.Size(165, 20) - Me.txtShotNo.TabIndex = 4 - ' - 'frmAddShot - ' - Me.AcceptButton = Me.btnAdd - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(309, 262) - Me.Controls.Add(Me.txtShotNo) - Me.Controls.Add(Me.Label7) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnAdd) - Me.Controls.Add(Me.txtPrice) - Me.Controls.Add(Me.txtPounds) - Me.Controls.Add(Me.txtMat) - Me.Controls.Add(Me.txtName) - Me.Controls.Add(Me.txtManu) - Me.Controls.Add(Me.Label6) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmAddShot" - Me.Text = "Add Shot to Inventory" - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddShot)) + 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.txtManu = New System.Windows.Forms.TextBox + Me.txtName = New System.Windows.Forms.TextBox + Me.txtMat = New System.Windows.Forms.TextBox + Me.txtPounds = New System.Windows.Forms.TextBox + Me.txtPrice = New System.Windows.Forms.TextBox + Me.btnAdd = New System.Windows.Forms.Button + Me.btnCancel = New System.Windows.Forms.Button + Me.Label7 = New System.Windows.Forms.Label + Me.txtShotNo = New System.Windows.Forms.TextBox + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(13, 62) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(73, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Manufacturer:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(13, 88) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(38, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Name:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(13, 114) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(47, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Material:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(13, 165) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(88, 13) + Me.Label4.TabIndex = 3 + Me.Label4.Text = "Weight (pounds):" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(13, 191) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(34, 13) + Me.Label5.TabIndex = 4 + Me.Label5.Text = "Price:" + ' + 'Label6 + ' + Me.Label6.Location = New System.Drawing.Point(13, 1) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(293, 47) + Me.Label6.TabIndex = 5 + Me.Label6.Text = "This form will allow you to add the pounds of shot that you wish to add to the in" & _ + "ventory. Currently based on a brand new bag of shot being added to the inventor" & _ + "y." + ' + 'txtManu + ' + Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtManu.Location = New System.Drawing.Point(119, 59) + Me.txtManu.Name = "txtManu" + Me.txtManu.Size = New System.Drawing.Size(165, 20) + Me.txtManu.TabIndex = 1 + ' + 'txtName + ' + Me.txtName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtName.Location = New System.Drawing.Point(119, 85) + Me.txtName.Name = "txtName" + Me.txtName.Size = New System.Drawing.Size(165, 20) + Me.txtName.TabIndex = 2 + ' + 'txtMat + ' + Me.txtMat.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtMat.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtMat.Location = New System.Drawing.Point(119, 111) + Me.txtMat.Name = "txtMat" + Me.txtMat.Size = New System.Drawing.Size(165, 20) + Me.txtMat.TabIndex = 3 + ' + 'txtPounds + ' + Me.txtPounds.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPounds.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPounds.Location = New System.Drawing.Point(119, 162) + Me.txtPounds.Name = "txtPounds" + Me.txtPounds.Size = New System.Drawing.Size(165, 20) + Me.txtPounds.TabIndex = 5 + ' + 'txtPrice + ' + Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPrice.Location = New System.Drawing.Point(119, 188) + Me.txtPrice.Name = "txtPrice" + Me.txtPrice.Size = New System.Drawing.Size(165, 20) + Me.txtPrice.TabIndex = 6 + ' + 'btnAdd + ' + Me.btnAdd.Location = New System.Drawing.Point(33, 223) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(75, 23) + Me.btnAdd.TabIndex = 7 + Me.btnAdd.Text = "&Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(187, 222) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 8 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'Label7 + ' + Me.Label7.AutoSize = True + Me.Label7.Location = New System.Drawing.Point(13, 139) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(72, 13) + Me.Label7.TabIndex = 13 + Me.Label7.Text = "Shot Number:" + ' + 'txtShotNo + ' + Me.txtShotNo.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtShotNo.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtShotNo.Location = New System.Drawing.Point(119, 136) + Me.txtShotNo.Name = "txtShotNo" + Me.txtShotNo.Size = New System.Drawing.Size(165, 20) + Me.txtShotNo.TabIndex = 4 + ' + 'frmAddShot + ' + Me.AcceptButton = Me.btnAdd + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(309, 262) + Me.Controls.Add(Me.txtShotNo) + Me.Controls.Add(Me.Label7) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.txtPrice) + Me.Controls.Add(Me.txtPounds) + Me.Controls.Add(Me.txtMat) + Me.Controls.Add(Me.txtName) + Me.Controls.Add(Me.txtManu) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmAddShot" + Me.Text = "Add Shot to Inventory" + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - 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 txtManu As System.Windows.Forms.TextBox - Friend WithEvents txtName As System.Windows.Forms.TextBox - Friend WithEvents txtMat As System.Windows.Forms.TextBox - Friend WithEvents txtPounds As System.Windows.Forms.TextBox - Friend WithEvents txtPrice As System.Windows.Forms.TextBox - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents Label7 As System.Windows.Forms.Label - Friend WithEvents txtShotNo As System.Windows.Forms.TextBox -End Class + End Sub + 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 txtManu As System.Windows.Forms.TextBox + Friend WithEvents txtName As System.Windows.Forms.TextBox + Friend WithEvents txtMat As System.Windows.Forms.TextBox + Friend WithEvents txtPounds As System.Windows.Forms.TextBox + Friend WithEvents txtPrice As System.Windows.Forms.TextBox + Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents Label7 As System.Windows.Forms.Label + Friend WithEvents txtShotNo As System.Windows.Forms.TextBox + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddShot.vb b/BSMyLoadersLog/Adding/frmAddShot.vb index 5159289..a6bf957 100644 --- a/BSMyLoadersLog/Adding/frmAddShot.vb +++ b/BSMyLoadersLog/Adding/frmAddShot.vb @@ -1,55 +1,107 @@ -Imports BSMyLoadersLog.LoadersClass +'Imports BSMyLoadersLog.LoadersClass +Imports BSMyLoadersLog.Viewing +Imports BurnSoft.Applications.MLL.AutoFill +'Imports BurnSoft.Applications.MLL.Global Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory -Public Class frmAddShot - Public FromView As Boolean - Sub AutoFill() - Try - Dim ObjAF As New AutoFillCollections.ShotGun - txtManu.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_Manu - txtName.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_Name - txtMat.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_mat - txtShotNo.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_ShotNo - txtPounds.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_weight - txtPrice.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_Price - Catch ex As Exception - Call LogError(Me.Name, "AutoFill", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmAddShot_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call AutoFill() - End Sub +Namespace Adding + ' TODO #20 Code Clean Up + ''' + ''' Class FrmAddShot. + ''' Implements the + ''' + ''' + Public Class FrmAddShot + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' From view + ''' + Public FromView As Boolean + ''' + ''' Automatics the fill. + ''' + ''' + Sub AutoFill() + Try + 'Dim ObjAF As New AutoFillCollections.ShotGun + 'txtManu.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_Manu + 'txtName.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_Name + 'txtMat.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_mat + 'txtShotNo.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_ShotNo + 'txtPounds.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_weight + 'txtPrice.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_Price + txtManu.AutoCompleteCustomSource = GeneralShotgun.TypeDetailsManufacturer(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtName.AutoCompleteCustomSource = GeneralShotgun.TypeDetailsName(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtMat.AutoCompleteCustomSource = GeneralShotgun.TypeDetailsMat(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtShotNo.AutoCompleteCustomSource = GeneralShotgun.TypeDetailsShotNo(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtPounds.AutoCompleteCustomSource = GeneralShotgun.TypeDetailsWeight(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtPrice.AutoCompleteCustomSource = GeneralShotgun.TypeDetailsPrice(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "AutoFill", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmAddShot control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmAddShot_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call AutoFill() + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnAdd control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click + Try + Dim manu As String = GeneralHelpers.FluffContent(txtManu.Text) + Dim sName As String = GeneralHelpers.FluffContent(txtName.Text) + Dim mat As String = GeneralHelpers.FluffContent(txtMat.Text, "LEAD") + Dim shotNo As String = GeneralHelpers.FluffContent(txtShotNo.Text, "0") + Dim weight As String = GeneralHelpers.FluffContent(txtPounds.Text, "0") + Dim cost As Double = GeneralHelpers.FluffContent(CDbl(txtPrice.Text), 0.0) + 'Dim SQL As String = "" + 'Dim Obj As New BSDatabase + 'Dim ounces As Double = WeightValues.WEIGHT_OZ_1LBS * CDbl(Weight) + 'Dim grams As Double = ounces * WeightValues.WEIGHT_GRAMS_OZ + 'Dim epps As Double = 0 + 'If Cost > 0 Then epps = Cost / grams - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub - - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click - Try - Dim Manu As String = GeneralHelpers.FluffContent(txtManu.Text) - Dim Name As String = GeneralHelpers.FluffContent(txtName.Text) - Dim Mat As String = GeneralHelpers.FluffContent(txtMat.Text, "LEAD") - Dim ShotNo As String = GeneralHelpers.FluffContent(txtShotNo.Text, "0") - Dim Weight As String = GeneralHelpers.FluffContent(txtPounds.Text, "0") - Dim Cost As Double = GeneralHelpers.FluffContent(CDbl(txtPrice.Text), 0.0) - Dim SQL As String = "" - Dim Obj As New BSDatabase - Dim ounces As Double = WeightOz1Lbs * CDbl(Weight) - Dim grams As Double = ounces * WeightGramsOz - Dim epps As Double = 0 - If Cost > 0 Then epps = Cost / grams - - If Not GeneralHelpers.IsRequired(Manu, "Manufacturer", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(Name, "Name", Me.Text) Then Exit Sub - - SQL = "INSERT INTO List_SG_ShotType_Details(Manufacturer,Name,mat,ShotNo,weight,Price,ounces,grams,epps,IsSlug) VALUES('" & _ - Manu & "','" & Name & "','" & Mat & "','" & ShotNo & "','" & Weight & "'," & Cost & "," & ounces & _ - "," & grams & "," & epps & ",0)" - Obj.ConnExec(SQL) - If FromView Then Call frmView_List_Shot.LoadData() - Me.Close() - Catch ex As Exception - Call LogError(Me.Name, "btnAdd_Click", Err.Number, ex.Message.ToString) - End Try - End Sub -End Class \ No newline at end of file + If Not GeneralHelpers.IsRequired(manu, "Manufacturer",Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(sName, "Name",Text) Then Exit Sub + ' TODO Add Caliber Field is needed, to double check shit + Dim caliber as String = "" + If Not ShotgunShotTypeInventory.Add(DatabasePath, manu, sName, mat, weight, False, + shotNo, caliber, 0, cost, _errOut) Then Throw new Exception(_errOut) + 'SQL = "INSERT INTO List_SG_ShotType_Details(Manufacturer,Name,mat,ShotNo,weight,Price,ounces,grams,epps,IsSlug) VALUES('" & _ + ' Manu & "','" & Name & "','" & Mat & "','" & ShotNo & "','" & Weight & "'," & Cost & "," & ounces & _ + ' "," & grams & "," & epps & ",0)" + 'Obj.ConnExec(SQL) + If FromView Then Call FrmViewListShot.LoadData() + Close() + Catch ex As Exception + Call LogError(Name, "btnAdd_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddSlugs.Designer.vb b/BSMyLoadersLog/Adding/frmAddSlugs.Designer.vb index fa648ac..998f39d 100644 --- a/BSMyLoadersLog/Adding/frmAddSlugs.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddSlugs.Designer.vb @@ -1,215 +1,217 @@ - _ -Partial Class frmAddSlugs - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddSlugs + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddSlugs)) - Me.Label7 = New System.Windows.Forms.Label - Me.txtPounds = New System.Windows.Forms.TextBox - Me.txtCal = New System.Windows.Forms.TextBox - Me.txtName = New System.Windows.Forms.TextBox - Me.txtManu = New System.Windows.Forms.TextBox - Me.Label4 = New System.Windows.Forms.Label - Me.Label3 = New System.Windows.Forms.Label - Me.Label2 = New System.Windows.Forms.Label - Me.Label1 = New System.Windows.Forms.Label - Me.nudQty = New System.Windows.Forms.NumericUpDown - Me.btnCancel = New System.Windows.Forms.Button - Me.btnAdd = New System.Windows.Forms.Button - Me.Label5 = New System.Windows.Forms.Label - Me.txtPrice = New System.Windows.Forms.TextBox - CType(Me.nudQty, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'Label7 - ' - Me.Label7.AutoSize = True - Me.Label7.Location = New System.Drawing.Point(12, 123) - Me.Label7.Name = "Label7" - Me.Label7.Size = New System.Drawing.Size(26, 13) - Me.Label7.TabIndex = 27 - Me.Label7.Text = "Qty:" - ' - 'txtPounds - ' - Me.txtPounds.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPounds.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPounds.Location = New System.Drawing.Point(118, 95) - Me.txtPounds.Name = "txtPounds" - Me.txtPounds.Size = New System.Drawing.Size(165, 20) - Me.txtPounds.TabIndex = 4 - ' - 'txtCal - ' - Me.txtCal.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtCal.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtCal.Location = New System.Drawing.Point(118, 69) - Me.txtCal.Name = "txtCal" - Me.txtCal.Size = New System.Drawing.Size(165, 20) - Me.txtCal.TabIndex = 3 - ' - 'txtName - ' - Me.txtName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtName.Location = New System.Drawing.Point(118, 43) - Me.txtName.Name = "txtName" - Me.txtName.Size = New System.Drawing.Size(165, 20) - Me.txtName.TabIndex = 2 - ' - 'txtManu - ' - Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtManu.Location = New System.Drawing.Point(118, 17) - Me.txtManu.Name = "txtManu" - Me.txtManu.Size = New System.Drawing.Size(165, 20) - Me.txtManu.TabIndex = 1 - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(12, 98) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(44, 13) - Me.Label4.TabIndex = 18 - Me.Label4.Text = "Weight:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(12, 72) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(42, 13) - Me.Label3.TabIndex = 17 - Me.Label3.Text = "Caliber:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(12, 46) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(38, 13) - Me.Label2.TabIndex = 16 - Me.Label2.Text = "Name:" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(12, 20) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(73, 13) - Me.Label1.TabIndex = 15 - Me.Label1.Text = "Manufacturer:" - ' - 'nudQty - ' - Me.nudQty.Location = New System.Drawing.Point(118, 120) - Me.nudQty.Maximum = New Decimal(New Integer() {10000, 0, 0, 0}) - Me.nudQty.Name = "nudQty" - Me.nudQty.Size = New System.Drawing.Size(165, 20) - Me.nudQty.TabIndex = 5 - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(186, 179) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 8 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'btnAdd - ' - Me.btnAdd.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnAdd.Location = New System.Drawing.Point(32, 180) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(75, 23) - Me.btnAdd.TabIndex = 7 - Me.btnAdd.Text = "&Add" - Me.btnAdd.UseVisualStyleBackColor = True - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(12, 148) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(34, 13) - Me.Label5.TabIndex = 19 - Me.Label5.Text = "Price:" - ' - 'txtPrice - ' - Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPrice.Location = New System.Drawing.Point(118, 145) - Me.txtPrice.Name = "txtPrice" - Me.txtPrice.Size = New System.Drawing.Size(165, 20) - Me.txtPrice.TabIndex = 6 - ' - 'frmAddSlugs - ' - Me.AcceptButton = Me.btnAdd - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(300, 224) - Me.Controls.Add(Me.nudQty) - Me.Controls.Add(Me.Label7) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnAdd) - Me.Controls.Add(Me.txtPrice) - Me.Controls.Add(Me.txtPounds) - Me.Controls.Add(Me.txtCal) - Me.Controls.Add(Me.txtName) - Me.Controls.Add(Me.txtManu) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmAddSlugs" - Me.Text = "Add Slugs to Inventory" - CType(Me.nudQty, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddSlugs)) + Me.Label7 = New System.Windows.Forms.Label + Me.txtPounds = New System.Windows.Forms.TextBox + Me.txtCal = New System.Windows.Forms.TextBox + Me.txtName = New System.Windows.Forms.TextBox + Me.txtManu = New System.Windows.Forms.TextBox + Me.Label4 = New System.Windows.Forms.Label + Me.Label3 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label1 = New System.Windows.Forms.Label + Me.nudQty = New System.Windows.Forms.NumericUpDown + Me.btnCancel = New System.Windows.Forms.Button + Me.btnAdd = New System.Windows.Forms.Button + Me.Label5 = New System.Windows.Forms.Label + Me.txtPrice = New System.Windows.Forms.TextBox + CType(Me.nudQty, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'Label7 + ' + Me.Label7.AutoSize = True + Me.Label7.Location = New System.Drawing.Point(12, 123) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(26, 13) + Me.Label7.TabIndex = 27 + Me.Label7.Text = "Qty:" + ' + 'txtPounds + ' + Me.txtPounds.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPounds.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPounds.Location = New System.Drawing.Point(118, 95) + Me.txtPounds.Name = "txtPounds" + Me.txtPounds.Size = New System.Drawing.Size(165, 20) + Me.txtPounds.TabIndex = 4 + ' + 'txtCal + ' + Me.txtCal.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtCal.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtCal.Location = New System.Drawing.Point(118, 69) + Me.txtCal.Name = "txtCal" + Me.txtCal.Size = New System.Drawing.Size(165, 20) + Me.txtCal.TabIndex = 3 + ' + 'txtName + ' + Me.txtName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtName.Location = New System.Drawing.Point(118, 43) + Me.txtName.Name = "txtName" + Me.txtName.Size = New System.Drawing.Size(165, 20) + Me.txtName.TabIndex = 2 + ' + 'txtManu + ' + Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtManu.Location = New System.Drawing.Point(118, 17) + Me.txtManu.Name = "txtManu" + Me.txtManu.Size = New System.Drawing.Size(165, 20) + Me.txtManu.TabIndex = 1 + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(12, 98) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(44, 13) + Me.Label4.TabIndex = 18 + Me.Label4.Text = "Weight:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(12, 72) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(42, 13) + Me.Label3.TabIndex = 17 + Me.Label3.Text = "Caliber:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 46) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(38, 13) + Me.Label2.TabIndex = 16 + Me.Label2.Text = "Name:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 20) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(73, 13) + Me.Label1.TabIndex = 15 + Me.Label1.Text = "Manufacturer:" + ' + 'nudQty + ' + Me.nudQty.Location = New System.Drawing.Point(118, 120) + Me.nudQty.Maximum = New Decimal(New Integer() {10000, 0, 0, 0}) + Me.nudQty.Name = "nudQty" + Me.nudQty.Size = New System.Drawing.Size(165, 20) + Me.nudQty.TabIndex = 5 + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(186, 179) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 8 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'btnAdd + ' + Me.btnAdd.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnAdd.Location = New System.Drawing.Point(32, 180) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(75, 23) + Me.btnAdd.TabIndex = 7 + Me.btnAdd.Text = "&Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(12, 148) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(34, 13) + Me.Label5.TabIndex = 19 + Me.Label5.Text = "Price:" + ' + 'txtPrice + ' + Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPrice.Location = New System.Drawing.Point(118, 145) + Me.txtPrice.Name = "txtPrice" + Me.txtPrice.Size = New System.Drawing.Size(165, 20) + Me.txtPrice.TabIndex = 6 + ' + 'frmAddSlugs + ' + Me.AcceptButton = Me.btnAdd + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(300, 224) + Me.Controls.Add(Me.nudQty) + Me.Controls.Add(Me.Label7) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.txtPrice) + Me.Controls.Add(Me.txtPounds) + Me.Controls.Add(Me.txtCal) + Me.Controls.Add(Me.txtName) + Me.Controls.Add(Me.txtManu) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmAddSlugs" + Me.Text = "Add Slugs to Inventory" + CType(Me.nudQty, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents Label7 As System.Windows.Forms.Label - Friend WithEvents txtPounds As System.Windows.Forms.TextBox - Friend WithEvents txtCal As System.Windows.Forms.TextBox - Friend WithEvents txtName As System.Windows.Forms.TextBox - Friend WithEvents txtManu As System.Windows.Forms.TextBox - Friend WithEvents Label4 As System.Windows.Forms.Label - Friend WithEvents Label3 As System.Windows.Forms.Label - Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents Label1 As System.Windows.Forms.Label - Friend WithEvents nudQty As System.Windows.Forms.NumericUpDown - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents Label5 As System.Windows.Forms.Label - Friend WithEvents txtPrice As System.Windows.Forms.TextBox -End Class + End Sub + Friend WithEvents Label7 As System.Windows.Forms.Label + Friend WithEvents txtPounds As System.Windows.Forms.TextBox + Friend WithEvents txtCal As System.Windows.Forms.TextBox + Friend WithEvents txtName As System.Windows.Forms.TextBox + Friend WithEvents txtManu As System.Windows.Forms.TextBox + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents nudQty As System.Windows.Forms.NumericUpDown + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents Label5 As System.Windows.Forms.Label + Friend WithEvents txtPrice As System.Windows.Forms.TextBox + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddSlugs.vb b/BSMyLoadersLog/Adding/frmAddSlugs.vb index 6010659..929b956 100644 --- a/BSMyLoadersLog/Adding/frmAddSlugs.vb +++ b/BSMyLoadersLog/Adding/frmAddSlugs.vb @@ -1,55 +1,100 @@ -Imports BSMyLoadersLog.LoadersClass +'Imports BSMyLoadersLog.LoadersClass +Imports BSMyLoadersLog.Viewing +Imports BurnSoft.Applications.MLL.AutoFill Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory -Public Class frmAddSlugs - Public FromView As Boolean - Sub AutoFill() - Try - Dim ObjAF As New AutoFillCollections.ShotGun - txtManu.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_Manu - txtName.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_Name - txtCal.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_CAL - txtPounds.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_weight - txtPrice.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_Price - Catch ex As Exception - Call LogError(Me.Name, "AutoFill", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmAddSlugs_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call AutoFill() - End Sub +Namespace Adding - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub + Public Class FrmAddSlugs + ' TODO #20 Code Clean Up + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' From view + ''' + Public FromView As Boolean + ''' + ''' Automatics the fill. + ''' + ''' + Sub AutoFill() + Try + 'Dim ObjAF As New AutoFillCollections.ShotGun + 'txtManu.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_Manu + 'txtName.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_Name + 'txtCal.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_CAL + 'txtPounds.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_weight + 'txtPrice.AutoCompleteCustomSource = ObjAF.List_SG_SHOTSLUG_Details_Price - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click - Try - Dim Manu As String = GeneralHelpers.FluffContent(txtManu.Text) - Dim Name As String = GeneralHelpers.FluffContent(txtName.Text) - Dim CAL As String = GeneralHelpers.FluffContent(txtCal.Text) - Dim Qty As Integer = nudQty.Value - Dim Weight As String = GeneralHelpers.FluffContent(txtPounds.Text) - Dim Cost As Double = GeneralHelpers.FluffContent(CDbl(txtPrice.Text), 0.0) - Dim epps As Double = 0 - Dim SQL As String = "" - Dim Obj As New BSDatabase + txtManu.AutoCompleteCustomSource = GeneralShotgun.TypeDetailsManufacturer(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtName.AutoCompleteCustomSource = GeneralShotgun.TypeDetailsName(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtCal.AutoCompleteCustomSource = GeneralShotgun.TypeDetailsCaliber(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtPounds.AutoCompleteCustomSource = GeneralShotgun.TypeDetailsWeight(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtPrice.AutoCompleteCustomSource = GeneralShotgun.TypeDetailsPrice(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "AutoFill", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmAddSlugs control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmAddSlugs_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call AutoFill() + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnAdd control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click + Try + Dim manufacturer As String = GeneralHelpers.FluffContent(txtManu.Text) + Dim itemName As String = GeneralHelpers.FluffContent(txtName.Text) + Dim caliber As String = GeneralHelpers.FluffContent(txtCal.Text) + Dim qty As Integer = nudQty.Value + Dim weight As String = GeneralHelpers.FluffContent(txtPounds.Text) + Dim cost As Double = GeneralHelpers.FluffContent(CDbl(txtPrice.Text), 0.0) + 'Dim epps As Double = 0 + 'Dim SQL As String = "" + 'Dim Obj As New BSDatabase - If Not GeneralHelpers.IsRequired(Manu, "Manufacturer", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(Name, "Name", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(CAL, "Caliber", Me.Text) Then Exit Sub - Dim EstCostPerItem As Double = 0 - If Cost <> 0 Then - EstCostPerItem = (Cost / Qty) - End If - epps = EstCostPerItem - SQL = "INSERT INTO List_SG_ShotType_Details(Manufacturer,Name,IsSlug,CAL,QTY,weight,epps,Price) VALUES('" & _ - Manu & "','" & Name & "',1,'" & CAL & "'," & Qty & ",'" & Weight & "'," & epps & "," & Cost & ")" - Obj.ConnExec(SQL) - If FromView Then Call frmView_List_Slug.LoadData() - Me.Close() - Catch ex As Exception - Call LogError(Me.Name, "btnAdd.Click", Err.Number, ex.Message.ToString) - End Try - End Sub -End Class \ No newline at end of file + If Not GeneralHelpers.IsRequired(manufacturer, "Manufacturer", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(itemName, "Name", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(caliber, "Caliber", Text) Then Exit Sub + + If Not ShotgunShotTypeInventory.Add(DatabasePath, manufacturer, itemName, "", weight, True, "", caliber, qty, cost, _errOut) Then Throw New Exception(_errOut) + 'Dim EstCostPerItem As Double = 0 + 'If cost <> 0 Then + ' EstCostPerItem = (cost / qty) + 'End If + 'epps = EstCostPerItem + 'SQL = "INSERT INTO List_SG_ShotType_Details(Manufacturer,Name,IsSlug,CAL,QTY,weight,epps,Price) VALUES('" & _ + ' manufacturer & "','" & name & "',1,'" & caliber & "'," & qty & ",'" & weight & "'," & epps & "," & cost & ")" + 'Obj.ConnExec(SQL) + If FromView Then Call FrmViewListSlug.LoadData() + Close() + Catch ex As Exception + Call LogError(Name, "btnAdd.Click", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddWad.Designer.vb b/BSMyLoadersLog/Adding/frmAddWad.Designer.vb index 5dab60e..5449674 100644 --- a/BSMyLoadersLog/Adding/frmAddWad.Designer.vb +++ b/BSMyLoadersLog/Adding/frmAddWad.Designer.vb @@ -1,248 +1,250 @@ - _ -Partial Class frmAddWad - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmAddWad + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddWad)) - Me.Label1 = New System.Windows.Forms.Label - Me.Label2 = New System.Windows.Forms.Label - Me.txtManu = New System.Windows.Forms.TextBox - Me.txtWAD = New System.Windows.Forms.TextBox - Me.btnAdd = New System.Windows.Forms.Button - Me.btnCancel = New System.Windows.Forms.Button - Me.Label3 = New System.Windows.Forms.Label - Me.Label4 = New System.Windows.Forms.Label - Me.txtPrice = New System.Windows.Forms.TextBox - Me.nudQty = New System.Windows.Forms.NumericUpDown - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - Me.Label5 = New System.Windows.Forms.Label - Me.Label6 = New System.Windows.Forms.Label - Me.cmdGauge = New System.Windows.Forms.ComboBox - Me.ListSGGaugeBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.txtLoad = New System.Windows.Forms.TextBox - Me.List_SG_GaugeTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_GaugeTableAdapter - CType(Me.nudQty, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.ListSGGaugeBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(12, 9) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(73, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Manufacturer:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(12, 40) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(38, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Name:" - ' - 'txtManu - ' - Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtManu.Location = New System.Drawing.Point(103, 9) - Me.txtManu.Name = "txtManu" - Me.txtManu.Size = New System.Drawing.Size(172, 20) - Me.txtManu.TabIndex = 1 - ' - 'txtWAD - ' - Me.txtWAD.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtWAD.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtWAD.Location = New System.Drawing.Point(103, 37) - Me.txtWAD.Name = "txtWAD" - Me.txtWAD.Size = New System.Drawing.Size(172, 20) - Me.txtWAD.TabIndex = 2 - ' - 'btnAdd - ' - Me.btnAdd.Location = New System.Drawing.Point(27, 175) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(75, 23) - Me.btnAdd.TabIndex = 7 - Me.btnAdd.Text = "Add" - Me.btnAdd.UseVisualStyleBackColor = True - ' - 'btnCancel - ' - Me.btnCancel.Location = New System.Drawing.Point(174, 175) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 8 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(12, 116) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(26, 13) - Me.Label3.TabIndex = 6 - Me.Label3.Text = "Qty:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(12, 143) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(34, 13) - Me.Label4.TabIndex = 7 - Me.Label4.Text = "Price:" - ' - 'txtPrice - ' - Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPrice.Location = New System.Drawing.Point(103, 140) - Me.txtPrice.Name = "txtPrice" - Me.txtPrice.Size = New System.Drawing.Size(172, 20) - Me.txtPrice.TabIndex = 6 - ' - 'nudQty - ' - Me.nudQty.Location = New System.Drawing.Point(103, 114) - Me.nudQty.Maximum = New Decimal(New Integer() {10000, 0, 0, 0}) - Me.nudQty.Name = "nudQty" - Me.nudQty.Size = New System.Drawing.Size(172, 20) - Me.nudQty.TabIndex = 5 - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(12, 66) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(42, 13) - Me.Label5.TabIndex = 8 - Me.Label5.Text = "Gauge:" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(12, 92) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(80, 13) - Me.Label6.TabIndex = 9 - Me.Label6.Text = "Max Load (oz.):" - ' - 'cmdGauge - ' - Me.cmdGauge.DataSource = Me.ListSGGaugeBindingSource - Me.cmdGauge.DisplayMember = "ga" - Me.cmdGauge.FormattingEnabled = True - Me.cmdGauge.Location = New System.Drawing.Point(103, 63) - Me.cmdGauge.Name = "cmdGauge" - Me.cmdGauge.Size = New System.Drawing.Size(172, 21) - Me.cmdGauge.TabIndex = 3 - Me.cmdGauge.ValueMember = "ID" - ' - 'ListSGGaugeBindingSource - ' - Me.ListSGGaugeBindingSource.DataMember = "List_SG_Gauge" - Me.ListSGGaugeBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'txtLoad - ' - Me.txtLoad.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtLoad.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtLoad.Location = New System.Drawing.Point(103, 89) - Me.txtLoad.Name = "txtLoad" - Me.txtLoad.Size = New System.Drawing.Size(172, 20) - Me.txtLoad.TabIndex = 4 - ' - 'List_SG_GaugeTableAdapter - ' - Me.List_SG_GaugeTableAdapter.ClearBeforeFill = True - ' - 'frmAddWad - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(287, 224) - Me.Controls.Add(Me.txtLoad) - Me.Controls.Add(Me.cmdGauge) - Me.Controls.Add(Me.Label6) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.nudQty) - Me.Controls.Add(Me.txtPrice) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnAdd) - Me.Controls.Add(Me.txtWAD) - Me.Controls.Add(Me.txtManu) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.HelpProvider1.SetHelpKeyword(Me, "Add WADs to Inventory") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Add WADs to Inventory") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmAddWad" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Add WAD" - CType(Me.nudQty, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.ListSGGaugeBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddWad)) + Me.Label1 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.txtManu = New System.Windows.Forms.TextBox + Me.txtWAD = New System.Windows.Forms.TextBox + Me.btnAdd = New System.Windows.Forms.Button + Me.btnCancel = New System.Windows.Forms.Button + Me.Label3 = New System.Windows.Forms.Label + Me.Label4 = New System.Windows.Forms.Label + Me.txtPrice = New System.Windows.Forms.TextBox + Me.nudQty = New System.Windows.Forms.NumericUpDown + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + Me.Label5 = New System.Windows.Forms.Label + Me.Label6 = New System.Windows.Forms.Label + Me.cmdGauge = New System.Windows.Forms.ComboBox + Me.ListSGGaugeBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.txtLoad = New System.Windows.Forms.TextBox + Me.List_SG_GaugeTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_GaugeTableAdapter + CType(Me.nudQty, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ListSGGaugeBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 9) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(73, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Manufacturer:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 40) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(38, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Name:" + ' + 'txtManu + ' + Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtManu.Location = New System.Drawing.Point(103, 9) + Me.txtManu.Name = "txtManu" + Me.txtManu.Size = New System.Drawing.Size(172, 20) + Me.txtManu.TabIndex = 1 + ' + 'txtWAD + ' + Me.txtWAD.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtWAD.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtWAD.Location = New System.Drawing.Point(103, 37) + Me.txtWAD.Name = "txtWAD" + Me.txtWAD.Size = New System.Drawing.Size(172, 20) + Me.txtWAD.TabIndex = 2 + ' + 'btnAdd + ' + Me.btnAdd.Location = New System.Drawing.Point(27, 175) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(75, 23) + Me.btnAdd.TabIndex = 7 + Me.btnAdd.Text = "Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'btnCancel + ' + Me.btnCancel.Location = New System.Drawing.Point(174, 175) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 8 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(12, 116) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(26, 13) + Me.Label3.TabIndex = 6 + Me.Label3.Text = "Qty:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(12, 143) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(34, 13) + Me.Label4.TabIndex = 7 + Me.Label4.Text = "Price:" + ' + 'txtPrice + ' + Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPrice.Location = New System.Drawing.Point(103, 140) + Me.txtPrice.Name = "txtPrice" + Me.txtPrice.Size = New System.Drawing.Size(172, 20) + Me.txtPrice.TabIndex = 6 + ' + 'nudQty + ' + Me.nudQty.Location = New System.Drawing.Point(103, 114) + Me.nudQty.Maximum = New Decimal(New Integer() {10000, 0, 0, 0}) + Me.nudQty.Name = "nudQty" + Me.nudQty.Size = New System.Drawing.Size(172, 20) + Me.nudQty.TabIndex = 5 + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(12, 66) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(42, 13) + Me.Label5.TabIndex = 8 + Me.Label5.Text = "Gauge:" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(12, 92) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(80, 13) + Me.Label6.TabIndex = 9 + Me.Label6.Text = "Max Load (oz.):" + ' + 'cmdGauge + ' + Me.cmdGauge.DataSource = Me.ListSGGaugeBindingSource + Me.cmdGauge.DisplayMember = "ga" + Me.cmdGauge.FormattingEnabled = True + Me.cmdGauge.Location = New System.Drawing.Point(103, 63) + Me.cmdGauge.Name = "cmdGauge" + Me.cmdGauge.Size = New System.Drawing.Size(172, 21) + Me.cmdGauge.TabIndex = 3 + Me.cmdGauge.ValueMember = "ID" + ' + 'ListSGGaugeBindingSource + ' + Me.ListSGGaugeBindingSource.DataMember = "List_SG_Gauge" + Me.ListSGGaugeBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'txtLoad + ' + Me.txtLoad.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtLoad.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtLoad.Location = New System.Drawing.Point(103, 89) + Me.txtLoad.Name = "txtLoad" + Me.txtLoad.Size = New System.Drawing.Size(172, 20) + Me.txtLoad.TabIndex = 4 + ' + 'List_SG_GaugeTableAdapter + ' + Me.List_SG_GaugeTableAdapter.ClearBeforeFill = True + ' + 'frmAddWad + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(287, 224) + Me.Controls.Add(Me.txtLoad) + Me.Controls.Add(Me.cmdGauge) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.nudQty) + Me.Controls.Add(Me.txtPrice) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.txtWAD) + Me.Controls.Add(Me.txtManu) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.HelpProvider1.SetHelpKeyword(Me, "Add WADs to Inventory") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Add WADs to Inventory") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmAddWad" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Add WAD" + CType(Me.nudQty, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ListSGGaugeBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents Label1 As System.Windows.Forms.Label - Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents txtManu As System.Windows.Forms.TextBox - Friend WithEvents txtWAD As System.Windows.Forms.TextBox - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents Label3 As System.Windows.Forms.Label - Friend WithEvents Label4 As System.Windows.Forms.Label - Friend WithEvents txtPrice As System.Windows.Forms.TextBox - Friend WithEvents nudQty As System.Windows.Forms.NumericUpDown - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider - Friend WithEvents Label5 As System.Windows.Forms.Label - Friend WithEvents Label6 As System.Windows.Forms.Label - Friend WithEvents cmdGauge As System.Windows.Forms.ComboBox - Friend WithEvents txtLoad As System.Windows.Forms.TextBox - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents ListSGGaugeBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_SG_GaugeTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_GaugeTableAdapter -End Class + End Sub + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents txtManu As System.Windows.Forms.TextBox + Friend WithEvents txtWAD As System.Windows.Forms.TextBox + Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents txtPrice As System.Windows.Forms.TextBox + Friend WithEvents nudQty As System.Windows.Forms.NumericUpDown + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + Friend WithEvents Label5 As System.Windows.Forms.Label + Friend WithEvents Label6 As System.Windows.Forms.Label + Friend WithEvents cmdGauge As System.Windows.Forms.ComboBox + Friend WithEvents txtLoad As System.Windows.Forms.TextBox + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents ListSGGaugeBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_SG_GaugeTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_GaugeTableAdapter + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmAddWad.vb b/BSMyLoadersLog/Adding/frmAddWad.vb index 2a65732..b9c78a3 100644 --- a/BSMyLoadersLog/Adding/frmAddWad.vb +++ b/BSMyLoadersLog/Adding/frmAddWad.vb @@ -1,69 +1,108 @@ -Imports BSMyLoadersLog.LoadersClass +'Imports BSMyLoadersLog.LoadersClass +Imports BurnSoft.Applications.MLL.AutoFill Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory -Public Class frmAddWad +Namespace Adding + ' TODO #20 Code Clean Up ''' - ''' The error out + ''' Class FrmAddWad. + ''' Implements the ''' - Dim errOut as String - Sub AutoLoad() - Try - Dim ObjAF As New AutoFillCollections.ShotGun - txtManu.AutoCompleteCustomSource = ObjAF.List_SG_WAD_Manufacturer - txtWAD.AutoCompleteCustomSource = ObjAF.List_SG_WAD_WAD - txtPrice.AutoCompleteCustomSource = ObjAF.List_SG_WAD_Price - Catch ex As Exception - Call LogError(Me.Name, "AutoLoad", Err.Number, ex.Message.ToString) - End Try - End Sub - - Sub SaveData() - Try - Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) - Dim strName As String = GeneralHelpers.FluffContent(txtWAD.Text) - Dim intQty As Integer = nudQty.Value - Dim dPrice As Double = GeneralHelpers.FluffContent(CDbl(txtPrice.Text), 0) - Dim sLoad As String = GeneralHelpers.FluffContent(txtLoad.Text, "0") - Dim dLoad As Double = Converters.ConvertOZToDouble(sLoad, errOut) - Dim GName As String = cmdGauge.Text - Dim GID As Integer = cmdGauge.SelectedValue - Dim eppw As Double = 0 - If Not GeneralHelpers.IsRequired(strManu, "Manufacturer", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strName, "Name", Me.Text) Then Exit Sub - If dPrice <> 0 Then - eppw = (dPrice / intQty) - End If - Dim Obj As New BSDatabase - Dim SQL As String = "INSERT INTO List_SG_WAD (Manufacturer,WAD,Qty,Price,eppw,gauge,GID,load_t,load_d) VALUES('" & _ - strManu & "','" & strName & "'," & intQty & "," & dPrice & "," & eppw & _ - ",'" & GName & "'," & GID & ",'" & sLoad & "'," & dLoad & ")" - Obj.ConnExec(SQL) - Dim sAns As String = MsgBox(strManu & " " & strName & " was added to the database." & _ - Chr(10) & "Do you wish to add another?", MsgBoxStyle.YesNo, Me.Text) - If sAns = vbNo Then - Me.Close() - Else - txtManu.Text = "" - txtWAD.Text = "" - txtLoad.Text = "" - nudQty.Value = 0 - txtPrice.Text = "" - Call AutoLoad() - End If - Catch ex As Exception - Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub + ''' + Public Class FrmAddWad + ''' + ''' The error out + ''' + Dim _errOut as String + ''' + ''' Automatics the load. + ''' + ''' + Sub AutoLoad() + Try + 'Dim ObjAF As New AutoFillCollections.ShotGun + 'txtManu.AutoCompleteCustomSource = ObjAF.List_SG_WAD_Manufacturer + 'txtWAD.AutoCompleteCustomSource = ObjAF.List_SG_WAD_WAD + 'txtPrice.AutoCompleteCustomSource = ObjAF.List_SG_WAD_Price + txtManu.AutoCompleteCustomSource = ConfigShotgun.WadManufacturer(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtWAD.AutoCompleteCustomSource = ConfigShotgun.Wads(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtPrice.AutoCompleteCustomSource = ConfigShotgun.WadPrice(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "AutoLoad", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Saves the data. + ''' + Sub SaveData() + Try + Dim manufacturer As String = GeneralHelpers.FluffContent(txtManu.Text) + Dim itemName As String = GeneralHelpers.FluffContent(txtWAD.Text) + Dim qty As Integer = nudQty.Value + Dim price As Double = GeneralHelpers.FluffContent(CDbl(txtPrice.Text), 0) + Dim loadValue As String = GeneralHelpers.FluffContent(txtLoad.Text, "0") + 'Dim doubleLoadValue As Double = Converters.ConvertOZToDouble(loadValue, errOut) + Dim gaugeName As String = cmdGauge.Text + Dim gaugeId As Integer = cmdGauge.SelectedValue + 'Dim eppw As Double = 0 + If Not GeneralHelpers.IsRequired(manufacturer, "Manufacturer", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(itemName, "Name", Text) Then Exit Sub - Private Sub frmAddWad_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Me.List_SG_GaugeTableAdapter.Fill(Me.MLLDataSet.List_SG_Gauge) - Call AutoLoad() - End Sub + If Not WadInventory.Add(DatabasePath, manufacturer, itemName, gaugeName, gaugeId, + loadValue, qty, price, _errOut) Then Throw new Exception(_errOut) - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click - Call SaveData() - End Sub -End Class \ No newline at end of file + 'If price <> 0 Then + ' eppw = (price / qty) + 'End If + 'Dim Obj As New BSDatabase + 'Dim SQL As String = "INSERT INTO List_SG_WAD (Manufacturer,WAD,Qty,Price,eppw,gauge,GID,load_t,load_d) VALUES('" & _ + ' manufacturer & "','" & itemName & "'," & qty & "," & price & "," & eppw & _ + ' ",'" & gaugeName & "'," & gaugeId & ",'" & loadValue & "'," & doubleLoadValue & ")" + 'Obj.ConnExec(SQL) + Dim sAns As String = MsgBox(manufacturer & " " & itemName & " was added to the database." & _ + Chr(10) & "Do you wish to add another?", MsgBoxStyle.YesNo, Text) + If sAns = vbNo Then + Close() + Else + txtManu.Text = "" + txtWAD.Text = "" + txtLoad.Text = "" + nudQty.Value = 0 + txtPrice.Text = "" + Call AutoLoad() + End If + Catch ex As Exception + Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Load event of the frmAddWad control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmAddWad_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + List_SG_GaugeTableAdapter.Fill(MLLDataSet.List_SG_Gauge) + Call AutoLoad() + End Sub + ''' + ''' Handles the Click event of the btnAdd control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click + Call SaveData() + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard.Designer.vb b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard.Designer.vb index 6bca393..f8453a5 100644 --- a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard.Designer.vb +++ b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard.Designer.vb @@ -1,197 +1,199 @@ - _ -Partial Class frmConfig_Add_Wizard - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmConfigAddWizard + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - MyBase.Dispose(disposing) - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + MyBase.Dispose(disposing) + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmConfig_Add_Wizard)) - Me.Label1 = New System.Windows.Forms.Label - Me.Label2 = New System.Windows.Forms.Label - Me.Label3 = New System.Windows.Forms.Label - Me.txtConfigID = New System.Windows.Forms.TextBox - Me.chkRP = New System.Windows.Forms.CheckBox - Me.chkShotgun = New System.Windows.Forms.CheckBox - Me.cmbCal = New System.Windows.Forms.ComboBox - Me.ListCalibersBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSetBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.List_CalibersTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_CalibersTableAdapter - Me.Label4 = New System.Windows.Forms.Label - Me.btnNext = New System.Windows.Forms.Button - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - CType(Me.ListCalibersBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSetBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(7, 52) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(86, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Configuration ID:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(7, 77) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(34, 13) - Me.Label2.TabIndex = 2 - Me.Label2.Text = "Type:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(7, 102) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(42, 13) - Me.Label3.TabIndex = 3 - Me.Label3.Text = "Caliber:" - ' - 'txtConfigID - ' - Me.txtConfigID.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtConfigID.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtConfigID.Location = New System.Drawing.Point(99, 49) - Me.txtConfigID.Name = "txtConfigID" - Me.txtConfigID.Size = New System.Drawing.Size(195, 20) - Me.txtConfigID.TabIndex = 4 - ' - 'chkRP - ' - Me.chkRP.AutoSize = True - Me.chkRP.Location = New System.Drawing.Point(99, 76) - Me.chkRP.Name = "chkRP" - Me.chkRP.Size = New System.Drawing.Size(77, 17) - Me.chkRP.TabIndex = 5 - Me.chkRP.Text = "Rifle/Pistol" - Me.chkRP.UseVisualStyleBackColor = True - ' - 'chkShotgun - ' - Me.chkShotgun.AutoSize = True - Me.chkShotgun.Location = New System.Drawing.Point(195, 76) - Me.chkShotgun.Name = "chkShotgun" - Me.chkShotgun.Size = New System.Drawing.Size(66, 17) - Me.chkShotgun.TabIndex = 6 - Me.chkShotgun.Text = "Shotgun" - Me.chkShotgun.UseVisualStyleBackColor = True - ' - 'cmbCal - ' - Me.cmbCal.DataSource = Me.ListCalibersBindingSource - Me.cmbCal.DisplayMember = "Cal" - Me.cmbCal.FormattingEnabled = True - Me.cmbCal.Location = New System.Drawing.Point(99, 99) - Me.cmbCal.Name = "cmbCal" - Me.cmbCal.Size = New System.Drawing.Size(195, 21) - Me.cmbCal.TabIndex = 7 - Me.cmbCal.ValueMember = "ID" - ' - 'ListCalibersBindingSource - ' - Me.ListCalibersBindingSource.DataMember = "List_Calibers" - Me.ListCalibersBindingSource.DataSource = Me.MLLDataSetBindingSource - ' - 'MLLDataSetBindingSource - ' - Me.MLLDataSetBindingSource.DataSource = Me.MLLDataSet - Me.MLLDataSetBindingSource.Position = 0 - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'List_CalibersTableAdapter - ' - Me.List_CalibersTableAdapter.ClearBeforeFill = True - ' - 'Label4 - ' - Me.Label4.Location = New System.Drawing.Point(7, 8) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(320, 38) - Me.Label4.TabIndex = 8 - Me.Label4.Text = "The Add Configuration Sheet Wizard will walk you through adding a new load to the" & _ - " database." - ' - 'btnNext - ' - Me.btnNext.Location = New System.Drawing.Point(219, 126) - Me.btnNext.Name = "btnNext" - Me.btnNext.Size = New System.Drawing.Size(75, 23) - Me.btnNext.TabIndex = 9 - Me.btnNext.Text = "Next" - Me.btnNext.UseVisualStyleBackColor = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmConfig_Add_Wizard - ' - Me.AcceptButton = Me.btnNext - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(331, 159) - Me.Controls.Add(Me.btnNext) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.cmbCal) - Me.Controls.Add(Me.chkShotgun) - Me.Controls.Add(Me.chkRP) - Me.Controls.Add(Me.txtConfigID) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.HelpProvider1.SetHelpKeyword(Me, "Adding a New Configuration") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Adding a New Configuration") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmConfig_Add_Wizard" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "Add Configuration Sheet Wizard" - CType(Me.ListCalibersBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSetBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmConfigAddWizard)) + Me.Label1 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label3 = New System.Windows.Forms.Label + Me.txtConfigID = New System.Windows.Forms.TextBox + Me.chkRP = New System.Windows.Forms.CheckBox + Me.chkShotgun = New System.Windows.Forms.CheckBox + Me.cmbCal = New System.Windows.Forms.ComboBox + Me.ListCalibersBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSetBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.List_CalibersTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_CalibersTableAdapter + Me.Label4 = New System.Windows.Forms.Label + Me.btnNext = New System.Windows.Forms.Button + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + CType(Me.ListCalibersBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSetBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(7, 52) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(86, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Configuration ID:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(7, 77) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(34, 13) + Me.Label2.TabIndex = 2 + Me.Label2.Text = "Type:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(7, 102) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(42, 13) + Me.Label3.TabIndex = 3 + Me.Label3.Text = "Caliber:" + ' + 'txtConfigID + ' + Me.txtConfigID.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtConfigID.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtConfigID.Location = New System.Drawing.Point(99, 49) + Me.txtConfigID.Name = "txtConfigID" + Me.txtConfigID.Size = New System.Drawing.Size(195, 20) + Me.txtConfigID.TabIndex = 4 + ' + 'chkRP + ' + Me.chkRP.AutoSize = True + Me.chkRP.Location = New System.Drawing.Point(99, 76) + Me.chkRP.Name = "chkRP" + Me.chkRP.Size = New System.Drawing.Size(77, 17) + Me.chkRP.TabIndex = 5 + Me.chkRP.Text = "Rifle/Pistol" + Me.chkRP.UseVisualStyleBackColor = True + ' + 'chkShotgun + ' + Me.chkShotgun.AutoSize = True + Me.chkShotgun.Location = New System.Drawing.Point(195, 76) + Me.chkShotgun.Name = "chkShotgun" + Me.chkShotgun.Size = New System.Drawing.Size(66, 17) + Me.chkShotgun.TabIndex = 6 + Me.chkShotgun.Text = "Shotgun" + Me.chkShotgun.UseVisualStyleBackColor = True + ' + 'cmbCal + ' + Me.cmbCal.DataSource = Me.ListCalibersBindingSource + Me.cmbCal.DisplayMember = "Cal" + Me.cmbCal.FormattingEnabled = True + Me.cmbCal.Location = New System.Drawing.Point(99, 99) + Me.cmbCal.Name = "cmbCal" + Me.cmbCal.Size = New System.Drawing.Size(195, 21) + Me.cmbCal.TabIndex = 7 + Me.cmbCal.ValueMember = "ID" + ' + 'ListCalibersBindingSource + ' + Me.ListCalibersBindingSource.DataMember = "List_Calibers" + Me.ListCalibersBindingSource.DataSource = Me.MLLDataSetBindingSource + ' + 'MLLDataSetBindingSource + ' + Me.MLLDataSetBindingSource.DataSource = Me.MLLDataSet + Me.MLLDataSetBindingSource.Position = 0 + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'List_CalibersTableAdapter + ' + Me.List_CalibersTableAdapter.ClearBeforeFill = True + ' + 'Label4 + ' + Me.Label4.Location = New System.Drawing.Point(7, 8) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(320, 38) + Me.Label4.TabIndex = 8 + Me.Label4.Text = "The Add Configuration Sheet Wizard will walk you through adding a new load to the" & _ + " database." + ' + 'btnNext + ' + Me.btnNext.Location = New System.Drawing.Point(219, 126) + Me.btnNext.Name = "btnNext" + Me.btnNext.Size = New System.Drawing.Size(75, 23) + Me.btnNext.TabIndex = 9 + Me.btnNext.Text = "Next" + Me.btnNext.UseVisualStyleBackColor = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmConfig_Add_Wizard + ' + Me.AcceptButton = Me.btnNext + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(331, 159) + Me.Controls.Add(Me.btnNext) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.cmbCal) + Me.Controls.Add(Me.chkShotgun) + Me.Controls.Add(Me.chkRP) + Me.Controls.Add(Me.txtConfigID) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.HelpProvider1.SetHelpKeyword(Me, "Adding a New Configuration") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Adding a New Configuration") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "FrmConfigAddWizard" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Add Configuration Sheet Wizard" + CType(Me.ListCalibersBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSetBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - 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 txtConfigID As System.Windows.Forms.TextBox - Friend WithEvents chkRP As System.Windows.Forms.CheckBox - Friend WithEvents chkShotgun As System.Windows.Forms.CheckBox - Friend WithEvents cmbCal As System.Windows.Forms.ComboBox - Friend WithEvents MLLDataSetBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents ListCalibersBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_CalibersTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_CalibersTableAdapter - Friend WithEvents Label4 As System.Windows.Forms.Label - Friend WithEvents btnNext As System.Windows.Forms.Button - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider -End Class + End Sub + 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 txtConfigID As System.Windows.Forms.TextBox + Friend WithEvents chkRP As System.Windows.Forms.CheckBox + Friend WithEvents chkShotgun As System.Windows.Forms.CheckBox + Friend WithEvents cmbCal As System.Windows.Forms.ComboBox + Friend WithEvents MLLDataSetBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents ListCalibersBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_CalibersTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_CalibersTableAdapter + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents btnNext As System.Windows.Forms.Button + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard.vb b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard.vb index d1b05cc..a7f48c4 100644 --- a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard.vb +++ b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard.vb @@ -1,87 +1,132 @@ -Imports BSMyLoadersLog.LoadersClass +'Imports BSMyLoadersLog.LoadersClass +Imports BurnSoft.Applications.MLL.AutoFill +Imports BurnSoft.Applications.MLL.ConfigSheets Imports BurnSoft.Applications.MLL.Helpers -Public Class frmConfig_Add_Wizard - Private Sub frmConfig_Add_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Try - Me.List_CalibersTableAdapter.Fill(Me.MLLDataSet.List_Calibers) - Dim Obj As New AutoFillCollections - txtConfigID.AutoCompleteCustomSource = Obj.ConfigName - chkShotgun.Enabled = UseShotgun - If LoadertypeShotgun And LoadertypeNonshotgun Then - chkShotgun.Checked = False - chkRP.Checked = False - ElseIf LoadertypeNonshotgun And Not LoadertypeShotgun Then - chkShotgun.Checked = False - chkRP.Checked = True - chkShotgun.Enabled = False - ElseIf Not LoadertypeNonshotgun And LoadertypeShotgun Then - chkShotgun.Checked = True - chkRP.Checked = False - chkRP.Enabled = False - End If - Catch ex As Exception - Call LogError(Me.Name, "Load", Err.Number, ex.Message.ToString) - End Try - End Sub - - Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click - Try - Dim strConfigName As String = GeneralHelpers.FluffContent(txtConfigID.Text) - Dim bRP As Boolean = chkRP.Checked - Dim bSG As Boolean = chkShotgun.Checked - Dim lngCal As Long = cmbCal.SelectedValue - Dim LoadType As Integer = 0 - If bSG Then LoadType = 1 - If Not GeneralHelpers.IsRequired(strConfigName, "Configuration ID", Me.Text) Then Exit Sub - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim SQL As String = "" - Dim MyID As Long = 0 - If ObjG.ObjectExistsinDB(strConfigName, "ConfigName", "Config_List_Name") Then - Dim sAns As String = MsgBox(strConfigName & " already exists!" & Chr(10) & "Do you wish to overwrite?", MsgBoxStyle.YesNo) - If sAns = vbYes Then - MyID = ObjG.GetID("SELECT * from Config_list_Name where ConfigName='" & strConfigName & "'") - SQL = "DELETE from Config_List_Powder_Data_NSG where CLNID=" & MyID - Obj.ConnExec(SQL) - SQL = "DELETE from Config_List_Data_NSG where CLNID=" & MyID - Obj.ConnExec(SQL) - Else - Exit Sub +Namespace Adding + ' TODO #20 Code Clean Up + ''' + ''' Class frmConfig_Add_Wizard. + ''' Implements the + ''' + ''' + Public Class FrmConfigAddWizard + ''' + ''' The error out + ''' + Dim _errOut as String + ''' + ''' Handles the Load event of the frmConfig_Add control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmConfig_Add_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Try + List_CalibersTableAdapter.Fill(MLLDataSet.List_Calibers) + 'Dim Obj As New AutoFillCollections + 'txtConfigID.AutoCompleteCustomSource = Obj.ConfigName + txtConfigID.AutoCompleteCustomSource = ConfigMetalic.ConfigName(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + chkShotgun.Enabled = UseShotgun + If LoaderTypeShotGun And LoaderTypeMetalic Then + chkShotgun.Checked = False + chkRP.Checked = False + ElseIf LoaderTypeMetalic And Not LoaderTypeShotGun Then + chkShotgun.Checked = False + chkRP.Checked = True + chkShotgun.Enabled = False + ElseIf Not LoaderTypeMetalic And LoaderTypeShotGun Then + chkShotgun.Checked = True + chkRP.Checked = False + chkRP.Enabled = False End If - Else - SQL = "INSERT INTO Config_List_Name(ConfigName,IsPersonal,IsShotGun) VALUES('" & _ - strConfigName & "',1," & LoadType & ")" - Obj.ConnExec(SQL) - MyID = ObjG.GetID("SELECT * from Config_list_Name where ConfigName='" & strConfigName & "'") - End If - If bRP Then - frmConfig_Add_Wizard_RP_1.ConfigName = strConfigName - frmConfig_Add_Wizard_RP_1.CalID = lngCal - frmConfig_Add_Wizard_RP_1.ConfigID = MyID - frmConfig_Add_Wizard_RP_1.MdiParent = Me.MdiParent - frmConfig_Add_Wizard_RP_1.Show() - Me.Close() - End If - If bSG Then - frmConfig_Add_Wizard_SG_1.ConfigName = strConfigName - frmConfig_Add_Wizard_SG_1.CalID = lngCal - frmConfig_Add_Wizard_SG_1.ConfigID = MyID - frmConfig_Add_Wizard_SG_1.CalName = cmbCal.Text - frmConfig_Add_Wizard_SG_1.MdiParent = Me.MdiParent - frmConfig_Add_Wizard_SG_1.Show() - Me.Close() - End If - Catch ex As Exception - Call LogError(Me.Name, "btnNext", Err.Number, ex.Message.ToString) - End Try - End Sub - - Private Sub chkRP_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkRP.CheckedChanged - If chkShotgun.Checked Then chkShotgun.Checked = False - End Sub - - Private Sub chkShotgun_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkShotgun.CheckedChanged - If chkRP.Checked Then chkRP.Checked = False - End Sub -End Class \ No newline at end of file + Catch ex As Exception + Call LogError(Name, "Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the btnNext control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnNext_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnNext.Click + Try + Dim configName As String = GeneralHelpers.FluffContent(txtConfigID.Text) + Dim isMetallic As Boolean = chkRP.Checked + Dim isShotgun As Boolean = chkShotgun.Checked + Dim caliberId As Long = cmbCal.SelectedValue + 'Dim loadType As Integer = 0 + 'If isShotgun Then loadType = 1 + If Not GeneralHelpers.IsRequired(configName, "Configuration ID", Text) Then Exit Sub + + 'Dim Obj As New BSDatabase + 'Dim ObjG As New GlobalFunctions + 'Dim SQL As String = "" + Dim configId As Long = 0 + If ConfigListDataName.DataExists(DatabasePath, configName, _errOut) Then + Dim sAns As String = MsgBox($"{configName} already exists! {Environment.NewLine} Do you wish to overwrite?", MsgBoxStyle.YesNo) + If sAns = vbNo Then Exit Sub + configId = ConfigListDataName.GetId(DatabasePath, configName, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + If Not ConfigListDataName.Delete(DatabasePath, configId, _errOut) Then Throw New Exception(_errOut) + Else + If Not ConfigListDataName.Add(DatabasePath, configName, True, isShotgun, " ", + True, False, _errOut) Then Throw New Exception(_errOut) + End If + 'If ObjG.ObjectExistsinDB(configName, "ConfigName", "Config_List_Name") Then + ' Dim sAns As String = MsgBox(configName & " already exists!" & Chr(10) & "Do you wish to overwrite?", MsgBoxStyle.YesNo) + ' If sAns = vbYes Then + ' configId = ObjG.GetID("SELECT * from Config_list_Name where ConfigName='" & configName & "'") + ' SQL = "DELETE from Config_List_Powder_Data_NSG where CLNID=" & configId + ' Obj.ConnExec(SQL) + ' SQL = "DELETE from Config_List_Data_NSG where CLNID=" & configId + ' Obj.ConnExec(SQL) + ' Else + ' Exit Sub + ' End If + 'Else + ' SQL = "INSERT INTO Config_List_Name(ConfigName,IsPersonal,IsShotGun) VALUES('" & _ + ' configName & "',1," & loadType & ")" + ' Obj.ConnExec(SQL) + ' configId = ObjG.GetID("SELECT * from Config_list_Name where ConfigName='" & configName & "'") + 'End If + If isMetallic Then + FrmConfigAddWizardRp1.ConfigName = configName + FrmConfigAddWizardRp1.CaliberId = caliberId + FrmConfigAddWizardRp1.ConfigId = configId + FrmConfigAddWizardRp1.MdiParent = MdiParent + FrmConfigAddWizardRp1.Show() + Close() + End If + If isShotgun Then + FrmConfigAddWizardSg1.ConfigName = configName + FrmConfigAddWizardSg1.CaliberId = caliberId + FrmConfigAddWizardSg1.ConfigId = configId + FrmConfigAddWizardSg1.CaliberName = cmbCal.Text + FrmConfigAddWizardSg1.MdiParent = MdiParent + FrmConfigAddWizardSg1.Show() + Close() + End If + Catch ex As Exception + Call LogError(Name, "btnNext", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the CheckedChanged event of the chkRP control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub chkRP_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles chkRP.CheckedChanged + If chkShotgun.Checked Then chkShotgun.Checked = False + End Sub + ''' + ''' Handles the CheckedChanged event of the chkShotgun control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub chkShotgun_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles chkShotgun.CheckedChanged + If chkRP.Checked Then chkRP.Checked = False + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_Powder.Designer.vb b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_Powder.Designer.vb index 714fad1..ca553fb 100644 --- a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_Powder.Designer.vb +++ b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_Powder.Designer.vb @@ -1,329 +1,331 @@ - _ -Partial Class frmConfig_Add_Wizard_Powder - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmConfigAddWizardPowder + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmConfig_Add_Wizard_Powder)) - 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.Label9 = New System.Windows.Forms.Label - Me.Label10 = New System.Windows.Forms.Label - Me.cmbPowder = New System.Windows.Forms.ComboBox - Me.GeneralPowderBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.General_PowderTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.General_PowderTableAdapter - Me.txtLMin = New System.Windows.Forms.TextBox - Me.txtLMid = New System.Windows.Forms.TextBox - Me.txtLMax = New System.Windows.Forms.TextBox - Me.txtMVMin = New System.Windows.Forms.TextBox - Me.txtMVMid = New System.Windows.Forms.TextBox - Me.txtMVMax = New System.Windows.Forms.TextBox - Me.txtCUPSMin = New System.Windows.Forms.TextBox - Me.txtCUPSMid = New System.Windows.Forms.TextBox - Me.txtCUPSMax = New System.Windows.Forms.TextBox - Me.btnAdd = New System.Windows.Forms.Button - Me.btnCancel = New System.Windows.Forms.Button - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - CType(Me.GeneralPowderBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(12, 21) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(46, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Powder:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(12, 49) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(54, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Load Min:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(12, 75) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(102, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Load Mid/Preferred:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(12, 101) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(57, 13) - Me.Label4.TabIndex = 3 - Me.Label4.Text = "Load Max:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(12, 127) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(103, 13) - Me.Label5.TabIndex = 4 - Me.Label5.Text = "Min Muzzle Velocity:" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(12, 152) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(103, 13) - Me.Label6.TabIndex = 5 - Me.Label6.Text = "Mid Muzzle Velocity:" - ' - 'Label7 - ' - Me.Label7.AutoSize = True - Me.Label7.Location = New System.Drawing.Point(12, 179) - Me.Label7.Name = "Label7" - Me.Label7.Size = New System.Drawing.Size(106, 13) - Me.Label7.TabIndex = 6 - Me.Label7.Text = "Max Muzzle Velocity:" - ' - 'Label8 - ' - Me.Label8.AutoSize = True - Me.Label8.Location = New System.Drawing.Point(12, 205) - Me.Label8.Name = "Label8" - Me.Label8.Size = New System.Drawing.Size(112, 13) - Me.Label8.TabIndex = 7 - Me.Label8.Text = "Min Pressure C.U.P.S:" - ' - 'Label9 - ' - Me.Label9.AutoSize = True - Me.Label9.Location = New System.Drawing.Point(12, 229) - Me.Label9.Name = "Label9" - Me.Label9.Size = New System.Drawing.Size(112, 13) - Me.Label9.TabIndex = 8 - Me.Label9.Text = "Mid Pressure C.U.P.S:" - ' - 'Label10 - ' - Me.Label10.AutoSize = True - Me.Label10.Location = New System.Drawing.Point(13, 255) - Me.Label10.Name = "Label10" - Me.Label10.Size = New System.Drawing.Size(115, 13) - Me.Label10.TabIndex = 9 - Me.Label10.Text = "Max Pressure C.U.P.S:" - ' - 'cmbPowder - ' - Me.cmbPowder.DataSource = Me.GeneralPowderBindingSource - Me.cmbPowder.DisplayMember = "Name" - Me.cmbPowder.FormattingEnabled = True - Me.cmbPowder.Location = New System.Drawing.Point(134, 18) - Me.cmbPowder.Name = "cmbPowder" - Me.cmbPowder.Size = New System.Drawing.Size(166, 21) - Me.cmbPowder.TabIndex = 10 - Me.cmbPowder.ValueMember = "ID" - ' - 'GeneralPowderBindingSource - ' - Me.GeneralPowderBindingSource.DataMember = "General_Powder" - Me.GeneralPowderBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'General_PowderTableAdapter - ' - Me.General_PowderTableAdapter.ClearBeforeFill = True - ' - 'txtLMin - ' - Me.txtLMin.Location = New System.Drawing.Point(134, 46) - Me.txtLMin.Name = "txtLMin" - Me.txtLMin.Size = New System.Drawing.Size(166, 20) - Me.txtLMin.TabIndex = 11 - ' - 'txtLMid - ' - Me.txtLMid.Location = New System.Drawing.Point(134, 72) - Me.txtLMid.Name = "txtLMid" - Me.txtLMid.Size = New System.Drawing.Size(166, 20) - Me.txtLMid.TabIndex = 12 - ' - 'txtLMax - ' - Me.txtLMax.Location = New System.Drawing.Point(134, 98) - Me.txtLMax.Name = "txtLMax" - Me.txtLMax.Size = New System.Drawing.Size(166, 20) - Me.txtLMax.TabIndex = 13 - ' - 'txtMVMin - ' - Me.txtMVMin.Location = New System.Drawing.Point(134, 124) - Me.txtMVMin.Name = "txtMVMin" - Me.txtMVMin.Size = New System.Drawing.Size(166, 20) - Me.txtMVMin.TabIndex = 14 - ' - 'txtMVMid - ' - Me.txtMVMid.Location = New System.Drawing.Point(134, 149) - Me.txtMVMid.Name = "txtMVMid" - Me.txtMVMid.Size = New System.Drawing.Size(166, 20) - Me.txtMVMid.TabIndex = 15 - ' - 'txtMVMax - ' - Me.txtMVMax.Location = New System.Drawing.Point(134, 176) - Me.txtMVMax.Name = "txtMVMax" - Me.txtMVMax.Size = New System.Drawing.Size(166, 20) - Me.txtMVMax.TabIndex = 16 - ' - 'txtCUPSMin - ' - Me.txtCUPSMin.Location = New System.Drawing.Point(134, 202) - Me.txtCUPSMin.Name = "txtCUPSMin" - Me.txtCUPSMin.Size = New System.Drawing.Size(166, 20) - Me.txtCUPSMin.TabIndex = 17 - ' - 'txtCUPSMid - ' - Me.txtCUPSMid.Location = New System.Drawing.Point(134, 226) - Me.txtCUPSMid.Name = "txtCUPSMid" - Me.txtCUPSMid.Size = New System.Drawing.Size(166, 20) - Me.txtCUPSMid.TabIndex = 18 - ' - 'txtCUPSMax - ' - Me.txtCUPSMax.Location = New System.Drawing.Point(134, 252) - Me.txtCUPSMax.Name = "txtCUPSMax" - Me.txtCUPSMax.Size = New System.Drawing.Size(166, 20) - Me.txtCUPSMax.TabIndex = 19 - ' - 'btnAdd - ' - Me.btnAdd.Location = New System.Drawing.Point(31, 286) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(83, 23) - Me.btnAdd.TabIndex = 20 - Me.btnAdd.Text = "Add && Finish" - Me.btnAdd.UseVisualStyleBackColor = True - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(178, 286) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 21 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmConfig_Add_Wizard_Powder - ' - Me.AcceptButton = Me.btnAdd - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(318, 321) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnAdd) - Me.Controls.Add(Me.txtCUPSMax) - Me.Controls.Add(Me.txtCUPSMid) - Me.Controls.Add(Me.txtCUPSMin) - Me.Controls.Add(Me.txtMVMax) - Me.Controls.Add(Me.txtMVMid) - Me.Controls.Add(Me.txtMVMin) - Me.Controls.Add(Me.txtLMax) - Me.Controls.Add(Me.txtLMid) - Me.Controls.Add(Me.txtLMin) - Me.Controls.Add(Me.cmbPowder) - Me.Controls.Add(Me.Label10) - Me.Controls.Add(Me.Label9) - Me.Controls.Add(Me.Label8) - Me.Controls.Add(Me.Label7) - Me.Controls.Add(Me.Label6) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.HelpProvider1.SetHelpKeyword(Me, "Adding a New Configuration") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Adding a New Configuration") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmConfig_Add_Wizard_Powder" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "Add Configuration - Powder Details" - CType(Me.GeneralPowderBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmConfigAddWizardPowder)) + 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.Label9 = New System.Windows.Forms.Label + Me.Label10 = New System.Windows.Forms.Label + Me.cmbPowder = New System.Windows.Forms.ComboBox + Me.GeneralPowderBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.General_PowderTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.General_PowderTableAdapter + Me.txtLMin = New System.Windows.Forms.TextBox + Me.txtLMid = New System.Windows.Forms.TextBox + Me.txtLMax = New System.Windows.Forms.TextBox + Me.txtMVMin = New System.Windows.Forms.TextBox + Me.txtMVMid = New System.Windows.Forms.TextBox + Me.txtMVMax = New System.Windows.Forms.TextBox + Me.txtCUPSMin = New System.Windows.Forms.TextBox + Me.txtCUPSMid = New System.Windows.Forms.TextBox + Me.txtCUPSMax = New System.Windows.Forms.TextBox + Me.btnAdd = New System.Windows.Forms.Button + Me.btnCancel = New System.Windows.Forms.Button + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + CType(Me.GeneralPowderBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 21) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(46, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Powder:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 49) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(54, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Load Min:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(12, 75) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(102, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Load Mid/Preferred:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(12, 101) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(57, 13) + Me.Label4.TabIndex = 3 + Me.Label4.Text = "Load Max:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(12, 127) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(103, 13) + Me.Label5.TabIndex = 4 + Me.Label5.Text = "Min Muzzle Velocity:" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(12, 152) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(103, 13) + Me.Label6.TabIndex = 5 + Me.Label6.Text = "Mid Muzzle Velocity:" + ' + 'Label7 + ' + Me.Label7.AutoSize = True + Me.Label7.Location = New System.Drawing.Point(12, 179) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(106, 13) + Me.Label7.TabIndex = 6 + Me.Label7.Text = "Max Muzzle Velocity:" + ' + 'Label8 + ' + Me.Label8.AutoSize = True + Me.Label8.Location = New System.Drawing.Point(12, 205) + Me.Label8.Name = "Label8" + Me.Label8.Size = New System.Drawing.Size(112, 13) + Me.Label8.TabIndex = 7 + Me.Label8.Text = "Min Pressure C.U.P.S:" + ' + 'Label9 + ' + Me.Label9.AutoSize = True + Me.Label9.Location = New System.Drawing.Point(12, 229) + Me.Label9.Name = "Label9" + Me.Label9.Size = New System.Drawing.Size(112, 13) + Me.Label9.TabIndex = 8 + Me.Label9.Text = "Mid Pressure C.U.P.S:" + ' + 'Label10 + ' + Me.Label10.AutoSize = True + Me.Label10.Location = New System.Drawing.Point(13, 255) + Me.Label10.Name = "Label10" + Me.Label10.Size = New System.Drawing.Size(115, 13) + Me.Label10.TabIndex = 9 + Me.Label10.Text = "Max Pressure C.U.P.S:" + ' + 'cmbPowder + ' + Me.cmbPowder.DataSource = Me.GeneralPowderBindingSource + Me.cmbPowder.DisplayMember = "Name" + Me.cmbPowder.FormattingEnabled = True + Me.cmbPowder.Location = New System.Drawing.Point(134, 18) + Me.cmbPowder.Name = "cmbPowder" + Me.cmbPowder.Size = New System.Drawing.Size(166, 21) + Me.cmbPowder.TabIndex = 10 + Me.cmbPowder.ValueMember = "ID" + ' + 'GeneralPowderBindingSource + ' + Me.GeneralPowderBindingSource.DataMember = "General_Powder" + Me.GeneralPowderBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'General_PowderTableAdapter + ' + Me.General_PowderTableAdapter.ClearBeforeFill = True + ' + 'txtLMin + ' + Me.txtLMin.Location = New System.Drawing.Point(134, 46) + Me.txtLMin.Name = "txtLMin" + Me.txtLMin.Size = New System.Drawing.Size(166, 20) + Me.txtLMin.TabIndex = 11 + ' + 'txtLMid + ' + Me.txtLMid.Location = New System.Drawing.Point(134, 72) + Me.txtLMid.Name = "txtLMid" + Me.txtLMid.Size = New System.Drawing.Size(166, 20) + Me.txtLMid.TabIndex = 12 + ' + 'txtLMax + ' + Me.txtLMax.Location = New System.Drawing.Point(134, 98) + Me.txtLMax.Name = "txtLMax" + Me.txtLMax.Size = New System.Drawing.Size(166, 20) + Me.txtLMax.TabIndex = 13 + ' + 'txtMVMin + ' + Me.txtMVMin.Location = New System.Drawing.Point(134, 124) + Me.txtMVMin.Name = "txtMVMin" + Me.txtMVMin.Size = New System.Drawing.Size(166, 20) + Me.txtMVMin.TabIndex = 14 + ' + 'txtMVMid + ' + Me.txtMVMid.Location = New System.Drawing.Point(134, 149) + Me.txtMVMid.Name = "txtMVMid" + Me.txtMVMid.Size = New System.Drawing.Size(166, 20) + Me.txtMVMid.TabIndex = 15 + ' + 'txtMVMax + ' + Me.txtMVMax.Location = New System.Drawing.Point(134, 176) + Me.txtMVMax.Name = "txtMVMax" + Me.txtMVMax.Size = New System.Drawing.Size(166, 20) + Me.txtMVMax.TabIndex = 16 + ' + 'txtCUPSMin + ' + Me.txtCUPSMin.Location = New System.Drawing.Point(134, 202) + Me.txtCUPSMin.Name = "txtCUPSMin" + Me.txtCUPSMin.Size = New System.Drawing.Size(166, 20) + Me.txtCUPSMin.TabIndex = 17 + ' + 'txtCUPSMid + ' + Me.txtCUPSMid.Location = New System.Drawing.Point(134, 226) + Me.txtCUPSMid.Name = "txtCUPSMid" + Me.txtCUPSMid.Size = New System.Drawing.Size(166, 20) + Me.txtCUPSMid.TabIndex = 18 + ' + 'txtCUPSMax + ' + Me.txtCUPSMax.Location = New System.Drawing.Point(134, 252) + Me.txtCUPSMax.Name = "txtCUPSMax" + Me.txtCUPSMax.Size = New System.Drawing.Size(166, 20) + Me.txtCUPSMax.TabIndex = 19 + ' + 'btnAdd + ' + Me.btnAdd.Location = New System.Drawing.Point(31, 286) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(83, 23) + Me.btnAdd.TabIndex = 20 + Me.btnAdd.Text = "Add && Finish" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(178, 286) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 21 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmConfig_Add_Wizard_Powder + ' + Me.AcceptButton = Me.btnAdd + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(318, 321) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.txtCUPSMax) + Me.Controls.Add(Me.txtCUPSMid) + Me.Controls.Add(Me.txtCUPSMin) + Me.Controls.Add(Me.txtMVMax) + Me.Controls.Add(Me.txtMVMid) + Me.Controls.Add(Me.txtMVMin) + Me.Controls.Add(Me.txtLMax) + Me.Controls.Add(Me.txtLMid) + Me.Controls.Add(Me.txtLMin) + Me.Controls.Add(Me.cmbPowder) + Me.Controls.Add(Me.Label10) + Me.Controls.Add(Me.Label9) + Me.Controls.Add(Me.Label8) + Me.Controls.Add(Me.Label7) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.HelpProvider1.SetHelpKeyword(Me, "Adding a New Configuration") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Adding a New Configuration") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "FrmConfigAddWizardPowder" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Add Configuration - Powder Details" + CType(Me.GeneralPowderBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - 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 Label9 As System.Windows.Forms.Label - Friend WithEvents Label10 As System.Windows.Forms.Label - Friend WithEvents cmbPowder As System.Windows.Forms.ComboBox - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents GeneralPowderBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents General_PowderTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.General_PowderTableAdapter - Friend WithEvents txtLMin As System.Windows.Forms.TextBox - Friend WithEvents txtLMid As System.Windows.Forms.TextBox - Friend WithEvents txtLMax As System.Windows.Forms.TextBox - Friend WithEvents txtMVMin As System.Windows.Forms.TextBox - Friend WithEvents txtMVMid As System.Windows.Forms.TextBox - Friend WithEvents txtMVMax As System.Windows.Forms.TextBox - Friend WithEvents txtCUPSMin As System.Windows.Forms.TextBox - Friend WithEvents txtCUPSMid As System.Windows.Forms.TextBox - Friend WithEvents txtCUPSMax As System.Windows.Forms.TextBox - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider -End Class + End Sub + 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 Label9 As System.Windows.Forms.Label + Friend WithEvents Label10 As System.Windows.Forms.Label + Friend WithEvents cmbPowder As System.Windows.Forms.ComboBox + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents GeneralPowderBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents General_PowderTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.General_PowderTableAdapter + Friend WithEvents txtLMin As System.Windows.Forms.TextBox + Friend WithEvents txtLMid As System.Windows.Forms.TextBox + Friend WithEvents txtLMax As System.Windows.Forms.TextBox + Friend WithEvents txtMVMin As System.Windows.Forms.TextBox + Friend WithEvents txtMVMid As System.Windows.Forms.TextBox + Friend WithEvents txtMVMax As System.Windows.Forms.TextBox + Friend WithEvents txtCUPSMin As System.Windows.Forms.TextBox + Friend WithEvents txtCUPSMid As System.Windows.Forms.TextBox + Friend WithEvents txtCUPSMax As System.Windows.Forms.TextBox + Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_Powder.vb b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_Powder.vb index 347067b..c682ab2 100644 --- a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_Powder.vb +++ b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_Powder.vb @@ -1,69 +1,117 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc +'Imports System.Data.Odbc +'Imports BSMyLoadersLog.LoadersClass +Imports BurnSoft.Applications.MLL.ConfigSheets Imports BurnSoft.Applications.MLL.Helpers -Public Class frmConfig_Add_Wizard_Powder - Public ConfigName As String - Public ConfigID As Long - Public FromConfigWiz As Boolean - Private Sub frmConfig_Add_Wizard_Powder_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Try - Me.General_PowderTableAdapter.Fill(Me.MLLDataSet.General_Powder) - Catch ex As Exception - Call LogError(Me.Name, "Load", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub - Private Function HasPerfPowder(ByVal lngID As Long) As Boolean - Dim bAns As Boolean = False - Try - Dim Obj As New BSDatabase - Dim SQL As String = "SELECT * from Config_List_Powder_Data_NSG where CLNID=" & _ - lngID & " and IsPref=1" - Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - bAns = RS.HasRows - RS.Close() - RS = Nothing - CMD = Nothing - Obj.CloseDB() - Catch ex As Exception - Call LogError(Me.Name, "HasPerfPowder", Err.Number, ex.Message.ToString) - End Try - Return bAns - End Function - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click - Try - Dim lngPowderID As Long = cmbPowder.SelectedValue - Dim LMin As Double = GeneralHelpers.FluffContent(txtLMin.Text, 0) - Dim LMid As Double = GeneralHelpers.FluffContent(txtLMid.Text, 0) - Dim LMax As Double = GeneralHelpers.FluffContent(txtLMax.Text, 0) - Dim MVMin As Double = GeneralHelpers.FluffContent(txtMVMin.Text, 0) - Dim MVMid As Double = GeneralHelpers.FluffContent(txtMVMid.Text, 0) - Dim MVMax As Double = GeneralHelpers.FluffContent(txtMVMax.Text, 0) - Dim CUPSMin As Double = GeneralHelpers.FluffContent(txtCUPSMin.Text, 0) - Dim CUPSMid As Double = GeneralHelpers.FluffContent(txtCUPSMid.Text, 0) - Dim CUPSMax As Double = GeneralHelpers.FluffContent(txtCUPSMax.Text, 0) - Dim intPerf As Integer = 0 - If Not HasPerfPowder(ConfigID) Then intPerf = 1 - If Not GeneralHelpers.IsRequired(LMid, 0, "Mid Load/Preferred Load", Me.Text) Then Exit Sub - Dim Obj As New BSDatabase - Dim SQL As String = "INSERT INTO Config_List_Powder_Data_NSG(CLNID,PID," & _ - "Load_Min,Load_Mid,Load_Max,FPS_Min,FPS_MID,FPS_Max," & _ - "CUPS_Min,CUPS_Mid,CUPS_Max,IsPref) VALUES (" & ConfigID & "," & _ - lngPowderID & "," & LMin & "," & LMid & "," & LMax & "," & _ - MVMin & "," & MVMid & "," & MVMax & "," & CUPSMin & "," & _ - CUPSMid & "," & CUPSMax & "," & intPerf & ")" - Obj.ConnExec(SQL) - If FromConfigWiz Then Call MDIParentMain.RefreshConfigData() - Me.Close() - Catch ex As Exception - Call LogError(Me.Name, "btnAdd.Click", Err.Number, ex.Message.ToString) - End Try - End Sub +Namespace Adding + ' TODO #20 Code Clean Up + ''' + ''' Class frmConfig_Add_Wizard_Powder. + ''' Implements the + ''' + ''' + Public Class FrmConfigAddWizardPowder + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' The configuration name + ''' + Public ConfigName As String + ''' + ''' The configuration identifier + ''' + Public ConfigId As Long + ''' + ''' From configuration wiz + ''' + Public FromConfigWiz As Boolean + ''' + ''' Handles the Load event of the frmConfig_Add_Wizard_Powder control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmConfig_Add_Wizard_Powder_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Try + General_PowderTableAdapter.Fill(MLLDataSet.General_Powder) + Catch ex As Exception + Call LogError(Name, "Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub -End Class \ No newline at end of file + ' + 'Private Function HasPerfPowder(ByVal lngID As Long) As Boolean + ' Dim bAns As Boolean = False + ' Try + ' Dim Obj As New BSDatabase + ' Dim SQL As String = "SELECT * from Config_List_Powder_Data_NSG where CLNID=" & _ + ' lngID & " and IsPref=1" + ' Obj.ConnectDB() + ' Dim CMD As New OdbcCommand(SQL, Obj.Conn) + ' Dim RS As OdbcDataReader + ' RS = CMD.ExecuteReader + ' bAns = RS.HasRows + ' RS.Close() + ' RS = Nothing + ' CMD = Nothing + ' Obj.CloseDB() + ' Catch ex As Exception + ' Call LogError(Name, "HasPerfPowder", Err.Number, ex.Message.ToString) + ' End Try + ' Return bAns + 'End Function + ''' + ''' Handles the Click event of the btnAdd control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click + Try + Dim powderId As Long = cmbPowder.SelectedValue + Dim loadMin As Double = GeneralHelpers.FluffContent(txtLMin.Text, 0) + Dim loadMid As Double = GeneralHelpers.FluffContent(txtLMid.Text, 0) + Dim loadMax As Double = GeneralHelpers.FluffContent(txtLMax.Text, 0) + Dim fpsMin As Double = GeneralHelpers.FluffContent(txtMVMin.Text, 0) + Dim fpsMid As Double = GeneralHelpers.FluffContent(txtMVMid.Text, 0) + Dim fpsMax As Double = GeneralHelpers.FluffContent(txtMVMax.Text, 0) + Dim cupsMin As Double = GeneralHelpers.FluffContent(txtCUPSMin.Text, 0) + Dim cupsMid As Double = GeneralHelpers.FluffContent(txtCUPSMid.Text, 0) + Dim cupsMax As Double = GeneralHelpers.FluffContent(txtCUPSMax.Text, 0) + + If Not GeneralHelpers.IsRequired(loadMid, 0, "Mid Load/Preferred Load", Text) Then Exit Sub + + Dim setAsDefault As Boolean = False + ' TODO: #19 UnComment Code when you update is applied + 'If Not ConfigListDataPowder.HasDefaultPowder(DatabasePath, ConfigId, _errOut) Then setAsDefault = True + if _errOut.Length > 0 then Throw new Exception(_errOut) + If Not ConfigListDataPowder.Add(DatabasePath, ConfigId, powderId, loadMin, + loadMid, loadMax, fpsMin, fpsMid, fpsMax, cupsMin, + cupsMid, cupsMax, setAsDefault, _errOut) then Throw new Exception(_errOut) + 'Dim intPerf As Integer = 0 + 'If Not HasPerfPowder(ConfigId) Then intPerf = 1 + 'Dim Obj As New BSDatabase + 'Dim SQL As String = "INSERT INTO Config_List_Powder_Data_NSG(CLNID,PID," & _ + ' "Load_Min,Load_Mid,Load_Max,FPS_Min,FPS_MID,FPS_Max," & _ + ' "CUPS_Min,CUPS_Mid,CUPS_Max,IsPref) VALUES (" & ConfigId & "," & _ + ' powderId & "," & loadMin & "," & loadMid & "," & loadMax & "," & _ + ' fpsMin & "," & fpsMid & "," & fpsMax & "," & cupsMin & "," & _ + ' cupsMid & "," & cupsMax & "," & intPerf & ")" + 'Obj.ConnExec(SQL) + If FromConfigWiz Then Call MdiParentMain.RefreshConfigData() + Close() + Catch ex As Exception + Call LogError(Name, "btnAdd.Click", Err.Number, ex.Message.ToString) + End Try + End Sub + + End Class +End Namespace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_RP_1.Designer.vb b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_RP_1.Designer.vb index 1833fb8..dc5b968 100644 --- a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_RP_1.Designer.vb +++ b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_RP_1.Designer.vb @@ -1,313 +1,315 @@ - _ -Partial Class frmConfig_Add_Wizard_RP_1 - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmConfigAddWizardRp1 + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - MyBase.Dispose(disposing) - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + MyBase.Dispose(disposing) + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmConfig_Add_Wizard_RP_1)) - 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.cmbBullet = New System.Windows.Forms.ComboBox - Me.ListBulletsBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.cmbPrimer = New System.Windows.Forms.ComboBox - Me.GeneralPrimerBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.cmbCase = New System.Windows.Forms.ComboBox - Me.ListCaseBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.chkPersonal = New System.Windows.Forms.CheckBox - Me.chkBook = New System.Windows.Forms.CheckBox - Me.txtLoad = New System.Windows.Forms.TextBox - Me.List_BulletsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_BulletsTableAdapter - Me.General_PrimerTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.General_PrimerTableAdapter - Me.List_CaseTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_CaseTableAdapter - Me.btnAdd = New System.Windows.Forms.Button - Me.btnCancel = New System.Windows.Forms.Button - Me.cmbAmmo = New System.Windows.Forms.ComboBox - Me.GeneralAmmunitionTypeBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.Label6 = New System.Windows.Forms.Label - Me.General_Ammunition_TypeTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.General_Ammunition_TypeTableAdapter - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - CType(Me.ListBulletsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.GeneralPrimerBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.ListCaseBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.GeneralAmmunitionTypeBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(12, 39) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(36, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Bullet:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(12, 66) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(39, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Primer:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(12, 93) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(34, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Case:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(12, 145) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(71, 13) - Me.Label4.TabIndex = 3 - Me.Label4.Text = "Load Source:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(11, 119) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(61, 13) - Me.Label5.TabIndex = 4 - Me.Label5.Text = "Load Type:" - ' - 'cmbBullet - ' - Me.cmbBullet.DataSource = Me.ListBulletsBindingSource - Me.cmbBullet.DisplayMember = "Name" - Me.cmbBullet.FormattingEnabled = True - Me.cmbBullet.Location = New System.Drawing.Point(103, 36) - Me.cmbBullet.Name = "cmbBullet" - Me.cmbBullet.Size = New System.Drawing.Size(172, 21) - Me.cmbBullet.TabIndex = 5 - Me.cmbBullet.ValueMember = "ID" - ' - 'ListBulletsBindingSource - ' - Me.ListBulletsBindingSource.DataMember = "List_Bullets" - Me.ListBulletsBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'cmbPrimer - ' - Me.cmbPrimer.DataSource = Me.GeneralPrimerBindingSource - Me.cmbPrimer.DisplayMember = "Name" - Me.cmbPrimer.FormattingEnabled = True - Me.cmbPrimer.Location = New System.Drawing.Point(103, 63) - Me.cmbPrimer.Name = "cmbPrimer" - Me.cmbPrimer.Size = New System.Drawing.Size(172, 21) - Me.cmbPrimer.TabIndex = 6 - Me.cmbPrimer.ValueMember = "ID" - ' - 'GeneralPrimerBindingSource - ' - Me.GeneralPrimerBindingSource.DataMember = "General_Primer" - Me.GeneralPrimerBindingSource.DataSource = Me.MLLDataSet - ' - 'cmbCase - ' - Me.cmbCase.DataSource = Me.ListCaseBindingSource - Me.cmbCase.DisplayMember = "Name" - Me.cmbCase.FormattingEnabled = True - Me.cmbCase.Location = New System.Drawing.Point(103, 90) - Me.cmbCase.Name = "cmbCase" - Me.cmbCase.Size = New System.Drawing.Size(172, 21) - Me.cmbCase.TabIndex = 7 - Me.cmbCase.ValueMember = "ID" - ' - 'ListCaseBindingSource - ' - Me.ListCaseBindingSource.DataMember = "List_Case" - Me.ListCaseBindingSource.DataSource = Me.MLLDataSet - ' - 'chkPersonal - ' - Me.chkPersonal.AutoSize = True - Me.chkPersonal.Location = New System.Drawing.Point(103, 118) - Me.chkPersonal.Name = "chkPersonal" - Me.chkPersonal.Size = New System.Drawing.Size(67, 17) - Me.chkPersonal.TabIndex = 8 - Me.chkPersonal.Text = "Personal" - Me.chkPersonal.UseVisualStyleBackColor = True - ' - 'chkBook - ' - Me.chkBook.AutoSize = True - Me.chkBook.Location = New System.Drawing.Point(188, 118) - Me.chkBook.Name = "chkBook" - Me.chkBook.Size = New System.Drawing.Size(86, 17) - Me.chkBook.TabIndex = 9 - Me.chkBook.Text = "From a Book" - Me.chkBook.UseVisualStyleBackColor = True - ' - 'txtLoad - ' - Me.txtLoad.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtLoad.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtLoad.Location = New System.Drawing.Point(103, 142) - Me.txtLoad.Name = "txtLoad" - Me.txtLoad.Size = New System.Drawing.Size(171, 20) - Me.txtLoad.TabIndex = 10 - ' - 'List_BulletsTableAdapter - ' - Me.List_BulletsTableAdapter.ClearBeforeFill = True - ' - 'General_PrimerTableAdapter - ' - Me.General_PrimerTableAdapter.ClearBeforeFill = True - ' - 'List_CaseTableAdapter - ' - Me.List_CaseTableAdapter.ClearBeforeFill = True - ' - 'btnAdd - ' - Me.btnAdd.Location = New System.Drawing.Point(44, 180) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(75, 23) - Me.btnAdd.TabIndex = 11 - Me.btnAdd.Text = "Add" - Me.btnAdd.UseVisualStyleBackColor = True - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(188, 180) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 12 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'cmbAmmo - ' - Me.cmbAmmo.DataSource = Me.GeneralAmmunitionTypeBindingSource - Me.cmbAmmo.DisplayMember = "FType" - Me.cmbAmmo.FormattingEnabled = True - Me.cmbAmmo.Location = New System.Drawing.Point(103, 9) - Me.cmbAmmo.Name = "cmbAmmo" - Me.cmbAmmo.Size = New System.Drawing.Size(171, 21) - Me.cmbAmmo.TabIndex = 13 - Me.cmbAmmo.ValueMember = "ID" - ' - 'GeneralAmmunitionTypeBindingSource - ' - Me.GeneralAmmunitionTypeBindingSource.DataMember = "General_Ammunition_Type" - Me.GeneralAmmunitionTypeBindingSource.DataSource = Me.MLLDataSet - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(12, 12) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(66, 13) - Me.Label6.TabIndex = 14 - Me.Label6.Text = "Ammo Type:" - ' - 'General_Ammunition_TypeTableAdapter - ' - Me.General_Ammunition_TypeTableAdapter.ClearBeforeFill = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmConfig_Add_Wizard_RP_1 - ' - Me.AcceptButton = Me.btnAdd - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(291, 214) - Me.Controls.Add(Me.Label6) - Me.Controls.Add(Me.cmbAmmo) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnAdd) - Me.Controls.Add(Me.txtLoad) - Me.Controls.Add(Me.chkBook) - Me.Controls.Add(Me.chkPersonal) - Me.Controls.Add(Me.cmbCase) - Me.Controls.Add(Me.cmbPrimer) - Me.Controls.Add(Me.cmbBullet) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.HelpProvider1.SetHelpKeyword(Me, "Adding a New Configuration") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Adding a New Configuration") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmConfig_Add_Wizard_RP_1" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "Add Configuration for Pistols and Rifles" - CType(Me.ListBulletsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.GeneralPrimerBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.ListCaseBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.GeneralAmmunitionTypeBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmConfigAddWizardRp1)) + 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.cmbBullet = New System.Windows.Forms.ComboBox + Me.ListBulletsBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.cmbPrimer = New System.Windows.Forms.ComboBox + Me.GeneralPrimerBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.cmbCase = New System.Windows.Forms.ComboBox + Me.ListCaseBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.chkPersonal = New System.Windows.Forms.CheckBox + Me.chkBook = New System.Windows.Forms.CheckBox + Me.txtLoad = New System.Windows.Forms.TextBox + Me.List_BulletsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_BulletsTableAdapter + Me.General_PrimerTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.General_PrimerTableAdapter + Me.List_CaseTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_CaseTableAdapter + Me.btnAdd = New System.Windows.Forms.Button + Me.btnCancel = New System.Windows.Forms.Button + Me.cmbAmmo = New System.Windows.Forms.ComboBox + Me.GeneralAmmunitionTypeBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.Label6 = New System.Windows.Forms.Label + Me.General_Ammunition_TypeTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.General_Ammunition_TypeTableAdapter + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + CType(Me.ListBulletsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.GeneralPrimerBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ListCaseBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.GeneralAmmunitionTypeBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 39) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(36, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Bullet:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 66) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(39, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Primer:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(12, 93) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(34, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Case:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(12, 145) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(71, 13) + Me.Label4.TabIndex = 3 + Me.Label4.Text = "Load Source:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(11, 119) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(61, 13) + Me.Label5.TabIndex = 4 + Me.Label5.Text = "Load Type:" + ' + 'cmbBullet + ' + Me.cmbBullet.DataSource = Me.ListBulletsBindingSource + Me.cmbBullet.DisplayMember = "Name" + Me.cmbBullet.FormattingEnabled = True + Me.cmbBullet.Location = New System.Drawing.Point(103, 36) + Me.cmbBullet.Name = "cmbBullet" + Me.cmbBullet.Size = New System.Drawing.Size(172, 21) + Me.cmbBullet.TabIndex = 5 + Me.cmbBullet.ValueMember = "ID" + ' + 'ListBulletsBindingSource + ' + Me.ListBulletsBindingSource.DataMember = "List_Bullets" + Me.ListBulletsBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'cmbPrimer + ' + Me.cmbPrimer.DataSource = Me.GeneralPrimerBindingSource + Me.cmbPrimer.DisplayMember = "Name" + Me.cmbPrimer.FormattingEnabled = True + Me.cmbPrimer.Location = New System.Drawing.Point(103, 63) + Me.cmbPrimer.Name = "cmbPrimer" + Me.cmbPrimer.Size = New System.Drawing.Size(172, 21) + Me.cmbPrimer.TabIndex = 6 + Me.cmbPrimer.ValueMember = "ID" + ' + 'GeneralPrimerBindingSource + ' + Me.GeneralPrimerBindingSource.DataMember = "General_Primer" + Me.GeneralPrimerBindingSource.DataSource = Me.MLLDataSet + ' + 'cmbCase + ' + Me.cmbCase.DataSource = Me.ListCaseBindingSource + Me.cmbCase.DisplayMember = "Name" + Me.cmbCase.FormattingEnabled = True + Me.cmbCase.Location = New System.Drawing.Point(103, 90) + Me.cmbCase.Name = "cmbCase" + Me.cmbCase.Size = New System.Drawing.Size(172, 21) + Me.cmbCase.TabIndex = 7 + Me.cmbCase.ValueMember = "ID" + ' + 'ListCaseBindingSource + ' + Me.ListCaseBindingSource.DataMember = "List_Case" + Me.ListCaseBindingSource.DataSource = Me.MLLDataSet + ' + 'chkPersonal + ' + Me.chkPersonal.AutoSize = True + Me.chkPersonal.Location = New System.Drawing.Point(103, 118) + Me.chkPersonal.Name = "chkPersonal" + Me.chkPersonal.Size = New System.Drawing.Size(67, 17) + Me.chkPersonal.TabIndex = 8 + Me.chkPersonal.Text = "Personal" + Me.chkPersonal.UseVisualStyleBackColor = True + ' + 'chkBook + ' + Me.chkBook.AutoSize = True + Me.chkBook.Location = New System.Drawing.Point(188, 118) + Me.chkBook.Name = "chkBook" + Me.chkBook.Size = New System.Drawing.Size(86, 17) + Me.chkBook.TabIndex = 9 + Me.chkBook.Text = "From a Book" + Me.chkBook.UseVisualStyleBackColor = True + ' + 'txtLoad + ' + Me.txtLoad.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtLoad.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtLoad.Location = New System.Drawing.Point(103, 142) + Me.txtLoad.Name = "txtLoad" + Me.txtLoad.Size = New System.Drawing.Size(171, 20) + Me.txtLoad.TabIndex = 10 + ' + 'List_BulletsTableAdapter + ' + Me.List_BulletsTableAdapter.ClearBeforeFill = True + ' + 'General_PrimerTableAdapter + ' + Me.General_PrimerTableAdapter.ClearBeforeFill = True + ' + 'List_CaseTableAdapter + ' + Me.List_CaseTableAdapter.ClearBeforeFill = True + ' + 'btnAdd + ' + Me.btnAdd.Location = New System.Drawing.Point(44, 180) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(75, 23) + Me.btnAdd.TabIndex = 11 + Me.btnAdd.Text = "Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(188, 180) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 12 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'cmbAmmo + ' + Me.cmbAmmo.DataSource = Me.GeneralAmmunitionTypeBindingSource + Me.cmbAmmo.DisplayMember = "FType" + Me.cmbAmmo.FormattingEnabled = True + Me.cmbAmmo.Location = New System.Drawing.Point(103, 9) + Me.cmbAmmo.Name = "cmbAmmo" + Me.cmbAmmo.Size = New System.Drawing.Size(171, 21) + Me.cmbAmmo.TabIndex = 13 + Me.cmbAmmo.ValueMember = "ID" + ' + 'GeneralAmmunitionTypeBindingSource + ' + Me.GeneralAmmunitionTypeBindingSource.DataMember = "General_Ammunition_Type" + Me.GeneralAmmunitionTypeBindingSource.DataSource = Me.MLLDataSet + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(12, 12) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(66, 13) + Me.Label6.TabIndex = 14 + Me.Label6.Text = "Ammo Type:" + ' + 'General_Ammunition_TypeTableAdapter + ' + Me.General_Ammunition_TypeTableAdapter.ClearBeforeFill = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmConfig_Add_Wizard_RP_1 + ' + Me.AcceptButton = Me.btnAdd + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(291, 214) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.cmbAmmo) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.txtLoad) + Me.Controls.Add(Me.chkBook) + Me.Controls.Add(Me.chkPersonal) + Me.Controls.Add(Me.cmbCase) + Me.Controls.Add(Me.cmbPrimer) + Me.Controls.Add(Me.cmbBullet) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.HelpProvider1.SetHelpKeyword(Me, "Adding a New Configuration") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Adding a New Configuration") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "FrmConfigAddWizardRp1" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Add Configuration for Pistols and Rifles" + CType(Me.ListBulletsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.GeneralPrimerBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ListCaseBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.GeneralAmmunitionTypeBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - 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 cmbBullet As System.Windows.Forms.ComboBox - Friend WithEvents cmbPrimer As System.Windows.Forms.ComboBox - Friend WithEvents cmbCase As System.Windows.Forms.ComboBox - Friend WithEvents chkPersonal As System.Windows.Forms.CheckBox - Friend WithEvents chkBook As System.Windows.Forms.CheckBox - Friend WithEvents txtLoad As System.Windows.Forms.TextBox - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents ListBulletsBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_BulletsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_BulletsTableAdapter - Friend WithEvents GeneralPrimerBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents General_PrimerTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.General_PrimerTableAdapter - Friend WithEvents ListCaseBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_CaseTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_CaseTableAdapter - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents cmbAmmo As System.Windows.Forms.ComboBox - Friend WithEvents Label6 As System.Windows.Forms.Label - Friend WithEvents GeneralAmmunitionTypeBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents General_Ammunition_TypeTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.General_Ammunition_TypeTableAdapter - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider -End Class + End Sub + 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 cmbBullet As System.Windows.Forms.ComboBox + Friend WithEvents cmbPrimer As System.Windows.Forms.ComboBox + Friend WithEvents cmbCase As System.Windows.Forms.ComboBox + Friend WithEvents chkPersonal As System.Windows.Forms.CheckBox + Friend WithEvents chkBook As System.Windows.Forms.CheckBox + Friend WithEvents txtLoad As System.Windows.Forms.TextBox + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents ListBulletsBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_BulletsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_BulletsTableAdapter + Friend WithEvents GeneralPrimerBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents General_PrimerTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.General_PrimerTableAdapter + Friend WithEvents ListCaseBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_CaseTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_CaseTableAdapter + Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents cmbAmmo As System.Windows.Forms.ComboBox + Friend WithEvents Label6 As System.Windows.Forms.Label + Friend WithEvents GeneralAmmunitionTypeBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents General_Ammunition_TypeTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.General_Ammunition_TypeTableAdapter + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_RP_1.vb b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_RP_1.vb index ecfb366..f1d86ba 100644 --- a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_RP_1.vb +++ b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_RP_1.vb @@ -1,75 +1,131 @@ -Imports BSMyLoadersLog.LoadersClass +'Imports BSMyLoadersLog.LoadersClass +Imports BurnSoft.Applications.MLL.AutoFill +Imports BurnSoft.Applications.MLL.ConfigSheets Imports BurnSoft.Applications.MLL.Helpers -Public Class frmConfig_Add_Wizard_RP_1 - Public CalID As Long - Public ConfigName As String - Public ConfigID As Long - Dim isPersonal As Boolean - Private Sub frmConfig_Add_Wizard_RP_1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Try - Me.General_Ammunition_TypeTableAdapter.Fill(Me.MLLDataSet.General_Ammunition_Type) - isPersonal = True - Me.List_CaseTableAdapter.FillBy_CALID(Me.MLLDataSet.List_Case, CalID) - Me.General_PrimerTableAdapter.Fill(Me.MLLDataSet.General_Primer) - Me.List_BulletsTableAdapter.FillBy_CALID(Me.MLLDataSet.List_Bullets, CalID) - If isPersonal Then +Namespace Adding + ''' + ''' Class frmConfig_Add_Wizard_RP_1. + ''' Implements the + ''' + ''' + Public Class FrmConfigAddWizardRp1 + ' TODO: #20 Code Cleanup + ''' + ''' The error out + ''' + Dim _errOut as String + ''' + ''' The cal identifier + ''' + Public CaliberId As Long + ''' + ''' The configuration name + ''' + Public ConfigName As String + ''' + ''' The configuration identifier + ''' + Public ConfigId As Long + ''' + ''' The is personal + ''' + Dim _isPersonal As Boolean + ''' + ''' Handles the Load event of the frmConfig_Add_Wizard_RP_1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmConfig_Add_Wizard_RP_1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Try + General_Ammunition_TypeTableAdapter.Fill(MLLDataSet.General_Ammunition_Type) + _isPersonal = True + List_CaseTableAdapter.FillBy_CALID(MLLDataSet.List_Case, CaliberId) + General_PrimerTableAdapter.Fill(MLLDataSet.General_Primer) + List_BulletsTableAdapter.FillBy_CALID(MLLDataSet.List_Bullets, CaliberId) + If _isPersonal Then + txtLoad.Enabled = False + chkPersonal.Checked = True + End If + 'Dim ObjAF As New AutoFillCollections + 'txtLoad.AutoCompleteCustomSource = ObjAF.Config_Source_NSG + txtLoad.AutoCompleteCustomSource = ConfigMetalic.Source(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the CheckedChanged event of the chkPersonal control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub chkPersonal_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles chkPersonal.CheckedChanged + If chkPersonal.Checked Then txtLoad.Enabled = False - chkPersonal.Checked = True + chkBook.Checked = False End If - Dim ObjAF As New AutoFillCollections - txtLoad.AutoCompleteCustomSource = ObjAF.Config_Source_NSG - Catch ex As Exception - Call LogError(Me.Name, "Load", Err.Number, ex.Message.ToString) - End Try - End Sub - - Private Sub chkPersonal_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkPersonal.CheckedChanged - If chkPersonal.Checked Then - txtLoad.Enabled = False - chkBook.Checked = False - End If - End Sub - - Private Sub chkBook_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkBook.CheckedChanged - If chkBook.Checked Then - txtLoad.Enabled = True - chkPersonal.Checked = False - End If - End Sub - - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub - - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click - Try - Dim lngBullet As Long = cmbBullet.SelectedValue - Dim lngPrimer As Long = cmbPrimer.SelectedValue - Dim lngCase As Long = cmbCase.SelectedValue - Dim lngAmmoType As Long = cmbAmmo.SelectedValue - Dim bPersonal As Boolean = chkPersonal.Checked - Dim bOther As Boolean = chkBook.Checked - Dim SQL As String = "" - Dim Obj As New BSDatabase - Dim strSource As String = GeneralHelpers.FluffContent(txtLoad.Text) - If bOther Then - SQL = "UPDATE Config_List_Name set IsPersonal=0 where id=" & ConfigID - Obj.ConnExec(SQL) + End Sub + ''' + ''' Handles the CheckedChanged event of the chkBook control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub chkBook_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles chkBook.CheckedChanged + If chkBook.Checked Then + txtLoad.Enabled = True + chkPersonal.Checked = False End If + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnAdd control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click + Try + Dim lngBullet As Long = cmbBullet.SelectedValue + Dim lngPrimer As Long = cmbPrimer.SelectedValue + Dim lngCase As Long = cmbCase.SelectedValue + Dim lngAmmoType As Long = cmbAmmo.SelectedValue + 'Dim bPersonal As Boolean = chkPersonal.Checked + 'Dim bOther As Boolean = chkBook.Checked + 'Dim SQL As String = "" + 'Dim Obj As New BSDatabase + Dim strSource As String = GeneralHelpers.FluffContent(txtLoad.Text) + If chkBook.Checked Then + ' TODO: #19 Update when newer library is applied + 'If Not ConfigListDataName.SetPersonal(DatabasePath, ConfigID, false, _errOut) Then Throw New Exception(_errOut) + 'SQL = "UPDATE Config_List_Name set IsPersonal=0 where id=" & ConfigID + 'Obj.ConnExec(SQL) + End If + + If Not ConfigListDataMetalic.Add(DatabasePath, ConfigId, lngAmmoType, CaliberId, + lngBullet, lngPrimer, lngCase, strSource, + _errOut) Then Throw New Exception(_errOut) - SQL = "INSERT INTO Config_List_Data_NSG(CLNID,ATID,CALID,BID,PRID,CAID,Source) VALUES (" & _ - ConfigID & "," & lngAmmoType & "," & CalID & "," & lngBullet & "," & _ - lngPrimer & "," & lngCase & ",'" & strSource & "')" - Obj.ConnExec(SQL) - frmConfig_Add_Wizard_Powder.ConfigID = ConfigID - frmConfig_Add_Wizard_Powder.ConfigName = ConfigName - frmConfig_Add_Wizard_Powder.FromConfigWiz = True - frmConfig_Add_Wizard_Powder.MdiParent = Me.MdiParent - frmConfig_Add_Wizard_Powder.Show() - Me.Close() - Catch ex As Exception - Call LogError(Me.Name, "btnAdd.Click", Err.Number, ex.Message.ToString) - End Try - End Sub -End Class \ No newline at end of file + 'SQL = "INSERT INTO Config_List_Data_NSG(CLNID,ATID,CALID,BID,PRID,CAID,Source) VALUES (" & _ + ' ConfigID & "," & lngAmmoType & "," & CalID & "," & lngBullet & "," & _ + ' lngPrimer & "," & lngCase & ",'" & strSource & "')" + 'Obj.ConnExec(SQL) + FrmConfigAddWizardPowder.ConfigId = ConfigId + FrmConfigAddWizardPowder.ConfigName = ConfigName + FrmConfigAddWizardPowder.FromConfigWiz = True + FrmConfigAddWizardPowder.MdiParent = MdiParent + FrmConfigAddWizardPowder.Show() + Close() + Catch ex As Exception + Call LogError(Name, "btnAdd.Click", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_1.Designer.vb b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_1.Designer.vb index 7140b8a..91ea841 100644 --- a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_1.Designer.vb +++ b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_1.Designer.vb @@ -1,107 +1,109 @@ - _ -Partial Class frmConfig_Add_Wizard_SG_1 - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmConfigAddWizardSg1 + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmConfig_Add_Wizard_SG_1)) - Me.chkShot = New System.Windows.Forms.CheckBox - Me.chkSlug = New System.Windows.Forms.CheckBox - Me.Label1 = New System.Windows.Forms.Label - Me.btnCon = New System.Windows.Forms.Button - Me.btnCancel = New System.Windows.Forms.Button - Me.SuspendLayout() - ' - 'chkShot - ' - Me.chkShot.AutoSize = True - Me.chkShot.Location = New System.Drawing.Point(16, 55) - Me.chkShot.Name = "chkShot" - Me.chkShot.Size = New System.Drawing.Size(187, 17) - Me.chkShot.TabIndex = 0 - Me.chkShot.Text = "Shot (#9,8,7,6,5,4,3,0,00,000,etc)" - Me.chkShot.UseVisualStyleBackColor = True - ' - 'chkSlug - ' - Me.chkSlug.AutoSize = True - Me.chkSlug.Location = New System.Drawing.Point(16, 78) - Me.chkSlug.Name = "chkSlug" - Me.chkSlug.Size = New System.Drawing.Size(86, 17) - Me.chkSlug.TabIndex = 1 - Me.chkSlug.Text = "Slug/Sabbot" - Me.chkSlug.UseVisualStyleBackColor = True - ' - 'Label1 - ' - Me.Label1.Location = New System.Drawing.Point(13, 13) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(240, 28) - Me.Label1.TabIndex = 2 - Me.Label1.Text = "Please select the type of shotgun ammunition that you want to build." - ' - 'btnCon - ' - Me.btnCon.Location = New System.Drawing.Point(16, 110) - Me.btnCon.Name = "btnCon" - Me.btnCon.Size = New System.Drawing.Size(75, 23) - Me.btnCon.TabIndex = 3 - Me.btnCon.Text = "&Continue" - Me.btnCon.UseVisualStyleBackColor = True - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(159, 110) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 4 - Me.btnCancel.Text = "&Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'frmConfig_Add_Wizard_SG_1 - ' - Me.AcceptButton = Me.btnCon - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(257, 144) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnCon) - Me.Controls.Add(Me.Label1) - Me.Controls.Add(Me.chkSlug) - Me.Controls.Add(Me.chkShot) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmConfig_Add_Wizard_SG_1" - Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "Select Shotgun Ammunition Type" - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmConfigAddWizardSg1)) + Me.chkShot = New System.Windows.Forms.CheckBox + Me.chkSlug = New System.Windows.Forms.CheckBox + Me.Label1 = New System.Windows.Forms.Label + Me.btnCon = New System.Windows.Forms.Button + Me.btnCancel = New System.Windows.Forms.Button + Me.SuspendLayout() + ' + 'chkShot + ' + Me.chkShot.AutoSize = True + Me.chkShot.Location = New System.Drawing.Point(16, 55) + Me.chkShot.Name = "chkShot" + Me.chkShot.Size = New System.Drawing.Size(187, 17) + Me.chkShot.TabIndex = 0 + Me.chkShot.Text = "Shot (#9,8,7,6,5,4,3,0,00,000,etc)" + Me.chkShot.UseVisualStyleBackColor = True + ' + 'chkSlug + ' + Me.chkSlug.AutoSize = True + Me.chkSlug.Location = New System.Drawing.Point(16, 78) + Me.chkSlug.Name = "chkSlug" + Me.chkSlug.Size = New System.Drawing.Size(86, 17) + Me.chkSlug.TabIndex = 1 + Me.chkSlug.Text = "Slug/Sabbot" + Me.chkSlug.UseVisualStyleBackColor = True + ' + 'Label1 + ' + Me.Label1.Location = New System.Drawing.Point(13, 13) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(240, 28) + Me.Label1.TabIndex = 2 + Me.Label1.Text = "Please select the type of shotgun ammunition that you want to build." + ' + 'btnCon + ' + Me.btnCon.Location = New System.Drawing.Point(16, 110) + Me.btnCon.Name = "btnCon" + Me.btnCon.Size = New System.Drawing.Size(75, 23) + Me.btnCon.TabIndex = 3 + Me.btnCon.Text = "&Continue" + Me.btnCon.UseVisualStyleBackColor = True + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(159, 110) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 4 + Me.btnCancel.Text = "&Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'frmConfig_Add_Wizard_SG_1 + ' + Me.AcceptButton = Me.btnCon + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(257, 144) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnCon) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.chkSlug) + Me.Controls.Add(Me.chkShot) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "FrmConfigAddWizardSg1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Select Shotgun Ammunition Type" + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents chkShot As System.Windows.Forms.CheckBox - Friend WithEvents chkSlug As System.Windows.Forms.CheckBox - Friend WithEvents Label1 As System.Windows.Forms.Label - Friend WithEvents btnCon As System.Windows.Forms.Button - Friend WithEvents btnCancel As System.Windows.Forms.Button -End Class + End Sub + Friend WithEvents chkShot As System.Windows.Forms.CheckBox + Friend WithEvents chkSlug As System.Windows.Forms.CheckBox + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents btnCon As System.Windows.Forms.Button + Friend WithEvents btnCancel As System.Windows.Forms.Button + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_1.vb b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_1.vb index 8e8518c..30cc0e3 100644 --- a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_1.vb +++ b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_1.vb @@ -1,82 +1,136 @@ -Imports System.Data -Imports System.Data.Odbc -Imports BSMyLoadersLog.LoadersClass -Public Class frmConfig_Add_Wizard_SG_1 - Public ConfigName As String - Public CalID As Long - Public CalName As String - Public ConfigID As Long - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub - Private Sub btnCon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCon.Click - Try - Dim bShot As Boolean = chkShot.Checked - Dim bSlug As Boolean = chkSlug.Checked - If bShot Then - frmConfig_Add_Wizard_SG_2.ConfigID = ConfigID - frmConfig_Add_Wizard_SG_2.CalID = CalID - frmConfig_Add_Wizard_SG_2.CalName = CalName - frmConfig_Add_Wizard_SG_2.GID = GenerateGaugeID(CalName) - frmConfig_Add_Wizard_SG_2.ConfigName = ConfigName - frmConfig_Add_Wizard_SG_2.MdiParent = Me.MdiParent - frmConfig_Add_Wizard_SG_2.Show() - Me.Close() - End If - If bSlug Then - frmConfig_Add_Wizard_SG_3.ConfigID = ConfigID - frmConfig_Add_Wizard_SG_3.CalID = CalID - frmConfig_Add_Wizard_SG_3.CalName = CalName - frmConfig_Add_Wizard_SG_3.GID = GenerateGaugeID(CalName) - frmConfig_Add_Wizard_SG_3.ConfigName = ConfigName - frmConfig_Add_Wizard_SG_3.MdiParent = Me.MdiParent - frmConfig_Add_Wizard_SG_3.Show() - Me.Close() - End If - Catch ex As Exception - Call LogError(Me.Name, "btnCon_Click", Err.Number, ex.Message.ToString) - End Try - End Sub - Function GenerateGaugeID(ByVal sCalName As String) As Long - Dim lAns As Long = 0 - Dim Obj As New BSDatabase - lAns = GetGaugeID(sCalName) - If lAns = 0 Then - Obj.ConnExec("INSERT INTO List_SG_Gauge(ga) VALUES('" & sCalName & "')") - lAns = GetGaugeID(sCalName) - End If - Return lAns - End Function - Function GetGaugeID(ByVal sCalName As String) As Long - Dim lAns As Long = 0 - Try - Dim SQL As String = "SELECT ID from List_SG_Gauge where ga='" & sCalName & "'" - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - While RS.Read - lAns = RS("ID") - End While - RS.Close() - RS = Nothing - CMD = Nothing - Obj.CloseDB() - Catch ex As Exception - Call LogError(Me.Name, "GetGaugeID", Err.Number, ex.Message.ToString) - End Try - Return lAns - End Function - Private Sub chkShot_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkShot.CheckedChanged - If chkShot.Checked Then chkSlug.Checked = False - End Sub +'Imports System.Data +'Imports System.Data.Odbc +'Imports BSMyLoadersLog.LoadersClass +Imports BurnSoft.Applications.MLL.Inventory - Private Sub chkSlug_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkSlug.CheckedChanged - If chkSlug.Checked Then chkShot.Checked = False - End Sub +Namespace Adding + ''' + ''' Class frmConfig_Add_Wizard_SG_1. + ''' Implements the + ''' + ''' + Public Class FrmConfigAddWizardSg1 + ' TODO: #20 Code Cleanup + ''' + ''' The error out + ''' + Dim _errOut as String + ''' + ''' The configuration name + ''' + Public ConfigName As String + ''' + ''' The cal identifier + ''' + Public CaliberId As Long + ''' + ''' The cal name + ''' + Public CaliberName As String + ''' + ''' The configuration identifier + ''' + Public ConfigId As Long + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnCon control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCon_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCon.Click + Try + Dim bShot As Boolean = chkShot.Checked + Dim bSlug As Boolean = chkSlug.Checked + Dim gaugeId as Long = ShotgunGauges.GenerateGaugeId(DatabasePath, CaliberName, _errOut) + If _errOut.Length > 0 then Throw New Exception(_errOut) - Private Sub frmConfig_Add_Wizard_SG_1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load + If bShot Then + FrmConfigAddWizardSg2.ConfigId = ConfigId + FrmConfigAddWizardSg2.CaliberId = CaliberId + FrmConfigAddWizardSg2.CaliberName = CaliberName + FrmConfigAddWizardSg2.GaugeId = gaugeId + FrmConfigAddWizardSg2.ConfigName = ConfigName + FrmConfigAddWizardSg2.MdiParent = MdiParent + FrmConfigAddWizardSg2.Show() + Close() + End If + If bSlug Then + FrmConfigAddWizardSg3.ConfigId = ConfigId + FrmConfigAddWizardSg3.CaliberId = CaliberId + FrmConfigAddWizardSg3.CaliberName = CaliberName + FrmConfigAddWizardSg3.GaugeId = gaugeId + FrmConfigAddWizardSg3.ConfigName = ConfigName + FrmConfigAddWizardSg3.MdiParent = MdiParent + FrmConfigAddWizardSg3.Show() + Close() + End If + Catch ex As Exception + Call LogError(Name, "btnCon_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + + 'Function GenerateGaugeId(ByVal sCalName As String) As Long + ' Dim lAns As Long = 0 + ' Dim obj As New BSDatabase + ' lAns = GetGaugeId(sCalName) + ' If lAns = 0 Then + ' obj.ConnExec("INSERT INTO List_SG_Gauge(ga) VALUES('" & sCalName & "')") + ' lAns = GetGaugeId(sCalName) + ' End If + ' Return lAns + 'End Function + + 'Function GetGaugeId(ByVal sCalName As String) As Long + ' Dim lAns As Long = 0 + ' Try + ' Dim sql As String = "SELECT ID from List_SG_Gauge where ga='" & sCalName & "'" + ' Dim obj As New BSDatabase + ' Call obj.ConnectDB() + ' Dim cmd As New OdbcCommand(sql, obj.Conn) + ' Dim rs As OdbcDataReader + ' rs = cmd.ExecuteReader + ' While rs.Read + ' lAns = rs("ID") + ' End While + ' rs.Close() + ' rs = Nothing + ' cmd = Nothing + ' obj.CloseDB() + ' Catch ex As Exception + ' Call LogError(Name, "GetGaugeID", Err.Number, ex.Message.ToString) + ' End Try + ' Return lAns + 'End Function + ''' + ''' Handles the CheckedChanged event of the chkShot control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub chkShot_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles chkShot.CheckedChanged + If chkShot.Checked Then chkSlug.Checked = False + End Sub + ''' + ''' Handles the CheckedChanged event of the chkSlug control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub chkSlug_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles chkSlug.CheckedChanged + If chkSlug.Checked Then chkShot.Checked = False + End Sub + ''' + ''' Handles the Load event of the frmConfig_Add_Wizard_SG_1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmConfig_Add_Wizard_SG_1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load - End Sub -End Class \ No newline at end of file + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_2.Designer.vb b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_2.Designer.vb index eed2e10..b09adca 100644 --- a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_2.Designer.vb +++ b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_2.Designer.vb @@ -1,359 +1,361 @@ - _ -Partial Class frmConfig_Add_Wizard_SG_2 - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmConfigAddWizardSg2 + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmConfig_Add_Wizard_SG_2)) - 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.cmbPrimer = New System.Windows.Forms.ComboBox - Me.ViewPrimerListBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.cmdWAD = New System.Windows.Forms.ComboBox - Me.ListSGWADBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.cmdHull = New System.Windows.Forms.ComboBox - Me.ListSGCaseBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.cmdShotType = New System.Windows.Forms.ComboBox - Me.ListSGShotTypeDetailsBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.ViewPrimerListTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.viewPrimerListTableAdapter - Me.List_SG_WADTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_WADTableAdapter - Me.List_SG_CaseTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_CaseTableAdapter - Me.List_SG_ShotType_DetailsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotType_DetailsTableAdapter - Me.Label5 = New System.Windows.Forms.Label - Me.txtShotCharge = New System.Windows.Forms.TextBox - Me.Label6 = New System.Windows.Forms.Label - Me.cmbLoadType = New System.Windows.Forms.ComboBox - Me.ListSGShotChargeLoadsBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.List_SG_ShotCharge_LoadsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotCharge_LoadsTableAdapter - Me.Label7 = New System.Windows.Forms.Label - Me.btnNext = New System.Windows.Forms.Button - Me.txtSource = New System.Windows.Forms.TextBox - Me.Label8 = New System.Windows.Forms.Label - Me.Label9 = New System.Windows.Forms.Label - Me.chkPersonal = New System.Windows.Forms.CheckBox - CType(Me.ViewPrimerListBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.ListSGWADBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.ListSGCaseBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.ListSGShotTypeDetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.ListSGShotChargeLoadsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(13, 73) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(39, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Primer:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(13, 98) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(28, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Hull:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(13, 125) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(36, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "WAD:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(13, 152) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(59, 13) - Me.Label4.TabIndex = 3 - Me.Label4.Text = "Shot Type:" - ' - 'cmbPrimer - ' - Me.cmbPrimer.DataSource = Me.ViewPrimerListBindingSource - Me.cmbPrimer.DisplayMember = "PrimerName" - Me.cmbPrimer.FormattingEnabled = True - Me.cmbPrimer.Location = New System.Drawing.Point(110, 70) - Me.cmbPrimer.Name = "cmbPrimer" - Me.cmbPrimer.Size = New System.Drawing.Size(235, 21) - Me.cmbPrimer.TabIndex = 4 - Me.cmbPrimer.ValueMember = "ID" - ' - 'ViewPrimerListBindingSource - ' - Me.ViewPrimerListBindingSource.DataMember = "viewPrimerList" - Me.ViewPrimerListBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'cmdWAD - ' - Me.cmdWAD.DataSource = Me.ListSGWADBindingSource - Me.cmdWAD.DisplayMember = "WAD" - Me.cmdWAD.FormattingEnabled = True - Me.cmdWAD.Location = New System.Drawing.Point(110, 122) - Me.cmdWAD.Name = "cmdWAD" - Me.cmdWAD.Size = New System.Drawing.Size(235, 21) - Me.cmdWAD.TabIndex = 5 - Me.cmdWAD.ValueMember = "ID" - ' - 'ListSGWADBindingSource - ' - Me.ListSGWADBindingSource.DataMember = "List_SG_WAD" - Me.ListSGWADBindingSource.DataSource = Me.MLLDataSet - ' - 'cmdHull - ' - Me.cmdHull.DataSource = Me.ListSGCaseBindingSource - Me.cmdHull.DisplayMember = "Name" - Me.cmdHull.FormattingEnabled = True - Me.cmdHull.Location = New System.Drawing.Point(110, 95) - Me.cmdHull.Name = "cmdHull" - Me.cmdHull.Size = New System.Drawing.Size(235, 21) - Me.cmdHull.TabIndex = 6 - Me.cmdHull.ValueMember = "ID" - ' - 'ListSGCaseBindingSource - ' - Me.ListSGCaseBindingSource.DataMember = "List_SG_Case" - Me.ListSGCaseBindingSource.DataSource = Me.MLLDataSet - ' - 'cmdShotType - ' - Me.cmdShotType.DataSource = Me.ListSGShotTypeDetailsBindingSource - Me.cmdShotType.DisplayMember = "Name" - Me.cmdShotType.FormattingEnabled = True - Me.cmdShotType.Location = New System.Drawing.Point(110, 149) - Me.cmdShotType.Name = "cmdShotType" - Me.cmdShotType.Size = New System.Drawing.Size(235, 21) - Me.cmdShotType.TabIndex = 7 - Me.cmdShotType.ValueMember = "ID" - ' - 'ListSGShotTypeDetailsBindingSource - ' - Me.ListSGShotTypeDetailsBindingSource.DataMember = "List_SG_ShotType_Details" - Me.ListSGShotTypeDetailsBindingSource.DataSource = Me.MLLDataSet - ' - 'ViewPrimerListTableAdapter - ' - Me.ViewPrimerListTableAdapter.ClearBeforeFill = True - ' - 'List_SG_WADTableAdapter - ' - Me.List_SG_WADTableAdapter.ClearBeforeFill = True - ' - 'List_SG_CaseTableAdapter - ' - Me.List_SG_CaseTableAdapter.ClearBeforeFill = True - ' - 'List_SG_ShotType_DetailsTableAdapter - ' - Me.List_SG_ShotType_DetailsTableAdapter.ClearBeforeFill = True - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(12, 179) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(89, 13) - Me.Label5.TabIndex = 8 - Me.Label5.Text = "Shot Charge (oz):" - ' - 'txtShotCharge - ' - Me.txtShotCharge.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtShotCharge.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtShotCharge.Location = New System.Drawing.Point(110, 176) - Me.txtShotCharge.Name = "txtShotCharge" - Me.txtShotCharge.Size = New System.Drawing.Size(235, 20) - Me.txtShotCharge.TabIndex = 9 - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(13, 205) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(61, 13) - Me.Label6.TabIndex = 10 - Me.Label6.Text = "Load Type:" - ' - 'cmbLoadType - ' - Me.cmbLoadType.DataSource = Me.ListSGShotChargeLoadsBindingSource - Me.cmbLoadType.DisplayMember = "Name" - Me.cmbLoadType.FormattingEnabled = True - Me.cmbLoadType.Location = New System.Drawing.Point(110, 202) - Me.cmbLoadType.Name = "cmbLoadType" - Me.cmbLoadType.Size = New System.Drawing.Size(235, 21) - Me.cmbLoadType.TabIndex = 11 - Me.cmbLoadType.ValueMember = "ID" - ' - 'ListSGShotChargeLoadsBindingSource - ' - Me.ListSGShotChargeLoadsBindingSource.DataMember = "List_SG_ShotCharge_Loads" - Me.ListSGShotChargeLoadsBindingSource.DataSource = Me.MLLDataSet - ' - 'List_SG_ShotCharge_LoadsTableAdapter - ' - Me.List_SG_ShotCharge_LoadsTableAdapter.ClearBeforeFill = True - ' - 'Label7 - ' - Me.Label7.Location = New System.Drawing.Point(13, 13) - Me.Label7.Name = "Label7" - Me.Label7.Size = New System.Drawing.Size(332, 44) - Me.Label7.TabIndex = 12 - Me.Label7.Text = "Select the Components below that will go into make this kind of shotgun load. Af" & _ - "ter you have finished, click on the Next button to add the Powder Information." - ' - 'btnNext - ' - Me.btnNext.Location = New System.Drawing.Point(270, 277) - Me.btnNext.Name = "btnNext" - Me.btnNext.Size = New System.Drawing.Size(75, 23) - Me.btnNext.TabIndex = 13 - Me.btnNext.Text = "&Next" - Me.btnNext.UseVisualStyleBackColor = True - ' - 'txtSource - ' - Me.txtSource.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtSource.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtSource.Location = New System.Drawing.Point(110, 251) - Me.txtSource.Name = "txtSource" - Me.txtSource.ReadOnly = True - Me.txtSource.Size = New System.Drawing.Size(235, 20) - Me.txtSource.TabIndex = 14 - ' - 'Label8 - ' - Me.Label8.AutoSize = True - Me.Label8.Location = New System.Drawing.Point(13, 254) - Me.Label8.Name = "Label8" - Me.Label8.Size = New System.Drawing.Size(41, 13) - Me.Label8.TabIndex = 15 - Me.Label8.Text = "Source" - ' - 'Label9 - ' - Me.Label9.AutoSize = True - Me.Label9.Location = New System.Drawing.Point(13, 230) - Me.Label9.Name = "Label9" - Me.Label9.Size = New System.Drawing.Size(81, 13) - Me.Label9.TabIndex = 16 - Me.Label9.Text = "Personal Load?" - ' - 'chkPersonal - ' - Me.chkPersonal.AutoSize = True - Me.chkPersonal.Checked = True - Me.chkPersonal.CheckState = System.Windows.Forms.CheckState.Checked - Me.chkPersonal.Location = New System.Drawing.Point(110, 229) - Me.chkPersonal.Name = "chkPersonal" - Me.chkPersonal.Size = New System.Drawing.Size(44, 17) - Me.chkPersonal.TabIndex = 17 - Me.chkPersonal.Text = "Yes" - Me.chkPersonal.UseVisualStyleBackColor = True - ' - 'frmConfig_Add_Wizard_SG_2 - ' - Me.AcceptButton = Me.btnNext - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(364, 313) - Me.Controls.Add(Me.chkPersonal) - Me.Controls.Add(Me.Label9) - Me.Controls.Add(Me.Label8) - Me.Controls.Add(Me.txtSource) - Me.Controls.Add(Me.btnNext) - Me.Controls.Add(Me.Label7) - Me.Controls.Add(Me.cmbLoadType) - Me.Controls.Add(Me.Label6) - Me.Controls.Add(Me.txtShotCharge) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.cmdShotType) - Me.Controls.Add(Me.cmdHull) - Me.Controls.Add(Me.cmdWAD) - Me.Controls.Add(Me.cmbPrimer) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmConfig_Add_Wizard_SG_2" - Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "Shot Configuration" - CType(Me.ViewPrimerListBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.ListSGWADBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.ListSGCaseBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.ListSGShotTypeDetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.ListSGShotChargeLoadsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmConfigAddWizardSg2)) + 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.cmbPrimer = New System.Windows.Forms.ComboBox + Me.ViewPrimerListBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.cmdWAD = New System.Windows.Forms.ComboBox + Me.ListSGWADBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.cmdHull = New System.Windows.Forms.ComboBox + Me.ListSGCaseBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.cmdShotType = New System.Windows.Forms.ComboBox + Me.ListSGShotTypeDetailsBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.ViewPrimerListTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.viewPrimerListTableAdapter + Me.List_SG_WADTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_WADTableAdapter + Me.List_SG_CaseTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_CaseTableAdapter + Me.List_SG_ShotType_DetailsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotType_DetailsTableAdapter + Me.Label5 = New System.Windows.Forms.Label + Me.txtShotCharge = New System.Windows.Forms.TextBox + Me.Label6 = New System.Windows.Forms.Label + Me.cmbLoadType = New System.Windows.Forms.ComboBox + Me.ListSGShotChargeLoadsBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.List_SG_ShotCharge_LoadsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotCharge_LoadsTableAdapter + Me.Label7 = New System.Windows.Forms.Label + Me.btnNext = New System.Windows.Forms.Button + Me.txtSource = New System.Windows.Forms.TextBox + Me.Label8 = New System.Windows.Forms.Label + Me.Label9 = New System.Windows.Forms.Label + Me.chkPersonal = New System.Windows.Forms.CheckBox + CType(Me.ViewPrimerListBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ListSGWADBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ListSGCaseBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ListSGShotTypeDetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ListSGShotChargeLoadsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(13, 73) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(39, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Primer:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(13, 98) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(28, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Hull:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(13, 125) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(36, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "WAD:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(13, 152) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(59, 13) + Me.Label4.TabIndex = 3 + Me.Label4.Text = "Shot Type:" + ' + 'cmbPrimer + ' + Me.cmbPrimer.DataSource = Me.ViewPrimerListBindingSource + Me.cmbPrimer.DisplayMember = "PrimerName" + Me.cmbPrimer.FormattingEnabled = True + Me.cmbPrimer.Location = New System.Drawing.Point(110, 70) + Me.cmbPrimer.Name = "cmbPrimer" + Me.cmbPrimer.Size = New System.Drawing.Size(235, 21) + Me.cmbPrimer.TabIndex = 4 + Me.cmbPrimer.ValueMember = "ID" + ' + 'ViewPrimerListBindingSource + ' + Me.ViewPrimerListBindingSource.DataMember = "viewPrimerList" + Me.ViewPrimerListBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'cmdWAD + ' + Me.cmdWAD.DataSource = Me.ListSGWADBindingSource + Me.cmdWAD.DisplayMember = "WAD" + Me.cmdWAD.FormattingEnabled = True + Me.cmdWAD.Location = New System.Drawing.Point(110, 122) + Me.cmdWAD.Name = "cmdWAD" + Me.cmdWAD.Size = New System.Drawing.Size(235, 21) + Me.cmdWAD.TabIndex = 5 + Me.cmdWAD.ValueMember = "ID" + ' + 'ListSGWADBindingSource + ' + Me.ListSGWADBindingSource.DataMember = "List_SG_WAD" + Me.ListSGWADBindingSource.DataSource = Me.MLLDataSet + ' + 'cmdHull + ' + Me.cmdHull.DataSource = Me.ListSGCaseBindingSource + Me.cmdHull.DisplayMember = "Name" + Me.cmdHull.FormattingEnabled = True + Me.cmdHull.Location = New System.Drawing.Point(110, 95) + Me.cmdHull.Name = "cmdHull" + Me.cmdHull.Size = New System.Drawing.Size(235, 21) + Me.cmdHull.TabIndex = 6 + Me.cmdHull.ValueMember = "ID" + ' + 'ListSGCaseBindingSource + ' + Me.ListSGCaseBindingSource.DataMember = "List_SG_Case" + Me.ListSGCaseBindingSource.DataSource = Me.MLLDataSet + ' + 'cmdShotType + ' + Me.cmdShotType.DataSource = Me.ListSGShotTypeDetailsBindingSource + Me.cmdShotType.DisplayMember = "Name" + Me.cmdShotType.FormattingEnabled = True + Me.cmdShotType.Location = New System.Drawing.Point(110, 149) + Me.cmdShotType.Name = "cmdShotType" + Me.cmdShotType.Size = New System.Drawing.Size(235, 21) + Me.cmdShotType.TabIndex = 7 + Me.cmdShotType.ValueMember = "ID" + ' + 'ListSGShotTypeDetailsBindingSource + ' + Me.ListSGShotTypeDetailsBindingSource.DataMember = "List_SG_ShotType_Details" + Me.ListSGShotTypeDetailsBindingSource.DataSource = Me.MLLDataSet + ' + 'ViewPrimerListTableAdapter + ' + Me.ViewPrimerListTableAdapter.ClearBeforeFill = True + ' + 'List_SG_WADTableAdapter + ' + Me.List_SG_WADTableAdapter.ClearBeforeFill = True + ' + 'List_SG_CaseTableAdapter + ' + Me.List_SG_CaseTableAdapter.ClearBeforeFill = True + ' + 'List_SG_ShotType_DetailsTableAdapter + ' + Me.List_SG_ShotType_DetailsTableAdapter.ClearBeforeFill = True + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(12, 179) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(89, 13) + Me.Label5.TabIndex = 8 + Me.Label5.Text = "Shot Charge (oz):" + ' + 'txtShotCharge + ' + Me.txtShotCharge.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtShotCharge.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtShotCharge.Location = New System.Drawing.Point(110, 176) + Me.txtShotCharge.Name = "txtShotCharge" + Me.txtShotCharge.Size = New System.Drawing.Size(235, 20) + Me.txtShotCharge.TabIndex = 9 + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(13, 205) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(61, 13) + Me.Label6.TabIndex = 10 + Me.Label6.Text = "Load Type:" + ' + 'cmbLoadType + ' + Me.cmbLoadType.DataSource = Me.ListSGShotChargeLoadsBindingSource + Me.cmbLoadType.DisplayMember = "Name" + Me.cmbLoadType.FormattingEnabled = True + Me.cmbLoadType.Location = New System.Drawing.Point(110, 202) + Me.cmbLoadType.Name = "cmbLoadType" + Me.cmbLoadType.Size = New System.Drawing.Size(235, 21) + Me.cmbLoadType.TabIndex = 11 + Me.cmbLoadType.ValueMember = "ID" + ' + 'ListSGShotChargeLoadsBindingSource + ' + Me.ListSGShotChargeLoadsBindingSource.DataMember = "List_SG_ShotCharge_Loads" + Me.ListSGShotChargeLoadsBindingSource.DataSource = Me.MLLDataSet + ' + 'List_SG_ShotCharge_LoadsTableAdapter + ' + Me.List_SG_ShotCharge_LoadsTableAdapter.ClearBeforeFill = True + ' + 'Label7 + ' + Me.Label7.Location = New System.Drawing.Point(13, 13) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(332, 44) + Me.Label7.TabIndex = 12 + Me.Label7.Text = "Select the Components below that will go into make this kind of shotgun load. Af" & _ + "ter you have finished, click on the Next button to add the Powder Information." + ' + 'btnNext + ' + Me.btnNext.Location = New System.Drawing.Point(270, 277) + Me.btnNext.Name = "btnNext" + Me.btnNext.Size = New System.Drawing.Size(75, 23) + Me.btnNext.TabIndex = 13 + Me.btnNext.Text = "&Next" + Me.btnNext.UseVisualStyleBackColor = True + ' + 'txtSource + ' + Me.txtSource.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtSource.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtSource.Location = New System.Drawing.Point(110, 251) + Me.txtSource.Name = "txtSource" + Me.txtSource.ReadOnly = True + Me.txtSource.Size = New System.Drawing.Size(235, 20) + Me.txtSource.TabIndex = 14 + ' + 'Label8 + ' + Me.Label8.AutoSize = True + Me.Label8.Location = New System.Drawing.Point(13, 254) + Me.Label8.Name = "Label8" + Me.Label8.Size = New System.Drawing.Size(41, 13) + Me.Label8.TabIndex = 15 + Me.Label8.Text = "Source" + ' + 'Label9 + ' + Me.Label9.AutoSize = True + Me.Label9.Location = New System.Drawing.Point(13, 230) + Me.Label9.Name = "Label9" + Me.Label9.Size = New System.Drawing.Size(81, 13) + Me.Label9.TabIndex = 16 + Me.Label9.Text = "Personal Load?" + ' + 'chkPersonal + ' + Me.chkPersonal.AutoSize = True + Me.chkPersonal.Checked = True + Me.chkPersonal.CheckState = System.Windows.Forms.CheckState.Checked + Me.chkPersonal.Location = New System.Drawing.Point(110, 229) + Me.chkPersonal.Name = "chkPersonal" + Me.chkPersonal.Size = New System.Drawing.Size(44, 17) + Me.chkPersonal.TabIndex = 17 + Me.chkPersonal.Text = "Yes" + Me.chkPersonal.UseVisualStyleBackColor = True + ' + 'frmConfig_Add_Wizard_SG_2 + ' + Me.AcceptButton = Me.btnNext + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(364, 313) + Me.Controls.Add(Me.chkPersonal) + Me.Controls.Add(Me.Label9) + Me.Controls.Add(Me.Label8) + Me.Controls.Add(Me.txtSource) + Me.Controls.Add(Me.btnNext) + Me.Controls.Add(Me.Label7) + Me.Controls.Add(Me.cmbLoadType) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.txtShotCharge) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.cmdShotType) + Me.Controls.Add(Me.cmdHull) + Me.Controls.Add(Me.cmdWAD) + Me.Controls.Add(Me.cmbPrimer) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "FrmConfigAddWizardSg2" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Shot Configuration" + CType(Me.ViewPrimerListBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ListSGWADBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ListSGCaseBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ListSGShotTypeDetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ListSGShotChargeLoadsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - 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 cmbPrimer As System.Windows.Forms.ComboBox - Friend WithEvents cmdWAD As System.Windows.Forms.ComboBox - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents ViewPrimerListBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents ViewPrimerListTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.viewPrimerListTableAdapter - Friend WithEvents ListSGWADBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_SG_WADTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_WADTableAdapter - Friend WithEvents cmdHull As System.Windows.Forms.ComboBox - Friend WithEvents ListSGCaseBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_SG_CaseTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_CaseTableAdapter - Friend WithEvents cmdShotType As System.Windows.Forms.ComboBox - Friend WithEvents ListSGShotTypeDetailsBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_SG_ShotType_DetailsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotType_DetailsTableAdapter - Friend WithEvents Label5 As System.Windows.Forms.Label - Friend WithEvents txtShotCharge As System.Windows.Forms.TextBox - Friend WithEvents Label6 As System.Windows.Forms.Label - Friend WithEvents cmbLoadType As System.Windows.Forms.ComboBox - Friend WithEvents ListSGShotChargeLoadsBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_SG_ShotCharge_LoadsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotCharge_LoadsTableAdapter - Friend WithEvents Label7 As System.Windows.Forms.Label - Friend WithEvents btnNext As System.Windows.Forms.Button - Friend WithEvents txtSource As System.Windows.Forms.TextBox - Friend WithEvents Label8 As System.Windows.Forms.Label - Friend WithEvents Label9 As System.Windows.Forms.Label - Friend WithEvents chkPersonal As System.Windows.Forms.CheckBox -End Class + End Sub + 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 cmbPrimer As System.Windows.Forms.ComboBox + Friend WithEvents cmdWAD As System.Windows.Forms.ComboBox + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents ViewPrimerListBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents ViewPrimerListTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.viewPrimerListTableAdapter + Friend WithEvents ListSGWADBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_SG_WADTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_WADTableAdapter + Friend WithEvents cmdHull As System.Windows.Forms.ComboBox + Friend WithEvents ListSGCaseBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_SG_CaseTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_CaseTableAdapter + Friend WithEvents cmdShotType As System.Windows.Forms.ComboBox + Friend WithEvents ListSGShotTypeDetailsBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_SG_ShotType_DetailsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotType_DetailsTableAdapter + Friend WithEvents Label5 As System.Windows.Forms.Label + Friend WithEvents txtShotCharge As System.Windows.Forms.TextBox + Friend WithEvents Label6 As System.Windows.Forms.Label + Friend WithEvents cmbLoadType As System.Windows.Forms.ComboBox + Friend WithEvents ListSGShotChargeLoadsBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_SG_ShotCharge_LoadsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotCharge_LoadsTableAdapter + Friend WithEvents Label7 As System.Windows.Forms.Label + Friend WithEvents btnNext As System.Windows.Forms.Button + Friend WithEvents txtSource As System.Windows.Forms.TextBox + Friend WithEvents Label8 As System.Windows.Forms.Label + Friend WithEvents Label9 As System.Windows.Forms.Label + Friend WithEvents chkPersonal As System.Windows.Forms.CheckBox + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_2.vb b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_2.vb index 1e2a316..e61cc9d 100644 --- a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_2.vb +++ b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_2.vb @@ -1,101 +1,177 @@ -Imports System.Data -Imports System.Data.Odbc -Imports BSMyLoadersLog.LoadersClass +'Imports System.Data +'Imports System.Data.Odbc +'Imports BSMyLoadersLog.LoadersClass +Imports BurnSoft.Applications.MLL.AutoFill +Imports BurnSoft.Applications.MLL.ConfigSheets Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory +Imports BurnSoft.Applications.MLL.Types -Public Class frmConfig_Add_Wizard_SG_2 +Namespace Adding ''' - ''' The error out + ''' Class frmConfig_Add_Wizard_SG_2. + ''' Implements the ''' - Dim errOut as String - Public ConfigName As String - Public CalID As Long - Public CalName As String - Public GID As Long - Public ConfigID As Long - Private Sub frmConfig_Add_Wizard_SG_2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Try - Me.List_SG_ShotType_DetailsTableAdapter.FillBy_CFG_List(Me.MLLDataSet.List_SG_ShotType_Details) - Me.List_SG_CaseTableAdapter.FillBy_CFG_List(Me.MLLDataSet.List_SG_Case, GID) - Me.List_SG_WADTableAdapter.FillBy_CFG_WADList(Me.MLLDataSet.List_SG_WAD, GID) - Me.ViewPrimerListTableAdapter.FillBy_CFG_List(Me.MLLDataSet.viewPrimerList) - Dim WID As Long = cmdWAD.SelectedValue - txtShotCharge.Text = GetMaxWADCharge(WID) - Me.List_SG_ShotCharge_LoadsTableAdapter.Fill(Me.MLLDataSet.List_SG_ShotCharge_Loads) - Dim ObjAF As New AutoFillCollections.ShotGun - txtSource.AutoCompleteCustomSource = ObjAF.Config_Source_SG - txtShotCharge.AutoCompleteCustomSource = ObjAF.Config_LoadInOZ_SG - Catch ex As Exception - Call LogError(Me.Name, "Load", Err.Number, ex.Message.ToString) - End Try - End Sub - Function GetMaxWADCharge(ByVal iID As Long) As String - Dim sAns As String = "" - Try - Dim SQL As String = "SELECT * from List_SG_WAD where ID=" & iID - Dim Obj As New BSDatabase - Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - While RS.Read - sAns = RS("load_t") - End While - RS.Close() - RS = Nothing - CMD = Nothing - Obj.CloseDB() - Catch ex As Exception - Call LogError(Me.Name, "GetMaxWADCharge", Err.Number, ex.Message.ToString) - End Try - Return sAns - End Function - Private Sub cmdWAD_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdWAD.SelectedIndexChanged - Dim WID As Long = cmdWAD.SelectedValue - txtShotCharge.Text = GetMaxWADCharge(WID) - End Sub + ''' + Public Class FrmConfigAddWizardSg2 + ' TODO: #20 Code Cleanup + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' The configuration name + ''' + Public ConfigName As String + ''' + ''' The cal identifier + ''' + Public CaliberId As Long + ''' + ''' The cal name + ''' + Public CaliberName As String + ''' + ''' The gauge id + ''' + Public GaugeId As Long + ''' + ''' The configuration identifier + ''' + Public ConfigId As Long + ''' + ''' Handles the Load event of the frmConfig_Add_Wizard_SG_2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmConfig_Add_Wizard_SG_2_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Try + List_SG_ShotType_DetailsTableAdapter.FillBy_CFG_List(MLLDataSet.List_SG_ShotType_Details) + List_SG_CaseTableAdapter.FillBy_CFG_List(MLLDataSet.List_SG_Case, GaugeId) + List_SG_WADTableAdapter.FillBy_CFG_WADList(MLLDataSet.List_SG_WAD, GaugeId) + ViewPrimerListTableAdapter.FillBy_CFG_List(MLLDataSet.viewPrimerList) + Dim wadId As Long = cmdWAD.SelectedValue + txtShotCharge.Text = GetMaxWADCharge(wadId) + List_SG_ShotCharge_LoadsTableAdapter.Fill(MLLDataSet.List_SG_ShotCharge_Loads) + 'Dim ObjAF As New AutoFillCollections.ShotGun + 'txtSource.AutoCompleteCustomSource = ObjAF.Config_Source_SG + 'txtShotCharge.AutoCompleteCustomSource = ObjAF.Config_LoadInOZ_SG + 'Dim ObjAF As New AutoFillCollections.ShotGun + txtSource.AutoCompleteCustomSource = ConfigShotgun.Source(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtShotCharge.AutoCompleteCustomSource = ConfigShotgun.LoadInOunces(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Gets the maximum wad charge. + ''' + ''' The i identifier. + ''' System.String. + + Function GetMaxWADCharge(ByVal iID As Long) As String + Dim sAns As String = "" + Try + Dim lst As List(Of WadData) = WadInventory.GetDetails(DatabasePath, iID, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As WadData In lst + sAns = o.LoadInOzText + Next + 'Dim SQL As String = "SELECT * from List_SG_WAD where ID=" & iID + 'Dim Obj As New BSDatabase + 'Obj.ConnectDB() + 'Dim CMD As New OdbcCommand(Sql, Obj.Conn) + 'Dim RS As OdbcDataReader + 'RS = CMD.ExecuteReader + 'While RS.Read + ' sAns = RS("load_t") + 'End While + 'RS.Close() + 'RS = Nothing + 'CMD = Nothing + 'Obj.CloseDB() + Catch ex As Exception + Call LogError(Name, "GetMaxWADCharge", Err.Number, ex.Message.ToString) + End Try + Return sAns + End Function + ''' + ''' Handles the SelectedIndexChanged event of the cmdWAD control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub cmdWAD_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles cmdWAD.SelectedIndexChanged + Try + Dim wadId As Long = cmdWAD.SelectedValue + txtShotCharge.Text = GetMaxWADCharge(wadId) + Catch ex As Exception + Call LogError(Name, "cmdWAD_SelectedIndexChanged", Err.Number, ex.Message.ToString) + End Try + End Sub - Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click - Try - Dim PID As Long = cmbPrimer.SelectedValue - Dim HID As Long = cmdHull.SelectedValue - Dim WID As Long = cmdWAD.SelectedValue - Dim sLoad As String = txtShotCharge.Text - Dim dLoad As Double = Converters.ConvertOZToDouble(sLoad, errOut) - Dim SLTID As Long = cmdShotType.SelectedValue - Dim LTID As Long = cmbLoadType.SelectedValue - Dim sSource As String = GeneralHelpers.FluffContent(txtSource.Text) - Dim IsPersonal As Boolean = chkPersonal.Checked - Dim iPersonal As Integer = 1 - Dim SQL As String = "" - Dim Obj As New BSDatabase - If Not IsPersonal Then iPersonal = 0 - SQL = "INSERT INTO Config_List_Data_SG (CLNID,ATID,CALID,PRID,CAID,SW,SW_t,WAD" & _ - ",SCL,Source,GID,IsPersonal,LTID) VALUES(" & ConfigID & "," & CalID & "," & GID & "," & PID & _ - "," & HID & "," & dLoad & ",'" & sLoad & "'," & WID & "," & SLTID & ",'" & _ - sSource & "'," & GID & "," & iPersonal & "," & LTID & ")" - Obj.ConnExec(SQL) - SQL = "UPDATE Config_List_Name set IsPersonal=" & iPersonal & " where id=" & ConfigID - Obj.ConnExec(SQL) - frmConfig_Add_Wizard_SG_Powder.MdiParent = Me.MdiParent - frmConfig_Add_Wizard_SG_Powder.ConfigID = ConfigID - frmConfig_Add_Wizard_SG_Powder.ConfigName = ConfigName - frmConfig_Add_Wizard_SG_Powder.CalName = CalName - frmConfig_Add_Wizard_SG_Powder.FromConfigWiz = True - frmConfig_Add_Wizard_SG_Powder.CalID = CalID - frmConfig_Add_Wizard_SG_Powder.GID = GID - frmConfig_Add_Wizard_SG_Powder.Show() - Me.Close() - Catch ex As Exception - Call LogError(Me.Name, "btnNext.Click", Err.Number, ex.Message.ToString) - End Try - End Sub - - Private Sub chkPersonal_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkPersonal.CheckedChanged - If chkPersonal.Checked Then - txtSource.ReadOnly = True - Else - txtSource.ReadOnly = False - End If - End Sub -End Class \ No newline at end of file + ''' + ''' Handles the Click event of the btnNext control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnNext_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnNext.Click + Try + Dim primerId As Long = cmbPrimer.SelectedValue + Dim hullId As Long = cmdHull.SelectedValue + Dim wadId As Long = cmdWAD.SelectedValue + Dim shotCharge As String = txtShotCharge.Text + Dim shotChargeNumeric As Double = Converters.ConvertOzToDouble(shotCharge, _errOut) + Dim shotTypeId As Long = cmdShotType.SelectedValue + Dim loadTypeId As Long = cmbLoadType.SelectedValue + Dim source As String = GeneralHelpers.FluffContent(txtSource.Text) + ' TODO: Double check this + If Not ConfigListDataShotgun.Add(DatabasePath, ConfigId, CaliberId, + GaugeId, primerId, hullId, shotChargeNumeric, + shotCharge, shotTypeId, 0, wadId, + loadTypeId, source, GaugeId, chkPersonal.Checked, + loadTypeId, 0, 0, + _errOut) Then Throw new Exception(_errOut) + If Not ConfigListDataName.SetPersonal(DatabaseName, ConfigId, chkPersonal.Checked, + _errOut) Then Throw New Exception(_errOut) + 'Dim isPersonal As Boolean = chkPersonal.Checked + 'Dim iPersonal As Integer = 1 + 'Dim sql As String = "" + 'Dim obj As New BSDatabase + 'If Not isPersonal Then iPersonal = 0 + 'sql = "INSERT INTO Config_List_Data_SG (CLNID,ATID,CALID,PRID,CAID,SW,SW_t,WAD" & _ + ' ",SCL,Source,GID,IsPersonal,LTID) VALUES(" & ConfigId & "," & CaliberId & "," & GaugeId & "," & primerId & _ + ' "," & hullId & "," & shotChargeNumeric & ",'" & shotCharge & "'," & wadId & "," & shotTypeId & ",'" & _ + ' source & "'," & GaugeId & "," & iPersonal & "," & loadTypeId & ")" + 'obj.ConnExec(sql) + 'sql = "UPDATE Config_List_Name set IsPersonal=" & iPersonal & " where id=" & ConfigId + 'obj.ConnExec(sql) + frmConfig_Add_Wizard_SG_Powder.MdiParent = MdiParent + frmConfig_Add_Wizard_SG_Powder.ConfigID = ConfigId + frmConfig_Add_Wizard_SG_Powder.ConfigName = ConfigName + frmConfig_Add_Wizard_SG_Powder.CalName = CaliberName + frmConfig_Add_Wizard_SG_Powder.FromConfigWiz = True + frmConfig_Add_Wizard_SG_Powder.CalID = CaliberId + frmConfig_Add_Wizard_SG_Powder.GID = GaugeId + frmConfig_Add_Wizard_SG_Powder.Show() + Close() + Catch ex As Exception + Call LogError(Name, "btnNext.Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the CheckedChanged event of the chkPersonal control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub chkPersonal_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles chkPersonal.CheckedChanged + If chkPersonal.Checked Then + txtSource.ReadOnly = True + Else + txtSource.ReadOnly = False + End If + End Sub + End Class +End Namespace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_3.Designer.vb b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_3.Designer.vb index 634555a..692fbb5 100644 --- a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_3.Designer.vb +++ b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_3.Designer.vb @@ -1,334 +1,336 @@ - _ -Partial Class frmConfig_Add_Wizard_SG_3 - Inherits System.Windows.Forms.Form +Namespace Adding + _ + Partial Class FrmConfigAddWizardSg3 + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmConfig_Add_Wizard_SG_3)) - Me.chkPersonal = New System.Windows.Forms.CheckBox - Me.Label9 = New System.Windows.Forms.Label - Me.Label8 = New System.Windows.Forms.Label - Me.txtSource = New System.Windows.Forms.TextBox - Me.btnNext = New System.Windows.Forms.Button - Me.Label7 = New System.Windows.Forms.Label - Me.cmbLoadType = New System.Windows.Forms.ComboBox - Me.ListSGShotChargeLoadsBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.Label6 = New System.Windows.Forms.Label - Me.cmdHull = New System.Windows.Forms.ComboBox - Me.ListSGCaseBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.cmdWAD = New System.Windows.Forms.ComboBox - Me.ListSGWADBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.cmbPrimer = New System.Windows.Forms.ComboBox - Me.ViewPrimerListBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.Label3 = New System.Windows.Forms.Label - Me.Label2 = New System.Windows.Forms.Label - Me.Label1 = New System.Windows.Forms.Label - Me.Label4 = New System.Windows.Forms.Label - Me.cmbSlug = New System.Windows.Forms.ComboBox - Me.ListSGShotTypeDetailsBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.ViewPrimerListTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.viewPrimerListTableAdapter - Me.List_SG_CaseTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_CaseTableAdapter - Me.List_SG_WADTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_WADTableAdapter - Me.List_SG_ShotCharge_LoadsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotCharge_LoadsTableAdapter - Me.List_SG_ShotType_DetailsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotType_DetailsTableAdapter - CType(Me.ListSGShotChargeLoadsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.ListSGCaseBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.ListSGWADBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.ViewPrimerListBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.ListSGShotTypeDetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'chkPersonal - ' - Me.chkPersonal.AutoSize = True - Me.chkPersonal.Checked = True - Me.chkPersonal.CheckState = System.Windows.Forms.CheckState.Checked - Me.chkPersonal.Location = New System.Drawing.Point(109, 200) - Me.chkPersonal.Name = "chkPersonal" - Me.chkPersonal.Size = New System.Drawing.Size(44, 17) - Me.chkPersonal.TabIndex = 35 - Me.chkPersonal.Text = "Yes" - Me.chkPersonal.UseVisualStyleBackColor = True - ' - 'Label9 - ' - Me.Label9.AutoSize = True - Me.Label9.Location = New System.Drawing.Point(12, 201) - Me.Label9.Name = "Label9" - Me.Label9.Size = New System.Drawing.Size(81, 13) - Me.Label9.TabIndex = 34 - Me.Label9.Text = "Personal Load?" - ' - 'Label8 - ' - Me.Label8.AutoSize = True - Me.Label8.Location = New System.Drawing.Point(12, 225) - Me.Label8.Name = "Label8" - Me.Label8.Size = New System.Drawing.Size(41, 13) - Me.Label8.TabIndex = 33 - Me.Label8.Text = "Source" - ' - 'txtSource - ' - Me.txtSource.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtSource.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtSource.Location = New System.Drawing.Point(109, 222) - Me.txtSource.Name = "txtSource" - Me.txtSource.ReadOnly = True - Me.txtSource.Size = New System.Drawing.Size(235, 20) - Me.txtSource.TabIndex = 32 - ' - 'btnNext - ' - Me.btnNext.Location = New System.Drawing.Point(269, 248) - Me.btnNext.Name = "btnNext" - Me.btnNext.Size = New System.Drawing.Size(75, 23) - Me.btnNext.TabIndex = 31 - Me.btnNext.Text = "&Next" - Me.btnNext.UseVisualStyleBackColor = True - ' - 'Label7 - ' - Me.Label7.Location = New System.Drawing.Point(12, 9) - Me.Label7.Name = "Label7" - Me.Label7.Size = New System.Drawing.Size(332, 44) - Me.Label7.TabIndex = 30 - Me.Label7.Text = "Select the Components below that will go into make this kind of shotgun load. Af" & _ - "ter you have finished, click on the Next button to add the Powder Information." - ' - 'cmbLoadType - ' - Me.cmbLoadType.DataSource = Me.ListSGShotChargeLoadsBindingSource - Me.cmbLoadType.DisplayMember = "Name" - Me.cmbLoadType.FormattingEnabled = True - Me.cmbLoadType.Location = New System.Drawing.Point(109, 173) - Me.cmbLoadType.Name = "cmbLoadType" - Me.cmbLoadType.Size = New System.Drawing.Size(235, 21) - Me.cmbLoadType.TabIndex = 29 - Me.cmbLoadType.ValueMember = "ID" - ' - 'ListSGShotChargeLoadsBindingSource - ' - Me.ListSGShotChargeLoadsBindingSource.DataMember = "List_SG_ShotCharge_Loads" - Me.ListSGShotChargeLoadsBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(12, 176) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(61, 13) - Me.Label6.TabIndex = 28 - Me.Label6.Text = "Load Type:" - ' - 'cmdHull - ' - Me.cmdHull.DataSource = Me.ListSGCaseBindingSource - Me.cmdHull.DisplayMember = "Name" - Me.cmdHull.FormattingEnabled = True - Me.cmdHull.Location = New System.Drawing.Point(109, 91) - Me.cmdHull.Name = "cmdHull" - Me.cmdHull.Size = New System.Drawing.Size(235, 21) - Me.cmdHull.TabIndex = 24 - Me.cmdHull.ValueMember = "ID" - ' - 'ListSGCaseBindingSource - ' - Me.ListSGCaseBindingSource.DataMember = "List_SG_Case" - Me.ListSGCaseBindingSource.DataSource = Me.MLLDataSet - ' - 'cmdWAD - ' - Me.cmdWAD.DataSource = Me.ListSGWADBindingSource - Me.cmdWAD.DisplayMember = "WAD" - Me.cmdWAD.FormattingEnabled = True - Me.cmdWAD.Location = New System.Drawing.Point(109, 118) - Me.cmdWAD.Name = "cmdWAD" - Me.cmdWAD.Size = New System.Drawing.Size(235, 21) - Me.cmdWAD.TabIndex = 23 - Me.cmdWAD.ValueMember = "ID" - ' - 'ListSGWADBindingSource - ' - Me.ListSGWADBindingSource.DataMember = "List_SG_WAD" - Me.ListSGWADBindingSource.DataSource = Me.MLLDataSet - ' - 'cmbPrimer - ' - Me.cmbPrimer.DataSource = Me.ViewPrimerListBindingSource - Me.cmbPrimer.DisplayMember = "PrimerName" - Me.cmbPrimer.FormattingEnabled = True - Me.cmbPrimer.Location = New System.Drawing.Point(109, 66) - Me.cmbPrimer.Name = "cmbPrimer" - Me.cmbPrimer.Size = New System.Drawing.Size(235, 21) - Me.cmbPrimer.TabIndex = 22 - Me.cmbPrimer.ValueMember = "ID" - ' - 'ViewPrimerListBindingSource - ' - Me.ViewPrimerListBindingSource.DataMember = "viewPrimerList" - Me.ViewPrimerListBindingSource.DataSource = Me.MLLDataSet - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(12, 121) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(36, 13) - Me.Label3.TabIndex = 20 - Me.Label3.Text = "WAD:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(12, 94) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(28, 13) - Me.Label2.TabIndex = 19 - Me.Label2.Text = "Hull:" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(12, 69) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(39, 13) - Me.Label1.TabIndex = 18 - Me.Label1.Text = "Primer:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(12, 149) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(58, 13) - Me.Label4.TabIndex = 36 - Me.Label4.Text = "Slug Type:" - ' - 'cmbSlug - ' - Me.cmbSlug.DataSource = Me.ListSGShotTypeDetailsBindingSource - Me.cmbSlug.DisplayMember = "Name" - Me.cmbSlug.FormattingEnabled = True - Me.cmbSlug.Location = New System.Drawing.Point(109, 145) - Me.cmbSlug.Name = "cmbSlug" - Me.cmbSlug.Size = New System.Drawing.Size(235, 21) - Me.cmbSlug.TabIndex = 37 - Me.cmbSlug.ValueMember = "ID" - ' - 'ListSGShotTypeDetailsBindingSource - ' - Me.ListSGShotTypeDetailsBindingSource.DataMember = "List_SG_ShotType_Details" - Me.ListSGShotTypeDetailsBindingSource.DataSource = Me.MLLDataSet - ' - 'ViewPrimerListTableAdapter - ' - Me.ViewPrimerListTableAdapter.ClearBeforeFill = True - ' - 'List_SG_CaseTableAdapter - ' - Me.List_SG_CaseTableAdapter.ClearBeforeFill = True - ' - 'List_SG_WADTableAdapter - ' - Me.List_SG_WADTableAdapter.ClearBeforeFill = True - ' - 'List_SG_ShotCharge_LoadsTableAdapter - ' - Me.List_SG_ShotCharge_LoadsTableAdapter.ClearBeforeFill = True - ' - 'List_SG_ShotType_DetailsTableAdapter - ' - Me.List_SG_ShotType_DetailsTableAdapter.ClearBeforeFill = True - ' - 'frmConfig_Add_Wizard_SG_3 - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(366, 290) - Me.Controls.Add(Me.cmbSlug) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.chkPersonal) - Me.Controls.Add(Me.Label9) - Me.Controls.Add(Me.Label8) - Me.Controls.Add(Me.txtSource) - Me.Controls.Add(Me.btnNext) - Me.Controls.Add(Me.Label7) - Me.Controls.Add(Me.cmbLoadType) - Me.Controls.Add(Me.Label6) - Me.Controls.Add(Me.cmdHull) - Me.Controls.Add(Me.cmdWAD) - Me.Controls.Add(Me.cmbPrimer) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmConfig_Add_Wizard_SG_3" - Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "Slug Configuration" - CType(Me.ListSGShotChargeLoadsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.ListSGCaseBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.ListSGWADBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.ViewPrimerListBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.ListSGShotTypeDetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmConfigAddWizardSg3)) + Me.chkPersonal = New System.Windows.Forms.CheckBox + Me.Label9 = New System.Windows.Forms.Label + Me.Label8 = New System.Windows.Forms.Label + Me.txtSource = New System.Windows.Forms.TextBox + Me.btnNext = New System.Windows.Forms.Button + Me.Label7 = New System.Windows.Forms.Label + Me.cmbLoadType = New System.Windows.Forms.ComboBox + Me.ListSGShotChargeLoadsBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.Label6 = New System.Windows.Forms.Label + Me.cmdHull = New System.Windows.Forms.ComboBox + Me.ListSGCaseBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.cmdWAD = New System.Windows.Forms.ComboBox + Me.ListSGWADBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.cmbPrimer = New System.Windows.Forms.ComboBox + Me.ViewPrimerListBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.Label3 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label1 = New System.Windows.Forms.Label + Me.Label4 = New System.Windows.Forms.Label + Me.cmbSlug = New System.Windows.Forms.ComboBox + Me.ListSGShotTypeDetailsBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.ViewPrimerListTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.viewPrimerListTableAdapter + Me.List_SG_CaseTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_CaseTableAdapter + Me.List_SG_WADTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_WADTableAdapter + Me.List_SG_ShotCharge_LoadsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotCharge_LoadsTableAdapter + Me.List_SG_ShotType_DetailsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotType_DetailsTableAdapter + CType(Me.ListSGShotChargeLoadsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ListSGCaseBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ListSGWADBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ViewPrimerListBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ListSGShotTypeDetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'chkPersonal + ' + Me.chkPersonal.AutoSize = True + Me.chkPersonal.Checked = True + Me.chkPersonal.CheckState = System.Windows.Forms.CheckState.Checked + Me.chkPersonal.Location = New System.Drawing.Point(109, 200) + Me.chkPersonal.Name = "chkPersonal" + Me.chkPersonal.Size = New System.Drawing.Size(44, 17) + Me.chkPersonal.TabIndex = 35 + Me.chkPersonal.Text = "Yes" + Me.chkPersonal.UseVisualStyleBackColor = True + ' + 'Label9 + ' + Me.Label9.AutoSize = True + Me.Label9.Location = New System.Drawing.Point(12, 201) + Me.Label9.Name = "Label9" + Me.Label9.Size = New System.Drawing.Size(81, 13) + Me.Label9.TabIndex = 34 + Me.Label9.Text = "Personal Load?" + ' + 'Label8 + ' + Me.Label8.AutoSize = True + Me.Label8.Location = New System.Drawing.Point(12, 225) + Me.Label8.Name = "Label8" + Me.Label8.Size = New System.Drawing.Size(41, 13) + Me.Label8.TabIndex = 33 + Me.Label8.Text = "Source" + ' + 'txtSource + ' + Me.txtSource.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtSource.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtSource.Location = New System.Drawing.Point(109, 222) + Me.txtSource.Name = "txtSource" + Me.txtSource.ReadOnly = True + Me.txtSource.Size = New System.Drawing.Size(235, 20) + Me.txtSource.TabIndex = 32 + ' + 'btnNext + ' + Me.btnNext.Location = New System.Drawing.Point(269, 248) + Me.btnNext.Name = "btnNext" + Me.btnNext.Size = New System.Drawing.Size(75, 23) + Me.btnNext.TabIndex = 31 + Me.btnNext.Text = "&Next" + Me.btnNext.UseVisualStyleBackColor = True + ' + 'Label7 + ' + Me.Label7.Location = New System.Drawing.Point(12, 9) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(332, 44) + Me.Label7.TabIndex = 30 + Me.Label7.Text = "Select the Components below that will go into make this kind of shotgun load. Af" & _ + "ter you have finished, click on the Next button to add the Powder Information." + ' + 'cmbLoadType + ' + Me.cmbLoadType.DataSource = Me.ListSGShotChargeLoadsBindingSource + Me.cmbLoadType.DisplayMember = "Name" + Me.cmbLoadType.FormattingEnabled = True + Me.cmbLoadType.Location = New System.Drawing.Point(109, 173) + Me.cmbLoadType.Name = "cmbLoadType" + Me.cmbLoadType.Size = New System.Drawing.Size(235, 21) + Me.cmbLoadType.TabIndex = 29 + Me.cmbLoadType.ValueMember = "ID" + ' + 'ListSGShotChargeLoadsBindingSource + ' + Me.ListSGShotChargeLoadsBindingSource.DataMember = "List_SG_ShotCharge_Loads" + Me.ListSGShotChargeLoadsBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(12, 176) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(61, 13) + Me.Label6.TabIndex = 28 + Me.Label6.Text = "Load Type:" + ' + 'cmdHull + ' + Me.cmdHull.DataSource = Me.ListSGCaseBindingSource + Me.cmdHull.DisplayMember = "Name" + Me.cmdHull.FormattingEnabled = True + Me.cmdHull.Location = New System.Drawing.Point(109, 91) + Me.cmdHull.Name = "cmdHull" + Me.cmdHull.Size = New System.Drawing.Size(235, 21) + Me.cmdHull.TabIndex = 24 + Me.cmdHull.ValueMember = "ID" + ' + 'ListSGCaseBindingSource + ' + Me.ListSGCaseBindingSource.DataMember = "List_SG_Case" + Me.ListSGCaseBindingSource.DataSource = Me.MLLDataSet + ' + 'cmdWAD + ' + Me.cmdWAD.DataSource = Me.ListSGWADBindingSource + Me.cmdWAD.DisplayMember = "WAD" + Me.cmdWAD.FormattingEnabled = True + Me.cmdWAD.Location = New System.Drawing.Point(109, 118) + Me.cmdWAD.Name = "cmdWAD" + Me.cmdWAD.Size = New System.Drawing.Size(235, 21) + Me.cmdWAD.TabIndex = 23 + Me.cmdWAD.ValueMember = "ID" + ' + 'ListSGWADBindingSource + ' + Me.ListSGWADBindingSource.DataMember = "List_SG_WAD" + Me.ListSGWADBindingSource.DataSource = Me.MLLDataSet + ' + 'cmbPrimer + ' + Me.cmbPrimer.DataSource = Me.ViewPrimerListBindingSource + Me.cmbPrimer.DisplayMember = "PrimerName" + Me.cmbPrimer.FormattingEnabled = True + Me.cmbPrimer.Location = New System.Drawing.Point(109, 66) + Me.cmbPrimer.Name = "cmbPrimer" + Me.cmbPrimer.Size = New System.Drawing.Size(235, 21) + Me.cmbPrimer.TabIndex = 22 + Me.cmbPrimer.ValueMember = "ID" + ' + 'ViewPrimerListBindingSource + ' + Me.ViewPrimerListBindingSource.DataMember = "viewPrimerList" + Me.ViewPrimerListBindingSource.DataSource = Me.MLLDataSet + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(12, 121) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(36, 13) + Me.Label3.TabIndex = 20 + Me.Label3.Text = "WAD:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 94) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(28, 13) + Me.Label2.TabIndex = 19 + Me.Label2.Text = "Hull:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 69) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(39, 13) + Me.Label1.TabIndex = 18 + Me.Label1.Text = "Primer:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(12, 149) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(58, 13) + Me.Label4.TabIndex = 36 + Me.Label4.Text = "Slug Type:" + ' + 'cmbSlug + ' + Me.cmbSlug.DataSource = Me.ListSGShotTypeDetailsBindingSource + Me.cmbSlug.DisplayMember = "Name" + Me.cmbSlug.FormattingEnabled = True + Me.cmbSlug.Location = New System.Drawing.Point(109, 145) + Me.cmbSlug.Name = "cmbSlug" + Me.cmbSlug.Size = New System.Drawing.Size(235, 21) + Me.cmbSlug.TabIndex = 37 + Me.cmbSlug.ValueMember = "ID" + ' + 'ListSGShotTypeDetailsBindingSource + ' + Me.ListSGShotTypeDetailsBindingSource.DataMember = "List_SG_ShotType_Details" + Me.ListSGShotTypeDetailsBindingSource.DataSource = Me.MLLDataSet + ' + 'ViewPrimerListTableAdapter + ' + Me.ViewPrimerListTableAdapter.ClearBeforeFill = True + ' + 'List_SG_CaseTableAdapter + ' + Me.List_SG_CaseTableAdapter.ClearBeforeFill = True + ' + 'List_SG_WADTableAdapter + ' + Me.List_SG_WADTableAdapter.ClearBeforeFill = True + ' + 'List_SG_ShotCharge_LoadsTableAdapter + ' + Me.List_SG_ShotCharge_LoadsTableAdapter.ClearBeforeFill = True + ' + 'List_SG_ShotType_DetailsTableAdapter + ' + Me.List_SG_ShotType_DetailsTableAdapter.ClearBeforeFill = True + ' + 'frmConfig_Add_Wizard_SG_3 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(366, 290) + Me.Controls.Add(Me.cmbSlug) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.chkPersonal) + Me.Controls.Add(Me.Label9) + Me.Controls.Add(Me.Label8) + Me.Controls.Add(Me.txtSource) + Me.Controls.Add(Me.btnNext) + Me.Controls.Add(Me.Label7) + Me.Controls.Add(Me.cmbLoadType) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.cmdHull) + Me.Controls.Add(Me.cmdWAD) + Me.Controls.Add(Me.cmbPrimer) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "FrmConfigAddWizardSg3" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Slug Configuration" + CType(Me.ListSGShotChargeLoadsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ListSGCaseBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ListSGWADBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ViewPrimerListBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ListSGShotTypeDetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents chkPersonal As System.Windows.Forms.CheckBox - Friend WithEvents Label9 As System.Windows.Forms.Label - Friend WithEvents Label8 As System.Windows.Forms.Label - Friend WithEvents txtSource As System.Windows.Forms.TextBox - Friend WithEvents btnNext As System.Windows.Forms.Button - Friend WithEvents Label7 As System.Windows.Forms.Label - Friend WithEvents cmbLoadType As System.Windows.Forms.ComboBox - Friend WithEvents Label6 As System.Windows.Forms.Label - Friend WithEvents cmdHull As System.Windows.Forms.ComboBox - Friend WithEvents cmdWAD As System.Windows.Forms.ComboBox - Friend WithEvents cmbPrimer As System.Windows.Forms.ComboBox - Friend WithEvents Label3 As System.Windows.Forms.Label - Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents Label1 As System.Windows.Forms.Label - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents ViewPrimerListBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents ViewPrimerListTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.viewPrimerListTableAdapter - Friend WithEvents ListSGCaseBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_SG_CaseTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_CaseTableAdapter - Friend WithEvents ListSGWADBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_SG_WADTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_WADTableAdapter - Friend WithEvents ListSGShotChargeLoadsBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_SG_ShotCharge_LoadsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotCharge_LoadsTableAdapter - Friend WithEvents Label4 As System.Windows.Forms.Label - Friend WithEvents cmbSlug As System.Windows.Forms.ComboBox - Friend WithEvents ListSGShotTypeDetailsBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_SG_ShotType_DetailsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotType_DetailsTableAdapter -End Class + End Sub + Friend WithEvents chkPersonal As System.Windows.Forms.CheckBox + Friend WithEvents Label9 As System.Windows.Forms.Label + Friend WithEvents Label8 As System.Windows.Forms.Label + Friend WithEvents txtSource As System.Windows.Forms.TextBox + Friend WithEvents btnNext As System.Windows.Forms.Button + Friend WithEvents Label7 As System.Windows.Forms.Label + Friend WithEvents cmbLoadType As System.Windows.Forms.ComboBox + Friend WithEvents Label6 As System.Windows.Forms.Label + Friend WithEvents cmdHull As System.Windows.Forms.ComboBox + Friend WithEvents cmdWAD As System.Windows.Forms.ComboBox + Friend WithEvents cmbPrimer As System.Windows.Forms.ComboBox + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents ViewPrimerListBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents ViewPrimerListTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.viewPrimerListTableAdapter + Friend WithEvents ListSGCaseBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_SG_CaseTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_CaseTableAdapter + Friend WithEvents ListSGWADBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_SG_WADTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_WADTableAdapter + Friend WithEvents ListSGShotChargeLoadsBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_SG_ShotCharge_LoadsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotCharge_LoadsTableAdapter + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents cmbSlug As System.Windows.Forms.ComboBox + Friend WithEvents ListSGShotTypeDetailsBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_SG_ShotType_DetailsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotType_DetailsTableAdapter + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_3.vb b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_3.vb index 59b55c1..68beeb0 100644 --- a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_3.vb +++ b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_3.vb @@ -1,65 +1,110 @@ Imports System.Data Imports System.Data.Odbc Imports BSMyLoadersLog.LoadersClass +Imports BurnSoft.Applications.MLL.AutoFill Imports BurnSoft.Applications.MLL.Helpers -Public Class frmConfig_Add_Wizard_SG_3 - Public ConfigName As String - Public CalID As Long - Public ConfigID As Long - Public CalName As String - Public GID As Long - Private Sub frmConfig_Add_Wizard_SG_3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Try - Me.List_SG_ShotType_DetailsTableAdapter.FillBy_CFG_List_Slug(Me.MLLDataSet.List_SG_ShotType_Details, CalName) - Me.List_SG_ShotCharge_LoadsTableAdapter.Fill(Me.MLLDataSet.List_SG_ShotCharge_Loads) - Me.List_SG_WADTableAdapter.FillBy_CFG_WADList(Me.MLLDataSet.List_SG_WAD, GID) - Me.List_SG_CaseTableAdapter.FillBy_CFG_List(Me.MLLDataSet.List_SG_Case, GID) - Me.ViewPrimerListTableAdapter.Fill(Me.MLLDataSet.viewPrimerList) - Dim ObjAF As New AutoFillCollections.ShotGun - txtSource.AutoCompleteCustomSource = ObjAF.Config_Source_SG - Catch ex As Exception - Call LogError(Me.Name, "Load", Err.Number, ex.Message.ToString) - End Try - End Sub +Namespace Adding - Private Sub chkPersonal_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkPersonal.CheckedChanged - If chkPersonal.Checked Then - txtSource.ReadOnly = True - Else - txtSource.ReadOnly = False - End If - End Sub - - Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click - Try - Dim PID As Long = cmbPrimer.SelectedValue - Dim HID As Long = cmdHull.SelectedValue - Dim WID As Long = cmdWAD.SelectedValue - Dim STID As Long = cmbSlug.SelectedValue - Dim LTID As Long = cmbLoadType.SelectedValue - Dim sSource As String = GeneralHelpers.FluffContent(txtSource.Text) - Dim IsPersonal As Boolean = chkPersonal.Checked - Dim iPersonal As Integer = 1 - Dim SQL As String = "" - Dim Obj As New BSDatabase - If Not IsPersonal Then iPersonal = 0 - SQL = "INSERT INTO Config_List_Data_SG (CLNID,ATID,CALID,PRID,CAID,WAD" & _ - ",SCL,Source,GID,IsPersonal,LTID) VALUES(" & ConfigID & "," & CalID & "," & GID & "," & PID & _ - "," & HID & "," & WID & "," & STID & ",'" & _ - sSource & "'," & GID & "," & iPersonal & "," & LTID & ")" - Obj.ConnExec(SQL) - frmConfig_Add_Wizard_SG_Powder.MdiParent = Me.MdiParent - frmConfig_Add_Wizard_SG_Powder.ConfigID = ConfigID - frmConfig_Add_Wizard_SG_Powder.ConfigName = ConfigName - frmConfig_Add_Wizard_SG_Powder.CalName = CalName - frmConfig_Add_Wizard_SG_Powder.CalID = CalID - frmConfig_Add_Wizard_SG_Powder.FromConfigWiz = True - frmConfig_Add_Wizard_SG_Powder.GID = GID - frmConfig_Add_Wizard_SG_Powder.Show() - Me.Close() - Catch ex As Exception - Call LogError(Me.Name, "btnNext_Click", Err.Number, ex.Message.ToString) - End Try - End Sub -End Class \ No newline at end of file + ''' + ''' Class frmConfig_Add_Wizard_SG_3. + ''' Implements the + ''' + ''' + Public Class FrmConfigAddWizardSg3 + ' TODO: #20 Code Cleanup + ''' + ''' The error out + ''' + Dim errOut as String + ''' + ''' The configuration name + ''' + Public ConfigName As String + ''' + ''' The cal identifier + ''' + Public CaliberId As Long + ''' + ''' The configuration identifier + ''' + Public ConfigId As Long + ''' + ''' The cal name + ''' + Public CaliberName As String + ''' + ''' The gid + ''' + Public GaugeId As Long + ''' + ''' Handles the Load event of the frmConfig_Add_Wizard_SG_3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmConfig_Add_Wizard_SG_3_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Try + List_SG_ShotType_DetailsTableAdapter.FillBy_CFG_List_Slug(MLLDataSet.List_SG_ShotType_Details, CaliberName) + List_SG_ShotCharge_LoadsTableAdapter.Fill(MLLDataSet.List_SG_ShotCharge_Loads) + List_SG_WADTableAdapter.FillBy_CFG_WADList(MLLDataSet.List_SG_WAD, GaugeId) + List_SG_CaseTableAdapter.FillBy_CFG_List(MLLDataSet.List_SG_Case, GaugeId) + ViewPrimerListTableAdapter.Fill(MLLDataSet.viewPrimerList) + 'Dim ObjAF As New AutoFillCollections.ShotGun + 'txtSource.AutoCompleteCustomSource = ObjAF.Config_Source_SG + txtSource.AutoCompleteCustomSource = ConfigShotgun.Source(DatabasePath, errOut) + If errOut.Length > 0 Then Throw New Exception(errOut) + Catch ex As Exception + Call LogError(Me.Name, "Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the CheckedChanged event of the chkPersonal control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub chkPersonal_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles chkPersonal.CheckedChanged + If chkPersonal.Checked Then + txtSource.ReadOnly = True + Else + txtSource.ReadOnly = False + End If + End Sub + ''' + ''' Handles the Click event of the btnNext control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnNext_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnNext.Click + Try + Dim primerId As Long = cmbPrimer.SelectedValue + Dim hullId As Long = cmdHull.SelectedValue + Dim wadId As Long = cmdWAD.SelectedValue + Dim slugId As Long = cmbSlug.SelectedValue + Dim loadTypeId As Long = cmbLoadType.SelectedValue + Dim source As String = GeneralHelpers.FluffContent(txtSource.Text) + Dim isPersonal As Boolean = chkPersonal.Checked + Dim iPersonal As Integer = 1 + Dim sql As String = "" + Dim obj As New BSDatabase + If Not isPersonal Then iPersonal = 0 + sql = "INSERT INTO Config_List_Data_SG (CLNID,ATID,CALID,PRID,CAID,WAD" & _ + ",SCL,Source,GID,IsPersonal,LTID) VALUES(" & ConfigId & "," & CaliberId & "," & GaugeId & "," & primerId & _ + "," & hullId & "," & wadId & "," & slugId & ",'" & _ + source & "'," & GaugeId & "," & iPersonal & "," & loadTypeId & ")" + obj.ConnExec(sql) + frmConfig_Add_Wizard_SG_Powder.MdiParent = Me.MdiParent + frmConfig_Add_Wizard_SG_Powder.ConfigID = ConfigId + frmConfig_Add_Wizard_SG_Powder.ConfigName = ConfigName + frmConfig_Add_Wizard_SG_Powder.CalName = CaliberName + frmConfig_Add_Wizard_SG_Powder.CalID = CaliberId + frmConfig_Add_Wizard_SG_Powder.FromConfigWiz = True + frmConfig_Add_Wizard_SG_Powder.GID = GaugeId + frmConfig_Add_Wizard_SG_Powder.Show() + Me.Close() + Catch ex As Exception + Call LogError(Me.Name, "btnNext_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_Powder.vb b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_Powder.vb index a84351e..9db6f4b 100644 --- a/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_Powder.vb +++ b/BSMyLoadersLog/Adding/frmConfig_Add_Wizard_SG_Powder.vb @@ -2,17 +2,47 @@ Imports System.Data Imports System.Data.Odbc Imports BSMyLoadersLog.LoadersClass Imports BurnSoft.Applications.MLL.Helpers - +''' +''' Class frmConfig_Add_Wizard_SG_Powder. +''' Implements the +''' +''' Public Class frmConfig_Add_Wizard_SG_Powder + ''' + ''' The configuration name + ''' Public ConfigName As String + ''' + ''' The cal identifier + ''' Public CalID As Long + ''' + ''' The cal name + ''' Public CalName As String + ''' + ''' The gid + ''' Public GID As Long + ''' + ''' The configuration identifier + ''' Public ConfigID As Long + ''' + ''' From configuration wiz + ''' Public FromConfigWiz As Boolean + ''' + ''' Handles the Load event of the frmConfig_Add_Wizard_SG_4 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. Private Sub frmConfig_Add_Wizard_SG_4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Call LoadData() End Sub + ''' + ''' Saves the data. + ''' Sub SaveData() Try Dim dCharge As Double = GeneralHelpers.FluffContent(txtCharge.Text, 0) @@ -35,6 +65,11 @@ Public Class frmConfig_Add_Wizard_SG_Powder Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) End Try End Sub + ''' + ''' Determines whether [has perf powder] [the specified LNG identifier]. + ''' + ''' The LNG identifier. + ''' true if [has perf powder] [the specified LNG identifier]; otherwise, false. Private Function HasPerfPowder(ByVal lngID As Long) As Boolean Dim bAns As Boolean = False Try @@ -55,6 +90,9 @@ Public Class frmConfig_Add_Wizard_SG_Powder End Try Return bAns End Function + ''' + ''' Loads the data. + ''' Sub LoadData() Try Me.General_PowderTableAdapter.FillBy_Config_List(Me.MLLDataSet.General_Powder) @@ -62,7 +100,11 @@ Public Class frmConfig_Add_Wizard_SG_Powder Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) End Try End Sub - + ''' + ''' Handles the Click event of the btnSave control. + ''' + ''' The source of the event. + ''' The instance containing the event data. Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click Call SaveData() End Sub diff --git a/BSMyLoadersLog/Adding/frmCopy_DataSheet_Copy_ShotGun.Designer.vb b/BSMyLoadersLog/Adding/frmCopy_DataSheet_Copy_ShotGun.Designer.vb new file mode 100644 index 0000000..c7ddcb9 --- /dev/null +++ b/BSMyLoadersLog/Adding/frmCopy_DataSheet_Copy_ShotGun.Designer.vb @@ -0,0 +1,39 @@ +Namespace Adding + _ + Partial Class FrmCopyDataSheetCopyShotGun + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.SuspendLayout() + ' + 'frmCopy_DataSheet_Copy_ShotGun + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(284, 262) + Me.Name = "FrmCopyDataSheetCopyShotGun" + Me.Text = "frmCopy_DataSheet_Copy_ShotGun" + Me.ResumeLayout(False) + + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/frmCopy_DataSheet_Copy_ShotGun.resx b/BSMyLoadersLog/Adding/frmCopy_DataSheet_Copy_ShotGun.resx similarity index 97% rename from BSMyLoadersLog/frmCopy_DataSheet_Copy_ShotGun.resx rename to BSMyLoadersLog/Adding/frmCopy_DataSheet_Copy_ShotGun.resx index 29dcb1b..1af7de1 100644 --- a/BSMyLoadersLog/frmCopy_DataSheet_Copy_ShotGun.resx +++ b/BSMyLoadersLog/Adding/frmCopy_DataSheet_Copy_ShotGun.resx @@ -1,120 +1,120 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmCopy_DataSheet_Copy_ShotGun.vb b/BSMyLoadersLog/Adding/frmCopy_DataSheet_Copy_ShotGun.vb new file mode 100644 index 0000000..4815cf6 --- /dev/null +++ b/BSMyLoadersLog/Adding/frmCopy_DataSheet_Copy_ShotGun.vb @@ -0,0 +1,25 @@ +Namespace Adding + ''' + ''' Class FrmCopyDataSheetCopyShotGun. + ''' Implements the + ''' + ''' + Public Class FrmCopyDataSheetCopyShotGun + ''' + ''' From view + ''' + Public FromView As Boolean + ''' + ''' The cfgid + ''' + Public CFGID As Integer + ''' + ''' Handles the Load event of the frmCopy_DataSheet_Copy_ShotGun control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmCopy_DataSheet_Copy_ShotGun_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load + 'TODO: Finish the Copy Shotgun Copy Data Sheet Form + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmCopy_DataSheet_RiflePistol.Designer.vb b/BSMyLoadersLog/Adding/frmCopy_DataSheet_RiflePistol.Designer.vb new file mode 100644 index 0000000..a404c57 --- /dev/null +++ b/BSMyLoadersLog/Adding/frmCopy_DataSheet_RiflePistol.Designer.vb @@ -0,0 +1,440 @@ +Namespace Adding + _ + Partial Class FrmCopyDataSheetRiflePistol + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmCopyDataSheetRiflePistol)) + Me.txtCase = New System.Windows.Forms.TextBox + Me.txtPrimer = New System.Windows.Forms.TextBox + Me.txtBullet = New System.Windows.Forms.TextBox + Me.txtPowManu = New System.Windows.Forms.TextBox + Me.txtPowWei = New System.Windows.Forms.TextBox + Me.txtPowName = New System.Windows.Forms.TextBox + Me.Label14 = New System.Windows.Forms.Label + Me.Label13 = New System.Windows.Forms.Label + Me.Label12 = New System.Windows.Forms.Label + Me.Label11 = New System.Windows.Forms.Label + Me.Label10 = New System.Windows.Forms.Label + Me.Label4 = New System.Windows.Forms.Label + Me.nudYards = New System.Windows.Forms.NumericUpDown + Me.Label9 = New System.Windows.Forms.Label + Me.nudShots = New System.Windows.Forms.NumericUpDown + Me.Label8 = New System.Windows.Forms.Label + Me.btnCancel = New System.Windows.Forms.Button + Me.btnAdd = New System.Windows.Forms.Button + Me.txtNotes = New System.Windows.Forms.TextBox + Me.txtLen = New System.Windows.Forms.TextBox + Me.txtCon = New System.Windows.Forms.TextBox + Me.txtGroup = New System.Windows.Forms.TextBox + Me.dtpTested = New System.Windows.Forms.DateTimePicker + Me.cmbFirearm = New System.Windows.Forms.ComboBox + Me.LoadersLogFirearmsBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.Label7 = New System.Windows.Forms.Label + Me.Label6 = New System.Windows.Forms.Label + Me.Label5 = New System.Windows.Forms.Label + Me.Label3 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label1 = New System.Windows.Forms.Label + Me.Loaders_Log_FirearmsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_FirearmsTableAdapter + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + CType(Me.nudYards, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.nudShots, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LoadersLogFirearmsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'txtCase + ' + Me.txtCase.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtCase.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtCase.Location = New System.Drawing.Point(132, 269) + Me.txtCase.Name = "txtCase" + Me.txtCase.Size = New System.Drawing.Size(200, 20) + Me.txtCase.TabIndex = 56 + ' + 'txtPrimer + ' + Me.txtPrimer.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPrimer.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPrimer.Location = New System.Drawing.Point(132, 243) + Me.txtPrimer.Name = "txtPrimer" + Me.txtPrimer.Size = New System.Drawing.Size(200, 20) + Me.txtPrimer.TabIndex = 55 + ' + 'txtBullet + ' + Me.txtBullet.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtBullet.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtBullet.Location = New System.Drawing.Point(132, 217) + Me.txtBullet.Name = "txtBullet" + Me.txtBullet.Size = New System.Drawing.Size(200, 20) + Me.txtBullet.TabIndex = 54 + ' + 'txtPowManu + ' + Me.txtPowManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPowManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPowManu.Location = New System.Drawing.Point(132, 191) + Me.txtPowManu.Name = "txtPowManu" + Me.txtPowManu.Size = New System.Drawing.Size(200, 20) + Me.txtPowManu.TabIndex = 53 + ' + 'txtPowWei + ' + Me.txtPowWei.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPowWei.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPowWei.Location = New System.Drawing.Point(132, 165) + Me.txtPowWei.Name = "txtPowWei" + Me.txtPowWei.Size = New System.Drawing.Size(200, 20) + Me.txtPowWei.TabIndex = 52 + ' + 'txtPowName + ' + Me.txtPowName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPowName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPowName.Location = New System.Drawing.Point(132, 140) + Me.txtPowName.Name = "txtPowName" + Me.txtPowName.Size = New System.Drawing.Size(200, 20) + Me.txtPowName.TabIndex = 51 + ' + 'Label14 + ' + Me.Label14.AutoSize = True + Me.Label14.Location = New System.Drawing.Point(12, 272) + Me.Label14.Name = "Label14" + Me.Label14.Size = New System.Drawing.Size(34, 13) + Me.Label14.TabIndex = 75 + Me.Label14.Text = "Case:" + ' + 'Label13 + ' + Me.Label13.AutoSize = True + Me.Label13.Location = New System.Drawing.Point(12, 246) + Me.Label13.Name = "Label13" + Me.Label13.Size = New System.Drawing.Size(39, 13) + Me.Label13.TabIndex = 74 + Me.Label13.Text = "Primer:" + ' + 'Label12 + ' + Me.Label12.AutoSize = True + Me.Label12.Location = New System.Drawing.Point(12, 220) + Me.Label12.Name = "Label12" + Me.Label12.Size = New System.Drawing.Size(36, 13) + Me.Label12.TabIndex = 73 + Me.Label12.Text = "Bullet:" + ' + 'Label11 + ' + Me.Label11.AutoSize = True + Me.Label11.Location = New System.Drawing.Point(12, 194) + Me.Label11.Name = "Label11" + Me.Label11.Size = New System.Drawing.Size(112, 13) + Me.Label11.TabIndex = 72 + Me.Label11.Text = "Powder Manufacturer:" + ' + 'Label10 + ' + Me.Label10.AutoSize = True + Me.Label10.Location = New System.Drawing.Point(12, 168) + Me.Label10.Name = "Label10" + Me.Label10.Size = New System.Drawing.Size(123, 13) + Me.Label10.TabIndex = 71 + Me.Label10.Text = "Weight of Powder Used:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(12, 143) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(77, 13) + Me.Label4.TabIndex = 70 + Me.Label4.Text = "Powder Name:" + ' + 'nudYards + ' + Me.nudYards.Location = New System.Drawing.Point(132, 60) + Me.nudYards.Maximum = New Decimal(New Integer() {5000, 0, 0, 0}) + Me.nudYards.Name = "nudYards" + Me.nudYards.Size = New System.Drawing.Size(200, 20) + Me.nudYards.TabIndex = 48 + ' + 'Label9 + ' + Me.Label9.AutoSize = True + Me.Label9.Location = New System.Drawing.Point(12, 62) + Me.Label9.Name = "Label9" + Me.Label9.Size = New System.Drawing.Size(81, 13) + Me.Label9.TabIndex = 69 + Me.Label9.Text = "Yards tested at:" + ' + 'nudShots + ' + Me.nudShots.Location = New System.Drawing.Point(132, 114) + Me.nudShots.Maximum = New Decimal(New Integer() {1000, 0, 0, 0}) + Me.nudShots.Name = "nudShots" + Me.nudShots.Size = New System.Drawing.Size(200, 20) + Me.nudShots.TabIndex = 50 + ' + 'Label8 + ' + Me.Label8.AutoSize = True + Me.Label8.Location = New System.Drawing.Point(12, 116) + Me.Label8.Name = "Label8" + Me.Label8.Size = New System.Drawing.Size(89, 13) + Me.Label8.TabIndex = 68 + Me.Label8.Text = "Number of Shots:" + ' + 'btnCancel + ' + Me.btnCancel.Location = New System.Drawing.Point(257, 454) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 61 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'btnAdd + ' + Me.btnAdd.Location = New System.Drawing.Point(15, 454) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(75, 23) + Me.btnAdd.TabIndex = 60 + Me.btnAdd.Text = "Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'txtNotes + ' + Me.txtNotes.Location = New System.Drawing.Point(15, 362) + Me.txtNotes.Multiline = True + Me.txtNotes.Name = "txtNotes" + Me.txtNotes.Size = New System.Drawing.Size(317, 84) + Me.txtNotes.TabIndex = 59 + ' + 'txtLen + ' + Me.txtLen.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtLen.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtLen.Location = New System.Drawing.Point(132, 321) + Me.txtLen.Name = "txtLen" + Me.txtLen.Size = New System.Drawing.Size(200, 20) + Me.txtLen.TabIndex = 58 + ' + 'txtCon + ' + Me.txtCon.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtCon.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtCon.Location = New System.Drawing.Point(132, 295) + Me.txtCon.Name = "txtCon" + Me.txtCon.Size = New System.Drawing.Size(200, 20) + Me.txtCon.TabIndex = 57 + ' + 'txtGroup + ' + Me.txtGroup.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtGroup.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtGroup.Location = New System.Drawing.Point(132, 86) + Me.txtGroup.Name = "txtGroup" + Me.txtGroup.Size = New System.Drawing.Size(200, 20) + Me.txtGroup.TabIndex = 49 + ' + 'dtpTested + ' + Me.dtpTested.Location = New System.Drawing.Point(132, 33) + Me.dtpTested.Name = "dtpTested" + Me.dtpTested.Size = New System.Drawing.Size(200, 20) + Me.dtpTested.TabIndex = 47 + ' + 'cmbFirearm + ' + Me.cmbFirearm.DataSource = Me.LoadersLogFirearmsBindingSource + Me.cmbFirearm.DisplayMember = "FullName" + Me.cmbFirearm.FormattingEnabled = True + Me.cmbFirearm.Location = New System.Drawing.Point(132, 6) + Me.cmbFirearm.Name = "cmbFirearm" + Me.cmbFirearm.Size = New System.Drawing.Size(200, 21) + Me.cmbFirearm.TabIndex = 46 + Me.cmbFirearm.ValueMember = "ID" + ' + 'LoadersLogFirearmsBindingSource + ' + Me.LoadersLogFirearmsBindingSource.DataMember = "Loaders_Log_Firearms" + Me.LoadersLogFirearmsBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'Label7 + ' + Me.Label7.AutoSize = True + Me.Label7.Location = New System.Drawing.Point(12, 346) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(35, 13) + Me.Label7.TabIndex = 67 + Me.Label7.Text = "Notes" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(12, 324) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(70, 13) + Me.Label6.TabIndex = 66 + Me.Label6.Text = "Total Length:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(12, 298) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(59, 13) + Me.Label5.TabIndex = 65 + Me.Label5.Text = "Conditions:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(12, 89) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(103, 13) + Me.Label3.TabIndex = 64 + Me.Label3.Text = "Group size or Score:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 37) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(65, 13) + Me.Label2.TabIndex = 63 + Me.Label2.Text = "Date tested:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 9) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(98, 13) + Me.Label1.TabIndex = 62 + Me.Label1.Text = "Firearm tested with:" + ' + 'Loaders_Log_FirearmsTableAdapter + ' + Me.Loaders_Log_FirearmsTableAdapter.ClearBeforeFill = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmCopy_DataSheet_RiflePistol + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(348, 489) + Me.Controls.Add(Me.txtCase) + Me.Controls.Add(Me.txtPrimer) + Me.Controls.Add(Me.txtBullet) + Me.Controls.Add(Me.txtPowManu) + Me.Controls.Add(Me.txtPowWei) + Me.Controls.Add(Me.txtPowName) + Me.Controls.Add(Me.Label14) + Me.Controls.Add(Me.Label13) + Me.Controls.Add(Me.Label12) + Me.Controls.Add(Me.Label11) + Me.Controls.Add(Me.Label10) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.nudYards) + Me.Controls.Add(Me.Label9) + Me.Controls.Add(Me.nudShots) + Me.Controls.Add(Me.Label8) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.txtNotes) + Me.Controls.Add(Me.txtLen) + Me.Controls.Add(Me.txtCon) + Me.Controls.Add(Me.txtGroup) + Me.Controls.Add(Me.dtpTested) + Me.Controls.Add(Me.cmbFirearm) + Me.Controls.Add(Me.Label7) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.HelpProvider1.SetHelpKeyword(Me, "Copy Loaders Log Entry") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Copy Loaders Log Entry") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "FrmCopyDataSheetRiflePistol" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Copy Loaders Log Entry" + CType(Me.nudYards, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.nudShots, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LoadersLogFirearmsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents txtCase As System.Windows.Forms.TextBox + Friend WithEvents txtPrimer As System.Windows.Forms.TextBox + Friend WithEvents txtBullet As System.Windows.Forms.TextBox + Friend WithEvents txtPowManu As System.Windows.Forms.TextBox + Friend WithEvents txtPowWei As System.Windows.Forms.TextBox + Friend WithEvents txtPowName As System.Windows.Forms.TextBox + Friend WithEvents Label14 As System.Windows.Forms.Label + Friend WithEvents Label13 As System.Windows.Forms.Label + Friend WithEvents Label12 As System.Windows.Forms.Label + Friend WithEvents Label11 As System.Windows.Forms.Label + Friend WithEvents Label10 As System.Windows.Forms.Label + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents nudYards As System.Windows.Forms.NumericUpDown + Friend WithEvents Label9 As System.Windows.Forms.Label + Friend WithEvents nudShots As System.Windows.Forms.NumericUpDown + Friend WithEvents Label8 As System.Windows.Forms.Label + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents txtNotes As System.Windows.Forms.TextBox + Friend WithEvents txtLen As System.Windows.Forms.TextBox + Friend WithEvents txtCon As System.Windows.Forms.TextBox + Friend WithEvents txtGroup As System.Windows.Forms.TextBox + Friend WithEvents dtpTested As System.Windows.Forms.DateTimePicker + Friend WithEvents cmbFirearm As System.Windows.Forms.ComboBox + Friend WithEvents Label7 As System.Windows.Forms.Label + Friend WithEvents Label6 As System.Windows.Forms.Label + Friend WithEvents Label5 As System.Windows.Forms.Label + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents LoadersLogFirearmsBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents Loaders_Log_FirearmsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_FirearmsTableAdapter + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/frmCopy_DataSheet_RiflePistol.resx b/BSMyLoadersLog/Adding/frmCopy_DataSheet_RiflePistol.resx similarity index 98% rename from BSMyLoadersLog/frmCopy_DataSheet_RiflePistol.resx rename to BSMyLoadersLog/Adding/frmCopy_DataSheet_RiflePistol.resx index 6ea37d6..06ea66c 100644 --- a/BSMyLoadersLog/frmCopy_DataSheet_RiflePistol.resx +++ b/BSMyLoadersLog/Adding/frmCopy_DataSheet_RiflePistol.resx @@ -1,152 +1,152 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 128, 17 - - - 17, 17 - - - 351, 17 - - - 17, 54 - - - - - AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAQAMAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADJ0dN+fY6BgZWDgpCXl5urq6vDy83I0NLK09TR3uAAAAAAAAAAAAAAAAAAAAAAAADCysx8 - fJbt7e3q6e3Pzt20s8mfn7KUlKWMi6CCgpeAgI+UlJnO290AAAAAAAAAAACmpqdISIi2t7/U1NXf39/l - 5eXq6urq6urt7e3u7u7s7O7V1OKxub8AAAAAAAAAAACNjZQ5OIM5OJg+PpZLSpNeXph1daCOjq2nqLrB - wcjU1NTf39/ExMQAAAAAAAAAAAB4d4suLIBEQqVDQaM+PJw6OJU1M44zMYozMYs1M4w8O5BOTZVqaZIA - AAAAAADR3uBmZYcxL4ZGQ6hDQaU/Pp48Opg4NpI3NY83NZA6OJQ+PJtBP6FjYpYAAAAAAADJ0tNRUHs1 - M49HRatFQ6hCP6I/PZ08Opk7OZY7OZc+PJpAPp9CQKOCgaYAAAAAAADFzc8+PXQ7OZlIRq1GRKtEQqdC - QKNAPp8/Pp4/Pp9BQKFDQaVDQaSmrr4AAAAAAAC0uLk3NXxAPaJJR65IRq1HRKtFQ6hEQqZEQqVEQqVE - QqdGRKpFQ6TBys0AAAAAAACWlps3NYVEQahIRq1IRq1IRq1HRqxHRaxHRatHRatHRaxIRq1TUp8AAAAA - AAAAAACBgI83NYxLSa9JR65IRq1JR65IRq1JR65IRq1JR65IRq1JR61raqIAAAAAAAAAAAB7e5Y3NJFQ - TrJJR65IRq1IRq1IRq1IRq1IRq1IRq1IRq1IRq2NkboAAAAAAAAAAACCgaA+PJxUUrZUUrVUUbRTUbJT - UbJTULFRT7JLSa5IRq1IRq2pscEAAAAAAAAAAACnr7tFQqhPTLlPTLlPTLlPTLlOS7hOS7ZOS7VUUbdV - UrVVU7LDzM4AAAAAAAAAAADR3uCkrMWRlMR2da1jYadXVK9PTLdPS7hPTLhPTLlPTLlcWqoAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAADFzdCxucOiqsGSlcOEgrqTkbUAAAAAAAAAAADADwAAwAEAAMAB - AADAAQAAwAEAAIABAACAAQAAgAEAAIABAACAAwAAgAMAAIADAACAAwAAgAMAAIAHAAD+BwAA - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 128, 17 + + + 17, 17 + + + 351, 17 + + + 17, 54 + + + + + AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAQAMAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAADJ0dN+fY6BgZWDgpCXl5urq6vDy83I0NLK09TR3uAAAAAAAAAAAAAAAAAAAAAAAADCysx8 + fJbt7e3q6e3Pzt20s8mfn7KUlKWMi6CCgpeAgI+UlJnO290AAAAAAAAAAACmpqdISIi2t7/U1NXf39/l + 5eXq6urq6urt7e3u7u7s7O7V1OKxub8AAAAAAAAAAACNjZQ5OIM5OJg+PpZLSpNeXph1daCOjq2nqLrB + wcjU1NTf39/ExMQAAAAAAAAAAAB4d4suLIBEQqVDQaM+PJw6OJU1M44zMYozMYs1M4w8O5BOTZVqaZIA + AAAAAADR3uBmZYcxL4ZGQ6hDQaU/Pp48Opg4NpI3NY83NZA6OJQ+PJtBP6FjYpYAAAAAAADJ0tNRUHs1 + M49HRatFQ6hCP6I/PZ08Opk7OZY7OZc+PJpAPp9CQKOCgaYAAAAAAADFzc8+PXQ7OZlIRq1GRKtEQqdC + QKNAPp8/Pp4/Pp9BQKFDQaVDQaSmrr4AAAAAAAC0uLk3NXxAPaJJR65IRq1HRKtFQ6hEQqZEQqVEQqVE + QqdGRKpFQ6TBys0AAAAAAACWlps3NYVEQahIRq1IRq1IRq1HRqxHRaxHRatHRatHRaxIRq1TUp8AAAAA + AAAAAACBgI83NYxLSa9JR65IRq1JR65IRq1JR65IRq1JR65IRq1JR61raqIAAAAAAAAAAAB7e5Y3NJFQ + TrJJR65IRq1IRq1IRq1IRq1IRq1IRq1IRq1IRq2NkboAAAAAAAAAAACCgaA+PJxUUrZUUrVUUbRTUbJT + UbJTULFRT7JLSa5IRq1IRq2pscEAAAAAAAAAAACnr7tFQqhPTLlPTLlPTLlPTLlOS7hOS7ZOS7VUUbdV + UrVVU7LDzM4AAAAAAAAAAADR3uCkrMWRlMR2da1jYadXVK9PTLdPS7hPTLhPTLlPTLlcWqoAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAADFzdCxucOiqsGSlcOEgrqTkbUAAAAAAAAAAADADwAAwAEAAMAB + AADAAQAAwAEAAIABAACAAQAAgAEAAIABAACAAwAAgAMAAIADAACAAwAAgAMAAIAHAAD+BwAA + + \ No newline at end of file diff --git a/BSMyLoadersLog/Adding/frmCopy_DataSheet_RiflePistol.vb b/BSMyLoadersLog/Adding/frmCopy_DataSheet_RiflePistol.vb new file mode 100644 index 0000000..d7ca567 --- /dev/null +++ b/BSMyLoadersLog/Adding/frmCopy_DataSheet_RiflePistol.vb @@ -0,0 +1,125 @@ +Imports BSMyLoadersLog.Viewing +Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.LoadersLog +Imports BurnSoft.Applications.MLL.Types + +Namespace Adding + ''' + ''' Class FrmCopyDataSheetRiflePistol. + ''' Implements the + ''' + ''' + Public Class FrmCopyDataSheetRiflePistol + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' The configuration identifier + ''' + Public ConfigId As Long + ''' + ''' From view + ''' + Public FromView As Boolean + ''' + ''' Loads the data. + ''' + ''' + Sub LoadData() + Try + Loaders_Log_FirearmsTableAdapter.Fill(MLLDataSet.Loaders_Log_Firearms) + Dim strSplit() As String + Dim lst As List(Of LoadersLogMetallicData) = LoadersLogMetallic.GetDetails(DatabasePath, ConfigId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As LoadersLogMetallicData In lst + cmbFirearm.SelectedValue = o.FirearmId + dtpTested.Value = o.DateCreated + txtGroup.Text = o.GroupSize + nudShots.Value = o.NumberOfShots + nudYards.Value = o.Yards + strSplit = Split(o.PowderDetails, " - ") + txtPowName.Text = Trim(strSplit(0)) + txtPowWei.Text = Trim(strSplit(1)) + txtPowManu.Text = Trim(strSplit(2)) + txtBullet.Text = o.BulletDetails + txtPrimer.Text = o.PrimerDetails + txtCase.Text = o.CaseDetails + txtCon.Text = o.Conditions + txtLen.Text = o.TotalLenght + txtNotes.Text = o.Notes + Next + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Saves the data. + ''' + ''' + Sub SaveData() + Try + Dim firearmId As Long = cmbFirearm.SelectedValue + Dim firearmName As String = cmbFirearm.Text + Dim dateCreated As String = dtpTested.Value + Dim groupSize As String = GeneralHelpers.FluffContent(txtGroup.Text) + Dim numShots As Long = nudShots.Value + Dim yards As Long = nudYards.Value + Dim powderName As String = GeneralHelpers.FluffContent(txtPowName.Text) + Dim powderWeight As String = GeneralHelpers.FluffContent(txtPowWei.Text) + Dim powderManufacturer As String = GeneralHelpers.FluffContent(txtPowManu.Text) + Dim bulletDetails As String = GeneralHelpers.FluffContent(txtBullet.Text) + Dim primerDetails As String = GeneralHelpers.FluffContent(txtPrimer.Text) + Dim caseDetails As String = GeneralHelpers.FluffContent(txtCase.Text) + Dim condition As String = GeneralHelpers.FluffContent(txtCon.Text) + Dim oal As String = GeneralHelpers.FluffContent(txtLen.Text) + Dim notes As String = GeneralHelpers.FluffContent(txtNotes.Text) + Dim configName As String = "N/A" + Dim barrelLenght As String = "" + Dim caliber As String = "" + + Dim lst As List(Of FirearmCollection) = Firearms.GetDetails(DatabasePath, CInt(firearmId), _errOut) + For Each o As FirearmCollection In lst + caliber = o.Caliber + barrelLenght = o.Barrel + Next + + If Not LoadersLogMetallic.Add(DatabasePath, firearmId, dateCreated, CInt(yards), groupSize, + CInt(numShots), $"{powderName} - {powderWeight} - {powderManufacturer}", + bulletDetails, primerDetails, caseDetails, condition, oal, notes, + configName, firearmName, caliber, barrelLenght, + _errOut) Then Throw New Exception(_errOut) + + MsgBox("Information was saved to the Loaders Log!") + If FromView Then Call FrmViewDataSheetRiflePistols.LoadDataCur() + Close() + Catch ex As Exception + Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmCopy_DataSheet_RiflePistol control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmCopy_DataSheet_RiflePistol_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call LoadData() + End Sub + ''' + ''' Handles the Click event of the btnAdd control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click + Call SaveData() + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/BSMyLoadersLog.vbproj b/BSMyLoadersLog/BSMyLoadersLog.vbproj index ddd6673..7f0c8f5 100644 --- a/BSMyLoadersLog/BSMyLoadersLog.vbproj +++ b/BSMyLoadersLog/BSMyLoadersLog.vbproj @@ -63,7 +63,7 @@ My Project\app.manifest - true + false 7A8EC588D285191AC5FC7F2E2C6E784F539770C2 @@ -72,8 +72,11 @@ http://timestamp.verisign.com/scripts/timstamp.dll - - ..\packages\BurnSoft.Applications.MLL.3.0.3.61-beta\lib\net481\BurnSoft.Applications.MLL.dll + + ..\packages\BurnSoft.Applications.MGC.1.7.16.59-beta\lib\net481\BurnSoft.Applications.MGC.dll + + + ..\packages\BurnSoft.Applications.MLL.3.0.3.79-beta\lib\net481\BurnSoft.Applications.MLL.dll False @@ -174,10 +177,10 @@ Form - + frmCopy_DataSheet_Copy_ShotGun.vb - + Form @@ -380,10 +383,10 @@ Form - + frmCopy_DataSheet_RiflePistol.vb - + Form @@ -518,10 +521,10 @@ Form - - frmLoadMakeReady_Details.vb + + FrmLoadMakeReadyDetails.vb - + Form @@ -820,7 +823,7 @@ frmAddQtyHulls.vb - + frmCopy_DataSheet_Copy_ShotGun.vb @@ -963,7 +966,7 @@ Designer frmConfig_Add_Wizard_SG_Powder.vb - + Designer frmCopy_DataSheet_RiflePistol.vb @@ -1055,9 +1058,9 @@ Designer frmImportFirearms.vb - + Designer - frmLoadMakeReady_Details.vb + FrmLoadMakeReadyDetails.vb Designer @@ -1241,6 +1244,7 @@ + diff --git a/BSMyLoadersLog/BurnSoft.Applications.MGC.chm b/BSMyLoadersLog/BurnSoft.Applications.MGC.chm new file mode 100644 index 0000000..5eff5ef Binary files /dev/null and b/BSMyLoadersLog/BurnSoft.Applications.MGC.chm differ diff --git a/BSMyLoadersLog/BurnSoft.Applications.MLL.chm b/BSMyLoadersLog/BurnSoft.Applications.MLL.chm index fcba7cc..d7065cd 100644 Binary files a/BSMyLoadersLog/BurnSoft.Applications.MLL.chm and b/BSMyLoadersLog/BurnSoft.Applications.MLL.chm differ diff --git a/BSMyLoadersLog/DBBackup/MLL.mdb b/BSMyLoadersLog/DBBackup/v1.0/MLL.mdb similarity index 92% rename from BSMyLoadersLog/DBBackup/MLL.mdb rename to BSMyLoadersLog/DBBackup/v1.0/MLL.mdb index 241b79c..cd19bec 100644 Binary files a/BSMyLoadersLog/DBBackup/MLL.mdb and b/BSMyLoadersLog/DBBackup/v1.0/MLL.mdb differ diff --git a/BSMyLoadersLog/DBBackup/v2.1/MLL.mdb b/BSMyLoadersLog/DBBackup/v2.1/MLL.mdb new file mode 100644 index 0000000..d8f5a2e Binary files /dev/null and b/BSMyLoadersLog/DBBackup/v2.1/MLL.mdb differ diff --git a/BSMyLoadersLog/DBBackup/v2.2/MLL.mdb b/BSMyLoadersLog/DBBackup/v2.2/MLL.mdb new file mode 100644 index 0000000..b995575 Binary files /dev/null and b/BSMyLoadersLog/DBBackup/v2.2/MLL.mdb differ diff --git a/BSMyLoadersLog/Editing/frmEditBullets.vb b/BSMyLoadersLog/Editing/frmEditBullets.vb index b383689..5357b25 100644 --- a/BSMyLoadersLog/Editing/frmEditBullets.vb +++ b/BSMyLoadersLog/Editing/frmEditBullets.vb @@ -41,7 +41,7 @@ Public Class frmEditBullets If Not IsDBNull(RS("ePPB")) Then eppo = RS("ePPB") dPrice = eppo * iQty nudQty.Value = iQty - txtPrice.Text = ObjIM.ConvertToDollars(dPrice) + txtPrice.Text = Converters.ConvertToDollars(dPrice) End While RS.Close() RS = Nothing @@ -99,7 +99,7 @@ Public Class frmEditBullets Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click Try Call SaveData() - If FromView Then Call frmView_List_Bullets.LoadData() + If FromView Then Call FrmViewListBullets.LoadData() Me.Close() Catch ex As Exception Call LogError(Me.Name, "btnAdd.Click", Err.Number, ex.Message.ToString) diff --git a/BSMyLoadersLog/Editing/frmEditBushing_Powder.vb b/BSMyLoadersLog/Editing/frmEditBushing_Powder.vb index e9ff5a3..b285b73 100644 --- a/BSMyLoadersLog/Editing/frmEditBushing_Powder.vb +++ b/BSMyLoadersLog/Editing/frmEditBushing_Powder.vb @@ -1,8 +1,13 @@ Imports BSMyLoadersLog.LoadersClass Imports System.Data.Odbc +Imports BurnSoft.Applications.MLL.AutoFill Imports BurnSoft.Applications.MLL.Helpers Public Class frmEditBushing_Powder + ''' + ''' The error out + ''' + Dim errOut as String Public CID As Long Sub LoadData() Try @@ -30,10 +35,16 @@ Public Class frmEditBushing_Powder End Sub Sub PreloadData() Try - Dim Objaf As New AutoFillCollections.ShotGun - txtManu.AutoCompleteCustomSource = Objaf.List_SG_Bushings_Powder_Manufacturer - txtName.AutoCompleteCustomSource = Objaf.List_SG_Bushings_Powder_Name - txtCharge.AutoCompleteCustomSource = Objaf.List_SG_Bushings_Powder_sCharge + 'Dim Objaf As New AutoFillCollections.ShotGun + 'txtManu.AutoCompleteCustomSource = Objaf.List_SG_Bushings_Powder_Manufacturer + 'txtName.AutoCompleteCustomSource = Objaf.List_SG_Bushings_Powder_Name + 'txtCharge.AutoCompleteCustomSource = Objaf.List_SG_Bushings_Powder_sCharge + txtManu.AutoCompleteCustomSource = ConfigShotgun.BushingPowderManufacturer(DatabasePath, errOut) + If errOut.Length > 0 Then Throw New Exception(errOut) + txtName.AutoCompleteCustomSource = ConfigShotgun.BushingPowderName(DatabasePath, errOut) + If errOut.Length > 0 Then Throw New Exception(errOut) + txtCharge.AutoCompleteCustomSource = ConfigShotgun.BushingPowderCharge(DatabasePath, errOut) + If errOut.Length > 0 Then Throw New Exception(errOut) Catch ex As Exception Call LogError(Me.Name, "PreloadData", Err.Number, ex.Message.ToString) End Try diff --git a/BSMyLoadersLog/Editing/frmEditBushing_Shot.vb b/BSMyLoadersLog/Editing/frmEditBushing_Shot.vb index b62cbbf..b54a769 100644 --- a/BSMyLoadersLog/Editing/frmEditBushing_Shot.vb +++ b/BSMyLoadersLog/Editing/frmEditBushing_Shot.vb @@ -1,8 +1,13 @@ Imports BSMyLoadersLog.LoadersClass Imports System.Data.Odbc +Imports BurnSoft.Applications.MLL.AutoFill Imports BurnSoft.Applications.MLL.Helpers Public Class frmEditBushing_Shot + ''' + ''' The error out + ''' + Dim errOut as String Public CID As Long Sub LoadData() Dim Obj As New BSDatabase @@ -25,10 +30,16 @@ Public Class frmEditBushing_Shot End Sub Sub PreLoadData() Try - Dim ObjAF As New AutoFillCollections.ShotGun - txtCharge.AutoCompleteCustomSource = ObjAF.List_SG_Bushings_Shot_sCharge - txtManu.AutoCompleteCustomSource = ObjAF.List_SG_Bushings_Shot_Manufacturer - txtName.AutoCompleteCustomSource = ObjAF.List_SG_Bushings_Shot_Name + 'Dim ObjAF As New AutoFillCollections.ShotGun + 'txtCharge.AutoCompleteCustomSource = ObjAF.List_SG_Bushings_Shot_sCharge + 'txtManu.AutoCompleteCustomSource = ObjAF.List_SG_Bushings_Shot_Manufacturer + 'txtName.AutoCompleteCustomSource = ObjAF.List_SG_Bushings_Shot_Name + txtCharge.AutoCompleteCustomSource = ConfigShotgun.BushingShotCharge(DatabasePath, errOut) + If errOut.Length > 0 Then Throw New Exception(errOut) + txtManu.AutoCompleteCustomSource = ConfigShotgun.BushingShotManufacturer(DatabasePath, errOut) + If errOut.Length > 0 Then Throw New Exception(errOut) + txtName.AutoCompleteCustomSource = ConfigShotgun.BushingShotName(DatabasePath, errOut) + If errOut.Length > 0 Then Throw New Exception(errOut) Catch ex As Exception Call LogError(Me.Name, "PreLoadData", Err.Number, ex.Message.ToString) End Try diff --git a/BSMyLoadersLog/Editing/frmEditDataSheet_RiflePistols.vb b/BSMyLoadersLog/Editing/frmEditDataSheet_RiflePistols.vb index 88c15b9..8832609 100644 --- a/BSMyLoadersLog/Editing/frmEditDataSheet_RiflePistols.vb +++ b/BSMyLoadersLog/Editing/frmEditDataSheet_RiflePistols.vb @@ -1,7 +1,7 @@ Imports BSMyLoadersLog.LoadersClass Imports System.Data.Odbc Imports BurnSoft.Applications.MLL.Helpers - +Imports BSMyLoadersLog.Viewing Public Class frmEditDataSheet_RiflePistols Public CFGID As Long Public FromView As Boolean @@ -67,7 +67,7 @@ Public Class frmEditDataSheet_RiflePistols "',BarrelLen='" & strBarLen & "' where ID=" & CFGID Obj.ConnExec(Sql) MsgBox("Information was saved to the Loaders Log!") - If FromView Then Call frmViewDataSheet_RiflePistols.LoadDataCur() + If FromView Then Call FrmViewDataSheetRiflePistols.LoadDataCur() Me.Close() Catch ex As Exception Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) diff --git a/BSMyLoadersLog/Editing/frmEditEquipment.vb b/BSMyLoadersLog/Editing/frmEditEquipment.vb index 63fcdb0..43551a1 100644 --- a/BSMyLoadersLog/Editing/frmEditEquipment.vb +++ b/BSMyLoadersLog/Editing/frmEditEquipment.vb @@ -1,6 +1,7 @@ Imports BSMyLoadersLog.LoadersClass Imports System.Data.Odbc Imports BurnSoft.Applications.MLL.Helpers +Imports BSMyLoadersLog.Viewing Public Class frmEditEquipment Public EID As Long @@ -46,7 +47,7 @@ Public Class frmEditEquipment "Use='" & strUse & "', Cost=" & strPrice & ", Notes='" & strNotes & "' where ID=" & EID Obj.ConnExec(SQL) Obj = Nothing - If FromView Then Call frmView_List_Equipment.LoadData() + If FromView Then Call FrmViewListEquipment.LoadData() Me.Close() Catch ex As Exception Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) diff --git a/BSMyLoadersLog/Editing/frmEditFirearm.vb b/BSMyLoadersLog/Editing/frmEditFirearm.vb index 203b596..a2184c4 100644 --- a/BSMyLoadersLog/Editing/frmEditFirearm.vb +++ b/BSMyLoadersLog/Editing/frmEditFirearm.vb @@ -1,6 +1,7 @@ Imports BSMyLoadersLog.LoadersClass Imports System.Data.Odbc Imports BurnSoft.Applications.MLL.Helpers +Imports BSMyLoadersLog.Viewing Public Class frmEditFirearm Public FID As Long @@ -56,7 +57,7 @@ Public Class frmEditFirearm ",SerialNo='" & strSerial & "',GType='" & strType & "',exclude=" & iExclude & _ " where ID=" & FID Obj.ConnExec(SQL) - If FromView Then Call frmView_List_Firearms.LoadData() + If FromView Then Call FrmViewListFirearms.LoadData() Me.Close() Catch ex As Exception Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) diff --git a/BSMyLoadersLog/Editing/frmEditHulls.Designer.vb b/BSMyLoadersLog/Editing/frmEditHulls.Designer.vb index cee8c6d..4c9389f 100644 --- a/BSMyLoadersLog/Editing/frmEditHulls.Designer.vb +++ b/BSMyLoadersLog/Editing/frmEditHulls.Designer.vb @@ -1,268 +1,270 @@ - _ -Partial Class frmEditHulls - Inherits System.Windows.Forms.Form +Namespace Editing + _ + Partial Class FrmEditHulls + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmEditHulls)) - Me.btnCancel = New System.Windows.Forms.Button - Me.btnAdd = New System.Windows.Forms.Button - Me.cmbGauge = New System.Windows.Forms.ComboBox - Me.ListSGGaugeBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.nudQty = New System.Windows.Forms.NumericUpDown - Me.txtPrice = New System.Windows.Forms.TextBox - Me.txtLen = New System.Windows.Forms.TextBox - Me.txtName = New System.Windows.Forms.TextBox - Me.txtManu = New System.Windows.Forms.TextBox - Me.Label6 = New System.Windows.Forms.Label - Me.Label5 = New System.Windows.Forms.Label - Me.Label4 = New System.Windows.Forms.Label - Me.Label3 = New System.Windows.Forms.Label - Me.Label2 = New System.Windows.Forms.Label - Me.Label1 = New System.Windows.Forms.Label - Me.List_SG_GaugeTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_GaugeTableAdapter - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - Me.txtDRAM = New System.Windows.Forms.TextBox - Me.Label7 = New System.Windows.Forms.Label - CType(Me.ListSGGaugeBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.nudQty, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'btnCancel - ' - Me.btnCancel.Location = New System.Drawing.Point(168, 212) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 22 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'btnAdd - ' - Me.btnAdd.Location = New System.Drawing.Point(30, 212) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(75, 23) - Me.btnAdd.TabIndex = 21 - Me.btnAdd.Text = "Update" - Me.btnAdd.UseVisualStyleBackColor = True - ' - 'cmbGauge - ' - Me.cmbGauge.DataSource = Me.ListSGGaugeBindingSource - Me.cmbGauge.DisplayMember = "ga" - Me.cmbGauge.FormattingEnabled = True - Me.cmbGauge.Location = New System.Drawing.Point(104, 71) - Me.cmbGauge.Name = "cmbGauge" - Me.cmbGauge.Size = New System.Drawing.Size(167, 21) - Me.cmbGauge.TabIndex = 15 - Me.cmbGauge.ValueMember = "ID" - ' - 'ListSGGaugeBindingSource - ' - Me.ListSGGaugeBindingSource.DataMember = "List_SG_Gauge" - Me.ListSGGaugeBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'nudQty - ' - Me.nudQty.Location = New System.Drawing.Point(105, 150) - Me.nudQty.Maximum = New Decimal(New Integer() {100000, 0, 0, 0}) - Me.nudQty.Name = "nudQty" - Me.nudQty.Size = New System.Drawing.Size(167, 20) - Me.nudQty.TabIndex = 19 - ' - 'txtPrice - ' - Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPrice.Location = New System.Drawing.Point(105, 176) - Me.txtPrice.Name = "txtPrice" - Me.txtPrice.Size = New System.Drawing.Size(167, 20) - Me.txtPrice.TabIndex = 20 - ' - 'txtLen - ' - Me.txtLen.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtLen.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtLen.Location = New System.Drawing.Point(104, 98) - Me.txtLen.Name = "txtLen" - Me.txtLen.Size = New System.Drawing.Size(167, 20) - Me.txtLen.TabIndex = 17 - ' - 'txtName - ' - Me.txtName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtName.Location = New System.Drawing.Point(104, 45) - Me.txtName.Name = "txtName" - Me.txtName.Size = New System.Drawing.Size(167, 20) - Me.txtName.TabIndex = 12 - ' - 'txtManu - ' - Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtManu.Location = New System.Drawing.Point(104, 19) - Me.txtManu.Name = "txtManu" - Me.txtManu.Size = New System.Drawing.Size(167, 20) - Me.txtManu.TabIndex = 10 - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(13, 179) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(34, 13) - Me.Label6.TabIndex = 18 - Me.Label6.Text = "Price:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(13, 152) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(26, 13) - Me.Label5.TabIndex = 16 - Me.Label5.Text = "Qty." - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(12, 101) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(43, 13) - Me.Label4.TabIndex = 14 - Me.Label4.Text = "Length:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(12, 74) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(42, 13) - Me.Label3.TabIndex = 13 - Me.Label3.Text = "Gauge:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(12, 48) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(38, 13) - Me.Label2.TabIndex = 11 - Me.Label2.Text = "Name:" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(12, 19) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(73, 13) - Me.Label1.TabIndex = 9 - Me.Label1.Text = "Manufacturer:" - ' - 'List_SG_GaugeTableAdapter - ' - Me.List_SG_GaugeTableAdapter.ClearBeforeFill = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'txtDRAM - ' - Me.txtDRAM.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtDRAM.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtDRAM.Location = New System.Drawing.Point(105, 124) - Me.txtDRAM.Name = "txtDRAM" - Me.txtDRAM.Size = New System.Drawing.Size(167, 20) - Me.txtDRAM.TabIndex = 23 - ' - 'Label7 - ' - Me.Label7.AutoSize = True - Me.Label7.Location = New System.Drawing.Point(13, 124) - Me.Label7.Name = "Label7" - Me.Label7.Size = New System.Drawing.Size(42, 13) - Me.Label7.TabIndex = 24 - Me.Label7.Text = "DRAM:" - ' - 'frmEditHulls - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(288, 250) - Me.Controls.Add(Me.txtDRAM) - Me.Controls.Add(Me.Label7) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnAdd) - Me.Controls.Add(Me.cmbGauge) - Me.Controls.Add(Me.nudQty) - Me.Controls.Add(Me.txtPrice) - Me.Controls.Add(Me.txtLen) - Me.Controls.Add(Me.txtName) - Me.Controls.Add(Me.txtManu) - Me.Controls.Add(Me.Label6) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmEditHulls" - Me.Text = "Edit Shotshell Hulls" - CType(Me.ListSGGaugeBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.nudQty, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmEditHulls)) + Me.btnCancel = New System.Windows.Forms.Button + Me.btnAdd = New System.Windows.Forms.Button + Me.cmbGauge = New System.Windows.Forms.ComboBox + Me.ListSGGaugeBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.nudQty = New System.Windows.Forms.NumericUpDown + Me.txtPrice = New System.Windows.Forms.TextBox + Me.txtLen = New System.Windows.Forms.TextBox + Me.txtName = New System.Windows.Forms.TextBox + Me.txtManu = New System.Windows.Forms.TextBox + Me.Label6 = New System.Windows.Forms.Label + Me.Label5 = New System.Windows.Forms.Label + Me.Label4 = New System.Windows.Forms.Label + Me.Label3 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label1 = New System.Windows.Forms.Label + Me.List_SG_GaugeTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_GaugeTableAdapter + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + Me.txtDRAM = New System.Windows.Forms.TextBox + Me.Label7 = New System.Windows.Forms.Label + CType(Me.ListSGGaugeBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.nudQty, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'btnCancel + ' + Me.btnCancel.Location = New System.Drawing.Point(168, 212) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 22 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'btnAdd + ' + Me.btnAdd.Location = New System.Drawing.Point(30, 212) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(75, 23) + Me.btnAdd.TabIndex = 21 + Me.btnAdd.Text = "Update" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'cmbGauge + ' + Me.cmbGauge.DataSource = Me.ListSGGaugeBindingSource + Me.cmbGauge.DisplayMember = "ga" + Me.cmbGauge.FormattingEnabled = True + Me.cmbGauge.Location = New System.Drawing.Point(104, 71) + Me.cmbGauge.Name = "cmbGauge" + Me.cmbGauge.Size = New System.Drawing.Size(167, 21) + Me.cmbGauge.TabIndex = 15 + Me.cmbGauge.ValueMember = "ID" + ' + 'ListSGGaugeBindingSource + ' + Me.ListSGGaugeBindingSource.DataMember = "List_SG_Gauge" + Me.ListSGGaugeBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'nudQty + ' + Me.nudQty.Location = New System.Drawing.Point(105, 150) + Me.nudQty.Maximum = New Decimal(New Integer() {100000, 0, 0, 0}) + Me.nudQty.Name = "nudQty" + Me.nudQty.Size = New System.Drawing.Size(167, 20) + Me.nudQty.TabIndex = 19 + ' + 'txtPrice + ' + Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPrice.Location = New System.Drawing.Point(105, 176) + Me.txtPrice.Name = "txtPrice" + Me.txtPrice.Size = New System.Drawing.Size(167, 20) + Me.txtPrice.TabIndex = 20 + ' + 'txtLen + ' + Me.txtLen.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtLen.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtLen.Location = New System.Drawing.Point(104, 98) + Me.txtLen.Name = "txtLen" + Me.txtLen.Size = New System.Drawing.Size(167, 20) + Me.txtLen.TabIndex = 17 + ' + 'txtName + ' + Me.txtName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtName.Location = New System.Drawing.Point(104, 45) + Me.txtName.Name = "txtName" + Me.txtName.Size = New System.Drawing.Size(167, 20) + Me.txtName.TabIndex = 12 + ' + 'txtManu + ' + Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtManu.Location = New System.Drawing.Point(104, 19) + Me.txtManu.Name = "txtManu" + Me.txtManu.Size = New System.Drawing.Size(167, 20) + Me.txtManu.TabIndex = 10 + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(13, 179) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(34, 13) + Me.Label6.TabIndex = 18 + Me.Label6.Text = "Price:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(13, 152) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(26, 13) + Me.Label5.TabIndex = 16 + Me.Label5.Text = "Qty." + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(12, 101) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(43, 13) + Me.Label4.TabIndex = 14 + Me.Label4.Text = "Length:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(12, 74) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(42, 13) + Me.Label3.TabIndex = 13 + Me.Label3.Text = "Gauge:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 48) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(38, 13) + Me.Label2.TabIndex = 11 + Me.Label2.Text = "Name:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 19) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(73, 13) + Me.Label1.TabIndex = 9 + Me.Label1.Text = "Manufacturer:" + ' + 'List_SG_GaugeTableAdapter + ' + Me.List_SG_GaugeTableAdapter.ClearBeforeFill = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'txtDRAM + ' + Me.txtDRAM.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtDRAM.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtDRAM.Location = New System.Drawing.Point(105, 124) + Me.txtDRAM.Name = "txtDRAM" + Me.txtDRAM.Size = New System.Drawing.Size(167, 20) + Me.txtDRAM.TabIndex = 23 + ' + 'Label7 + ' + Me.Label7.AutoSize = True + Me.Label7.Location = New System.Drawing.Point(13, 124) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(42, 13) + Me.Label7.TabIndex = 24 + Me.Label7.Text = "DRAM:" + ' + 'frmEditHulls + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(288, 250) + Me.Controls.Add(Me.txtDRAM) + Me.Controls.Add(Me.Label7) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.cmbGauge) + Me.Controls.Add(Me.nudQty) + Me.Controls.Add(Me.txtPrice) + Me.Controls.Add(Me.txtLen) + Me.Controls.Add(Me.txtName) + Me.Controls.Add(Me.txtManu) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmEditHulls" + Me.Text = "Edit Shotshell Hulls" + CType(Me.ListSGGaugeBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.nudQty, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents cmbGauge As System.Windows.Forms.ComboBox - Friend WithEvents nudQty As System.Windows.Forms.NumericUpDown - Friend WithEvents txtPrice As System.Windows.Forms.TextBox - Friend WithEvents txtLen As System.Windows.Forms.TextBox - Friend WithEvents txtName As System.Windows.Forms.TextBox - Friend WithEvents txtManu As System.Windows.Forms.TextBox - Friend WithEvents Label6 As System.Windows.Forms.Label - Friend WithEvents Label5 As System.Windows.Forms.Label - Friend WithEvents Label4 As System.Windows.Forms.Label - Friend WithEvents Label3 As System.Windows.Forms.Label - Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents Label1 As System.Windows.Forms.Label - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents ListSGGaugeBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_SG_GaugeTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_GaugeTableAdapter - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider - Friend WithEvents txtDRAM As System.Windows.Forms.TextBox - Friend WithEvents Label7 As System.Windows.Forms.Label -End Class + End Sub + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents cmbGauge As System.Windows.Forms.ComboBox + Friend WithEvents nudQty As System.Windows.Forms.NumericUpDown + Friend WithEvents txtPrice As System.Windows.Forms.TextBox + Friend WithEvents txtLen As System.Windows.Forms.TextBox + Friend WithEvents txtName As System.Windows.Forms.TextBox + Friend WithEvents txtManu As System.Windows.Forms.TextBox + Friend WithEvents Label6 As System.Windows.Forms.Label + Friend WithEvents Label5 As System.Windows.Forms.Label + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents ListSGGaugeBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_SG_GaugeTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_GaugeTableAdapter + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + Friend WithEvents txtDRAM As System.Windows.Forms.TextBox + Friend WithEvents Label7 As System.Windows.Forms.Label + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Editing/frmEditHulls.vb b/BSMyLoadersLog/Editing/frmEditHulls.vb index 5e4c876..b299919 100644 --- a/BSMyLoadersLog/Editing/frmEditHulls.vb +++ b/BSMyLoadersLog/Editing/frmEditHulls.vb @@ -1,99 +1,165 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc +'Imports System.Data.Odbc +'Imports BSMyLoadersLog.LoadersClass +Imports BSMyLoadersLog.Viewing +Imports BurnSoft.Applications.MLL.AutoFill Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory +Imports BurnSoft.Applications.MLL.Types -Public Class frmEditHulls - Public SID As Integer - Public FromView As Boolean - Sub AutoLoad() - Try - Dim ObjAF As New AutoFillCollections.ShotGun - txtManu.AutoCompleteCustomSource = ObjAF.List_SG_Case_Manufacturer - txtName.AutoCompleteCustomSource = ObjAF.List_SG_Case_Name - txtLen.AutoCompleteCustomSource = ObjAF.List_SG_Case_Length - txtPrice.AutoCompleteCustomSource = ObjAF.List_SG_Case_Price - txtDRAM.AutoCompleteCustomSource = ObjAF.List_SG_Case_DRAM - Catch ex As Exception - Call LogError(Me.Name, "utoLoad", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub Loaddata() - Try - Me.List_SG_GaugeTableAdapter.Fill(Me.MLLDataSet.List_SG_Gauge) - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim SQL As String = "SELECT * from List_SG_Case where ID=" & SID - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - Dim TimesUsed As Long = 0 - Dim iQty As Integer = 0 - Dim eppo As Double = 0 - Dim dPrice As Double = 0 - While RS.Read - If Not IsDBNull(RS("GID")) Then - cmbGauge.SelectedValue = RS("GID") +Namespace Editing + ' TODO: #20 clean up code + ''' + ''' Class frmEditHulls. + ''' Implements the + ''' + ''' + Public Class FrmEditHulls + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' The hull identifier + ''' + Public HullId As Integer + ''' + ''' From view + ''' + Public FromView As Boolean + Sub AutoLoad() + Try + 'Dim ObjAF As New AutoFillCollections.ShotGun + 'txtManu.AutoCompleteCustomSource = ObjAF.List_SG_Case_Manufacturer + 'txtName.AutoCompleteCustomSource = ObjAF.List_SG_Case_Name + 'txtLen.AutoCompleteCustomSource = ObjAF.List_SG_Case_Length + 'txtPrice.AutoCompleteCustomSource = ObjAF.List_SG_Case_Price + 'txtDRAM.AutoCompleteCustomSource = ObjAF.List_SG_Case_DRAM + txtManu.AutoCompleteCustomSource = GeneralShotgun.CaseManufacturer(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtName.AutoCompleteCustomSource = GeneralShotgun.CaseName(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtLen.AutoCompleteCustomSource = GeneralShotgun.Length(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtPrice.AutoCompleteCustomSource = GeneralShotgun.Price(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + txtDRAM.AutoCompleteCustomSource = GeneralShotgun.Dram(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "AutoLoad", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Loaddatas this instance. + ''' + Sub Loaddata() + Try + List_SG_GaugeTableAdapter.Fill(MLLDataSet.List_SG_Gauge) + Dim lst As List(Of ShotgunHullData) = ShotgunHullInventory.GetDetails(DatabasePath, HullId, _errOut) + If _errOut.Length > 0 Then Throw new Exception(_errOut) + For Each o As ShotgunHullData In lst + cmbGauge.SelectedValue = o.GunId cmbGauge.Update() - End If - If Not IsDBNull(RS("Manufacturer")) Then txtManu.Text = GeneralHelpers.UnFluffContent(RS("Manufacturer")) - If Not IsDBNull(RS("Name")) Then txtName.Text = GeneralHelpers.UnFluffContent(RS("Name")) - If Not IsDBNull(RS("Length")) Then txtLen.Text = GeneralHelpers.UnFluffContent(RS("Length")) - If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") - If Not IsDBNull(RS("Qty")) Then iQty = RS("Qty") - If Not IsDBNull(RS("epps")) Then eppo = RS("epps") - If Not IsDBNull(RS("DRAM")) Then txtDRAM.Text = GeneralHelpers.UnFluffContent(RS("DRAM")) - dPrice = eppo * iQty - nudQty.Value = iQty - Dim ObjIM As New InventoryMath - txtPrice.Text = ObjIM.ConvertToDollars(dPrice) - End While - RS.Close() - RS = Nothing - CMD = Nothing - Call Obj.CloseDB() - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub SaveData() - Try - Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) - Dim strName As String = GeneralHelpers.FluffContent(txtName.Text) - Dim strlen As String = GeneralHelpers.FluffContent(txtLen.Text) - Dim intQty As Integer = nudQty.Value - Dim dbPrice As Double = GeneralHelpers.FluffContent(txtPrice.Text, 0) - Dim sDRAM As String = GeneralHelpers.FluffContent(txtDRAM.Text) - Dim LngGAID As Long = cmbGauge.SelectedValue - Dim sGauge As String = cmbGauge.Text - If Not GeneralHelpers.IsRequired(strManu, "Manufacturer", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strName, "Name", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strlen, "Length", Me.Text) Then Exit Sub - Dim EstCostPerItem As Double = 0 - If dbPrice <> 0 And intQty > 0 Then - EstCostPerItem = (dbPrice / intQty) - End If - Dim Obj As New BSDatabase - Dim SQL As String = "UPDATE List_SG_Case set Manufacturer='" & strManu & "',Name='" & strName & "'" & _ - ",Length='" & strlen & "',Gauge='" & sGauge & "', epps=" & EstCostPerItem & ", " & _ - "Qty=" & intQty & ",Price=" & dbPrice & ",GID=" & LngGAID & _ - ", DRAM='" & sDRAM & "' where id=" & SID - Obj.ConnExec(SQL) - If FromView Then Call frmView_List_ShellHulls.LoadData() - Me.Close() - Catch ex As Exception - Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmEditHulls_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call AutoLoad() - Call Loaddata() - End Sub + txtManu.Text = GeneralHelpers.UnFluffContent(o.Manufacturer) + txtName.Text = GeneralHelpers.UnFluffContent(o.Name) + txtLen.Text = GeneralHelpers.UnFluffContent(o.Length) + txtDRAM.Text = GeneralHelpers.UnFluffContent(o.DRAM) + nudQty.Value = o.Qty + txtPrice.Text = Converters.ConvertToDollars(o.Qty * o.EstimatedPricePerItem) + Next + 'Dim Obj As New BSDatabase + 'Call Obj.ConnectDB() + 'Dim SQL As String = "SELECT * from List_SG_Case where ID=" & HullId + 'Dim CMD As New OdbcCommand(SQL, Obj.Conn) + 'Dim RS As OdbcDataReader + 'RS = CMD.ExecuteReader + 'Dim TimesUsed As Long = 0 + 'Dim iQty As Integer = 0 + 'Dim eppo As Double = 0 + 'Dim dPrice As Double = 0 + 'While RS.Read + ' If Not IsDBNull(RS("GID")) Then + ' cmbGauge.SelectedValue = RS("GID") + ' cmbGauge.Update() + ' End If + ' If Not IsDBNull(RS("Manufacturer")) Then txtManu.Text = GeneralHelpers.UnFluffContent(RS("Manufacturer")) + ' If Not IsDBNull(RS("Name")) Then txtName.Text = GeneralHelpers.UnFluffContent(RS("Name")) + ' If Not IsDBNull(RS("Length")) Then txtLen.Text = GeneralHelpers.UnFluffContent(RS("Length")) + ' If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") + ' If Not IsDBNull(RS("Qty")) Then iQty = RS("Qty") + ' If Not IsDBNull(RS("epps")) Then eppo = RS("epps") + ' If Not IsDBNull(RS("DRAM")) Then txtDRAM.Text = GeneralHelpers.UnFluffContent(RS("DRAM")) + ' dPrice = eppo * iQty + ' nudQty.Value = iQty + ' Dim ObjIM As New InventoryMath + ' txtPrice.Text = Converters.ConvertToDollars(dPrice) + 'End While + 'RS.Close() + 'RS = Nothing + 'CMD = Nothing + 'Call Obj.CloseDB() + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Saves the data. + ''' + Sub SaveData() + Try + Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) + Dim strName As String = GeneralHelpers.FluffContent(txtName.Text) + Dim strlen As String = GeneralHelpers.FluffContent(txtLen.Text) + Dim intQty As Integer = nudQty.Value + Dim dbPrice As Double = GeneralHelpers.FluffContent(txtPrice.Text, 0) + Dim sDram As String = GeneralHelpers.FluffContent(txtDRAM.Text) + 'Dim LngGAID As Long = cmbGauge.SelectedValue + Dim sGauge As String = cmbGauge.Text + If Not GeneralHelpers.IsRequired(strManu, "Manufacturer", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(strName, "Name", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(strlen, "Length", Text) Then Exit Sub + If Not ShotgunHullInventory.Add(DatabasePath, HullId, strManu, strName, + sGauge, strlen, intQty, dbPrice, sDram, _errOut) then Throw new Exception(_errOut) - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub - - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click - Call SaveData() - End Sub -End Class \ No newline at end of file + 'Dim EstCostPerItem As Double = 0 + 'If dbPrice <> 0 And intQty > 0 Then + ' EstCostPerItem = (dbPrice / intQty) + 'End If + 'Dim Obj As New BSDatabase + 'Dim SQL As String = "UPDATE List_SG_Case set Manufacturer='" & strManu & "',Name='" & strName & "'" & _ + ' ",Length='" & strlen & "',Gauge='" & sGauge & "', epps=" & EstCostPerItem & ", " & _ + ' "Qty=" & intQty & ",Price=" & dbPrice & ",GID=" & LngGAID & _ + ' ", DRAM='" & sDRAM & "' where id=" & HullId + 'Obj.ConnExec(SQL) + If FromView Then Call FrmViewListShellHulls.LoadData() + Close() + Catch ex As Exception + Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmEditHulls control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmEditHulls_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call AutoLoad() + Call Loaddata() + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnAdd control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click + Call SaveData() + End Sub + End Class +End Namespace \ No newline at end of file diff --git a/BSMyLoadersLog/Editing/frmEditPowder.vb b/BSMyLoadersLog/Editing/frmEditPowder.vb index 1ff4b41..b46cbc8 100644 --- a/BSMyLoadersLog/Editing/frmEditPowder.vb +++ b/BSMyLoadersLog/Editing/frmEditPowder.vb @@ -1,6 +1,7 @@ Imports BSMyLoadersLog.LoadersClass Imports System.Data.Odbc Imports BSMyLoadersLog.Viewing +Imports BurnSoft.Applications.MLL.Global Imports BurnSoft.Applications.MLL.Helpers Public Class frmEditPowder @@ -25,11 +26,11 @@ Public Class frmEditPowder If Not IsDBNull(RS("weightgn")) Then iQty = RS("weightgn") If Not IsDBNull(RS("eppp")) Then eppo = RS("eppp") 'If Not IsDBNull(RS("weightlbs")) Then txtwei.Text = RS("weightlbs") - txtwei.Text = Math.Round(iQty / WeightGrains1Lbs, 3) + txtwei.Text = Math.Round(iQty / WeightValues.WEIGHT_GRAINS_1LBS, 3) dPrice = eppo * iQty txtGrains.Text = iQty Dim ObjIM As New InventoryMath - txtPrice.Text = ObjIM.ConvertToDollars(dPrice) + txtPrice.Text = Converters.ConvertToDollars(dPrice) End While RS.Close() RS = Nothing @@ -59,7 +60,7 @@ Public Class frmEditPowder "weightlbs=" & strWei & ",weightgn=" & dbWeiGrn & "," & _ "Price=" & dbPrice & ",Notes='" & strNotes & "',eppp=" & EstCostPerItem & " where ID=" & PID Obj.ConnExec(SQL) - If FromView Then Call frmView_List_Powder.LoadData() + If FromView Then Call FrmViewListPowder.LoadData() Me.Close() Catch ex As Exception Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) diff --git a/BSMyLoadersLog/Editing/frmEditPrimer.Designer.vb b/BSMyLoadersLog/Editing/frmEditPrimer.Designer.vb index aaab62c..b635f3e 100644 --- a/BSMyLoadersLog/Editing/frmEditPrimer.Designer.vb +++ b/BSMyLoadersLog/Editing/frmEditPrimer.Designer.vb @@ -1,239 +1,241 @@ - _ -Partial Class frmEditPrimer - Inherits System.Windows.Forms.Form +Namespace Editing + _ + Partial Class FrmEditPrimer + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmEditPrimer)) - Me.btnCancel = New System.Windows.Forms.Button - Me.btnUpdate = New System.Windows.Forms.Button - Me.txtPrice = New System.Windows.Forms.TextBox - Me.nudQty = New System.Windows.Forms.NumericUpDown - Me.cmbPriType = New System.Windows.Forms.ComboBox - Me.GeneralPrimerTypeBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.GeneralPrimerBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.txtName = New System.Windows.Forms.TextBox - Me.txtManu = New System.Windows.Forms.TextBox - Me.Label5 = New System.Windows.Forms.Label - Me.Label4 = New System.Windows.Forms.Label - Me.Label3 = New System.Windows.Forms.Label - Me.Label2 = New System.Windows.Forms.Label - Me.Label1 = New System.Windows.Forms.Label - Me.General_PrimerTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.General_PrimerTableAdapter - Me.General_Primer_TypeTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.General_Primer_TypeTableAdapter - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - CType(Me.nudQty, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.GeneralPrimerTypeBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.GeneralPrimerBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(157, 153) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 19 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'btnUpdate - ' - Me.btnUpdate.Location = New System.Drawing.Point(39, 153) - Me.btnUpdate.Name = "btnUpdate" - Me.btnUpdate.Size = New System.Drawing.Size(75, 23) - Me.btnUpdate.TabIndex = 18 - Me.btnUpdate.Text = "Update" - Me.btnUpdate.UseVisualStyleBackColor = True - ' - 'txtPrice - ' - Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPrice.Location = New System.Drawing.Point(92, 112) - Me.txtPrice.Name = "txtPrice" - Me.txtPrice.Size = New System.Drawing.Size(166, 20) - Me.txtPrice.TabIndex = 17 - ' - 'nudQty - ' - Me.nudQty.Location = New System.Drawing.Point(92, 86) - Me.nudQty.Maximum = New Decimal(New Integer() {10000000, 0, 0, 0}) - Me.nudQty.Name = "nudQty" - Me.nudQty.Size = New System.Drawing.Size(166, 20) - Me.nudQty.TabIndex = 15 - ' - 'cmbPriType - ' - Me.cmbPriType.DataSource = Me.GeneralPrimerTypeBindingSource - Me.cmbPriType.DisplayMember = "Name" - Me.cmbPriType.FormattingEnabled = True - Me.cmbPriType.Location = New System.Drawing.Point(92, 59) - Me.cmbPriType.Name = "cmbPriType" - Me.cmbPriType.Size = New System.Drawing.Size(166, 21) - Me.cmbPriType.TabIndex = 14 - Me.cmbPriType.ValueMember = "ID" - ' - 'GeneralPrimerTypeBindingSource - ' - Me.GeneralPrimerTypeBindingSource.DataMember = "General_Primer_Type" - Me.GeneralPrimerTypeBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'GeneralPrimerBindingSource - ' - Me.GeneralPrimerBindingSource.DataMember = "General_Primer" - Me.GeneralPrimerBindingSource.DataSource = Me.MLLDataSet - ' - 'txtName - ' - Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtName.Location = New System.Drawing.Point(92, 32) - Me.txtName.Name = "txtName" - Me.txtName.Size = New System.Drawing.Size(166, 20) - Me.txtName.TabIndex = 11 - ' - 'txtManu - ' - Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtManu.Location = New System.Drawing.Point(92, 6) - Me.txtManu.Name = "txtManu" - Me.txtManu.Size = New System.Drawing.Size(166, 20) - Me.txtManu.TabIndex = 9 - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(12, 115) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(34, 13) - Me.Label5.TabIndex = 16 - Me.Label5.Text = "Price:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(12, 88) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(26, 13) - Me.Label4.TabIndex = 13 - Me.Label4.Text = "Qty:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(12, 62) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(66, 13) - Me.Label3.TabIndex = 12 - Me.Label3.Text = "Primer Type:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(12, 35) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(38, 13) - Me.Label2.TabIndex = 10 - Me.Label2.Text = "Name:" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(12, 9) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(73, 13) - Me.Label1.TabIndex = 8 - Me.Label1.Text = "Manufacturer:" - ' - 'General_PrimerTableAdapter - ' - Me.General_PrimerTableAdapter.ClearBeforeFill = True - ' - 'General_Primer_TypeTableAdapter - ' - Me.General_Primer_TypeTableAdapter.ClearBeforeFill = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmEditPrimer - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(273, 189) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnUpdate) - Me.Controls.Add(Me.txtPrice) - Me.Controls.Add(Me.nudQty) - Me.Controls.Add(Me.cmbPriType) - Me.Controls.Add(Me.txtName) - Me.Controls.Add(Me.txtManu) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.HelpProvider1.SetHelpKeyword(Me, "Edit Primer from View") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Edit Primer from View") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmEditPrimer" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Edit Primer Details" - CType(Me.nudQty, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.GeneralPrimerTypeBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.GeneralPrimerBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmEditPrimer)) + Me.btnCancel = New System.Windows.Forms.Button + Me.btnUpdate = New System.Windows.Forms.Button + Me.txtPrice = New System.Windows.Forms.TextBox + Me.nudQty = New System.Windows.Forms.NumericUpDown + Me.cmbPriType = New System.Windows.Forms.ComboBox + Me.GeneralPrimerTypeBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.GeneralPrimerBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.txtName = New System.Windows.Forms.TextBox + Me.txtManu = New System.Windows.Forms.TextBox + Me.Label5 = New System.Windows.Forms.Label + Me.Label4 = New System.Windows.Forms.Label + Me.Label3 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label1 = New System.Windows.Forms.Label + Me.General_PrimerTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.General_PrimerTableAdapter + Me.General_Primer_TypeTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.General_Primer_TypeTableAdapter + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + CType(Me.nudQty, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.GeneralPrimerTypeBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.GeneralPrimerBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(157, 153) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 19 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'btnUpdate + ' + Me.btnUpdate.Location = New System.Drawing.Point(39, 153) + Me.btnUpdate.Name = "btnUpdate" + Me.btnUpdate.Size = New System.Drawing.Size(75, 23) + Me.btnUpdate.TabIndex = 18 + Me.btnUpdate.Text = "Update" + Me.btnUpdate.UseVisualStyleBackColor = True + ' + 'txtPrice + ' + Me.txtPrice.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtPrice.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtPrice.Location = New System.Drawing.Point(92, 112) + Me.txtPrice.Name = "txtPrice" + Me.txtPrice.Size = New System.Drawing.Size(166, 20) + Me.txtPrice.TabIndex = 17 + ' + 'nudQty + ' + Me.nudQty.Location = New System.Drawing.Point(92, 86) + Me.nudQty.Maximum = New Decimal(New Integer() {10000000, 0, 0, 0}) + Me.nudQty.Name = "nudQty" + Me.nudQty.Size = New System.Drawing.Size(166, 20) + Me.nudQty.TabIndex = 15 + ' + 'cmbPriType + ' + Me.cmbPriType.DataSource = Me.GeneralPrimerTypeBindingSource + Me.cmbPriType.DisplayMember = "Name" + Me.cmbPriType.FormattingEnabled = True + Me.cmbPriType.Location = New System.Drawing.Point(92, 59) + Me.cmbPriType.Name = "cmbPriType" + Me.cmbPriType.Size = New System.Drawing.Size(166, 21) + Me.cmbPriType.TabIndex = 14 + Me.cmbPriType.ValueMember = "ID" + ' + 'GeneralPrimerTypeBindingSource + ' + Me.GeneralPrimerTypeBindingSource.DataMember = "General_Primer_Type" + Me.GeneralPrimerTypeBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'GeneralPrimerBindingSource + ' + Me.GeneralPrimerBindingSource.DataMember = "General_Primer" + Me.GeneralPrimerBindingSource.DataSource = Me.MLLDataSet + ' + 'txtName + ' + Me.txtName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtName.Location = New System.Drawing.Point(92, 32) + Me.txtName.Name = "txtName" + Me.txtName.Size = New System.Drawing.Size(166, 20) + Me.txtName.TabIndex = 11 + ' + 'txtManu + ' + Me.txtManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.txtManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource + Me.txtManu.Location = New System.Drawing.Point(92, 6) + Me.txtManu.Name = "txtManu" + Me.txtManu.Size = New System.Drawing.Size(166, 20) + Me.txtManu.TabIndex = 9 + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(12, 115) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(34, 13) + Me.Label5.TabIndex = 16 + Me.Label5.Text = "Price:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(12, 88) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(26, 13) + Me.Label4.TabIndex = 13 + Me.Label4.Text = "Qty:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(12, 62) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(66, 13) + Me.Label3.TabIndex = 12 + Me.Label3.Text = "Primer Type:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 35) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(38, 13) + Me.Label2.TabIndex = 10 + Me.Label2.Text = "Name:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 9) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(73, 13) + Me.Label1.TabIndex = 8 + Me.Label1.Text = "Manufacturer:" + ' + 'General_PrimerTableAdapter + ' + Me.General_PrimerTableAdapter.ClearBeforeFill = True + ' + 'General_Primer_TypeTableAdapter + ' + Me.General_Primer_TypeTableAdapter.ClearBeforeFill = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmEditPrimer + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(273, 189) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnUpdate) + Me.Controls.Add(Me.txtPrice) + Me.Controls.Add(Me.nudQty) + Me.Controls.Add(Me.cmbPriType) + Me.Controls.Add(Me.txtName) + Me.Controls.Add(Me.txtManu) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.HelpProvider1.SetHelpKeyword(Me, "Edit Primer from View") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Edit Primer from View") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmEditPrimer" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Edit Primer Details" + CType(Me.nudQty, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.GeneralPrimerTypeBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.GeneralPrimerBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents btnUpdate As System.Windows.Forms.Button - Friend WithEvents txtPrice As System.Windows.Forms.TextBox - Friend WithEvents nudQty As System.Windows.Forms.NumericUpDown - Friend WithEvents cmbPriType As System.Windows.Forms.ComboBox - Friend WithEvents txtName As System.Windows.Forms.TextBox - Friend WithEvents txtManu As System.Windows.Forms.TextBox - Friend WithEvents Label5 As System.Windows.Forms.Label - Friend WithEvents Label4 As System.Windows.Forms.Label - Friend WithEvents Label3 As System.Windows.Forms.Label - Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents Label1 As System.Windows.Forms.Label - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents GeneralPrimerBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents General_PrimerTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.General_PrimerTableAdapter - Friend WithEvents GeneralPrimerTypeBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents General_Primer_TypeTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.General_Primer_TypeTableAdapter - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider -End Class + End Sub + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents btnUpdate As System.Windows.Forms.Button + Friend WithEvents txtPrice As System.Windows.Forms.TextBox + Friend WithEvents nudQty As System.Windows.Forms.NumericUpDown + Friend WithEvents cmbPriType As System.Windows.Forms.ComboBox + Friend WithEvents txtName As System.Windows.Forms.TextBox + Friend WithEvents txtManu As System.Windows.Forms.TextBox + Friend WithEvents Label5 As System.Windows.Forms.Label + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents GeneralPrimerBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents General_PrimerTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.General_PrimerTableAdapter + Friend WithEvents GeneralPrimerTypeBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents General_Primer_TypeTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.General_Primer_TypeTableAdapter + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Editing/frmEditPrimer.vb b/BSMyLoadersLog/Editing/frmEditPrimer.vb index 5f033cd..c486c2a 100644 --- a/BSMyLoadersLog/Editing/frmEditPrimer.vb +++ b/BSMyLoadersLog/Editing/frmEditPrimer.vb @@ -1,80 +1,128 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc +'Imports System.Data.Odbc +'Imports BSMyLoadersLog.LoadersClass Imports BSMyLoadersLog.Viewing Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory +Imports BurnSoft.Applications.MLL.Types -Public Class frmEditPrimer - Public PID As Long - Sub LoadData() - Try - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim SQL As String = "SELECT * from General_Primer where ID=" & PID - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - Dim iQty As Integer = 0 - Dim eppo As Double = 0 - Dim dPrice As Double = 0 - While RS.Read - If Not IsDBNull(RS("Manufacturer")) Then txtManu.Text = GeneralHelpers.UnFluffContent(RS("Manufacturer")) - If Not IsDBNull(RS("Name")) Then txtName.Text = GeneralHelpers.UnFluffContent(RS("Name")) - If Not IsDBNull(RS("Primer_Type")) Then - cmbPriType.SelectedValue = RS("Primer_Type") +Namespace Editing + ''' + ''' Class FrmEditPrimer. + ''' Implements the + ''' + ''' + Public Class FrmEditPrimer + ' TODO: #20 clean up code + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' The primer identifier + ''' + Public PrimerId As Long + ''' + ''' Loads the data. + ''' + Sub LoadData() + Try + Dim lst As List(Of PrimerListings) = PrimerInventory.GetDetails(DatabasePath, PrimerId, _errOut) + If _errOut.Length > 0 then Throw New Exception(_errOut) + For Each o As PrimerListings In lst + nudQty.Value = o.Qty + txtManu.Text = o.Manufacturer + txtName.Text = o.Name + cmbPriType.SelectedValue = o.PrimerType cmbPriType.Update() - End If - If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") - If Not IsDBNull(RS("Qty")) Then iQty = RS("Qty") - If Not IsDBNull(RS("eppp")) Then eppo = RS("eppp") - dPrice = eppo * iQty - nudQty.Value = iQty - Dim ObjIM As New InventoryMath - txtPrice.Text = ObjIM.ConvertToDollars(dPrice) - End While - RS.Close() - RS = Nothing - CMD = Nothing - Obj.CloseDB() - Catch ex As Exception - Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub SaveData() - Try - Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) - Dim strName As String = GeneralHelpers.FluffContent(txtName.Text) - Dim intPriType As Integer = cmbPriType.SelectedValue - Dim intQty As Integer = nudQty.Value - Dim dbPrice As Double = GeneralHelpers.FluffContent(txtPrice.Text, 0) + txtPrice.Text = Converters.ConvertToDollars(o.Qty * o.PricePerPrimer) + Next + 'Dim Obj As New BSDatabase + 'Call Obj.ConnectDB() + 'Dim SQL As String = "SELECT * from General_Primer where ID=" & PrimerId + 'Dim CMD As New OdbcCommand(SQL, Obj.Conn) + 'Dim RS As OdbcDataReader + 'RS = CMD.ExecuteReader + 'Dim iQty As Integer = 0 + 'Dim eppo As Double = 0 + 'Dim newPrice As Double = 0 + 'While RS.Read + ' If Not IsDBNull(RS("Manufacturer")) Then txtManu.Text = GeneralHelpers.UnFluffContent(RS("Manufacturer")) + ' If Not IsDBNull(RS("Name")) Then txtName.Text = GeneralHelpers.UnFluffContent(RS("Name")) + ' If Not IsDBNull(RS("Primer_Type")) Then + ' cmbPriType.SelectedValue = RS("Primer_Type") + ' cmbPriType.Update() + ' End If + ' If Not IsDBNull(RS("Price")) Then newPrice = RS("Price") + ' If Not IsDBNull(RS("Qty")) Then iQty = RS("Qty") + ' If Not IsDBNull(RS("eppp")) Then eppo = RS("eppp") + ' newPrice = eppo * iQty + ' nudQty.Value = iQty + ' Dim ObjIM As New InventoryMath + ' txtPrice.Text = Converters.ConvertToDollars(newPrice) + 'End While + 'RS.Close() + 'RS = Nothing + 'CMD = Nothing + 'Obj.CloseDB() + Catch ex As Exception + Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Saves the data. + ''' + Sub SaveData() + Try + Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) + Dim strName As String = GeneralHelpers.FluffContent(txtName.Text) + Dim intPriType As Integer = cmbPriType.SelectedValue + Dim intQty As Integer = nudQty.Value + Dim dbPrice As Double = GeneralHelpers.FluffContent(txtPrice.Text, 0) - If Not GeneralHelpers.IsRequired(strManu, "Manufacturer", Me.Text) Then Exit Sub - If Not GeneralHelpers.IsRequired(strName, "Name", Me.Text) Then Exit Sub - Dim EstCostPerItem As Double = 0 - If dbPrice <> 0 And intQty > 0 Then - EstCostPerItem = (dbPrice / intQty) - End If - Dim Obj As New BSDatabase - Dim SQL As String = "UPDATE General_Primer set Manufacturer='" & strManu & "',Name='" & strName & "'" & _ - ", Primer_Type=" & intPriType & ",Qty=" & intQty & ",Price=" & dbPrice & _ - ",eppp=" & EstCostPerItem & " where ID=" & PID - Obj.ConnExec(SQL) - Me.Close() - Catch ex As Exception - Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmEditPrimer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Me.General_Primer_TypeTableAdapter.Fill(Me.MLLDataSet.General_Primer_Type) - Me.General_PrimerTableAdapter.Fill(Me.MLLDataSet.General_Primer) - Call LoadData() - End Sub - - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub - - Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click - Call SaveData() - Call frmView_List_Primer.LoadData() - End Sub -End Class \ No newline at end of file + If Not GeneralHelpers.IsRequired(strManu, "Manufacturer", Text) Then Exit Sub + If Not GeneralHelpers.IsRequired(strName, "Name", Text) Then Exit Sub + If Not PrimerInventory.Update(DatabasePath, PrimerId, strManu, strName, intPriType, + dbPrice, intQty, _errOut) then Throw new Exception(_errOut) + 'Dim EstCostPerItem As Double = 0 + 'If dbPrice <> 0 And intQty > 0 Then + ' EstCostPerItem = (dbPrice / intQty) + 'End If + 'Dim Obj As New BSDatabase + 'Dim SQL As String = "UPDATE General_Primer set Manufacturer='" & strManu & "',Name='" & strName & "'" & _ + ' ", Primer_Type=" & intPriType & ",Qty=" & intQty & ",Price=" & dbPrice & _ + ' ",eppp=" & EstCostPerItem & " where ID=" & PrimerId + 'Obj.ConnExec(SQL) + 'Close() + Catch ex As Exception + Call LogError(Name, "SaveData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmEditPrimer control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmEditPrimer_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + General_Primer_TypeTableAdapter.Fill(MLLDataSet.General_Primer_Type) + General_PrimerTableAdapter.Fill(MLLDataSet.General_Primer) + Call LoadData() + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnUpdate control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdate.Click + Call SaveData() + Call FrmViewListPrimer.LoadData() + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Editing/frmEditShells.vb b/BSMyLoadersLog/Editing/frmEditShells.vb index c28003c..408c707 100644 --- a/BSMyLoadersLog/Editing/frmEditShells.vb +++ b/BSMyLoadersLog/Editing/frmEditShells.vb @@ -40,7 +40,7 @@ Public Class frmEditShells dPrice = eppo * iQty nudQty.Value = iQty Dim ObjIM As New InventoryMath - txtPrice.Text = ObjIM.ConvertToDollars(dPrice) + txtPrice.Text = Converters.ConvertToDollars(dPrice) End While RS.Close() RS = Nothing diff --git a/BSMyLoadersLog/Editing/frmEditShot.vb b/BSMyLoadersLog/Editing/frmEditShot.vb index a4047d5..d11953b 100644 --- a/BSMyLoadersLog/Editing/frmEditShot.vb +++ b/BSMyLoadersLog/Editing/frmEditShot.vb @@ -1,6 +1,8 @@ Imports BSMyLoadersLog.LoadersClass Imports System.Data.Odbc +Imports BurnSoft.Applications.MLL.Global Imports BurnSoft.Applications.MLL.Helpers +Imports BSMyLoadersLog.Viewing Public Class frmEditShot Public BID As Long @@ -39,8 +41,8 @@ Public Class frmEditShot Dim Cost As Double = GeneralHelpers.FluffContent(txtPrice.Text, 0.0) Dim SQL As String = "" Dim Obj As New BSDatabase - Dim ounces As Double = WeightOz1Lbs * CDbl(Weight) - Dim grams As Double = ounces * WeightGramsOz + Dim ounces As Double = WeightValues.WEIGHT_OZ_1LBS * CDbl(Weight) + Dim grams As Double = ounces * WeightValues.WEIGHT_GRAMS_OZ Dim epps As Double = 0 If Cost > 0 Then epps = Cost / grams @@ -64,7 +66,7 @@ Public Class frmEditShot End Sub Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click Call SaveData() - If FromView Then Call frmView_List_Shot.LoadData() + If FromView Then Call FrmViewListShot.LoadData() Me.Close() End Sub End Class \ No newline at end of file diff --git a/BSMyLoadersLog/Editing/frmEditSlug.vb b/BSMyLoadersLog/Editing/frmEditSlug.vb index a86e428..648246f 100644 --- a/BSMyLoadersLog/Editing/frmEditSlug.vb +++ b/BSMyLoadersLog/Editing/frmEditSlug.vb @@ -1,6 +1,7 @@ Imports BSMyLoadersLog.LoadersClass Imports System.Data.Odbc Imports BurnSoft.Applications.MLL.Helpers +Imports BSMyLoadersLog.Viewing Public Class frmEditSlug Public FromView As Boolean @@ -54,7 +55,7 @@ Public Class frmEditSlug ",weight='" & Weight & "',epps=" & epps & ",Price=" & _ Cost & " where ID=" & SID Obj.ConnExec(SQL) - If FromView Then Call frmView_List_Slug.LoadData() + If FromView Then Call FrmViewListSlug.LoadData() Me.Close() Catch ex As Exception Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) diff --git a/BSMyLoadersLog/Editing/frmEditWADS.vb b/BSMyLoadersLog/Editing/frmEditWADS.vb index 083e10d..ff86ba0 100644 --- a/BSMyLoadersLog/Editing/frmEditWADS.vb +++ b/BSMyLoadersLog/Editing/frmEditWADS.vb @@ -1,12 +1,13 @@ Imports BSMyLoadersLog.LoadersClass Imports System.Data.Odbc Imports BurnSoft.Applications.MLL.Helpers +Imports BSMyLoadersLog.Viewing Public Class frmEditWADS ''' ''' The error out ''' - Dim errOut as String + Dim errOut As String Public SID As Integer Public FromView As Boolean Sub Loaddata() @@ -24,7 +25,7 @@ Public Class frmEditWADS Dim GID As Integer While RS.Read If Not IsDBNull(RS("Manufacturer")) Then txtManu.Text = GeneralHelpers.UnFluffContent(RS("Manufacturer")) - If Not IsDBNull(RS("WAD")) Then txtWAD.Text =GeneralHelpers.UnFluffContent(RS("WAD")) + If Not IsDBNull(RS("WAD")) Then txtWAD.Text = GeneralHelpers.UnFluffContent(RS("WAD")) If Not IsDBNull(RS("Price")) Then dPrice = RS("Price") If Not IsDBNull(RS("Qty")) Then iQty = RS("Qty") If Not IsDBNull(RS("eppw")) Then eppo = RS("eppw") @@ -34,7 +35,7 @@ Public Class frmEditWADS dPrice = eppo * iQty nudQty.Value = iQty Dim ObjIM As New InventoryMath - txtPrice.Text = ObjIM.ConvertToDollars(dPrice) + txtPrice.Text = Converters.ConvertToDollars(dPrice) End While RS.Close() RS = Nothing @@ -49,9 +50,9 @@ Public Class frmEditWADS Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) Dim strName As String = GeneralHelpers.FluffContent(txtWAD.Text) Dim intQty As Integer = nudQty.Value - Dim dbPrice As Double = GeneralHelpers.FluffContent(cdbl(txtPrice.Text), 0) + Dim dbPrice As Double = GeneralHelpers.FluffContent(CDbl(txtPrice.Text), 0) Dim sLoad As String = GeneralHelpers.FluffContent(txtLoad.Text, "0") - Dim dLoad As Double = Converters.ConvertOZToDouble(sLoad, errOut) + Dim dLoad As Double = Converters.ConvertOzToDouble(sLoad, errOut) Dim GName As String = cmdGauge.Text Dim GID As Integer = cmdGauge.SelectedValue @@ -67,7 +68,7 @@ Public Class frmEditWADS ",gauge='" & GName & "',GID=" & GID & ",load_t='" & sLoad & _ "',load_d=" & dLoad & " where id=" & SID Obj.ConnExec(SQL) - If FromView Then Call frmView_List_WADS.LoadData() + If FromView Then Call FrmViewListWads.LoadData() Me.Close() Catch ex As Exception Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) diff --git a/BSMyLoadersLog/frmLoadMakeReady_Details.Designer.vb b/BSMyLoadersLog/FrmLoadMakeReadyDetails.Designer.vb similarity index 96% rename from BSMyLoadersLog/frmLoadMakeReady_Details.Designer.vb rename to BSMyLoadersLog/FrmLoadMakeReadyDetails.Designer.vb index 0217103..fb376f2 100644 --- a/BSMyLoadersLog/frmLoadMakeReady_Details.Designer.vb +++ b/BSMyLoadersLog/FrmLoadMakeReadyDetails.Designer.vb @@ -1,226 +1,226 @@ - _ -Partial Class frmLoadMakeReady_Details - Inherits System.Windows.Forms.Form - - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub - - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer - - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmLoadMakeReady_Details)) - 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.txtManu = New System.Windows.Forms.TextBox - Me.txtName = New System.Windows.Forms.TextBox - Me.txtCal = New System.Windows.Forms.TextBox - Me.txtGrains = New System.Windows.Forms.TextBox - Me.txtJacket = New System.Windows.Forms.TextBox - Me.lblInv = New System.Windows.Forms.Label - Me.btnMake = New System.Windows.Forms.Button - Me.Cancel = New System.Windows.Forms.Button - Me.nudQty = New System.Windows.Forms.NumericUpDown - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - CType(Me.nudQty, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(3, 9) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(73, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Manufacturer:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(3, 36) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(38, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Name:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(3, 62) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(42, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Caliber:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(3, 88) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(40, 13) - Me.Label4.TabIndex = 3 - Me.Label4.Text = "Grains:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(3, 114) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(42, 13) - Me.Label5.TabIndex = 4 - Me.Label5.Text = "Jacket:" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(3, 140) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(26, 13) - Me.Label6.TabIndex = 5 - Me.Label6.Text = "Qty:" - ' - 'txtManu - ' - Me.txtManu.Location = New System.Drawing.Point(82, 6) - Me.txtManu.Name = "txtManu" - Me.txtManu.Size = New System.Drawing.Size(180, 20) - Me.txtManu.TabIndex = 1 - ' - 'txtName - ' - Me.txtName.Location = New System.Drawing.Point(82, 33) - Me.txtName.Name = "txtName" - Me.txtName.Size = New System.Drawing.Size(180, 20) - Me.txtName.TabIndex = 2 - ' - 'txtCal - ' - Me.txtCal.Location = New System.Drawing.Point(82, 59) - Me.txtCal.Name = "txtCal" - Me.txtCal.Size = New System.Drawing.Size(180, 20) - Me.txtCal.TabIndex = 3 - ' - 'txtGrains - ' - Me.txtGrains.Location = New System.Drawing.Point(82, 85) - Me.txtGrains.Name = "txtGrains" - Me.txtGrains.Size = New System.Drawing.Size(180, 20) - Me.txtGrains.TabIndex = 4 - ' - 'txtJacket - ' - Me.txtJacket.Location = New System.Drawing.Point(82, 111) - Me.txtJacket.Name = "txtJacket" - Me.txtJacket.Size = New System.Drawing.Size(180, 20) - Me.txtJacket.TabIndex = 5 - ' - 'lblInv - ' - Me.lblInv.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblInv.Location = New System.Drawing.Point(6, 166) - Me.lblInv.Name = "lblInv" - Me.lblInv.Size = New System.Drawing.Size(256, 42) - Me.lblInv.TabIndex = 12 - ' - 'btnMake - ' - Me.btnMake.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnMake.Location = New System.Drawing.Point(24, 223) - Me.btnMake.Name = "btnMake" - Me.btnMake.Size = New System.Drawing.Size(92, 21) - Me.btnMake.TabIndex = 7 - Me.btnMake.Text = "Make" - Me.btnMake.UseVisualStyleBackColor = True - ' - 'Cancel - ' - Me.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.Cancel.Location = New System.Drawing.Point(154, 223) - Me.Cancel.Name = "Cancel" - Me.Cancel.Size = New System.Drawing.Size(92, 21) - Me.Cancel.TabIndex = 8 - Me.Cancel.Text = "Cancel" - Me.Cancel.UseVisualStyleBackColor = True - ' - 'nudQty - ' - Me.nudQty.Location = New System.Drawing.Point(82, 138) - Me.nudQty.Maximum = New Decimal(New Integer() {100000, 0, 0, 0}) - Me.nudQty.Name = "nudQty" - Me.nudQty.Size = New System.Drawing.Size(178, 20) - Me.nudQty.TabIndex = 6 - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmLoadMakeReady_Details - ' - Me.AcceptButton = Me.btnMake - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.Cancel - Me.ClientSize = New System.Drawing.Size(272, 256) - Me.Controls.Add(Me.nudQty) - Me.Controls.Add(Me.Cancel) - Me.Controls.Add(Me.btnMake) - Me.Controls.Add(Me.lblInv) - Me.Controls.Add(Me.txtJacket) - Me.Controls.Add(Me.txtGrains) - Me.Controls.Add(Me.txtCal) - Me.Controls.Add(Me.txtName) - Me.Controls.Add(Me.txtManu) - Me.Controls.Add(Me.Label6) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.HelpProvider1.SetHelpKeyword(Me, "Make Live Ammunition for this Configuration Load") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Make Live Ammunition for this Configuration Load") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmLoadMakeReady_Details" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Ammunition Ready to Use" - CType(Me.nudQty, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() - - End Sub - 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 txtManu As System.Windows.Forms.TextBox - Friend WithEvents txtName As System.Windows.Forms.TextBox - Friend WithEvents txtCal As System.Windows.Forms.TextBox - Friend WithEvents txtGrains As System.Windows.Forms.TextBox - Friend WithEvents txtJacket As System.Windows.Forms.TextBox - Friend WithEvents lblInv As System.Windows.Forms.Label - Friend WithEvents btnMake As System.Windows.Forms.Button - Friend WithEvents Cancel As System.Windows.Forms.Button - Friend WithEvents nudQty As System.Windows.Forms.NumericUpDown - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider -End Class + _ +Partial Class FrmLoadMakeReadyDetails + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmLoadMakeReadyDetails)) + 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.txtManu = New System.Windows.Forms.TextBox + Me.txtName = New System.Windows.Forms.TextBox + Me.txtCal = New System.Windows.Forms.TextBox + Me.txtGrains = New System.Windows.Forms.TextBox + Me.txtJacket = New System.Windows.Forms.TextBox + Me.lblInv = New System.Windows.Forms.Label + Me.btnMake = New System.Windows.Forms.Button + Me.Cancel = New System.Windows.Forms.Button + Me.nudQty = New System.Windows.Forms.NumericUpDown + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + CType(Me.nudQty, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(3, 9) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(73, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Manufacturer:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(3, 36) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(38, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Name:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(3, 62) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(42, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Caliber:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(3, 88) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(40, 13) + Me.Label4.TabIndex = 3 + Me.Label4.Text = "Grains:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(3, 114) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(42, 13) + Me.Label5.TabIndex = 4 + Me.Label5.Text = "Jacket:" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(3, 140) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(26, 13) + Me.Label6.TabIndex = 5 + Me.Label6.Text = "Qty:" + ' + 'txtManu + ' + Me.txtManu.Location = New System.Drawing.Point(82, 6) + Me.txtManu.Name = "txtManu" + Me.txtManu.Size = New System.Drawing.Size(180, 20) + Me.txtManu.TabIndex = 1 + ' + 'txtName + ' + Me.txtName.Location = New System.Drawing.Point(82, 33) + Me.txtName.Name = "txtName" + Me.txtName.Size = New System.Drawing.Size(180, 20) + Me.txtName.TabIndex = 2 + ' + 'txtCal + ' + Me.txtCal.Location = New System.Drawing.Point(82, 59) + Me.txtCal.Name = "txtCal" + Me.txtCal.Size = New System.Drawing.Size(180, 20) + Me.txtCal.TabIndex = 3 + ' + 'txtGrains + ' + Me.txtGrains.Location = New System.Drawing.Point(82, 85) + Me.txtGrains.Name = "txtGrains" + Me.txtGrains.Size = New System.Drawing.Size(180, 20) + Me.txtGrains.TabIndex = 4 + ' + 'txtJacket + ' + Me.txtJacket.Location = New System.Drawing.Point(82, 111) + Me.txtJacket.Name = "txtJacket" + Me.txtJacket.Size = New System.Drawing.Size(180, 20) + Me.txtJacket.TabIndex = 5 + ' + 'lblInv + ' + Me.lblInv.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblInv.Location = New System.Drawing.Point(6, 166) + Me.lblInv.Name = "lblInv" + Me.lblInv.Size = New System.Drawing.Size(256, 42) + Me.lblInv.TabIndex = 12 + ' + 'btnMake + ' + Me.btnMake.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnMake.Location = New System.Drawing.Point(24, 223) + Me.btnMake.Name = "btnMake" + Me.btnMake.Size = New System.Drawing.Size(92, 21) + Me.btnMake.TabIndex = 7 + Me.btnMake.Text = "Make" + Me.btnMake.UseVisualStyleBackColor = True + ' + 'Cancel + ' + Me.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.Cancel.Location = New System.Drawing.Point(154, 223) + Me.Cancel.Name = "Cancel" + Me.Cancel.Size = New System.Drawing.Size(92, 21) + Me.Cancel.TabIndex = 8 + Me.Cancel.Text = "Cancel" + Me.Cancel.UseVisualStyleBackColor = True + ' + 'nudQty + ' + Me.nudQty.Location = New System.Drawing.Point(82, 138) + Me.nudQty.Maximum = New Decimal(New Integer() {100000, 0, 0, 0}) + Me.nudQty.Name = "nudQty" + Me.nudQty.Size = New System.Drawing.Size(178, 20) + Me.nudQty.TabIndex = 6 + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmLoadMakeReady_Details + ' + Me.AcceptButton = Me.btnMake + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.Cancel + Me.ClientSize = New System.Drawing.Size(272, 256) + Me.Controls.Add(Me.nudQty) + Me.Controls.Add(Me.Cancel) + Me.Controls.Add(Me.btnMake) + Me.Controls.Add(Me.lblInv) + Me.Controls.Add(Me.txtJacket) + Me.Controls.Add(Me.txtGrains) + Me.Controls.Add(Me.txtCal) + Me.Controls.Add(Me.txtName) + Me.Controls.Add(Me.txtManu) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.HelpProvider1.SetHelpKeyword(Me, "Make Live Ammunition for this Configuration Load") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Make Live Ammunition for this Configuration Load") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "FrmLoadMakeReadyDetails" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Ammunition Ready to Use" + CType(Me.nudQty, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + 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 txtManu As System.Windows.Forms.TextBox + Friend WithEvents txtName As System.Windows.Forms.TextBox + Friend WithEvents txtCal As System.Windows.Forms.TextBox + Friend WithEvents txtGrains As System.Windows.Forms.TextBox + Friend WithEvents txtJacket As System.Windows.Forms.TextBox + Friend WithEvents lblInv As System.Windows.Forms.Label + Friend WithEvents btnMake As System.Windows.Forms.Button + Friend WithEvents Cancel As System.Windows.Forms.Button + Friend WithEvents nudQty As System.Windows.Forms.NumericUpDown + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider +End Class diff --git a/BSMyLoadersLog/frmLoadMakeReady_Details.resx b/BSMyLoadersLog/FrmLoadMakeReadyDetails.resx similarity index 98% rename from BSMyLoadersLog/frmLoadMakeReady_Details.resx rename to BSMyLoadersLog/FrmLoadMakeReadyDetails.resx index 894ed88..04b8854 100644 --- a/BSMyLoadersLog/frmLoadMakeReady_Details.resx +++ b/BSMyLoadersLog/FrmLoadMakeReadyDetails.resx @@ -1,143 +1,143 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - - - AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAQAMAAAAAAAAAAAAAAAAAAAAA - AAAAAABsdHYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsdHYAAAAAAACirrEAGSpl - v9gAWX8mcpA2OjsAAAAAAAA2OjtlmKoAZYwmjLIAGSqirrEAAAAAAABsdHYAGSYzsr8AP1kAZowAAAAA - AAAAAAAAAAAZf5kZZnIAf6UADBlsdHYAAAAAAABsdHYAM0yZ//8AM0wAf7IAAAAISAgISAgAAABmsswz - mZkAZpkAM0xsdHYAAAAAAABsdHYAM0yZ//8AM0wApdgAAAAAgAAAgAAAAABmsswzmZkAcqUATGZsdHYA - AAAAAABsdHYAM0yZ//8AM0wAsuUAAAAAgAAAgAAAAABmsswzmZkAf7IATGZsdHYAAAAAAABsdHYAM0yZ - //8IKAwISAgAQAAAgAAAgAAISAgISAgISAgIbogATGZsdHYAAAAAAABsdHYAM0yy//8ERAgAgAAAgAAA - gAAAgAAAgAAAgAAAgAAIbogATGZsdHYAAAAAAABsdHYAM0zl//8MLAwISAgISAgAgAAAgAAISAgISAgI - SAgIbogATGZsdHYAAAAAAACirrEAJjMAf7IAP2oMjLIICAgAgAAAgAAICAgAcpgAWYwAcp0MMz+irrEA - AAAAAAAAAAAAAABMzOUAZpkATGYICAgAgAAAgAAICAgATGZMzOUAZpkAAAAAAAAAAAAAAAAAAAAAAAA/ - jL8AP4wAGUwICAgISAgISAgICAgAGT8/jL8AP5gAAAAAAAAAAAAAAAAAAAA2Ojtlf7IZTLIADCairrEA - AAAAAACirrEADDNlf78ZTJg2OjsAAAAAAAAAAAAAAABsdHYMJj8/crIAAAAAAAAAAAAAAAAAAAAAAAAz - ZqUZM0xsdHYAAAAAAAAAAAAAAACirrEADAx/jIw2OjsAAAAAAAAAAAAAAAA2Ojt/jIwADAyirrEAAAAA - AAAAAAAAAAAAAAA2OjsAAACirrEAAAAAAAAAAAAAAACirrEAAAA2OjsAAAAAAAAAAACBgQAAgYEAAIGB - AACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAwAMAAMADAADBgwAAw8MAAMPDAADjxwAA - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + + AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAQAMAAAAAAAAAAAAAAAAAAAAA + AAAAAABsdHYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsdHYAAAAAAACirrEAGSpl + v9gAWX8mcpA2OjsAAAAAAAA2OjtlmKoAZYwmjLIAGSqirrEAAAAAAABsdHYAGSYzsr8AP1kAZowAAAAA + AAAAAAAAAAAZf5kZZnIAf6UADBlsdHYAAAAAAABsdHYAM0yZ//8AM0wAf7IAAAAISAgISAgAAABmsswz + mZkAZpkAM0xsdHYAAAAAAABsdHYAM0yZ//8AM0wApdgAAAAAgAAAgAAAAABmsswzmZkAcqUATGZsdHYA + AAAAAABsdHYAM0yZ//8AM0wAsuUAAAAAgAAAgAAAAABmsswzmZkAf7IATGZsdHYAAAAAAABsdHYAM0yZ + //8IKAwISAgAQAAAgAAAgAAISAgISAgISAgIbogATGZsdHYAAAAAAABsdHYAM0yy//8ERAgAgAAAgAAA + gAAAgAAAgAAAgAAAgAAIbogATGZsdHYAAAAAAABsdHYAM0zl//8MLAwISAgISAgAgAAAgAAISAgISAgI + SAgIbogATGZsdHYAAAAAAACirrEAJjMAf7IAP2oMjLIICAgAgAAAgAAICAgAcpgAWYwAcp0MMz+irrEA + AAAAAAAAAAAAAABMzOUAZpkATGYICAgAgAAAgAAICAgATGZMzOUAZpkAAAAAAAAAAAAAAAAAAAAAAAA/ + jL8AP4wAGUwICAgISAgISAgICAgAGT8/jL8AP5gAAAAAAAAAAAAAAAAAAAA2Ojtlf7IZTLIADCairrEA + AAAAAACirrEADDNlf78ZTJg2OjsAAAAAAAAAAAAAAABsdHYMJj8/crIAAAAAAAAAAAAAAAAAAAAAAAAz + ZqUZM0xsdHYAAAAAAAAAAAAAAACirrEADAx/jIw2OjsAAAAAAAAAAAAAAAA2Ojt/jIwADAyirrEAAAAA + AAAAAAAAAAAAAAA2OjsAAACirrEAAAAAAAAAAAAAAACirrEAAAA2OjsAAAAAAAAAAACBgQAAgYEAAIGB + AACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAwAMAAMADAADBgwAAw8MAAMPDAADjxwAA + + \ No newline at end of file diff --git a/BSMyLoadersLog/FrmLoadMakeReadyDetails.vb b/BSMyLoadersLog/FrmLoadMakeReadyDetails.vb new file mode 100644 index 0000000..63935a8 --- /dev/null +++ b/BSMyLoadersLog/FrmLoadMakeReadyDetails.vb @@ -0,0 +1,504 @@ +'Imports BSMyLoadersLog.LoadersClass +'Imports System.Data.Odbc +'Imports BurnSoft.Applications.MGC +Imports BurnSoft.Applications.MLL.ConfigSheets +Imports BurnSoft.Applications.MLL.Global +Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory +Imports BurnSoft.Applications.MLL.LoadersLog +Imports BurnSoft.Applications.MLL.Types + +''' +''' Class frmLoadMakeReady_Details. +''' Implements the +''' +''' +Public Class FrmLoadMakeReadyDetails +#Region "Variables" + ''' + ''' The error out + ''' + Dim _errOut As string + ''' + ''' The configuration name + ''' + Public ConfigName As String + ''' + ''' The configuration identifier + ''' + Public ConfigId As Long + '''' + '''' The is personal + '''' + 'Dim IsPersonal As Boolean + ''' + ''' The is shot gun' + ''' + Dim _isShotGun As Boolean + ''' + ''' The cost bullet + ''' + Dim _bulletPrice As Double + ''' + ''' The cost primer + ''' + Dim _primerPrice As Double + ''' + ''' The cost case + ''' + Dim _casePrice As Double + ''' + ''' The cost powder + ''' + Dim _powderPrice As Double + ''' + ''' The cost shot + ''' + Dim _shotPrice As Double + ''' + ''' The cost slug + ''' + Dim _slugPrice As Double + ''' + ''' The mid powder + ''' + Dim _powderMidRangeLoad As Double + ''' + ''' The l makeable rounds + ''' + Dim _roundsAbleToMake As Long + ''' + ''' The instock bullet + ''' + Dim _bulletQty As Long + ''' + ''' The instock primer + ''' + Dim _primerQty As Long + ''' + ''' The instock case + ''' + Dim _caseQty As Long + ''' + ''' The instock powder + ''' + Dim _powderQty As Double + + ''' + ''' The instock shot oz + ''' + Dim _shotOzQty As Double + ''' + ''' The shot prefload + ''' + Dim _shotPrefferedLoad As Double + ''' + ''' The instock slug + ''' + Dim _slugQty As Double + ''' + ''' The preffered powder identifier + ''' + Dim _prefferedPowderId As Long + + ''' + ''' The instock wad + ''' + Dim _wadQty As Double + ''' + ''' The shot details gr + ''' + Dim _shotDetailsInGrains As Double + ''' + ''' The cost wad + ''' + Dim _wadPrice As Double + ''' + ''' The FPS mid + ''' + Dim _midRangeFps As Double + ''' + ''' The is slug + ''' + Dim _isSlug As Boolean + ''' + ''' The bid + ''' + Dim _bulletId As Long + ''' + ''' The prid + ''' + Dim _primerId As Long + ''' + ''' The cid + ''' + Dim _caseId As Long + ''' + ''' The Shot/SlugID + ''' + Dim _shotSlugId As Long + ''' + ''' The Hull ID + ''' + Dim _hullId As Long + ''' + ''' The WAD ID + ''' + Dim _wadId As Long + ''' + ''' The cost to make rounds + ''' + Dim _costToMakeRounds As Double + + ''' + ''' The instock shot + ''' + Public Property ShotQty as Double + + ''' + ''' The wad maxload + ''' + Public Property WadMaxLoad as Double +#End Region +#Region "General Subs and Functions" + ''' + ''' Loads the costs. + ''' + Sub LoadCosts() + Dim lnmr As Long + 'Dim dPowPerB As Double + If Not _isShotGun Then + _costToMakeRounds = Converters.CostOfRoundsOfAmmoMetalic(_primerPrice, _casePrice, _bulletPrice, _powderPrice, + _powderMidRangeLoad) + lnmr = GeneralCalculations.CalculateMetallicRoundsToMake(_bulletQty, _caseQty, _primerQty, + _powderQty, _powderMidRangeLoad, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + 'lnmr = _bulletQty + 'If lnmr < _caseQty Then + ' lnmr = _bulletQty + 'ElseIf lnmr > _caseQty Then + ' lnmr = _caseQty + 'End If + 'dPowPerB = (_powderQty / _powderMidRangeLoad) + 'If lnmr > _primerQty Then lnmr = _primerQty + 'If lnmr > dPowPerB Then lnmr = CLng(dPowPerB) + Else + If Not _isSlug Then + _bulletPrice = _shotPrice * (_shotPrefferedLoad * WeightValues.WEIGHT_GRAMS_OZ) ' * _shotPrice + Else + _bulletPrice = _slugPrice + End If + _costToMakeRounds = Converters.CostOfRoundsOfAmmoShotGun(_primerPrice, _casePrice, _bulletPrice, + _powderPrice, _powderMidRangeLoad, _wadPrice) + + If _isSlug Then + lnmr = GeneralCalculations.CalculateShotgunSlugRoundsToMake(_slugQty, _caseQty, _wadQty, + _powderQty, _powderMidRangeLoad, + _primerQty, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + 'lnmr = _slugQty + 'If lnmr < _caseQty Then + ' lnmr = _slugQty + 'ElseIf lnmr > _caseQty Then + ' lnmr = _caseQty + 'End If + 'If lnmr > _wadQty Then lnmr = _wadQty + 'dPowPerB = (_powderQty / _powderMidRangeLoad) + 'If lnmr > _primerQty Then lnmr = _primerQty + 'If lnmr > dPowPerB Then lnmr = CLng(dPowPerB) + Else + lnmr = GeneralCalculations.CalculateShotgunRoundsToMake(_shotOzQty, _shotPrefferedLoad, _caseQty, _wadQty, + _powderQty, _powderMidRangeLoad, + _primerQty, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + 'Dim countMakeAble As Double = _shotOzQty / _shotPrefferedLoad + 'lnmr = countMakeAble + 'If lnmr < _caseQty Then + ' lnmr = countMakeAble + 'ElseIf lnmr > _caseQty Then + ' lnmr = _caseQty + 'End If + 'If lnmr > _wadQty Then lnmr = _wadQty + 'dPowPerB = (_powderQty / _powderMidRangeLoad) + 'If lnmr > _primerQty Then lnmr = _primerQty + 'If lnmr > dPowPerB Then lnmr = CLng(dPowPerB) + End If + End If + _roundsAbleToMake = lnmr + End Sub + ''' + ''' Loads the data. + ''' + Sub LoadData() + Try + _isShotGun = False + 'IsPersonal = False + 'Dim Obj As New InventoryMath + 'Call Obj.LoadConfig(ConfigID, IsPersonal, IsShotGun, "") + Dim lst as List(Of ConfigNameList) = ConfigListDataName.GetDetails(DatabasePath, ConfigId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As ConfigNameList In lst + 'IsPersonal = o.IsPersonal + _isShotGun = o.IsShotGun + Next + If Not _isShotGun Then + _prefferedPowderId = ConfigListDataPowder.GetDefaultPowderId(DatabasePath, ConfigId, _powderMidRangeLoad, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + _powderPrice = PowderInventory.GetPricePerPowder(DatabasePath, _prefferedPowderId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + _powderQty = PowderInventory.GetQtyPerPowder(DatabasePath, _prefferedPowderId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Call LoadConfig_RiflePistol() + Else + _prefferedPowderId = ConfigListDataPowderShotGun.GetDefaultPowderId(DatabasePath, + CInt(ConfigId), _powderMidRangeLoad, + _midRangeFps, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + _powderPrice = PowderInventory.GetPricePerPowder(DatabasePath, _prefferedPowderId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + _powderQty = PowderInventory.GetQtyPerPowder(DatabasePath, _prefferedPowderId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + LoadConfig_ShotGun() + End If + Call LoadCosts() + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Loads the configuration rifle pistol. + ''' + Private Sub LoadConfig_RiflePistol() + Try + Dim lst as List(Of ConfigListDataMetalicData) = ConfigListDataMetalic.GetDetails(DatabasePath, ConfigId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + if lst.Count > 0 Then + For Each o As ConfigListDataMetalicData In lst + txtManu.Text = OwnerLoadName + txtName.Text = ConfigName + txtCal.Text = CaliberInventory.GetName(DatabasePath, o.CaliberId, _errOut) + _bulletId = o.BulletId + _primerId = o.PrimerId + _caseId = o.CaseId + Next + Dim bulletList as List(Of BulletListings) = BulletsInventory.GetDetails(DatabasePath, _bulletId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As BulletListings In bulletList + txtJacket.Text = o.Name + txtGrains.Text = o.Weight + _bulletQty = o.Qty + _bulletPrice = o.EsitmatedPricePerBullet + Next + Dim primerList As List(Of PrimerListings) = PrimerInventory.GetDetails(DatabasePath, _primerId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As PrimerListings In primerList + _primerPrice = o.PricePerPrimer + _primerQty = o.Qty + Next + Dim caseList As List(Of CaseListings) = CaseInventory.GetDetails(DatabasePath, _caseId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As CaseListings In caseList + _casePrice = o.EstimatedPricePerCase + _caseQty = o.Qty + Next + End If + + Catch ex As Exception + Call LogError(Name, "LoadConfig_RiflePistol", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Loads the configuration shot gun. + ''' + Private Sub LoadConfig_ShotGun() + Try + 'Dim ObjIM As New InventoryMath + + 'Dim ShotDetails_Manu As String = "" + 'Dim ShotDetails_Name As String = "" + 'Dim ShotDetails_QTY As Double = 0 + 'Dim ShotDetails_EPPS As Double = 0 + 'Dim ShotDetails_ShotMat As String = "" + 'Dim ShotDetails_ShotNo As String = "" + 'Dim ShotDetails_SlugWeight As String = "" + + Dim lst As List(Of ConfigListDataShotgunData) = ConfigListDataShotgun.GetDetails(DatabasePath, ConfigId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As ConfigListDataShotgunData In lst + 'txtCal.Text = CaliberInventory.GetName(DatabasePath, o.AmmoTypeId, _errOut) + txtCal.Text = CaliberInventory.GetName(DatabasePath, o.CaliberId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + _shotSlugId = o.ShotChargeLoad + _primerId = o.PrimerId + _hullId = o.CaseId + _wadId = o.Wad + txtManu.Text = OwnerLoadName + txtName.Text = ConfigName + txtGrains.Text = $"{o.ShotWeightText} oz. shot" + _shotPrefferedLoad = o.ShotWeight + Next + + 'Call ObjIM.LoadSG_ShotType_Details(_shotSlugId, ShotDetails_Manu, ShotDetails_Name, IsSlug, _ + ' ShotDetails_ShotMat, ShotDetails_ShotNo, + ' ShotDetails_SlugWeight, "", ShotDetails_QTY, ShotDetails_EPPS, _ + ' 0, _shotOzQty, _shotDetailsInGrains) + Dim shotList As List(Of ShotgunShotTypeData) = ShotgunShotTypeInventory.GetDetails(DatabasePath, _shotSlugId, + errOut := _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As ShotgunShotTypeData In shotList + 'ShotDetails_Manu = o.Manufacturer + 'ShotDetails_Name = o.Name + _isSlug = o.IsSlug + 'ShotDetails_ShotMat = o.MaterialUsed + 'ShotDetails_ShotNo = o.ShotNumber + 'ShotDetails_SlugWeight = O.Weight + 'ShotDetails_QTY = O.Qty + 'ShotDetails_EPPS = O.EstimatedPricePerItem + _shotOzQty = o.Ounces + _shotDetailsInGrains = o.Grams + txtJacket.Text = $"{ o.ShotNumber} Shot" + If Not _isSlug Then + _shotPrice = O.EstimatedPricePerItem + ShotQty = o.Grams + Else + _slugPrice = O.EstimatedPricePerItem + _slugQty = O.Qty + End If + Next + 'txtJacket.Text = $"{ShotDetails_ShotNo} Shot" + 'If Not IsSlug Then + ' _shotPrice = ShotDetails_EPPS + ' _shotQty = _shotDetailsInGrains + 'Else + ' _slugPrice = ShotDetails_EPPS + ' _slugQty = ShotDetails_QTY + 'End If + + 'Call ObjIM.LoadWADInfo(_wadId, "", "", "", _wadMaxLoad, + ' _wadQty, _wadPrice) + Dim wadList as List(Of WadData) = WadInventory.GetDetails(DatabasePath, _wadId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As WadData In wadList + WadMaxLoad = o.LoadInOz + _wadQty = o.Qty + _wadPrice = o.Price + Next + + Dim primerList As List(Of PrimerListings) = PrimerInventory.GetDetails(DatabasePath, _primerId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As PrimerListings In primerList + _primerPrice = o.PricePerPrimer + _primerQty = o.Qty + Next + + 'Call ObjIM.LoadHullInfo(_hullId, "", "", "", _caseQty, _casePrice) + Dim hullList As List(Of ShotgunHullData) = ShotgunHullInventory.GetDetails(DatabasePath, _hullId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As ShotgunHullData In hullList + _caseQty = o.Qty + _casePrice = O.Price + Next + + Catch ex As Exception + Call LogError(Name, "LoadConfig_RiflePistol", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Saves the audit. + ''' + ''' The qty. + Sub SaveAudit(ByVal qty As Long) + Try + If Not LoadersLogAmmunitionAudit.Add(DatabasePath, ConfigId, Now, qty, + Converters.ConvertToDollars(qty * _costToMakeRounds), + Converters.ConvertToDollars(_costToMakeRounds), + _errOut) Then Throw New Exception(_errOut) + ' TODO: #25 Add The generic log generator here or in the function above. + Catch ex As Exception + Call LogError(Name, "SaveAudit", Err.Number, ex.Message.ToString) + End Try + End Sub +#End Region +#Region "Form Subs" + ''' + ''' Handles the Load event of the frmLoadMakeReady_Details control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmLoadMakeReady_Details_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call LoadData() + lblInv.Text = $"NOTE: Inventory states that you have enough to make {_roundsAbleToMake} rounds." + nudQty.Maximum = _roundsAbleToMake + End Sub + ''' + ''' Handles the Click event of the Cancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub Cancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Cancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the btnMake control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub btnMake_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnMake.Click + Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) + Dim strName As String = GeneralHelpers.FluffContent(txtName.Text) + Dim strCaliber As String = GeneralHelpers.FluffContent(txtCal.Text) + Dim strGrains As String = GeneralHelpers.FluffContent(txtGrains.Text) + Dim strJacket As String = GeneralHelpers.FluffContent(txtJacket.Text) + 'Dim dcal As Double = ConvToNum(strGrains) + 'Converters + 'Dim dcal As Double = Converters.ConvToNum(strGrains, _errOut) + 'If _errOut.Length > 0 Then Throw New Exception(_errOut) + Dim iQty As Long = nudQty.Value + Dim cQty As Long = 0 + 'Dim ObjIM As New InventoryMath + 'Dim Obj As New BSDatabase + 'Dim SQL As String = "" + Dim ammoId As Long = 0 + + If LoadersLogAmmunition.IsAlreadyListed(DatabasePath, strManu, strName, strCaliber, + strGrains, strJacket, _errOut, cQty, ammoId) Then + If Not LoadersLogAmmunition.UpdateQty(DatabasePath, ammoId, (cQty + iQty), + _errOut) then throw New Exception(_errOut) + Else + if not LoadersLogAmmunition.Add(DatabasePath, strManu, strName, strCaliber, + strGrains, strJacket, iQty, _midRangeFps, + _errOut) then Throw new Exception(_errOut) + End If + + 'If ObjIM.IsAlreadyListed(strManu, strName, strCaliber, strGrains, strJacket, cQty, MID) Then + ' SQL = "UPDATE Loaders_Log_Ammunition set Qty='" & (cQty + iQty) & "' where id=" & MID + ' Obj.ConnExec(SQL) + 'Else + ' SQL = "INSERT INTO Loaders_Log_Ammunition(Manufacturer,Name,Cal,Grain,Jacket,Qty,dcal,Vel) VALUES('" & _ + ' strManu & "','" & strName & "','" & strCaliber & "','" & strGrains & "','" & _ + ' strJacket & "'," & iQty & "," & dcal & "," & _midRangeFps & ")" + ' Obj.ConnExec(SQL) + 'End If + If Not _isShotGun Then + 'Call ObjIM.ARUNSG_UpdateInventoryQty(iQty, _bulletQty, _bulletId, _primerQty, _primerId, _caseQty, _CaseId, _ + ' _powderQty, PrefferedPowderID, _powderMidRangeLoad) + If Not InventoryUpdate.MetallicUpdate(DatabasePath, iQty, _bulletQty, _bulletId, + _primerQty, _primerId, _caseQty, + _caseId, _powderQty,_prefferedPowderId, + _powderMidRangeLoad, _errOut) Then Throw New Exception(_errOut) + Else + 'Call ObjIM.ARUSG_UpdateInventoryQty(iQty, _slugQty, _shotSlugId, _primerQty, _primerId, _caseQty, _hullId, _ + ' _powderQty, PrefferedPowderID, _powderMidRangeLoad, _wadQty, _wadId, IsSlug, _shotOzQty, _shotDetailsInGrains, _shotPrefferedLoad) + If not InventoryUpdate.ShotgunUpdate(DatabasePath, iQty, _shotSlugId, _slugQty, + _isSlug, _shotOzQty,_shotDetailsInGrains, + _shotPrefferedLoad, _wadQty, _wadId, + _primerQty, _primerId, _caseQty, _caseId, + _powderQty, _prefferedPowderId, + _midRangeFps, _errOut) Then Throw new Exception(_errOut) + End If + Call SaveAudit(iQty) + Close() + End Sub +#End Region +End Class \ No newline at end of file diff --git a/BSMyLoadersLog/GlobalVars.vb b/BSMyLoadersLog/GlobalVars.vb index 677f6d5..9c0fa7b 100644 --- a/BSMyLoadersLog/GlobalVars.vb +++ b/BSMyLoadersLog/GlobalVars.vb @@ -59,11 +59,11 @@ Module GlobalVars ''' ''' The loadertype shotgun ''' - Public LoadertypeShotgun As Boolean + Public LoaderTypeShotGun As Boolean ''' - ''' The loadertype nonshotgun + ''' The loader type metallic reloading ''' - Public LoadertypeNonshotgun As Boolean + Public LoaderTypeMetalic As Boolean ''' ''' The defaultlist ''' @@ -108,66 +108,66 @@ Module GlobalVars ''' The application path data ''' Public ApplicationPathData As String - ''' - ''' Help File path - ''' - Public Const MyHelpFile = GeneralSettings.MY_HELP_FILE - ''' - ''' Hotfixe file path - ''' - Public Const MyHotfixFile = GeneralSettings.MY_HOTFIX_FILE - ''' - ''' Backup application - ''' - Public Const MyBackup = GeneralSettings.MY_BACKUP - ''' - ''' Restore application - ''' - Public Const MyRestore = GeneralSettings.MY_RESTORE - ''' - ''' Wiki Link - ''' - Public Const MenuWiki = GeneralSettings.MENU_WIKI - ''' - ''' Shop Menu, might not be used anymore - ''' - Public Const MenuShop = GeneralSettings.MENU_SHOP - ''' - ''' Bug Report link - ''' - Public Const MenuBug = GeneralSettings.MENU_BUG - ''' - ''' Support Link - ''' - Public Const MenuSupport = GeneralSettings.MENU_SUPPORT - ''' - ''' Search Site, might not be used anymore - ''' - Public Const MenuSitesearch = GeneralSettings.MENU_SITESEARCH - ''' - ''' Menu Links Might not Be used anymore - ''' - Public Const MenuLinks = GeneralSettings.MENU_LINKS - ''' - ''' Weight Grains 1 lbs - ''' - Public Const WeightGrains1Lbs = WeightValues.WEIGHT_GRAINS_1LBS - ''' - ''' Weight in Grains 1 gm - ''' - Public Const WeightGrains1Gm = WeightValues.WEIGHT_GRAINS_1GM - ''' - ''' Weight in Grams for 1 lbs - ''' - Public Const WeightGrams1Lbs = WeightValues.WEIGHT_GRAMS_1LBS - ''' - ''' Weight in oz for 1 lbs - ''' - Public Const WeightOz1Lbs = WeightValues.WEIGHT_OZ_1LBS - ''' - ''' Weight in Grams from Ounce - ''' - Public Const WeightGramsOz = WeightValues.WEIGHT_GRAMS_OZ + '''' + '''' Help File path + '''' + 'Public Const MyHelpFile = GeneralSettings.MY_HELP_FILE + '''' + '''' Hotfixe file path + '''' + 'Public Const MyHotfixFile = GeneralSettings.MY_HOTFIX_FILE + '''' + '''' Backup application + '''' + 'Public Const MyBackup = GeneralSettings.MY_BACKUP + '''' + '''' Restore application + '''' + 'Public Const MyRestore = GeneralSettings.MY_RESTORE + '''' + '''' Wiki Link + '''' + 'Public Const MenuWiki = GeneralSettings.MENU_WIKI + '''' + '''' Shop Menu, might not be used anymore + '''' + 'Public Const MenuShop = GeneralSettings.MENU_SHOP + '''' + '''' Bug Report link + '''' + 'Public Const MenuBug = GeneralSettings.MENU_BUG + '''' + '''' Support Link + '''' + 'Public Const MenuSupport = GeneralSettings.MENU_SUPPORT + '''' + '''' Search Site, might not be used anymore + '''' + 'Public Const MenuSitesearch = GeneralSettings.MENU_SITESEARCH + '''' + '''' Menu Links Might not Be used anymore + '''' + 'Public Const MenuLinks = GeneralSettings.MENU_LINKS + '''' + '''' Weight Grains 1 lbs + '''' + 'Public Const WeightGrains1Lbs = WeightValues.WEIGHT_GRAINS_1LBS + '''' + '''' Weight in Grains 1 gm + '''' + 'Public Const WeightGrains1Gm = WeightValues.WEIGHT_GRAINS_1GM + '''' + '''' Weight in Grams for 1 lbs + '''' + 'Public Const WeightGrams1Lbs = WeightValues.WEIGHT_GRAMS_1LBS + '''' + '''' Weight in oz for 1 lbs + '''' + 'Public Const WeightOz1Lbs = WeightValues.WEIGHT_OZ_1LBS + '''' + '''' Weight in Grams from Ounce + '''' + 'Public Const WeightGramsOz = WeightValues.WEIGHT_GRAMS_OZ ''' ''' The Database Name ''' @@ -187,6 +187,8 @@ Module GlobalVars Dim objFs As New BurnSoft.Universal.FileIO Dim sMessage As String = sForm & "." & sProcedure & "::" & iErrNo & "::" & sErrorDesc objFs.LogFile(MyLogFile, sMessage) + MDIParentMain.tsslErrorsFound.Visible = True + MDIParentMain.tsslErrorsFound.Enabled = True End Sub End Module diff --git a/BSMyLoadersLog/ImportExport/frmImportFirearms.vb b/BSMyLoadersLog/ImportExport/frmImportFirearms.vb index cec5b72..8a4208c 100644 --- a/BSMyLoadersLog/ImportExport/frmImportFirearms.vb +++ b/BSMyLoadersLog/ImportExport/frmImportFirearms.vb @@ -1,12 +1,15 @@ Imports BSMyLoadersLog.LoadersClass Imports System.Data.Odbc +Imports BurnSoft.Applications.MGC.LoadersLog Imports BurnSoft.Applications.MLL.Helpers Public Class frmImportFirearms + Dim errOut As String Dim iCount As Integer Private Sub frmImportFirearms_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim Obj As New BSMGC - iCount = Obj.CountFirearms + 'iCount = Obj.CountFirearms + iCount = FirearmHelpers.CountFirearms(errOut) If iCount = 1 Then Label1.Text = "You have " & iCount & " firearm in your collection, are you ready to import or update to the local database?" ElseIf iCount > 1 Then diff --git a/BSMyLoadersLog/LoadersClass.vb b/BSMyLoadersLog/LoadersClass.vb index a557f81..4442e94 100644 --- a/BSMyLoadersLog/LoadersClass.vb +++ b/BSMyLoadersLog/LoadersClass.vb @@ -1,13 +1,14 @@ -Imports System -Imports System.IO +'Imports System +'Imports System.IO Imports System.Xml -Imports System.Text -Imports System.Data +'Imports System.Text +'Imports System.Data Imports System.Data.Odbc -Imports System.Windows.Forms -Imports Microsoft.Win32 +'Imports System.Windows.Forms +'Imports Microsoft.Win32 Imports System.Configuration -Imports BurnSoft.Applications.MLL.Helpers +'Imports BurnSoft.Applications.MLL.Global +'Imports BurnSoft.Applications.MLL.Helpers Imports BurnSoft.Universal Namespace LoadersClass @@ -188,7 +189,11 @@ Namespace LoadersClass ' MyReg.Close() 'End Sub ' - 'Public Sub SaveSettings(ByVal NumberFormat As String, ByVal TrackHistory As Boolean, ByVal TrackHistoryDays As Integer, ByVal AutoUpdate As Boolean, ByVal UseProxy As Boolean, ByVal AlertOnBackUp As Boolean, ByVal AutoBackup As Boolean, ByVal UOIMG As Boolean, ByVal UseSHOTGUN As Boolean, ByVal UseNONSHOTGUN As Boolean, ByVal UseDEFAULTLIST As String, ByVal UseIPer As Boolean, ByVal UseViewFPS As Boolean, ByVal UseViewCUPS As Boolean) + 'Public Sub SaveSettings(ByVal NumberFormat As String, ByVal TrackHistory As Boolean, ByVal TrackHistoryDays As Integer, + ' ByVal AutoUpdate As Boolean, ByVal UseProxy As Boolean, ByVal AlertOnBackUp As Boolean, + ' ByVal AutoBackup As Boolean, ByVal UOIMG As Boolean, ByVal UseSHOTGUN As Boolean, + ' ByVal UseNONSHOTGUN As Boolean, ByVal UseDEFAULTLIST As String, ByVal UseIPer As Boolean, + ' ByVal UseViewFPS As Boolean, ByVal UseViewCUPS As Boolean) ' Dim strValue As String = DefaultRegPath & "\Settings" ' If Not RegSubKeyExists(strValue) Then Call CreateSubKey(strValue) ' Dim MyReg As RegistryKey @@ -298,28 +303,28 @@ Namespace LoadersClass "ConnExec.strSQL=" & strSQL) End Try End Sub - - Public Function GetData(ByVal SQL As String) As DataTable - Dim Table As New DataTable - Try - Table.Locale = System.Globalization.CultureInfo.InvariantCulture - Call ConnectDB() - Dim CMD As New OdbcCommand(SQL, Conn) - Dim RS As New OdbcDataAdapter - RS.SelectCommand = CMD - RS.Fill(Table) - Catch ex As Exception - 'Dim ObjFS As New BSFileSystem - 'Dim sMessage As String = "MLL.BSDatabase.GetData" & "::" & Err.Number & "::" & ex.Message.ToString() & Chr(10) & "SQL STATEMENT: " & SQL - 'ObjFS.LogFile(MyLogFile, "GetData.SQL=" & SQL) - 'ObjFS.LogFile(MyLogFile, sMessage) - Call LogError("BSDatabase", "GetData", Err.Number, - ex.Message.ToString) - Call LogError("BSDatabase", "GetData", 0, - "GetData.strSQL=" & SQL) - End Try - Return Table - End Function + ' + ' Public Function GetData(ByVal SQL As String) As DataTable + ' Dim Table As New DataTable + ' Try + ' Table.Locale = System.Globalization.CultureInfo.InvariantCulture + ' Call ConnectDB() + ' Dim CMD As New OdbcCommand(SQL, Conn) + ' Dim RS As New OdbcDataAdapter + ' RS.SelectCommand = CMD + ' RS.Fill(Table) + ' Catch ex As Exception + ' 'Dim ObjFS As New BSFileSystem + ' 'Dim sMessage As String = "MLL.BSDatabase.GetData" & "::" & Err.Number & "::" & ex.Message.ToString() & Chr(10) & "SQL STATEMENT: " & SQL + ' 'ObjFS.LogFile(MyLogFile, "GetData.SQL=" & SQL) + ' 'ObjFS.LogFile(MyLogFile, sMessage) + ' Call LogError("BSDatabase", "GetData", Err.Number, + ' ex.Message.ToString) + ' Call LogError("BSDatabase", "GetData", 0, + ' "GetData.strSQL=" & SQL) + ' End Try + ' Return Table + ' End Function End Class ' 'Public Class BSFileSystem @@ -427,369 +432,369 @@ Namespace LoadersClass ' Return sAns ' End Function 'End Class - Public Class AutoFillCollections - Public Class ShotGun - - Private Function MainCollection(ByVal strColumn As String, ByVal strTable As String) As AutoCompleteStringCollection - Dim iCol As New AutoCompleteStringCollection - Dim ArrList As New ArrayList - Dim SQL As String = "SELECT " & strColumn & " from " & strTable & " order by " & strColumn & " ASC" - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - iCol.Clear() - If RS.HasRows Then - While (RS.Read()) - If Not IsDBNull(RS(strColumn)) Then iCol.Add(RS(strColumn)) - End While - Else - iCol.Add("N/A") - End If - RS.Close() - CMD = Nothing - Call Obj.CloseDB() - Return iCol - End Function - - Private Function MainCollectionDistinct(ByVal strColumn As String, ByVal strTable As String) As AutoCompleteStringCollection - Dim iCol As New AutoCompleteStringCollection - Dim ArrList As New ArrayList - Dim SQL As String = "SELECT distinct(" & strColumn & ") as Res from " & strTable & " order by " & strColumn & " ASC" - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - iCol.Clear() - If RS.HasRows Then - While (RS.Read()) - If Not IsDBNull(RS("Res")) Then iCol.Add(RS("Res")) - End While - Else - iCol.Add("N/A") - End If - RS.Close() - CMD = Nothing - Call Obj.CloseDB() - Return iCol - End Function - - Public Function Config_Source_SG() As AutoCompleteStringCollection - Return MainCollectionDistinct("Source", "Config_List_Data_SG") - End Function - - Public Function Config_LoadInOZ_SG() As AutoCompleteStringCollection - Return MainCollectionDistinct("SW_t", "Config_List_Data_SG") - End Function - - Public Function List_SG_WAD_Manufacturer() As AutoCompleteStringCollection - Return MainCollectionDistinct("Manufacturer", "List_SG_WAD") - End Function - - Public Function List_SG_WAD_WAD() As AutoCompleteStringCollection - Return MainCollectionDistinct("WAD", "List_SG_WAD") - End Function - - Public Function List_SG_WAD_Price() As AutoCompleteStringCollection - Return MainCollectionDistinct("Price", "List_SG_WAD") - End Function - - Public Function List_SG_Bushings_Powder_Manufacturer() As AutoCompleteStringCollection - Return MainCollectionDistinct("Manufacturer", "List_SG_Bushing_Powder") - End Function - - Public Function List_SG_Bushings_Powder_Name() As AutoCompleteStringCollection - Return MainCollectionDistinct("sName", "List_SG_Bushing_Powder") - End Function - - Public Function List_SG_Bushings_Powder_sCharge() As AutoCompleteStringCollection - Return MainCollectionDistinct("sCharge", "List_SG_Bushing_Powder") - End Function - - Public Function List_SG_Bushings_Powder_Powder() As AutoCompleteStringCollection - Return MainCollectionDistinct("name", "General_Powder") - End Function - - Public Function List_SG_Bushings_Shot_Manufacturer() As AutoCompleteStringCollection - Return MainCollectionDistinct("Manufacturer", "List_SG_Bushing_Shot") - End Function - - Public Function List_SG_Bushings_Shot_Name() As AutoCompleteStringCollection - Return MainCollectionDistinct("sName", "List_SG_Bushing_Shot") - End Function - - Public Function List_SG_Bushings_Shot_sCharge() As AutoCompleteStringCollection - Return MainCollectionDistinct("sCharge", "List_SG_Bushing_Shot") - End Function - - Public Function List_SG_Log_SG_Patterns() As AutoCompleteStringCollection - Return MainCollectionDistinct("pd", "Loaders_Log_SG") - End Function - - Public Function List_SG_Log_SG_ShotWt() As AutoCompleteStringCollection - Return MainCollectionDistinct("shotwt", "Loaders_Log_SG") - End Function - - Public Function List_SG_Log_SG_ShotSize() As AutoCompleteStringCollection - Return MainCollectionDistinct("shotsize", "Loaders_Log_SG") - End Function - - Public Function List_SG_Log_SG_Case() As AutoCompleteStringCollection - Return MainCollectionDistinct("case", "Loaders_Log_SG") - End Function - - Public Function List_SG_Log_SG_PowderBushing() As AutoCompleteStringCollection - Return MainCollectionDistinct("pbm", "Loaders_Log_SG") - End Function - - Public Function List_SG_Log_SG_Wad() As AutoCompleteStringCollection - Return MainCollectionDistinct("wad", "Loaders_Log_SG") - End Function - - Public Function List_SG_Log_SG_Primer() As AutoCompleteStringCollection - Return MainCollectionDistinct("primer", "Loaders_Log_SG") - End Function - - Public Function List_SG_Case_Manufacturer() As AutoCompleteStringCollection - Return MainCollectionDistinct("Manufacturer", "List_SG_Case") - End Function - - Public Function List_SG_Case_Name() As AutoCompleteStringCollection - Return MainCollectionDistinct("Name", "List_SG_Case") - End Function - - Public Function List_SG_Case_DRAM() As AutoCompleteStringCollection - Return MainCollectionDistinct("DRAM", "List_SG_Case") - End Function - - Public Function List_SG_Case_Gauge() As AutoCompleteStringCollection - Return MainCollectionDistinct("Gauge", "List_SG_Case") - End Function - - Public Function List_SG_Case_Length() As AutoCompleteStringCollection - Return MainCollectionDistinct("Length", "List_SG_Case") - End Function - - Public Function List_SG_Case_Price() As AutoCompleteStringCollection - Return MainCollectionDistinct("Price", "List_SG_Case") - End Function - - Public Function List_SG_SHOTSLUG_Details_Manu() As AutoCompleteStringCollection - Return MainCollectionDistinct("Manufacturer", "List_SG_ShotType_Details") - End Function - - Public Function List_SG_SHOTSLUG_Details_Name() As AutoCompleteStringCollection - Return MainCollectionDistinct("Name", "List_SG_ShotType_Details") - End Function - - Public Function List_SG_SHOTSLUG_Details_mat() As AutoCompleteStringCollection - Return MainCollectionDistinct("mat", "List_SG_ShotType_Details") - End Function - - Public Function List_SG_SHOTSLUG_Details_ShotNo() As AutoCompleteStringCollection - Return MainCollectionDistinct("ShotNo", "List_SG_ShotType_Details") - End Function - - Public Function List_SG_SHOTSLUG_Details_weight() As AutoCompleteStringCollection - Return MainCollectionDistinct("weight", "List_SG_ShotType_Details") - End Function - - Public Function List_SG_SHOTSLUG_Details_CAL() As AutoCompleteStringCollection - Return MainCollectionDistinct("CAL", "List_SG_ShotType_Details") - End Function - - Public Function List_SG_SHOTSLUG_Details_Price() As AutoCompleteStringCollection - Return MainCollectionDistinct("Price", "List_SG_ShotType_Details") - End Function - End Class - Private Function MainCollection(ByVal strColumn As String, ByVal strTable As String) As AutoCompleteStringCollection - Dim iCol As New AutoCompleteStringCollection - Dim ArrList As New ArrayList - Dim SQL As String = "SELECT " & strColumn & " from " & strTable & " order by " & strColumn & " ASC" - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - iCol.Clear() - If RS.HasRows Then - While (RS.Read()) - If Not IsDBNull(RS(strColumn)) Then iCol.Add(RS(strColumn)) - End While - Else - iCol.Add("N/A") - End If - RS.Close() - CMD = Nothing - Call Obj.CloseDB() - Return iCol - End Function - Private Function MainCollectionDistinct(ByVal strColumn As String, ByVal strTable As String) As AutoCompleteStringCollection - Dim iCol As New AutoCompleteStringCollection - Dim ArrList As New ArrayList - Dim SQL As String = "SELECT distinct(" & strColumn & ") as Res from " & strTable & " order by " & strColumn & " ASC" - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - iCol.Clear() - If RS.HasRows Then - While (RS.Read()) - If Not IsDBNull(RS("Res")) Then iCol.Add(RS("Res")) - End While - Else - iCol.Add("N/A") - End If - RS.Close() - CMD = Nothing - Call Obj.CloseDB() - Return iCol - End Function - - Public Function General_Calibers() As AutoCompleteStringCollection - Return MainCollection("Cal", "General_Calibers") - End Function - - Public Function General_Primer_Type_ManuFacturers() As AutoCompleteStringCollection - Return MainCollectionDistinct("Manufacturer", "General_Primer") - End Function - - Public Function General_Primer_Type_Name() As AutoCompleteStringCollection - Return MainCollectionDistinct("Name", "General_Primer") - End Function - - Public Function General_Primer_Type_Price() As AutoCompleteStringCollection - Return MainCollectionDistinct("Price", "General_Primer") - End Function - - Public Function General_Powder_Manufacturer() As AutoCompleteStringCollection - Return MainCollectionDistinct("Manufacturer", "General_Powder") - End Function - - Public Function General_Powder_Name() As AutoCompleteStringCollection - Return MainCollectionDistinct("Name", "General_Powder") - End Function - - Public Function General_Powder_WeightInPounds() As AutoCompleteStringCollection - Return MainCollectionDistinct("weightlbs", "General_Powder") - End Function - - Public Function General_Powder_Price() As AutoCompleteStringCollection - Return MainCollectionDistinct("Price", "General_Powder") - End Function - ' - 'Public Function List_Bullets_Manufacturer() As AutoCompleteStringCollection - ' Return MainCollectionDistinct("Manufacturer", "List_Bullets") - 'End Function - ' - 'Public Function List_Bullets_Name() As AutoCompleteStringCollection - ' Return MainCollectionDistinct("Name", "List_Bullets") - 'End Function - ' - 'Public Function List_Bullets_Diameter() As AutoCompleteStringCollection - ' Return MainCollectionDistinct("Diameter", "List_Bullets") - 'End Function - ' - 'Public Function List_Bullets_Sec_Den() As AutoCompleteStringCollection - ' Return MainCollectionDistinct("Sec_Den", "List_Bullets") - 'End Function - ' - 'Public Function List_Bullets_Part_number() As AutoCompleteStringCollection - ' Return MainCollectionDistinct("Part_number", "List_Bullets") - 'End Function - ' - 'Public Function List_Bullets_Ballistic_Coefficient() As AutoCompleteStringCollection - ' Return MainCollectionDistinct("Ballistic_Coefficient", "List_Bullets") - 'End Function - ' - 'Public Function List_Bullets_Price() As AutoCompleteStringCollection - ' Return MainCollectionDistinct("Price", "List_Bullets") - 'End Function - ' - 'Public Function List_Bullets_Weight() As AutoCompleteStringCollection - ' Return MainCollectionDistinct("Weight", "List_Bullets") - 'End Function - - Public Function List_Case_Manufacturer() As AutoCompleteStringCollection - Return MainCollectionDistinct("Manufacturer", "List_Case") - End Function - - Public Function List_Case_Name() As AutoCompleteStringCollection - Return MainCollectionDistinct("Name", "List_Case") - End Function - - Public Function List_Case_Trim_to_length() As AutoCompleteStringCollection - Return MainCollectionDistinct("ttl", "List_Case") - End Function - - Public Function List_Case_Price() As AutoCompleteStringCollection - Return MainCollectionDistinct("Price", "List_Case") - End Function - - Public Function General_Equipment_Manufacturer() As AutoCompleteStringCollection - Return MainCollectionDistinct("Manufacturer", "General_Equipment") - End Function - - Public Function General_Equipment_Name() As AutoCompleteStringCollection - Return MainCollectionDistinct("Name", "General_Equipment") - End Function - - Public Function General_Equipment_Use() As AutoCompleteStringCollection - Return MainCollectionDistinct("Use", "General_Equipment") - End Function - - Public Function General_Equipment_Cost() As AutoCompleteStringCollection - Return MainCollectionDistinct("Cost", "General_Equipment") - End Function - - Public Function ConfigName() As AutoCompleteStringCollection - Return MainCollectionDistinct("ConfigName", "Config_List_Name") - End Function - - Public Function Config_Source_NSG() As AutoCompleteStringCollection - Return MainCollectionDistinct("Source", "Config_List_Data_NSG") - End Function - - Public Function Loaders_Log_NSG_GroupSize() As AutoCompleteStringCollection - Return MainCollectionDistinct("gs", "Loaders_Log_NSG") - End Function - - Public Function Loaders_Log_NSG_Powder() As AutoCompleteStringCollection - Return MainCollectionDistinct("pwm", "Loaders_Log_NSG") - End Function - - Public Function Loaders_Log_NSG_Bullet() As AutoCompleteStringCollection - Return MainCollectionDistinct("bullet", "Loaders_Log_NSG") - End Function - - Public Function Loaders_Log_NSG_primer() As AutoCompleteStringCollection - Return MainCollectionDistinct("primer", "Loaders_Log_NSG") - End Function - - Public Function Loaders_Log_NSG_case() As AutoCompleteStringCollection - Return MainCollectionDistinct("case", "Loaders_Log_NSG") - End Function - - Public Function Loaders_Log_NSG_conditions() As AutoCompleteStringCollection - Return MainCollectionDistinct("conditions", "Loaders_Log_NSG") - End Function - - Public Function Loaders_Log_NSG_tl() As AutoCompleteStringCollection - Return MainCollectionDistinct("tl", "Loaders_Log_NSG") - End Function - - Public Function Loaders_Log_NSG_notes() As AutoCompleteStringCollection - Return MainCollectionDistinct("notes", "Loaders_Log_NSG") - End Function - - Public Function Loaders_Log_NSG_ConfigName() As AutoCompleteStringCollection - Return MainCollectionDistinct("ConfigName", "Loaders_Log_NSG") - End Function + 'Public Class AutoFillCollections + ' Public Class ShotGun + ' + ' Private Function MainCollection(ByVal strColumn As String, ByVal strTable As String) As AutoCompleteStringCollection + ' Dim iCol As New AutoCompleteStringCollection + ' Dim ArrList As New ArrayList + ' Dim SQL As String = "SELECT " & strColumn & " from " & strTable & " order by " & strColumn & " ASC" + ' Dim Obj As New BSDatabase + ' Call Obj.ConnectDB() + ' Dim CMD As New OdbcCommand(SQL, Obj.Conn) + ' Dim RS As OdbcDataReader + ' RS = CMD.ExecuteReader + ' iCol.Clear() + ' If RS.HasRows Then + ' While (RS.Read()) + ' If Not IsDBNull(RS(strColumn)) Then iCol.Add(RS(strColumn)) + ' End While + ' Else + ' iCol.Add("N/A") + ' End If + ' RS.Close() + ' CMD = Nothing + ' Call Obj.CloseDB() + ' Return iCol + ' End Function + ' + ' Private Function MainCollectionDistinct(ByVal strColumn As String, ByVal strTable As String) As AutoCompleteStringCollection + ' Dim iCol As New AutoCompleteStringCollection + ' Dim ArrList As New ArrayList + ' Dim SQL As String = "SELECT distinct(" & strColumn & ") as Res from " & strTable & " order by " & strColumn & " ASC" + ' Dim Obj As New BSDatabase + ' Call Obj.ConnectDB() + ' Dim CMD As New OdbcCommand(SQL, Obj.Conn) + ' Dim RS As OdbcDataReader + ' RS = CMD.ExecuteReader + ' iCol.Clear() + ' If RS.HasRows Then + ' While (RS.Read()) + ' If Not IsDBNull(RS("Res")) Then iCol.Add(RS("Res")) + ' End While + ' Else + ' iCol.Add("N/A") + ' End If + ' RS.Close() + ' CMD = Nothing + ' Call Obj.CloseDB() + ' Return iCol + ' End Function + ' + ' Public Function Config_Source_SG() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Source", "Config_List_Data_SG") + ' End Function + ' + ' Public Function Config_LoadInOZ_SG() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("SW_t", "Config_List_Data_SG") + ' End Function + ' + ' Public Function List_SG_WAD_Manufacturer() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Manufacturer", "List_SG_WAD") + ' End Function + ' + ' Public Function List_SG_WAD_WAD() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("WAD", "List_SG_WAD") + ' End Function + ' + ' Public Function List_SG_WAD_Price() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Price", "List_SG_WAD") + ' End Function + ' + ' Public Function List_SG_Bushings_Powder_Manufacturer() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Manufacturer", "List_SG_Bushing_Powder") + ' End Function + ' + ' Public Function List_SG_Bushings_Powder_Name() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("sName", "List_SG_Bushing_Powder") + ' End Function + ' + ' Public Function List_SG_Bushings_Powder_sCharge() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("sCharge", "List_SG_Bushing_Powder") + ' End Function + ' + ' Public Function List_SG_Bushings_Powder_Powder() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("name", "General_Powder") + ' End Function + ' + ' Public Function List_SG_Bushings_Shot_Manufacturer() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Manufacturer", "List_SG_Bushing_Shot") + ' End Function + ' + ' Public Function List_SG_Bushings_Shot_Name() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("sName", "List_SG_Bushing_Shot") + ' End Function + ' + ' Public Function List_SG_Bushings_Shot_sCharge() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("sCharge", "List_SG_Bushing_Shot") + ' End Function + ' + ' Public Function List_SG_Log_SG_Patterns() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("pd", "Loaders_Log_SG") + ' End Function + ' + ' Public Function List_SG_Log_SG_ShotWt() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("shotwt", "Loaders_Log_SG") + ' End Function + ' + ' Public Function List_SG_Log_SG_ShotSize() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("shotsize", "Loaders_Log_SG") + ' End Function + ' + ' Public Function List_SG_Log_SG_Case() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("case", "Loaders_Log_SG") + ' End Function + ' + ' Public Function List_SG_Log_SG_PowderBushing() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("pbm", "Loaders_Log_SG") + ' End Function + ' + ' Public Function List_SG_Log_SG_Wad() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("wad", "Loaders_Log_SG") + ' End Function + ' + ' Public Function List_SG_Log_SG_Primer() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("primer", "Loaders_Log_SG") + ' End Function + ' + ' Public Function List_SG_Case_Manufacturer() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Manufacturer", "List_SG_Case") + ' End Function + ' + ' Public Function List_SG_Case_Name() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Name", "List_SG_Case") + ' End Function + ' + ' Public Function List_SG_Case_DRAM() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("DRAM", "List_SG_Case") + ' End Function + ' + ' Public Function List_SG_Case_Gauge() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Gauge", "List_SG_Case") + ' End Function + ' + ' Public Function List_SG_Case_Length() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Length", "List_SG_Case") + ' End Function + ' + ' Public Function List_SG_Case_Price() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Price", "List_SG_Case") + ' End Function + ' + ' Public Function List_SG_SHOTSLUG_Details_Manu() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Manufacturer", "List_SG_ShotType_Details") + ' End Function + ' + ' Public Function List_SG_SHOTSLUG_Details_Name() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Name", "List_SG_ShotType_Details") + ' End Function + ' + ' Public Function List_SG_SHOTSLUG_Details_mat() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("mat", "List_SG_ShotType_Details") + ' End Function + ' + ' Public Function List_SG_SHOTSLUG_Details_ShotNo() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("ShotNo", "List_SG_ShotType_Details") + ' End Function + ' + ' Public Function List_SG_SHOTSLUG_Details_weight() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("weight", "List_SG_ShotType_Details") + ' End Function + ' + ' Public Function List_SG_SHOTSLUG_Details_CAL() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("CAL", "List_SG_ShotType_Details") + ' End Function + ' + ' Public Function List_SG_SHOTSLUG_Details_Price() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Price", "List_SG_ShotType_Details") + ' End Function + ' End Class + ' Private Function MainCollection(ByVal strColumn As String, ByVal strTable As String) As AutoCompleteStringCollection + ' Dim iCol As New AutoCompleteStringCollection + ' Dim ArrList As New ArrayList + ' Dim SQL As String = "SELECT " & strColumn & " from " & strTable & " order by " & strColumn & " ASC" + ' Dim Obj As New BSDatabase + ' Call Obj.ConnectDB() + ' Dim CMD As New OdbcCommand(SQL, Obj.Conn) + ' Dim RS As OdbcDataReader + ' RS = CMD.ExecuteReader + ' iCol.Clear() + ' If RS.HasRows Then + ' While (RS.Read()) + ' If Not IsDBNull(RS(strColumn)) Then iCol.Add(RS(strColumn)) + ' End While + ' Else + ' iCol.Add("N/A") + ' End If + ' RS.Close() + ' CMD = Nothing + ' Call Obj.CloseDB() + ' Return iCol + ' End Function + ' Private Function MainCollectionDistinct(ByVal strColumn As String, ByVal strTable As String) As AutoCompleteStringCollection + ' Dim iCol As New AutoCompleteStringCollection + ' Dim ArrList As New ArrayList + ' Dim SQL As String = "SELECT distinct(" & strColumn & ") as Res from " & strTable & " order by " & strColumn & " ASC" + ' Dim Obj As New BSDatabase + ' Call Obj.ConnectDB() + ' Dim CMD As New OdbcCommand(SQL, Obj.Conn) + ' Dim RS As OdbcDataReader + ' RS = CMD.ExecuteReader + ' iCol.Clear() + ' If RS.HasRows Then + ' While (RS.Read()) + ' If Not IsDBNull(RS("Res")) Then iCol.Add(RS("Res")) + ' End While + ' Else + ' iCol.Add("N/A") + ' End If + ' RS.Close() + ' CMD = Nothing + ' Call Obj.CloseDB() + ' Return iCol + ' End Function + ' + ' Public Function General_Calibers() As AutoCompleteStringCollection + ' Return MainCollection("Cal", "General_Calibers") + ' End Function + ' + ' Public Function General_Primer_Type_ManuFacturers() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Manufacturer", "General_Primer") + ' End Function + ' + ' Public Function General_Primer_Type_Name() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Name", "General_Primer") + ' End Function + ' + ' Public Function General_Primer_Type_Price() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Price", "General_Primer") + ' End Function + ' + ' Public Function General_Powder_Manufacturer() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Manufacturer", "General_Powder") + ' End Function + ' + ' Public Function General_Powder_Name() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Name", "General_Powder") + ' End Function + ' + ' Public Function General_Powder_WeightInPounds() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("weightlbs", "General_Powder") + ' End Function + ' + ' Public Function General_Powder_Price() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Price", "General_Powder") + ' End Function + ' ' + ' 'Public Function List_Bullets_Manufacturer() As AutoCompleteStringCollection + ' ' Return MainCollectionDistinct("Manufacturer", "List_Bullets") + ' 'End Function + ' ' + ' 'Public Function List_Bullets_Name() As AutoCompleteStringCollection + ' ' Return MainCollectionDistinct("Name", "List_Bullets") + ' 'End Function + ' ' + ' 'Public Function List_Bullets_Diameter() As AutoCompleteStringCollection + ' ' Return MainCollectionDistinct("Diameter", "List_Bullets") + ' 'End Function + ' ' + ' 'Public Function List_Bullets_Sec_Den() As AutoCompleteStringCollection + ' ' Return MainCollectionDistinct("Sec_Den", "List_Bullets") + ' 'End Function + ' ' + ' 'Public Function List_Bullets_Part_number() As AutoCompleteStringCollection + ' ' Return MainCollectionDistinct("Part_number", "List_Bullets") + ' 'End Function + ' ' + ' 'Public Function List_Bullets_Ballistic_Coefficient() As AutoCompleteStringCollection + ' ' Return MainCollectionDistinct("Ballistic_Coefficient", "List_Bullets") + ' 'End Function + ' ' + ' 'Public Function List_Bullets_Price() As AutoCompleteStringCollection + ' ' Return MainCollectionDistinct("Price", "List_Bullets") + ' 'End Function + ' ' + ' 'Public Function List_Bullets_Weight() As AutoCompleteStringCollection + ' ' Return MainCollectionDistinct("Weight", "List_Bullets") + ' 'End Function + ' + ' Public Function List_Case_Manufacturer() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Manufacturer", "List_Case") + ' End Function + ' + ' Public Function List_Case_Name() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Name", "List_Case") + ' End Function + ' + ' Public Function List_Case_Trim_to_length() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("ttl", "List_Case") + ' End Function + ' + ' Public Function List_Case_Price() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Price", "List_Case") + ' End Function + ' + ' Public Function General_Equipment_Manufacturer() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Manufacturer", "General_Equipment") + ' End Function + ' + ' Public Function General_Equipment_Name() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Name", "General_Equipment") + ' End Function + ' + ' Public Function General_Equipment_Use() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Use", "General_Equipment") + ' End Function + ' + ' Public Function General_Equipment_Cost() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Cost", "General_Equipment") + ' End Function + ' + ' Public Function ConfigName() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("ConfigName", "Config_List_Name") + ' End Function + ' + ' Public Function Config_Source_NSG() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("Source", "Config_List_Data_NSG") + ' End Function + ' + ' Public Function Loaders_Log_NSG_GroupSize() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("gs", "Loaders_Log_NSG") + ' End Function + ' + ' Public Function Loaders_Log_NSG_Powder() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("pwm", "Loaders_Log_NSG") + ' End Function + ' + ' Public Function Loaders_Log_NSG_Bullet() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("bullet", "Loaders_Log_NSG") + ' End Function + ' + ' Public Function Loaders_Log_NSG_primer() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("primer", "Loaders_Log_NSG") + ' End Function + ' + ' Public Function Loaders_Log_NSG_case() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("case", "Loaders_Log_NSG") + ' End Function + ' + ' Public Function Loaders_Log_NSG_conditions() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("conditions", "Loaders_Log_NSG") + ' End Function + ' + ' Public Function Loaders_Log_NSG_tl() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("tl", "Loaders_Log_NSG") + ' End Function + ' + ' Public Function Loaders_Log_NSG_notes() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("notes", "Loaders_Log_NSG") + ' End Function + ' + ' Public Function Loaders_Log_NSG_ConfigName() As AutoCompleteStringCollection + ' Return MainCollectionDistinct("ConfigName", "Loaders_Log_NSG") + ' End Function - End Class + 'End Class Public Class GlobalFunctions ' 'Public Function DatabaseVersion() As Double @@ -994,18 +999,18 @@ Namespace LoadersClass ' End Try ' Return lAns 'End Function - - Public Function GetTitle(ByVal lngID As Long) As String - Dim sAns As String = "" - sAns = GetName("SELECT * from Config_List_Name where ID=" & lngID, "ConfigName") - Return sAns - End Function - - Public Function GetAmmoTypeID(ByVal sName) As Long - Dim lAns As Long = 0 - lAns = GetID("SELECT ID from General_Ammunition_Type where FType='" & sName & "'") - Return lAns - End Function + ' + 'Public Function GetTitle(ByVal lngID As Long) As String + ' Dim sAns As String = "" + ' sAns = GetName("SELECT * from Config_List_Name where ID=" & lngID, "ConfigName") + ' Return sAns + 'End Function + ' + 'Public Function GetAmmoTypeID(ByVal sName) As Long + ' Dim lAns As Long = 0 + ' lAns = GetID("SELECT ID from General_Ammunition_Type where FType='" & sName & "'") + ' Return lAns + 'End Function Public Function GetAmmoTypeIDSG(ByVal sName) As Long Dim lAns As Long = 0 @@ -1090,33 +1095,33 @@ Namespace LoadersClass Err.Number, ex.Message.ToString) End Try End Sub - - Public Function GetFirearmID(ByVal Fullname As String) As Long - Dim lAns As Long = 0 - Try - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim SQL As String = "Select ID from Loaders_Log_Firearms where FullName='" & Fullname & "'" - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - While RS.Read - lAns = RS("id") - End While - RS.Close() - RS = Nothing - CMD = Nothing - Catch ex As Exception - 'Dim strform As String = "LoadersClass.GlobalFunctions" - 'Dim strProcedure As String = "GetFirearmID" - 'Dim ObjFS As New BSMyLoadersLog.LoadersClass.BSFileSystem - 'Dim sMessage As String = strform & "." & strProcedure & "::" & Err.Number & "::" & ex.Message.ToString() - 'ObjFS.LogFile(MyLogFile, sMessage) - Call LogError("LoadersClass", "GetFirearmID", - Err.Number, ex.Message.ToString) - End Try - Return lAns - End Function + ' + 'Public Function GetFirearmID(ByVal Fullname As String) As Long + ' Dim lAns As Long = 0 + ' Try + ' Dim Obj As New BSDatabase + ' Call Obj.ConnectDB() + ' Dim SQL As String = "Select ID from Loaders_Log_Firearms where FullName='" & Fullname & "'" + ' Dim CMD As New OdbcCommand(SQL, Obj.Conn) + ' Dim RS As OdbcDataReader + ' RS = CMD.ExecuteReader + ' While RS.Read + ' lAns = RS("id") + ' End While + ' RS.Close() + ' RS = Nothing + ' CMD = Nothing + ' Catch ex As Exception + ' 'Dim strform As String = "LoadersClass.GlobalFunctions" + ' 'Dim strProcedure As String = "GetFirearmID" + ' 'Dim ObjFS As New BSMyLoadersLog.LoadersClass.BSFileSystem + ' 'Dim sMessage As String = strform & "." & strProcedure & "::" & Err.Number & "::" & ex.Message.ToString() + ' 'ObjFS.LogFile(MyLogFile, sMessage) + ' Call LogError("LoadersClass", "GetFirearmID", + ' Err.Number, ex.Message.ToString) + ' End Try + ' Return lAns + 'End Function Public Function GetGaugeID(ByVal Fullname As String) As Long Dim lAns As Long = 0 Try @@ -1143,49 +1148,54 @@ Namespace LoadersClass End Try Return lAns End Function - Public Function TotalConfigByCal(ByVal lCalID As Long) As Long - Dim iAns As Integer = 0 - Try - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim SQL As String = "SELECT Count(*) as Total from qry_CFG_SR_PowderList where MyCalID=" & lCalID - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - While RS.Read - iAns = RS("Total") - End While - RS.Close() - RS = Nothing - CMD = Nothing - Call Obj.CloseDB() - Catch ex As Exception - 'Dim strform As String = "LoadersClass.GlobalFunctions" - 'Dim strProcedure As String = "TotalConfigByCal" - 'Dim ObjFS As New BSMyLoadersLog.LoadersClass.BSFileSystem - 'Dim sMessage As String = strform & "." & strProcedure & "::" & Err.Number & "::" & ex.Message.ToString() - 'ObjFS.LogFile(MyLogFile, sMessage) - Call LogError("LoadersClass", "TotalConfigByCal", - Err.Number, ex.Message.ToString) - End Try - Return iAns - End Function - Function IsShotGunCOnfig(ByVal iCal As Long) As Boolean - Dim bAns As Boolean = False - bAns = ObjectExistsinDB(CInt(iCal), "Id", "qry_ConfigCal_SG") - Return bAns - End Function + ' + 'Public Function TotalConfigByCal(ByVal lCalID As Long) As Long + ' Dim iAns As Integer = 0 + ' Try + ' Dim Obj As New BSDatabase + ' Call Obj.ConnectDB() + ' Dim SQL As String = "SELECT Count(*) as Total from qry_CFG_SR_PowderList where MyCalID=" & lCalID + ' Dim CMD As New OdbcCommand(SQL, Obj.Conn) + ' Dim RS As OdbcDataReader + ' RS = CMD.ExecuteReader + ' While RS.Read + ' iAns = RS("Total") + ' End While + ' RS.Close() + ' RS = Nothing + ' CMD = Nothing + ' Call Obj.CloseDB() + ' Catch ex As Exception + ' 'Dim strform As String = "LoadersClass.GlobalFunctions" + ' 'Dim strProcedure As String = "TotalConfigByCal" + ' 'Dim ObjFS As New BSMyLoadersLog.LoadersClass.BSFileSystem + ' 'Dim sMessage As String = strform & "." & strProcedure & "::" & Err.Number & "::" & ex.Message.ToString() + ' 'ObjFS.LogFile(MyLogFile, sMessage) + ' Call LogError("LoadersClass", "TotalConfigByCal", + ' Err.Number, ex.Message.ToString) + ' End Try + ' Return iAns + 'End Function + ' + 'Function IsShotGunCOnfig(ByVal iCal As Long) As Boolean + ' Dim bAns As Boolean = False + ' bAns = ObjectExistsinDB(CInt(iCal), "Id", "qry_ConfigCal_SG") + ' Return bAns + 'End Function + Function FormatForXML(ByVal sValue As String) As String Dim sAns As String = "" sAns = Replace(sValue, "&", "&") Return sAns End Function + Function FormatFromXML(ByVal sValue As String) As String Dim sAns As String = "" sAns = Replace(sValue, "&", "&") sAns = Replace(sAns, "'", "''") Return sAns End Function + Public Function IsSlugConfig(ByVal BID As String) As Boolean Dim bAns As Boolean = False Try @@ -1212,110 +1222,113 @@ Namespace LoadersClass End Try Return bAns End Function - Private Function InSG(ByVal lCALID As Long) As Boolean - Dim bAns As Boolean = False - Try - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim SQL As String = "SELECT Config_List_Name.ID,Config_List_Name.ConfigName,Config_List_Name.IsPersonal,Config_List_Name.IsActive,Config_List_Name.IsFav,Config_List_Name.IsShotgun, Config_List_Data_SG.ATID,Config_List_Data_SG.CALID,Config_List_Data_SG.PRID,Config_List_Data_SG.CAID,Config_List_Data_SG.SW,Config_List_Data_SG.SS,Config_List_Data_SG.WAD,Config_List_Data_SG.SCL,Config_List_Data_SG.GID,Config_List_Data_SG.LTID from Config_List_Name INNER JOIN Config_List_Data_SG on Config_List_Data_SG.CLNID=Config_List_Name.ID " & _ - "where Config_List_Data_SG.ATID=" & lCALID & " order by Config_List_Name.ConfigName ASC" - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - bAns = RS.HasRows - RS.Close() - RS = Nothing - CMD = Nothing - Catch ex As Exception - 'Dim strform As String = "LoadersClass.GlobalFunctions" - 'Dim strProcedure As String = "InSG" - 'Dim ObjFS As New BSMyLoadersLog.LoadersClass.BSFileSystem - 'Dim sMessage As String = strform & "." & strProcedure & "::" & Err.Number & "::" & ex.Message.ToString() - 'ObjFS.LogFile(MyLogFile, sMessage) - Call LogError("LoadersClass", "InSG", - Err.Number, ex.Message.ToString) - End Try - Return bAns - End Function - Private Function InRP(ByVal lCALID As Long) As Boolean - Dim bAns As Boolean = False - Try - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim SQL As String = "SELECT Config_List_Name.ID,Config_List_Name.ConfigName,Config_List_Name.IsPersonal,Config_List_Name.IsActive,Config_List_Name.IsFav,Config_List_Name.IsShotgun, " & _ - "Config_List_Data_NSG.ATID, Config_List_Data_NSG.CALID,Config_List_Data_NSG.CAID, Config_List_Data_NSG.BID, " & _ - "Config_List_Data_NSG.PRID from Config_List_Name INNER JOIN Config_List_Data_NSG on " & _ - "Config_List_Data_NSG.CLNID=Config_List_Name.ID where Config_List_Data_NSG.CALID=" & lCALID & " order by Config_List_Name.ConfigName ASC" - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - bAns = RS.HasRows - RS.Close() - RS = Nothing - CMD = Nothing - Catch ex As Exception - 'Dim strform As String = "LoadersClass.GlobalFunctions" - 'Dim strProcedure As String = "InRP" - 'Dim ObjFS As New BSMyLoadersLog.LoadersClass.BSFileSystem - 'Dim sMessage As String = strform & "." & strProcedure & "::" & Err.Number & "::" & ex.Message.ToString() - 'ObjFS.LogFile(MyLogFile, sMessage) - Call LogError("LoadersClass", "InRP", - Err.Number, ex.Message.ToString) - End Try - Return bAns - End Function - Public Function IsNotInShotgunConfigbyCal(ByVal lCALID As Long) As Boolean - Dim bAns As Boolean = False - Try - If Not InRP(lCALID) Then - If InSG(lCALID) Then - bAns = False - Else - bAns = True - End If - Else - bAns = True - End If - Catch ex As Exception - 'Dim strform As String = "LoadersClass.GlobalFunctions" - 'Dim strProcedure As String = "IsNotInShotgunConfigbyCal" - 'Dim ObjFS As New BSMyLoadersLog.LoadersClass.BSFileSystem - 'Dim sMessage As String = strform & "." & strProcedure & "::" & Err.Number & "::" & ex.Message.ToString() - 'ObjFS.LogFile(MyLogFile, sMessage) - Call LogError("LoadersClass", "IsNotInShotgunConfigbyCal", - Err.Number, ex.Message.ToString) - End Try - Return bAns - End Function - End Class - - Public Class BSMGC - Private _RegPath As String - Public Conn As OdbcConnection - - Public Property DefaultRegPath() As String - Get - Return "Software\\BurnSoft\\BSMGC" - End Get - Set(ByVal value As String) - _RegPath = value - End Set - End Property - - Public Function MyGunCollectionIsInstalled() As Boolean - Dim bAns As Boolean = False - Dim MyReg As RegistryKey - Dim strValue As String = DefaultRegPath - On Error Resume Next - MyReg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(strValue, True) - If MyReg Is Nothing Then - bAns = False - Else - bAns = True - End If - Return bAns - Return bAns - End Function + ' + 'Private Function InSG(ByVal lCALID As Long) As Boolean + ' Dim bAns As Boolean = False + ' Try + ' Dim Obj As New BSDatabase + ' Call Obj.ConnectDB() + ' Dim SQL As String = "SELECT Config_List_Name.ID,Config_List_Name.ConfigName,Config_List_Name.IsPersonal,Config_List_Name.IsActive,Config_List_Name.IsFav,Config_List_Name.IsShotgun, Config_List_Data_SG.ATID,Config_List_Data_SG.CALID,Config_List_Data_SG.PRID,Config_List_Data_SG.CAID,Config_List_Data_SG.SW,Config_List_Data_SG.SS,Config_List_Data_SG.WAD,Config_List_Data_SG.SCL,Config_List_Data_SG.GID,Config_List_Data_SG.LTID from Config_List_Name INNER JOIN Config_List_Data_SG on Config_List_Data_SG.CLNID=Config_List_Name.ID " & _ + ' "where Config_List_Data_SG.ATID=" & lCALID & " order by Config_List_Name.ConfigName ASC" + ' Dim CMD As New OdbcCommand(SQL, Obj.Conn) + ' Dim RS As OdbcDataReader + ' RS = CMD.ExecuteReader + ' bAns = RS.HasRows + ' RS.Close() + ' RS = Nothing + ' CMD = Nothing + ' Catch ex As Exception + ' 'Dim strform As String = "LoadersClass.GlobalFunctions" + ' 'Dim strProcedure As String = "InSG" + ' 'Dim ObjFS As New BSMyLoadersLog.LoadersClass.BSFileSystem + ' 'Dim sMessage As String = strform & "." & strProcedure & "::" & Err.Number & "::" & ex.Message.ToString() + ' 'ObjFS.LogFile(MyLogFile, sMessage) + ' Call LogError("LoadersClass", "InSG", + ' Err.Number, ex.Message.ToString) + ' End Try + ' Return bAns + 'End Function + ' + 'Private Function InRP(ByVal lCALID As Long) As Boolean + ' Dim bAns As Boolean = False + ' Try + ' Dim Obj As New BSDatabase + ' Call Obj.ConnectDB() + ' Dim SQL As String = "SELECT Config_List_Name.ID,Config_List_Name.ConfigName,Config_List_Name.IsPersonal,Config_List_Name.IsActive,Config_List_Name.IsFav,Config_List_Name.IsShotgun, " & _ + ' "Config_List_Data_NSG.ATID, Config_List_Data_NSG.CALID,Config_List_Data_NSG.CAID, Config_List_Data_NSG.BID, " & _ + ' "Config_List_Data_NSG.PRID from Config_List_Name INNER JOIN Config_List_Data_NSG on " & _ + ' "Config_List_Data_NSG.CLNID=Config_List_Name.ID where Config_List_Data_NSG.CALID=" & lCALID & " order by Config_List_Name.ConfigName ASC" + ' Dim CMD As New OdbcCommand(SQL, Obj.Conn) + ' Dim RS As OdbcDataReader + ' RS = CMD.ExecuteReader + ' bAns = RS.HasRows + ' RS.Close() + ' RS = Nothing + ' CMD = Nothing + ' Catch ex As Exception + ' 'Dim strform As String = "LoadersClass.GlobalFunctions" + ' 'Dim strProcedure As String = "InRP" + ' 'Dim ObjFS As New BSMyLoadersLog.LoadersClass.BSFileSystem + ' 'Dim sMessage As String = strform & "." & strProcedure & "::" & Err.Number & "::" & ex.Message.ToString() + ' 'ObjFS.LogFile(MyLogFile, sMessage) + ' Call LogError("LoadersClass", "InRP", + ' Err.Number, ex.Message.ToString) + ' End Try + ' Return bAns + 'End Function + ' + 'Public Function IsNotInShotgunConfigbyCal(ByVal lCALID As Long) As Boolean + ' Dim bAns As Boolean = False + ' Try + ' If Not InRP(lCALID) Then + ' If InSG(lCALID) Then + ' bAns = False + ' Else + ' bAns = True + ' End If + ' Else + ' bAns = True + ' End If + ' Catch ex As Exception + ' 'Dim strform As String = "LoadersClass.GlobalFunctions" + ' 'Dim strProcedure As String = "IsNotInShotgunConfigbyCal" + ' 'Dim ObjFS As New BSMyLoadersLog.LoadersClass.BSFileSystem + ' 'Dim sMessage As String = strform & "." & strProcedure & "::" & Err.Number & "::" & ex.Message.ToString() + ' 'ObjFS.LogFile(MyLogFile, sMessage) + ' Call LogError("LoadersClass", "IsNotInShotgunConfigbyCal", + ' Err.Number, ex.Message.ToString) + ' End Try + ' Return bAns + 'End Function + End Class + + Public Class BSMGC + Private _RegPath As String + Public Conn As OdbcConnection + ' + 'Public Property DefaultRegPath() As String + ' Get + ' Return "Software\\BurnSoft\\BSMGC" + ' End Get + ' Set(ByVal value As String) + ' _RegPath = value + ' End Set + 'End Property + ' + 'Public Function MyGunCollectionIsInstalled() As Boolean + ' Dim bAns As Boolean = False + ' Dim MyReg As RegistryKey + ' Dim strValue As String = DefaultRegPath + ' On Error Resume Next + ' MyReg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(strValue, True) + ' If MyReg Is Nothing Then + ' bAns = False + ' Else + ' bAns = True + ' End If + ' Return bAns + ' Return bAns + 'End Function Public Function sConnect() As String Dim sAns As String = "" @@ -1367,49 +1380,49 @@ Namespace LoadersClass Err.Number, ex.Message.ToString) End Try End Sub - - Public Function GetMGCPath() As String - Dim sAns As String = "" - Dim MyReg As RegistryKey - Dim strValue As String = DefaultRegPath - MyReg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(strValue, True) - If MyReg Is Nothing Then - MyReg = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(strValue) - End If - sAns = MyReg.GetValue("DataBase", "") - MyReg.Close() - Return sAns - End Function - - Public Function GetMGCEXEPath() As String - Dim sAns As String = "" - Dim MyReg As RegistryKey - Dim strValue As String = DefaultRegPath - MyReg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(strValue, True) - If MyReg Is Nothing Then - MyReg = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(strValue) - End If - sAns = MyReg.GetValue("AppEXE", "") - MyReg.Close() - Return sAns - End Function - - Public Function CountFirearms() As Integer - Dim iAns As Integer = 0 - Call ConnectDB() - Dim SQL As String = "SELECT Count(*) as Total from Gun_Collection where ItemSold=0" - Dim CMD As New OdbcCommand(SQL, Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - While RS.Read - iAns = RS("Total") - End While - RS.Close() - RS = Nothing - CMD = Nothing - Call CloseDB() - Return ians - End Function + ' + 'Public Function GetMGCPath() As String + ' Dim sAns As String = "" + ' Dim MyReg As RegistryKey + ' Dim strValue As String = DefaultRegPath + ' MyReg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(strValue, True) + ' If MyReg Is Nothing Then + ' MyReg = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(strValue) + ' End If + ' sAns = MyReg.GetValue("DataBase", "") + ' MyReg.Close() + ' Return sAns + 'End Function + ' + 'Public Function GetMGCEXEPath() As String + ' Dim sAns As String = "" + ' Dim MyReg As RegistryKey + ' Dim strValue As String = DefaultRegPath + ' MyReg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(strValue, True) + ' If MyReg Is Nothing Then + ' MyReg = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(strValue) + ' End If + ' sAns = MyReg.GetValue("AppEXE", "") + ' MyReg.Close() + ' Return sAns + 'End Function + ' + 'Public Function CountFirearms() As Integer + ' Dim iAns As Integer = 0 + ' Call ConnectDB() + ' Dim SQL As String = "SELECT Count(*) as Total from Gun_Collection where ItemSold=0" + ' Dim CMD As New OdbcCommand(SQL, Conn) + ' Dim RS As OdbcDataReader + ' RS = CMD.ExecuteReader + ' While RS.Read + ' iAns = RS("Total") + ' End While + ' RS.Close() + ' RS = Nothing + ' CMD = Nothing + ' Call CloseDB() + ' Return ians + 'End Function Public Function ObjectExistsinDB(ByVal strObject As String, ByVal strField As String, ByVal strTable As String) As Boolean Try @@ -1496,12 +1509,12 @@ Namespace LoadersClass End If Return iAns End Function - - Public Function GetManufacturersName(ByVal strValue As String) As String - Dim SQL As String = "SELECT Brand from Gun_Manufacturer where ID=" & strValue - Dim sAns As String = GetName(SQL, "Brand") - Return sAns - End Function + ' + 'Public Function GetManufacturersName(ByVal strValue As String) As String + ' Dim SQL As String = "SELECT Brand from Gun_Manufacturer where ID=" & strValue + ' Dim sAns As String = GetName(SQL, "Brand") + ' Return sAns + 'End Function Public Function GetModelID(ByVal strValue As String, ByVal StrValueID As Long) As Long Dim SQL As String = "SELECT ID from Gun_Model where Model='" & strValue & "' and GMID=" & StrValueID @@ -1565,21 +1578,21 @@ Namespace LoadersClass Err.Number, ex.Message.ToString) End Try End Function - - Public Sub UpdateGunType(ByVal strType As String) - Try - If Not ObjectExistsinDB(strType, "Type", "Gun_Type") Then - Dim SQL As String = "INSERT INTO Gun_Type(Type) VALUES('" & strType & "')" - ConnExec(SQL) - End If - Catch ex As Exception - 'Dim ObjFS As New BSFileSystem - 'Dim sMessage As String = "LoadersClass.BSMGC.UpdateGunType" & "::" & Err.Number & "::" & ex.Message.ToString() - 'ObjFS.LogFile(MyLogFile, sMessage) - Call LogError("LoadersClass", "UpdateGunType", - Err.Number, ex.Message.ToString) - End Try - End Sub + ' + 'Public Sub UpdateGunType(ByVal strType As String) + ' Try + ' If Not ObjectExistsinDB(strType, "Type", "Gun_Type") Then + ' Dim SQL As String = "INSERT INTO Gun_Type(Type) VALUES('" & strType & "')" + ' ConnExec(SQL) + ' End If + ' Catch ex As Exception + ' 'Dim ObjFS As New BSFileSystem + ' 'Dim sMessage As String = "LoadersClass.BSMGC.UpdateGunType" & "::" & Err.Number & "::" & ex.Message.ToString() + ' 'ObjFS.LogFile(MyLogFile, sMessage) + ' Call LogError("LoadersClass", "UpdateGunType", + ' Err.Number, ex.Message.ToString) + ' End Try + 'End Sub Public Function CaliberExists(ByVal strCaliber As String) As Boolean Return ObjectExistsinDB(strCaliber, "Cal", "Gun_Cal") @@ -1610,28 +1623,28 @@ Namespace LoadersClass Call ConnExec(SQL) If Not CaliberExists(Cal) Then ConnExec("INSERT INTO Gun_Cal (Cal) VALUES('" & Cal & "')") End Sub - - Public Function AmmoIsAlreadyListed(ByVal Manufacturer As String, ByVal Name As String, _ - ByVal Cal As String, ByVal Grain As String, ByVal Jacket As String, Optional ByRef Qty As Long = 0, Optional ByRef MID As Long = 0) - Dim bAns As Boolean = False - Call ConnectDB() - Dim SQL As String = "SELECT * from Gun_Collection_Ammo where Manufacturer='" & _ - Manufacturer & "' and Name='" & Name & "' and Cal='" & Cal & _ - "' and Grain='" & Grain & "' and Jacket='" & Jacket & "'" - Dim CMD As New OdbcCommand(SQL, Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - bAns = RS.HasRows - While RS.Read - Qty = RS("qty") - MID = RS("ID") - End While - RS.Close() - RS = Nothing - CMD = Nothing - CloseDB() - Return bAns - End Function + ' + ' Public Function AmmoIsAlreadyListed(ByVal Manufacturer As String, ByVal Name As String, _ + 'ByVal Cal As String, ByVal Grain As String, ByVal Jacket As String, Optional ByRef Qty As Long = 0, Optional ByRef MID As Long = 0) + ' Dim bAns As Boolean = False + ' Call ConnectDB() + ' Dim SQL As String = "SELECT * from Gun_Collection_Ammo where Manufacturer='" & _ + ' Manufacturer & "' and Name='" & Name & "' and Cal='" & Cal & _ + ' "' and Grain='" & Grain & "' and Jacket='" & Jacket & "'" + ' Dim CMD As New OdbcCommand(SQL, Conn) + ' Dim RS As OdbcDataReader + ' RS = CMD.ExecuteReader + ' bAns = RS.HasRows + ' While RS.Read + ' Qty = RS("qty") + ' MID = RS("ID") + ' End While + ' RS.Close() + ' RS = Nothing + ' CMD = Nothing + ' CloseDB() + ' Return bAns + ' End Function End Class Public Class InventoryMath '''' @@ -1649,31 +1662,31 @@ Namespace LoadersClass ''' Just pass the Configuration ID to this function ''' ''' - - Function GetPrefNSGPowderID(ByVal ConfigID As Long, Optional ByRef DefaultPowderLoad As Double = 0, Optional ByRef DefaultFPS As Double = 0) As Long - Dim iAns As Integer = 0 - Try - Dim Obj As New BSDatabase - Dim SQL As String = "SELECT PID,Load_Mid,FPS_MID from Config_List_Powder_Data_NSG where IsPref=1 and CLNID=" & ConfigID - Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - While RS.Read - iAns = RS("PID") - DefaultPowderLoad = RS("Load_Mid") - DefaultFPS = RS("FPS_MID") - End While - RS.Close() - RS = Nothing - CMD = Nothing - Obj.CloseDB() - Catch ex As Exception - Call LogError("LoadersClass.InventoryMath", "GetPrefNSGPowderID", - Err.Number, ex.Message.ToString()) - End Try - Return iAns - End Function + ' + 'Function GetPrefNSGPowderID(ByVal ConfigID As Long, Optional ByRef DefaultPowderLoad As Double = 0, Optional ByRef DefaultFPS As Double = 0) As Long + ' Dim iAns As Integer = 0 + ' Try + ' Dim Obj As New BSDatabase + ' Dim SQL As String = "SELECT PID,Load_Mid,FPS_MID from Config_List_Powder_Data_NSG where IsPref=1 and CLNID=" & ConfigID + ' Obj.ConnectDB() + ' Dim CMD As New OdbcCommand(SQL, Obj.Conn) + ' Dim RS As OdbcDataReader + ' RS = CMD.ExecuteReader + ' While RS.Read + ' iAns = RS("PID") + ' DefaultPowderLoad = RS("Load_Mid") + ' DefaultFPS = RS("FPS_MID") + ' End While + ' RS.Close() + ' RS = Nothing + ' CMD = Nothing + ' Obj.CloseDB() + ' Catch ex As Exception + ' Call LogError("LoadersClass.InventoryMath", "GetPrefNSGPowderID", + ' Err.Number, ex.Message.ToString()) + ' End Try + ' Return iAns + 'End Function ''' ''' Get the Powder ID ( OID ) from the Config_List_Powder_Data_SG Table for Shotguns ''' and returns the ID along with the Default Powder Load ( byref DefaultPowderLoad ) value. @@ -1977,36 +1990,36 @@ Namespace LoadersClass ''' ''' ''' - - Public Sub LoadCaseInfo(ByVal lngID As Long, Optional ByRef Manufacturer As String = "", _ - Optional ByRef Name As String = "", Optional ByRef Trim2length As String = "", _ - Optional ByRef TimesUsed As String = "0", Optional ByRef lQty As Long = 0, _ - Optional ByRef ePPC As Double = 0) - Try - Dim Obj As New BSDatabase - Dim SQL As String = "SELECT * from List_Case where ID=" & lngID - Call Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - Dim intNew As Integer = 0 - While RS.Read - If Not IsDBNull(RS("Manufacturer")) Then Manufacturer = RS("Manufacturer") - If Not IsDBNull(RS("Name")) Then Name = RS("Name") - If Not IsDBNull(RS("ttl")) Then Trim2length = RS("ttl") - If Not IsDBNull(RS("TimesUsed")) Then TimesUsed = RS("TimesUsed") - lQty = RS("Qty") - ePPC = CDbl(RS("ePPC")) - End While - RS.Close() - RS = Nothing - CMD = Nothing - Catch ex As Exception - 'Call LogError("LoadCaseInfo", Err.Number, ex.Message.ToString()) - Call LogError("LoadersClass.InventoryMath", "LoadCaseInfo", - Err.Number, ex.Message.ToString()) - End Try - End Sub + ' + 'Public Sub LoadCaseInfo(ByVal lngID As Long, Optional ByRef Manufacturer As String = "", _ + ' Optional ByRef Name As String = "", Optional ByRef Trim2length As String = "", _ + ' Optional ByRef TimesUsed As String = "0", Optional ByRef lQty As Long = 0, _ + ' Optional ByRef ePPC As Double = 0) + ' Try + ' Dim Obj As New BSDatabase + ' Dim SQL As String = "SELECT * from List_Case where ID=" & lngID + ' Call Obj.ConnectDB() + ' Dim CMD As New OdbcCommand(SQL, Obj.Conn) + ' Dim RS As OdbcDataReader + ' RS = CMD.ExecuteReader + ' Dim intNew As Integer = 0 + ' While RS.Read + ' If Not IsDBNull(RS("Manufacturer")) Then Manufacturer = RS("Manufacturer") + ' If Not IsDBNull(RS("Name")) Then Name = RS("Name") + ' If Not IsDBNull(RS("ttl")) Then Trim2length = RS("ttl") + ' If Not IsDBNull(RS("TimesUsed")) Then TimesUsed = RS("TimesUsed") + ' lQty = RS("Qty") + ' ePPC = CDbl(RS("ePPC")) + ' End While + ' RS.Close() + ' RS = Nothing + ' CMD = Nothing + ' Catch ex As Exception + ' 'Call LogError("LoadCaseInfo", Err.Number, ex.Message.ToString()) + ' Call LogError("LoadersClass.InventoryMath", "LoadCaseInfo", + ' Err.Number, ex.Message.ToString()) + ' End Try + 'End Sub ''' ''' Get the Shull/shotgun Case information by passing the Case ID and optionally getting the Manufacturer, ''' Name, Trim to Length, Current Qty, Estimated Price Per Case, and DRAM @@ -2160,124 +2173,128 @@ Namespace LoadersClass Err.Number, ex.Message.ToString()) End Try End Sub + '''' + '''' + '''' + '''' + ' + 'Public Function ConvertToDollars(ByVal dValue As Double) As Double + ' Dim dAns As Double = 0 + ' dAns = Math.Round(dValue, 2) + ' Return dAns + 'End Function ''' ''' ''' ''' - - Public Function ConvertToDollars(ByVal dValue As Double) As Double - Dim dAns As Double = 0 - dAns = Math.Round(dValue, 2) - Return dAns - End Function - ''' - ''' - ''' - ''' - Public Sub ARUNSG_UpdateInventoryQty(ByVal lQty As Long, ByVal lQBullet As Long, ByVal BID As Long, ByVal lQPrimer As Long, _ - ByVal PRID As Long, ByVal lQCase As Long, ByVal CID As Long, ByVal dQPowder As Double, ByVal PPID As Long, ByVal dGrainsUses As Double) - Try - Dim lNewBullet As Long = lQBullet - lQty - Dim lNewCase As Long = lQCase - lQty - Dim lNewPrimer As Long = lQPrimer - lQty - Dim lNewPowder As Double = dQPowder - (dGrainsUses * lQty) - Dim dPounds As Double = Math.Round(lNewPowder / WeightGrains1Lbs, 3) - Dim Obj As New BSDatabase - Dim SQL As String = "UPDATE List_Bullets set Qty=" & lNewBullet & " where ID=" & BID - Obj.ConnExec(SQL) - SQL = "UPDATE List_Case set Qty=" & lNewCase & " where id=" & CID - Obj.ConnExec(SQL) - SQL = "UPDATE General_Primer set Qty=" & lNewPrimer & " where id=" & PRID - Obj.ConnExec(SQL) - SQL = "UPDATE General_Powder set weightgn=" & lNewPowder & ",weightlbs=" & dPounds & " where id=" & PPID - Obj.ConnExec(SQL) - Catch ex As Exception - 'Call LogError("ARUNSG_UpdateInventoryQty", Err.Number, ex.Message.ToString()) - Call LogError("LoadersClass.InventoryMath", "ARUNSG_UpdateInventoryQty", - Err.Number, ex.Message.ToString()) - End Try - End Sub + ' + 'Public Sub ARUNSG_UpdateInventoryQty(ByVal lQty As Long, ByVal lQBullet As Long, ByVal BID As Long, ByVal lQPrimer As Long, _ + ' ByVal PRID As Long, ByVal lQCase As Long, ByVal CID As Long, ByVal dQPowder As Double, ByVal PPID As Long, ByVal dGrainsUses As Double) + ' Try + ' Dim lNewBullet As Long = lQBullet - lQty + ' Dim lNewCase As Long = lQCase - lQty + ' Dim lNewPrimer As Long = lQPrimer - lQty + ' Dim lNewPowder As Double = dQPowder - (dGrainsUses * lQty) + ' Dim dPounds As Double = Math.Round(lNewPowder / WeightValues.WEIGHT_GRAINS_1LBS, 3) + ' Dim Obj As New BSDatabase + ' Dim SQL As String = "UPDATE List_Bullets set Qty=" & lNewBullet & " where ID=" & BID + ' Obj.ConnExec(SQL) + ' SQL = "UPDATE List_Case set Qty=" & lNewCase & " where id=" & CID + ' Obj.ConnExec(SQL) + ' SQL = "UPDATE General_Primer set Qty=" & lNewPrimer & " where id=" & PRID + ' Obj.ConnExec(SQL) + ' SQL = "UPDATE General_Powder set weightgn=" & lNewPowder & ",weightlbs=" & dPounds & " where id=" & PPID + ' Obj.ConnExec(SQL) + ' Catch ex As Exception + ' 'Call LogError("ARUNSG_UpdateInventoryQty", Err.Number, ex.Message.ToString()) + ' Call LogError("LoadersClass.InventoryMath", "ARUNSG_UpdateInventoryQty", + ' Err.Number, ex.Message.ToString()) + ' End Try + 'End Sub ''' ''' ''' ''' - Public Sub ARUSG_UpdateInventoryQty(ByVal lQty As Long, ByVal lQBullet As Long, ByVal BID As Long, ByVal lQPrimer As Long, _ - ByVal PRID As Long, ByVal lQCase As Long, ByVal CID As Long, ByVal dQPowder As Double, ByVal PPID As Long, _ - ByVal dGrainsUses As Double, ByVal lQWADS As Long, ByVal WID As Long, ByVal IsSlug As Boolean, _ - ByVal lQSHOT_OZ As Double, ByVal lQSHOT_GR As Double, ByVal dQPrefLoad As Double) - Try - Dim lNewBullet As Long = 0 - Dim lNewCase As Long = lQCase - lQty - Dim lNewPrimer As Long = lQPrimer - lQty - Dim lNewWad As Long = lQWADS - lQty - Dim lNewPowder As Double = dQPowder - (dGrainsUses * lQty) - Dim dPounds As Double = Math.Round(lNewPowder / WeightGrains1Lbs, 3) - Dim dNewShotGrans As Double = 0 - Dim dNewShotOz As Double = 0 - Dim dNewShotLBS As Double = 0 - Dim Obj As New BSDatabase - Dim SQL As String = "" - If IsSlug Then - lNewBullet = lQBullet - lQty - SQL = "UPDATE List_SG_ShotType_Details set Qty=" & lNewBullet & " where ID=" & BID - Else - dNewShotOz = lQSHOT_OZ - (dQPrefLoad * lQty) - dNewShotGrans = dNewShotOz * WeightGramsOz - dNewShotLBS = dNewShotOz / WeightOz1Lbs - SQL = "UPDATE List_SG_ShotType_Details set weight=" & dNewShotLBS & _ - ", ounces=" & dNewShotOz & ", grams=" & dNewShotGrans & " where ID=" & BID - End If - Obj.ConnExec(SQL) - SQL = "UPDATE List_SG_WAD set Qty=" & lNewWad & " where id=" & WID - Obj.ConnExec(SQL) - SQL = "UPDATE List_SG_Case set Qty=" & lNewCase & " where id=" & CID - Obj.ConnExec(SQL) - SQL = "UPDATE General_Primer set Qty=" & lNewPrimer & " where id=" & PRID - Obj.ConnExec(SQL) - SQL = "UPDATE General_Powder set weightgn=" & lNewPowder & ",weightlbs=" & dPounds & " where id=" & PPID - Obj.ConnExec(SQL) - Catch ex As Exception - 'Call LogError("ARUSG_UpdateInventoryQty", Err.Number, ex.Message.ToString()) - Call LogError("LoadersClass.InventoryMath", "ARUSG_UpdateInventoryQty", - Err.Number, ex.Message.ToString()) - End Try - End Sub + ' + 'Public Sub ARUSG_UpdateInventoryQty(ByVal lQty As Long, ByVal lQBullet As Long, ByVal BID As Long, ByVal lQPrimer As Long, _ + ' ByVal PRID As Long, ByVal lQCase As Long, ByVal CID As Long, ByVal dQPowder As Double, ByVal PPID As Long, _ + ' ByVal dGrainsUses As Double, ByVal lQWADS As Long, ByVal WID As Long, ByVal IsSlug As Boolean, _ + ' ByVal lQSHOT_OZ As Double, ByVal lQSHOT_GR As Double, ByVal dQPrefLoad As Double) + ' Try + ' Dim lNewBullet As Long = 0 + ' Dim lNewCase As Long = lQCase - lQty + ' Dim lNewPrimer As Long = lQPrimer - lQty + ' Dim lNewWad As Long = lQWADS - lQty + ' Dim lNewPowder As Double = dQPowder - (dGrainsUses * lQty) + ' Dim dPounds As Double = Math.Round(lNewPowder / WeightValues.WEIGHT_GRAINS_1LBS, 3) + ' Dim dNewShotGrans As Double = 0 + ' Dim dNewShotOz As Double = 0 + ' Dim dNewShotLBS As Double = 0 + ' Dim Obj As New BSDatabase + ' Dim SQL As String = "" + ' If IsSlug Then + ' lNewBullet = lQBullet - lQty + ' SQL = "UPDATE List_SG_ShotType_Details set Qty=" & lNewBullet & " where ID=" & BID + ' Else + ' dNewShotOz = lQSHOT_OZ - (dQPrefLoad * lQty) + ' dNewShotGrans = dNewShotOz * WeightValues.WEIGHT_GRAMS_OZ + ' dNewShotLBS = dNewShotOz / WeightValues.WEIGHT_OZ_1LBS + ' SQL = "UPDATE List_SG_ShotType_Details set weight=" & dNewShotLBS & _ + ' ", ounces=" & dNewShotOz & ", grams=" & dNewShotGrans & " where ID=" & BID + ' End If + ' Obj.ConnExec(SQL) + ' SQL = "UPDATE List_SG_WAD set Qty=" & lNewWad & " where id=" & WID + ' Obj.ConnExec(SQL) + ' SQL = "UPDATE List_SG_Case set Qty=" & lNewCase & " where id=" & CID + ' Obj.ConnExec(SQL) + ' SQL = "UPDATE General_Primer set Qty=" & lNewPrimer & " where id=" & PRID + ' Obj.ConnExec(SQL) + ' SQL = "UPDATE General_Powder set weightgn=" & lNewPowder & ",weightlbs=" & dPounds & " where id=" & PPID + ' Obj.ConnExec(SQL) + ' Catch ex As Exception + ' 'Call LogError("ARUSG_UpdateInventoryQty", Err.Number, ex.Message.ToString()) + ' Call LogError("LoadersClass.InventoryMath", "ARUSG_UpdateInventoryQty", + ' Err.Number, ex.Message.ToString()) + ' End Try + 'End Sub ''' ''' ''' ''' - Public Function IsAlreadyListed(ByVal Manufacturer As String, ByVal Name As String, _ - ByVal Cal As String, ByVal Grain As String, ByVal Jacket As String, Optional ByRef Qty As Long = 0, Optional ByRef MID As Long = 0) - Dim bAns As Boolean = False - Try - Dim Obj As New BSDatabase - Obj.ConnectDB() - Dim SQL As String = "SELECT * from Loaders_Log_Ammunition where Manufacturer='" & _ - Manufacturer & "' and Name='" & Name & "' and Cal='" & Cal & _ - "' and Grain='" & Grain & "' and Jacket='" & Jacket & "'" - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - bAns = RS.HasRows - While RS.Read - Qty = RS("qty") - MID = RS("ID") - End While - RS.Close() - RS = Nothing - CMD = Nothing - Obj.CloseDB() - Catch ex As Exception - 'Call LogError("IsAlreadyListed", Err.Number, ex.Message.ToString()) - Call LogError("LoadersClass.InventoryMath", "IsAlreadyListed", - Err.Number, ex.Message.ToString()) - End Try - Return bAns - End Function + ' + 'Public Function IsAlreadyListed(ByVal Manufacturer As String, ByVal Name As String, _ + 'ByVal Cal As String, ByVal Grain As String, ByVal Jacket As String, Optional ByRef Qty As Long = 0, Optional ByRef MID As Long = 0) + ' Dim bAns As Boolean = False + ' Try + ' Dim Obj As New BSDatabase + ' Obj.ConnectDB() + ' Dim SQL As String = "SELECT * from Loaders_Log_Ammunition where Manufacturer='" & _ + ' Manufacturer & "' and Name='" & Name & "' and Cal='" & Cal & _ + ' "' and Grain='" & Grain & "' and Jacket='" & Jacket & "'" + ' Dim CMD As New OdbcCommand(SQL, Obj.Conn) + ' Dim RS As OdbcDataReader + ' RS = CMD.ExecuteReader + ' bAns = RS.HasRows + ' While RS.Read + ' Qty = RS("qty") + ' MID = RS("ID") + ' End While + ' RS.Close() + ' RS = Nothing + ' CMD = Nothing + ' Obj.CloseDB() + ' Catch ex As Exception + ' 'Call LogError("IsAlreadyListed", Err.Number, ex.Message.ToString()) + ' Call LogError("LoadersClass.InventoryMath", "IsAlreadyListed", + ' Err.Number, ex.Message.ToString()) + ' End Try + ' Return bAns + 'End Function ''' ''' ''' ''' + Public Sub GetPowderDetails(ByVal PID As Long, Optional ByRef Manu As String = "", _ Optional ByRef sName As String = "", Optional ByVal weightlbs As Double = 0, _ Optional ByRef weightgn As Double = 0, Optional ByRef Price As Double = 0, _ diff --git a/BSMyLoadersLog/MDIParentMain.vb b/BSMyLoadersLog/MDIParentMain.vb index bbed475..98f5a73 100644 --- a/BSMyLoadersLog/MDIParentMain.vb +++ b/BSMyLoadersLog/MDIParentMain.vb @@ -1,6 +1,7 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc +'Imports BSMyLoadersLog.LoadersClass +'Imports System.Data.Odbc +'Imports System.Diagnostics.Eventing.Reader Imports System.IO Imports BurnSoft.MsgBox Imports BSMyLoadersLog.Adding @@ -8,19 +9,24 @@ Imports BurnSoft.Applications.MLL.Global Imports BurnSoft.Applications.MLL.PeopleAndPlaces Imports BurnSoft.Applications.MLL.Types Imports BSMyLoadersLog.Viewing +Imports BSMyLoadersLog.ViewReports +'Imports BurnSoft.Applications.MGC +Imports BurnSoft.Applications.MGC.LoadersLog +Imports BurnSoft.Applications.MLL.ConfigSheets Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.Inventory Imports BurnSoft.Universal ''' ''' Class MdiParentMain. -''' Implements the +''' Implements the ''' -''' +''' Public Class MdiParentMain ''' ''' The error out ''' - Private errOut as String + Private _errOut as String #Region "Form Subs" ''' ''' Handles the Disposed event of the MDIParentMain control. @@ -31,7 +37,7 @@ Public Class MdiParentMain Try If DoAutoBackup Then Dim myProcess As New Process - myProcess.StartInfo.FileName = Application.StartupPath & "\" & MyBackup + myProcess.StartInfo.FileName = Application.StartupPath & "\" & GeneralSettings.MY_BACKUP myProcess.StartInfo.Arguments = "/auto" myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal myProcess.Start() @@ -40,6 +46,28 @@ Public Class MdiParentMain Call LogError(Name, "Disposed", Err.Number, ex.Message.ToString) End Try End Sub + ''' + ''' Checks the login. + ''' + ''' + Private Sub CheckLogin() + Dim loginInfo as List(Of LoginInformationOnly) = OwnerInformation.LoginEnabled(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Dim requiredLogin as Boolean = False + For Each o As LoginInformationOnly In loginInfo + requiredLogin = o.UseLock + UseMyPwd = o.Password + UseMyUid = o.UserName + UseMyForgotWord = o.Forgot + UseMyForgotPhrase = o.ForgetPhrase + Next + + If requiredLogin And Not IsLoggedIn Then + frmLogin.Show() + Close() + End If + End Sub + ''' ''' Handles the Load event of the MDIParent2 control. ''' @@ -50,38 +78,39 @@ Public Class MdiParentMain Lastconfigedviewed = 0 'MyLogFile = Application.StartupPath & "\err.log" Call CheckforHotFix() + Call CheckLogin() 'If LoginEnabled(UseMyPWD, UseMyUID, UseMyForgotWord, UseMyForgotPhrase) And Not IsLoggedIN Then ' frmLogin.Show() ' Close() 'End If - Dim loginInfo as List(Of LoginInformationOnly) = OwnerInformation.LoginEnabled(DatabasePath, errOut) - If errOut.Length > 0 Then Throw New Exception(errOut) - Dim requiredLogin as Boolean = False - For Each o As LoginInformationOnly In loginInfo - requiredLogin = o.UseLock - UseMyPwd = o.Password - UseMyUid = o.UserName - UseMyForgotWord = o.Forgot - UseMyForgotPhrase = o.ForgetPhrase - Next + 'Dim loginInfo as List(Of LoginInformationOnly) = OwnerInformation.LoginEnabled(DatabasePath, errOut) + 'If errOut.Length > 0 Then Throw New Exception(errOut) + 'Dim requiredLogin as Boolean = False + 'For Each o As LoginInformationOnly In loginInfo + ' requiredLogin = o.UseLock + ' UseMyPwd = o.Password + ' UseMyUid = o.UserName + ' UseMyForgotWord = o.Forgot + ' UseMyForgotPhrase = o.ForgetPhrase + 'Next - If requiredLogin And Not IsLoggedIn Then - frmLogin.Show() - Close() - End If - Dim obj As New LoadersClass.BSRegistry + 'If requiredLogin And Not IsLoggedIn Then + ' frmLogin.Show() + ' Close() + 'End If + 'Dim obj As New LoadersClass.BSRegistry 'OwnerID = GetOwnerID() - OwnerId = OwnerInformation.GetOwnerID(DatabasePath, errOut) - If errOut.Length > 0 Then Throw New Exception(errOut) + OwnerId = OwnerInformation.GetOwnerID(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) 'Call obj.UpDateAppDetails() If Not MyRegistry.UpdateAppDetails(Application.ProductVersion, Application.ProductName, Application.ExecutablePath(), ApplicationPath, MyLogFile, DatabasePath, ApplicationPathData, - errOut) Then Throw New Exception(errOut) + _errOut) Then Throw New Exception(_errOut) - Dim regSettings As List(Of RegistrySettings) = MyRegistry.GetSettings(errOut) - If errOut.Length > 0 Then Throw New Exception(errOut) + Dim regSettings As List(Of RegistrySettings) = MyRegistry.GetSettings(_errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) For Each o As RegistrySettings In regSettings LastSucBackup = o.LastSucBackup AlertOnBackUp = o.AlertOnBackUp @@ -91,6 +120,8 @@ Public Class MdiParentMain DoOriginalImage = o.UseOrgImage UseIndividualReports = o.IndvReports cmbConfigSort.Text = o.ConfigSort + LoaderTypeShotGun = o.LoaderTypeShotGun + LoaderTypeMetalic = o.LoaderTypeMetalic Next 'Call obj.GetSettings(LastSucBackup, AlertOnBackUp, TrackHistoryDays, TrackHistory, DoAutoBackup, DoOriginalImage, @@ -104,34 +135,19 @@ Public Class MdiParentMain frmNew.MdiParent = Me frmNew.Show() End If - If Not UseShotgun Then - ToolStripButton6.Visible = False - WADListToolStripMenuItem.Visible = False - ShellListToolStripMenuItem.Visible = False - ShotListToolStripMenuItem.Visible = False - SlugListToolStripMenuItem.Visible = False - BushingsChargeBarToolStripMenuItem.Visible = False - WADInventoryToolStripMenuItem.Visible = False - ShellInventoryToolStripMenuItem.Visible = False - ShotInventoryToolStripMenuItem.Visible = False - SlugInventoryToolStripMenuItem.Visible = False - ShotgunsToolStripMenuItem.Visible = False - ShotgunGaugesToolStripMenuItem.Visible = False - ShotWeightToolStripMenuItem.Visible = False - - End If 'OwnerLoadName = Replace(GetLoadName(), "''", "'") - OwnerLoadName = Replace(OwnerInformation.GetLoadName(DatabasePath, errOut), "''", "'") - If OwnerLoadName <> "My Loaders Log" Then Text = OwnerLoadName & " Loaders Log" + OwnerLoadName = Replace(OwnerInformation.GetLoadName(DatabasePath, _errOut), "''", "'") + If OwnerLoadName <> "My Loaders Log" Then Text = $"{OwnerLoadName} Loaders Log" Call RefreshData() Call InitForm() Call InitLoaderType() Dim objFs As New FileIO - If objFs.FileExists(MyHotfixFile) Then ReRunHotfixUpdatesToolStripMenuItem.Enabled = True + If objFs.FileExists(GeneralSettings.MY_HOTFIX_FILE) Then ReRunHotfixUpdatesToolStripMenuItem.Enabled = True Catch ex As Exception Call LogError(Name, "Load", Err.Number, ex.Message.ToString) End Try End Sub + ''' ''' Handles the Resize event of the MDIParentMain control. ''' @@ -193,109 +209,164 @@ Public Class MdiParentMain If Lastconfigedviewed > 0 Then lstConfigSheets.SelectedValue = Lastconfigedviewed 'Dim objR As New BSRegistry 'objR.SaveConfigSort(selectedView) - If Not MyRegistry.SaveConfigSort(selectedView, errOut) Then Throw New Exception(errOut) + If Not MyRegistry.SaveConfigSort(selectedView, _errOut) Then Throw New Exception(_errOut) Catch ex As Exception Call LogError(Name, "RefreshConfigData", Err.Number, ex.Message.ToString) End Try End Sub + '''' + '''' Deinits the type of the loader. + '''' + 'Private Sub DeinitLoaderType() + ' BulletToolStripMenuItem.Visible = False + ' CaseToolStripMenuItem.Visible = False + ' WADToolStripMenuItem.Visible = False + ' ShellToolStripMenuItem.Visible = False + ' BulletToolStripMenuItem1.Visible = False + ' CaseToolStripMenuItem1.Visible = False + ' WADListToolStripMenuItem.Visible = False + ' ShellListToolStripMenuItem.Visible = False + ' ToolStripSeparator7.Visible = False + ' ToolStripSeparator10.Visible = False + ' ToolStripSeparator13.Visible = False + ' ToolStripSeparator14.Visible = False + ' ShotgunToolStripMenuItem.Visible = False + ' ShotgunToolStripMenuItem1.Visible = False + ' RiflePistolToolStripMenuItem.Visible = False + ' RiflePistolToolStripMenuItem1.Visible = False + ' WADInventoryToolStripMenuItem.Visible = False + ' ShellInventoryToolStripMenuItem.Visible = False + ' CaseBrassInventoryToolStripMenuItem.Visible = False + ' BulletInventoryToolStripMenuItem.Visible = False + ' ShotgunGaugesToolStripMenuItem.Visible = False + ' ShotWeightToolStripMenuItem.Visible = False + ' ShotgunsToolStripMenuItem.Visible = False + ' RifleAndPistolsToolStripMenuItem.Visible = False + ' ToolStripButton6.Visible = False + ' ToolStripButton5.Visible = False + ' SlugsToolStripMenuItem.Visible = False + ' ShotToolStripMenuItem.Visible = False + ' SlugListToolStripMenuItem.Visible = False + ' ShotListToolStripMenuItem.Visible = False + ' ShotInventoryToolStripMenuItem.Visible = False + ' SlugInventoryToolStripMenuItem.Visible = False + ' PowderBushingsToolStripMenuItem.Visible = False + ' BushingsChargeBarToolStripMenuItem.Visible = False + 'End Sub + '''' + '''' Initializes the reg values. + '''' + 'Private Sub InitRegValues() + ' 'Dim objr As New BSRegistry + ' 'Call objr.UpDateAppDetails() + ' Try + ' If Not MyRegistry.UpdateAppDetails(Application.ProductVersion, Application.ProductName, + ' Application.ExecutablePath(), ApplicationPath, + ' MyLogFile, DatabasePath, ApplicationPathData, + ' errOut) Then Throw New Exception(errOut) + ' Catch ex As Exception + ' Call LogError(Name, "InitRegValues", Err.Number, ex.Message.ToString) + ' End Try + 'End Sub + ''' + ''' Toggles the shotgun views visible or hidden + ''' + ''' if set to true [status]. + Sub ToggleShotgunViews(status As Boolean) + If LoaderTypeShotGun Then + ToolStripSeparator7.Visible = status + ToolStripSeparator14.Visible = status + WADToolStripMenuItem.Visible = status + ShellToolStripMenuItem.Visible = status + WADListToolStripMenuItem.Visible = status + ShellListToolStripMenuItem.Visible = status + ShotgunToolStripMenuItem.Visible = status + ShotgunToolStripMenuItem1.Visible = status + WADInventoryToolStripMenuItem.Visible = status + ShellInventoryToolStripMenuItem.Visible = status + ShotgunGaugesToolStripMenuItem.Visible = status + ShotWeightToolStripMenuItem.Visible = status + ShotgunsToolStripMenuItem.Visible = status + ToolStripButton6.Visible = status + SlugsToolStripMenuItem.Visible = status + ShotToolStripMenuItem.Visible = status + SlugListToolStripMenuItem.Visible = status + ShotListToolStripMenuItem.Visible = status + ShotInventoryToolStripMenuItem.Visible = status + SlugInventoryToolStripMenuItem.Visible = status + PowderBushingsToolStripMenuItem.Visible = status + BushingsChargeBarToolStripMenuItem.Visible = status + End If + End Sub ''' - ''' Deinits the type of the loader. - ''' - Private Sub DeinitLoaderType() - BulletToolStripMenuItem.Visible = False - CaseToolStripMenuItem.Visible = False - WADToolStripMenuItem.Visible = False - ShellToolStripMenuItem.Visible = False - BulletToolStripMenuItem1.Visible = False - CaseToolStripMenuItem1.Visible = False - WADListToolStripMenuItem.Visible = False - ShellListToolStripMenuItem.Visible = False - ToolStripSeparator7.Visible = False - ToolStripSeparator10.Visible = False - ToolStripSeparator13.Visible = False - ToolStripSeparator14.Visible = False - ShotgunToolStripMenuItem.Visible = False - ShotgunToolStripMenuItem1.Visible = False - RiflePistolToolStripMenuItem.Visible = False - RiflePistolToolStripMenuItem1.Visible = False - WADInventoryToolStripMenuItem.Visible = False - ShellInventoryToolStripMenuItem.Visible = False - CaseBrassInventoryToolStripMenuItem.Visible = False - BulletInventoryToolStripMenuItem.Visible = False - ShotgunGaugesToolStripMenuItem.Visible = False - ShotWeightToolStripMenuItem.Visible = False - ShotgunsToolStripMenuItem.Visible = False - RifleAndPistolsToolStripMenuItem.Visible = False - ToolStripButton6.Visible = False - ToolStripButton5.Visible = False - SlugsToolStripMenuItem.Visible = False - ShotToolStripMenuItem.Visible = False - SlugListToolStripMenuItem.Visible = False - ShotListToolStripMenuItem.Visible = False - ShotInventoryToolStripMenuItem.Visible = False - SlugInventoryToolStripMenuItem.Visible = False - PowderBushingsToolStripMenuItem.Visible = False - BushingsChargeBarToolStripMenuItem.Visible = False - End Sub - ''' - ''' Initializes the reg values. - ''' - Private Sub InitRegValues() - 'Dim objr As New BSRegistry - 'Call objr.UpDateAppDetails() - Try - If Not MyRegistry.UpdateAppDetails(Application.ProductVersion, Application.ProductName, - Application.ExecutablePath(), ApplicationPath, - MyLogFile, DatabasePath, ApplicationPathData, - errOut) Then Throw New Exception(errOut) - Catch ex As Exception - Call LogError(Name, "InitRegValues", Err.Number, ex.Message.ToString) - End Try + ''' Toggles the metalic views visible or hidden + ''' + ''' if set to true [status]. + Sub ToggleMetalicViews(status As Boolean) + If LoaderTypeMetalic Then + ToolStripSeparator13.Visible = status + ToolStripSeparator10.Visible = status + BulletToolStripMenuItem.Visible = status + CaseToolStripMenuItem.Visible = status + BulletToolStripMenuItem1.Visible = status + CaseToolStripMenuItem1.Visible = status + RiflePistolToolStripMenuItem.Visible = status + RiflePistolToolStripMenuItem1.Visible = status + CaseBrassInventoryToolStripMenuItem.Visible = status + BulletInventoryToolStripMenuItem.Visible = status + RifleAndPistolsToolStripMenuItem.Visible = status + ToolStripButton5.Visible = status + End If End Sub ''' ''' Initializes the type of the loader. ''' Public Sub InitLoaderType() Try - Call DeinitLoaderType() - If LoadertypeShotgun Then - ToolStripSeparator7.Visible = True - ToolStripSeparator14.Visible = True - WADToolStripMenuItem.Visible = True - ShellToolStripMenuItem.Visible = True - WADListToolStripMenuItem.Visible = True - ShellListToolStripMenuItem.Visible = True - ShotgunToolStripMenuItem.Visible = True - ShotgunToolStripMenuItem1.Visible = True - WADInventoryToolStripMenuItem.Visible = True - ShellInventoryToolStripMenuItem.Visible = True - ShotgunGaugesToolStripMenuItem.Visible = True - ShotWeightToolStripMenuItem.Visible = True - ShotgunsToolStripMenuItem.Visible = True - ToolStripButton6.Visible = True - SlugsToolStripMenuItem.Visible = True - ShotToolStripMenuItem.Visible = True - SlugListToolStripMenuItem.Visible = True - ShotListToolStripMenuItem.Visible = True - ShotInventoryToolStripMenuItem.Visible = True - SlugInventoryToolStripMenuItem.Visible = True - PowderBushingsToolStripMenuItem.Visible = True - BushingsChargeBarToolStripMenuItem.Visible = True - End If - If LoadertypeNonshotgun Then - ToolStripSeparator13.Visible = True - ToolStripSeparator10.Visible = True - BulletToolStripMenuItem.Visible = True - CaseToolStripMenuItem.Visible = True - BulletToolStripMenuItem1.Visible = True - CaseToolStripMenuItem1.Visible = True - RiflePistolToolStripMenuItem.Visible = True - RiflePistolToolStripMenuItem1.Visible = True - CaseBrassInventoryToolStripMenuItem.Visible = True - BulletInventoryToolStripMenuItem.Visible = True - RifleAndPistolsToolStripMenuItem.Visible = True - ToolStripButton5.Visible = True - End If + Call ToggleShotgunViews(False) + Call ToggleMetalicViews(False) + Call ToggleShotgunViews(True) + Call ToggleMetalicViews(True) + 'Call DeinitLoaderType() + + 'If LoaderTypeShotGun Then + ' ToolStripSeparator7.Visible = True + ' ToolStripSeparator14.Visible = True + ' WADToolStripMenuItem.Visible = True + ' ShellToolStripMenuItem.Visible = True + ' WADListToolStripMenuItem.Visible = True + ' ShellListToolStripMenuItem.Visible = True + ' ShotgunToolStripMenuItem.Visible = True + ' ShotgunToolStripMenuItem1.Visible = True + ' WADInventoryToolStripMenuItem.Visible = True + ' ShellInventoryToolStripMenuItem.Visible = True + ' ShotgunGaugesToolStripMenuItem.Visible = True + ' ShotWeightToolStripMenuItem.Visible = True + ' ShotgunsToolStripMenuItem.Visible = True + ' ToolStripButton6.Visible = True + ' SlugsToolStripMenuItem.Visible = True + ' ShotToolStripMenuItem.Visible = True + ' SlugListToolStripMenuItem.Visible = True + ' ShotListToolStripMenuItem.Visible = True + ' ShotInventoryToolStripMenuItem.Visible = True + ' SlugInventoryToolStripMenuItem.Visible = True + ' PowderBushingsToolStripMenuItem.Visible = True + ' BushingsChargeBarToolStripMenuItem.Visible = True + 'End If + 'If LoaderTypeMetalic Then + ' ToolStripSeparator13.Visible = True + ' ToolStripSeparator10.Visible = True + ' BulletToolStripMenuItem.Visible = True + ' CaseToolStripMenuItem.Visible = True + ' BulletToolStripMenuItem1.Visible = True + ' CaseToolStripMenuItem1.Visible = True + ' RiflePistolToolStripMenuItem.Visible = True + ' RiflePistolToolStripMenuItem1.Visible = True + ' CaseBrassInventoryToolStripMenuItem.Visible = True + ' BulletInventoryToolStripMenuItem.Visible = True + ' RifleAndPistolsToolStripMenuItem.Visible = True + ' ToolStripButton5.Visible = True + 'End If Catch ex As Exception Call LogError(Name, "InitLoaderType", Err.Number, ex.Message.ToString) End Try @@ -305,11 +376,12 @@ Public Class MdiParentMain ''' Sub InitForm() Try - Dim obj As New BSMGC - If obj.MyGunCollectionIsInstalled Then + 'Dim obj As New BSMGC + If RegistryHelpers.MyGunCollectionIsInstalled(_errOut) Then tsslMGCEnabled.Enabled = True tsslMGCEnabled.Visible = True - MgcPath = obj.GetMGCPath + MgcPath = RegistryHelpers.GetMgcExePath(_errOut) + if _errOut.Length > 0 Then Throw new Exception(_errOut) SaveAsToolStripMenuItem.Enabled = True ToolStripButton1.Enabled = True ExportFirearmsToMGCToolStripMenuItem.Enabled = True @@ -335,7 +407,7 @@ Public Class MdiParentMain Try DoAutoBackup = False Dim myProcess As New Process - myProcess.StartInfo.FileName = Application.StartupPath & "\" & MyBackup + myProcess.StartInfo.FileName = Application.StartupPath & "\" & GeneralSettings.MY_BACKUP myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal myProcess.Start() Close() @@ -350,7 +422,7 @@ Public Class MdiParentMain Try DoAutoBackup = False Dim myProcess As New Process - myProcess.StartInfo.FileName = Application.StartupPath & "\" & MyRestore + myProcess.StartInfo.FileName = Application.StartupPath & "\" & GeneralSettings.MY_RESTORE myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal myProcess.Start() Close() @@ -365,7 +437,7 @@ Public Class MdiParentMain Dim objf As New FileIO If objf.FileExists(Application.StartupPath & "\hotfix.ini") Then Dim myProcess As New Process - Dim runThiSApp As String = Application.StartupPath & "\" & MyHotfixFile + Dim runThiSApp As String = Application.StartupPath & "\" & GeneralSettings.MY_HOTFIX_FILE myProcess.StartInfo.FileName = runThiSApp myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal DoAutoBackup = False @@ -378,7 +450,7 @@ Public Class MdiParentMain ''' Sub DoHelp() Try - Help.ShowHelp(Me, MyHelpFile) + Help.ShowHelp(Me, GeneralSettings.MY_HELP_FILE) Catch ex As Exception Call LogError(Name, "DoHelp", Err.Number, ex.Message.ToString) End Try @@ -389,121 +461,113 @@ Public Class MdiParentMain ''' Sub CheckBackup() Try - Dim objR As New LoadersClass.BSRegistry + ' TODO: See if this is needed or was replaced. + 'Dim objR As New LoadersClass.BSRegistry If Not AlertOnBackUp Then Exit Sub Dim myLastDateDiff As Long = DateDiff(DateInterval.Day, CDate(LastSucBackup), DateTime.Now) Dim obj As New MsgClass - If myLastDateDiff > TrackHistoryDays Then obj.DoMessage("It has been " & myLastDateDiff & " days since your last backup.", MgboxStyle.Inf_OK, MgBtnStyle.mb_Exclamantion, "Last Backup Notice", , True, "Backup Warning", False) + If myLastDateDiff > TrackHistoryDays Then obj.DoMessage($"It has been {myLastDateDiff} days since your last backup.", + MgboxStyle.Inf_OK, MgBtnStyle.mb_Exclamantion, + "Last Backup Notice", , True, "Backup Warning", + False) Catch ex As Exception Call LogError(Name, "CheckBackup", Err.Number, ex.Message.ToString) End Try End Sub - ''' - ''' Copies the configuration details NSG. - ''' - ''' My identifier. - ''' The configuration identifier. - Private Sub CopyConfigDetailsNsg(ByVal myId As Long, ByVal configId As Long) - Try - Dim sql As String = "SELECT * from Config_List_Data_NSG where CLNID=" & configId - Dim obj As New BSDatabase - Call obj.ConnectDB() - Dim cmd As New OdbcCommand(sql, obj.Conn) - Dim rs As OdbcDataReader - rs = cmd.ExecuteReader - While rs.Read - sql = "INSERT INTO Config_List_Data_NSG (CLNID,ATID,CALID,BID,PRID,CAID,Source) VALUES(" & _ - myId & "," & rs("ATID") & "," & rs("CALID") & "," & rs("BID") & "," & rs("PRID") & "," & rs("CAID") & ",'" & _ - rs("Source") & "')" - obj.ConnExec(sql) - End While - rs.Close() - Catch ex As Exception - Call LogError(Name, "CopyConfigDetailsNSG", Err.Number, ex.Message.ToString) - End Try - End Sub - ''' - ''' Copies the configuration powders NSG. - ''' - ''' My identifier. - ''' The configuration identifier. - Private Sub CopyConfigPowdersNsg(ByVal myId As Long, ByVal configId As Long) - Try - Dim sql As String = "SELECT * from Config_List_Powder_Data_NSG where CLNID=" & configId - Dim obj As New BSDatabase - Call obj.ConnectDB() - Dim cmd As New OdbcCommand(sql, obj.Conn) - Dim rs As OdbcDataReader - rs = cmd.ExecuteReader - While rs.Read - sql = "INSERT INTO Config_List_Powder_Data_NSG (CLNID,PID,Load_Min,Load_Mid,Load_Max," & _ - "FPS_Min,FPS_MID,FPS_Max,CUPS_Min,CUPS_Mid,CUPS_Max,IsPref) VALUES(" & myId & _ - "," & rs("PID") & "," & rs("Load_Min") & "," & rs("Load_Mid") & "," & rs("Load_Max") & "," & _ - rs("FPS_Min") & "," & rs("FPS_MID") & "," & rs("FPS_Max") & "," & rs("CUPS_Min") & "," & _ - rs("CUPS_Mid") & "," & rs("CUPS_Max") & "," & rs("IsPref") & ")" - obj.ConnExec(sql) - End While - rs.Close() - Catch ex As Exception - Call LogError(Name, "CopyConfigPowdersNSG", Err.Number, ex.Message.ToString) - End Try - End Sub - ''' - ''' Copies the configuration details sg. - ''' - ''' My identifier. - ''' The configuration identifier. - Private Sub CopyConfigDetailsSg(ByVal myId As Long, ByVal configId As Long) - Try - Dim sql As String = "SELECT * from Config_List_Data_SG where CLNID=" & configId - Dim obj As New BSDatabase - Call obj.ConnectDB() - Dim cmd As New OdbcCommand(sql, obj.Conn) - Dim rs As OdbcDataReader - rs = cmd.ExecuteReader - While rs.Read - sql = "INSERT INTO Config_List_Data_SG (CLNID,ATID,CALID,PRID,CAID,Source,SW,SS,Bushing,WAD,SCL,SW_t,GID,IsPersonal) VALUES(" & _ - myId & "," & rs("ATID") & "," & rs("CALID") & "," & rs("PRID") & "," & rs("CAID") & ",'" & _ - rs("Source") & "'," & rs("SW") & "," & rs("SS") & "," & rs("Bushing") & "," & rs("WAD") & _ - "," & rs("SCL") & ",'" & rs("SW_t") & "'," & rs("GID") & "," & rs("IsPersonal") & ")" - obj.ConnExec(sql) - End While - rs.Close() - rs = Nothing - cmd = Nothing - Catch ex As Exception - Call LogError(Name, "CopyConfigDetailsSG", Err.Number, ex.Message.ToString) - End Try - End Sub - ''' - ''' Copies the configuration powders sg. - ''' - ''' My identifier. - ''' The configuration identifier. - Private Sub CopyConfigPowdersSg(ByVal myId As Long, ByVal configId As Long) - Try - Dim sql As String = "SELECT * from Config_List_Powder_Data_SG where CLNID=" & configId - Dim obj As New BSDatabase - Call obj.ConnectDB() - Dim cmd As New OdbcCommand(sql, obj.Conn) - Dim rs As OdbcDataReader - rs = cmd.ExecuteReader - While rs.Read - sql = "INSERT INTO Config_List_Powder_Data_SG (CLNID,PID,Load_Min,Load_Mid,Load_Max," & _ - "FPS_Min,FPS_MID,FPS_Max,PSI_Min,PSI_Mid,PSI_Max,IsPref) VALUES(" & myId & _ - "," & rs("PID") & "," & rs("Load_Min") & "," & rs("Load_Mid") & "," & rs("Load_Max") & "," & _ - rs("FPS_Min") & "," & rs("FPS_MID") & "," & rs("FPS_Max") & "," & rs("PSI_Min") & "," & _ - rs("PSI_Mid") & "," & rs("PSI_Max") & "," & rs("IsPref") & ")" - obj.ConnExec(sql) - End While - rs.Close() - rs = Nothing - cmd = Nothing - Catch ex As Exception - Call LogError(Name, "CopyConfigPowdersSG", Err.Number, ex.Message.ToString) - End Try - End Sub + ' + 'Private Sub CopyConfigDetailsNsg(ByVal myId As Long, ByVal configId As Long) + ' Try + ' Dim sql As String = "SELECT * from Config_List_Data_NSG where CLNID=" & configId + ' Dim obj As New BSDatabase + ' Call obj.ConnectDB() + ' Dim cmd As New OdbcCommand(sql, obj.Conn) + ' Dim rs As OdbcDataReader + ' rs = cmd.ExecuteReader + ' While rs.Read + ' sql = "INSERT INTO Config_List_Data_NSG (CLNID,ATID,CALID,BID,PRID,CAID,Source) VALUES(" & _ + ' myId & "," & rs("ATID") & "," & rs("CALID") & "," & rs("BID") & "," & rs("PRID") & "," & rs("CAID") & ",'" & _ + ' rs("Source") & "')" + ' obj.ConnExec(sql) + ' End While + ' rs.Close() + + ' Catch ex As Exception + ' Call LogError(Name, "CopyConfigDetailsNSG", Err.Number, ex.Message.ToString) + ' End Try + 'End Sub + + ' + 'Private Sub CopyConfigPowdersNsg(ByVal myId As Long, ByVal configId As Long) + ' Try + ' Dim sql As String = "SELECT * from Config_List_Powder_Data_NSG where CLNID=" & configId + ' Dim obj As New BSDatabase + ' Call obj.ConnectDB() + ' Dim cmd As New OdbcCommand(sql, obj.Conn) + ' Dim rs As OdbcDataReader + ' rs = cmd.ExecuteReader + ' While rs.Read + ' sql = "INSERT INTO Config_List_Powder_Data_NSG (CLNID,PID,Load_Min,Load_Mid,Load_Max," & _ + ' "FPS_Min,FPS_MID,FPS_Max,CUPS_Min,CUPS_Mid,CUPS_Max,IsPref) VALUES(" & myId & _ + ' "," & rs("PID") & "," & rs("Load_Min") & "," & rs("Load_Mid") & "," & rs("Load_Max") & "," & _ + ' rs("FPS_Min") & "," & rs("FPS_MID") & "," & rs("FPS_Max") & "," & rs("CUPS_Min") & "," & _ + ' rs("CUPS_Mid") & "," & rs("CUPS_Max") & "," & rs("IsPref") & ")" + ' obj.ConnExec(sql) + ' End While + ' rs.Close() + ' Catch ex As Exception + ' Call LogError(Name, "CopyConfigPowdersNSG", Err.Number, ex.Message.ToString) + ' End Try + 'End Sub + + ' + 'Private Sub CopyConfigDetailsSg(ByVal myId As Long, ByVal configId As Long) + ' Try + ' Dim sql As String = "SELECT * from Config_List_Data_SG where CLNID=" & configId + ' Dim obj As New BSDatabase + ' Call obj.ConnectDB() + ' Dim cmd As New OdbcCommand(sql, obj.Conn) + ' Dim rs As OdbcDataReader + ' rs = cmd.ExecuteReader + ' While rs.Read + ' sql = "INSERT INTO Config_List_Data_SG (CLNID,ATID,CALID,PRID,CAID,Source,SW,SS,Bushing,WAD,SCL,SW_t,GID,IsPersonal) VALUES(" & _ + ' myId & "," & rs("ATID") & "," & rs("CALID") & "," & rs("PRID") & "," & rs("CAID") & ",'" & _ + ' rs("Source") & "'," & rs("SW") & "," & rs("SS") & "," & rs("Bushing") & "," & rs("WAD") & _ + ' "," & rs("SCL") & ",'" & rs("SW_t") & "'," & rs("GID") & "," & rs("IsPersonal") & ")" + ' obj.ConnExec(sql) + ' End While + ' rs.Close() + ' rs = Nothing + ' cmd = Nothing + ' Catch ex As Exception + ' Call LogError(Name, "CopyConfigDetailsSG", Err.Number, ex.Message.ToString) + ' End Try + 'End Sub + + ' + 'Private Sub CopyConfigPowdersSg(ByVal myId As Long, ByVal configId As Long) + ' Try + ' Dim sql As String = "SELECT * from Config_List_Powder_Data_SG where CLNID=" & configId + ' Dim obj As New BSDatabase + ' Call obj.ConnectDB() + ' Dim cmd As New OdbcCommand(sql, obj.Conn) + ' Dim rs As OdbcDataReader + ' rs = cmd.ExecuteReader + ' While rs.Read + ' sql = "INSERT INTO Config_List_Powder_Data_SG (CLNID,PID,Load_Min,Load_Mid,Load_Max," & _ + ' "FPS_Min,FPS_MID,FPS_Max,PSI_Min,PSI_Mid,PSI_Max,IsPref) VALUES(" & myId & _ + ' "," & rs("PID") & "," & rs("Load_Min") & "," & rs("Load_Mid") & "," & rs("Load_Max") & "," & _ + ' rs("FPS_Min") & "," & rs("FPS_MID") & "," & rs("FPS_Max") & "," & rs("PSI_Min") & "," & _ + ' rs("PSI_Mid") & "," & rs("PSI_Max") & "," & rs("IsPref") & ")" + ' obj.ConnExec(sql) + ' End While + ' rs.Close() + ' rs = Nothing + ' cmd = Nothing + ' Catch ex As Exception + ' Call LogError(Name, "CopyConfigPowdersSG", Err.Number, ex.Message.ToString) + ' End Try + 'End Sub #End Region #Region "Tool Bar And Misc. Components Subs" ''' @@ -547,20 +611,22 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub btnAddConfig_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAddConfig.Click - frmConfig_Add_Wizard.MdiParent = Me - frmConfig_Add_Wizard.Show() + FrmConfigAddWizard.MdiParent = Me + FrmConfigAddWizard.Show() End Sub ''' ''' Views the configs. ''' Sub ViewConfigs() - Dim objGs As New GlobalFunctions + 'Dim objGs As New GlobalFunctions Dim lngConfigId As Long = lstConfigSheets.SelectedValue - Dim configType As Boolean = objGs.IsShotGunCOnfig(lngConfigId) + 'Dim configType As Boolean = objGs.IsShotGunCOnfig(lngConfigId) + Dim configType As Boolean = ConfigListGeneral.IsShotgunConfig(DatabasePath, lngConfigId, _errOut) + if _errOut.Length > 0 Then Throw New Exception(_errOut) If Not configType Then - Dim frmNew As New frmView_Configuration_Sheet - frmNew.ConfigID = lngConfigId + Dim frmNew As New FrmViewConfigurationSheet + frmNew.ConfigId = lngConfigId frmNew.MdiParent = Me frmNew.Show() Else @@ -587,8 +653,8 @@ Public Class MdiParentMain ''' The instance containing the event data. Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click Cursor = Cursors.WaitCursor - frmView_List_Firearms.MdiParent = Me - frmView_List_Firearms.Show() + FrmViewListFirearms.MdiParent = Me + FrmViewListFirearms.Show() Cursor = Cursors.Arrow End Sub ''' @@ -597,20 +663,26 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub lstCal_DoubleClick(ByVal sender As Object, ByVal e As EventArgs) Handles lstCal.DoubleClick - Dim objGf As New GlobalFunctions - Dim lngCalId As Long = lstCal.SelectedValue - Dim isNsg As Boolean = objGf.IsNotInShotgunConfigbyCal(lngCalId) - If isNsg Then - Dim frmNew As New frmView_List_ConfigurationsByCal - frmNew.CALID = lngCalId - frmNew.MdiParent = Me - frmNew.Show() - Else - Dim frmNewS As New frmView_List_ConfigurationsByCal_SG - frmNewS.CALID = lngCalId - frmNewS.MdiParent = Me - frmNewS.Show() - End If + Try + 'Dim objGf As New GlobalFunctions + Dim lngCalId As Long = lstCal.SelectedValue + 'Dim isNsg As Boolean = objGf.IsNotInShotgunConfigbyCal(lngCalId) + Dim isNsg As Boolean = ConfigListGeneral.IsNotInShotgunConfigByCaliber(DatabasePath, lngCalId, _errOut) + If _errOut.Length > 0 Then Throw new Exception(_errOut) + If isNsg Then + Dim frmNew As New FrmViewListConfigurationsByCal + frmNew.CaliberId = lngCalId + frmNew.MdiParent = Me + frmNew.Show() + Else + Dim frmNewS As New FrmViewListConfigurationsByCalSg + frmNewS.CaliberId = lngCalId + frmNewS.MdiParent = Me + frmNewS.Show() + End If + Catch ex As Exception + Call LogError(Name, "lstCal_DoubleClick", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the btnDelete control. @@ -619,19 +691,22 @@ Public Class MdiParentMain ''' The instance containing the event data. Private Sub btnDelete_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnDelete.Click Dim lngConfigId As Long = lstConfigSheets.SelectedValue - Dim obj As New BSDatabase - Dim objG As New GlobalFunctions - Dim strName As String = objG.GetName("SELECT * from Config_List_Name where ID=" & lngConfigId, "ConfigName") + 'Dim obj As New BSDatabase + 'Dim objG As New GlobalFunctions + 'Dim strName As String = objG.GetName("SELECT * from Config_List_Name where ID=" & lngConfigId, "ConfigName") + Dim strName As String = ConfigListDataName.GetName(DatabasePath, lngConfigId ,_errOut) + If _errOut.Length > 0 then Throw New Exception(_errOut) Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim sql As String = "DELETE from Config_List_Powder_Data_NSG where CLNID=" & lngConfigId + 'Dim sql As String = "DELETE from Config_List_Powder_Data_NSG where CLNID=" & lngConfigId If strAns = vbYes Then - obj.ConnExec(sql) - sql = "DELETE from Config_List_Data_NSG where CLNID=" & lngConfigId - obj.ConnExec(sql) - sql = "DELETE from Loaders_Log_Ammunition_Audit where CFID=" & lngConfigId - obj.ConnExec(sql) - sql = "DELETE from Config_List_Name where ID=" & lngConfigId - obj.ConnExec(sql) + if Not ConfigListDataName.Delete(DatabasePath, lngConfigId ,_errOut) then Throw New Exception(_errOut) + 'obj.ConnExec(sql) + 'sql = "DELETE from Config_List_Data_NSG where CLNID=" & lngConfigId + 'obj.ConnExec(sql) + 'sql = "DELETE from Loaders_Log_Ammunition_Audit where CFID=" & lngConfigId + 'obj.ConnExec(sql) + 'sql = "DELETE from Config_List_Name where ID=" & lngConfigId + 'obj.ConnExec(sql) Call RefreshConfigData() End If End Sub @@ -641,10 +716,14 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub tsslErrorsFound_Click(ByVal sender As Object, ByVal e As EventArgs) Handles tsslErrorsFound.Click - Dim myProcess As New Process - myProcess.StartInfo.FileName = MyLogFile - myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal - myProcess.Start() + Try + Dim myProcess As New Process + myProcess.StartInfo.FileName = MyLogFile + myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal + myProcess.Start() + Catch ex As Exception + Call LogError(Name, "tsslErrorsFound_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the tsslMGCEnabled control. @@ -652,12 +731,18 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub tsslMGCEnabled_Click(ByVal sender As Object, ByVal e As EventArgs) Handles tsslMGCEnabled.Click - Dim obj As New BSMGC - Dim strPath As String = obj.GetMGCEXEPath - Dim myProcess As New Process - myProcess.StartInfo.FileName = strPath - myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal - myProcess.Start() + Try + 'Dim obj As New BSMGC + 'Dim strPath As String = obj.GetMGCEXEPath + Dim strPath As String = RegistryHelpers.GetMgcExePath(_errOut) + if _errOut.Length > 0 then Throw new Exception(_errOut) + Dim myProcess As New Process + myProcess.StartInfo.FileName = strPath + myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal + myProcess.Start() + Catch ex As Exception + Call LogError(Name, "tsslMGCEnabled_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the ToolStripButton4 control. @@ -665,10 +750,15 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub ToolStripButton4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton4.Click - Cursor = Cursors.WaitCursor - frmView_Loaded_Ammunition.MdiParent = Me - frmView_Loaded_Ammunition.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + FrmViewLoadedAmmunition.MdiParent = Me + FrmViewLoadedAmmunition.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "tsslMGCEnabled_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the btnImportConfig control. @@ -676,8 +766,12 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub btnImportConfig_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnImportConfig.Click - frmImportConfiguration.MdiParent = Me - frmImportConfiguration.Show() + Try + frmImportConfiguration.MdiParent = Me + frmImportConfiguration.Show() + Catch ex As Exception + Call LogError(Name, "btnImportConfig_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the ToolStripButton5 control. @@ -685,10 +779,15 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub ToolStripButton5_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton5.Click - Cursor = Cursors.WaitCursor - frmSearchConfig_RiflePistol.MdiParent = Me - frmSearchConfig_RiflePistol.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + frmSearchConfig_RiflePistol.MdiParent = Me + frmSearchConfig_RiflePistol.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "ToolStripButton5_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the SelectedIndexChanged event of the cmbConfigSort control. @@ -791,8 +890,13 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub OptionsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles OptionsToolStripMenuItem.Click - FrmOptions.MdiParent = Me - FrmOptions.Show() + Try + FrmOptions.MdiParent = Me + FrmOptions.Show() + Catch ex As Exception + Call LogError(Name, "TechnicalSupportToolStripMenuItem_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the SaveToolStripMenuItem control. @@ -802,27 +906,32 @@ Public Class MdiParentMain Private Sub SaveToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles SaveToolStripMenuItem.Click Call DoBackup() End Sub - ''' - ''' Handles the Click event of the PurchaseToolStripMenuItem control. - ''' - ''' The source of the event. - ''' The instance containing the event data. - Private Sub PurchaseToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) - Dim myProcess As New Process - myProcess.StartInfo.FileName = MenuShop - myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized - myProcess.Start() - End Sub + '''' + '''' Handles the Click event of the PurchaseToolStripMenuItem control. + '''' + '''' The source of the event. + '''' The instance containing the event data. + 'Private Sub PurchaseToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) + ' Dim myProcess As New Process + ' myProcess.StartInfo.FileName = MenuShop + ' myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized + ' myProcess.Start() + 'End Sub ''' ''' Handles the Click event of the TechnicalSupportToolStripMenuItem control. ''' ''' The source of the event. ''' The instance containing the event data. Private Sub TechnicalSupportToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles TechnicalSupportToolStripMenuItem.Click - Dim myProcess As New Process - myProcess.StartInfo.FileName = MenuSupport - myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized - myProcess.Start() + Try + Dim myProcess As New Process + myProcess.StartInfo.FileName = GeneralSettings.MENU_SUPPORT + myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized + myProcess.Start() + Catch ex As Exception + Call LogError(Name, "TechnicalSupportToolStripMenuItem_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the ReportABugToolStripMenuItem control. @@ -830,10 +939,15 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub ReportABugToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ReportABugToolStripMenuItem.Click - Dim myProcess As New Process - myProcess.StartInfo.FileName = MenuBug - myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized - myProcess.Start() + Try + Dim myProcess As New Process + myProcess.StartInfo.FileName = GeneralSettings.MENU_BUG + myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized + myProcess.Start() + Catch ex As Exception + Call LogError(Name, "ReportABugToolStripMenuItem_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the KnowledgeBaseToolStripMenuItem control. @@ -841,10 +955,15 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub KnowledgeBaseToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles KnowledgeBaseToolStripMenuItem.Click - Dim myProcess As New Process - myProcess.StartInfo.FileName = MenuWiki - myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized - myProcess.Start() + Try + Dim myProcess As New Process + myProcess.StartInfo.FileName = GeneralSettings.MENU_WIKI + myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized + myProcess.Start() + Catch ex As Exception + Call LogError(Name, "KnowledgeBaseToolStripMenuItem_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the SearchToolStripMenuItem control. @@ -852,10 +971,15 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub SearchToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles SearchToolStripMenuItem.Click - Dim myProcess As New Process - myProcess.StartInfo.FileName = MenuSitesearch - myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized - myProcess.Start() + Try + Dim myProcess As New Process + myProcess.StartInfo.FileName = GeneralSettings.MENU_SITESEARCH + myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized + myProcess.Start() + Catch ex As Exception + Call LogError(Name, "SearchToolStripMenuItem_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the IndexToolStripMenuItem control. @@ -863,7 +987,12 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub IndexToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles IndexToolStripMenuItem.Click - Help.ShowHelpIndex(Me, MyHelpFile) + Try + Help.ShowHelpIndex(Me, GeneralSettings.MY_HELP_FILE) + Catch ex As Exception + Call LogError(Name, "IndexToolStripMenuItem_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the ContentsToolStripMenuItem control. @@ -879,8 +1008,13 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub PowderToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles PowderToolStripMenuItem.Click - frmAddPowder.MdiParent = Me - frmAddPowder.Show() + Try + frmAddPowder.MdiParent = Me + frmAddPowder.Show() + Catch ex As Exception + Call LogError(Name, "PowderToolStripMenuItem_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the PrimerToolStripMenuItem control. @@ -888,8 +1022,13 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub PrimerToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles PrimerToolStripMenuItem.Click - frmAddPrimer.MdiParent = Me - frmAddPrimer.Show() + Try + frmAddPrimer.MdiParent = Me + frmAddPrimer.Show() + Catch ex As Exception + Call LogError(Name, "PrimerToolStripMenuItem_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the BulletToolStripMenuItem control. @@ -897,8 +1036,13 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub BulletToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles BulletToolStripMenuItem.Click - FrmAddBullets.MdiParent = Me - FrmAddBullets.Show() + Try + FrmAddBullets.MdiParent = Me + FrmAddBullets.Show() + Catch ex As Exception + Call LogError(Name, "BulletToolStripMenuItem_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the CaseToolStripMenuItem control. @@ -906,8 +1050,13 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub CaseToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CaseToolStripMenuItem.Click - frmAddShells.MdiParent = Me - frmAddShells.Show() + Try + frmAddShells.MdiParent = Me + frmAddShells.Show() + Catch ex As Exception + Call LogError(Name, "CaseToolStripMenuItem_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the MyFirearmCollectionsToolStripMenuItem control. @@ -915,10 +1064,15 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub MyFirearmCollectionsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles MyFirearmCollectionsToolStripMenuItem.Click - Cursor = Cursors.WaitCursor - frmView_List_Firearms.MdiParent = Me - frmView_List_Firearms.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + FrmViewListFirearms.MdiParent = Me + FrmViewListFirearms.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Call LogError(Name, "MyFirearmCollectionsToolStripMenuItem_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the EquipmentToolStripMenuItem control. @@ -926,8 +1080,13 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub EquipmentToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EquipmentToolStripMenuItem.Click - frmAddEquipment.MdiParent = Me - frmAddEquipment.Show() + Try + frmAddEquipment.MdiParent = Me + frmAddEquipment.Show() + Catch ex As Exception + Call LogError(Name, "EquipmentToolStripMenuItem_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the AddFirearmToolStripMenuItem control. @@ -935,8 +1094,13 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub AddFirearmToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AddFirearmToolStripMenuItem.Click - frmAddFirearm.MdiParent = Me - frmAddFirearm.Show() + Try + frmAddFirearm.MdiParent = Me + frmAddFirearm.Show() + Catch ex As Exception + Call LogError(Name, "AddFirearmToolStripMenuItem_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the EquipmentToolStripMenuItem1 control. @@ -944,10 +1108,16 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub EquipmentToolStripMenuItem1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EquipmentToolStripMenuItem1.Click - Cursor = Cursors.WaitCursor - frmView_List_Equipment.MdiParent = Me - frmView_List_Equipment.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + FrmViewListEquipment.MdiParent = Me + FrmViewListEquipment.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "EquipmentToolStripMenuItem1_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the CaseToolStripMenuItem1 control. @@ -955,10 +1125,16 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub CaseToolStripMenuItem1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CaseToolStripMenuItem1.Click - Cursor = Cursors.WaitCursor - FrmViewListShells.MdiParent = Me - FrmViewListShells.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + FrmViewListShells.MdiParent = Me + FrmViewListShells.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "CaseToolStripMenuItem1_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the PrimerListToolStripMenuItem control. @@ -966,10 +1142,16 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub PrimerListToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles PrimerListToolStripMenuItem.Click - Cursor = Cursors.WaitCursor - frmView_List_Primer.MdiParent = Me - frmView_List_Primer.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + FrmViewListPrimer.MdiParent = Me + FrmViewListPrimer.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "PrimerListToolStripMenuItem_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the PowderListToolStripMenuItem control. @@ -977,10 +1159,16 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub PowderListToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles PowderListToolStripMenuItem.Click - Cursor = Cursors.WaitCursor - frmView_List_Powder.MdiParent = Me - frmView_List_Powder.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + FrmViewListPowder.MdiParent = Me + FrmViewListPowder.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "PowderListToolStripMenuItem_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the BulletToolStripMenuItem1 control. @@ -988,10 +1176,16 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub BulletToolStripMenuItem1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles BulletToolStripMenuItem1.Click - Cursor = Cursors.WaitCursor - frmView_List_Bullets.MdiParent = Me - frmView_List_Bullets.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + FrmViewListBullets.MdiParent = Me + FrmViewListBullets.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "BulletToolStripMenuItem1_Click", Err.Number, + ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the MakeReadyToUseAmmunitionToolStripMenuItem control. @@ -999,15 +1193,21 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub MakeReadyToUseAmmunitionToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles MakeReadyToUseAmmunitionToolStripMenuItem.Click - Dim configId As Long = lstConfigSheets.SelectedValue - Dim configName As String - Dim frmNew As New frmLoadMakeReady_Details - Dim objG As New GlobalFunctions - configName = objG.GetTitle(configId) - frmNew.ConfigID = configId - frmNew.ConfigName = configName - frmNew.MdiParent = Me - frmNew.Show() + Try + Dim configId As Long = lstConfigSheets.SelectedValue + Dim configName As String = GeneralFunctions.GetTitle(DatabasePath, configId, _errOut) + if _errOut.Length > 0 Then Throw new Exception(_errOut) + 'Dim objG As New GlobalFunctions + 'configName = objG.GetTitle(configId) + Dim frmNew As New FrmLoadMakeReadyDetails With { + .ConfigId = configId, + .ConfigName = configName, + .MdiParent = Me + } + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "MakeReadyToUseAmmunitionToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the DeleteToolStripMenuItem control. @@ -1015,31 +1215,41 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub DeleteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles DeleteToolStripMenuItem.Click - Dim lngConfigId As Long = lstConfigSheets.SelectedValue - Dim obj As New BSDatabase - Dim objG As New GlobalFunctions - Dim strName As String = objG.GetName("SELECT * from Config_List_Name where ID=" & lngConfigId, "ConfigName") - Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim isShotGun As Boolean = objG.IsShotGunCOnfig(lngConfigId) - Dim sql As String = "" - If strAns = vbYes Then - If Not isShotGun Then - sql = "DELETE from Config_List_Powder_Data_NSG where CLNID=" & lngConfigId - obj.ConnExec(sql) - sql = "DELETE from Config_List_Data_NSG where CLNID=" & lngConfigId - obj.ConnExec(sql) - sql = "DELETE from Config_List_Name where ID=" & lngConfigId - obj.ConnExec(sql) - Else - sql = "DELETE from Config_List_Powder_Data_SG where CLNID=" & lngConfigId - obj.ConnExec(sql) - sql = "DELETE from Config_List_Data_SG where CLNID=" & lngConfigId - obj.ConnExec(sql) - sql = "DELETE from Config_List_Name where ID=" & lngConfigId - obj.ConnExec(sql) + Try + Dim lngConfigId As Long = lstConfigSheets.SelectedValue + 'Dim obj As New BSDatabase + 'Dim objG As New GlobalFunctions + 'Dim strName As String = objG.GetName("SELECT * from Config_List_Name where ID=" & lngConfigId, "ConfigName") + Dim sql As String = $"SELECT * from Config_List_Name where ID={lngConfigId}" + Dim strName As String = BurnSoft.Applications.MLL.Database.GetName(DatabasePath, sql, "ConfigName", _errOut) + if _errOut.Length > 0 Then Throw New Exception(_errOut) + Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + 'Dim isShotGun As Boolean = objG.IsShotGunCOnfig(lngConfigId) + 'Dim isShotGun As Boolean = ConfigListGeneral.IsShotGunCOnfig(DatabasePath, lngConfigId, errOut) + if _errOut.Length > 0 Then Throw New Exception(_errOut) + 'Dim sql As String = "" + If strAns = vbYes Then + If Not ConfigListDataName.Delete(DatabasePath, lngConfigId, _errOut) Then Throw new Exception(_errOut) + 'If Not isShotGun Then + ' sql = "DELETE from Config_List_Powder_Data_NSG where CLNID=" & lngConfigId + ' obj.ConnExec(sql) + ' sql = "DELETE from Config_List_Data_NSG where CLNID=" & lngConfigId + ' obj.ConnExec(sql) + ' sql = "DELETE from Config_List_Name where ID=" & lngConfigId + ' obj.ConnExec(sql) + 'Else + ' sql = "DELETE from Config_List_Powder_Data_SG where CLNID=" & lngConfigId + ' obj.ConnExec(sql) + ' sql = "DELETE from Config_List_Data_SG where CLNID=" & lngConfigId + ' obj.ConnExec(sql) + ' sql = "DELETE from Config_List_Name where ID=" & lngConfigId + ' obj.ConnExec(sql) + 'End If + Call RefreshConfigData() End If - Call RefreshConfigData() - End If + Catch ex As Exception + Call LogError(Name, "DeleteToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the ToolStripMenuItem1 control. @@ -1047,18 +1257,23 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub ToolStripMenuItem1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripMenuItem1.Click - Dim configId As Long = lstConfigSheets.SelectedValue - Dim configName As String - Dim objG As New GlobalFunctions - configName = objG.GetTitle(configId) - Dim sMsg As String = "Renaming " & configName & " to:" - Dim strNewName As String = Trim(GeneralHelpers.FluffContent(InputBox(sMsg, "Rename Configuration Name", configName))) - If Len(strNewName) <> 0 And LCase(strNewName) <> LCase(configName) Then - Dim sql As String = "UPDATE Config_List_Name set ConfigName='" & strNewName & "' where id=" & configId - Dim obj As New BSDatabase - obj.ConnExec(sql) - Call RefreshConfigData() - End If + try + Dim configId As Long = lstConfigSheets.SelectedValue + Dim configName As String = GeneralFunctions.GetTitle(DatabasePath, configId, _errOut) + 'Dim objG As New GlobalFunctions + 'configName = objG.GetTitle(configId) + Dim sMsg As String = "Renaming " & configName & " to:" + Dim strNewName As String = Trim(GeneralHelpers.FluffContent(InputBox(sMsg, "Rename Configuration Name", configName))) + If Len(strNewName) <> 0 And LCase(strNewName) <> LCase(configName) Then + if Not ConfigListDataName.Rename(DatabasePath, configId, strNewName, _errOut) Then Throw new Exception(_errOut) + 'Dim sql As String = "UPDATE Config_List_Name set ConfigName='" & strNewName & "' where id=" & configId + 'Dim obj As New BSDatabase + 'obj.ConnExec(sql) + Call RefreshConfigData() + End If + Catch ex As Exception + Call LogError(Name, "ToolStripMenuItem1_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the ViewToolStripMenuItem control. @@ -1066,9 +1281,14 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub ViewToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ViewToolStripMenuItem.Click - Cursor = Cursors.WaitCursor - Call ViewConfigs() - Cursor = Cursors.Arrow + try + Cursor = Cursors.WaitCursor + Call ViewConfigs() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "ViewToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the CopyToolStripMenuItem control. @@ -1076,42 +1296,50 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub CopyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CopyToolStripMenuItem.Click - Dim configId As Long = lstConfigSheets.SelectedValue - Dim configName As String - Dim objG As New GlobalFunctions - configName = objG.GetTitle(configId) - Dim isShotGun As Boolean = False + Try + Dim configId As Long = lstConfigSheets.SelectedValue + Dim configName As String = GeneralFunctions.GetTitle(DatabasePath, configId, _errOut) + 'Dim objG As New GlobalFunctions + 'configName = objG.GetTitle(configId) + 'Dim isShotGun As Boolean = False Dim sMsg As String = "What do you wish to call this new configuration?" Dim strNewName As String = Trim(GeneralHelpers.FluffContent(InputBox(sMsg, "Copy Configuration", configName))) If Len(strNewName) <> 0 And LCase(strNewName) <> LCase(configName) Then - Dim sql As String = "SELECT * from Config_List_Name where ID=" & configId - Dim obj As New BSDatabase - Call obj.ConnectDB() - Dim cmd As New OdbcCommand(sql, obj.Conn) - Dim rs As OdbcDataReader - rs = cmd.ExecuteReader - While rs.Read() - If rs("IsShotGun") = 1 Then isShotGun = True - Dim strNotes As String = " " - If Not IsDBNull(rs("notes")) Then strNotes = GeneralHelpers.FluffContent(rs("Notes")) - sql = "INSERT INTO Config_List_Name(ConfigName,IsPersonal,IsShotGun,Notes,IsActive,IsFav) VALUES('" & _ - strNewName & "'," & rs("IsPersonal") & "," & rs("IsShotGun") & ",'" & _ - strNotes & "'," & rs("IsActive") & "," & rs("IsFav") & ")" - obj.ConnExec(sql) - End While - rs.Close() - rs = Nothing - cmd = Nothing - Dim myId As Long = objG.GetID("SELECT * from Config_list_Name where ConfigName='" & strNewName & "'") - If Not isShotGun Then - Call CopyConfigDetailsNsg(myId, configId) - Call CopyConfigPowdersNsg(myId, configId) - Else - Call CopyConfigDetailsSg(myId, configId) - Call CopyConfigPowdersSg(myId, configId) - End If + if Not ConfigListDataName.CopyConfig(DatabasePath, strNewName, configId, _errOut) Then Throw new Exception(_errOut) + + 'Dim sql As String = "SELECT * from Config_List_Name where ID=" & configId + 'Dim obj As New BSDatabase + 'Call obj.ConnectDB() + 'Dim cmd As New OdbcCommand(sql, obj.Conn) + 'Dim rs As OdbcDataReader + 'rs = cmd.ExecuteReader + 'While rs.Read() + ' If rs("IsShotGun") = 1 Then isShotGun = True + ' Dim strNotes As String = " " + ' If Not IsDBNull(rs("notes")) Then strNotes = GeneralHelpers.FluffContent(rs("Notes")) + ' sql = "INSERT INTO Config_List_Name(ConfigName,IsPersonal,IsShotGun,Notes,IsActive,IsFav) VALUES('" & _ + ' strNewName & "'," & rs("IsPersonal") & "," & rs("IsShotGun") & ",'" & _ + ' strNotes & "'," & rs("IsActive") & "," & rs("IsFav") & ")" + ' obj.ConnExec(sql) + 'End While + 'rs.Close() + 'rs = Nothing + 'cmd = Nothing + ''Dim myId As Long = objG.GetID("SELECT * from Config_list_Name where ConfigName='" & strNewName & "'") + 'Dim myId As Long = ConfigListDataName.GetId(DatabasePath, strNewName, errOut) + 'if errOut.Length > 0 then Throw New Exception(errOut) + 'If Not isShotGun Then + ' Call CopyConfigDetailsNsg(myId, configId) + ' Call CopyConfigPowdersNsg(myId, configId) + 'Else + ' Call CopyConfigDetailsSg(myId, configId) + ' Call CopyConfigPowdersSg(myId, configId) + 'End If Call RefreshConfigData() End If + Catch ex As Exception + Call LogError(Name, "CopyToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the EditToolStripMenuItem control. @@ -1119,15 +1347,20 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub EditToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EditToolStripMenuItem.Click - Dim frmNew As New frmEditConfig - Dim configId As Long = lstConfigSheets.SelectedValue - Dim configName As String - Dim objG As New GlobalFunctions - configName = objG.GetTitle(configId) - frmNew.ConfigID = configId - frmNew.ConfigName = configName - frmNew.MdiParent = Me - frmNew.Show() + Try + Dim frmNew As New frmEditConfig + Dim configId As Long = lstConfigSheets.SelectedValue + Dim configName As String + 'Dim objG As New GlobalFunctions + 'configName = objG.GetTitle(configId) + configName = GeneralFunctions.GetTitle(DatabasePath, configId, _errOut) + frmNew.ConfigID = configId + frmNew.ConfigName = configName + frmNew.MdiParent = Me + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "EditToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the UseConfigurationToolStripMenuItem control. @@ -1135,9 +1368,13 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub UseConfigurationToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles UseConfigurationToolStripMenuItem.Click - Dim frmNew As New FrmAddDataSheetRiflePistolsCfg - frmNew.MdiParent = Me - frmNew.Show() + Try + Dim frmNew As New FrmAddDataSheetRiflePistolsCfg + frmNew.MdiParent = Me + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "UseConfigurationToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the RiflePistolToolStripMenuItem1 control. @@ -1145,11 +1382,16 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub RiflePistolToolStripMenuItem1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles RiflePistolToolStripMenuItem1.Click - Cursor = Cursors.WaitCursor - Dim frmnew As New frmViewDataSheet_RiflePistols - frmnew.MdiParent = Me - frmnew.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + Dim frmnew As New FrmViewDataSheetRiflePistols + frmnew.MdiParent = Me + frmnew.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "RiflePistolToolStripMenuItem1_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the AmmunitionInventoryToolStripMenuItem control. @@ -1157,10 +1399,15 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub AmmunitionInventoryToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AmmunitionInventoryToolStripMenuItem.Click - Cursor = Cursors.WaitCursor - frmReport_Loaded_Ammunition.MdiParent = Me - frmReport_Loaded_Ammunition.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + frmReport_Loaded_Ammunition.MdiParent = Me + frmReport_Loaded_Ammunition.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "AmmunitionInventoryToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the EquipmentListToolStripMenuItem control. @@ -1168,10 +1415,15 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub EquipmentListToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EquipmentListToolStripMenuItem.Click - Cursor = Cursors.WaitCursor - frmReport_List_Equipment.MdiParent = Me - frmReport_List_Equipment.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + frmReport_List_Equipment.MdiParent = Me + frmReport_List_Equipment.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "EquipmentListToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the FirearmInventoryToolStripMenuItem control. @@ -1179,10 +1431,15 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub FirearmInventoryToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles FirearmInventoryToolStripMenuItem.Click - Cursor = Cursors.WaitCursor - frmReport_List_Firearms.MdiParent = Me - frmReport_List_Firearms.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + frmReport_List_Firearms.MdiParent = Me + frmReport_List_Firearms.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "FirearmInventoryToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the PowderInventoryToolStripMenuItem control. @@ -1190,10 +1447,15 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub PowderInventoryToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles PowderInventoryToolStripMenuItem.Click - Cursor = Cursors.WaitCursor - frmReport_PowderInventory.MdiParent = Me - frmReport_PowderInventory.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + frmReport_PowderInventory.MdiParent = Me + frmReport_PowderInventory.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "PowderInventoryToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the PrimerInventoryToolStripMenuItem control. @@ -1201,10 +1463,15 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub PrimerInventoryToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles PrimerInventoryToolStripMenuItem.Click - Cursor = Cursors.WaitCursor - frmReport_PrimerInventory.MdiParent = Me - frmReport_PrimerInventory.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + frmReport_PrimerInventory.MdiParent = Me + frmReport_PrimerInventory.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "PrimerInventoryToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the BulletInventoryToolStripMenuItem control. @@ -1212,10 +1479,15 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub BulletInventoryToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles BulletInventoryToolStripMenuItem.Click - Cursor = Cursors.WaitCursor - frmReport_BulletInventory.MdiParent = Me - frmReport_BulletInventory.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + FrmReportBulletInventory.MdiParent = Me + FrmReportBulletInventory.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "BulletInventoryToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the CaseBrassInventoryToolStripMenuItem control. @@ -1223,10 +1495,15 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub CaseBrassInventoryToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CaseBrassInventoryToolStripMenuItem.Click - Cursor = Cursors.WaitCursor - frmReport_CaseInventory.MdiParent = Me - frmReport_CaseInventory.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + FrmReportCaseInventory.MdiParent = Me + FrmReportCaseInventory.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "CaseBrassInventoryToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the CaliberReloadToolStripMenuItem control. @@ -1234,8 +1511,12 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub CaliberReloadToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CaliberReloadToolStripMenuItem.Click - FrmAddCaliberToCollection.MdiParent = Me - FrmAddCaliberToCollection.Show() + Try + FrmAddCaliberToCollection.MdiParent = Me + FrmAddCaliberToCollection.Show() + Catch ex As Exception + Call LogError(Name, "CaliberReloadToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the PreLoadedCaliberListToolStripMenuItem control. @@ -1243,10 +1524,15 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub PreLoadedCaliberListToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles PreLoadedCaliberListToolStripMenuItem.Click - Cursor = Cursors.WaitCursor - frmView_General_Calibers.MdiParent = Me - frmView_General_Calibers.Show() - Cursor = Cursors.Arrow + Try + Cursor = Cursors.WaitCursor + FrmViewGeneralCalibers.MdiParent = Me + FrmViewGeneralCalibers.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Cursor = Cursors.Arrow + Call LogError(Name, "PreLoadedCaliberListToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the PrimerTypeToolStripMenuItem control. @@ -1254,8 +1540,12 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub PrimerTypeToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles PrimerTypeToolStripMenuItem.Click - frmEdit_PrimerTypes.MdiParent = Me - frmEdit_PrimerTypes.Show() + Try + frmEdit_PrimerTypes.MdiParent = Me + frmEdit_PrimerTypes.Show() + Catch ex As Exception + Call LogError(Name, "PrimerTypeToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub ''' ''' Handles the Click event of the AmmunitionTypesToolStripMenuItem control. @@ -1291,7 +1581,7 @@ Public Class MdiParentMain ''' The instance containing the event data. Private Sub ShotgunToolStripMenuItem1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ShotgunToolStripMenuItem1.Click Cursor = Cursors.WaitCursor - Dim frmNew As New frmViewDataSheet_Shotgun + Dim frmNew As New FrmViewDataSheetShotgun frmNew.MdiParent = Me frmNew.Show() Cursor = Cursors.Arrow @@ -1341,8 +1631,8 @@ Public Class MdiParentMain ''' The instance containing the event data. Private Sub ShellListToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ShellListToolStripMenuItem.Click Cursor = Cursors.WaitCursor - frmView_List_ShellHulls.MdiParent = Me - frmView_List_ShellHulls.Show() + FrmViewListShellHulls.MdiParent = Me + FrmViewListShellHulls.Show() Cursor = Cursors.Arrow End Sub ''' @@ -1352,8 +1642,8 @@ Public Class MdiParentMain ''' The instance containing the event data. Private Sub WADListToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles WADListToolStripMenuItem.Click Cursor = Cursors.WaitCursor - frmView_List_WADS.MdiParent = Me - frmView_List_WADS.Show() + FrmViewListWads.MdiParent = Me + FrmViewListWads.Show() Cursor = Cursors.Arrow End Sub ''' @@ -1395,60 +1685,87 @@ Public Class MdiParentMain Private Sub DeleteCaliberToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles DeleteCaliberToolStripMenuItem.Click Try Dim lngCalId As Long = lstCal.SelectedValue - Dim obj As New BSDatabase - Dim objG As New GlobalFunctions - Dim strSqlTable As String = "List_Calibers" - Dim strName As String = objG.GetName("SELECT * from " & strSqlTable & " where ID=" & lngCalId, "Cal") - Dim cOnfigCount As Long = objG.TotalConfigByCal(lngCalId) - Dim strAns As String = "" - Dim sql As String = "" + 'Dim obj As New BSDatabase + 'Dim objG As New GlobalFunctions + 'Dim strSqlTable As String = "List_Calibers" + 'Dim strName As String = objG.GetName("SELECT * from " & strSqlTable & " where ID=" & lngCalId, "Cal") + 'Dim cOnfigCount As Long = objG.TotalConfigByCal(lngCalId) + Dim cOnfigCount As Long = CaliberInventory.TotalConfigurationUsedByCaliber(DatabasePath, lngCalId, _errOut) + if _errOut.Length > 0 Then Throw New Exception(_errOut) + Dim strName As String = CaliberInventory.GetName(DatabasePath, lngCalId, _errOut) + if _errOut.Length > 0 Then Throw New Exception(_errOut) + 'Dim cOnfigCount As Long = + Dim strAns As String + 'Dim sql As String = "" If cOnfigCount = 0 Then - strAns = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + strAns = MsgBox("Are you sure you want to delete " & strName & "?", + MsgBoxStyle.YesNo, "Delete Item from the Database.") Else - strAns = MsgBox("Are you sure you want to delete " & strName & " and the " & cOnfigCount & " configurations with it?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + strAns = MsgBox("Are you sure you want to delete " & strName & " and the " & + cOnfigCount & " configurations with it?", MsgBoxStyle.YesNo, + "Delete Item from the Database.") End If If strAns = vbYes Then + Cursor = Cursors.WaitCursor If cOnfigCount = 0 Then - Cursor = Cursors.WaitCursor - sql = "DELETE from " & strSqlTable & " where ID=" & lngCalId - obj.ConnExec(sql) - Cursor = Cursors.Arrow + 'Cursor = Cursors.WaitCursor + 'sql = "DELETE from " & strSqlTable & " where ID=" & lngCalId + 'obj.ConnExec(sql) + if not CaliberInventory.Delete(DatabasePath, lngCalId, _errOut) then throw new Exception(_errOut) + 'Cursor = Cursors.Arrow Else - sql = "Select ID,IsShotGun from qry_ConfigCal_NSG where CalID=" & lngCalId - If objG.IsShotGunCOnfig(lngCalId) Then sql = "Select ID,IsShotGun from qry_ConfigCal_SG where CalID=" & lngCalId - obj.ConnectDB() - Dim cmd As New OdbcCommand(sql, obj.Conn) - Dim rs As OdbcDataReader - rs = cmd.ExecuteReader - Dim configId As Long = 0 - Cursor = Cursors.WaitCursor - While rs.Read - configId = rs("CLNID") - If rs("IsShotGun") = 0 Then - sql = "DELETE from Loaders_Log_Ammunition_Audit where CFID=" & configId - obj.ConnExec(sql) - sql = "DELETE from Config_List_Powder_Data_NSG where CLNID=" & configId - obj.ConnExec(sql) - sql = "DELETE from Config_List_Data_NSG where CLNID=" & configId - obj.ConnExec(sql) - sql = "DELETE from Config_List_Name where ID=" & configId - obj.ConnExec(sql) - Else - sql = "DELETE from Loaders_Log_Ammunition_Audit where CFID=" & configId - obj.ConnExec(sql) - sql = "DELETE from Config_List_Powder_Data_SG where CLNID=" & configId - obj.ConnExec(sql) - sql = "DELETE from Config_List_Data_SG where CLNID=" & configId - obj.ConnExec(sql) - sql = "DELETE from Config_List_Name where ID=" & configId - obj.ConnExec(sql) - End If - End While - rs.Close() - rs = Nothing - cmd = Nothing - sql = "DELETE from " & strSqlTable & " where ID=" & lngCalId - obj.ConnExec(sql) + Dim lst as List(Of QueryConfigCaliberData) + Dim isShotgunConfig as Boolean = ConfigListGeneral.IsShotgunConfig(DatabasePath, lngCalId, _errOut) + if _errOut.Length > 0 Then Throw New Exception(_errOut) + if isShotgunConfig Then + lst = QueryConfigCaliberShotgun.GetDetailsByCaliberId(DatabasePath, lngCalId, _errOut) + if _errOut.Length > 0 Then Throw New Exception(_errOut) + Else + lst = QueryConfigCaliberMetallic.GetDetailsByCaliberId(DatabasePath, lngCalId, _errOut) + if _errOut.Length > 0 Then Throw New Exception(_errOut) + End If + + For Each o As QueryConfigCaliberData In lst + If Not ConfigListDataName.Delete(DatabasePath, o.Id, _errOut ) Then Throw New Exception(_errOut) + Next + + + 'sql = "Select ID,IsShotGun from qry_ConfigCal_NSG where CalID=" & lngCalId + 'If ConfigListGeneral.IsShotgunConfig(DatabasePath, lngCalId, errOut) Then sql = "Select ID,IsShotGun from qry_ConfigCal_SG where CalID=" & lngCalId + 'obj.ConnectDB() + 'Dim cmd As New OdbcCommand(sql, obj.Conn) + 'Dim rs As OdbcDataReader + 'rs = cmd.ExecuteReader + 'Dim configId As Long = 0 + 'Cursor = Cursors.WaitCursor + 'While rs.Read + ' configId = rs("CLNID") + ' If rs("IsShotGun") = 0 Then + ' sql = "DELETE from Loaders_Log_Ammunition_Audit where CFID=" & configId + ' obj.ConnExec(sql) + ' sql = "DELETE from Config_List_Powder_Data_NSG where CLNID=" & configId + ' obj.ConnExec(sql) + ' sql = "DELETE from Config_List_Data_NSG where CLNID=" & configId + ' obj.ConnExec(sql) + ' sql = "DELETE from Config_List_Name where ID=" & configId + ' obj.ConnExec(sql) + ' Else + ' sql = "DELETE from Loaders_Log_Ammunition_Audit where CFID=" & configId + ' obj.ConnExec(sql) + ' sql = "DELETE from Config_List_Powder_Data_SG where CLNID=" & configId + ' obj.ConnExec(sql) + ' sql = "DELETE from Config_List_Data_SG where CLNID=" & configId + ' obj.ConnExec(sql) + ' sql = "DELETE from Config_List_Name where ID=" & configId + ' obj.ConnExec(sql) + ' End If + 'End While + 'rs.Close() + 'rs = Nothing + 'cmd = Nothing + 'sql = "DELETE from " & strSqlTable & " where ID=" & lngCalId + 'obj.ConnExec(sql) + if not CaliberInventory.Delete(DatabasePath, lngCalId, _errOut) then throw new Exception(_errOut) Call RefreshCalData() Call RefreshConfigData() Cursor = Cursors.Arrow @@ -1485,8 +1802,8 @@ Public Class MdiParentMain ''' The instance containing the event data. Private Sub LoadedAmmunitionToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles LoadedAmmunitionToolStripMenuItem.Click Cursor = Cursors.WaitCursor - frmView_Loaded_Ammunition.MdiParent = Me - frmView_Loaded_Ammunition.Show() + FrmViewLoadedAmmunition.MdiParent = Me + FrmViewLoadedAmmunition.Show() Cursor = Cursors.Arrow End Sub ''' @@ -1497,7 +1814,7 @@ Public Class MdiParentMain Private Sub ReRunHotfixUpdatesToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ReRunHotfixUpdatesToolStripMenuItem.Click DoAutoBackup = False Dim myProcess As New Process - myProcess.StartInfo.FileName = MyHotfixFile + myProcess.StartInfo.FileName = GeneralSettings.MY_HOTFIX_FILE myProcess.StartInfo.Arguments = "/redo" myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal myProcess.Start() @@ -1540,8 +1857,8 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub ShotListToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ShotListToolStripMenuItem.Click - frmView_List_Shot.MdiParent = Me - frmView_List_Shot.Show() + FrmViewListShot.MdiParent = Me + FrmViewListShot.Show() End Sub ''' ''' Handles the Click event of the SlugListToolStripMenuItem control. @@ -1549,8 +1866,8 @@ Public Class MdiParentMain ''' The source of the event. ''' The instance containing the event data. Private Sub SlugListToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles SlugListToolStripMenuItem.Click - frmView_List_Slug.MdiParent = Me - frmView_List_Slug.Show() + FrmViewListSlug.MdiParent = Me + FrmViewListSlug.Show() End Sub ''' ''' Handles the Click event of the SlugInventoryToolStripMenuItem control. diff --git a/BSMyLoadersLog/MLL.ldb b/BSMyLoadersLog/MLL.ldb deleted file mode 100644 index 011d430..0000000 Binary files a/BSMyLoadersLog/MLL.ldb and /dev/null differ diff --git a/BSMyLoadersLog/MLL.mdb b/BSMyLoadersLog/MLL.mdb index e149382..67420ac 100644 Binary files a/BSMyLoadersLog/MLL.mdb and b/BSMyLoadersLog/MLL.mdb differ diff --git a/BSMyLoadersLog/MLLDataSet.Designer.vb b/BSMyLoadersLog/MLLDataSet.Designer.vb index 21264b2..aa1be51 100644 --- a/BSMyLoadersLog/MLLDataSet.Designer.vb +++ b/BSMyLoadersLog/MLLDataSet.Designer.vb @@ -16242,6 +16242,10 @@ Partial Public Class MLLDataSet Private columnPrice As Global.System.Data.DataColumn + Private columnounces As Global.System.Data.DataColumn + + Private columngrams As Global.System.Data.DataColumn + _ Public Sub New() @@ -16365,6 +16369,22 @@ Partial Public Class MLLDataSet End Get End Property + _ + Public ReadOnly Property ouncesColumn() As Global.System.Data.DataColumn + Get + Return Me.columnounces + End Get + End Property + + _ + Public ReadOnly Property gramsColumn() As Global.System.Data.DataColumn + Get + Return Me.columngrams + End Get + End Property + _ @@ -16402,9 +16422,9 @@ Partial Public Class MLLDataSet _ - Public Overloads Function AddList_SG_ShotType_DetailsRow(ByVal Manufacturer As String, ByVal Name As String, ByVal IsSlug As Integer, ByVal mat As String, ByVal ShotNo As String, ByVal weight As String, ByVal CAL As String, ByVal Qty As Integer, ByVal epps As Double, ByVal Price As Double) As List_SG_ShotType_DetailsRow + Public Overloads Function AddList_SG_ShotType_DetailsRow(ByVal Manufacturer As String, ByVal Name As String, ByVal IsSlug As Integer, ByVal mat As String, ByVal ShotNo As String, ByVal weight As String, ByVal CAL As String, ByVal Qty As Integer, ByVal epps As Double, ByVal Price As Double, ByVal ounces As Double, ByVal grams As Double) As List_SG_ShotType_DetailsRow Dim rowList_SG_ShotType_DetailsRow As List_SG_ShotType_DetailsRow = CType(Me.NewRow,List_SG_ShotType_DetailsRow) - Dim columnValuesArray() As Object = New Object() {Nothing, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price} + Dim columnValuesArray() As Object = New Object() {Nothing, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price, ounces, grams} rowList_SG_ShotType_DetailsRow.ItemArray = columnValuesArray Me.Rows.Add(rowList_SG_ShotType_DetailsRow) Return rowList_SG_ShotType_DetailsRow @@ -16444,6 +16464,8 @@ Partial Public Class MLLDataSet Me.columnQty = MyBase.Columns("Qty") Me.columnepps = MyBase.Columns("epps") Me.columnPrice = MyBase.Columns("Price") + Me.columnounces = MyBase.Columns("ounces") + Me.columngrams = MyBase.Columns("grams") End Sub _ + Public Property ounces() As Double + Get + Try + Return CType(Me(Me.tableList_SG_ShotType_Details.ouncesColumn),Double) + Catch e As Global.System.InvalidCastException + Throw New Global.System.Data.StrongTypingException("The value for column 'ounces' in table 'List_SG_ShotType_Details' is DBNull.", e) + End Try + End Get + Set + Me(Me.tableList_SG_ShotType_Details.ouncesColumn) = value + End Set + End Property + + _ + Public Property grams() As Double + Get + Try + Return CType(Me(Me.tableList_SG_ShotType_Details.gramsColumn),Double) + Catch e As Global.System.InvalidCastException + Throw New Global.System.Data.StrongTypingException("The value for column 'grams' in table 'List_SG_ShotType_Details' is DBNull.", e) + End Try + End Get + Set + Me(Me.tableList_SG_ShotType_Details.gramsColumn) = value + End Set + End Property + _ Public Function IsManufacturerNull() As Boolean @@ -27357,6 +27413,30 @@ Partial Public Class MLLDataSet Public Sub SetPriceNull() Me(Me.tableList_SG_ShotType_Details.PriceColumn) = Global.System.Convert.DBNull End Sub + + _ + Public Function IsouncesNull() As Boolean + Return Me.IsNull(Me.tableList_SG_ShotType_Details.ouncesColumn) + End Function + + _ + Public Sub SetouncesNull() + Me(Me.tableList_SG_ShotType_Details.ouncesColumn) = Global.System.Convert.DBNull + End Sub + + _ + Public Function IsgramsNull() As Boolean + Return Me.IsNull(Me.tableList_SG_ShotType_Details.gramsColumn) + End Function + + _ + Public Sub SetgramsNull() + Me(Me.tableList_SG_ShotType_Details.gramsColumn) = Global.System.Convert.DBNull + End Sub End Class ''' @@ -51043,6 +51123,8 @@ Namespace MLLDataSetTableAdapters tableMapping.ColumnMappings.Add("Qty", "Qty") tableMapping.ColumnMappings.Add("epps", "epps") tableMapping.ColumnMappings.Add("Price", "Price") + tableMapping.ColumnMappings.Add("ounces", "ounces") + tableMapping.ColumnMappings.Add("grams", "grams") Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.DeleteCommand.Connection = Me.Connection @@ -51053,7 +51135,8 @@ Namespace MLLDataSetTableAdapters ")) AND ((? = 1 AND `weight` IS NULL) OR (`weight` = ?)) AND ((? = 1 AND `CAL` IS"& _ " NULL) OR (`CAL` = ?)) AND ((? = 1 AND `Qty` IS NULL) OR (`Qty` = ?)) AND ((? = "& _ "1 AND `epps` IS NULL) OR (`epps` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Pri"& _ - "ce` = ?)))" + "ce` = ?)) AND ((? = 1 AND `ounces` IS NULL) OR (`ounces` = ?)) AND ((? = 1 AND `"& _ + "grams` IS NULL) OR (`grams` = ?)))" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_ID", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "ID", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Manufacturer", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Manufacturer", Global.System.Data.DataRowVersion.Original, true, Nothing)) @@ -51076,11 +51159,15 @@ Namespace MLLDataSetTableAdapters Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_epps", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "epps", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Price", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Price", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Price", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Price", Global.System.Data.DataRowVersion.Original, false, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_ounces", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "ounces", Global.System.Data.DataRowVersion.Original, true, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_ounces", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "ounces", Global.System.Data.DataRowVersion.Original, false, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_grams", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "grams", Global.System.Data.DataRowVersion.Original, true, Nothing)) + Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_grams", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "grams", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.InsertCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO `List_SG_ShotType_Details` (`Manufacturer`, `Name`, `IsSlug`, `mat`, "& _ - "`ShotNo`, `weight`, `CAL`, `Qty`, `epps`, `Price`) VALUES (?, ?, ?, ?, ?, ?, ?, "& _ - "?, ?, ?)" + "`ShotNo`, `weight`, `CAL`, `Qty`, `epps`, `Price`, `ounces`, `grams`) VALUES (?,"& _ + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Manufacturer", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Manufacturer", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Name", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Name", Global.System.Data.DataRowVersion.Current, false, Nothing)) @@ -51092,17 +51179,21 @@ Namespace MLLDataSetTableAdapters Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Qty", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Qty", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("epps", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "epps", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Price", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Price", Global.System.Data.DataRowVersion.Current, false, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("ounces", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "ounces", Global.System.Data.DataRowVersion.Current, false, Nothing)) + Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("grams", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "grams", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE `List_SG_ShotType_Details` SET `Manufacturer` = ?, `Name` = ?, `IsSlug` = "& _ "?, `mat` = ?, `ShotNo` = ?, `weight` = ?, `CAL` = ?, `Qty` = ?, `epps` = ?, `Pri"& _ - "ce` = ? WHERE ((`ID` = ?) AND ((? = 1 AND `Manufacturer` IS NULL) OR (`Manufactu"& _ - "rer` = ?)) AND ((? = 1 AND `Name` IS NULL) OR (`Name` = ?)) AND ((? = 1 AND `IsS"& _ - "lug` IS NULL) OR (`IsSlug` = ?)) AND ((? = 1 AND `mat` IS NULL) OR (`mat` = ?)) "& _ - "AND ((? = 1 AND `ShotNo` IS NULL) OR (`ShotNo` = ?)) AND ((? = 1 AND `weight` IS"& _ - " NULL) OR (`weight` = ?)) AND ((? = 1 AND `CAL` IS NULL) OR (`CAL` = ?)) AND ((?"& _ - " = 1 AND `Qty` IS NULL) OR (`Qty` = ?)) AND ((? = 1 AND `epps` IS NULL) OR (`epp"& _ - "s` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Price` = ?)))" + "ce` = ?, `ounces` = ?, `grams` = ? WHERE ((`ID` = ?) AND ((? = 1 AND `Manufactur"& _ + "er` IS NULL) OR (`Manufacturer` = ?)) AND ((? = 1 AND `Name` IS NULL) OR (`Name`"& _ + " = ?)) AND ((? = 1 AND `IsSlug` IS NULL) OR (`IsSlug` = ?)) AND ((? = 1 AND `mat"& _ + "` IS NULL) OR (`mat` = ?)) AND ((? = 1 AND `ShotNo` IS NULL) OR (`ShotNo` = ?)) "& _ + "AND ((? = 1 AND `weight` IS NULL) OR (`weight` = ?)) AND ((? = 1 AND `CAL` IS NU"& _ + "LL) OR (`CAL` = ?)) AND ((? = 1 AND `Qty` IS NULL) OR (`Qty` = ?)) AND ((? = 1 A"& _ + "ND `epps` IS NULL) OR (`epps` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Price`"& _ + " = ?)) AND ((? = 1 AND `ounces` IS NULL) OR (`ounces` = ?)) AND ((? = 1 AND `gra"& _ + "ms` IS NULL) OR (`grams` = ?)))" Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Manufacturer", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Manufacturer", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Name", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Name", Global.System.Data.DataRowVersion.Current, false, Nothing)) @@ -51114,6 +51205,8 @@ Namespace MLLDataSetTableAdapters Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Qty", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Qty", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("epps", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "epps", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Price", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Price", Global.System.Data.DataRowVersion.Current, false, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("ounces", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "ounces", Global.System.Data.DataRowVersion.Current, false, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("grams", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "grams", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_ID", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "ID", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Manufacturer", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Manufacturer", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Manufacturer", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Manufacturer", Global.System.Data.DataRowVersion.Original, false, Nothing)) @@ -51135,6 +51228,10 @@ Namespace MLLDataSetTableAdapters Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_epps", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "epps", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Price", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Price", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Price", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Price", Global.System.Data.DataRowVersion.Original, false, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_ounces", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "ounces", Global.System.Data.DataRowVersion.Original, true, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_ounces", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "ounces", Global.System.Data.DataRowVersion.Original, false, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_grams", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "grams", Global.System.Data.DataRowVersion.Original, true, Nothing)) + Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_grams", Global.System.Data.OleDb.OleDbType.[Double], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "grams", Global.System.Data.DataRowVersion.Original, false, Nothing)) End Sub 0 and Price > 0 o"& _ - "rder by Manufacturer,Name ASC" + Me._commandCollection(8).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weigh"& _ + "t) > 0) AND (Price > 0) ORDER BY Manufacturer, Name" Me._commandCollection(8).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(9) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(9).Connection = Me.Connection - Me._commandCollection(9).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)>0 and Price > 0 o"& _ - "rder by Material ASC" + Me._commandCollection(9).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weigh"& _ + "t) > 0) AND (Price > 0) ORDER BY Material" Me._commandCollection(9).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(10) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(10).Connection = Me.Connection - Me._commandCollection(10).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)>0 and Price > 0 o"& _ - "rder by Price ASC" + Me._commandCollection(10).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weigh"& _ + "t) > 0) AND (Price > 0) ORDER BY Price" Me._commandCollection(10).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(11) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(11).Connection = Me.Connection - Me._commandCollection(11).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)>0 and Price > 0 o"& _ - "rder by ShotNo ASC" + Me._commandCollection(11).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weigh"& _ + "t) > 0) AND (Price > 0) ORDER BY ShotNo" Me._commandCollection(11).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(12) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(12).Connection = Me.Connection - Me._commandCollection(12).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)>0 and Price > 0 o"& _ - "rder by weight ASC" + Me._commandCollection(12).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weigh"& _ + "t) > 0) AND (Price > 0) ORDER BY weight" Me._commandCollection(12).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(13) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(13).Connection = Me.Connection - Me._commandCollection(13).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)=0 and Price > 0 o"& _ - "rder by Manufacturer,Name ASC" + Me._commandCollection(13).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weigh"& _ + "t) = 0) AND (Price > 0) ORDER BY Manufacturer, Name" Me._commandCollection(13).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(14) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(14).Connection = Me.Connection - Me._commandCollection(14).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)=0 and Price > 0 o"& _ - "rder by mat ASC" + Me._commandCollection(14).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weigh"& _ + "t) = 0) AND (Price > 0) ORDER BY mat" Me._commandCollection(14).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(15) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(15).Connection = Me.Connection - Me._commandCollection(15).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)=0 and Price > 0 o"& _ - "rder by Price ASC" + Me._commandCollection(15).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weigh"& _ + "t) = 0) AND (Price > 0) ORDER BY Price" Me._commandCollection(15).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(16) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(16).Connection = Me.Connection - Me._commandCollection(16).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)=0 and Price > 0 o"& _ - "rder by ShotNo ASC" + Me._commandCollection(16).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weigh"& _ + "t) = 0) AND (Price > 0) ORDER BY ShotNo" Me._commandCollection(16).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(17) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(17).Connection = Me.Connection - Me._commandCollection(17).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)=0 and Price = 0 o"& _ - "rder by Manufacturer,Name ASC" + Me._commandCollection(17).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weigh"& _ + "t) = 0) AND (Price = 0) ORDER BY Manufacturer, Name" Me._commandCollection(17).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(18) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(18).Connection = Me.Connection - Me._commandCollection(18).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 order by Manufacturer, Name ASC" + Me._commandCollection(18).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) ORDER BY Manufa"& _ + "cturer, Name" Me._commandCollection(18).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(19) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(19).Connection = Me.Connection - Me._commandCollection(19).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 order by CAL ASC" + Me._commandCollection(19).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) ORDER BY CAL" Me._commandCollection(19).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(20) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(20).Connection = Me.Connection - Me._commandCollection(20).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 order by Price ASC" + Me._commandCollection(20).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) ORDER BY Price" Me._commandCollection(20).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(21) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(21).Connection = Me.Connection - Me._commandCollection(21).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 order by Qty ASC" + Me._commandCollection(21).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) ORDER BY Qty" Me._commandCollection(21).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(22) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(22).Connection = Me.Connection - Me._commandCollection(22).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 order by weight ASC" + Me._commandCollection(22).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) ORDER BY weight"& _ + "" Me._commandCollection(22).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(23) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(23).Connection = Me.Connection - Me._commandCollection(23).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 and Qty>0 and Price > 0 order by C"& _ - "AL ASC" + Me._commandCollection(23).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty > 0) A"& _ + "ND (Price > 0) ORDER BY CAL" Me._commandCollection(23).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(24) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(24).Connection = Me.Connection - Me._commandCollection(24).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 and Qty>0 and Price > 0 order by M"& _ - "anufacturer,Name ASC" + Me._commandCollection(24).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty > 0) A"& _ + "ND (Price > 0) ORDER BY Manufacturer, Name" Me._commandCollection(24).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(25) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(25).Connection = Me.Connection - Me._commandCollection(25).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 and Qty>0 and Price > 0 order by P"& _ - "rice ASC" + Me._commandCollection(25).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty > 0) A"& _ + "ND (Price > 0) ORDER BY Price" Me._commandCollection(25).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(26) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(26).Connection = Me.Connection - Me._commandCollection(26).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 and Qty>0 and Price > 0 order by Q"& _ - "ty ASC" + Me._commandCollection(26).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty > 0) A"& _ + "ND (Price > 0) ORDER BY Qty" Me._commandCollection(26).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(27) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(27).Connection = Me.Connection - Me._commandCollection(27).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 and Qty>0 and Price > 0 order by W"& _ - "eight ASC" + Me._commandCollection(27).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty > 0) A"& _ + "ND (Price > 0) ORDER BY weight" Me._commandCollection(27).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(28) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(28).Connection = Me.Connection - Me._commandCollection(28).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price > 0 order by C"& _ - "AL ASC" + Me._commandCollection(28).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) A"& _ + "ND (Price > 0) ORDER BY CAL" Me._commandCollection(28).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(29) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(29).Connection = Me.Connection - Me._commandCollection(29).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price > 0 order by M"& _ - "anufacturer, Name ASC" + Me._commandCollection(29).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) A"& _ + "ND (Price > 0) ORDER BY Manufacturer, Name" Me._commandCollection(29).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(30) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(30).Connection = Me.Connection - Me._commandCollection(30).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price > 0 order by P"& _ - "rice ASC" + Me._commandCollection(30).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) A"& _ + "ND (Price > 0) ORDER BY Price" Me._commandCollection(30).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(31) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(31).Connection = Me.Connection - Me._commandCollection(31).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price > 0 order by Q"& _ - "ty ASC" + Me._commandCollection(31).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) A"& _ + "ND (Price > 0) ORDER BY Qty" Me._commandCollection(31).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(32) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(32).Connection = Me.Connection - Me._commandCollection(32).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price > 0 order by w"& _ - "eight ASC" + Me._commandCollection(32).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) A"& _ + "ND (Price > 0) ORDER BY weight" Me._commandCollection(32).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(33) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(33).Connection = Me.Connection - Me._commandCollection(33).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price = 0 order by C"& _ - "AL ASC" + Me._commandCollection(33).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) A"& _ + "ND (Price = 0) ORDER BY CAL" Me._commandCollection(33).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(34) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(34).Connection = Me.Connection - Me._commandCollection(34).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price = 0 order by M"& _ - "anufacturer,Name ASC" + Me._commandCollection(34).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) A"& _ + "ND (Price = 0) ORDER BY Manufacturer, Name" Me._commandCollection(34).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(35) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(35).Connection = Me.Connection - Me._commandCollection(35).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price = 0 order by Q"& _ - "ty ASC" + Me._commandCollection(35).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) A"& _ + "ND (Price = 0) ORDER BY Qty" Me._commandCollection(35).CommandType = Global.System.Data.CommandType.Text Me._commandCollection(36) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(36).Connection = Me.Connection - Me._commandCollection(36).CommandText = "SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price"& _ - " FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price = 0 order by w"& _ - "eight ASC" + Me._commandCollection(36).CommandText = "SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat,"& _ + " ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) A"& _ + "ND (Price = 0) ORDER BY weight" Me._commandCollection(36).CommandType = Global.System.Data.CommandType.Text End Sub @@ -51415,7 +51518,7 @@ Namespace MLLDataSetTableAdapters Public Overloads Overridable Function FillBy_CFG_List_Slug(ByVal dataTable As MLLDataSet.List_SG_ShotType_DetailsDataTable, ByVal __CAL As String) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(2) If (__CAL Is Nothing) Then - Throw New Global.System.ArgumentNullException("__CAL") + Me.Adapter.SelectCommand.Parameters(0).Value = Global.System.DBNull.Value Else Me.Adapter.SelectCommand.Parameters(0).Value = CType(__CAL,String) End If @@ -51433,7 +51536,7 @@ Namespace MLLDataSetTableAdapters Public Overloads Overridable Function GetDataBy_CFG_List_Slug(ByVal __CAL As String) As MLLDataSet.List_SG_ShotType_DetailsDataTable Me.Adapter.SelectCommand = Me.CommandCollection(2) If (__CAL Is Nothing) Then - Throw New Global.System.ArgumentNullException("__CAL") + Me.Adapter.SelectCommand.Parameters(0).Value = Global.System.DBNull.Value Else Me.Adapter.SelectCommand.Parameters(0).Value = CType(__CAL,String) End If @@ -52290,7 +52393,7 @@ Namespace MLLDataSetTableAdapters Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Delete, true)> _ - Public Overloads Overridable Function Delete(ByVal Original_ID As Integer, ByVal Original_Manufacturer As String, ByVal Original_Name As String, ByVal Original_IsSlug As Global.System.Nullable(Of Integer), ByVal Original_mat As String, ByVal Original_ShotNo As String, ByVal Original_weight As String, ByVal Original_CAL As String, ByVal Original_Qty As Global.System.Nullable(Of Integer), ByVal Original_epps As Global.System.Nullable(Of Double), ByVal Original_Price As Global.System.Nullable(Of Double)) As Integer + Public Overloads Overridable Function Delete(ByVal Original_ID As Integer, ByVal Original_Manufacturer As String, ByVal Original_Name As String, ByVal Original_IsSlug As Global.System.Nullable(Of Integer), ByVal Original_mat As String, ByVal Original_ShotNo As String, ByVal Original_weight As String, ByVal Original_CAL As String, ByVal Original_Qty As Global.System.Nullable(Of Integer), ByVal Original_epps As Global.System.Nullable(Of Double), ByVal Original_Price As Global.System.Nullable(Of Double), ByVal Original_ounces As Global.System.Nullable(Of Double), ByVal Original_grams As Global.System.Nullable(Of Double)) As Integer Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_ID,Integer) If (Original_Manufacturer Is Nothing) Then Me.Adapter.DeleteCommand.Parameters(1).Value = CType(1,Object) @@ -52362,6 +52465,20 @@ Namespace MLLDataSetTableAdapters Me.Adapter.DeleteCommand.Parameters(19).Value = CType(1,Object) Me.Adapter.DeleteCommand.Parameters(20).Value = Global.System.DBNull.Value End If + If (Original_ounces.HasValue = true) Then + Me.Adapter.DeleteCommand.Parameters(21).Value = CType(0,Object) + Me.Adapter.DeleteCommand.Parameters(22).Value = CType(Original_ounces.Value,Double) + Else + Me.Adapter.DeleteCommand.Parameters(21).Value = CType(1,Object) + Me.Adapter.DeleteCommand.Parameters(22).Value = Global.System.DBNull.Value + End If + If (Original_grams.HasValue = true) Then + Me.Adapter.DeleteCommand.Parameters(23).Value = CType(0,Object) + Me.Adapter.DeleteCommand.Parameters(24).Value = CType(Original_grams.Value,Double) + Else + Me.Adapter.DeleteCommand.Parameters(23).Value = CType(1,Object) + Me.Adapter.DeleteCommand.Parameters(24).Value = Global.System.DBNull.Value + End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then @@ -52381,7 +52498,7 @@ Namespace MLLDataSetTableAdapters Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Insert, true)> _ - Public Overloads Overridable Function Insert(ByVal Manufacturer As String, ByVal Name As String, ByVal IsSlug As Global.System.Nullable(Of Integer), ByVal mat As String, ByVal ShotNo As String, ByVal weight As String, ByVal CAL As String, ByVal Qty As Global.System.Nullable(Of Integer), ByVal epps As Global.System.Nullable(Of Double), ByVal Price As Global.System.Nullable(Of Double)) As Integer + Public Overloads Overridable Function Insert(ByVal Manufacturer As String, ByVal Name As String, ByVal IsSlug As Global.System.Nullable(Of Integer), ByVal mat As String, ByVal ShotNo As String, ByVal weight As String, ByVal CAL As String, ByVal Qty As Global.System.Nullable(Of Integer), ByVal epps As Global.System.Nullable(Of Double), ByVal Price As Global.System.Nullable(Of Double), ByVal ounces As Global.System.Nullable(Of Double), ByVal grams As Global.System.Nullable(Of Double)) As Integer If (Manufacturer Is Nothing) Then Me.Adapter.InsertCommand.Parameters(0).Value = Global.System.DBNull.Value Else @@ -52432,6 +52549,16 @@ Namespace MLLDataSetTableAdapters Else Me.Adapter.InsertCommand.Parameters(9).Value = Global.System.DBNull.Value End If + If (ounces.HasValue = true) Then + Me.Adapter.InsertCommand.Parameters(10).Value = CType(ounces.Value,Double) + Else + Me.Adapter.InsertCommand.Parameters(10).Value = Global.System.DBNull.Value + End If + If (grams.HasValue = true) Then + Me.Adapter.InsertCommand.Parameters(11).Value = CType(grams.Value,Double) + Else + Me.Adapter.InsertCommand.Parameters(11).Value = Global.System.DBNull.Value + End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then @@ -52462,6 +52589,8 @@ Namespace MLLDataSetTableAdapters ByVal Qty As Global.System.Nullable(Of Integer), _ ByVal epps As Global.System.Nullable(Of Double), _ ByVal Price As Global.System.Nullable(Of Double), _ + ByVal ounces As Global.System.Nullable(Of Double), _ + ByVal grams As Global.System.Nullable(Of Double), _ ByVal Original_ID As Integer, _ ByVal Original_Manufacturer As String, _ ByVal Original_Name As String, _ @@ -52472,7 +52601,9 @@ Namespace MLLDataSetTableAdapters ByVal Original_CAL As String, _ ByVal Original_Qty As Global.System.Nullable(Of Integer), _ ByVal Original_epps As Global.System.Nullable(Of Double), _ - ByVal Original_Price As Global.System.Nullable(Of Double)) As Integer + ByVal Original_Price As Global.System.Nullable(Of Double), _ + ByVal Original_ounces As Global.System.Nullable(Of Double), _ + ByVal Original_grams As Global.System.Nullable(Of Double)) As Integer If (Manufacturer Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(0).Value = Global.System.DBNull.Value Else @@ -52523,77 +52654,101 @@ Namespace MLLDataSetTableAdapters Else Me.Adapter.UpdateCommand.Parameters(9).Value = Global.System.DBNull.Value End If - Me.Adapter.UpdateCommand.Parameters(10).Value = CType(Original_ID,Integer) - If (Original_Manufacturer Is Nothing) Then - Me.Adapter.UpdateCommand.Parameters(11).Value = CType(1,Object) - Me.Adapter.UpdateCommand.Parameters(12).Value = Global.System.DBNull.Value + If (ounces.HasValue = true) Then + Me.Adapter.UpdateCommand.Parameters(10).Value = CType(ounces.Value,Double) Else - Me.Adapter.UpdateCommand.Parameters(11).Value = CType(0,Object) - Me.Adapter.UpdateCommand.Parameters(12).Value = CType(Original_Manufacturer,String) + Me.Adapter.UpdateCommand.Parameters(10).Value = Global.System.DBNull.Value End If - If (Original_Name Is Nothing) Then + If (grams.HasValue = true) Then + Me.Adapter.UpdateCommand.Parameters(11).Value = CType(grams.Value,Double) + Else + Me.Adapter.UpdateCommand.Parameters(11).Value = Global.System.DBNull.Value + End If + Me.Adapter.UpdateCommand.Parameters(12).Value = CType(Original_ID,Integer) + If (Original_Manufacturer Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(13).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(14).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(13).Value = CType(0,Object) - Me.Adapter.UpdateCommand.Parameters(14).Value = CType(Original_Name,String) + Me.Adapter.UpdateCommand.Parameters(14).Value = CType(Original_Manufacturer,String) End If - If (Original_IsSlug.HasValue = true) Then - Me.Adapter.UpdateCommand.Parameters(15).Value = CType(0,Object) - Me.Adapter.UpdateCommand.Parameters(16).Value = CType(Original_IsSlug.Value,Integer) - Else + If (Original_Name Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(15).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(16).Value = Global.System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(15).Value = CType(0,Object) + Me.Adapter.UpdateCommand.Parameters(16).Value = CType(Original_Name,String) End If - If (Original_mat Is Nothing) Then + If (Original_IsSlug.HasValue = true) Then + Me.Adapter.UpdateCommand.Parameters(17).Value = CType(0,Object) + Me.Adapter.UpdateCommand.Parameters(18).Value = CType(Original_IsSlug.Value,Integer) + Else Me.Adapter.UpdateCommand.Parameters(17).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(18).Value = Global.System.DBNull.Value - Else - Me.Adapter.UpdateCommand.Parameters(17).Value = CType(0,Object) - Me.Adapter.UpdateCommand.Parameters(18).Value = CType(Original_mat,String) End If - If (Original_ShotNo Is Nothing) Then + If (Original_mat Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(19).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(20).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(19).Value = CType(0,Object) - Me.Adapter.UpdateCommand.Parameters(20).Value = CType(Original_ShotNo,String) + Me.Adapter.UpdateCommand.Parameters(20).Value = CType(Original_mat,String) End If - If (Original_weight Is Nothing) Then + If (Original_ShotNo Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(21).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(22).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(21).Value = CType(0,Object) - Me.Adapter.UpdateCommand.Parameters(22).Value = CType(Original_weight,String) + Me.Adapter.UpdateCommand.Parameters(22).Value = CType(Original_ShotNo,String) End If - If (Original_CAL Is Nothing) Then + If (Original_weight Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(23).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(24).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(23).Value = CType(0,Object) - Me.Adapter.UpdateCommand.Parameters(24).Value = CType(Original_CAL,String) + Me.Adapter.UpdateCommand.Parameters(24).Value = CType(Original_weight,String) End If - If (Original_Qty.HasValue = true) Then - Me.Adapter.UpdateCommand.Parameters(25).Value = CType(0,Object) - Me.Adapter.UpdateCommand.Parameters(26).Value = CType(Original_Qty.Value,Integer) - Else + If (Original_CAL Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(25).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(26).Value = Global.System.DBNull.Value + Else + Me.Adapter.UpdateCommand.Parameters(25).Value = CType(0,Object) + Me.Adapter.UpdateCommand.Parameters(26).Value = CType(Original_CAL,String) End If - If (Original_epps.HasValue = true) Then + If (Original_Qty.HasValue = true) Then Me.Adapter.UpdateCommand.Parameters(27).Value = CType(0,Object) - Me.Adapter.UpdateCommand.Parameters(28).Value = CType(Original_epps.Value,Double) + Me.Adapter.UpdateCommand.Parameters(28).Value = CType(Original_Qty.Value,Integer) Else Me.Adapter.UpdateCommand.Parameters(27).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(28).Value = Global.System.DBNull.Value End If - If (Original_Price.HasValue = true) Then + If (Original_epps.HasValue = true) Then Me.Adapter.UpdateCommand.Parameters(29).Value = CType(0,Object) - Me.Adapter.UpdateCommand.Parameters(30).Value = CType(Original_Price.Value,Double) + Me.Adapter.UpdateCommand.Parameters(30).Value = CType(Original_epps.Value,Double) Else Me.Adapter.UpdateCommand.Parameters(29).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(30).Value = Global.System.DBNull.Value End If + If (Original_Price.HasValue = true) Then + Me.Adapter.UpdateCommand.Parameters(31).Value = CType(0,Object) + Me.Adapter.UpdateCommand.Parameters(32).Value = CType(Original_Price.Value,Double) + Else + Me.Adapter.UpdateCommand.Parameters(31).Value = CType(1,Object) + Me.Adapter.UpdateCommand.Parameters(32).Value = Global.System.DBNull.Value + End If + If (Original_ounces.HasValue = true) Then + Me.Adapter.UpdateCommand.Parameters(33).Value = CType(0,Object) + Me.Adapter.UpdateCommand.Parameters(34).Value = CType(Original_ounces.Value,Double) + Else + Me.Adapter.UpdateCommand.Parameters(33).Value = CType(1,Object) + Me.Adapter.UpdateCommand.Parameters(34).Value = Global.System.DBNull.Value + End If + If (Original_grams.HasValue = true) Then + Me.Adapter.UpdateCommand.Parameters(35).Value = CType(0,Object) + Me.Adapter.UpdateCommand.Parameters(36).Value = CType(Original_grams.Value,Double) + Else + Me.Adapter.UpdateCommand.Parameters(35).Value = CType(1,Object) + Me.Adapter.UpdateCommand.Parameters(36).Value = Global.System.DBNull.Value + End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then diff --git a/BSMyLoadersLog/MLLDataSet.vb b/BSMyLoadersLog/MLLDataSet.vb index 042b662..2acbddc 100644 --- a/BSMyLoadersLog/MLLDataSet.vb +++ b/BSMyLoadersLog/MLLDataSet.vb @@ -1,4 +1,11 @@ Partial Class MLLDataSet + Partial Public Class Loaders_Log_FirearmsDataTable + Private Sub Loaders_Log_FirearmsDataTable_Loaders_Log_FirearmsRowChanging(sender As Object, e As BSMyLoadersLog.MLLDataSet.Loaders_Log_FirearmsRowChangeEvent) Handles Me.Loaders_Log_FirearmsRowChanging + + End Sub + + End Class + Partial Class ConfigList_Simple_SGDataTable Private Sub ConfigList_Simple_SGDataTable_ConfigList_Simple_SGRowChanging(ByVal sender As System.Object, ByVal e As ConfigList_Simple_SGRowChangeEvent) Handles Me.ConfigList_Simple_SGRowChanging @@ -35,3 +42,5 @@ End Class End Class + + diff --git a/BSMyLoadersLog/MLLDataSet.xsd b/BSMyLoadersLog/MLLDataSet.xsd index d87cc47..ac304a0 100644 --- a/BSMyLoadersLog/MLLDataSet.xsd +++ b/BSMyLoadersLog/MLLDataSet.xsd @@ -4327,7 +4327,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - DELETE FROM `List_SG_ShotType_Details` WHERE ((`ID` = ?) AND ((? = 1 AND `Manufacturer` IS NULL) OR (`Manufacturer` = ?)) AND ((? = 1 AND `Name` IS NULL) OR (`Name` = ?)) AND ((? = 1 AND `IsSlug` IS NULL) OR (`IsSlug` = ?)) AND ((? = 1 AND `mat` IS NULL) OR (`mat` = ?)) AND ((? = 1 AND `ShotNo` IS NULL) OR (`ShotNo` = ?)) AND ((? = 1 AND `weight` IS NULL) OR (`weight` = ?)) AND ((? = 1 AND `CAL` IS NULL) OR (`CAL` = ?)) AND ((? = 1 AND `Qty` IS NULL) OR (`Qty` = ?)) AND ((? = 1 AND `epps` IS NULL) OR (`epps` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Price` = ?))) + DELETE FROM `List_SG_ShotType_Details` WHERE ((`ID` = ?) AND ((? = 1 AND `Manufacturer` IS NULL) OR (`Manufacturer` = ?)) AND ((? = 1 AND `Name` IS NULL) OR (`Name` = ?)) AND ((? = 1 AND `IsSlug` IS NULL) OR (`IsSlug` = ?)) AND ((? = 1 AND `mat` IS NULL) OR (`mat` = ?)) AND ((? = 1 AND `ShotNo` IS NULL) OR (`ShotNo` = ?)) AND ((? = 1 AND `weight` IS NULL) OR (`weight` = ?)) AND ((? = 1 AND `CAL` IS NULL) OR (`CAL` = ?)) AND ((? = 1 AND `Qty` IS NULL) OR (`Qty` = ?)) AND ((? = 1 AND `epps` IS NULL) OR (`epps` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Price` = ?)) AND ((? = 1 AND `ounces` IS NULL) OR (`ounces` = ?)) AND ((? = 1 AND `grams` IS NULL) OR (`grams` = ?))) @@ -4350,12 +4350,16 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC + + + + - INSERT INTO `List_SG_ShotType_Details` (`Manufacturer`, `Name`, `IsSlug`, `mat`, `ShotNo`, `weight`, `CAL`, `Qty`, `epps`, `Price`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + INSERT INTO `List_SG_ShotType_Details` (`Manufacturer`, `Name`, `IsSlug`, `mat`, `ShotNo`, `weight`, `CAL`, `Qty`, `epps`, `Price`, `ounces`, `grams`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) @@ -4367,18 +4371,20 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC + + - - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details + + SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price, ounces, grams FROM List_SG_ShotType_Details - UPDATE `List_SG_ShotType_Details` SET `Manufacturer` = ?, `Name` = ?, `IsSlug` = ?, `mat` = ?, `ShotNo` = ?, `weight` = ?, `CAL` = ?, `Qty` = ?, `epps` = ?, `Price` = ? WHERE ((`ID` = ?) AND ((? = 1 AND `Manufacturer` IS NULL) OR (`Manufacturer` = ?)) AND ((? = 1 AND `Name` IS NULL) OR (`Name` = ?)) AND ((? = 1 AND `IsSlug` IS NULL) OR (`IsSlug` = ?)) AND ((? = 1 AND `mat` IS NULL) OR (`mat` = ?)) AND ((? = 1 AND `ShotNo` IS NULL) OR (`ShotNo` = ?)) AND ((? = 1 AND `weight` IS NULL) OR (`weight` = ?)) AND ((? = 1 AND `CAL` IS NULL) OR (`CAL` = ?)) AND ((? = 1 AND `Qty` IS NULL) OR (`Qty` = ?)) AND ((? = 1 AND `epps` IS NULL) OR (`epps` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Price` = ?))) + UPDATE `List_SG_ShotType_Details` SET `Manufacturer` = ?, `Name` = ?, `IsSlug` = ?, `mat` = ?, `ShotNo` = ?, `weight` = ?, `CAL` = ?, `Qty` = ?, `epps` = ?, `Price` = ?, `ounces` = ?, `grams` = ? WHERE ((`ID` = ?) AND ((? = 1 AND `Manufacturer` IS NULL) OR (`Manufacturer` = ?)) AND ((? = 1 AND `Name` IS NULL) OR (`Name` = ?)) AND ((? = 1 AND `IsSlug` IS NULL) OR (`IsSlug` = ?)) AND ((? = 1 AND `mat` IS NULL) OR (`mat` = ?)) AND ((? = 1 AND `ShotNo` IS NULL) OR (`ShotNo` = ?)) AND ((? = 1 AND `weight` IS NULL) OR (`weight` = ?)) AND ((? = 1 AND `CAL` IS NULL) OR (`CAL` = ?)) AND ((? = 1 AND `Qty` IS NULL) OR (`Qty` = ?)) AND ((? = 1 AND `epps` IS NULL) OR (`epps` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Price` = ?)) AND ((? = 1 AND `ounces` IS NULL) OR (`ounces` = ?)) AND ((? = 1 AND `grams` IS NULL) OR (`grams` = ?))) @@ -4390,6 +4396,8 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC + + @@ -4411,6 +4419,10 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC + + + + @@ -4428,12 +4440,14 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC + + - SELECT ID, Cstr(Name & " #" & ShotNo & " (" & mat & ")") as Name FROM List_SG_ShotType_Details where IsSlug=0 order by Manufacturer, Name ASC + SELECT CAL, ID, IsSlug, Manufacturer, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) ORDER BY Manufacturer, Name @@ -4443,7 +4457,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC SELECT ID, Cstr(Name & " (" & weight & ")") as Name FROM List_SG_ShotType_Details where IsSlug=1 and Cal=@CAL order by Manufacturer, Name ASC - + @@ -4451,7 +4465,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=0 order by Manufacturer, Name ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) ORDER BY Manufacturer, Name @@ -4459,7 +4473,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=0 order by mat ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) ORDER BY mat @@ -4467,7 +4481,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=0 order by Price ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) ORDER BY Price @@ -4475,7 +4489,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=0 order by ShotNo ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) ORDER BY ShotNo @@ -4483,7 +4497,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=0 order by weight ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) ORDER BY weight @@ -4491,7 +4505,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)>0 and Price > 0 order by Manufacturer,Name ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weight) > 0) AND (Price > 0) ORDER BY Manufacturer, Name @@ -4499,7 +4513,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)>0 and Price > 0 order by Material ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weight) > 0) AND (Price > 0) ORDER BY Material @@ -4507,7 +4521,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)>0 and Price > 0 order by Price ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weight) > 0) AND (Price > 0) ORDER BY Price @@ -4515,7 +4529,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)>0 and Price > 0 order by ShotNo ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weight) > 0) AND (Price > 0) ORDER BY ShotNo @@ -4523,7 +4537,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)>0 and Price > 0 order by weight ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weight) > 0) AND (Price > 0) ORDER BY weight @@ -4531,7 +4545,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)=0 and Price > 0 order by Manufacturer,Name ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weight) = 0) AND (Price > 0) ORDER BY Manufacturer, Name @@ -4539,7 +4553,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)=0 and Price > 0 order by mat ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weight) = 0) AND (Price > 0) ORDER BY mat @@ -4547,7 +4561,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)=0 and Price > 0 order by Price ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weight) = 0) AND (Price > 0) ORDER BY Price @@ -4555,7 +4569,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)=0 and Price > 0 order by ShotNo ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weight) = 0) AND (Price > 0) ORDER BY ShotNo @@ -4563,7 +4577,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=0 and cdbl(weight)=0 and Price = 0 order by Manufacturer,Name ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 0) AND (cdbl(weight) = 0) AND (Price = 0) ORDER BY Manufacturer, Name @@ -4571,7 +4585,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 order by Manufacturer, Name ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) ORDER BY Manufacturer, Name @@ -4579,7 +4593,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 order by CAL ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) ORDER BY CAL @@ -4587,7 +4601,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 order by Price ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) ORDER BY Price @@ -4595,7 +4609,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 order by Qty ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) ORDER BY Qty @@ -4603,7 +4617,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 order by weight ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) ORDER BY weight @@ -4611,7 +4625,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 and Qty>0 and Price > 0 order by CAL ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty > 0) AND (Price > 0) ORDER BY CAL @@ -4619,7 +4633,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 and Qty>0 and Price > 0 order by Manufacturer,Name ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty > 0) AND (Price > 0) ORDER BY Manufacturer, Name @@ -4627,7 +4641,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 and Qty>0 and Price > 0 order by Price ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty > 0) AND (Price > 0) ORDER BY Price @@ -4635,7 +4649,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 and Qty>0 and Price > 0 order by Qty ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty > 0) AND (Price > 0) ORDER BY Qty @@ -4643,7 +4657,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 and Qty>0 and Price > 0 order by Weight ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty > 0) AND (Price > 0) ORDER BY weight @@ -4651,7 +4665,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price > 0 order by CAL ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) AND (Price > 0) ORDER BY CAL @@ -4659,7 +4673,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price > 0 order by Manufacturer, Name ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) AND (Price > 0) ORDER BY Manufacturer, Name @@ -4667,7 +4681,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price > 0 order by Price ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) AND (Price > 0) ORDER BY Price @@ -4675,7 +4689,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price > 0 order by Qty ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) AND (Price > 0) ORDER BY Qty @@ -4683,7 +4697,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price > 0 order by weight ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) AND (Price > 0) ORDER BY weight @@ -4691,7 +4705,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price = 0 order by CAL ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) AND (Price = 0) ORDER BY CAL @@ -4699,7 +4713,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price = 0 order by Manufacturer,Name ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) AND (Price = 0) ORDER BY Manufacturer, Name @@ -4707,7 +4721,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price = 0 order by Qty ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) AND (Price = 0) ORDER BY Qty @@ -4715,7 +4729,7 @@ FROM List_SG_Case where Qty=0 and Price=0 order by Manufacturer,Name ASC - SELECT ID, Manufacturer, Name, IsSlug, mat, ShotNo, weight, CAL, Qty, epps, Price FROM List_SG_ShotType_Details where IsSlug=1 and Qty=0 and Price = 0 order by weight ASC + SELECT CAL, ID, IsSlug, Manufacturer, Name, Price, Qty, ShotNo, epps, grams, mat, ounces, weight FROM List_SG_ShotType_Details WHERE (IsSlug = 1) AND (Qty = 0) AND (Price = 0) ORDER BY weight @@ -6517,6 +6531,8 @@ where Config_List_Data_SG.ATID=@CID and Config_List_Name.IsPersonal = 1 order by + + diff --git a/BSMyLoadersLog/My Project/AssemblyInfo.vb b/BSMyLoadersLog/My Project/AssemblyInfo.vb index a7dff08..6b8436f 100644 --- a/BSMyLoadersLog/My Project/AssemblyInfo.vb +++ b/BSMyLoadersLog/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + diff --git a/BSMyLoadersLog/ViewReports/frmReport_BulletInventory.Designer.vb b/BSMyLoadersLog/ViewReports/frmReport_BulletInventory.Designer.vb index 3106f0e..131fe37 100644 --- a/BSMyLoadersLog/ViewReports/frmReport_BulletInventory.Designer.vb +++ b/BSMyLoadersLog/ViewReports/frmReport_BulletInventory.Designer.vb @@ -1,124 +1,126 @@ - _ -Partial Class frmReport_BulletInventory - Inherits System.Windows.Forms.Form +Namespace ViewReports + _ + Partial Class FrmReportBulletInventory + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmReport_BulletInventory)) - Me.List_Bullets_DetailsBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.ToolStrip1 = New System.Windows.Forms.ToolStrip - Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel - Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox - Me.ReportViewer1 = New Microsoft.Reporting.WinForms.ReportViewer - Me.List_Bullets_DetailsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_Bullets_DetailsTableAdapter - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - CType(Me.List_Bullets_DetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.ToolStrip1.SuspendLayout() - Me.SuspendLayout() - ' - 'List_Bullets_DetailsBindingSource - ' - Me.List_Bullets_DetailsBindingSource.DataMember = "List_Bullets_Details" - Me.List_Bullets_DetailsBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'ToolStrip1 - ' - Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel1, Me.ToolStripComboBox1}) - Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) - Me.ToolStrip1.Name = "ToolStrip1" - Me.ToolStrip1.Size = New System.Drawing.Size(609, 25) - Me.ToolStrip1.TabIndex = 0 - Me.ToolStrip1.Text = "ToolStrip1" - ' - 'ToolStripLabel1 - ' - Me.ToolStripLabel1.Name = "ToolStripLabel1" - Me.ToolStripLabel1.Size = New System.Drawing.Size(46, 22) - Me.ToolStripLabel1.Text = "Sort By:" - ' - 'ToolStripComboBox1 - ' - Me.ToolStripComboBox1.Items.AddRange(New Object() {"All Manufacturer", "All Caliber", "All Diameter", "All Weight", "All Section Density", "All Part Number", "All Ballistic Coefficient", "All Firearm Type", "All Qty.", "All Price", "Instock Manufacturer", "Instock Caliber", "Instock Diameter", "Instock Weight", "Instock Section Density", "Instock Part Number", "Instock Ballistic Coefficient", "Instock Firearm Type", "Instock Qty.", "Instock Price", "Out-Of-Stock Manufacturer", "Out-Of-Stock Caliber", "Out-Of-Stock Diameter", "Out-Of-Stock Weight", "Out-Of-Stock Section Density", "Out-Of-Stock Part Number", "Out-Of-Stock Ballistic Coefficient", "Out-Of-Stock Firearm Type", "Out-Of-Stock Qty.", "Out-Of-Stock Price"}) - Me.ToolStripComboBox1.Name = "ToolStripComboBox1" - Me.ToolStripComboBox1.Size = New System.Drawing.Size(121, 25) - Me.ToolStripComboBox1.Text = "Default" - ' - 'ReportViewer1 - ' - Me.ReportViewer1.Dock = System.Windows.Forms.DockStyle.Fill - ReportDataSource1.Name = "MLLDataSet_List_Bullets_Details" - ReportDataSource1.Value = Me.List_Bullets_DetailsBindingSource - Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1) - Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "BSMyLoadersLog.Report_BulletInventory.rdlc" - Me.ReportViewer1.Location = New System.Drawing.Point(0, 25) - Me.ReportViewer1.Name = "ReportViewer1" - Me.ReportViewer1.Size = New System.Drawing.Size(609, 380) - Me.ReportViewer1.TabIndex = 1 - ' - 'List_Bullets_DetailsTableAdapter - ' - Me.List_Bullets_DetailsTableAdapter.ClearBeforeFill = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmReport_BulletInventory - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(609, 405) - Me.Controls.Add(Me.ReportViewer1) - Me.Controls.Add(Me.ToolStrip1) - Me.HelpProvider1.SetHelpKeyword(Me, "Bullet Inventory") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Bullet Inventory") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmReport_BulletInventory" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Bullet Inventory Report" - CType(Me.List_Bullets_DetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ToolStrip1.ResumeLayout(False) - Me.ToolStrip1.PerformLayout() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmReportBulletInventory)) + Me.List_Bullets_DetailsBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip + Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel + Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox + Me.ReportViewer1 = New Microsoft.Reporting.WinForms.ReportViewer + Me.List_Bullets_DetailsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_Bullets_DetailsTableAdapter + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + CType(Me.List_Bullets_DetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ToolStrip1.SuspendLayout() + Me.SuspendLayout() + ' + 'List_Bullets_DetailsBindingSource + ' + Me.List_Bullets_DetailsBindingSource.DataMember = "List_Bullets_Details" + Me.List_Bullets_DetailsBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'ToolStrip1 + ' + Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel1, Me.ToolStripComboBox1}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(609, 25) + Me.ToolStrip1.TabIndex = 0 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripLabel1 + ' + Me.ToolStripLabel1.Name = "ToolStripLabel1" + Me.ToolStripLabel1.Size = New System.Drawing.Size(46, 22) + Me.ToolStripLabel1.Text = "Sort By:" + ' + 'ToolStripComboBox1 + ' + Me.ToolStripComboBox1.Items.AddRange(New Object() {"All Manufacturer", "All Caliber", "All Diameter", "All Weight", "All Section Density", "All Part Number", "All Ballistic Coefficient", "All Firearm Type", "All Qty.", "All Price", "Instock Manufacturer", "Instock Caliber", "Instock Diameter", "Instock Weight", "Instock Section Density", "Instock Part Number", "Instock Ballistic Coefficient", "Instock Firearm Type", "Instock Qty.", "Instock Price", "Out-Of-Stock Manufacturer", "Out-Of-Stock Caliber", "Out-Of-Stock Diameter", "Out-Of-Stock Weight", "Out-Of-Stock Section Density", "Out-Of-Stock Part Number", "Out-Of-Stock Ballistic Coefficient", "Out-Of-Stock Firearm Type", "Out-Of-Stock Qty.", "Out-Of-Stock Price"}) + Me.ToolStripComboBox1.Name = "ToolStripComboBox1" + Me.ToolStripComboBox1.Size = New System.Drawing.Size(121, 25) + Me.ToolStripComboBox1.Text = "Default" + ' + 'ReportViewer1 + ' + Me.ReportViewer1.Dock = System.Windows.Forms.DockStyle.Fill + ReportDataSource1.Name = "MLLDataSet_List_Bullets_Details" + ReportDataSource1.Value = Me.List_Bullets_DetailsBindingSource + Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1) + Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "BSMyLoadersLog.Report_BulletInventory.rdlc" + Me.ReportViewer1.Location = New System.Drawing.Point(0, 25) + Me.ReportViewer1.Name = "ReportViewer1" + Me.ReportViewer1.Size = New System.Drawing.Size(609, 380) + Me.ReportViewer1.TabIndex = 1 + ' + 'List_Bullets_DetailsTableAdapter + ' + Me.List_Bullets_DetailsTableAdapter.ClearBeforeFill = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmReport_BulletInventory + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(609, 405) + Me.Controls.Add(Me.ReportViewer1) + Me.Controls.Add(Me.ToolStrip1) + Me.HelpProvider1.SetHelpKeyword(Me, "Bullet Inventory") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Bullet Inventory") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.Name = "FrmReportBulletInventory" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Bullet Inventory Report" + CType(Me.List_Bullets_DetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip - Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel - Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox - Friend WithEvents ReportViewer1 As Microsoft.Reporting.WinForms.ReportViewer - Friend WithEvents List_Bullets_DetailsBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents List_Bullets_DetailsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_Bullets_DetailsTableAdapter - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider -End Class + End Sub + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel + Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox + Friend WithEvents ReportViewer1 As Microsoft.Reporting.WinForms.ReportViewer + Friend WithEvents List_Bullets_DetailsBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents List_Bullets_DetailsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_Bullets_DetailsTableAdapter + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/ViewReports/frmReport_BulletInventory.vb b/BSMyLoadersLog/ViewReports/frmReport_BulletInventory.vb index b07b142..ac3d556 100644 --- a/BSMyLoadersLog/ViewReports/frmReport_BulletInventory.vb +++ b/BSMyLoadersLog/ViewReports/frmReport_BulletInventory.vb @@ -1,84 +1,101 @@ -Public Class frmReport_BulletInventory - Sub LoadData() - Try - Select Case LCase(ToolStripComboBox1.SelectedItem.ToString) - Case LCase("All Manufacturer") - Me.List_Bullets_DetailsTableAdapter.FillByAllManu(Me.MLLDataSet.List_Bullets_Details) - Case LCase("All Caliber") - Me.List_Bullets_DetailsTableAdapter.FillByAllCalibers(Me.MLLDataSet.List_Bullets_Details) - Case LCase("All Diameter") - Me.List_Bullets_DetailsTableAdapter.FillByAllDiameter(Me.MLLDataSet.List_Bullets_Details) - Case LCase("All Weight") - Me.List_Bullets_DetailsTableAdapter.FillByAllWeight(Me.MLLDataSet.List_Bullets_Details) - Case LCase("All Section Density") - Me.List_Bullets_DetailsTableAdapter.FillByAllSectionDensity(Me.MLLDataSet.List_Bullets_Details) - Case LCase("All Part Number") - Me.List_Bullets_DetailsTableAdapter.FillByAllPart_number(Me.MLLDataSet.List_Bullets_Details) - Case LCase("All Ballistic Coefficient") - Me.List_Bullets_DetailsTableAdapter.FillByAllBallistic_Coefficient(Me.MLLDataSet.List_Bullets_Details) - Case LCase("All Firearm Type") - Me.List_Bullets_DetailsTableAdapter.FillByAllFirearmType(Me.MLLDataSet.List_Bullets_Details) - Case LCase("All Qty.") - Me.List_Bullets_DetailsTableAdapter.FillByAllQty(Me.MLLDataSet.List_Bullets_Details) - Case LCase("All Price") - Me.List_Bullets_DetailsTableAdapter.FillByAllPrice(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Instock Manufacturer") - Me.List_Bullets_DetailsTableAdapter.FillByINSManu(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Instock Caliber") - Me.List_Bullets_DetailsTableAdapter.FillByINSCalibers(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Instock Diameter") - Me.List_Bullets_DetailsTableAdapter.FillByINSDiameter(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Instock Weight") - Me.List_Bullets_DetailsTableAdapter.FillByINSWeight(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Instock Section Density") - Me.List_Bullets_DetailsTableAdapter.FillByINSSectionDensity(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Instock Part Number") - Me.List_Bullets_DetailsTableAdapter.FillByINSPart_number(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Instock Ballistic Coefficient") - Me.List_Bullets_DetailsTableAdapter.FillByINSBallistic_Coefficient(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Instock Firearm Type") - Me.List_Bullets_DetailsTableAdapter.FillByINSFirearmType(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Instock Qty.") - Me.List_Bullets_DetailsTableAdapter.FillByINSQty(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Instock Price") - Me.List_Bullets_DetailsTableAdapter.FillByINSPrice(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Out-Of-Stock Manufacturer") - Me.List_Bullets_DetailsTableAdapter.FillByOOSManu(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Out-Of-Stock Caliber") - Me.List_Bullets_DetailsTableAdapter.FillByOOSCalibers(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Out-Of-Stock Diameter") - Me.List_Bullets_DetailsTableAdapter.FillByOOSDiameter(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Out-Of-Stock Weight") - Me.List_Bullets_DetailsTableAdapter.FillByOOSWeight(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Out-Of-Stock Section Density") - Me.List_Bullets_DetailsTableAdapter.FillByOOSSectionDensity(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Out-Of-Stock Part Number") - Me.List_Bullets_DetailsTableAdapter.FillByOOSPart_number(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Out-Of-Stock Ballistic Coefficient") - Me.List_Bullets_DetailsTableAdapter.FillByOOSBallistic_Coefficient(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Out-Of-Stock Firearm Type") - Me.List_Bullets_DetailsTableAdapter.FillByOOSFirearmType(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Out-Of-Stock Qty.") - Me.List_Bullets_DetailsTableAdapter.FillByOOSQty(Me.MLLDataSet.List_Bullets_Details) - Case LCase("Out-Of-Stock Price") - Me.List_Bullets_DetailsTableAdapter.FillByOOSPrice(Me.MLLDataSet.List_Bullets_Details) - Case Else - Me.List_Bullets_DetailsTableAdapter.Fill(Me.MLLDataSet.List_Bullets_Details) - End Select - Me.ReportViewer1.RefreshReport() - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmReport_BulletInventory_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Try - Me.List_Bullets_DetailsTableAdapter.Fill(Me.MLLDataSet.List_Bullets_Details) - Me.ReportViewer1.RefreshReport() - Catch ex As Exception - Call LogError(Me.Name, "Load", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged - Call LoadData() - End Sub -End Class \ No newline at end of file +Namespace ViewReports + ''' + ''' Class FrmReportBulletInventory. + ''' Implements the + ''' + ''' + Public Class FrmReportBulletInventory + Sub LoadData() + Try + Select Case LCase(ToolStripComboBox1.SelectedItem.ToString) + Case LCase("All Manufacturer") + List_Bullets_DetailsTableAdapter.FillByAllManu(MLLDataSet.List_Bullets_Details) + Case LCase("All Caliber") + List_Bullets_DetailsTableAdapter.FillByAllCalibers(MLLDataSet.List_Bullets_Details) + Case LCase("All Diameter") + List_Bullets_DetailsTableAdapter.FillByAllDiameter(MLLDataSet.List_Bullets_Details) + Case LCase("All Weight") + List_Bullets_DetailsTableAdapter.FillByAllWeight(MLLDataSet.List_Bullets_Details) + Case LCase("All Section Density") + List_Bullets_DetailsTableAdapter.FillByAllSectionDensity(MLLDataSet.List_Bullets_Details) + Case LCase("All Part Number") + List_Bullets_DetailsTableAdapter.FillByAllPart_number(MLLDataSet.List_Bullets_Details) + Case LCase("All Ballistic Coefficient") + List_Bullets_DetailsTableAdapter.FillByAllBallistic_Coefficient(MLLDataSet.List_Bullets_Details) + Case LCase("All Firearm Type") + List_Bullets_DetailsTableAdapter.FillByAllFirearmType(MLLDataSet.List_Bullets_Details) + Case LCase("All Qty.") + List_Bullets_DetailsTableAdapter.FillByAllQty(MLLDataSet.List_Bullets_Details) + Case LCase("All Price") + List_Bullets_DetailsTableAdapter.FillByAllPrice(MLLDataSet.List_Bullets_Details) + Case LCase("Instock Manufacturer") + List_Bullets_DetailsTableAdapter.FillByINSManu(MLLDataSet.List_Bullets_Details) + Case LCase("Instock Caliber") + List_Bullets_DetailsTableAdapter.FillByINSCalibers(MLLDataSet.List_Bullets_Details) + Case LCase("Instock Diameter") + List_Bullets_DetailsTableAdapter.FillByINSDiameter(MLLDataSet.List_Bullets_Details) + Case LCase("Instock Weight") + List_Bullets_DetailsTableAdapter.FillByINSWeight(MLLDataSet.List_Bullets_Details) + Case LCase("Instock Section Density") + List_Bullets_DetailsTableAdapter.FillByINSSectionDensity(MLLDataSet.List_Bullets_Details) + Case LCase("Instock Part Number") + List_Bullets_DetailsTableAdapter.FillByINSPart_number(MLLDataSet.List_Bullets_Details) + Case LCase("Instock Ballistic Coefficient") + List_Bullets_DetailsTableAdapter.FillByINSBallistic_Coefficient(MLLDataSet.List_Bullets_Details) + Case LCase("Instock Firearm Type") + List_Bullets_DetailsTableAdapter.FillByINSFirearmType(MLLDataSet.List_Bullets_Details) + Case LCase("Instock Qty.") + List_Bullets_DetailsTableAdapter.FillByINSQty(MLLDataSet.List_Bullets_Details) + Case LCase("Instock Price") + List_Bullets_DetailsTableAdapter.FillByINSPrice(MLLDataSet.List_Bullets_Details) + Case LCase("Out-Of-Stock Manufacturer") + List_Bullets_DetailsTableAdapter.FillByOOSManu(MLLDataSet.List_Bullets_Details) + Case LCase("Out-Of-Stock Caliber") + List_Bullets_DetailsTableAdapter.FillByOOSCalibers(MLLDataSet.List_Bullets_Details) + Case LCase("Out-Of-Stock Diameter") + List_Bullets_DetailsTableAdapter.FillByOOSDiameter(MLLDataSet.List_Bullets_Details) + Case LCase("Out-Of-Stock Weight") + List_Bullets_DetailsTableAdapter.FillByOOSWeight(MLLDataSet.List_Bullets_Details) + Case LCase("Out-Of-Stock Section Density") + List_Bullets_DetailsTableAdapter.FillByOOSSectionDensity(MLLDataSet.List_Bullets_Details) + Case LCase("Out-Of-Stock Part Number") + List_Bullets_DetailsTableAdapter.FillByOOSPart_number(MLLDataSet.List_Bullets_Details) + Case LCase("Out-Of-Stock Ballistic Coefficient") + List_Bullets_DetailsTableAdapter.FillByOOSBallistic_Coefficient(MLLDataSet.List_Bullets_Details) + Case LCase("Out-Of-Stock Firearm Type") + List_Bullets_DetailsTableAdapter.FillByOOSFirearmType(MLLDataSet.List_Bullets_Details) + Case LCase("Out-Of-Stock Qty.") + List_Bullets_DetailsTableAdapter.FillByOOSQty(MLLDataSet.List_Bullets_Details) + Case LCase("Out-Of-Stock Price") + List_Bullets_DetailsTableAdapter.FillByOOSPrice(MLLDataSet.List_Bullets_Details) + Case Else + List_Bullets_DetailsTableAdapter.Fill(MLLDataSet.List_Bullets_Details) + End Select + ReportViewer1.RefreshReport() + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmReport_BulletInventory control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmReport_BulletInventory_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Try + List_Bullets_DetailsTableAdapter.Fill(MLLDataSet.List_Bullets_Details) + ReportViewer1.RefreshReport() + Catch ex As Exception + Call LogError(Name, "Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the SelectedIndexChanged event of the ToolStripComboBox1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged + Call LoadData() + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/ViewReports/frmReport_CaseInventory.Designer.vb b/BSMyLoadersLog/ViewReports/frmReport_CaseInventory.Designer.vb index 3df8189..9da122d 100644 --- a/BSMyLoadersLog/ViewReports/frmReport_CaseInventory.Designer.vb +++ b/BSMyLoadersLog/ViewReports/frmReport_CaseInventory.Designer.vb @@ -1,124 +1,126 @@ - _ -Partial Class frmReport_CaseInventory - Inherits System.Windows.Forms.Form +Namespace ViewReports + _ + Partial Class FrmReportCaseInventory + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmReport_CaseInventory)) - Me.List_Case_DetailsBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.ToolStrip1 = New System.Windows.Forms.ToolStrip - Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel - Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox - Me.ReportViewer1 = New Microsoft.Reporting.WinForms.ReportViewer - Me.List_Case_DetailsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_Case_DetailsTableAdapter - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - CType(Me.List_Case_DetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.ToolStrip1.SuspendLayout() - Me.SuspendLayout() - ' - 'List_Case_DetailsBindingSource - ' - Me.List_Case_DetailsBindingSource.DataMember = "List_Case_Details" - Me.List_Case_DetailsBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'ToolStrip1 - ' - Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel1, Me.ToolStripComboBox1}) - Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) - Me.ToolStrip1.Name = "ToolStrip1" - Me.ToolStrip1.Size = New System.Drawing.Size(684, 25) - Me.ToolStrip1.TabIndex = 0 - Me.ToolStrip1.Text = "ToolStrip1" - ' - 'ToolStripLabel1 - ' - Me.ToolStripLabel1.Name = "ToolStripLabel1" - Me.ToolStripLabel1.Size = New System.Drawing.Size(46, 22) - Me.ToolStripLabel1.Text = "Sort By:" - ' - 'ToolStripComboBox1 - ' - Me.ToolStripComboBox1.Items.AddRange(New Object() {"All Manufacturer", "All Caliber", "All Trim to Length", "All Times Used", "All Qty", "All Price", "Instock Manufacturer", "Instock Caliber", "Instock Trim to Length", "Instock Times Used", "Instock Qty", "Instock Price", "Out-Of-Stock Manufacturer", "Out-Of-Stock Caliber", "Out-Of-Stock Trim to Length", "Out-Of-Stock Times Used", "Out-Of-Stock Qty", "Out-Of-Stock Price"}) - Me.ToolStripComboBox1.Name = "ToolStripComboBox1" - Me.ToolStripComboBox1.Size = New System.Drawing.Size(121, 25) - Me.ToolStripComboBox1.Text = "Default" - ' - 'ReportViewer1 - ' - Me.ReportViewer1.Dock = System.Windows.Forms.DockStyle.Fill - ReportDataSource1.Name = "MLLDataSet_List_Case_Details" - ReportDataSource1.Value = Me.List_Case_DetailsBindingSource - Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1) - Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "BSMyLoadersLog.Report_CaseInventory.rdlc" - Me.ReportViewer1.Location = New System.Drawing.Point(0, 25) - Me.ReportViewer1.Name = "ReportViewer1" - Me.ReportViewer1.Size = New System.Drawing.Size(684, 337) - Me.ReportViewer1.TabIndex = 1 - ' - 'List_Case_DetailsTableAdapter - ' - Me.List_Case_DetailsTableAdapter.ClearBeforeFill = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmReport_CaseInventory - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(684, 362) - Me.Controls.Add(Me.ReportViewer1) - Me.Controls.Add(Me.ToolStrip1) - Me.HelpProvider1.SetHelpKeyword(Me, "Case Inventory") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Case Inventory") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmReport_CaseInventory" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Case/Brass Inventory Report" - CType(Me.List_Case_DetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ToolStrip1.ResumeLayout(False) - Me.ToolStrip1.PerformLayout() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmReportCaseInventory)) + Me.List_Case_DetailsBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip + Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel + Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox + Me.ReportViewer1 = New Microsoft.Reporting.WinForms.ReportViewer + Me.List_Case_DetailsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_Case_DetailsTableAdapter + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + CType(Me.List_Case_DetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ToolStrip1.SuspendLayout() + Me.SuspendLayout() + ' + 'List_Case_DetailsBindingSource + ' + Me.List_Case_DetailsBindingSource.DataMember = "List_Case_Details" + Me.List_Case_DetailsBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'ToolStrip1 + ' + Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel1, Me.ToolStripComboBox1}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(684, 25) + Me.ToolStrip1.TabIndex = 0 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripLabel1 + ' + Me.ToolStripLabel1.Name = "ToolStripLabel1" + Me.ToolStripLabel1.Size = New System.Drawing.Size(46, 22) + Me.ToolStripLabel1.Text = "Sort By:" + ' + 'ToolStripComboBox1 + ' + Me.ToolStripComboBox1.Items.AddRange(New Object() {"All Manufacturer", "All Caliber", "All Trim to Length", "All Times Used", "All Qty", "All Price", "Instock Manufacturer", "Instock Caliber", "Instock Trim to Length", "Instock Times Used", "Instock Qty", "Instock Price", "Out-Of-Stock Manufacturer", "Out-Of-Stock Caliber", "Out-Of-Stock Trim to Length", "Out-Of-Stock Times Used", "Out-Of-Stock Qty", "Out-Of-Stock Price"}) + Me.ToolStripComboBox1.Name = "ToolStripComboBox1" + Me.ToolStripComboBox1.Size = New System.Drawing.Size(121, 25) + Me.ToolStripComboBox1.Text = "Default" + ' + 'ReportViewer1 + ' + Me.ReportViewer1.Dock = System.Windows.Forms.DockStyle.Fill + ReportDataSource1.Name = "MLLDataSet_List_Case_Details" + ReportDataSource1.Value = Me.List_Case_DetailsBindingSource + Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1) + Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "BSMyLoadersLog.Report_CaseInventory.rdlc" + Me.ReportViewer1.Location = New System.Drawing.Point(0, 25) + Me.ReportViewer1.Name = "ReportViewer1" + Me.ReportViewer1.Size = New System.Drawing.Size(684, 337) + Me.ReportViewer1.TabIndex = 1 + ' + 'List_Case_DetailsTableAdapter + ' + Me.List_Case_DetailsTableAdapter.ClearBeforeFill = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmReport_CaseInventory + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(684, 362) + Me.Controls.Add(Me.ReportViewer1) + Me.Controls.Add(Me.ToolStrip1) + Me.HelpProvider1.SetHelpKeyword(Me, "Case Inventory") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Case Inventory") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.Name = "FrmReportCaseInventory" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Case/Brass Inventory Report" + CType(Me.List_Case_DetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip - Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel - Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox - Friend WithEvents ReportViewer1 As Microsoft.Reporting.WinForms.ReportViewer - Friend WithEvents List_Case_DetailsBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents List_Case_DetailsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_Case_DetailsTableAdapter - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider -End Class + End Sub + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel + Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox + Friend WithEvents ReportViewer1 As Microsoft.Reporting.WinForms.ReportViewer + Friend WithEvents List_Case_DetailsBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents List_Case_DetailsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_Case_DetailsTableAdapter + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/ViewReports/frmReport_CaseInventory.vb b/BSMyLoadersLog/ViewReports/frmReport_CaseInventory.vb index 27b8091..be813a4 100644 --- a/BSMyLoadersLog/ViewReports/frmReport_CaseInventory.vb +++ b/BSMyLoadersLog/ViewReports/frmReport_CaseInventory.vb @@ -1,61 +1,80 @@ -Public Class frmReport_CaseInventory - Sub LoadData() - Try - Select Case LCase(ToolStripComboBox1.SelectedItem.ToString) - Case LCase("All Manufacturer") - Me.List_Case_DetailsTableAdapter.FillByAllManu(Me.MLLDataSet.List_Case_Details) - Case LCase("All Caliber") - Me.List_Case_DetailsTableAdapter.FillByAllCaliber(Me.MLLDataSet.List_Case_Details) - Case LCase("All Trim to Length") - Me.List_Case_DetailsTableAdapter.FillByAllTTL(Me.MLLDataSet.List_Case_Details) - Case LCase("All Times Used") - Me.List_Case_DetailsTableAdapter.FillByAllTimesUsed(Me.MLLDataSet.List_Case_Details) - Case LCase("All Qty") - Me.List_Case_DetailsTableAdapter.FillByAllQty(Me.MLLDataSet.List_Case_Details) - Case LCase("All Price") - Me.List_Case_DetailsTableAdapter.FillByAllPrice(Me.MLLDataSet.List_Case_Details) - Case LCase("Instock Manufacturer") - Me.List_Case_DetailsTableAdapter.FillByINSManu(Me.MLLDataSet.List_Case_Details) - Case LCase("Instock Caliber") - Me.List_Case_DetailsTableAdapter.FillByINSCaliber(Me.MLLDataSet.List_Case_Details) - Case LCase("Instock Trim to Length") - Me.List_Case_DetailsTableAdapter.FillByINSTTL(Me.MLLDataSet.List_Case_Details) - Case LCase("Instock Times Used") - Me.List_Case_DetailsTableAdapter.FillByINSTimesUsed(Me.MLLDataSet.List_Case_Details) - Case LCase("Instock Qty") - Me.List_Case_DetailsTableAdapter.FillByINSQty(Me.MLLDataSet.List_Case_Details) - Case LCase("Instock Price") - Me.List_Case_DetailsTableAdapter.FillByINSPrice(Me.MLLDataSet.List_Case_Details) - Case LCase("Out-Of-Stock Manufacturer") - Me.List_Case_DetailsTableAdapter.FillByOOSManu(Me.MLLDataSet.List_Case_Details) - Case LCase("Out-Of-Stock Caliber") - Me.List_Case_DetailsTableAdapter.FillByOOSCaliber(Me.MLLDataSet.List_Case_Details) - Case LCase("Out-Of-Stock Trim to Length") - Me.List_Case_DetailsTableAdapter.FillByOOSTTL(Me.MLLDataSet.List_Case_Details) - Case LCase("Out-Of-Stock Times Used") - Me.List_Case_DetailsTableAdapter.FillByOOSTimesUsed(Me.MLLDataSet.List_Case_Details) - Case LCase("Out-Of-Stock Qty") - Me.List_Case_DetailsTableAdapter.FillByOOSQty(Me.MLLDataSet.List_Case_Details) - Case LCase("Out-Of-Stock Price") - Me.List_Case_DetailsTableAdapter.FillByOOSPrice(Me.MLLDataSet.List_Case_Details) - Case Else - Me.List_Case_DetailsTableAdapter.Fill(Me.MLLDataSet.List_Case_Details) - End Select - Me.ReportViewer1.RefreshReport() - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmReport_CaseInventory_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Try - Me.List_Case_DetailsTableAdapter.Fill(Me.MLLDataSet.List_Case_Details) - Me.ReportViewer1.RefreshReport() - Catch ex As Exception - Call LogError(Me.Name, "Load", Err.Number, ex.Message.ToString) - End Try - End Sub - - Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged - Call LoadData() - End Sub -End Class \ No newline at end of file +Namespace ViewReports + ''' + ''' Class FrmReportCaseInventory. + ''' Implements the + ''' + ''' + Public Class FrmReportCaseInventory + ''' + ''' Loads the data. + ''' + Sub LoadData() + Try + Select Case LCase(ToolStripComboBox1.SelectedItem.ToString) + Case LCase("All Manufacturer") + List_Case_DetailsTableAdapter.FillByAllManu(MLLDataSet.List_Case_Details) + Case LCase("All Caliber") + List_Case_DetailsTableAdapter.FillByAllCaliber(MLLDataSet.List_Case_Details) + Case LCase("All Trim to Length") + List_Case_DetailsTableAdapter.FillByAllTTL(MLLDataSet.List_Case_Details) + Case LCase("All Times Used") + List_Case_DetailsTableAdapter.FillByAllTimesUsed(MLLDataSet.List_Case_Details) + Case LCase("All Qty") + List_Case_DetailsTableAdapter.FillByAllQty(MLLDataSet.List_Case_Details) + Case LCase("All Price") + List_Case_DetailsTableAdapter.FillByAllPrice(MLLDataSet.List_Case_Details) + Case LCase("Instock Manufacturer") + List_Case_DetailsTableAdapter.FillByINSManu(MLLDataSet.List_Case_Details) + Case LCase("Instock Caliber") + List_Case_DetailsTableAdapter.FillByINSCaliber(MLLDataSet.List_Case_Details) + Case LCase("Instock Trim to Length") + List_Case_DetailsTableAdapter.FillByINSTTL(MLLDataSet.List_Case_Details) + Case LCase("Instock Times Used") + List_Case_DetailsTableAdapter.FillByINSTimesUsed(MLLDataSet.List_Case_Details) + Case LCase("Instock Qty") + List_Case_DetailsTableAdapter.FillByINSQty(MLLDataSet.List_Case_Details) + Case LCase("Instock Price") + List_Case_DetailsTableAdapter.FillByINSPrice(MLLDataSet.List_Case_Details) + Case LCase("Out-Of-Stock Manufacturer") + List_Case_DetailsTableAdapter.FillByOOSManu(MLLDataSet.List_Case_Details) + Case LCase("Out-Of-Stock Caliber") + List_Case_DetailsTableAdapter.FillByOOSCaliber(MLLDataSet.List_Case_Details) + Case LCase("Out-Of-Stock Trim to Length") + List_Case_DetailsTableAdapter.FillByOOSTTL(MLLDataSet.List_Case_Details) + Case LCase("Out-Of-Stock Times Used") + List_Case_DetailsTableAdapter.FillByOOSTimesUsed(MLLDataSet.List_Case_Details) + Case LCase("Out-Of-Stock Qty") + List_Case_DetailsTableAdapter.FillByOOSQty(MLLDataSet.List_Case_Details) + Case LCase("Out-Of-Stock Price") + List_Case_DetailsTableAdapter.FillByOOSPrice(MLLDataSet.List_Case_Details) + Case Else + List_Case_DetailsTableAdapter.Fill(MLLDataSet.List_Case_Details) + End Select + ReportViewer1.RefreshReport() + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmReport_CaseInventory control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmReport_CaseInventory_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Try + List_Case_DetailsTableAdapter.Fill(MLLDataSet.List_Case_Details) + ReportViewer1.RefreshReport() + Catch ex As Exception + Call LogError(Name, "Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the SelectedIndexChanged event of the ToolStripComboBox1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged + Call LoadData() + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet .Designer.vb b/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet .Designer.vb index ebf5683..a01dc25 100644 --- a/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet .Designer.vb +++ b/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet .Designer.vb @@ -1,86 +1,88 @@ - _ -Partial Class frmReport_Configuration_Sheet - Inherits System.Windows.Forms.Form +Namespace ViewReports + _ + Partial Class FrmReportConfigurationSheet + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmReport_Configuration_Sheet)) - Me.Config_List_Powder_Data_NSG_ViewBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.ReportViewer1 = New Microsoft.Reporting.WinForms.ReportViewer - Me.Config_List_Powder_Data_NSG_ViewTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Config_List_Powder_Data_NSG_ViewTableAdapter - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - CType(Me.Config_List_Powder_Data_NSG_ViewBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'Config_List_Powder_Data_NSG_ViewBindingSource - ' - Me.Config_List_Powder_Data_NSG_ViewBindingSource.DataMember = "Config_List_Powder_Data_NSG_View" - Me.Config_List_Powder_Data_NSG_ViewBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'ReportViewer1 - ' - Me.ReportViewer1.Dock = System.Windows.Forms.DockStyle.Fill - ReportDataSource1.Name = "MLLDataSet_Config_List_Powder_Data_NSG_View" - ReportDataSource1.Value = Me.Config_List_Powder_Data_NSG_ViewBindingSource - Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1) - Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "BSMyLoadersLog.Report_Config_RiflePistol.rdlc" - Me.ReportViewer1.Location = New System.Drawing.Point(0, 0) - Me.ReportViewer1.Name = "ReportViewer1" - Me.ReportViewer1.Size = New System.Drawing.Size(608, 430) - Me.ReportViewer1.TabIndex = 1 - ' - 'Config_List_Powder_Data_NSG_ViewTableAdapter - ' - Me.Config_List_Powder_Data_NSG_ViewTableAdapter.ClearBeforeFill = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmReport_Configuration_Sheet - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(608, 430) - Me.Controls.Add(Me.ReportViewer1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmReport_Configuration_Sheet" - Me.Text = "Configuration Sheet Report" - CType(Me.Config_List_Powder_Data_NSG_ViewBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmReportConfigurationSheet)) + Me.Config_List_Powder_Data_NSG_ViewBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.ReportViewer1 = New Microsoft.Reporting.WinForms.ReportViewer + Me.Config_List_Powder_Data_NSG_ViewTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Config_List_Powder_Data_NSG_ViewTableAdapter + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + CType(Me.Config_List_Powder_Data_NSG_ViewBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'Config_List_Powder_Data_NSG_ViewBindingSource + ' + Me.Config_List_Powder_Data_NSG_ViewBindingSource.DataMember = "Config_List_Powder_Data_NSG_View" + Me.Config_List_Powder_Data_NSG_ViewBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'ReportViewer1 + ' + Me.ReportViewer1.Dock = System.Windows.Forms.DockStyle.Fill + ReportDataSource1.Name = "MLLDataSet_Config_List_Powder_Data_NSG_View" + ReportDataSource1.Value = Me.Config_List_Powder_Data_NSG_ViewBindingSource + Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1) + Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "BSMyLoadersLog.Report_Config_RiflePistol.rdlc" + Me.ReportViewer1.Location = New System.Drawing.Point(0, 0) + Me.ReportViewer1.Name = "ReportViewer1" + Me.ReportViewer1.Size = New System.Drawing.Size(608, 430) + Me.ReportViewer1.TabIndex = 1 + ' + 'Config_List_Powder_Data_NSG_ViewTableAdapter + ' + Me.Config_List_Powder_Data_NSG_ViewTableAdapter.ClearBeforeFill = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmReport_Configuration_Sheet + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(608, 430) + Me.Controls.Add(Me.ReportViewer1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.Name = "FrmReportConfigurationSheet" + Me.Text = "Configuration Sheet Report" + CType(Me.Config_List_Powder_Data_NSG_ViewBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) - End Sub - Friend WithEvents ReportViewer1 As Microsoft.Reporting.WinForms.ReportViewer - Friend WithEvents Config_List_Powder_Data_NSG_ViewBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents Config_List_Powder_Data_NSG_ViewTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Config_List_Powder_Data_NSG_ViewTableAdapter - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider -End Class + End Sub + Friend WithEvents ReportViewer1 As Microsoft.Reporting.WinForms.ReportViewer + Friend WithEvents Config_List_Powder_Data_NSG_ViewBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents Config_List_Powder_Data_NSG_ViewTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Config_List_Powder_Data_NSG_ViewTableAdapter + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet .vb b/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet .vb index 5641817..e992c91 100644 --- a/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet .vb +++ b/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet .vb @@ -1,67 +1,153 @@ -Imports BSMyLoadersLog.LoadersClass Imports Microsoft.Reporting.WinForms -Public Class frmReport_Configuration_Sheet - Public Config_ID As Long - Public Config_Name As String - Public Config_AT As String - Public Config_Cal As String - Public Config_Notes As String - Public Bul_Manu As String - Public Bul_Name As String - Public Bul_Dia As String - Public Bul_Wei As String - Public Bul_SD As String - Public Bul_PN As String - Public Bul_BC As String - Public Bul_BT As String - Public Pri_Manu As String - Public Pri_Name As String - Public Pri_PT As String - Public Case_Manu As String - Public Case_Name As String - Public Case_TTL As String - Public Case_TU As String - Dim Config_PersonalLoad As String - Public Config_ISPersonal As Boolean - Public Config_Fav As Boolean - Public Config_Ref As String - Sub LoadData() - Try - Me.Config_List_Powder_Data_NSG_ViewTableAdapter.FillBy_ConfigID(Me.MLLDataSet.Config_List_Powder_Data_NSG_View, Config_ID) - Dim parmList As New Generic.List(Of ReportParameter) - parmList.Add(New ReportParameter("Config_Name", Config_Name)) - parmList.Add(New ReportParameter("Config_AT", Config_AT)) - parmList.Add(New ReportParameter("Config_Cal", Config_Cal)) - parmList.Add(New ReportParameter("Config_Notes", Config_Notes)) - parmList.Add(New ReportParameter("Bul_Manu", Bul_Manu)) - parmList.Add(New ReportParameter("Bul_Name", Bul_Name)) - parmList.Add(New ReportParameter("Bul_Dia", Bul_Dia)) - parmList.Add(New ReportParameter("Bul_Wei", Bul_Wei)) - parmList.Add(New ReportParameter("Bul_SD", Bul_SD)) - parmList.Add(New ReportParameter("Bul_PN", Bul_PN)) - parmList.Add(New ReportParameter("Bul_BC", Bul_BC)) - parmList.Add(New ReportParameter("Bul_BT", Bul_BT)) - parmList.Add(New ReportParameter("Pri_Manu", Pri_Manu)) - parmList.Add(New ReportParameter("Pri_Name", Pri_Name)) - parmList.Add(New ReportParameter("Pri_PT", Pri_PT)) - parmList.Add(New ReportParameter("Case_Manu", Case_Manu)) - parmList.Add(New ReportParameter("Case_Name", Case_Name)) - parmList.Add(New ReportParameter("Case_TTL", Case_TTL)) - parmList.Add(New ReportParameter("Case_TU", Case_TU)) - If Config_ISPersonal Then - Config_PersonalLoad = "Yes" - Else - Config_PersonalLoad = "No (" & Config_Ref & ")" - End If - parmList.Add(New ReportParameter("Config_PersonalLoad", Config_PersonalLoad)) - Me.ReportViewer1.LocalReport.SetParameters(parmList) - Me.ReportViewer1.RefreshReport() - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmReport_Configuration_Sheet_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call LoadData() - End Sub -End Class \ No newline at end of file +Namespace ViewReports + ''' + ''' Class frmReport_Configuration_Sheet. + ''' Implements the + ''' + ''' + Public Class FrmReportConfigurationSheet + ''' + ''' The configuration identifier + ''' + Public ConfigId As Long + ''' + ''' The configuration name + ''' + Public ConfigName As String + ''' + ''' The configuration ammo type + ''' + Public ConfigAmmoType As String + ''' + ''' The configuration caliber + ''' + Public ConfigCaliber As String + ''' + ''' The configuration notes + ''' + Public ConfigNotes As String + ''' + ''' The bullet manufacturer + ''' + Public BulletManufacturer As String + ''' + ''' The bullet name + ''' + Public BulletName As String + ''' + ''' The bullet diameter + ''' + Public BulletDiameter As String + ''' + ''' The bullet weight + ''' + Public BulletWeight As String + ''' + ''' The bullet sectional density + ''' + Public BulletSectionalDensity As String + ''' + ''' The bullet part number + ''' + Public BulletPartNumber As String + ''' + ''' The bullet ballistic coeffcient + ''' + Public BulletBallisticCoeffcient As String + ''' + ''' The bullet type + ''' + Public BulletType As String + ''' + ''' The primer manufacturer + ''' + Public PrimerManufacturer As String + ''' + ''' The primer name + ''' + Public PrimerName As String + ''' + ''' The primer type + ''' + Public PrimerType As String + ''' + ''' The case manufacturer + ''' + Public CaseManufacturer As String + ''' + ''' The case name + ''' + Public CaseName As String + ''' + ''' The case trim to length + ''' + Public CaseTrimToLength As String + ''' + ''' The case times used + ''' + Public CaseTimesUsed As String + ''' + ''' The configuration personal load + ''' + Dim _configPersonalLoad As String + ''' + ''' The configuration is personal + ''' + Public ConfigIsPersonal As Boolean + ''' + ''' The configuration favorite + ''' + Public ConfigFavorite As Boolean + ''' + ''' The configuration referance + ''' + Public ConfigReferance As String + ''' + ''' Loads the data. + ''' + Sub LoadData() + Try + Config_List_Powder_Data_NSG_ViewTableAdapter.FillBy_ConfigID(MLLDataSet.Config_List_Powder_Data_NSG_View, ConfigId) + Dim parmList As New List(Of ReportParameter) + parmList.Add(New ReportParameter("Config_Name", ConfigName)) + parmList.Add(New ReportParameter("Config_AT", ConfigAmmoType)) + parmList.Add(New ReportParameter("Config_Cal", ConfigCaliber)) + parmList.Add(New ReportParameter("Config_Notes", ConfigNotes)) + parmList.Add(New ReportParameter("Bul_Manu", BulletManufacturer)) + parmList.Add(New ReportParameter("Bul_Name", BulletName)) + parmList.Add(New ReportParameter("Bul_Dia", BulletDiameter)) + parmList.Add(New ReportParameter("Bul_Wei", BulletWeight)) + parmList.Add(New ReportParameter("Bul_SD", BulletSectionalDensity)) + parmList.Add(New ReportParameter("Bul_PN", BulletPartNumber)) + parmList.Add(New ReportParameter("Bul_BC", BulletBallisticCoeffcient)) + parmList.Add(New ReportParameter("Bul_BT", BulletType)) + parmList.Add(New ReportParameter("Pri_Manu", PrimerManufacturer)) + parmList.Add(New ReportParameter("Pri_Name", PrimerName)) + parmList.Add(New ReportParameter("Pri_PT", PrimerType)) + parmList.Add(New ReportParameter("Case_Manu", CaseManufacturer)) + parmList.Add(New ReportParameter("Case_Name", CaseName)) + parmList.Add(New ReportParameter("Case_TTL", CaseTrimToLength)) + parmList.Add(New ReportParameter("Case_TU", CaseTimesUsed)) + If ConfigIsPersonal Then + _configPersonalLoad = "Yes" + Else + _configPersonalLoad = "No (" & ConfigReferance & ")" + End If + parmList.Add(New ReportParameter("Config_PersonalLoad", _configPersonalLoad)) + ReportViewer1.LocalReport.SetParameters(parmList) + ReportViewer1.RefreshReport() + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmReport_Configuration_Sheet control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmReport_Configuration_Sheet_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call LoadData() + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet_SG.Designer.vb b/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet_SG.Designer.vb index 4d1a08b..481aff9 100644 --- a/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet_SG.Designer.vb +++ b/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet_SG.Designer.vb @@ -1,80 +1,82 @@ - _ -Partial Class frmReport_Configuration_Sheet_SG - Inherits System.Windows.Forms.Form +Namespace ViewReports + _ + Partial Class FrmReportConfigurationSheetSg + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmReport_Configuration_Sheet_SG)) - Me.ReportViewer1 = New Microsoft.Reporting.WinForms.ReportViewer - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.Config_List_Powder_Data_SG_ViewBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.Config_List_Powder_Data_SG_ViewTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Config_List_Powder_Data_SG_ViewTableAdapter - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.Config_List_Powder_Data_SG_ViewBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'ReportViewer1 - ' - Me.ReportViewer1.Dock = System.Windows.Forms.DockStyle.Fill - ReportDataSource1.Name = "MLLDataSet_Config_List_Powder_Data_SG_View" - ReportDataSource1.Value = Me.Config_List_Powder_Data_SG_ViewBindingSource - Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1) - Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "BSMyLoadersLog.Report_Config_Shotgun.rdlc" - Me.ReportViewer1.Location = New System.Drawing.Point(0, 0) - Me.ReportViewer1.Name = "ReportViewer1" - Me.ReportViewer1.Size = New System.Drawing.Size(652, 324) - Me.ReportViewer1.TabIndex = 0 - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'Config_List_Powder_Data_SG_ViewBindingSource - ' - Me.Config_List_Powder_Data_SG_ViewBindingSource.DataMember = "Config_List_Powder_Data_SG_View" - Me.Config_List_Powder_Data_SG_ViewBindingSource.DataSource = Me.MLLDataSet - ' - 'Config_List_Powder_Data_SG_ViewTableAdapter - ' - Me.Config_List_Powder_Data_SG_ViewTableAdapter.ClearBeforeFill = True - ' - 'frmReport_Configuration_Sheet_SG - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(652, 324) - Me.Controls.Add(Me.ReportViewer1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmReport_Configuration_Sheet_SG" - Me.Text = "Configuration Sheet Report" - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.Config_List_Powder_Data_SG_ViewBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmReportConfigurationSheetSg)) + Me.ReportViewer1 = New Microsoft.Reporting.WinForms.ReportViewer + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.Config_List_Powder_Data_SG_ViewBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.Config_List_Powder_Data_SG_ViewTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Config_List_Powder_Data_SG_ViewTableAdapter + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.Config_List_Powder_Data_SG_ViewBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'ReportViewer1 + ' + Me.ReportViewer1.Dock = System.Windows.Forms.DockStyle.Fill + ReportDataSource1.Name = "MLLDataSet_Config_List_Powder_Data_SG_View" + ReportDataSource1.Value = Me.Config_List_Powder_Data_SG_ViewBindingSource + Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1) + Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "BSMyLoadersLog.Report_Config_Shotgun.rdlc" + Me.ReportViewer1.Location = New System.Drawing.Point(0, 0) + Me.ReportViewer1.Name = "ReportViewer1" + Me.ReportViewer1.Size = New System.Drawing.Size(652, 324) + Me.ReportViewer1.TabIndex = 0 + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'Config_List_Powder_Data_SG_ViewBindingSource + ' + Me.Config_List_Powder_Data_SG_ViewBindingSource.DataMember = "Config_List_Powder_Data_SG_View" + Me.Config_List_Powder_Data_SG_ViewBindingSource.DataSource = Me.MLLDataSet + ' + 'Config_List_Powder_Data_SG_ViewTableAdapter + ' + Me.Config_List_Powder_Data_SG_ViewTableAdapter.ClearBeforeFill = True + ' + 'frmReport_Configuration_Sheet_SG + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(652, 324) + Me.Controls.Add(Me.ReportViewer1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.Name = "FrmReportConfigurationSheetSg" + Me.Text = "Configuration Sheet Report" + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.Config_List_Powder_Data_SG_ViewBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) - End Sub - Friend WithEvents ReportViewer1 As Microsoft.Reporting.WinForms.ReportViewer - Friend WithEvents Config_List_Powder_Data_SG_ViewBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents Config_List_Powder_Data_SG_ViewTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Config_List_Powder_Data_SG_ViewTableAdapter -End Class + End Sub + Friend WithEvents ReportViewer1 As Microsoft.Reporting.WinForms.ReportViewer + Friend WithEvents Config_List_Powder_Data_SG_ViewBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents Config_List_Powder_Data_SG_ViewTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Config_List_Powder_Data_SG_ViewTableAdapter + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet_SG.vb b/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet_SG.vb index b95f579..5abba8e 100644 --- a/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet_SG.vb +++ b/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet_SG.vb @@ -1,67 +1,153 @@ -Imports BSMyLoadersLog.LoadersClass Imports Microsoft.Reporting.WinForms -Public Class frmReport_Configuration_Sheet_SG - Public Config_ID As Long - Public Config_Name As String - Public Config_AT As String - Public Config_Cal As String - Public Config_Notes As String - Public Pro_Manu As String - Public Pro_Name As String - Public Pro_ShotNo As String - Public Pro_Material As String - Public Pro_SelectedLoad As String - Public WAD_Manu As String - Public WAD_Name As String - Public WAD_MaxLoad As String - Public Pri_Manu As String - Public Pri_Name As String - Public Pri_PT As String - Public Case_Manu As String - Public Case_Name As String - Public Case_TTL As String - Public Case_DRAM As String - Dim Config_PersonalLoad As String - Public Config_ISPersonal As Boolean - Public Config_Fav As Boolean - Public Config_Ref As String - Sub LoadData() - Try - Me.Config_List_Powder_Data_SG_ViewTableAdapter.FillBy_ConfigID(Me.MLLDataSet.Config_List_Powder_Data_SG_View, Config_ID) - Dim parmList As New Generic.List(Of ReportParameter) - parmList.Add(New ReportParameter("Config_Name", Config_Name)) - parmList.Add(New ReportParameter("Config_AT", Config_AT)) - parmList.Add(New ReportParameter("Config_Cal", Config_Cal)) - parmList.Add(New ReportParameter("Config_Notes", Config_Notes)) - parmList.Add(New ReportParameter("Pro_Manu", Pro_Manu)) - parmList.Add(New ReportParameter("Pro_Name", Pro_Name)) - parmList.Add(New ReportParameter("Pro_Material", Pro_Material)) - parmList.Add(New ReportParameter("Pro_ShotNo", Pro_ShotNo)) - parmList.Add(New ReportParameter("Pro_SelectedLoad", Pro_SelectedLoad)) - parmList.Add(New ReportParameter("WAD_Manu", WAD_Manu)) - parmList.Add(New ReportParameter("WAD_Name", WAD_Name)) - parmList.Add(New ReportParameter("WAD_MaxLoad", WAD_MaxLoad)) - parmList.Add(New ReportParameter("Pri_Manu", Pri_Manu)) - parmList.Add(New ReportParameter("Pri_Name", Pri_Name)) - parmList.Add(New ReportParameter("Pri_PT", Pri_PT)) - parmList.Add(New ReportParameter("Case_Manu", Case_Manu)) - parmList.Add(New ReportParameter("Case_Name", Case_Name)) - parmList.Add(New ReportParameter("Case_TTL", Case_TTL)) - parmList.Add(New ReportParameter("Case_DRAM", Case_DRAM)) - If Config_ISPersonal Then - Config_PersonalLoad = "Yes" - Else - Config_PersonalLoad = "No (" & Config_Ref & ")" - End If - parmList.Add(New ReportParameter("Config_PersonalLoad", Config_PersonalLoad)) - Me.ReportViewer1.LocalReport.SetParameters(parmList) - Me.ReportViewer1.RefreshReport() - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmReport_Configuration_Sheet_SG_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call LoadData() - End Sub -End Class \ No newline at end of file +Namespace ViewReports + ''' + ''' Class frmReport_Configuration_Sheet_SG. + ''' Implements the + ''' + ''' + Public Class FrmReportConfigurationSheetSg + ''' + ''' The configuration identifier + ''' + Public ConfigId As Long + ''' + ''' The configuration name + ''' + Public ConfigName As String + ''' + ''' The configuration ammo type + ''' + Public ConfigAmmoType As String + ''' + ''' The configuration caliber + ''' + Public ConfigCaliber As String + ''' + ''' The configuration notes + ''' + Public ConfigNotes As String + ''' + ''' The projectile manufacturer + ''' + Public ProjectileManufacturer As String + ''' + ''' The projectile name + ''' + Public ProjectileName As String + ''' + ''' The projectile shot no + ''' + Public ProjectileShotNo As String + ''' + ''' The projectile material + ''' + Public ProjectileMaterial As String + ''' + ''' The projectile selected load + ''' + Public ProjectileSelectedLoad As String + ''' + ''' The wad manufacturer + ''' + Public WadManufacturer As String + ''' + ''' The wad name + ''' + Public WadName As String + ''' + ''' The wad maximum load + ''' + Public WadMaxLoad As String + ''' + ''' The primer manufacturer + ''' + Public PrimerManufacturer As String + ''' + ''' The primer name + ''' + Public PrimerName As String + ''' + ''' The primer type + ''' + Public PrimerType As String + ''' + ''' The case manufacturer + ''' + Public CaseManufacturer As String + ''' + ''' The case name + ''' + Public CaseName As String + ''' + ''' The case trim to length + ''' + Public CaseTrimToLength As String + ''' + ''' The case dram + ''' + Public CaseDram As String + ''' + ''' The configuration personal load + ''' + Dim _configPersonalLoad As String + ''' + ''' The configuration is personal + ''' + Public ConfigIsPersonal As Boolean + ''' + ''' The configuration favorite + ''' + Public ConfigFavorite As Boolean + ''' + ''' The configuration refference + ''' + Public ConfigRefference As String + ''' + ''' Loads the data. + ''' + Sub LoadData() + Try + Config_List_Powder_Data_SG_ViewTableAdapter.FillBy_ConfigID(MLLDataSet.Config_List_Powder_Data_SG_View, ConfigId) + Dim parmList As New List(Of ReportParameter) + parmList.Add(New ReportParameter("Config_Name", ConfigName)) + parmList.Add(New ReportParameter("Config_AT", ConfigAmmoType)) + parmList.Add(New ReportParameter("Config_Cal", ConfigCaliber)) + parmList.Add(New ReportParameter("Config_Notes", ConfigNotes)) + parmList.Add(New ReportParameter("Pro_Manu", ProjectileManufacturer)) + parmList.Add(New ReportParameter("Pro_Name", ProjectileName)) + parmList.Add(New ReportParameter("Pro_Material", ProjectileMaterial)) + parmList.Add(New ReportParameter("Pro_ShotNo", ProjectileShotNo)) + parmList.Add(New ReportParameter("Pro_SelectedLoad", ProjectileSelectedLoad)) + parmList.Add(New ReportParameter("WAD_Manu", WadManufacturer)) + parmList.Add(New ReportParameter("WAD_Name", WadName)) + parmList.Add(New ReportParameter("WAD_MaxLoad", WadMaxLoad)) + parmList.Add(New ReportParameter("Pri_Manu", PrimerManufacturer)) + parmList.Add(New ReportParameter("Pri_Name", PrimerName)) + parmList.Add(New ReportParameter("Pri_PT", PrimerType)) + parmList.Add(New ReportParameter("Case_Manu", CaseManufacturer)) + parmList.Add(New ReportParameter("Case_Name", CaseName)) + parmList.Add(New ReportParameter("Case_TTL", CaseTrimToLength)) + parmList.Add(New ReportParameter("Case_DRAM", CaseDram)) + If ConfigIsPersonal Then + _configPersonalLoad = "Yes" + Else + _configPersonalLoad = "No (" & ConfigRefference & ")" + End If + parmList.Add(New ReportParameter("Config_PersonalLoad", _configPersonalLoad)) + ReportViewer1.LocalReport.SetParameters(parmList) + ReportViewer1.RefreshReport() + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmReport_Configuration_Sheet_SG control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmReport_Configuration_Sheet_SG_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call LoadData() + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet_SG_Slug.vb b/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet_SG_Slug.vb index db5ec64..099dc91 100644 --- a/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet_SG_Slug.vb +++ b/BSMyLoadersLog/ViewReports/frmReport_Configuration_Sheet_SG_Slug.vb @@ -29,8 +29,8 @@ Public Class frmReport_Configuration_Sheet_SG_Slug Dim parmList As New Generic.List(Of ReportParameter) parmList.Add(New ReportParameter("Config_Name", Config_Name)) parmList.Add(New ReportParameter("Config_AT", Config_AT)) - parmList.Add(New ReportParameter("Config_Cal", Config_Cal)) - parmList.Add(New ReportParameter("Config_Notes", Config_Notes)) + parmList.Add(New ReportParameter("ConfigCaliber", Config_Cal)) + parmList.Add(New ReportParameter("ConfigNotes", Config_Notes)) parmList.Add(New ReportParameter("Pro_Manu", Pro_Manu)) parmList.Add(New ReportParameter("Pro_Name", Pro_Name)) @@ -39,7 +39,7 @@ Public Class frmReport_Configuration_Sheet_SG_Slug parmList.Add(New ReportParameter("WAD_Name", WAD_Name)) parmList.Add(New ReportParameter("WAD_MaxLoad", WAD_MaxLoad)) parmList.Add(New ReportParameter("Pri_Manu", Pri_Manu)) - parmList.Add(New ReportParameter("Pri_Name", Pri_Name)) + parmList.Add(New ReportParameter("PrimerName", Pri_Name)) parmList.Add(New ReportParameter("Pri_PT", Pri_PT)) parmList.Add(New ReportParameter("Case_Manu", Case_Manu)) parmList.Add(New ReportParameter("Case_Name", Case_Name)) diff --git a/BSMyLoadersLog/ViewReports/frmReport_Custom.vb b/BSMyLoadersLog/ViewReports/frmReport_Custom.vb index 78c6502..458e021 100644 --- a/BSMyLoadersLog/ViewReports/frmReport_Custom.vb +++ b/BSMyLoadersLog/ViewReports/frmReport_Custom.vb @@ -1,6 +1,10 @@ Imports BSMyLoadersLog.LoadersClass Imports BSMyLoadersLog.ImportExport.ExportModule +Imports BurnSoft.Applications.MLL + Public Class frmReport_Custom + ' TODO #18 Add Comments + Dim errOut as String Public SQL As String Private GridPrinter As DataGridPrinter Private MyDataTable As DataTable @@ -17,8 +21,10 @@ Public Class frmReport_Custom End Sub Sub LoadData() Try - Dim Obj As New BSDatabase - MyDataTable = Obj.GetData(SQL) + 'Dim Obj As New BSDatabase + 'MyDataTable = Obj.GetData(SQL) + MyDataTable = Database.GetDataFromTable(DatabasePath, SQL, errOut) + If errOut.Length > 0 then Throw new Exception(errOut) MyDataTable.TableName = Replace(ReportName, " ", "_") With DataGrid1 .DataSource = MyDataTable diff --git a/BSMyLoadersLog/Viewing/frmViewDataSheet_RiflePistols.Designer.vb b/BSMyLoadersLog/Viewing/frmViewDataSheet_RiflePistols.Designer.vb index ac8e34c..ee8467a 100644 --- a/BSMyLoadersLog/Viewing/frmViewDataSheet_RiflePistols.Designer.vb +++ b/BSMyLoadersLog/Viewing/frmViewDataSheet_RiflePistols.Designer.vb @@ -1,405 +1,407 @@ - _ -Partial Class frmViewDataSheet_RiflePistols - Inherits System.Windows.Forms.Form +Namespace Viewing + _ + Partial Class FrmViewDataSheetRiflePistols + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmViewDataSheet_RiflePistols)) - Me.ToolStrip1 = New System.Windows.Forms.ToolStrip - Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox - Me.ToolStripButton1 = New System.Windows.Forms.ToolStripDropDownButton - Me.ManuallyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.UseConfigurationToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.ToolStripSplitButton1 = New System.Windows.Forms.ToolStripSplitButton - Me.WithConfigToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.WithoutConfigToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton - Me.tslSerialNo = New System.Windows.Forms.ToolStripLabel - Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator - Me.tslCal = New System.Windows.Forms.ToolStripLabel - Me.ToolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator - Me.tslBarrel = New System.Windows.Forms.ToolStripLabel - Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton - Me.DataGridView1 = New System.Windows.Forms.DataGridView - Me.IdDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.DtDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.YdsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.GsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.NsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.PwmDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.BulletDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.PrimerDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.CaseDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.ConditionsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.TlDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.ConfigNameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.NotesDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.CopyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.LoadersLogNSGBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.Loaders_Log_NSGTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_NSGTableAdapter - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - Me.ToolStrip1.SuspendLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.ContextMenuStrip1.SuspendLayout() - CType(Me.LoadersLogNSGBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'ToolStrip1 - ' - Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripComboBox1, Me.ToolStripButton1, Me.ToolStripSplitButton1, Me.ToolStripButton2, Me.tslSerialNo, Me.ToolStripSeparator1, Me.tslCal, Me.ToolStripSeparator2, Me.tslBarrel, Me.ToolStripButton3}) - Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) - Me.ToolStrip1.Name = "ToolStrip1" - Me.ToolStrip1.Size = New System.Drawing.Size(589, 25) - Me.ToolStrip1.TabIndex = 0 - Me.ToolStrip1.Text = "ToolStrip1" - ' - 'ToolStripComboBox1 - ' - Me.ToolStripComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.ToolStripComboBox1.DropDownWidth = 150 - Me.ToolStripComboBox1.MaxDropDownItems = 100 - Me.ToolStripComboBox1.Name = "ToolStripComboBox1" - Me.ToolStripComboBox1.Size = New System.Drawing.Size(150, 25) - ' - 'ToolStripButton1 - ' - Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton1.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ManuallyToolStripMenuItem, Me.UseConfigurationToolStripMenuItem}) - Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) - Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton1.Name = "ToolStripButton1" - Me.ToolStripButton1.Size = New System.Drawing.Size(29, 22) - Me.ToolStripButton1.Text = "ToolStripButton1" - Me.ToolStripButton1.ToolTipText = "Add to Log" - ' - 'ManuallyToolStripMenuItem - ' - Me.ManuallyToolStripMenuItem.Name = "ManuallyToolStripMenuItem" - Me.ManuallyToolStripMenuItem.Size = New System.Drawing.Size(171, 22) - Me.ManuallyToolStripMenuItem.Text = "Manually" - ' - 'UseConfigurationToolStripMenuItem - ' - Me.UseConfigurationToolStripMenuItem.Name = "UseConfigurationToolStripMenuItem" - Me.UseConfigurationToolStripMenuItem.Size = New System.Drawing.Size(171, 22) - Me.UseConfigurationToolStripMenuItem.Text = "Use Configuration" - ' - 'ToolStripSplitButton1 - ' - Me.ToolStripSplitButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripSplitButton1.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.WithConfigToolStripMenuItem, Me.WithoutConfigToolStripMenuItem}) - Me.ToolStripSplitButton1.Image = CType(resources.GetObject("ToolStripSplitButton1.Image"), System.Drawing.Image) - Me.ToolStripSplitButton1.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripSplitButton1.Name = "ToolStripSplitButton1" - Me.ToolStripSplitButton1.Size = New System.Drawing.Size(32, 22) - Me.ToolStripSplitButton1.Text = "tsbPrint" - Me.ToolStripSplitButton1.ToolTipText = "View and Print Reports" - ' - 'WithConfigToolStripMenuItem - ' - Me.WithConfigToolStripMenuItem.Name = "WithConfigToolStripMenuItem" - Me.WithConfigToolStripMenuItem.Size = New System.Drawing.Size(157, 22) - Me.WithConfigToolStripMenuItem.Text = "With Config" - ' - 'WithoutConfigToolStripMenuItem - ' - Me.WithoutConfigToolStripMenuItem.Name = "WithoutConfigToolStripMenuItem" - Me.WithoutConfigToolStripMenuItem.Size = New System.Drawing.Size(157, 22) - Me.WithoutConfigToolStripMenuItem.Text = "Without Config" - ' - 'ToolStripButton2 - ' - Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) - Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton2.Name = "ToolStripButton2" - Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton2.Text = "Refresh List" - ' - 'tslSerialNo - ' - Me.tslSerialNo.Name = "tslSerialNo" - Me.tslSerialNo.Size = New System.Drawing.Size(57, 22) - Me.tslSerialNo.Text = "tslSerialNo" - ' - 'ToolStripSeparator1 - ' - Me.ToolStripSeparator1.Name = "ToolStripSeparator1" - Me.ToolStripSeparator1.Size = New System.Drawing.Size(6, 25) - ' - 'tslCal - ' - Me.tslCal.Name = "tslCal" - Me.tslCal.Size = New System.Drawing.Size(33, 22) - Me.tslCal.Text = "tslCal" - ' - 'ToolStripSeparator2 - ' - Me.ToolStripSeparator2.Name = "ToolStripSeparator2" - Me.ToolStripSeparator2.Size = New System.Drawing.Size(6, 25) - ' - 'tslBarrel - ' - Me.tslBarrel.Name = "tslBarrel" - Me.tslBarrel.Size = New System.Drawing.Size(46, 22) - Me.tslBarrel.Text = "tslBarrel" - ' - 'ToolStripButton3 - ' - Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) - Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton3.Name = "ToolStripButton3" - Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton3.Text = "Delete From Log" - ' - 'DataGridView1 - ' - Me.DataGridView1.AllowUserToAddRows = False - Me.DataGridView1.AutoGenerateColumns = False - Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IdDataGridViewTextBoxColumn, Me.DtDataGridViewTextBoxColumn, Me.YdsDataGridViewTextBoxColumn, Me.GsDataGridViewTextBoxColumn, Me.NsDataGridViewTextBoxColumn, Me.PwmDataGridViewTextBoxColumn, Me.BulletDataGridViewTextBoxColumn, Me.PrimerDataGridViewTextBoxColumn, Me.CaseDataGridViewTextBoxColumn, Me.ConditionsDataGridViewTextBoxColumn, Me.TlDataGridViewTextBoxColumn, Me.ConfigNameDataGridViewTextBoxColumn, Me.NotesDataGridViewTextBoxColumn}) - Me.DataGridView1.ContextMenuStrip = Me.ContextMenuStrip1 - Me.DataGridView1.DataSource = Me.LoadersLogNSGBindingSource - Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill - Me.DataGridView1.Location = New System.Drawing.Point(0, 25) - Me.DataGridView1.Name = "DataGridView1" - Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DataGridView1.Size = New System.Drawing.Size(589, 300) - Me.DataGridView1.TabIndex = 1 - ' - 'IdDataGridViewTextBoxColumn - ' - Me.IdDataGridViewTextBoxColumn.DataPropertyName = "id" - Me.IdDataGridViewTextBoxColumn.HeaderText = "id" - Me.IdDataGridViewTextBoxColumn.Name = "IdDataGridViewTextBoxColumn" - Me.IdDataGridViewTextBoxColumn.Visible = False - ' - 'DtDataGridViewTextBoxColumn - ' - Me.DtDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.DtDataGridViewTextBoxColumn.DataPropertyName = "dt" - Me.DtDataGridViewTextBoxColumn.HeaderText = "Date" - Me.DtDataGridViewTextBoxColumn.Name = "DtDataGridViewTextBoxColumn" - Me.DtDataGridViewTextBoxColumn.Width = 55 - ' - 'YdsDataGridViewTextBoxColumn - ' - Me.YdsDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.YdsDataGridViewTextBoxColumn.DataPropertyName = "yds" - Me.YdsDataGridViewTextBoxColumn.HeaderText = "Yards" - Me.YdsDataGridViewTextBoxColumn.Name = "YdsDataGridViewTextBoxColumn" - Me.YdsDataGridViewTextBoxColumn.Width = 59 - ' - 'GsDataGridViewTextBoxColumn - ' - Me.GsDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.GsDataGridViewTextBoxColumn.DataPropertyName = "gs" - Me.GsDataGridViewTextBoxColumn.HeaderText = "Group Size or Score" - Me.GsDataGridViewTextBoxColumn.Name = "GsDataGridViewTextBoxColumn" - Me.GsDataGridViewTextBoxColumn.Width = 91 - ' - 'NsDataGridViewTextBoxColumn - ' - Me.NsDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.NsDataGridViewTextBoxColumn.DataPropertyName = "ns" - Me.NsDataGridViewTextBoxColumn.HeaderText = "No. of Shots" - Me.NsDataGridViewTextBoxColumn.Name = "NsDataGridViewTextBoxColumn" - Me.NsDataGridViewTextBoxColumn.Width = 84 - ' - 'PwmDataGridViewTextBoxColumn - ' - Me.PwmDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.PwmDataGridViewTextBoxColumn.DataPropertyName = "pwm" - Me.PwmDataGridViewTextBoxColumn.HeaderText = "Powder - Wt. - MFG." - Me.PwmDataGridViewTextBoxColumn.Name = "PwmDataGridViewTextBoxColumn" - Me.PwmDataGridViewTextBoxColumn.Width = 87 - ' - 'BulletDataGridViewTextBoxColumn - ' - Me.BulletDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.BulletDataGridViewTextBoxColumn.DataPropertyName = "bullet" - Me.BulletDataGridViewTextBoxColumn.HeaderText = "Bullet" - Me.BulletDataGridViewTextBoxColumn.Name = "BulletDataGridViewTextBoxColumn" - Me.BulletDataGridViewTextBoxColumn.Width = 58 - ' - 'PrimerDataGridViewTextBoxColumn - ' - Me.PrimerDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.PrimerDataGridViewTextBoxColumn.DataPropertyName = "primer" - Me.PrimerDataGridViewTextBoxColumn.HeaderText = "Primer" - Me.PrimerDataGridViewTextBoxColumn.Name = "PrimerDataGridViewTextBoxColumn" - Me.PrimerDataGridViewTextBoxColumn.Width = 61 - ' - 'CaseDataGridViewTextBoxColumn - ' - Me.CaseDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.CaseDataGridViewTextBoxColumn.DataPropertyName = "case" - Me.CaseDataGridViewTextBoxColumn.HeaderText = "Case" - Me.CaseDataGridViewTextBoxColumn.Name = "CaseDataGridViewTextBoxColumn" - Me.CaseDataGridViewTextBoxColumn.Width = 56 - ' - 'ConditionsDataGridViewTextBoxColumn - ' - Me.ConditionsDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.ConditionsDataGridViewTextBoxColumn.DataPropertyName = "conditions" - Me.ConditionsDataGridViewTextBoxColumn.HeaderText = "Conditions" - Me.ConditionsDataGridViewTextBoxColumn.Name = "ConditionsDataGridViewTextBoxColumn" - Me.ConditionsDataGridViewTextBoxColumn.Width = 81 - ' - 'TlDataGridViewTextBoxColumn - ' - Me.TlDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.TlDataGridViewTextBoxColumn.DataPropertyName = "tl" - Me.TlDataGridViewTextBoxColumn.HeaderText = "Total Length" - Me.TlDataGridViewTextBoxColumn.Name = "TlDataGridViewTextBoxColumn" - Me.TlDataGridViewTextBoxColumn.Width = 85 - ' - 'ConfigNameDataGridViewTextBoxColumn - ' - Me.ConfigNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.ConfigNameDataGridViewTextBoxColumn.DataPropertyName = "ConfigName" - Me.ConfigNameDataGridViewTextBoxColumn.HeaderText = "Config Name" - Me.ConfigNameDataGridViewTextBoxColumn.Name = "ConfigNameDataGridViewTextBoxColumn" - Me.ConfigNameDataGridViewTextBoxColumn.Width = 86 - ' - 'NotesDataGridViewTextBoxColumn - ' - Me.NotesDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.NotesDataGridViewTextBoxColumn.DataPropertyName = "notes" - Me.NotesDataGridViewTextBoxColumn.HeaderText = "Notes" - Me.NotesDataGridViewTextBoxColumn.Name = "NotesDataGridViewTextBoxColumn" - Me.NotesDataGridViewTextBoxColumn.Width = 60 - ' - 'ContextMenuStrip1 - ' - Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EditToolStripMenuItem, Me.DeleteToolStripMenuItem, Me.CopyToolStripMenuItem}) - Me.ContextMenuStrip1.Name = "ContextMenuStrip1" - Me.ContextMenuStrip1.Size = New System.Drawing.Size(117, 70) - ' - 'EditToolStripMenuItem - ' - Me.EditToolStripMenuItem.Image = CType(resources.GetObject("EditToolStripMenuItem.Image"), System.Drawing.Image) - Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" - Me.EditToolStripMenuItem.Size = New System.Drawing.Size(116, 22) - Me.EditToolStripMenuItem.Text = "Edit" - ' - 'DeleteToolStripMenuItem - ' - Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) - Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" - Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(116, 22) - Me.DeleteToolStripMenuItem.Text = "Delete" - ' - 'CopyToolStripMenuItem - ' - Me.CopyToolStripMenuItem.Image = CType(resources.GetObject("CopyToolStripMenuItem.Image"), System.Drawing.Image) - Me.CopyToolStripMenuItem.Name = "CopyToolStripMenuItem" - Me.CopyToolStripMenuItem.Size = New System.Drawing.Size(116, 22) - Me.CopyToolStripMenuItem.Text = "Copy" - ' - 'LoadersLogNSGBindingSource - ' - Me.LoadersLogNSGBindingSource.DataMember = "Loaders_Log_NSG" - Me.LoadersLogNSGBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'Loaders_Log_NSGTableAdapter - ' - Me.Loaders_Log_NSGTableAdapter.ClearBeforeFill = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmViewDataSheet_RiflePistols - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(589, 325) - Me.Controls.Add(Me.DataGridView1) - Me.Controls.Add(Me.ToolStrip1) - Me.HelpProvider1.SetHelpKeyword(Me, "View Loaders Log - Rifle & Pistol") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "View Loaders Log - Rifle & Pistol") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmViewDataSheet_RiflePistols" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Loaders Log - Rifles & Pistols" - Me.ToolStrip1.ResumeLayout(False) - Me.ToolStrip1.PerformLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() - Me.ContextMenuStrip1.ResumeLayout(False) - CType(Me.LoadersLogNSGBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmViewDataSheetRiflePistols)) + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip + Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripDropDownButton + Me.ManuallyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.UseConfigurationToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.ToolStripSplitButton1 = New System.Windows.Forms.ToolStripSplitButton + Me.WithConfigToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.WithoutConfigToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton + Me.tslSerialNo = New System.Windows.Forms.ToolStripLabel + Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator + Me.tslCal = New System.Windows.Forms.ToolStripLabel + Me.ToolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator + Me.tslBarrel = New System.Windows.Forms.ToolStripLabel + Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton + Me.DataGridView1 = New System.Windows.Forms.DataGridView + Me.IdDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.DtDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.YdsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.GsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.NsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.PwmDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.BulletDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.PrimerDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.CaseDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.ConditionsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.TlDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.ConfigNameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.NotesDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.CopyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.LoadersLogNSGBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.Loaders_Log_NSGTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_NSGTableAdapter + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + Me.ToolStrip1.SuspendLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ContextMenuStrip1.SuspendLayout() + CType(Me.LoadersLogNSGBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'ToolStrip1 + ' + Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripComboBox1, Me.ToolStripButton1, Me.ToolStripSplitButton1, Me.ToolStripButton2, Me.tslSerialNo, Me.ToolStripSeparator1, Me.tslCal, Me.ToolStripSeparator2, Me.tslBarrel, Me.ToolStripButton3}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(589, 25) + Me.ToolStrip1.TabIndex = 0 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripComboBox1 + ' + Me.ToolStripComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.ToolStripComboBox1.DropDownWidth = 150 + Me.ToolStripComboBox1.MaxDropDownItems = 100 + Me.ToolStripComboBox1.Name = "ToolStripComboBox1" + Me.ToolStripComboBox1.Size = New System.Drawing.Size(150, 25) + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ManuallyToolStripMenuItem, Me.UseConfigurationToolStripMenuItem}) + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(29, 22) + Me.ToolStripButton1.Text = "ToolStripButton1" + Me.ToolStripButton1.ToolTipText = "Add to Log" + ' + 'ManuallyToolStripMenuItem + ' + Me.ManuallyToolStripMenuItem.Name = "ManuallyToolStripMenuItem" + Me.ManuallyToolStripMenuItem.Size = New System.Drawing.Size(171, 22) + Me.ManuallyToolStripMenuItem.Text = "Manually" + ' + 'UseConfigurationToolStripMenuItem + ' + Me.UseConfigurationToolStripMenuItem.Name = "UseConfigurationToolStripMenuItem" + Me.UseConfigurationToolStripMenuItem.Size = New System.Drawing.Size(171, 22) + Me.UseConfigurationToolStripMenuItem.Text = "Use Configuration" + ' + 'ToolStripSplitButton1 + ' + Me.ToolStripSplitButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripSplitButton1.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.WithConfigToolStripMenuItem, Me.WithoutConfigToolStripMenuItem}) + Me.ToolStripSplitButton1.Image = CType(resources.GetObject("ToolStripSplitButton1.Image"), System.Drawing.Image) + Me.ToolStripSplitButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripSplitButton1.Name = "ToolStripSplitButton1" + Me.ToolStripSplitButton1.Size = New System.Drawing.Size(32, 22) + Me.ToolStripSplitButton1.Text = "tsbPrint" + Me.ToolStripSplitButton1.ToolTipText = "View and Print Reports" + ' + 'WithConfigToolStripMenuItem + ' + Me.WithConfigToolStripMenuItem.Name = "WithConfigToolStripMenuItem" + Me.WithConfigToolStripMenuItem.Size = New System.Drawing.Size(157, 22) + Me.WithConfigToolStripMenuItem.Text = "With Config" + ' + 'WithoutConfigToolStripMenuItem + ' + Me.WithoutConfigToolStripMenuItem.Name = "WithoutConfigToolStripMenuItem" + Me.WithoutConfigToolStripMenuItem.Size = New System.Drawing.Size(157, 22) + Me.WithoutConfigToolStripMenuItem.Text = "Without Config" + ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton2.Text = "Refresh List" + ' + 'tslSerialNo + ' + Me.tslSerialNo.Name = "tslSerialNo" + Me.tslSerialNo.Size = New System.Drawing.Size(57, 22) + Me.tslSerialNo.Text = "tslSerialNo" + ' + 'ToolStripSeparator1 + ' + Me.ToolStripSeparator1.Name = "ToolStripSeparator1" + Me.ToolStripSeparator1.Size = New System.Drawing.Size(6, 25) + ' + 'tslCal + ' + Me.tslCal.Name = "tslCal" + Me.tslCal.Size = New System.Drawing.Size(33, 22) + Me.tslCal.Text = "tslCal" + ' + 'ToolStripSeparator2 + ' + Me.ToolStripSeparator2.Name = "ToolStripSeparator2" + Me.ToolStripSeparator2.Size = New System.Drawing.Size(6, 25) + ' + 'tslBarrel + ' + Me.tslBarrel.Name = "tslBarrel" + Me.tslBarrel.Size = New System.Drawing.Size(46, 22) + Me.tslBarrel.Text = "tslBarrel" + ' + 'ToolStripButton3 + ' + Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) + Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton3.Name = "ToolStripButton3" + Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton3.Text = "Delete From Log" + ' + 'DataGridView1 + ' + Me.DataGridView1.AllowUserToAddRows = False + Me.DataGridView1.AutoGenerateColumns = False + Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IdDataGridViewTextBoxColumn, Me.DtDataGridViewTextBoxColumn, Me.YdsDataGridViewTextBoxColumn, Me.GsDataGridViewTextBoxColumn, Me.NsDataGridViewTextBoxColumn, Me.PwmDataGridViewTextBoxColumn, Me.BulletDataGridViewTextBoxColumn, Me.PrimerDataGridViewTextBoxColumn, Me.CaseDataGridViewTextBoxColumn, Me.ConditionsDataGridViewTextBoxColumn, Me.TlDataGridViewTextBoxColumn, Me.ConfigNameDataGridViewTextBoxColumn, Me.NotesDataGridViewTextBoxColumn}) + Me.DataGridView1.ContextMenuStrip = Me.ContextMenuStrip1 + Me.DataGridView1.DataSource = Me.LoadersLogNSGBindingSource + Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill + Me.DataGridView1.Location = New System.Drawing.Point(0, 25) + Me.DataGridView1.Name = "DataGridView1" + Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DataGridView1.Size = New System.Drawing.Size(589, 300) + Me.DataGridView1.TabIndex = 1 + ' + 'IdDataGridViewTextBoxColumn + ' + Me.IdDataGridViewTextBoxColumn.DataPropertyName = "id" + Me.IdDataGridViewTextBoxColumn.HeaderText = "id" + Me.IdDataGridViewTextBoxColumn.Name = "IdDataGridViewTextBoxColumn" + Me.IdDataGridViewTextBoxColumn.Visible = False + ' + 'DtDataGridViewTextBoxColumn + ' + Me.DtDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.DtDataGridViewTextBoxColumn.DataPropertyName = "dt" + Me.DtDataGridViewTextBoxColumn.HeaderText = "Date" + Me.DtDataGridViewTextBoxColumn.Name = "DtDataGridViewTextBoxColumn" + Me.DtDataGridViewTextBoxColumn.Width = 55 + ' + 'YdsDataGridViewTextBoxColumn + ' + Me.YdsDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.YdsDataGridViewTextBoxColumn.DataPropertyName = "yds" + Me.YdsDataGridViewTextBoxColumn.HeaderText = "Yards" + Me.YdsDataGridViewTextBoxColumn.Name = "YdsDataGridViewTextBoxColumn" + Me.YdsDataGridViewTextBoxColumn.Width = 59 + ' + 'GsDataGridViewTextBoxColumn + ' + Me.GsDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.GsDataGridViewTextBoxColumn.DataPropertyName = "gs" + Me.GsDataGridViewTextBoxColumn.HeaderText = "Group Size or Score" + Me.GsDataGridViewTextBoxColumn.Name = "GsDataGridViewTextBoxColumn" + Me.GsDataGridViewTextBoxColumn.Width = 91 + ' + 'NsDataGridViewTextBoxColumn + ' + Me.NsDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.NsDataGridViewTextBoxColumn.DataPropertyName = "ns" + Me.NsDataGridViewTextBoxColumn.HeaderText = "No. of Shots" + Me.NsDataGridViewTextBoxColumn.Name = "NsDataGridViewTextBoxColumn" + Me.NsDataGridViewTextBoxColumn.Width = 84 + ' + 'PwmDataGridViewTextBoxColumn + ' + Me.PwmDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.PwmDataGridViewTextBoxColumn.DataPropertyName = "pwm" + Me.PwmDataGridViewTextBoxColumn.HeaderText = "Powder - Wt. - MFG." + Me.PwmDataGridViewTextBoxColumn.Name = "PwmDataGridViewTextBoxColumn" + Me.PwmDataGridViewTextBoxColumn.Width = 87 + ' + 'BulletDataGridViewTextBoxColumn + ' + Me.BulletDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.BulletDataGridViewTextBoxColumn.DataPropertyName = "bullet" + Me.BulletDataGridViewTextBoxColumn.HeaderText = "Bullet" + Me.BulletDataGridViewTextBoxColumn.Name = "BulletDataGridViewTextBoxColumn" + Me.BulletDataGridViewTextBoxColumn.Width = 58 + ' + 'PrimerDataGridViewTextBoxColumn + ' + Me.PrimerDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.PrimerDataGridViewTextBoxColumn.DataPropertyName = "primer" + Me.PrimerDataGridViewTextBoxColumn.HeaderText = "Primer" + Me.PrimerDataGridViewTextBoxColumn.Name = "PrimerDataGridViewTextBoxColumn" + Me.PrimerDataGridViewTextBoxColumn.Width = 61 + ' + 'CaseDataGridViewTextBoxColumn + ' + Me.CaseDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.CaseDataGridViewTextBoxColumn.DataPropertyName = "case" + Me.CaseDataGridViewTextBoxColumn.HeaderText = "Case" + Me.CaseDataGridViewTextBoxColumn.Name = "CaseDataGridViewTextBoxColumn" + Me.CaseDataGridViewTextBoxColumn.Width = 56 + ' + 'ConditionsDataGridViewTextBoxColumn + ' + Me.ConditionsDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.ConditionsDataGridViewTextBoxColumn.DataPropertyName = "conditions" + Me.ConditionsDataGridViewTextBoxColumn.HeaderText = "Conditions" + Me.ConditionsDataGridViewTextBoxColumn.Name = "ConditionsDataGridViewTextBoxColumn" + Me.ConditionsDataGridViewTextBoxColumn.Width = 81 + ' + 'TlDataGridViewTextBoxColumn + ' + Me.TlDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.TlDataGridViewTextBoxColumn.DataPropertyName = "tl" + Me.TlDataGridViewTextBoxColumn.HeaderText = "Total Length" + Me.TlDataGridViewTextBoxColumn.Name = "TlDataGridViewTextBoxColumn" + Me.TlDataGridViewTextBoxColumn.Width = 85 + ' + 'ConfigNameDataGridViewTextBoxColumn + ' + Me.ConfigNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.ConfigNameDataGridViewTextBoxColumn.DataPropertyName = "ConfigName" + Me.ConfigNameDataGridViewTextBoxColumn.HeaderText = "Config Name" + Me.ConfigNameDataGridViewTextBoxColumn.Name = "ConfigNameDataGridViewTextBoxColumn" + Me.ConfigNameDataGridViewTextBoxColumn.Width = 86 + ' + 'NotesDataGridViewTextBoxColumn + ' + Me.NotesDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.NotesDataGridViewTextBoxColumn.DataPropertyName = "notes" + Me.NotesDataGridViewTextBoxColumn.HeaderText = "Notes" + Me.NotesDataGridViewTextBoxColumn.Name = "NotesDataGridViewTextBoxColumn" + Me.NotesDataGridViewTextBoxColumn.Width = 60 + ' + 'ContextMenuStrip1 + ' + Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EditToolStripMenuItem, Me.DeleteToolStripMenuItem, Me.CopyToolStripMenuItem}) + Me.ContextMenuStrip1.Name = "ContextMenuStrip1" + Me.ContextMenuStrip1.Size = New System.Drawing.Size(117, 70) + ' + 'EditToolStripMenuItem + ' + Me.EditToolStripMenuItem.Image = CType(resources.GetObject("EditToolStripMenuItem.Image"), System.Drawing.Image) + Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" + Me.EditToolStripMenuItem.Size = New System.Drawing.Size(116, 22) + Me.EditToolStripMenuItem.Text = "Edit" + ' + 'DeleteToolStripMenuItem + ' + Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) + Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" + Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(116, 22) + Me.DeleteToolStripMenuItem.Text = "Delete" + ' + 'CopyToolStripMenuItem + ' + Me.CopyToolStripMenuItem.Image = CType(resources.GetObject("CopyToolStripMenuItem.Image"), System.Drawing.Image) + Me.CopyToolStripMenuItem.Name = "CopyToolStripMenuItem" + Me.CopyToolStripMenuItem.Size = New System.Drawing.Size(116, 22) + Me.CopyToolStripMenuItem.Text = "Copy" + ' + 'LoadersLogNSGBindingSource + ' + Me.LoadersLogNSGBindingSource.DataMember = "Loaders_Log_NSG" + Me.LoadersLogNSGBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'Loaders_Log_NSGTableAdapter + ' + Me.Loaders_Log_NSGTableAdapter.ClearBeforeFill = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmViewDataSheet_RiflePistols + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(589, 325) + Me.Controls.Add(Me.DataGridView1) + Me.Controls.Add(Me.ToolStrip1) + Me.HelpProvider1.SetHelpKeyword(Me, "View Loaders Log - Rifle & Pistol") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "View Loaders Log - Rifle & Pistol") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.Name = "FrmViewDataSheetRiflePistols" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Loaders Log - Rifles & Pistols" + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ContextMenuStrip1.ResumeLayout(False) + CType(Me.LoadersLogNSGBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip - Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView - Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents LoadersLogNSGBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents Loaders_Log_NSGTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_NSGTableAdapter - Friend WithEvents IdDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents DtDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents YdsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents GsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents NsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents PwmDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents BulletDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents PrimerDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents CaseDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents ConditionsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents TlDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents ConfigNameDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents NotesDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripDropDownButton - Friend WithEvents ManuallyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents UseConfigurationToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents tslSerialNo As System.Windows.Forms.ToolStripLabel - Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator - Friend WithEvents tslCal As System.Windows.Forms.ToolStripLabel - Friend WithEvents ToolStripSeparator2 As System.Windows.Forms.ToolStripSeparator - Friend WithEvents tslBarrel As System.Windows.Forms.ToolStripLabel - Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripSplitButton1 As System.Windows.Forms.ToolStripSplitButton - Friend WithEvents WithConfigToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents WithoutConfigToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider - Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton - Friend WithEvents ContextMenuStrip1 As System.Windows.Forms.ContextMenuStrip - Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents CopyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem -End Class + End Sub + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView + Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents LoadersLogNSGBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents Loaders_Log_NSGTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_NSGTableAdapter + Friend WithEvents IdDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents DtDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents YdsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents GsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents NsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents PwmDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents BulletDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents PrimerDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents CaseDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents ConditionsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents TlDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents ConfigNameDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents NotesDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripDropDownButton + Friend WithEvents ManuallyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents UseConfigurationToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents tslSerialNo As System.Windows.Forms.ToolStripLabel + Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator + Friend WithEvents tslCal As System.Windows.Forms.ToolStripLabel + Friend WithEvents ToolStripSeparator2 As System.Windows.Forms.ToolStripSeparator + Friend WithEvents tslBarrel As System.Windows.Forms.ToolStripLabel + Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripSplitButton1 As System.Windows.Forms.ToolStripSplitButton + Friend WithEvents WithConfigToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents WithoutConfigToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton + Friend WithEvents ContextMenuStrip1 As System.Windows.Forms.ContextMenuStrip + Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents CopyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmViewDataSheet_RiflePistols.vb b/BSMyLoadersLog/Viewing/frmViewDataSheet_RiflePistols.vb index b92c08c..95a2663 100644 --- a/BSMyLoadersLog/Viewing/frmViewDataSheet_RiflePistols.vb +++ b/BSMyLoadersLog/Viewing/frmViewDataSheet_RiflePistols.vb @@ -1,161 +1,247 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc Imports BSMyLoadersLog.Adding +Imports BurnSoft.Applications.MLL.LoadersLog +Imports BurnSoft.Applications.MLL.Types -Public Class frmViewDataSheet_RiflePistols - Public FID As Long - Public FirearmName As String - Sub LoadComboBox() - Try - Dim Obj As New BSDatabase - Dim i As Integer = 0 - Dim SQL As String = "select * from Loaders_Log_Firearms where GType not like '%shotgun%' and exclude=0 order by FullName ASC" - Call Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - ToolStripComboBox1.Items.Clear() - While RS.Read - ToolStripComboBox1.Items.Add(RS("FullName")) - If i = 0 Then ToolStripComboBox1.Text = RS("FullName") - i += 1 - End While - RS.Close() - RS = Nothing - CMD = Nothing - Obj.CloseDB() - Catch ex As Exception - Dim strProcedure As String = "LoadComboBox" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Sub UpdateLabels() - Try - Dim Obj As New GlobalFunctions - FID = Obj.GetFirearmID(FirearmName) - Dim sCal As String = "" - Dim sSerial As String = "" - Dim sBar As String = "" - Call Obj.GetFirearmDetails(FID, 0, "", "", "", sCal, sBar, sSerial) - tslCal.Text = "Caliber: " & sCal - tslBarrel.Text = "Barrel: " & sBar - tslSerialNo.Text = "Serial No.: " & sSerial - Catch ex As Exception - Dim strProcedure As String = "UpdateLabels" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Sub LoadDatabyID() - Me.Loaders_Log_NSGTableAdapter.FillBy_FID(Me.MLLDataSet.Loaders_Log_NSG, FID) - End Sub - Sub LoadDatabyName() - Me.Loaders_Log_NSGTableAdapter.FillBy_FirearmName(Me.MLLDataSet.Loaders_Log_NSG, FirearmName) - End Sub - Public Sub LoadData() +Namespace Viewing + ''' + ''' Class FrmViewDataSheetRiflePistols. + ''' Implements the + ''' + ''' + Public Class FrmViewDataSheetRiflePistols + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' The firearm identifier + ''' + Dim _firearmId As Long + ''' + ''' The firearm name + ''' + Dim _firearmName As String + ''' + ''' Loads the ComboBox. + ''' + Sub LoadComboBox() + Try + Dim i As Integer = 0 + Dim lst as List(Of FirearmCollection) = Firearms.GetAll(DatabasePath, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As FirearmCollection In lst + If Not o.GunType.ToLower().Contains("shotgun") Then + If Not o.Exclude Then + ToolStripComboBox1.Items.Add(o.FullName) + If i = 0 Then ToolStripComboBox1.Text = o.FullName + i += 1 + End If + End If + Next + Catch ex As Exception + Call LogError(Name, "LoadComboBox", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Updates the labels. + ''' + ''' + Sub UpdateLabels() + Try + _firearmId = Firearms.GetId(DatabasePath, _firearmName, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) - Call LoadComboBox() - If FID = 0 Then - FirearmName = ToolStripComboBox1.Text + Dim lst as List(Of FirearmCollection) = Firearms.GetDetails(DatabasePath,CInt(_firearmId), _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + For Each o As FirearmCollection In lst + tslCal.Text = $"Caliber: {o.Caliber}" + tslBarrel.Text = $"Barrel: {o.Barrel}" + tslSerialNo.Text = $"Serial No.: {o.SerialNo}" + Next + Catch ex As Exception + Call LogError(Name, "UpdateLabels", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Loads the databy identifier. + ''' + Sub LoadDatabyId() + Loaders_Log_NSGTableAdapter.FillBy_FID(MLLDataSet.Loaders_Log_NSG, _firearmId) + End Sub + ''' + ''' Loads the name of the databy. + ''' + Sub LoadDatabyName() + Loaders_Log_NSGTableAdapter.FillBy_FirearmName(MLLDataSet.Loaders_Log_NSG, _firearmName) + End Sub + ''' + ''' Loads the data. + ''' + Public Sub LoadData() + Call LoadComboBox() + If _firearmId = 0 Then + _firearmName = ToolStripComboBox1.Text + Call LoadDatabyName() + Else + Call LoadDatabyId() + ToolStripComboBox1.Text = _firearmName + End If + Call UpdateLabels() + End Sub + ''' + ''' Loads the data current. + ''' + Public Sub LoadDataCur() + _firearmName = ToolStripComboBox1.Text Call LoadDatabyName() - Else - Call LoadDatabyID() - ToolStripComboBox1.Text = FirearmName - End If - Call UpdateLabels() - End Sub - Public Sub LoadDataCur() - FirearmName = ToolStripComboBox1.Text - Call LoadDatabyName() - Call UpdateLabels() - End Sub - Private Sub frmViewDataSheet_RiflePistols_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call LoadData() - End Sub - Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged - Call LoadDataCur() - End Sub - Private Sub frmViewDataSheet_RiflePistols_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize - If Me.Height <> 0 Then - Me.DataGridView1.Height = Me.Height - (65) - Me.DataGridView1.Width = Me.Width - 15 - End If - End Sub - Private Sub UseConfigurationToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UseConfigurationToolStripMenuItem.Click - Dim frmNew As New FrmAddDataSheetRiflePistolsCfg - frmNew.Fid = FID - frmNew.MdiParent = Me.MdiParent - frmNew.FromView = True - frmNew.Show() - End Sub + Call UpdateLabels() + End Sub + ''' + ''' Handles the Load event of the frmViewDataSheet_RiflePistols control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmViewDataSheet_RiflePistols_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call LoadData() + End Sub + ''' + ''' Handles the SelectedIndexChanged event of the ToolStripComboBox1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged + Call LoadDataCur() + End Sub + ''' + ''' Handles the Resize event of the frmViewDataSheet_RiflePistols control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmViewDataSheet_RiflePistols_Resize(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Resize + If Height <> 0 Then + DataGridView1.Height = Height - (65) + DataGridView1.Width = Width - 15 + End If + End Sub + ''' + ''' Handles the Click event of the UseConfigurationToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub UseConfigurationToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles UseConfigurationToolStripMenuItem.Click + Dim frmNew As New FrmAddDataSheetRiflePistolsCfg + frmNew.Fid = _firearmId + frmNew.MdiParent = MdiParent + frmNew.FromView = True + frmNew.Show() + End Sub + ''' + ''' Handles the Click event of the ManuallyToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ManuallyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ManuallyToolStripMenuItem.Click + Dim frmNew As New FrmAddDataSheetRiflePistolsMan + frmNew.Fid = _firearmId + frmNew.MdiParent = MdiParent + frmNew.FromView = True + frmNew.Show() + End Sub + ''' + ''' Handles the Click event of the ToolStripButton2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton2.Click + Call LoadDataCur() + End Sub + ''' + ''' Handles the Click event of the WithConfigToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub WithConfigToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles WithConfigToolStripMenuItem.Click + Cursor = Cursors.WaitCursor + Dim frmNew As New frmReport_DataLoader_RiflePistol + frmNew.FID = _firearmId + frmNew.FirearmName = _firearmName + frmNew.MdiParent = MdiParent + frmNew.Show() + Cursor = Cursors.Arrow + End Sub + ''' + ''' Handles the Click event of the WithoutConfigToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub WithoutConfigToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles WithoutConfigToolStripMenuItem.Click + Cursor = Cursors.WaitCursor + Dim frmNew As New frmReport_DataLoader_RiflePistolWOC + frmNew.FID = _firearmId + frmNew.FirearmName = _firearmName + frmNew.MdiParent = MdiParent + frmNew.Show() + Cursor = Cursors.Arrow + End Sub + ''' + ''' Deletes the log data. + ''' + ''' + Sub Delete_LogData() + Try + Dim itemId As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim strAns As String = MsgBox("Are you sure you want to delete this from the Log?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Private Sub ManuallyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ManuallyToolStripMenuItem.Click - Dim frmNew As New FrmAddDataSheetRiflePistolsMan - frmNew.Fid = FID - frmNew.MdiParent = Me.MdiParent - frmNew.FromView = True - frmNew.Show() - End Sub - - Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click - Call LoadDataCur() - End Sub - - Private Sub WithConfigToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WithConfigToolStripMenuItem.Click - Me.Cursor = Cursors.WaitCursor - Dim frmNew As New frmReport_DataLoader_RiflePistol - frmNew.FID = FID - frmNew.FirearmName = FirearmName - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - Me.Cursor = Cursors.Arrow - End Sub - - Private Sub WithoutConfigToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WithoutConfigToolStripMenuItem.Click - Me.Cursor = Cursors.WaitCursor - Dim frmNew As New frmReport_DataLoader_RiflePistolWOC - frmNew.FID = FID - frmNew.FirearmName = FirearmName - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - Me.Cursor = Cursors.Arrow - End Sub - Sub Delete_LogData() - Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strSQLTable As String = "Loaders_Log_NSG" - Dim strAns As String = MsgBox("Are you sure you want to delete this from the Log?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & ItemID - If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadDataCur() - Catch ex As Exception - Dim strProcedure As String = "LoadData" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click - Call Delete_LogData() - End Sub - - Private Sub DeleteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click - Call Delete_LogData() - End Sub - - Private Sub EditToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EditToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim frmNew As New frmEditDataSheet_RiflePistols - frmNew.CFGID = ItemID - frmNew.FromView = True - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - End Sub - - Private Sub CopyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyToolStripMenuItem.Click - Dim frmNew As New frmCopy_DataSheet_RiflePistol - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - frmNew.CFGID = ItemID - frmNew.FromView = True - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - End Sub -End Class \ No newline at end of file + If strAns = vbYes Then + If Not LoadersLogMetallic.Delete(DatabasePath, CLng(itemId), _errOut) Then Throw New Exception(_errOut) + Call LoadDataCur() + End If + Catch ex As Exception + Dim strProcedure As String = "LoadData" + Call LogError(Name, strProcedure, Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click + Call Delete_LogData() + End Sub + ''' + ''' Handles the Click event of the DeleteToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DeleteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles DeleteToolStripMenuItem.Click + Call Delete_LogData() + End Sub + ''' + ''' Handles the Click event of the EditToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub EditToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EditToolStripMenuItem.Click + Dim itemId As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim frmNew As New frmEditDataSheet_RiflePistols + frmNew.CFGID = itemId + frmNew.FromView = True + frmNew.MdiParent = MdiParent + frmNew.Show() + End Sub + ''' + ''' Handles the Click event of the CopyToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub CopyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CopyToolStripMenuItem.Click + Dim frmNew As New FrmCopyDataSheetRiflePistol + Dim itemId As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + frmNew.ConfigId = itemId + frmNew.FromView = True + frmNew.MdiParent = MdiParent + frmNew.Show() + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmViewDataSheet_Shotgun.Designer.vb b/BSMyLoadersLog/Viewing/frmViewDataSheet_Shotgun.Designer.vb index c220698..d9e1cf9 100644 --- a/BSMyLoadersLog/Viewing/frmViewDataSheet_Shotgun.Designer.vb +++ b/BSMyLoadersLog/Viewing/frmViewDataSheet_Shotgun.Designer.vb @@ -1,380 +1,382 @@ - _ -Partial Class frmViewDataSheet_Shotgun - Inherits System.Windows.Forms.Form +Namespace Viewing + _ + Partial Class FrmViewDataSheetShotgun + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmViewDataSheet_Shotgun)) - Me.ToolStrip1 = New System.Windows.Forms.ToolStrip() - Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox() - Me.ToolStripButton1 = New System.Windows.Forms.ToolStripDropDownButton() - Me.ManuallyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.UseConfigurationToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.ToolStripSplitButton1 = New System.Windows.Forms.ToolStripSplitButton() - Me.WithConfigToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.WithoutConfigToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton() - Me.tslSerialNo = New System.Windows.Forms.ToolStripLabel() - Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() - Me.tslCal = New System.Windows.Forms.ToolStripLabel() - Me.ToolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator() - Me.tslBarrel = New System.Windows.Forms.ToolStripLabel() - Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton() - Me.DataGridView1 = New System.Windows.Forms.DataGridView() - Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.DtDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.ShotwtDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.ShotSizeDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.CaseDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PbmDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.WadDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PrimerDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PdDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.YdsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.ConfigNameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.NotesDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.LoadersLogSGBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet() - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider() - Me.Loaders_Log_SGTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_SGTableAdapter() - Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.CopyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.ToolStrip1.SuspendLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.LoadersLogSGBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.ContextMenuStrip1.SuspendLayout() - Me.SuspendLayout() - ' - 'ToolStrip1 - ' - Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripComboBox1, Me.ToolStripButton1, Me.ToolStripSplitButton1, Me.ToolStripButton2, Me.tslSerialNo, Me.ToolStripSeparator1, Me.tslCal, Me.ToolStripSeparator2, Me.tslBarrel, Me.ToolStripButton3}) - Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) - Me.ToolStrip1.Name = "ToolStrip1" - Me.ToolStrip1.Size = New System.Drawing.Size(648, 25) - Me.ToolStrip1.TabIndex = 1 - Me.ToolStrip1.Text = "ToolStrip1" - ' - 'ToolStripComboBox1 - ' - Me.ToolStripComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.ToolStripComboBox1.DropDownWidth = 150 - Me.ToolStripComboBox1.MaxDropDownItems = 100 - Me.ToolStripComboBox1.Name = "ToolStripComboBox1" - Me.ToolStripComboBox1.Size = New System.Drawing.Size(150, 25) - ' - 'ToolStripButton1 - ' - Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton1.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ManuallyToolStripMenuItem, Me.UseConfigurationToolStripMenuItem}) - Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) - Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton1.Name = "ToolStripButton1" - Me.ToolStripButton1.Size = New System.Drawing.Size(29, 22) - Me.ToolStripButton1.Text = "ToolStripButton1" - Me.ToolStripButton1.ToolTipText = "Add to Log" - ' - 'ManuallyToolStripMenuItem - ' - Me.ManuallyToolStripMenuItem.Name = "ManuallyToolStripMenuItem" - Me.ManuallyToolStripMenuItem.Size = New System.Drawing.Size(170, 22) - Me.ManuallyToolStripMenuItem.Text = "Manually" - ' - 'UseConfigurationToolStripMenuItem - ' - Me.UseConfigurationToolStripMenuItem.Name = "UseConfigurationToolStripMenuItem" - Me.UseConfigurationToolStripMenuItem.Size = New System.Drawing.Size(170, 22) - Me.UseConfigurationToolStripMenuItem.Text = "Use Configuration" - ' - 'ToolStripSplitButton1 - ' - Me.ToolStripSplitButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripSplitButton1.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.WithConfigToolStripMenuItem, Me.WithoutConfigToolStripMenuItem}) - Me.ToolStripSplitButton1.Image = CType(resources.GetObject("ToolStripSplitButton1.Image"), System.Drawing.Image) - Me.ToolStripSplitButton1.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripSplitButton1.Name = "ToolStripSplitButton1" - Me.ToolStripSplitButton1.Size = New System.Drawing.Size(32, 22) - Me.ToolStripSplitButton1.Text = "tsbPrint" - Me.ToolStripSplitButton1.ToolTipText = "View and Print Reports" - ' - 'WithConfigToolStripMenuItem - ' - Me.WithConfigToolStripMenuItem.Name = "WithConfigToolStripMenuItem" - Me.WithConfigToolStripMenuItem.Size = New System.Drawing.Size(156, 22) - Me.WithConfigToolStripMenuItem.Text = "With Config" - ' - 'WithoutConfigToolStripMenuItem - ' - Me.WithoutConfigToolStripMenuItem.Name = "WithoutConfigToolStripMenuItem" - Me.WithoutConfigToolStripMenuItem.Size = New System.Drawing.Size(156, 22) - Me.WithoutConfigToolStripMenuItem.Text = "Without Config" - ' - 'ToolStripButton2 - ' - Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) - Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton2.Name = "ToolStripButton2" - Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton2.Text = "Refresh List" - ' - 'tslSerialNo - ' - Me.tslSerialNo.Name = "tslSerialNo" - Me.tslSerialNo.Size = New System.Drawing.Size(63, 22) - Me.tslSerialNo.Text = "tslSerialNo" - ' - 'ToolStripSeparator1 - ' - Me.ToolStripSeparator1.Name = "ToolStripSeparator1" - Me.ToolStripSeparator1.Size = New System.Drawing.Size(6, 25) - ' - 'tslCal - ' - Me.tslCal.Name = "tslCal" - Me.tslCal.Size = New System.Drawing.Size(36, 22) - Me.tslCal.Text = "tslCal" - ' - 'ToolStripSeparator2 - ' - Me.ToolStripSeparator2.Name = "ToolStripSeparator2" - Me.ToolStripSeparator2.Size = New System.Drawing.Size(6, 25) - ' - 'tslBarrel - ' - Me.tslBarrel.Name = "tslBarrel" - Me.tslBarrel.Size = New System.Drawing.Size(49, 22) - Me.tslBarrel.Text = "tslBarrel" - ' - 'ToolStripButton3 - ' - Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) - Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton3.Name = "ToolStripButton3" - Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton3.Text = "ToolStripButton3" - ' - 'DataGridView1 - ' - Me.DataGridView1.AllowUserToAddRows = False - Me.DataGridView1.AutoGenerateColumns = False - Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.DtDataGridViewTextBoxColumn, Me.ShotwtDataGridViewTextBoxColumn, Me.ShotSizeDataGridViewTextBoxColumn, Me.CaseDataGridViewTextBoxColumn, Me.PbmDataGridViewTextBoxColumn, Me.WadDataGridViewTextBoxColumn, Me.PrimerDataGridViewTextBoxColumn, Me.PdDataGridViewTextBoxColumn, Me.YdsDataGridViewTextBoxColumn, Me.ConfigNameDataGridViewTextBoxColumn, Me.NotesDataGridViewTextBoxColumn}) - Me.DataGridView1.DataSource = Me.LoadersLogSGBindingSource - Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill - Me.DataGridView1.Location = New System.Drawing.Point(0, 25) - Me.DataGridView1.Name = "DataGridView1" - Me.DataGridView1.ReadOnly = True - Me.DataGridView1.Size = New System.Drawing.Size(648, 241) - Me.DataGridView1.TabIndex = 2 - ' - 'IDDataGridViewTextBoxColumn - ' - Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" - Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" - Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" - Me.IDDataGridViewTextBoxColumn.ReadOnly = True - Me.IDDataGridViewTextBoxColumn.Visible = False - ' - 'DtDataGridViewTextBoxColumn - ' - Me.DtDataGridViewTextBoxColumn.DataPropertyName = "dt" - Me.DtDataGridViewTextBoxColumn.HeaderText = "Date & Time" - Me.DtDataGridViewTextBoxColumn.Name = "DtDataGridViewTextBoxColumn" - Me.DtDataGridViewTextBoxColumn.ReadOnly = True - ' - 'ShotwtDataGridViewTextBoxColumn - ' - Me.ShotwtDataGridViewTextBoxColumn.DataPropertyName = "Shotwt" - Me.ShotwtDataGridViewTextBoxColumn.HeaderText = "Shot Weight" - Me.ShotwtDataGridViewTextBoxColumn.Name = "ShotwtDataGridViewTextBoxColumn" - Me.ShotwtDataGridViewTextBoxColumn.ReadOnly = True - ' - 'ShotSizeDataGridViewTextBoxColumn - ' - Me.ShotSizeDataGridViewTextBoxColumn.DataPropertyName = "ShotSize" - Me.ShotSizeDataGridViewTextBoxColumn.HeaderText = "Shot Size No. - MFG" - Me.ShotSizeDataGridViewTextBoxColumn.Name = "ShotSizeDataGridViewTextBoxColumn" - Me.ShotSizeDataGridViewTextBoxColumn.ReadOnly = True - ' - 'CaseDataGridViewTextBoxColumn - ' - Me.CaseDataGridViewTextBoxColumn.DataPropertyName = "case" - Me.CaseDataGridViewTextBoxColumn.HeaderText = "Case Length - MFG" - Me.CaseDataGridViewTextBoxColumn.Name = "CaseDataGridViewTextBoxColumn" - Me.CaseDataGridViewTextBoxColumn.ReadOnly = True - ' - 'PbmDataGridViewTextBoxColumn - ' - Me.PbmDataGridViewTextBoxColumn.DataPropertyName = "pbm" - Me.PbmDataGridViewTextBoxColumn.HeaderText = "Powder - bushing - MFG" - Me.PbmDataGridViewTextBoxColumn.Name = "PbmDataGridViewTextBoxColumn" - Me.PbmDataGridViewTextBoxColumn.ReadOnly = True - ' - 'WadDataGridViewTextBoxColumn - ' - Me.WadDataGridViewTextBoxColumn.DataPropertyName = "wad" - Me.WadDataGridViewTextBoxColumn.HeaderText = "WAD" - Me.WadDataGridViewTextBoxColumn.Name = "WadDataGridViewTextBoxColumn" - Me.WadDataGridViewTextBoxColumn.ReadOnly = True - ' - 'PrimerDataGridViewTextBoxColumn - ' - Me.PrimerDataGridViewTextBoxColumn.DataPropertyName = "primer" - Me.PrimerDataGridViewTextBoxColumn.HeaderText = "Primer" - Me.PrimerDataGridViewTextBoxColumn.Name = "PrimerDataGridViewTextBoxColumn" - Me.PrimerDataGridViewTextBoxColumn.ReadOnly = True - ' - 'PdDataGridViewTextBoxColumn - ' - Me.PdDataGridViewTextBoxColumn.DataPropertyName = "pd" - Me.PdDataGridViewTextBoxColumn.HeaderText = "Pattern Density" - Me.PdDataGridViewTextBoxColumn.Name = "PdDataGridViewTextBoxColumn" - Me.PdDataGridViewTextBoxColumn.ReadOnly = True - ' - 'YdsDataGridViewTextBoxColumn - ' - Me.YdsDataGridViewTextBoxColumn.DataPropertyName = "yds" - Me.YdsDataGridViewTextBoxColumn.HeaderText = "Yards" - Me.YdsDataGridViewTextBoxColumn.Name = "YdsDataGridViewTextBoxColumn" - Me.YdsDataGridViewTextBoxColumn.ReadOnly = True - ' - 'ConfigNameDataGridViewTextBoxColumn - ' - Me.ConfigNameDataGridViewTextBoxColumn.DataPropertyName = "ConfigName" - Me.ConfigNameDataGridViewTextBoxColumn.HeaderText = "ConfigName" - Me.ConfigNameDataGridViewTextBoxColumn.Name = "ConfigNameDataGridViewTextBoxColumn" - Me.ConfigNameDataGridViewTextBoxColumn.ReadOnly = True - ' - 'NotesDataGridViewTextBoxColumn - ' - Me.NotesDataGridViewTextBoxColumn.DataPropertyName = "notes" - Me.NotesDataGridViewTextBoxColumn.HeaderText = "Notes" - Me.NotesDataGridViewTextBoxColumn.Name = "NotesDataGridViewTextBoxColumn" - Me.NotesDataGridViewTextBoxColumn.ReadOnly = True - ' - 'LoadersLogSGBindingSource - ' - Me.LoadersLogSGBindingSource.DataMember = "Loaders_Log_SG" - Me.LoadersLogSGBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'Loaders_Log_SGTableAdapter - ' - Me.Loaders_Log_SGTableAdapter.ClearBeforeFill = True - ' - 'ContextMenuStrip1 - ' - Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EditToolStripMenuItem, Me.DeleteToolStripMenuItem, Me.CopyToolStripMenuItem}) - Me.ContextMenuStrip1.Name = "ContextMenuStrip1" - Me.ContextMenuStrip1.Size = New System.Drawing.Size(153, 92) - ' - 'EditToolStripMenuItem - ' - Me.EditToolStripMenuItem.Image = CType(resources.GetObject("EditToolStripMenuItem.Image"), System.Drawing.Image) - Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" - Me.EditToolStripMenuItem.Size = New System.Drawing.Size(152, 22) - Me.EditToolStripMenuItem.Text = "Edit" - ' - 'DeleteToolStripMenuItem - ' - Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) - Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" - Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(152, 22) - Me.DeleteToolStripMenuItem.Text = "Delete" - ' - 'CopyToolStripMenuItem - ' - Me.CopyToolStripMenuItem.Image = CType(resources.GetObject("CopyToolStripMenuItem.Image"), System.Drawing.Image) - Me.CopyToolStripMenuItem.Name = "CopyToolStripMenuItem" - Me.CopyToolStripMenuItem.Size = New System.Drawing.Size(152, 22) - Me.CopyToolStripMenuItem.Text = "Copy" - ' - 'frmViewDataSheet_Shotgun - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(648, 266) - Me.Controls.Add(Me.DataGridView1) - Me.Controls.Add(Me.ToolStrip1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmViewDataSheet_Shotgun" - Me.Text = "Loaders Log - Shotgun" - Me.ToolStrip1.ResumeLayout(False) - Me.ToolStrip1.PerformLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.LoadersLogSGBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ContextMenuStrip1.ResumeLayout(False) - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmViewDataSheetShotgun)) + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip() + Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox() + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripDropDownButton() + Me.ManuallyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.UseConfigurationToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripSplitButton1 = New System.Windows.Forms.ToolStripSplitButton() + Me.WithConfigToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.WithoutConfigToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton() + Me.tslSerialNo = New System.Windows.Forms.ToolStripLabel() + Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() + Me.tslCal = New System.Windows.Forms.ToolStripLabel() + Me.ToolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator() + Me.tslBarrel = New System.Windows.Forms.ToolStripLabel() + Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton() + Me.DataGridView1 = New System.Windows.Forms.DataGridView() + Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.DtDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.ShotwtDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.ShotSizeDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.CaseDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PbmDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.WadDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PrimerDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PdDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.YdsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.ConfigNameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.NotesDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.LoadersLogSGBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet() + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider() + Me.Loaders_Log_SGTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_SGTableAdapter() + Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.CopyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStrip1.SuspendLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LoadersLogSGBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ContextMenuStrip1.SuspendLayout() + Me.SuspendLayout() + ' + 'ToolStrip1 + ' + Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripComboBox1, Me.ToolStripButton1, Me.ToolStripSplitButton1, Me.ToolStripButton2, Me.tslSerialNo, Me.ToolStripSeparator1, Me.tslCal, Me.ToolStripSeparator2, Me.tslBarrel, Me.ToolStripButton3}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(648, 25) + Me.ToolStrip1.TabIndex = 1 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripComboBox1 + ' + Me.ToolStripComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.ToolStripComboBox1.DropDownWidth = 150 + Me.ToolStripComboBox1.MaxDropDownItems = 100 + Me.ToolStripComboBox1.Name = "ToolStripComboBox1" + Me.ToolStripComboBox1.Size = New System.Drawing.Size(150, 25) + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ManuallyToolStripMenuItem, Me.UseConfigurationToolStripMenuItem}) + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(29, 22) + Me.ToolStripButton1.Text = "ToolStripButton1" + Me.ToolStripButton1.ToolTipText = "Add to Log" + ' + 'ManuallyToolStripMenuItem + ' + Me.ManuallyToolStripMenuItem.Name = "ManuallyToolStripMenuItem" + Me.ManuallyToolStripMenuItem.Size = New System.Drawing.Size(170, 22) + Me.ManuallyToolStripMenuItem.Text = "Manually" + ' + 'UseConfigurationToolStripMenuItem + ' + Me.UseConfigurationToolStripMenuItem.Name = "UseConfigurationToolStripMenuItem" + Me.UseConfigurationToolStripMenuItem.Size = New System.Drawing.Size(170, 22) + Me.UseConfigurationToolStripMenuItem.Text = "Use Configuration" + ' + 'ToolStripSplitButton1 + ' + Me.ToolStripSplitButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripSplitButton1.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.WithConfigToolStripMenuItem, Me.WithoutConfigToolStripMenuItem}) + Me.ToolStripSplitButton1.Image = CType(resources.GetObject("ToolStripSplitButton1.Image"), System.Drawing.Image) + Me.ToolStripSplitButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripSplitButton1.Name = "ToolStripSplitButton1" + Me.ToolStripSplitButton1.Size = New System.Drawing.Size(32, 22) + Me.ToolStripSplitButton1.Text = "tsbPrint" + Me.ToolStripSplitButton1.ToolTipText = "View and Print Reports" + ' + 'WithConfigToolStripMenuItem + ' + Me.WithConfigToolStripMenuItem.Name = "WithConfigToolStripMenuItem" + Me.WithConfigToolStripMenuItem.Size = New System.Drawing.Size(156, 22) + Me.WithConfigToolStripMenuItem.Text = "With Config" + ' + 'WithoutConfigToolStripMenuItem + ' + Me.WithoutConfigToolStripMenuItem.Name = "WithoutConfigToolStripMenuItem" + Me.WithoutConfigToolStripMenuItem.Size = New System.Drawing.Size(156, 22) + Me.WithoutConfigToolStripMenuItem.Text = "Without Config" + ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton2.Text = "Refresh List" + ' + 'tslSerialNo + ' + Me.tslSerialNo.Name = "tslSerialNo" + Me.tslSerialNo.Size = New System.Drawing.Size(63, 22) + Me.tslSerialNo.Text = "tslSerialNo" + ' + 'ToolStripSeparator1 + ' + Me.ToolStripSeparator1.Name = "ToolStripSeparator1" + Me.ToolStripSeparator1.Size = New System.Drawing.Size(6, 25) + ' + 'tslCal + ' + Me.tslCal.Name = "tslCal" + Me.tslCal.Size = New System.Drawing.Size(36, 22) + Me.tslCal.Text = "tslCal" + ' + 'ToolStripSeparator2 + ' + Me.ToolStripSeparator2.Name = "ToolStripSeparator2" + Me.ToolStripSeparator2.Size = New System.Drawing.Size(6, 25) + ' + 'tslBarrel + ' + Me.tslBarrel.Name = "tslBarrel" + Me.tslBarrel.Size = New System.Drawing.Size(49, 22) + Me.tslBarrel.Text = "tslBarrel" + ' + 'ToolStripButton3 + ' + Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) + Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton3.Name = "ToolStripButton3" + Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton3.Text = "ToolStripButton3" + ' + 'DataGridView1 + ' + Me.DataGridView1.AllowUserToAddRows = False + Me.DataGridView1.AutoGenerateColumns = False + Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.DtDataGridViewTextBoxColumn, Me.ShotwtDataGridViewTextBoxColumn, Me.ShotSizeDataGridViewTextBoxColumn, Me.CaseDataGridViewTextBoxColumn, Me.PbmDataGridViewTextBoxColumn, Me.WadDataGridViewTextBoxColumn, Me.PrimerDataGridViewTextBoxColumn, Me.PdDataGridViewTextBoxColumn, Me.YdsDataGridViewTextBoxColumn, Me.ConfigNameDataGridViewTextBoxColumn, Me.NotesDataGridViewTextBoxColumn}) + Me.DataGridView1.DataSource = Me.LoadersLogSGBindingSource + Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill + Me.DataGridView1.Location = New System.Drawing.Point(0, 25) + Me.DataGridView1.Name = "DataGridView1" + Me.DataGridView1.ReadOnly = True + Me.DataGridView1.Size = New System.Drawing.Size(648, 241) + Me.DataGridView1.TabIndex = 2 + ' + 'IDDataGridViewTextBoxColumn + ' + Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" + Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" + Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" + Me.IDDataGridViewTextBoxColumn.ReadOnly = True + Me.IDDataGridViewTextBoxColumn.Visible = False + ' + 'DtDataGridViewTextBoxColumn + ' + Me.DtDataGridViewTextBoxColumn.DataPropertyName = "dt" + Me.DtDataGridViewTextBoxColumn.HeaderText = "Date & Time" + Me.DtDataGridViewTextBoxColumn.Name = "DtDataGridViewTextBoxColumn" + Me.DtDataGridViewTextBoxColumn.ReadOnly = True + ' + 'ShotwtDataGridViewTextBoxColumn + ' + Me.ShotwtDataGridViewTextBoxColumn.DataPropertyName = "Shotwt" + Me.ShotwtDataGridViewTextBoxColumn.HeaderText = "Shot Weight" + Me.ShotwtDataGridViewTextBoxColumn.Name = "ShotwtDataGridViewTextBoxColumn" + Me.ShotwtDataGridViewTextBoxColumn.ReadOnly = True + ' + 'ShotSizeDataGridViewTextBoxColumn + ' + Me.ShotSizeDataGridViewTextBoxColumn.DataPropertyName = "ShotSize" + Me.ShotSizeDataGridViewTextBoxColumn.HeaderText = "Shot Size No. - MFG" + Me.ShotSizeDataGridViewTextBoxColumn.Name = "ShotSizeDataGridViewTextBoxColumn" + Me.ShotSizeDataGridViewTextBoxColumn.ReadOnly = True + ' + 'CaseDataGridViewTextBoxColumn + ' + Me.CaseDataGridViewTextBoxColumn.DataPropertyName = "case" + Me.CaseDataGridViewTextBoxColumn.HeaderText = "Case Length - MFG" + Me.CaseDataGridViewTextBoxColumn.Name = "CaseDataGridViewTextBoxColumn" + Me.CaseDataGridViewTextBoxColumn.ReadOnly = True + ' + 'PbmDataGridViewTextBoxColumn + ' + Me.PbmDataGridViewTextBoxColumn.DataPropertyName = "pbm" + Me.PbmDataGridViewTextBoxColumn.HeaderText = "Powder - bushing - MFG" + Me.PbmDataGridViewTextBoxColumn.Name = "PbmDataGridViewTextBoxColumn" + Me.PbmDataGridViewTextBoxColumn.ReadOnly = True + ' + 'WadDataGridViewTextBoxColumn + ' + Me.WadDataGridViewTextBoxColumn.DataPropertyName = "wad" + Me.WadDataGridViewTextBoxColumn.HeaderText = "WAD" + Me.WadDataGridViewTextBoxColumn.Name = "WadDataGridViewTextBoxColumn" + Me.WadDataGridViewTextBoxColumn.ReadOnly = True + ' + 'PrimerDataGridViewTextBoxColumn + ' + Me.PrimerDataGridViewTextBoxColumn.DataPropertyName = "primer" + Me.PrimerDataGridViewTextBoxColumn.HeaderText = "Primer" + Me.PrimerDataGridViewTextBoxColumn.Name = "PrimerDataGridViewTextBoxColumn" + Me.PrimerDataGridViewTextBoxColumn.ReadOnly = True + ' + 'PdDataGridViewTextBoxColumn + ' + Me.PdDataGridViewTextBoxColumn.DataPropertyName = "pd" + Me.PdDataGridViewTextBoxColumn.HeaderText = "Pattern Density" + Me.PdDataGridViewTextBoxColumn.Name = "PdDataGridViewTextBoxColumn" + Me.PdDataGridViewTextBoxColumn.ReadOnly = True + ' + 'YdsDataGridViewTextBoxColumn + ' + Me.YdsDataGridViewTextBoxColumn.DataPropertyName = "yds" + Me.YdsDataGridViewTextBoxColumn.HeaderText = "Yards" + Me.YdsDataGridViewTextBoxColumn.Name = "YdsDataGridViewTextBoxColumn" + Me.YdsDataGridViewTextBoxColumn.ReadOnly = True + ' + 'ConfigNameDataGridViewTextBoxColumn + ' + Me.ConfigNameDataGridViewTextBoxColumn.DataPropertyName = "ConfigName" + Me.ConfigNameDataGridViewTextBoxColumn.HeaderText = "ConfigName" + Me.ConfigNameDataGridViewTextBoxColumn.Name = "ConfigNameDataGridViewTextBoxColumn" + Me.ConfigNameDataGridViewTextBoxColumn.ReadOnly = True + ' + 'NotesDataGridViewTextBoxColumn + ' + Me.NotesDataGridViewTextBoxColumn.DataPropertyName = "notes" + Me.NotesDataGridViewTextBoxColumn.HeaderText = "Notes" + Me.NotesDataGridViewTextBoxColumn.Name = "NotesDataGridViewTextBoxColumn" + Me.NotesDataGridViewTextBoxColumn.ReadOnly = True + ' + 'LoadersLogSGBindingSource + ' + Me.LoadersLogSGBindingSource.DataMember = "Loaders_Log_SG" + Me.LoadersLogSGBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'Loaders_Log_SGTableAdapter + ' + Me.Loaders_Log_SGTableAdapter.ClearBeforeFill = True + ' + 'ContextMenuStrip1 + ' + Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EditToolStripMenuItem, Me.DeleteToolStripMenuItem, Me.CopyToolStripMenuItem}) + Me.ContextMenuStrip1.Name = "ContextMenuStrip1" + Me.ContextMenuStrip1.Size = New System.Drawing.Size(153, 92) + ' + 'EditToolStripMenuItem + ' + Me.EditToolStripMenuItem.Image = CType(resources.GetObject("EditToolStripMenuItem.Image"), System.Drawing.Image) + Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" + Me.EditToolStripMenuItem.Size = New System.Drawing.Size(152, 22) + Me.EditToolStripMenuItem.Text = "Edit" + ' + 'DeleteToolStripMenuItem + ' + Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) + Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" + Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(152, 22) + Me.DeleteToolStripMenuItem.Text = "Delete" + ' + 'CopyToolStripMenuItem + ' + Me.CopyToolStripMenuItem.Image = CType(resources.GetObject("CopyToolStripMenuItem.Image"), System.Drawing.Image) + Me.CopyToolStripMenuItem.Name = "CopyToolStripMenuItem" + Me.CopyToolStripMenuItem.Size = New System.Drawing.Size(152, 22) + Me.CopyToolStripMenuItem.Text = "Copy" + ' + 'frmViewDataSheet_Shotgun + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(648, 266) + Me.Controls.Add(Me.DataGridView1) + Me.Controls.Add(Me.ToolStrip1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.Name = "FrmViewDataSheetShotgun" + Me.Text = "Loaders Log - Shotgun" + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LoadersLogSGBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ContextMenuStrip1.ResumeLayout(False) + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip - Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox - Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripDropDownButton - Friend WithEvents ManuallyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents UseConfigurationToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents ToolStripSplitButton1 As System.Windows.Forms.ToolStripSplitButton - Friend WithEvents WithConfigToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents WithoutConfigToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton - Friend WithEvents tslSerialNo As System.Windows.Forms.ToolStripLabel - Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator - Friend WithEvents tslCal As System.Windows.Forms.ToolStripLabel - Friend WithEvents ToolStripSeparator2 As System.Windows.Forms.ToolStripSeparator - Friend WithEvents tslBarrel As System.Windows.Forms.ToolStripLabel - Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider - Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents LoadersLogSGBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents Loaders_Log_SGTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_SGTableAdapter - Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents DtDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents ShotwtDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents ShotSizeDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents CaseDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents PbmDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents WadDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents PrimerDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents PdDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents YdsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents ConfigNameDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents NotesDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents ContextMenuStrip1 As System.Windows.Forms.ContextMenuStrip - Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents CopyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem -End Class + End Sub + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox + Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripDropDownButton + Friend WithEvents ManuallyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents UseConfigurationToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents ToolStripSplitButton1 As System.Windows.Forms.ToolStripSplitButton + Friend WithEvents WithConfigToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents WithoutConfigToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton + Friend WithEvents tslSerialNo As System.Windows.Forms.ToolStripLabel + Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator + Friend WithEvents tslCal As System.Windows.Forms.ToolStripLabel + Friend WithEvents ToolStripSeparator2 As System.Windows.Forms.ToolStripSeparator + Friend WithEvents tslBarrel As System.Windows.Forms.ToolStripLabel + Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents LoadersLogSGBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents Loaders_Log_SGTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_SGTableAdapter + Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents DtDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents ShotwtDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents ShotSizeDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents CaseDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents PbmDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents WadDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents PrimerDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents PdDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents YdsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents ConfigNameDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents NotesDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents ContextMenuStrip1 As System.Windows.Forms.ContextMenuStrip + Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents CopyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmViewDataSheet_Shotgun.vb b/BSMyLoadersLog/Viewing/frmViewDataSheet_Shotgun.vb index 0fc4ef8..bee4ef9 100644 --- a/BSMyLoadersLog/Viewing/frmViewDataSheet_Shotgun.vb +++ b/BSMyLoadersLog/Viewing/frmViewDataSheet_Shotgun.vb @@ -1,166 +1,303 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc -Public Class frmViewDataSheet_Shotgun - Public FID As Long - Public FirearmName As String - Sub LoadComboBox() - Try - Dim Obj As New BSDatabase - Dim SQL As String = "SELECT * from Loaders_Log_Firearms where GType like '%shotgun%' and exclude=0 order by FullName ASC" - Call Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - Dim FullName As String = "" +'Imports System.Data.Odbc +Imports BSMyLoadersLog.Adding +'Imports BSMyLoadersLog.LoadersClass +Imports BurnSoft.Applications.MLL.LoadersLog +Imports BurnSoft.Applications.MLL.Types - While RS.Read - ToolStripComboBox1.Items.Add(RS("FullName")) - 'If Len(ToolStripComboBox1.Text) = 0 Then FullName = RS("FullName") - End While - RS.Close() - RS = Nothing - CMD = Nothing - Obj.CloseDB() - 'ToolStripComboBox1.Text = FullName - ToolStripComboBox1.SelectedIndex = 0 - Catch ex As Exception - Call LogError(Me.Name, "LoadComboBox", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub UpdateLabels() - Try - Dim Obj As New GlobalFunctions - FID = Obj.GetFirearmID(FirearmName) - Dim sCal As String = "" - Dim sSerial As String = "" - Dim sBar As String = "" - Call Obj.GetFirearmDetails(FID, 0, "", "", "", sCal, sBar, sSerial) - tslCal.Text = "Caliber: " & sCal - tslBarrel.Text = "Barrel: " & sBar - tslSerialNo.Text = "Serial No. " & sSerial - Catch ex As Exception - Call LogError(Me.Name, "UpdateLabels", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub WithConfigToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WithConfigToolStripMenuItem.Click - Me.Cursor = Cursors.WaitCursor - Dim frmNew As New frmReport_DataLoader_Shotgun - frmNew.FID = FID - frmNew.FirearmName = FirearmName - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - Me.Cursor = Cursors.Arrow - End Sub +Namespace Viewing + ''' + ''' Class FrmViewDataSheetShotgun. + ''' Implements the + ''' + ''' + Public Class FrmViewDataSheetShotgun + 'TODO: #20 Clean Up code + ''' + ''' The error out + ''' + Dim _errOut as String + ''' + ''' The firearm identifier + ''' + Public FirearmId As Long + ''' + ''' The firearm name + ''' + Public FirearmName As String + ''' + ''' Loads the ComboBox. + ''' + ''' + Sub LoadComboBox() + Try + Dim lst as List(Of FirearmCollection) = Firearms.GetAll(DatabasePath, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + For Each o As FirearmCollection In lst + ToolStripComboBox1.Items.Add(o.FullName) + Next + 'Dim Obj As New BSDatabase + 'Dim SQL As String = "SELECT * from Loaders_Log_Firearms where GType like '%shotgun%' and exclude=0 order by FullName ASC" + 'Call Obj.ConnectDB() + 'Dim CMD As New OdbcCommand(SQL, Obj.Conn) + 'Dim RS As OdbcDataReader + 'RS = CMD.ExecuteReader + 'Dim FullName As String = "" - Private Sub WithoutConfigToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WithoutConfigToolStripMenuItem.Click - Me.Cursor = Cursors.WaitCursor - Dim frmNew As New frmReport_DataLoader_ShotgunWOC - frmNew.FID = FID - frmNew.FirearmName = FirearmName - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - Me.Cursor = Cursors.Arrow - End Sub + 'While RS.Read + ' ToolStripComboBox1.Items.Add(RS("FullName")) + ' 'If Len(ToolStripComboBox1.Text) = 0 Then FullName = RS("FullName") + 'End While + 'RS.Close() + 'RS = Nothing + 'CMD = Nothing + 'Obj.CloseDB() + 'ToolStripComboBox1.Text = FullName + ToolStripComboBox1.SelectedIndex = 0 + Catch ex As Exception + Call LogError(Name, "LoadComboBox", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Updates the labels. + ''' + Sub UpdateLabels() + Try + 'Dim Obj As New GlobalFunctions + 'FirearmId = Obj.GetFirearmID(FirearmName) + FirearmId = Firearms.GetId(DatabasePath, FirearmName, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + 'Dim sCal As String = "" + 'Dim sSerial As String = "" + 'Dim sBar As String = "" + 'Call Obj.GetFirearmDetails(FirearmId, 0, "", "", "", sCal, sBar, sSerial) + 'tslCal.Text = "Caliber: " & sCal + 'tslBarrel.Text = "Barrel: " & sBar + 'tslSerialNo.Text = "Serial No. " & sSerial - Sub LoadDatabyID() - Try - Me.Loaders_Log_SGTableAdapter.FillBy_FID(Me.MLLDataSet.Loaders_Log_SG, FID) - 'Me.Loaders_Log_SGTableAdapter.FillBy_FID(Me.MLLDataSet.Loaders_Log_SG, FID) - Catch ex As Exception - Call LogError(Me.Name, "LoadDatabyID", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub LoadDatabyName() - Try - Me.Loaders_Log_SGTableAdapter.FillBy_FirearmName(Me.MLLDataSet.Loaders_Log_SG, FirearmName) - Catch ex As Exception - Call LogError(Me.Name, "LoadDatabyName", Err.Number, ex.Message.ToString) - End Try - End Sub - Public Sub LoadData() - Call LoadComboBox() - If FID = 0 Then + Dim lst as List(Of FirearmCollection) = Firearms.GetDetails(DatabasePath, CInt(FirearmId), _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + For Each o As FirearmCollection In lst + tslCal.Text = $"Caliber: {o.Caliber}" + tslBarrel.Text = $"Barrel: {o.Barrel}" + tslSerialNo.Text = $"Serial No. {o.SerialNo}" + Next + Catch ex As Exception + Call LogError(Name, "UpdateLabels", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the WithConfigToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub WithConfigToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles WithConfigToolStripMenuItem.Click + Cursor = Cursors.WaitCursor + Try + Dim frmNew As New frmReport_DataLoader_Shotgun + frmNew.FID = FirearmId + frmNew.FirearmName = FirearmName + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "WithConfigToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + Cursor = Cursors.Arrow + End Sub + ''' + ''' Handles the Click event of the WithoutConfigToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub WithoutConfigToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles WithoutConfigToolStripMenuItem.Click + Cursor = Cursors.WaitCursor + Try + Dim frmNew As New frmReport_DataLoader_ShotgunWOC + frmNew.FID = FirearmId + frmNew.FirearmName = FirearmName + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "WithoutConfigToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + Cursor = Cursors.Arrow + End Sub + ''' + ''' Loads the databy identifier. + ''' + Sub LoadDatabyId() + Try + Loaders_Log_SGTableAdapter.FillBy_FID(MLLDataSet.Loaders_Log_SG, FirearmId) + 'Loaders_Log_SGTableAdapter.FillBy_FID(MLLDataSet.Loaders_Log_SG, FID) + Catch ex As Exception + Call LogError(Name, "LoadDatabyID", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Loads the name of the databy. + ''' + Sub LoadDatabyName() + Try + Loaders_Log_SGTableAdapter.FillBy_FirearmName(MLLDataSet.Loaders_Log_SG, FirearmName) + Catch ex As Exception + Call LogError(Name, "LoadDatabyName", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Loads the data. + ''' + Public Sub LoadData() + Call LoadComboBox() + If FirearmId = 0 Then + FirearmName = ToolStripComboBox1.Text + Call LoadDatabyName() + Else + Call LoadDatabyId() + ToolStripComboBox1.Text = FirearmName + End If + Call UpdateLabels() + End Sub + ''' + ''' Loads the data current. + ''' + Public Sub LoadDataCur() FirearmName = ToolStripComboBox1.Text Call LoadDatabyName() - Else - Call LoadDatabyID() - ToolStripComboBox1.Text = FirearmName - End If - Call UpdateLabels() - End Sub - Public Sub LoadDataCur() - FirearmName = ToolStripComboBox1.Text - Call LoadDatabyName() - Call UpdateLabels() - End Sub - Private Sub frmViewDataSheet_Shotgun_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call LoadData() - End Sub + Call UpdateLabels() + End Sub + ''' + ''' Handles the Load event of the frmViewDataSheet_Shotgun control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmViewDataSheet_Shotgun_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call LoadData() + End Sub + ''' + ''' Handles the Click event of the ManuallyToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ManuallyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ManuallyToolStripMenuItem.Click + Try + Dim frmNew As New frmAddDataSheet_ShotGun_MAN + frmNew.FID = FirearmId + frmNew.MdiParent = MdiParent + frmNew.FromView = True + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "ManuallyToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the UseConfigurationToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub UseConfigurationToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles UseConfigurationToolStripMenuItem.Click + Try + Dim frmNew As New FrmAddDataSheetShotGunCfg + frmNew.FirearmId = FirearmId + frmNew.MdiParent = MdiParent + frmNew.FromView = True + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "UseConfigurationToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the SelectedIndexChanged event of the ToolStripComboBox1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged + Call LoadDataCur() + End Sub + ''' + ''' Handles the Resize event of the frmViewDataSheet_Shotgun control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmViewDataSheet_Shotgun_Resize(sender As Object, e As EventArgs) Handles Me.Resize + Try + If Height <> 0 Then + DataGridView1.Height = Height - (65) + DataGridView1.Width = Width - 15 + End If + Catch ex As Exception + Call LogError(Name, "frmViewDataSheet_Shotgun_Resize", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Deletes the log data. + ''' + ''' + Sub Delete_LogData() + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + 'Dim obj As New BSDatabase + 'Dim objG As New GlobalFunctions + 'Dim strSQLTable As String = "Loaders_Log_SG" + Dim strAns As String = MsgBox("Are you sure you want to delete this from the Log?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + 'Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & itemId + 'If strAns = vbYes Then obj.ConnExec(SQL) : Call LoadDataCur() - Private Sub ManuallyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ManuallyToolStripMenuItem.Click - Dim frmNew As New frmAddDataSheet_ShotGun_MAN - frmNew.FID = FID - frmNew.MdiParent = Me.MdiParent - frmNew.FromView = True - frmNew.Show() - End Sub - - Private Sub UseConfigurationToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UseConfigurationToolStripMenuItem.Click - Dim frmNew As New FrmAddDataSheetShotGunCfg - frmNew.Fid = FID - frmNew.MdiParent = Me.MdiParent - frmNew.FromView = True - frmNew.Show() - End Sub - - Private Sub ToolStripComboBox1_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged - Call LoadDataCur() - End Sub - - Private Sub frmViewDataSheet_Shotgun_Resize(sender As Object, e As System.EventArgs) Handles Me.Resize - If Me.Height <> 0 Then - Me.DataGridView1.Height = Me.Height - (65) - Me.DataGridView1.Width = Me.Width - 15 - End If - End Sub - Sub Delete_LogData() - Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strSQLTable As String = "Loaders_Log_SG" - Dim strAns As String = MsgBox("Are you sure you want to delete this from the Log?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & ItemID - If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadDataCur() - Catch ex As Exception - Dim strProcedure As String = "LoadData" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - - Private Sub ToolStripButton3_Click(sender As Object, e As System.EventArgs) Handles ToolStripButton3.Click - Call Delete_LogData() - End Sub - - Private Sub DeleteToolStripMenuItem_Click(sender As Object, e As System.EventArgs) Handles DeleteToolStripMenuItem.Click - Call Delete_LogData() - End Sub - - Private Sub EditToolStripMenuItem_Click(sender As Object, e As System.EventArgs) Handles EditToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim frmNew As New frmEditDataSheet_ShotGun - frmNew.CFGID = ItemID - frmNew.FromView = True - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - End Sub - - Private Sub CopyToolStripMenuItem_Click(sender As Object, e As System.EventArgs) Handles CopyToolStripMenuItem.Click - Dim frmNew As New frmCopy_DataSheet_Copy_ShotGun - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - frmNew.CFGID = ItemID - frmNew.FromView = True - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - End Sub -End Class \ No newline at end of file + If strAns = vbYes Then + If Not LoadersLogShotgun.Delete(DatabasePath, itemId, _errOut) Then Throw New Exception(_errOut) + Call LoadDataCur() + End If + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton3_Click(sender As Object, e As EventArgs) Handles ToolStripButton3.Click + Call Delete_LogData() + End Sub + ''' + ''' Handles the Click event of the DeleteToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DeleteToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DeleteToolStripMenuItem.Click + Call Delete_LogData() + End Sub + ''' + ''' Handles the Click event of the EditToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub EditToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles EditToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim frmNew As New frmEditDataSheet_ShotGun + frmNew.CFGID = itemId + frmNew.FromView = True + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "EditToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the CopyToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub CopyToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CopyToolStripMenuItem.Click + Try + Dim frmNew As New FrmCopyDataSheetCopyShotGun + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + frmNew.CFGID = itemId + frmNew.FromView = True + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "CopyToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_Configuration_Sheet.Designer.vb b/BSMyLoadersLog/Viewing/frmView_Configuration_Sheet.Designer.vb index a500f65..08f375a 100644 --- a/BSMyLoadersLog/Viewing/frmView_Configuration_Sheet.Designer.vb +++ b/BSMyLoadersLog/Viewing/frmView_Configuration_Sheet.Designer.vb @@ -1,1778 +1,1780 @@ - _ -Partial Class frmView_Configuration_Sheet - Inherits System.Windows.Forms.Form +Namespace Viewing + _ + Partial Class FrmViewConfigurationSheet + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmView_Configuration_Sheet)) - Me.TabControl1 = New System.Windows.Forms.TabControl - Me.TabPage1 = New System.Windows.Forms.TabPage - Me.chkFav = New System.Windows.Forms.CheckBox - Me.rbstatus2 = New System.Windows.Forms.RadioButton - Me.rbstatus1 = New System.Windows.Forms.RadioButton - Me.Label48 = New System.Windows.Forms.Label - Me.lblReffer = New System.Windows.Forms.Label - Me.ChkPerLoad = New System.Windows.Forms.CheckBox - Me.txtCal = New System.Windows.Forms.TextBox - Me.txtAmmoType = New System.Windows.Forms.TextBox - Me.txtConfigName = New System.Windows.Forms.TextBox - Me.GroupBox3 = New System.Windows.Forms.GroupBox - Me.txtCTU = New System.Windows.Forms.TextBox - Me.txtCTOL = New System.Windows.Forms.TextBox - Me.txtCName = New System.Windows.Forms.TextBox - Me.txtCManu = New System.Windows.Forms.TextBox - Me.Label18 = New System.Windows.Forms.Label - Me.Label17 = New System.Windows.Forms.Label - Me.Label15 = New System.Windows.Forms.Label - Me.Label16 = New System.Windows.Forms.Label - Me.GroupBox2 = New System.Windows.Forms.GroupBox - Me.txtPType = New System.Windows.Forms.TextBox - Me.txtPName = New System.Windows.Forms.TextBox - Me.txtPManu = New System.Windows.Forms.TextBox - Me.Label14 = New System.Windows.Forms.Label - Me.Label12 = New System.Windows.Forms.Label - Me.Label13 = New System.Windows.Forms.Label - Me.GroupBox1 = New System.Windows.Forms.GroupBox - Me.txtBType = New System.Windows.Forms.TextBox - Me.txtBBCO = New System.Windows.Forms.TextBox - Me.txtBPartNo = New System.Windows.Forms.TextBox - Me.txtBSecDen = New System.Windows.Forms.TextBox - Me.txtBWei = New System.Windows.Forms.TextBox - Me.txtBDia = New System.Windows.Forms.TextBox - Me.txtBName = New System.Windows.Forms.TextBox - Me.txtBManu = New System.Windows.Forms.TextBox - Me.Label11 = New System.Windows.Forms.Label - Me.Label10 = New System.Windows.Forms.Label - Me.Label9 = New System.Windows.Forms.Label - Me.Label8 = New System.Windows.Forms.Label - Me.Label7 = New System.Windows.Forms.Label - Me.Label6 = New System.Windows.Forms.Label - Me.Label5 = New System.Windows.Forms.Label - Me.Label4 = New System.Windows.Forms.Label - Me.Label3 = New System.Windows.Forms.Label - Me.Label2 = New System.Windows.Forms.Label - Me.Label1 = New System.Windows.Forms.Label - Me.TabPage2 = New System.Windows.Forms.TabPage - Me.btnRefresh = New System.Windows.Forms.Button - Me.btnAdd = New System.Windows.Forms.Button - Me.DataGridView1 = New System.Windows.Forms.DataGridView - Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.CLNIDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.PIDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.PowderNameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.LoadMinDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.LoadMidDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.LoadMaxDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.FPSMinDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.FPSMIDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.FPSMaxDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.CUPSMinDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.CUPSMidDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.CUPSMaxDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.CMSPowder = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.SetAsDefaultToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.ConfigListPowderDataNSGViewBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.TabPage3 = New System.Windows.Forms.TabPage - Me.btnUpdate = New System.Windows.Forms.Button - Me.btnAddNotes = New System.Windows.Forms.Button - Me.txtNotes = New System.Windows.Forms.TextBox - Me.TabPage4 = New System.Windows.Forms.TabPage - Me.GroupBox8 = New System.Windows.Forms.GroupBox - Me.txtTCR = New System.Windows.Forms.TextBox - Me.txtNMR = New System.Windows.Forms.TextBox - Me.txtCBIS = New System.Windows.Forms.TextBox - Me.txtCCIS = New System.Windows.Forms.TextBox - Me.txtCPriIS = New System.Windows.Forms.TextBox - Me.Label47 = New System.Windows.Forms.Label - Me.Label46 = New System.Windows.Forms.Label - Me.Label45 = New System.Windows.Forms.Label - Me.Label44 = New System.Windows.Forms.Label - Me.Label43 = New System.Windows.Forms.Label - Me.txtCPowIS = New System.Windows.Forms.TextBox - Me.Label42 = New System.Windows.Forms.Label - Me.GroupBox7 = New System.Windows.Forms.GroupBox - Me.Label41 = New System.Windows.Forms.Label - Me.txtC1RA = New System.Windows.Forms.TextBox - Me.txtCOPMid = New System.Windows.Forms.TextBox - Me.txtCPC = New System.Windows.Forms.TextBox - Me.txtCPP = New System.Windows.Forms.TextBox - Me.txtCPB = New System.Windows.Forms.TextBox - Me.Label40 = New System.Windows.Forms.Label - Me.Label39 = New System.Windows.Forms.Label - Me.Label38 = New System.Windows.Forms.Label - Me.Label37 = New System.Windows.Forms.Label - Me.TabPage5 = New System.Windows.Forms.TabPage - Me.DataGridView2 = New System.Windows.Forms.DataGridView - Me.LoadersLogAmmunitionAuditBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.TextBox11 = New System.Windows.Forms.TextBox - Me.TextBox12 = New System.Windows.Forms.TextBox - Me.GroupBox4 = New System.Windows.Forms.GroupBox - Me.Label19 = New System.Windows.Forms.Label - Me.Label20 = New System.Windows.Forms.Label - Me.Label21 = New System.Windows.Forms.Label - Me.Label22 = New System.Windows.Forms.Label - Me.GroupBox5 = New System.Windows.Forms.GroupBox - Me.Label23 = New System.Windows.Forms.Label - Me.Label24 = New System.Windows.Forms.Label - Me.Label25 = New System.Windows.Forms.Label - Me.GroupBox6 = New System.Windows.Forms.GroupBox - Me.TextBox13 = New System.Windows.Forms.TextBox - Me.TextBox14 = New System.Windows.Forms.TextBox - Me.TextBox15 = New System.Windows.Forms.TextBox - Me.TextBox16 = New System.Windows.Forms.TextBox - Me.TextBox17 = New System.Windows.Forms.TextBox - Me.TextBox18 = New System.Windows.Forms.TextBox - Me.TextBox19 = New System.Windows.Forms.TextBox - Me.TextBox20 = New System.Windows.Forms.TextBox - Me.Label26 = New System.Windows.Forms.Label - Me.Label27 = New System.Windows.Forms.Label - Me.Label28 = New System.Windows.Forms.Label - Me.Label29 = New System.Windows.Forms.Label - Me.Label30 = New System.Windows.Forms.Label - Me.Label31 = New System.Windows.Forms.Label - Me.Label32 = New System.Windows.Forms.Label - Me.Label33 = New System.Windows.Forms.Label - Me.Label34 = New System.Windows.Forms.Label - Me.Label35 = New System.Windows.Forms.Label - Me.Label36 = New System.Windows.Forms.Label - Me.ToolStrip1 = New System.Windows.Forms.ToolStrip - Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton4 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton5 = New System.Windows.Forms.ToolStripButton - Me.btnCancel = New System.Windows.Forms.Button - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - Me.SaveFileDialog1 = New System.Windows.Forms.SaveFileDialog - Me.Config_List_Powder_Data_NSG_ViewTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Config_List_Powder_Data_NSG_ViewTableAdapter - Me.Loaders_Log_Ammunition_AuditTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_Ammunition_AuditTableAdapter - Me.IDDataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.DtcDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.QtyDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.EcDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.EcprDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.TabControl1.SuspendLayout() - Me.TabPage1.SuspendLayout() - Me.GroupBox3.SuspendLayout() - Me.GroupBox2.SuspendLayout() - Me.GroupBox1.SuspendLayout() - Me.TabPage2.SuspendLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.CMSPowder.SuspendLayout() - CType(Me.ConfigListPowderDataNSGViewBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.TabPage3.SuspendLayout() - Me.TabPage4.SuspendLayout() - Me.GroupBox8.SuspendLayout() - Me.GroupBox7.SuspendLayout() - Me.TabPage5.SuspendLayout() - CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.LoadersLogAmmunitionAuditBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - Me.GroupBox4.SuspendLayout() - Me.GroupBox5.SuspendLayout() - Me.GroupBox6.SuspendLayout() - Me.ToolStrip1.SuspendLayout() - Me.SuspendLayout() - ' - 'TabControl1 - ' - Me.TabControl1.Controls.Add(Me.TabPage1) - Me.TabControl1.Controls.Add(Me.TabPage2) - Me.TabControl1.Controls.Add(Me.TabPage3) - Me.TabControl1.Controls.Add(Me.TabPage4) - Me.TabControl1.Controls.Add(Me.TabPage5) - Me.TabControl1.Location = New System.Drawing.Point(0, 23) - Me.TabControl1.Name = "TabControl1" - Me.TabControl1.SelectedIndex = 0 - Me.TabControl1.Size = New System.Drawing.Size(713, 433) - Me.TabControl1.TabIndex = 0 - ' - 'TabPage1 - ' - Me.TabPage1.Controls.Add(Me.chkFav) - Me.TabPage1.Controls.Add(Me.rbstatus2) - Me.TabPage1.Controls.Add(Me.rbstatus1) - Me.TabPage1.Controls.Add(Me.Label48) - Me.TabPage1.Controls.Add(Me.lblReffer) - Me.TabPage1.Controls.Add(Me.ChkPerLoad) - Me.TabPage1.Controls.Add(Me.txtCal) - Me.TabPage1.Controls.Add(Me.txtAmmoType) - Me.TabPage1.Controls.Add(Me.txtConfigName) - Me.TabPage1.Controls.Add(Me.GroupBox3) - Me.TabPage1.Controls.Add(Me.GroupBox2) - Me.TabPage1.Controls.Add(Me.GroupBox1) - Me.TabPage1.Controls.Add(Me.Label3) - Me.TabPage1.Controls.Add(Me.Label2) - Me.TabPage1.Controls.Add(Me.Label1) - Me.TabPage1.Location = New System.Drawing.Point(4, 22) - Me.TabPage1.Name = "TabPage1" - Me.TabPage1.Padding = New System.Windows.Forms.Padding(3) - Me.TabPage1.Size = New System.Drawing.Size(705, 407) - Me.TabPage1.TabIndex = 0 - Me.TabPage1.Text = "Information" - Me.TabPage1.UseVisualStyleBackColor = True - ' - 'chkFav - ' - Me.chkFav.AutoSize = True - Me.chkFav.Location = New System.Drawing.Point(293, 70) - Me.chkFav.Name = "chkFav" - Me.chkFav.Size = New System.Drawing.Size(64, 17) - Me.chkFav.TabIndex = 24 - Me.chkFav.Text = "Favorite" - Me.chkFav.UseVisualStyleBackColor = True - ' - 'rbstatus2 - ' - Me.rbstatus2.AutoSize = True - Me.rbstatus2.Location = New System.Drawing.Point(180, 70) - Me.rbstatus2.Name = "rbstatus2" - Me.rbstatus2.Size = New System.Drawing.Size(63, 17) - Me.rbstatus2.TabIndex = 23 - Me.rbstatus2.TabStop = True - Me.rbstatus2.Text = "Inactive" - Me.rbstatus2.UseVisualStyleBackColor = True - ' - 'rbstatus1 - ' - Me.rbstatus1.AutoSize = True - Me.rbstatus1.Location = New System.Drawing.Point(118, 69) - Me.rbstatus1.Name = "rbstatus1" - Me.rbstatus1.Size = New System.Drawing.Size(55, 17) - Me.rbstatus1.TabIndex = 22 - Me.rbstatus1.TabStop = True - Me.rbstatus1.Text = "Active" - Me.rbstatus1.UseVisualStyleBackColor = True - ' - 'Label48 - ' - Me.Label48.AutoSize = True - Me.Label48.Location = New System.Drawing.Point(9, 69) - Me.Label48.Name = "Label48" - Me.Label48.Size = New System.Drawing.Size(40, 13) - Me.Label48.TabIndex = 21 - Me.Label48.Text = "Status:" - ' - 'lblReffer - ' - Me.lblReffer.Location = New System.Drawing.Point(394, 46) - Me.lblReffer.Name = "lblReffer" - Me.lblReffer.Size = New System.Drawing.Size(295, 40) - Me.lblReffer.TabIndex = 20 - ' - 'ChkPerLoad - ' - Me.ChkPerLoad.AutoCheck = False - Me.ChkPerLoad.AutoSize = True - Me.ChkPerLoad.Enabled = False - Me.ChkPerLoad.Location = New System.Drawing.Point(293, 46) - Me.ChkPerLoad.Name = "ChkPerLoad" - Me.ChkPerLoad.Size = New System.Drawing.Size(94, 17) - Me.ChkPerLoad.TabIndex = 19 - Me.ChkPerLoad.Text = "Personal Load" - Me.ChkPerLoad.UseVisualStyleBackColor = True - ' - 'txtCal - ' - Me.txtCal.Location = New System.Drawing.Point(338, 17) - Me.txtCal.Name = "txtCal" - Me.txtCal.ReadOnly = True - Me.txtCal.Size = New System.Drawing.Size(146, 20) - Me.txtCal.TabIndex = 18 - ' - 'txtAmmoType - ' - Me.txtAmmoType.Location = New System.Drawing.Point(118, 43) - Me.txtAmmoType.Name = "txtAmmoType" - Me.txtAmmoType.ReadOnly = True - Me.txtAmmoType.Size = New System.Drawing.Size(146, 20) - Me.txtAmmoType.TabIndex = 17 - ' - 'txtConfigName - ' - Me.txtConfigName.Location = New System.Drawing.Point(118, 17) - Me.txtConfigName.Name = "txtConfigName" - Me.txtConfigName.ReadOnly = True - Me.txtConfigName.Size = New System.Drawing.Size(146, 20) - Me.txtConfigName.TabIndex = 16 - ' - 'GroupBox3 - ' - Me.GroupBox3.Controls.Add(Me.txtCTU) - Me.GroupBox3.Controls.Add(Me.txtCTOL) - Me.GroupBox3.Controls.Add(Me.txtCName) - Me.GroupBox3.Controls.Add(Me.txtCManu) - Me.GroupBox3.Controls.Add(Me.Label18) - Me.GroupBox3.Controls.Add(Me.Label17) - Me.GroupBox3.Controls.Add(Me.Label15) - Me.GroupBox3.Controls.Add(Me.Label16) - Me.GroupBox3.Location = New System.Drawing.Point(293, 226) - Me.GroupBox3.Name = "GroupBox3" - Me.GroupBox3.Size = New System.Drawing.Size(268, 125) - Me.GroupBox3.TabIndex = 10 - Me.GroupBox3.TabStop = False - Me.GroupBox3.Text = "Case Information" - ' - 'txtCTU - ' - Me.txtCTU.Location = New System.Drawing.Point(106, 81) - Me.txtCTU.Name = "txtCTU" - Me.txtCTU.ReadOnly = True - Me.txtCTU.Size = New System.Drawing.Size(146, 20) - Me.txtCTU.TabIndex = 20 - ' - 'txtCTOL - ' - Me.txtCTOL.Location = New System.Drawing.Point(106, 59) - Me.txtCTOL.Name = "txtCTOL" - Me.txtCTOL.ReadOnly = True - Me.txtCTOL.Size = New System.Drawing.Size(146, 20) - Me.txtCTOL.TabIndex = 19 - ' - 'txtCName - ' - Me.txtCName.Location = New System.Drawing.Point(106, 36) - Me.txtCName.Name = "txtCName" - Me.txtCName.ReadOnly = True - Me.txtCName.Size = New System.Drawing.Size(146, 20) - Me.txtCName.TabIndex = 18 - ' - 'txtCManu - ' - Me.txtCManu.Location = New System.Drawing.Point(106, 13) - Me.txtCManu.Name = "txtCManu" - Me.txtCManu.ReadOnly = True - Me.txtCManu.Size = New System.Drawing.Size(146, 20) - Me.txtCManu.TabIndex = 17 - ' - 'Label18 - ' - Me.Label18.AutoSize = True - Me.Label18.Location = New System.Drawing.Point(12, 84) - Me.Label18.Name = "Label18" - Me.Label18.Size = New System.Drawing.Size(66, 13) - Me.Label18.TabIndex = 15 - Me.Label18.Text = "Times Used:" - ' - 'Label17 - ' - Me.Label17.AutoSize = True - Me.Label17.Location = New System.Drawing.Point(12, 62) - Me.Label17.Name = "Label17" - Me.Label17.Size = New System.Drawing.Size(78, 13) - Me.Label17.TabIndex = 14 - Me.Label17.Text = "Trim to Length:" - ' - 'Label15 - ' - Me.Label15.AutoSize = True - Me.Label15.Location = New System.Drawing.Point(12, 39) - Me.Label15.Name = "Label15" - Me.Label15.Size = New System.Drawing.Size(38, 13) - Me.Label15.TabIndex = 13 - Me.Label15.Text = "Name:" - ' - 'Label16 - ' - Me.Label16.AutoSize = True - Me.Label16.Location = New System.Drawing.Point(12, 16) - Me.Label16.Name = "Label16" - Me.Label16.Size = New System.Drawing.Size(73, 13) - Me.Label16.TabIndex = 12 - Me.Label16.Text = "Manufacturer:" - ' - 'GroupBox2 - ' - Me.GroupBox2.Controls.Add(Me.txtPType) - Me.GroupBox2.Controls.Add(Me.txtPName) - Me.GroupBox2.Controls.Add(Me.txtPManu) - Me.GroupBox2.Controls.Add(Me.Label14) - Me.GroupBox2.Controls.Add(Me.Label12) - Me.GroupBox2.Controls.Add(Me.Label13) - Me.GroupBox2.Location = New System.Drawing.Point(293, 112) - Me.GroupBox2.Name = "GroupBox2" - Me.GroupBox2.Size = New System.Drawing.Size(268, 108) - Me.GroupBox2.TabIndex = 9 - Me.GroupBox2.TabStop = False - Me.GroupBox2.Text = "Primer Information" - ' - 'txtPType - ' - Me.txtPType.Location = New System.Drawing.Point(106, 75) - Me.txtPType.Name = "txtPType" - Me.txtPType.ReadOnly = True - Me.txtPType.Size = New System.Drawing.Size(146, 20) - Me.txtPType.TabIndex = 19 - ' - 'txtPName - ' - Me.txtPName.Location = New System.Drawing.Point(106, 50) - Me.txtPName.Name = "txtPName" - Me.txtPName.ReadOnly = True - Me.txtPName.Size = New System.Drawing.Size(146, 20) - Me.txtPName.TabIndex = 18 - ' - 'txtPManu - ' - Me.txtPManu.Location = New System.Drawing.Point(106, 24) - Me.txtPManu.Name = "txtPManu" - Me.txtPManu.ReadOnly = True - Me.txtPManu.Size = New System.Drawing.Size(146, 20) - Me.txtPManu.TabIndex = 17 - ' - 'Label14 - ' - Me.Label14.AutoSize = True - Me.Label14.Location = New System.Drawing.Point(12, 78) - Me.Label14.Name = "Label14" - Me.Label14.Size = New System.Drawing.Size(66, 13) - Me.Label14.TabIndex = 12 - Me.Label14.Text = "Primer Type:" - ' - 'Label12 - ' - Me.Label12.AutoSize = True - Me.Label12.Location = New System.Drawing.Point(12, 53) - Me.Label12.Name = "Label12" - Me.Label12.Size = New System.Drawing.Size(38, 13) - Me.Label12.TabIndex = 11 - Me.Label12.Text = "Name:" - ' - 'Label13 - ' - Me.Label13.AutoSize = True - Me.Label13.Location = New System.Drawing.Point(12, 27) - Me.Label13.Name = "Label13" - Me.Label13.Size = New System.Drawing.Size(73, 13) - Me.Label13.TabIndex = 10 - Me.Label13.Text = "Manufacturer:" - ' - 'GroupBox1 - ' - Me.GroupBox1.Controls.Add(Me.txtBType) - Me.GroupBox1.Controls.Add(Me.txtBBCO) - Me.GroupBox1.Controls.Add(Me.txtBPartNo) - Me.GroupBox1.Controls.Add(Me.txtBSecDen) - Me.GroupBox1.Controls.Add(Me.txtBWei) - Me.GroupBox1.Controls.Add(Me.txtBDia) - Me.GroupBox1.Controls.Add(Me.txtBName) - Me.GroupBox1.Controls.Add(Me.txtBManu) - Me.GroupBox1.Controls.Add(Me.Label11) - Me.GroupBox1.Controls.Add(Me.Label10) - Me.GroupBox1.Controls.Add(Me.Label9) - Me.GroupBox1.Controls.Add(Me.Label8) - Me.GroupBox1.Controls.Add(Me.Label7) - Me.GroupBox1.Controls.Add(Me.Label6) - Me.GroupBox1.Controls.Add(Me.Label5) - Me.GroupBox1.Controls.Add(Me.Label4) - Me.GroupBox1.Location = New System.Drawing.Point(12, 112) - Me.GroupBox1.Name = "GroupBox1" - Me.GroupBox1.Size = New System.Drawing.Size(262, 239) - Me.GroupBox1.TabIndex = 8 - Me.GroupBox1.TabStop = False - Me.GroupBox1.Text = "Bullet Information" - ' - 'txtBType - ' - Me.txtBType.Location = New System.Drawing.Point(106, 200) - Me.txtBType.Name = "txtBType" - Me.txtBType.ReadOnly = True - Me.txtBType.Size = New System.Drawing.Size(146, 20) - Me.txtBType.TabIndex = 24 - ' - 'txtBBCO - ' - Me.txtBBCO.Location = New System.Drawing.Point(106, 176) - Me.txtBBCO.Name = "txtBBCO" - Me.txtBBCO.ReadOnly = True - Me.txtBBCO.Size = New System.Drawing.Size(146, 20) - Me.txtBBCO.TabIndex = 23 - ' - 'txtBPartNo - ' - Me.txtBPartNo.Location = New System.Drawing.Point(106, 151) - Me.txtBPartNo.Name = "txtBPartNo" - Me.txtBPartNo.ReadOnly = True - Me.txtBPartNo.Size = New System.Drawing.Size(146, 20) - Me.txtBPartNo.TabIndex = 22 - ' - 'txtBSecDen - ' - Me.txtBSecDen.Location = New System.Drawing.Point(106, 125) - Me.txtBSecDen.Name = "txtBSecDen" - Me.txtBSecDen.ReadOnly = True - Me.txtBSecDen.Size = New System.Drawing.Size(146, 20) - Me.txtBSecDen.TabIndex = 21 - ' - 'txtBWei - ' - Me.txtBWei.Location = New System.Drawing.Point(106, 99) - Me.txtBWei.Name = "txtBWei" - Me.txtBWei.ReadOnly = True - Me.txtBWei.Size = New System.Drawing.Size(146, 20) - Me.txtBWei.TabIndex = 20 - ' - 'txtBDia - ' - Me.txtBDia.Location = New System.Drawing.Point(106, 75) - Me.txtBDia.Name = "txtBDia" - Me.txtBDia.ReadOnly = True - Me.txtBDia.Size = New System.Drawing.Size(146, 20) - Me.txtBDia.TabIndex = 19 - ' - 'txtBName - ' - Me.txtBName.Location = New System.Drawing.Point(106, 50) - Me.txtBName.Name = "txtBName" - Me.txtBName.ReadOnly = True - Me.txtBName.Size = New System.Drawing.Size(146, 20) - Me.txtBName.TabIndex = 18 - ' - 'txtBManu - ' - Me.txtBManu.Location = New System.Drawing.Point(106, 22) - Me.txtBManu.Name = "txtBManu" - Me.txtBManu.ReadOnly = True - Me.txtBManu.Size = New System.Drawing.Size(146, 20) - Me.txtBManu.TabIndex = 17 - ' - 'Label11 - ' - Me.Label11.AutoSize = True - Me.Label11.Location = New System.Drawing.Point(6, 203) - Me.Label11.Name = "Label11" - Me.Label11.Size = New System.Drawing.Size(63, 13) - Me.Label11.TabIndex = 15 - Me.Label11.Text = "Bullet Type:" - ' - 'Label10 - ' - Me.Label10.AutoSize = True - Me.Label10.Location = New System.Drawing.Point(6, 179) - Me.Label10.Name = "Label10" - Me.Label10.Size = New System.Drawing.Size(98, 13) - Me.Label10.TabIndex = 14 - Me.Label10.Text = "Ballistic Coefficient:" - ' - 'Label9 - ' - Me.Label9.AutoSize = True - Me.Label9.Location = New System.Drawing.Point(6, 154) - Me.Label9.Name = "Label9" - Me.Label9.Size = New System.Drawing.Size(69, 13) - Me.Label9.TabIndex = 13 - Me.Label9.Text = "Part Number:" - ' - 'Label8 - ' - Me.Label8.AutoSize = True - Me.Label8.Location = New System.Drawing.Point(6, 128) - Me.Label8.Name = "Label8" - Me.Label8.Size = New System.Drawing.Size(92, 13) - Me.Label8.TabIndex = 12 - Me.Label8.Text = "Sectional Density:" - ' - 'Label7 - ' - Me.Label7.AutoSize = True - Me.Label7.Location = New System.Drawing.Point(6, 102) - Me.Label7.Name = "Label7" - Me.Label7.Size = New System.Drawing.Size(44, 13) - Me.Label7.TabIndex = 11 - Me.Label7.Text = "Weight:" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(6, 78) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(52, 13) - Me.Label6.TabIndex = 10 - Me.Label6.Text = "Diameter:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(6, 53) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(38, 13) - Me.Label5.TabIndex = 9 - Me.Label5.Text = "Name:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(6, 27) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(73, 13) - Me.Label4.TabIndex = 8 - Me.Label4.Text = "Manufacturer:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(290, 20) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(42, 13) - Me.Label3.TabIndex = 2 - Me.Label3.Text = "Caliber:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(9, 46) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(91, 13) - Me.Label2.TabIndex = 1 - Me.Label2.Text = "Ammunition Type:" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(9, 20) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(103, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Configuration Name:" - ' - 'TabPage2 - ' - Me.TabPage2.Controls.Add(Me.btnRefresh) - Me.TabPage2.Controls.Add(Me.btnAdd) - Me.TabPage2.Controls.Add(Me.DataGridView1) - Me.TabPage2.Location = New System.Drawing.Point(4, 22) - Me.TabPage2.Name = "TabPage2" - Me.TabPage2.Padding = New System.Windows.Forms.Padding(3) - Me.TabPage2.Size = New System.Drawing.Size(705, 407) - Me.TabPage2.TabIndex = 1 - Me.TabPage2.Text = "Powder" - Me.TabPage2.UseVisualStyleBackColor = True - ' - 'btnRefresh - ' - Me.btnRefresh.Location = New System.Drawing.Point(95, 7) - Me.btnRefresh.Name = "btnRefresh" - Me.btnRefresh.Size = New System.Drawing.Size(75, 22) - Me.btnRefresh.TabIndex = 2 - Me.btnRefresh.Text = "Refresh" - Me.btnRefresh.UseVisualStyleBackColor = True - ' - 'btnAdd - ' - Me.btnAdd.Location = New System.Drawing.Point(4, 7) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(75, 22) - Me.btnAdd.TabIndex = 1 - Me.btnAdd.Text = "Add" - Me.btnAdd.UseVisualStyleBackColor = True - ' - 'DataGridView1 - ' - Me.DataGridView1.AllowUserToAddRows = False - Me.DataGridView1.AllowUserToDeleteRows = False - Me.DataGridView1.AutoGenerateColumns = False - Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.CLNIDDataGridViewTextBoxColumn, Me.PIDDataGridViewTextBoxColumn, Me.PowderNameDataGridViewTextBoxColumn, Me.LoadMinDataGridViewTextBoxColumn, Me.LoadMidDataGridViewTextBoxColumn, Me.LoadMaxDataGridViewTextBoxColumn, Me.FPSMinDataGridViewTextBoxColumn, Me.FPSMIDDataGridViewTextBoxColumn, Me.FPSMaxDataGridViewTextBoxColumn, Me.CUPSMinDataGridViewTextBoxColumn, Me.CUPSMidDataGridViewTextBoxColumn, Me.CUPSMaxDataGridViewTextBoxColumn}) - Me.DataGridView1.ContextMenuStrip = Me.CMSPowder - Me.DataGridView1.DataSource = Me.ConfigListPowderDataNSGViewBindingSource - Me.DataGridView1.Location = New System.Drawing.Point(4, 29) - Me.DataGridView1.Name = "DataGridView1" - Me.DataGridView1.ReadOnly = True - Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DataGridView1.Size = New System.Drawing.Size(630, 312) - Me.DataGridView1.TabIndex = 0 - ' - 'IDDataGridViewTextBoxColumn - ' - Me.IDDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None - Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" - Me.IDDataGridViewTextBoxColumn.FillWeight = 1.0! - Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" - Me.IDDataGridViewTextBoxColumn.MinimumWidth = 2 - Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" - Me.IDDataGridViewTextBoxColumn.ReadOnly = True - Me.IDDataGridViewTextBoxColumn.Visible = False - Me.IDDataGridViewTextBoxColumn.Width = 2 - ' - 'CLNIDDataGridViewTextBoxColumn - ' - Me.CLNIDDataGridViewTextBoxColumn.DataPropertyName = "CLNID" - Me.CLNIDDataGridViewTextBoxColumn.HeaderText = "CLNID" - Me.CLNIDDataGridViewTextBoxColumn.Name = "CLNIDDataGridViewTextBoxColumn" - Me.CLNIDDataGridViewTextBoxColumn.ReadOnly = True - Me.CLNIDDataGridViewTextBoxColumn.Visible = False - ' - 'PIDDataGridViewTextBoxColumn - ' - Me.PIDDataGridViewTextBoxColumn.DataPropertyName = "PID" - Me.PIDDataGridViewTextBoxColumn.HeaderText = "PID" - Me.PIDDataGridViewTextBoxColumn.Name = "PIDDataGridViewTextBoxColumn" - Me.PIDDataGridViewTextBoxColumn.ReadOnly = True - Me.PIDDataGridViewTextBoxColumn.Visible = False - ' - 'PowderNameDataGridViewTextBoxColumn - ' - Me.PowderNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.PowderNameDataGridViewTextBoxColumn.DataPropertyName = "Powder_Name" - Me.PowderNameDataGridViewTextBoxColumn.HeaderText = "Powder" - Me.PowderNameDataGridViewTextBoxColumn.Name = "PowderNameDataGridViewTextBoxColumn" - Me.PowderNameDataGridViewTextBoxColumn.ReadOnly = True - Me.PowderNameDataGridViewTextBoxColumn.Width = 68 - ' - 'LoadMinDataGridViewTextBoxColumn - ' - Me.LoadMinDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader - Me.LoadMinDataGridViewTextBoxColumn.DataPropertyName = "Load_Min" - Me.LoadMinDataGridViewTextBoxColumn.HeaderText = "Load Minimum" - Me.LoadMinDataGridViewTextBoxColumn.Name = "LoadMinDataGridViewTextBoxColumn" - Me.LoadMinDataGridViewTextBoxColumn.ReadOnly = True - ' - 'LoadMidDataGridViewTextBoxColumn - ' - Me.LoadMidDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader - Me.LoadMidDataGridViewTextBoxColumn.DataPropertyName = "Load_Mid" - Me.LoadMidDataGridViewTextBoxColumn.HeaderText = "Load Medium" - Me.LoadMidDataGridViewTextBoxColumn.Name = "LoadMidDataGridViewTextBoxColumn" - Me.LoadMidDataGridViewTextBoxColumn.ReadOnly = True - Me.LoadMidDataGridViewTextBoxColumn.Width = 96 - ' - 'LoadMaxDataGridViewTextBoxColumn - ' - Me.LoadMaxDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader - Me.LoadMaxDataGridViewTextBoxColumn.DataPropertyName = "Load_Max" - Me.LoadMaxDataGridViewTextBoxColumn.HeaderText = "Load Maxium" - Me.LoadMaxDataGridViewTextBoxColumn.Name = "LoadMaxDataGridViewTextBoxColumn" - Me.LoadMaxDataGridViewTextBoxColumn.ReadOnly = True - Me.LoadMaxDataGridViewTextBoxColumn.Width = 95 - ' - 'FPSMinDataGridViewTextBoxColumn - ' - Me.FPSMinDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader - Me.FPSMinDataGridViewTextBoxColumn.DataPropertyName = "FPS_Min" - Me.FPSMinDataGridViewTextBoxColumn.HeaderText = "FPS Minimum" - Me.FPSMinDataGridViewTextBoxColumn.Name = "FPSMinDataGridViewTextBoxColumn" - Me.FPSMinDataGridViewTextBoxColumn.ReadOnly = True - Me.FPSMinDataGridViewTextBoxColumn.Width = 96 - ' - 'FPSMIDDataGridViewTextBoxColumn - ' - Me.FPSMIDDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader - Me.FPSMIDDataGridViewTextBoxColumn.DataPropertyName = "FPS_MID" - Me.FPSMIDDataGridViewTextBoxColumn.HeaderText = "FPS Medium" - Me.FPSMIDDataGridViewTextBoxColumn.Name = "FPSMIDDataGridViewTextBoxColumn" - Me.FPSMIDDataGridViewTextBoxColumn.ReadOnly = True - Me.FPSMIDDataGridViewTextBoxColumn.Width = 92 - ' - 'FPSMaxDataGridViewTextBoxColumn - ' - Me.FPSMaxDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader - Me.FPSMaxDataGridViewTextBoxColumn.DataPropertyName = "FPS_Max" - Me.FPSMaxDataGridViewTextBoxColumn.HeaderText = "FPS Maxium" - Me.FPSMaxDataGridViewTextBoxColumn.Name = "FPSMaxDataGridViewTextBoxColumn" - Me.FPSMaxDataGridViewTextBoxColumn.ReadOnly = True - Me.FPSMaxDataGridViewTextBoxColumn.Width = 91 - ' - 'CUPSMinDataGridViewTextBoxColumn - ' - Me.CUPSMinDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader - Me.CUPSMinDataGridViewTextBoxColumn.DataPropertyName = "CUPS_Min" - Me.CUPSMinDataGridViewTextBoxColumn.HeaderText = "CUPS Minimum" - Me.CUPSMinDataGridViewTextBoxColumn.Name = "CUPSMinDataGridViewTextBoxColumn" - Me.CUPSMinDataGridViewTextBoxColumn.ReadOnly = True - Me.CUPSMinDataGridViewTextBoxColumn.Visible = False - ' - 'CUPSMidDataGridViewTextBoxColumn - ' - Me.CUPSMidDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader - Me.CUPSMidDataGridViewTextBoxColumn.DataPropertyName = "CUPS_Mid" - Me.CUPSMidDataGridViewTextBoxColumn.HeaderText = "CUPS Medium" - Me.CUPSMidDataGridViewTextBoxColumn.Name = "CUPSMidDataGridViewTextBoxColumn" - Me.CUPSMidDataGridViewTextBoxColumn.ReadOnly = True - Me.CUPSMidDataGridViewTextBoxColumn.Visible = False - ' - 'CUPSMaxDataGridViewTextBoxColumn - ' - Me.CUPSMaxDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader - Me.CUPSMaxDataGridViewTextBoxColumn.DataPropertyName = "CUPS_Max" - Me.CUPSMaxDataGridViewTextBoxColumn.HeaderText = "CUPS Maxium" - Me.CUPSMaxDataGridViewTextBoxColumn.Name = "CUPSMaxDataGridViewTextBoxColumn" - Me.CUPSMaxDataGridViewTextBoxColumn.ReadOnly = True - Me.CUPSMaxDataGridViewTextBoxColumn.Visible = False - ' - 'CMSPowder - ' - Me.CMSPowder.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.DeleteToolStripMenuItem, Me.SetAsDefaultToolStripMenuItem}) - Me.CMSPowder.Name = "CMSPowder" - Me.CMSPowder.Size = New System.Drawing.Size(155, 48) - ' - 'DeleteToolStripMenuItem - ' - Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) - Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" - Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(154, 22) - Me.DeleteToolStripMenuItem.Text = "Delete" - ' - 'SetAsDefaultToolStripMenuItem - ' - Me.SetAsDefaultToolStripMenuItem.Image = CType(resources.GetObject("SetAsDefaultToolStripMenuItem.Image"), System.Drawing.Image) - Me.SetAsDefaultToolStripMenuItem.Name = "SetAsDefaultToolStripMenuItem" - Me.SetAsDefaultToolStripMenuItem.Size = New System.Drawing.Size(154, 22) - Me.SetAsDefaultToolStripMenuItem.Text = "Set As Default" - ' - 'ConfigListPowderDataNSGViewBindingSource - ' - Me.ConfigListPowderDataNSGViewBindingSource.DataMember = "Config_List_Powder_Data_NSG_View" - Me.ConfigListPowderDataNSGViewBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'TabPage3 - ' - Me.TabPage3.Controls.Add(Me.btnUpdate) - Me.TabPage3.Controls.Add(Me.btnAddNotes) - Me.TabPage3.Controls.Add(Me.txtNotes) - Me.TabPage3.Location = New System.Drawing.Point(4, 22) - Me.TabPage3.Name = "TabPage3" - Me.TabPage3.Padding = New System.Windows.Forms.Padding(3) - Me.TabPage3.Size = New System.Drawing.Size(705, 407) - Me.TabPage3.TabIndex = 2 - Me.TabPage3.Text = "Notes" - Me.TabPage3.UseVisualStyleBackColor = True - ' - 'btnUpdate - ' - Me.btnUpdate.Location = New System.Drawing.Point(128, 13) - Me.btnUpdate.Name = "btnUpdate" - Me.btnUpdate.Size = New System.Drawing.Size(75, 23) - Me.btnUpdate.TabIndex = 2 - Me.btnUpdate.Text = "Update Notes" - Me.btnUpdate.UseVisualStyleBackColor = True - Me.btnUpdate.Visible = False - ' - 'btnAddNotes - ' - Me.btnAddNotes.Location = New System.Drawing.Point(9, 13) - Me.btnAddNotes.Name = "btnAddNotes" - Me.btnAddNotes.Size = New System.Drawing.Size(101, 23) - Me.btnAddNotes.TabIndex = 1 - Me.btnAddNotes.Text = "Edit Notes" - Me.btnAddNotes.UseVisualStyleBackColor = True - ' - 'txtNotes - ' - Me.txtNotes.Location = New System.Drawing.Point(7, 39) - Me.txtNotes.Multiline = True - Me.txtNotes.Name = "txtNotes" - Me.txtNotes.ReadOnly = True - Me.txtNotes.Size = New System.Drawing.Size(627, 310) - Me.txtNotes.TabIndex = 0 - ' - 'TabPage4 - ' - Me.TabPage4.Controls.Add(Me.GroupBox8) - Me.TabPage4.Controls.Add(Me.GroupBox7) - Me.TabPage4.Location = New System.Drawing.Point(4, 22) - Me.TabPage4.Name = "TabPage4" - Me.TabPage4.Size = New System.Drawing.Size(705, 407) - Me.TabPage4.TabIndex = 3 - Me.TabPage4.Text = "Cost & Stats" - Me.TabPage4.UseVisualStyleBackColor = True - ' - 'GroupBox8 - ' - Me.GroupBox8.Controls.Add(Me.txtTCR) - Me.GroupBox8.Controls.Add(Me.txtNMR) - Me.GroupBox8.Controls.Add(Me.txtCBIS) - Me.GroupBox8.Controls.Add(Me.txtCCIS) - Me.GroupBox8.Controls.Add(Me.txtCPriIS) - Me.GroupBox8.Controls.Add(Me.Label47) - Me.GroupBox8.Controls.Add(Me.Label46) - Me.GroupBox8.Controls.Add(Me.Label45) - Me.GroupBox8.Controls.Add(Me.Label44) - Me.GroupBox8.Controls.Add(Me.Label43) - Me.GroupBox8.Controls.Add(Me.txtCPowIS) - Me.GroupBox8.Controls.Add(Me.Label42) - Me.GroupBox8.Location = New System.Drawing.Point(25, 175) - Me.GroupBox8.Name = "GroupBox8" - Me.GroupBox8.Size = New System.Drawing.Size(365, 177) - Me.GroupBox8.TabIndex = 23 - Me.GroupBox8.TabStop = False - Me.GroupBox8.Text = "Build Stats and Costs" - ' - 'txtTCR - ' - Me.txtTCR.Location = New System.Drawing.Point(203, 148) - Me.txtTCR.Name = "txtTCR" - Me.txtTCR.ReadOnly = True - Me.txtTCR.Size = New System.Drawing.Size(135, 20) - Me.txtTCR.TabIndex = 33 - ' - 'txtNMR - ' - Me.txtNMR.Location = New System.Drawing.Point(203, 123) - Me.txtNMR.Name = "txtNMR" - Me.txtNMR.ReadOnly = True - Me.txtNMR.Size = New System.Drawing.Size(135, 20) - Me.txtNMR.TabIndex = 32 - ' - 'txtCBIS - ' - Me.txtCBIS.Location = New System.Drawing.Point(203, 97) - Me.txtCBIS.Name = "txtCBIS" - Me.txtCBIS.ReadOnly = True - Me.txtCBIS.Size = New System.Drawing.Size(135, 20) - Me.txtCBIS.TabIndex = 31 - ' - 'txtCCIS - ' - Me.txtCCIS.Location = New System.Drawing.Point(203, 71) - Me.txtCCIS.Name = "txtCCIS" - Me.txtCCIS.ReadOnly = True - Me.txtCCIS.Size = New System.Drawing.Size(135, 20) - Me.txtCCIS.TabIndex = 30 - ' - 'txtCPriIS - ' - Me.txtCPriIS.Location = New System.Drawing.Point(203, 44) - Me.txtCPriIS.Name = "txtCPriIS" - Me.txtCPriIS.ReadOnly = True - Me.txtCPriIS.Size = New System.Drawing.Size(135, 20) - Me.txtCPriIS.TabIndex = 29 - ' - 'Label47 - ' - Me.Label47.AutoSize = True - Me.Label47.Location = New System.Drawing.Point(15, 151) - Me.Label47.Name = "Label47" - Me.Label47.Size = New System.Drawing.Size(110, 13) - Me.Label47.TabIndex = 28 - Me.Label47.Text = "Total Cost of Rounds:" - ' - 'Label46 - ' - Me.Label46.AutoSize = True - Me.Label46.Location = New System.Drawing.Point(15, 126) - Me.Label46.Name = "Label46" - Me.Label46.Size = New System.Drawing.Size(185, 13) - Me.Label46.TabIndex = 27 - Me.Label46.Text = "Number of rounds that you can make:" - ' - 'Label45 - ' - Me.Label45.AutoSize = True - Me.Label45.Location = New System.Drawing.Point(15, 100) - Me.Label45.Name = "Label45" - Me.Label45.Size = New System.Drawing.Size(172, 13) - Me.Label45.TabIndex = 26 - Me.Label45.Text = "Current Number of Bullets in Stock:" - ' - 'Label44 - ' - Me.Label44.AutoSize = True - Me.Label44.Location = New System.Drawing.Point(15, 74) - Me.Label44.Name = "Label44" - Me.Label44.Size = New System.Drawing.Size(170, 13) - Me.Label44.TabIndex = 25 - Me.Label44.Text = "Current Number of Cases in Stock:" - ' - 'Label43 - ' - Me.Label43.AutoSize = True - Me.Label43.Location = New System.Drawing.Point(15, 47) - Me.Label43.Name = "Label43" - Me.Label43.Size = New System.Drawing.Size(175, 13) - Me.Label43.TabIndex = 24 - Me.Label43.Text = "Current Number of Primers in Stock:" - ' - 'txtCPowIS - ' - Me.txtCPowIS.Location = New System.Drawing.Point(203, 18) - Me.txtCPowIS.Name = "txtCPowIS" - Me.txtCPowIS.ReadOnly = True - Me.txtCPowIS.Size = New System.Drawing.Size(135, 20) - Me.txtCPowIS.TabIndex = 23 - ' - 'Label42 - ' - Me.Label42.AutoSize = True - Me.Label42.Location = New System.Drawing.Point(15, 21) - Me.Label42.Name = "Label42" - Me.Label42.Size = New System.Drawing.Size(165, 13) - Me.Label42.TabIndex = 22 - Me.Label42.Text = "Current Powder In-Stock (Grains):" - ' - 'GroupBox7 - ' - Me.GroupBox7.Controls.Add(Me.Label41) - Me.GroupBox7.Controls.Add(Me.txtC1RA) - Me.GroupBox7.Controls.Add(Me.txtCOPMid) - Me.GroupBox7.Controls.Add(Me.txtCPC) - Me.GroupBox7.Controls.Add(Me.txtCPP) - Me.GroupBox7.Controls.Add(Me.txtCPB) - Me.GroupBox7.Controls.Add(Me.Label40) - Me.GroupBox7.Controls.Add(Me.Label39) - Me.GroupBox7.Controls.Add(Me.Label38) - Me.GroupBox7.Controls.Add(Me.Label37) - Me.GroupBox7.Location = New System.Drawing.Point(25, 13) - Me.GroupBox7.Name = "GroupBox7" - Me.GroupBox7.Size = New System.Drawing.Size(365, 160) - Me.GroupBox7.TabIndex = 22 - Me.GroupBox7.TabStop = False - Me.GroupBox7.Text = "General Costs" - ' - 'Label41 - ' - Me.Label41.AutoSize = True - Me.Label41.Location = New System.Drawing.Point(15, 129) - Me.Label41.Name = "Label41" - Me.Label41.Size = New System.Drawing.Size(185, 13) - Me.Label41.TabIndex = 19 - Me.Label41.Text = "Total for 1 Round of Live Ammunition:" - ' - 'txtC1RA - ' - Me.txtC1RA.Location = New System.Drawing.Point(206, 126) - Me.txtC1RA.Name = "txtC1RA" - Me.txtC1RA.ReadOnly = True - Me.txtC1RA.Size = New System.Drawing.Size(135, 20) - Me.txtC1RA.TabIndex = 18 - ' - 'txtCOPMid - ' - Me.txtCOPMid.Location = New System.Drawing.Point(206, 100) - Me.txtCOPMid.Name = "txtCOPMid" - Me.txtCOPMid.ReadOnly = True - Me.txtCOPMid.Size = New System.Drawing.Size(135, 20) - Me.txtCOPMid.TabIndex = 17 - ' - 'txtCPC - ' - Me.txtCPC.Location = New System.Drawing.Point(206, 74) - Me.txtCPC.Name = "txtCPC" - Me.txtCPC.ReadOnly = True - Me.txtCPC.Size = New System.Drawing.Size(135, 20) - Me.txtCPC.TabIndex = 16 - ' - 'txtCPP - ' - Me.txtCPP.Location = New System.Drawing.Point(206, 47) - Me.txtCPP.Name = "txtCPP" - Me.txtCPP.ReadOnly = True - Me.txtCPP.Size = New System.Drawing.Size(135, 20) - Me.txtCPP.TabIndex = 15 - ' - 'txtCPB - ' - Me.txtCPB.Location = New System.Drawing.Point(206, 19) - Me.txtCPB.Name = "txtCPB" - Me.txtCPB.ReadOnly = True - Me.txtCPB.Size = New System.Drawing.Size(135, 20) - Me.txtCPB.TabIndex = 14 - ' - 'Label40 - ' - Me.Label40.AutoSize = True - Me.Label40.Location = New System.Drawing.Point(15, 103) - Me.Label40.Name = "Label40" - Me.Label40.Size = New System.Drawing.Size(108, 13) - Me.Label40.TabIndex = 13 - Me.Label40.Text = "Cost of Powder (Mid):" - ' - 'Label39 - ' - Me.Label39.AutoSize = True - Me.Label39.Location = New System.Drawing.Point(15, 77) - Me.Label39.Name = "Label39" - Me.Label39.Size = New System.Drawing.Size(77, 13) - Me.Label39.TabIndex = 12 - Me.Label39.Text = "Cost Per Case:" - ' - 'Label38 - ' - Me.Label38.AutoSize = True - Me.Label38.Location = New System.Drawing.Point(15, 52) - Me.Label38.Name = "Label38" - Me.Label38.Size = New System.Drawing.Size(82, 13) - Me.Label38.TabIndex = 11 - Me.Label38.Text = "Cost Per Primer:" - ' - 'Label37 - ' - Me.Label37.AutoSize = True - Me.Label37.Location = New System.Drawing.Point(15, 22) - Me.Label37.Name = "Label37" - Me.Label37.Size = New System.Drawing.Size(79, 13) - Me.Label37.TabIndex = 10 - Me.Label37.Text = "Cost Per Bullet:" - ' - 'TabPage5 - ' - Me.TabPage5.Controls.Add(Me.DataGridView2) - Me.TabPage5.Location = New System.Drawing.Point(4, 22) - Me.TabPage5.Name = "TabPage5" - Me.TabPage5.Padding = New System.Windows.Forms.Padding(3) - Me.TabPage5.Size = New System.Drawing.Size(705, 407) - Me.TabPage5.TabIndex = 4 - Me.TabPage5.Text = "History/Audit" - Me.TabPage5.UseVisualStyleBackColor = True - ' - 'DataGridView2 - ' - Me.DataGridView2.AllowUserToAddRows = False - Me.DataGridView2.AutoGenerateColumns = False - Me.DataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DataGridView2.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn1, Me.DtcDataGridViewTextBoxColumn, Me.QtyDataGridViewTextBoxColumn, Me.EcDataGridViewTextBoxColumn, Me.EcprDataGridViewTextBoxColumn}) - Me.DataGridView2.DataSource = Me.LoadersLogAmmunitionAuditBindingSource - Me.DataGridView2.Dock = System.Windows.Forms.DockStyle.Fill - Me.DataGridView2.Location = New System.Drawing.Point(3, 3) - Me.DataGridView2.Name = "DataGridView2" - Me.DataGridView2.ReadOnly = True - Me.DataGridView2.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DataGridView2.Size = New System.Drawing.Size(699, 401) - Me.DataGridView2.TabIndex = 0 - ' - 'LoadersLogAmmunitionAuditBindingSource - ' - Me.LoadersLogAmmunitionAuditBindingSource.DataMember = "Loaders_Log_Ammunition_Audit" - Me.LoadersLogAmmunitionAuditBindingSource.DataSource = Me.MLLDataSet - ' - 'TextBox11 - ' - Me.TextBox11.Location = New System.Drawing.Point(118, 43) - Me.TextBox11.Name = "TextBox11" - Me.TextBox11.ReadOnly = True - Me.TextBox11.Size = New System.Drawing.Size(146, 20) - Me.TextBox11.TabIndex = 17 - ' - 'TextBox12 - ' - Me.TextBox12.Location = New System.Drawing.Point(118, 17) - Me.TextBox12.Name = "TextBox12" - Me.TextBox12.ReadOnly = True - Me.TextBox12.Size = New System.Drawing.Size(146, 20) - Me.TextBox12.TabIndex = 16 - ' - 'GroupBox4 - ' - Me.GroupBox4.Controls.Add(Me.Label19) - Me.GroupBox4.Controls.Add(Me.Label20) - Me.GroupBox4.Controls.Add(Me.Label21) - Me.GroupBox4.Controls.Add(Me.Label22) - Me.GroupBox4.Location = New System.Drawing.Point(293, 173) - Me.GroupBox4.Name = "GroupBox4" - Me.GroupBox4.Size = New System.Drawing.Size(268, 125) - Me.GroupBox4.TabIndex = 10 - Me.GroupBox4.TabStop = False - Me.GroupBox4.Text = "Case Information" - ' - 'Label19 - ' - Me.Label19.AutoSize = True - Me.Label19.Location = New System.Drawing.Point(15, 84) - Me.Label19.Name = "Label19" - Me.Label19.Size = New System.Drawing.Size(66, 13) - Me.Label19.TabIndex = 15 - Me.Label19.Text = "Times Used:" - ' - 'Label20 - ' - Me.Label20.AutoSize = True - Me.Label20.Location = New System.Drawing.Point(15, 59) - Me.Label20.Name = "Label20" - Me.Label20.Size = New System.Drawing.Size(78, 13) - Me.Label20.TabIndex = 14 - Me.Label20.Text = "Trim to Length:" - ' - 'Label21 - ' - Me.Label21.AutoSize = True - Me.Label21.Location = New System.Drawing.Point(17, 39) - Me.Label21.Name = "Label21" - Me.Label21.Size = New System.Drawing.Size(38, 13) - Me.Label21.TabIndex = 13 - Me.Label21.Text = "Name:" - ' - 'Label22 - ' - Me.Label22.AutoSize = True - Me.Label22.Location = New System.Drawing.Point(12, 16) - Me.Label22.Name = "Label22" - Me.Label22.Size = New System.Drawing.Size(73, 13) - Me.Label22.TabIndex = 12 - Me.Label22.Text = "Manufacturer:" - ' - 'GroupBox5 - ' - Me.GroupBox5.Controls.Add(Me.Label23) - Me.GroupBox5.Controls.Add(Me.Label24) - Me.GroupBox5.Controls.Add(Me.Label25) - Me.GroupBox5.Location = New System.Drawing.Point(293, 74) - Me.GroupBox5.Name = "GroupBox5" - Me.GroupBox5.Size = New System.Drawing.Size(268, 95) - Me.GroupBox5.TabIndex = 9 - Me.GroupBox5.TabStop = False - Me.GroupBox5.Text = "Primer Information" - ' - 'Label23 - ' - Me.Label23.AutoSize = True - Me.Label23.Location = New System.Drawing.Point(19, 67) - Me.Label23.Name = "Label23" - Me.Label23.Size = New System.Drawing.Size(66, 13) - Me.Label23.TabIndex = 12 - Me.Label23.Text = "Primer Type:" - ' - 'Label24 - ' - Me.Label24.AutoSize = True - Me.Label24.Location = New System.Drawing.Point(21, 50) - Me.Label24.Name = "Label24" - Me.Label24.Size = New System.Drawing.Size(38, 13) - Me.Label24.TabIndex = 11 - Me.Label24.Text = "Name:" - ' - 'Label25 - ' - Me.Label25.AutoSize = True - Me.Label25.Location = New System.Drawing.Point(16, 27) - Me.Label25.Name = "Label25" - Me.Label25.Size = New System.Drawing.Size(73, 13) - Me.Label25.TabIndex = 10 - Me.Label25.Text = "Manufacturer:" - ' - 'GroupBox6 - ' - Me.GroupBox6.Controls.Add(Me.TextBox13) - Me.GroupBox6.Controls.Add(Me.TextBox14) - Me.GroupBox6.Controls.Add(Me.TextBox15) - Me.GroupBox6.Controls.Add(Me.TextBox16) - Me.GroupBox6.Controls.Add(Me.TextBox17) - Me.GroupBox6.Controls.Add(Me.TextBox18) - Me.GroupBox6.Controls.Add(Me.TextBox19) - Me.GroupBox6.Controls.Add(Me.TextBox20) - Me.GroupBox6.Controls.Add(Me.Label26) - Me.GroupBox6.Controls.Add(Me.Label27) - Me.GroupBox6.Controls.Add(Me.Label28) - Me.GroupBox6.Controls.Add(Me.Label29) - Me.GroupBox6.Controls.Add(Me.Label30) - Me.GroupBox6.Controls.Add(Me.Label31) - Me.GroupBox6.Controls.Add(Me.Label32) - Me.GroupBox6.Controls.Add(Me.Label33) - Me.GroupBox6.Location = New System.Drawing.Point(12, 74) - Me.GroupBox6.Name = "GroupBox6" - Me.GroupBox6.Size = New System.Drawing.Size(262, 226) - Me.GroupBox6.TabIndex = 8 - Me.GroupBox6.TabStop = False - Me.GroupBox6.Text = "Bullet Information" - ' - 'TextBox13 - ' - Me.TextBox13.Location = New System.Drawing.Point(106, 200) - Me.TextBox13.Name = "TextBox13" - Me.TextBox13.ReadOnly = True - Me.TextBox13.Size = New System.Drawing.Size(146, 20) - Me.TextBox13.TabIndex = 24 - ' - 'TextBox14 - ' - Me.TextBox14.Location = New System.Drawing.Point(106, 176) - Me.TextBox14.Name = "TextBox14" - Me.TextBox14.ReadOnly = True - Me.TextBox14.Size = New System.Drawing.Size(146, 20) - Me.TextBox14.TabIndex = 23 - ' - 'TextBox15 - ' - Me.TextBox15.Location = New System.Drawing.Point(106, 151) - Me.TextBox15.Name = "TextBox15" - Me.TextBox15.ReadOnly = True - Me.TextBox15.Size = New System.Drawing.Size(146, 20) - Me.TextBox15.TabIndex = 22 - ' - 'TextBox16 - ' - Me.TextBox16.Location = New System.Drawing.Point(106, 125) - Me.TextBox16.Name = "TextBox16" - Me.TextBox16.ReadOnly = True - Me.TextBox16.Size = New System.Drawing.Size(146, 20) - Me.TextBox16.TabIndex = 21 - ' - 'TextBox17 - ' - Me.TextBox17.Location = New System.Drawing.Point(106, 99) - Me.TextBox17.Name = "TextBox17" - Me.TextBox17.ReadOnly = True - Me.TextBox17.Size = New System.Drawing.Size(146, 20) - Me.TextBox17.TabIndex = 20 - ' - 'TextBox18 - ' - Me.TextBox18.Location = New System.Drawing.Point(106, 75) - Me.TextBox18.Name = "TextBox18" - Me.TextBox18.ReadOnly = True - Me.TextBox18.Size = New System.Drawing.Size(146, 20) - Me.TextBox18.TabIndex = 19 - ' - 'TextBox19 - ' - Me.TextBox19.Location = New System.Drawing.Point(106, 50) - Me.TextBox19.Name = "TextBox19" - Me.TextBox19.ReadOnly = True - Me.TextBox19.Size = New System.Drawing.Size(146, 20) - Me.TextBox19.TabIndex = 18 - ' - 'TextBox20 - ' - Me.TextBox20.Location = New System.Drawing.Point(106, 22) - Me.TextBox20.Name = "TextBox20" - Me.TextBox20.ReadOnly = True - Me.TextBox20.Size = New System.Drawing.Size(146, 20) - Me.TextBox20.TabIndex = 17 - ' - 'Label26 - ' - Me.Label26.AutoSize = True - Me.Label26.Location = New System.Drawing.Point(6, 203) - Me.Label26.Name = "Label26" - Me.Label26.Size = New System.Drawing.Size(63, 13) - Me.Label26.TabIndex = 15 - Me.Label26.Text = "Bullet Type:" - ' - 'Label27 - ' - Me.Label27.AutoSize = True - Me.Label27.Location = New System.Drawing.Point(6, 183) - Me.Label27.Name = "Label27" - Me.Label27.Size = New System.Drawing.Size(98, 13) - Me.Label27.TabIndex = 14 - Me.Label27.Text = "Ballistic Coefficient:" - ' - 'Label28 - ' - Me.Label28.AutoSize = True - Me.Label28.Location = New System.Drawing.Point(6, 154) - Me.Label28.Name = "Label28" - Me.Label28.Size = New System.Drawing.Size(69, 13) - Me.Label28.TabIndex = 13 - Me.Label28.Text = "Part Number:" - ' - 'Label29 - ' - Me.Label29.AutoSize = True - Me.Label29.Location = New System.Drawing.Point(6, 128) - Me.Label29.Name = "Label29" - Me.Label29.Size = New System.Drawing.Size(92, 13) - Me.Label29.TabIndex = 12 - Me.Label29.Text = "Sectional Density:" - ' - 'Label30 - ' - Me.Label30.AutoSize = True - Me.Label30.Location = New System.Drawing.Point(6, 102) - Me.Label30.Name = "Label30" - Me.Label30.Size = New System.Drawing.Size(44, 13) - Me.Label30.TabIndex = 11 - Me.Label30.Text = "Weight:" - ' - 'Label31 - ' - Me.Label31.AutoSize = True - Me.Label31.Location = New System.Drawing.Point(6, 78) - Me.Label31.Name = "Label31" - Me.Label31.Size = New System.Drawing.Size(52, 13) - Me.Label31.TabIndex = 10 - Me.Label31.Text = "Diameter:" - ' - 'Label32 - ' - Me.Label32.AutoSize = True - Me.Label32.Location = New System.Drawing.Point(6, 53) - Me.Label32.Name = "Label32" - Me.Label32.Size = New System.Drawing.Size(38, 13) - Me.Label32.TabIndex = 9 - Me.Label32.Text = "Name:" - ' - 'Label33 - ' - Me.Label33.AutoSize = True - Me.Label33.Location = New System.Drawing.Point(6, 27) - Me.Label33.Name = "Label33" - Me.Label33.Size = New System.Drawing.Size(73, 13) - Me.Label33.TabIndex = 8 - Me.Label33.Text = "Manufacturer:" - ' - 'Label34 - ' - Me.Label34.AutoSize = True - Me.Label34.Location = New System.Drawing.Point(290, 20) - Me.Label34.Name = "Label34" - Me.Label34.Size = New System.Drawing.Size(42, 13) - Me.Label34.TabIndex = 2 - Me.Label34.Text = "Caliber:" - ' - 'Label35 - ' - Me.Label35.AutoSize = True - Me.Label35.Location = New System.Drawing.Point(9, 46) - Me.Label35.Name = "Label35" - Me.Label35.Size = New System.Drawing.Size(91, 13) - Me.Label35.TabIndex = 1 - Me.Label35.Text = "Ammunition Type:" - ' - 'Label36 - ' - Me.Label36.AutoSize = True - Me.Label36.Location = New System.Drawing.Point(9, 20) - Me.Label36.Name = "Label36" - Me.Label36.Size = New System.Drawing.Size(103, 13) - Me.Label36.TabIndex = 0 - Me.Label36.Text = "Configuration Name:" - ' - 'ToolStrip1 - ' - Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1, Me.ToolStripButton3, Me.ToolStripButton2, Me.ToolStripButton4, Me.ToolStripButton5}) - Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) - Me.ToolStrip1.Name = "ToolStrip1" - Me.ToolStrip1.Size = New System.Drawing.Size(713, 25) - Me.ToolStrip1.TabIndex = 1 - Me.ToolStrip1.Text = "ToolStrip1" - ' - 'ToolStripButton1 - ' - Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) - Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton1.Name = "ToolStripButton1" - Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton1.Text = "Make Live Ammunition for this Configuration Load!" - ' - 'ToolStripButton3 - ' - Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) - Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton3.Name = "ToolStripButton3" - Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton3.Text = "Edit Configuration" - ' - 'ToolStripButton2 - ' - Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) - Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton2.Name = "ToolStripButton2" - Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton2.Text = "Close this window." - ' - 'ToolStripButton4 - ' - Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton4.Image = CType(resources.GetObject("ToolStripButton4.Image"), System.Drawing.Image) - Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton4.Name = "ToolStripButton4" - Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton4.Text = "Print Configuration" - ' - 'ToolStripButton5 - ' - Me.ToolStripButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton5.Image = CType(resources.GetObject("ToolStripButton5.Image"), System.Drawing.Image) - Me.ToolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton5.Name = "ToolStripButton5" - Me.ToolStripButton5.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton5.Text = "Export to XML" - ' - 'btnCancel - ' - Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(25, 462) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 2 - Me.btnCancel.Text = "&Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - Me.btnCancel.Visible = False - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'Config_List_Powder_Data_NSG_ViewTableAdapter - ' - Me.Config_List_Powder_Data_NSG_ViewTableAdapter.ClearBeforeFill = True - ' - 'Loaders_Log_Ammunition_AuditTableAdapter - ' - Me.Loaders_Log_Ammunition_AuditTableAdapter.ClearBeforeFill = True - ' - 'IDDataGridViewTextBoxColumn1 - ' - Me.IDDataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.IDDataGridViewTextBoxColumn1.DataPropertyName = "ID" - Me.IDDataGridViewTextBoxColumn1.HeaderText = "Lot No." - Me.IDDataGridViewTextBoxColumn1.Name = "IDDataGridViewTextBoxColumn1" - Me.IDDataGridViewTextBoxColumn1.ReadOnly = True - Me.IDDataGridViewTextBoxColumn1.Width = 67 - ' - 'DtcDataGridViewTextBoxColumn - ' - Me.DtcDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.DtcDataGridViewTextBoxColumn.DataPropertyName = "dtc" - Me.DtcDataGridViewTextBoxColumn.HeaderText = "Data Created" - Me.DtcDataGridViewTextBoxColumn.Name = "DtcDataGridViewTextBoxColumn" - Me.DtcDataGridViewTextBoxColumn.ReadOnly = True - Me.DtcDataGridViewTextBoxColumn.Width = 95 - ' - 'QtyDataGridViewTextBoxColumn - ' - Me.QtyDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.QtyDataGridViewTextBoxColumn.DataPropertyName = "qty" - Me.QtyDataGridViewTextBoxColumn.HeaderText = "Qty" - Me.QtyDataGridViewTextBoxColumn.Name = "QtyDataGridViewTextBoxColumn" - Me.QtyDataGridViewTextBoxColumn.ReadOnly = True - Me.QtyDataGridViewTextBoxColumn.Width = 48 - ' - 'EcDataGridViewTextBoxColumn - ' - Me.EcDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader - Me.EcDataGridViewTextBoxColumn.DataPropertyName = "ec" - Me.EcDataGridViewTextBoxColumn.HeaderText = "Estimated Cost." - Me.EcDataGridViewTextBoxColumn.Name = "EcDataGridViewTextBoxColumn" - Me.EcDataGridViewTextBoxColumn.ReadOnly = True - Me.EcDataGridViewTextBoxColumn.Width = 97 - ' - 'EcprDataGridViewTextBoxColumn - ' - Me.EcprDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader - Me.EcprDataGridViewTextBoxColumn.DataPropertyName = "ecpr" - Me.EcprDataGridViewTextBoxColumn.HeaderText = "Estimated Cost Per Round" - Me.EcprDataGridViewTextBoxColumn.Name = "EcprDataGridViewTextBoxColumn" - Me.EcprDataGridViewTextBoxColumn.ReadOnly = True - Me.EcprDataGridViewTextBoxColumn.Width = 114 - ' - 'frmView_Configuration_Sheet - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.CancelButton = Me.btnCancel - Me.ClientSize = New System.Drawing.Size(713, 452) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.ToolStrip1) - Me.Controls.Add(Me.TabControl1) - Me.HelpProvider1.SetHelpKeyword(Me, "View Configuration Sheets") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "View Configuration Sheets") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmView_Configuration_Sheet" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "frmView_Configuration_Sheet" - Me.TabControl1.ResumeLayout(False) - Me.TabPage1.ResumeLayout(False) - Me.TabPage1.PerformLayout() - Me.GroupBox3.ResumeLayout(False) - Me.GroupBox3.PerformLayout() - Me.GroupBox2.ResumeLayout(False) - Me.GroupBox2.PerformLayout() - Me.GroupBox1.ResumeLayout(False) - Me.GroupBox1.PerformLayout() - Me.TabPage2.ResumeLayout(False) - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() - Me.CMSPowder.ResumeLayout(False) - CType(Me.ConfigListPowderDataNSGViewBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.TabPage3.ResumeLayout(False) - Me.TabPage3.PerformLayout() - Me.TabPage4.ResumeLayout(False) - Me.GroupBox8.ResumeLayout(False) - Me.GroupBox8.PerformLayout() - Me.GroupBox7.ResumeLayout(False) - Me.GroupBox7.PerformLayout() - Me.TabPage5.ResumeLayout(False) - CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.LoadersLogAmmunitionAuditBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - Me.GroupBox4.ResumeLayout(False) - Me.GroupBox4.PerformLayout() - Me.GroupBox5.ResumeLayout(False) - Me.GroupBox5.PerformLayout() - Me.GroupBox6.ResumeLayout(False) - Me.GroupBox6.PerformLayout() - Me.ToolStrip1.ResumeLayout(False) - Me.ToolStrip1.PerformLayout() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmViewConfigurationSheet)) + Me.TabControl1 = New System.Windows.Forms.TabControl + Me.TabPage1 = New System.Windows.Forms.TabPage + Me.chkFav = New System.Windows.Forms.CheckBox + Me.rbstatus2 = New System.Windows.Forms.RadioButton + Me.rbstatus1 = New System.Windows.Forms.RadioButton + Me.Label48 = New System.Windows.Forms.Label + Me.lblReffer = New System.Windows.Forms.Label + Me.ChkPerLoad = New System.Windows.Forms.CheckBox + Me.txtCal = New System.Windows.Forms.TextBox + Me.txtAmmoType = New System.Windows.Forms.TextBox + Me.txtConfigName = New System.Windows.Forms.TextBox + Me.GroupBox3 = New System.Windows.Forms.GroupBox + Me.txtCTU = New System.Windows.Forms.TextBox + Me.txtCTOL = New System.Windows.Forms.TextBox + Me.txtCName = New System.Windows.Forms.TextBox + Me.txtCManu = New System.Windows.Forms.TextBox + Me.Label18 = New System.Windows.Forms.Label + Me.Label17 = New System.Windows.Forms.Label + Me.Label15 = New System.Windows.Forms.Label + Me.Label16 = New System.Windows.Forms.Label + Me.GroupBox2 = New System.Windows.Forms.GroupBox + Me.txtPType = New System.Windows.Forms.TextBox + Me.txtPName = New System.Windows.Forms.TextBox + Me.txtPManu = New System.Windows.Forms.TextBox + Me.Label14 = New System.Windows.Forms.Label + Me.Label12 = New System.Windows.Forms.Label + Me.Label13 = New System.Windows.Forms.Label + Me.GroupBox1 = New System.Windows.Forms.GroupBox + Me.txtBType = New System.Windows.Forms.TextBox + Me.txtBBCO = New System.Windows.Forms.TextBox + Me.txtBPartNo = New System.Windows.Forms.TextBox + Me.txtBSecDen = New System.Windows.Forms.TextBox + Me.txtBWei = New System.Windows.Forms.TextBox + Me.txtBDia = New System.Windows.Forms.TextBox + Me.txtBName = New System.Windows.Forms.TextBox + Me.txtBManu = New System.Windows.Forms.TextBox + Me.Label11 = New System.Windows.Forms.Label + Me.Label10 = New System.Windows.Forms.Label + Me.Label9 = New System.Windows.Forms.Label + Me.Label8 = New System.Windows.Forms.Label + Me.Label7 = New System.Windows.Forms.Label + Me.Label6 = New System.Windows.Forms.Label + Me.Label5 = New System.Windows.Forms.Label + Me.Label4 = New System.Windows.Forms.Label + Me.Label3 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label1 = New System.Windows.Forms.Label + Me.TabPage2 = New System.Windows.Forms.TabPage + Me.btnRefresh = New System.Windows.Forms.Button + Me.btnAdd = New System.Windows.Forms.Button + Me.DataGridView1 = New System.Windows.Forms.DataGridView + Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.CLNIDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.PIDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.PowderNameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.LoadMinDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.LoadMidDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.LoadMaxDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.FPSMinDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.FPSMIDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.FPSMaxDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.CUPSMinDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.CUPSMidDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.CUPSMaxDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.CMSPowder = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.SetAsDefaultToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.ConfigListPowderDataNSGViewBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.TabPage3 = New System.Windows.Forms.TabPage + Me.btnUpdate = New System.Windows.Forms.Button + Me.btnAddNotes = New System.Windows.Forms.Button + Me.txtNotes = New System.Windows.Forms.TextBox + Me.TabPage4 = New System.Windows.Forms.TabPage + Me.GroupBox8 = New System.Windows.Forms.GroupBox + Me.txtTCR = New System.Windows.Forms.TextBox + Me.txtNMR = New System.Windows.Forms.TextBox + Me.txtCBIS = New System.Windows.Forms.TextBox + Me.txtCCIS = New System.Windows.Forms.TextBox + Me.txtCPriIS = New System.Windows.Forms.TextBox + Me.Label47 = New System.Windows.Forms.Label + Me.Label46 = New System.Windows.Forms.Label + Me.Label45 = New System.Windows.Forms.Label + Me.Label44 = New System.Windows.Forms.Label + Me.Label43 = New System.Windows.Forms.Label + Me.txtCPowIS = New System.Windows.Forms.TextBox + Me.Label42 = New System.Windows.Forms.Label + Me.GroupBox7 = New System.Windows.Forms.GroupBox + Me.Label41 = New System.Windows.Forms.Label + Me.txtC1RA = New System.Windows.Forms.TextBox + Me.txtCOPMid = New System.Windows.Forms.TextBox + Me.txtCPC = New System.Windows.Forms.TextBox + Me.txtCPP = New System.Windows.Forms.TextBox + Me.txtCPB = New System.Windows.Forms.TextBox + Me.Label40 = New System.Windows.Forms.Label + Me.Label39 = New System.Windows.Forms.Label + Me.Label38 = New System.Windows.Forms.Label + Me.Label37 = New System.Windows.Forms.Label + Me.TabPage5 = New System.Windows.Forms.TabPage + Me.DataGridView2 = New System.Windows.Forms.DataGridView + Me.LoadersLogAmmunitionAuditBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.TextBox11 = New System.Windows.Forms.TextBox + Me.TextBox12 = New System.Windows.Forms.TextBox + Me.GroupBox4 = New System.Windows.Forms.GroupBox + Me.Label19 = New System.Windows.Forms.Label + Me.Label20 = New System.Windows.Forms.Label + Me.Label21 = New System.Windows.Forms.Label + Me.Label22 = New System.Windows.Forms.Label + Me.GroupBox5 = New System.Windows.Forms.GroupBox + Me.Label23 = New System.Windows.Forms.Label + Me.Label24 = New System.Windows.Forms.Label + Me.Label25 = New System.Windows.Forms.Label + Me.GroupBox6 = New System.Windows.Forms.GroupBox + Me.TextBox13 = New System.Windows.Forms.TextBox + Me.TextBox14 = New System.Windows.Forms.TextBox + Me.TextBox15 = New System.Windows.Forms.TextBox + Me.TextBox16 = New System.Windows.Forms.TextBox + Me.TextBox17 = New System.Windows.Forms.TextBox + Me.TextBox18 = New System.Windows.Forms.TextBox + Me.TextBox19 = New System.Windows.Forms.TextBox + Me.TextBox20 = New System.Windows.Forms.TextBox + Me.Label26 = New System.Windows.Forms.Label + Me.Label27 = New System.Windows.Forms.Label + Me.Label28 = New System.Windows.Forms.Label + Me.Label29 = New System.Windows.Forms.Label + Me.Label30 = New System.Windows.Forms.Label + Me.Label31 = New System.Windows.Forms.Label + Me.Label32 = New System.Windows.Forms.Label + Me.Label33 = New System.Windows.Forms.Label + Me.Label34 = New System.Windows.Forms.Label + Me.Label35 = New System.Windows.Forms.Label + Me.Label36 = New System.Windows.Forms.Label + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton4 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton5 = New System.Windows.Forms.ToolStripButton + Me.btnCancel = New System.Windows.Forms.Button + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + Me.SaveFileDialog1 = New System.Windows.Forms.SaveFileDialog + Me.Config_List_Powder_Data_NSG_ViewTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Config_List_Powder_Data_NSG_ViewTableAdapter + Me.Loaders_Log_Ammunition_AuditTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_Ammunition_AuditTableAdapter + Me.IDDataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.DtcDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.QtyDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.EcDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.EcprDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.TabControl1.SuspendLayout() + Me.TabPage1.SuspendLayout() + Me.GroupBox3.SuspendLayout() + Me.GroupBox2.SuspendLayout() + Me.GroupBox1.SuspendLayout() + Me.TabPage2.SuspendLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.CMSPowder.SuspendLayout() + CType(Me.ConfigListPowderDataNSGViewBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.TabPage3.SuspendLayout() + Me.TabPage4.SuspendLayout() + Me.GroupBox8.SuspendLayout() + Me.GroupBox7.SuspendLayout() + Me.TabPage5.SuspendLayout() + CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LoadersLogAmmunitionAuditBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + Me.GroupBox4.SuspendLayout() + Me.GroupBox5.SuspendLayout() + Me.GroupBox6.SuspendLayout() + Me.ToolStrip1.SuspendLayout() + Me.SuspendLayout() + ' + 'TabControl1 + ' + Me.TabControl1.Controls.Add(Me.TabPage1) + Me.TabControl1.Controls.Add(Me.TabPage2) + Me.TabControl1.Controls.Add(Me.TabPage3) + Me.TabControl1.Controls.Add(Me.TabPage4) + Me.TabControl1.Controls.Add(Me.TabPage5) + Me.TabControl1.Location = New System.Drawing.Point(0, 23) + Me.TabControl1.Name = "TabControl1" + Me.TabControl1.SelectedIndex = 0 + Me.TabControl1.Size = New System.Drawing.Size(713, 433) + Me.TabControl1.TabIndex = 0 + ' + 'TabPage1 + ' + Me.TabPage1.Controls.Add(Me.chkFav) + Me.TabPage1.Controls.Add(Me.rbstatus2) + Me.TabPage1.Controls.Add(Me.rbstatus1) + Me.TabPage1.Controls.Add(Me.Label48) + Me.TabPage1.Controls.Add(Me.lblReffer) + Me.TabPage1.Controls.Add(Me.ChkPerLoad) + Me.TabPage1.Controls.Add(Me.txtCal) + Me.TabPage1.Controls.Add(Me.txtAmmoType) + Me.TabPage1.Controls.Add(Me.txtConfigName) + Me.TabPage1.Controls.Add(Me.GroupBox3) + Me.TabPage1.Controls.Add(Me.GroupBox2) + Me.TabPage1.Controls.Add(Me.GroupBox1) + Me.TabPage1.Controls.Add(Me.Label3) + Me.TabPage1.Controls.Add(Me.Label2) + Me.TabPage1.Controls.Add(Me.Label1) + Me.TabPage1.Location = New System.Drawing.Point(4, 22) + Me.TabPage1.Name = "TabPage1" + Me.TabPage1.Padding = New System.Windows.Forms.Padding(3) + Me.TabPage1.Size = New System.Drawing.Size(705, 407) + Me.TabPage1.TabIndex = 0 + Me.TabPage1.Text = "Information" + Me.TabPage1.UseVisualStyleBackColor = True + ' + 'chkFav + ' + Me.chkFav.AutoSize = True + Me.chkFav.Location = New System.Drawing.Point(293, 70) + Me.chkFav.Name = "chkFav" + Me.chkFav.Size = New System.Drawing.Size(64, 17) + Me.chkFav.TabIndex = 24 + Me.chkFav.Text = "Favorite" + Me.chkFav.UseVisualStyleBackColor = True + ' + 'rbstatus2 + ' + Me.rbstatus2.AutoSize = True + Me.rbstatus2.Location = New System.Drawing.Point(180, 70) + Me.rbstatus2.Name = "rbstatus2" + Me.rbstatus2.Size = New System.Drawing.Size(63, 17) + Me.rbstatus2.TabIndex = 23 + Me.rbstatus2.TabStop = True + Me.rbstatus2.Text = "Inactive" + Me.rbstatus2.UseVisualStyleBackColor = True + ' + 'rbstatus1 + ' + Me.rbstatus1.AutoSize = True + Me.rbstatus1.Location = New System.Drawing.Point(118, 69) + Me.rbstatus1.Name = "rbstatus1" + Me.rbstatus1.Size = New System.Drawing.Size(55, 17) + Me.rbstatus1.TabIndex = 22 + Me.rbstatus1.TabStop = True + Me.rbstatus1.Text = "Active" + Me.rbstatus1.UseVisualStyleBackColor = True + ' + 'Label48 + ' + Me.Label48.AutoSize = True + Me.Label48.Location = New System.Drawing.Point(9, 69) + Me.Label48.Name = "Label48" + Me.Label48.Size = New System.Drawing.Size(40, 13) + Me.Label48.TabIndex = 21 + Me.Label48.Text = "Status:" + ' + 'lblReffer + ' + Me.lblReffer.Location = New System.Drawing.Point(394, 46) + Me.lblReffer.Name = "lblReffer" + Me.lblReffer.Size = New System.Drawing.Size(295, 40) + Me.lblReffer.TabIndex = 20 + ' + 'ChkPerLoad + ' + Me.ChkPerLoad.AutoCheck = False + Me.ChkPerLoad.AutoSize = True + Me.ChkPerLoad.Enabled = False + Me.ChkPerLoad.Location = New System.Drawing.Point(293, 46) + Me.ChkPerLoad.Name = "ChkPerLoad" + Me.ChkPerLoad.Size = New System.Drawing.Size(94, 17) + Me.ChkPerLoad.TabIndex = 19 + Me.ChkPerLoad.Text = "Personal Load" + Me.ChkPerLoad.UseVisualStyleBackColor = True + ' + 'txtCal + ' + Me.txtCal.Location = New System.Drawing.Point(338, 17) + Me.txtCal.Name = "txtCal" + Me.txtCal.ReadOnly = True + Me.txtCal.Size = New System.Drawing.Size(146, 20) + Me.txtCal.TabIndex = 18 + ' + 'txtAmmoType + ' + Me.txtAmmoType.Location = New System.Drawing.Point(118, 43) + Me.txtAmmoType.Name = "txtAmmoType" + Me.txtAmmoType.ReadOnly = True + Me.txtAmmoType.Size = New System.Drawing.Size(146, 20) + Me.txtAmmoType.TabIndex = 17 + ' + 'txtConfigName + ' + Me.txtConfigName.Location = New System.Drawing.Point(118, 17) + Me.txtConfigName.Name = "txtConfigName" + Me.txtConfigName.ReadOnly = True + Me.txtConfigName.Size = New System.Drawing.Size(146, 20) + Me.txtConfigName.TabIndex = 16 + ' + 'GroupBox3 + ' + Me.GroupBox3.Controls.Add(Me.txtCTU) + Me.GroupBox3.Controls.Add(Me.txtCTOL) + Me.GroupBox3.Controls.Add(Me.txtCName) + Me.GroupBox3.Controls.Add(Me.txtCManu) + Me.GroupBox3.Controls.Add(Me.Label18) + Me.GroupBox3.Controls.Add(Me.Label17) + Me.GroupBox3.Controls.Add(Me.Label15) + Me.GroupBox3.Controls.Add(Me.Label16) + Me.GroupBox3.Location = New System.Drawing.Point(293, 226) + Me.GroupBox3.Name = "GroupBox3" + Me.GroupBox3.Size = New System.Drawing.Size(268, 125) + Me.GroupBox3.TabIndex = 10 + Me.GroupBox3.TabStop = False + Me.GroupBox3.Text = "Case Information" + ' + 'txtCTU + ' + Me.txtCTU.Location = New System.Drawing.Point(106, 81) + Me.txtCTU.Name = "txtCTU" + Me.txtCTU.ReadOnly = True + Me.txtCTU.Size = New System.Drawing.Size(146, 20) + Me.txtCTU.TabIndex = 20 + ' + 'txtCTOL + ' + Me.txtCTOL.Location = New System.Drawing.Point(106, 59) + Me.txtCTOL.Name = "txtCTOL" + Me.txtCTOL.ReadOnly = True + Me.txtCTOL.Size = New System.Drawing.Size(146, 20) + Me.txtCTOL.TabIndex = 19 + ' + 'txtCName + ' + Me.txtCName.Location = New System.Drawing.Point(106, 36) + Me.txtCName.Name = "txtCName" + Me.txtCName.ReadOnly = True + Me.txtCName.Size = New System.Drawing.Size(146, 20) + Me.txtCName.TabIndex = 18 + ' + 'txtCManu + ' + Me.txtCManu.Location = New System.Drawing.Point(106, 13) + Me.txtCManu.Name = "txtCManu" + Me.txtCManu.ReadOnly = True + Me.txtCManu.Size = New System.Drawing.Size(146, 20) + Me.txtCManu.TabIndex = 17 + ' + 'Label18 + ' + Me.Label18.AutoSize = True + Me.Label18.Location = New System.Drawing.Point(12, 84) + Me.Label18.Name = "Label18" + Me.Label18.Size = New System.Drawing.Size(66, 13) + Me.Label18.TabIndex = 15 + Me.Label18.Text = "Times Used:" + ' + 'Label17 + ' + Me.Label17.AutoSize = True + Me.Label17.Location = New System.Drawing.Point(12, 62) + Me.Label17.Name = "Label17" + Me.Label17.Size = New System.Drawing.Size(78, 13) + Me.Label17.TabIndex = 14 + Me.Label17.Text = "Trim to Length:" + ' + 'Label15 + ' + Me.Label15.AutoSize = True + Me.Label15.Location = New System.Drawing.Point(12, 39) + Me.Label15.Name = "Label15" + Me.Label15.Size = New System.Drawing.Size(38, 13) + Me.Label15.TabIndex = 13 + Me.Label15.Text = "Name:" + ' + 'Label16 + ' + Me.Label16.AutoSize = True + Me.Label16.Location = New System.Drawing.Point(12, 16) + Me.Label16.Name = "Label16" + Me.Label16.Size = New System.Drawing.Size(73, 13) + Me.Label16.TabIndex = 12 + Me.Label16.Text = "Manufacturer:" + ' + 'GroupBox2 + ' + Me.GroupBox2.Controls.Add(Me.txtPType) + Me.GroupBox2.Controls.Add(Me.txtPName) + Me.GroupBox2.Controls.Add(Me.txtPManu) + Me.GroupBox2.Controls.Add(Me.Label14) + Me.GroupBox2.Controls.Add(Me.Label12) + Me.GroupBox2.Controls.Add(Me.Label13) + Me.GroupBox2.Location = New System.Drawing.Point(293, 112) + Me.GroupBox2.Name = "GroupBox2" + Me.GroupBox2.Size = New System.Drawing.Size(268, 108) + Me.GroupBox2.TabIndex = 9 + Me.GroupBox2.TabStop = False + Me.GroupBox2.Text = "Primer Information" + ' + 'txtPType + ' + Me.txtPType.Location = New System.Drawing.Point(106, 75) + Me.txtPType.Name = "txtPType" + Me.txtPType.ReadOnly = True + Me.txtPType.Size = New System.Drawing.Size(146, 20) + Me.txtPType.TabIndex = 19 + ' + 'txtPName + ' + Me.txtPName.Location = New System.Drawing.Point(106, 50) + Me.txtPName.Name = "txtPName" + Me.txtPName.ReadOnly = True + Me.txtPName.Size = New System.Drawing.Size(146, 20) + Me.txtPName.TabIndex = 18 + ' + 'txtPManu + ' + Me.txtPManu.Location = New System.Drawing.Point(106, 24) + Me.txtPManu.Name = "txtPManu" + Me.txtPManu.ReadOnly = True + Me.txtPManu.Size = New System.Drawing.Size(146, 20) + Me.txtPManu.TabIndex = 17 + ' + 'Label14 + ' + Me.Label14.AutoSize = True + Me.Label14.Location = New System.Drawing.Point(12, 78) + Me.Label14.Name = "Label14" + Me.Label14.Size = New System.Drawing.Size(66, 13) + Me.Label14.TabIndex = 12 + Me.Label14.Text = "Primer Type:" + ' + 'Label12 + ' + Me.Label12.AutoSize = True + Me.Label12.Location = New System.Drawing.Point(12, 53) + Me.Label12.Name = "Label12" + Me.Label12.Size = New System.Drawing.Size(38, 13) + Me.Label12.TabIndex = 11 + Me.Label12.Text = "Name:" + ' + 'Label13 + ' + Me.Label13.AutoSize = True + Me.Label13.Location = New System.Drawing.Point(12, 27) + Me.Label13.Name = "Label13" + Me.Label13.Size = New System.Drawing.Size(73, 13) + Me.Label13.TabIndex = 10 + Me.Label13.Text = "Manufacturer:" + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.txtBType) + Me.GroupBox1.Controls.Add(Me.txtBBCO) + Me.GroupBox1.Controls.Add(Me.txtBPartNo) + Me.GroupBox1.Controls.Add(Me.txtBSecDen) + Me.GroupBox1.Controls.Add(Me.txtBWei) + Me.GroupBox1.Controls.Add(Me.txtBDia) + Me.GroupBox1.Controls.Add(Me.txtBName) + Me.GroupBox1.Controls.Add(Me.txtBManu) + Me.GroupBox1.Controls.Add(Me.Label11) + Me.GroupBox1.Controls.Add(Me.Label10) + Me.GroupBox1.Controls.Add(Me.Label9) + Me.GroupBox1.Controls.Add(Me.Label8) + Me.GroupBox1.Controls.Add(Me.Label7) + Me.GroupBox1.Controls.Add(Me.Label6) + Me.GroupBox1.Controls.Add(Me.Label5) + Me.GroupBox1.Controls.Add(Me.Label4) + Me.GroupBox1.Location = New System.Drawing.Point(12, 112) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(262, 239) + Me.GroupBox1.TabIndex = 8 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "Bullet Information" + ' + 'txtBType + ' + Me.txtBType.Location = New System.Drawing.Point(106, 200) + Me.txtBType.Name = "txtBType" + Me.txtBType.ReadOnly = True + Me.txtBType.Size = New System.Drawing.Size(146, 20) + Me.txtBType.TabIndex = 24 + ' + 'txtBBCO + ' + Me.txtBBCO.Location = New System.Drawing.Point(106, 176) + Me.txtBBCO.Name = "txtBBCO" + Me.txtBBCO.ReadOnly = True + Me.txtBBCO.Size = New System.Drawing.Size(146, 20) + Me.txtBBCO.TabIndex = 23 + ' + 'txtBPartNo + ' + Me.txtBPartNo.Location = New System.Drawing.Point(106, 151) + Me.txtBPartNo.Name = "txtBPartNo" + Me.txtBPartNo.ReadOnly = True + Me.txtBPartNo.Size = New System.Drawing.Size(146, 20) + Me.txtBPartNo.TabIndex = 22 + ' + 'txtBSecDen + ' + Me.txtBSecDen.Location = New System.Drawing.Point(106, 125) + Me.txtBSecDen.Name = "txtBSecDen" + Me.txtBSecDen.ReadOnly = True + Me.txtBSecDen.Size = New System.Drawing.Size(146, 20) + Me.txtBSecDen.TabIndex = 21 + ' + 'txtBWei + ' + Me.txtBWei.Location = New System.Drawing.Point(106, 99) + Me.txtBWei.Name = "txtBWei" + Me.txtBWei.ReadOnly = True + Me.txtBWei.Size = New System.Drawing.Size(146, 20) + Me.txtBWei.TabIndex = 20 + ' + 'txtBDia + ' + Me.txtBDia.Location = New System.Drawing.Point(106, 75) + Me.txtBDia.Name = "txtBDia" + Me.txtBDia.ReadOnly = True + Me.txtBDia.Size = New System.Drawing.Size(146, 20) + Me.txtBDia.TabIndex = 19 + ' + 'txtBName + ' + Me.txtBName.Location = New System.Drawing.Point(106, 50) + Me.txtBName.Name = "txtBName" + Me.txtBName.ReadOnly = True + Me.txtBName.Size = New System.Drawing.Size(146, 20) + Me.txtBName.TabIndex = 18 + ' + 'txtBManu + ' + Me.txtBManu.Location = New System.Drawing.Point(106, 22) + Me.txtBManu.Name = "txtBManu" + Me.txtBManu.ReadOnly = True + Me.txtBManu.Size = New System.Drawing.Size(146, 20) + Me.txtBManu.TabIndex = 17 + ' + 'Label11 + ' + Me.Label11.AutoSize = True + Me.Label11.Location = New System.Drawing.Point(6, 203) + Me.Label11.Name = "Label11" + Me.Label11.Size = New System.Drawing.Size(63, 13) + Me.Label11.TabIndex = 15 + Me.Label11.Text = "Bullet Type:" + ' + 'Label10 + ' + Me.Label10.AutoSize = True + Me.Label10.Location = New System.Drawing.Point(6, 179) + Me.Label10.Name = "Label10" + Me.Label10.Size = New System.Drawing.Size(98, 13) + Me.Label10.TabIndex = 14 + Me.Label10.Text = "Ballistic Coefficient:" + ' + 'Label9 + ' + Me.Label9.AutoSize = True + Me.Label9.Location = New System.Drawing.Point(6, 154) + Me.Label9.Name = "Label9" + Me.Label9.Size = New System.Drawing.Size(69, 13) + Me.Label9.TabIndex = 13 + Me.Label9.Text = "Part Number:" + ' + 'Label8 + ' + Me.Label8.AutoSize = True + Me.Label8.Location = New System.Drawing.Point(6, 128) + Me.Label8.Name = "Label8" + Me.Label8.Size = New System.Drawing.Size(92, 13) + Me.Label8.TabIndex = 12 + Me.Label8.Text = "Sectional Density:" + ' + 'Label7 + ' + Me.Label7.AutoSize = True + Me.Label7.Location = New System.Drawing.Point(6, 102) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(44, 13) + Me.Label7.TabIndex = 11 + Me.Label7.Text = "Weight:" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(6, 78) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(52, 13) + Me.Label6.TabIndex = 10 + Me.Label6.Text = "Diameter:" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(6, 53) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(38, 13) + Me.Label5.TabIndex = 9 + Me.Label5.Text = "Name:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(6, 27) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(73, 13) + Me.Label4.TabIndex = 8 + Me.Label4.Text = "Manufacturer:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(290, 20) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(42, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "Caliber:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(9, 46) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(91, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Ammunition Type:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(9, 20) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(103, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Configuration Name:" + ' + 'TabPage2 + ' + Me.TabPage2.Controls.Add(Me.btnRefresh) + Me.TabPage2.Controls.Add(Me.btnAdd) + Me.TabPage2.Controls.Add(Me.DataGridView1) + Me.TabPage2.Location = New System.Drawing.Point(4, 22) + Me.TabPage2.Name = "TabPage2" + Me.TabPage2.Padding = New System.Windows.Forms.Padding(3) + Me.TabPage2.Size = New System.Drawing.Size(705, 407) + Me.TabPage2.TabIndex = 1 + Me.TabPage2.Text = "Powder" + Me.TabPage2.UseVisualStyleBackColor = True + ' + 'btnRefresh + ' + Me.btnRefresh.Location = New System.Drawing.Point(95, 7) + Me.btnRefresh.Name = "btnRefresh" + Me.btnRefresh.Size = New System.Drawing.Size(75, 22) + Me.btnRefresh.TabIndex = 2 + Me.btnRefresh.Text = "Refresh" + Me.btnRefresh.UseVisualStyleBackColor = True + ' + 'btnAdd + ' + Me.btnAdd.Location = New System.Drawing.Point(4, 7) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(75, 22) + Me.btnAdd.TabIndex = 1 + Me.btnAdd.Text = "Add" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'DataGridView1 + ' + Me.DataGridView1.AllowUserToAddRows = False + Me.DataGridView1.AllowUserToDeleteRows = False + Me.DataGridView1.AutoGenerateColumns = False + Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.CLNIDDataGridViewTextBoxColumn, Me.PIDDataGridViewTextBoxColumn, Me.PowderNameDataGridViewTextBoxColumn, Me.LoadMinDataGridViewTextBoxColumn, Me.LoadMidDataGridViewTextBoxColumn, Me.LoadMaxDataGridViewTextBoxColumn, Me.FPSMinDataGridViewTextBoxColumn, Me.FPSMIDDataGridViewTextBoxColumn, Me.FPSMaxDataGridViewTextBoxColumn, Me.CUPSMinDataGridViewTextBoxColumn, Me.CUPSMidDataGridViewTextBoxColumn, Me.CUPSMaxDataGridViewTextBoxColumn}) + Me.DataGridView1.ContextMenuStrip = Me.CMSPowder + Me.DataGridView1.DataSource = Me.ConfigListPowderDataNSGViewBindingSource + Me.DataGridView1.Location = New System.Drawing.Point(4, 29) + Me.DataGridView1.Name = "DataGridView1" + Me.DataGridView1.ReadOnly = True + Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DataGridView1.Size = New System.Drawing.Size(630, 312) + Me.DataGridView1.TabIndex = 0 + ' + 'IDDataGridViewTextBoxColumn + ' + Me.IDDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None + Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" + Me.IDDataGridViewTextBoxColumn.FillWeight = 1.0! + Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" + Me.IDDataGridViewTextBoxColumn.MinimumWidth = 2 + Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" + Me.IDDataGridViewTextBoxColumn.ReadOnly = True + Me.IDDataGridViewTextBoxColumn.Visible = False + Me.IDDataGridViewTextBoxColumn.Width = 2 + ' + 'CLNIDDataGridViewTextBoxColumn + ' + Me.CLNIDDataGridViewTextBoxColumn.DataPropertyName = "CLNID" + Me.CLNIDDataGridViewTextBoxColumn.HeaderText = "CLNID" + Me.CLNIDDataGridViewTextBoxColumn.Name = "CLNIDDataGridViewTextBoxColumn" + Me.CLNIDDataGridViewTextBoxColumn.ReadOnly = True + Me.CLNIDDataGridViewTextBoxColumn.Visible = False + ' + 'PIDDataGridViewTextBoxColumn + ' + Me.PIDDataGridViewTextBoxColumn.DataPropertyName = "PID" + Me.PIDDataGridViewTextBoxColumn.HeaderText = "PID" + Me.PIDDataGridViewTextBoxColumn.Name = "PIDDataGridViewTextBoxColumn" + Me.PIDDataGridViewTextBoxColumn.ReadOnly = True + Me.PIDDataGridViewTextBoxColumn.Visible = False + ' + 'PowderNameDataGridViewTextBoxColumn + ' + Me.PowderNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.PowderNameDataGridViewTextBoxColumn.DataPropertyName = "Powder_Name" + Me.PowderNameDataGridViewTextBoxColumn.HeaderText = "Powder" + Me.PowderNameDataGridViewTextBoxColumn.Name = "PowderNameDataGridViewTextBoxColumn" + Me.PowderNameDataGridViewTextBoxColumn.ReadOnly = True + Me.PowderNameDataGridViewTextBoxColumn.Width = 68 + ' + 'LoadMinDataGridViewTextBoxColumn + ' + Me.LoadMinDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader + Me.LoadMinDataGridViewTextBoxColumn.DataPropertyName = "Load_Min" + Me.LoadMinDataGridViewTextBoxColumn.HeaderText = "Load Minimum" + Me.LoadMinDataGridViewTextBoxColumn.Name = "LoadMinDataGridViewTextBoxColumn" + Me.LoadMinDataGridViewTextBoxColumn.ReadOnly = True + ' + 'LoadMidDataGridViewTextBoxColumn + ' + Me.LoadMidDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader + Me.LoadMidDataGridViewTextBoxColumn.DataPropertyName = "Load_Mid" + Me.LoadMidDataGridViewTextBoxColumn.HeaderText = "Load Medium" + Me.LoadMidDataGridViewTextBoxColumn.Name = "LoadMidDataGridViewTextBoxColumn" + Me.LoadMidDataGridViewTextBoxColumn.ReadOnly = True + Me.LoadMidDataGridViewTextBoxColumn.Width = 96 + ' + 'LoadMaxDataGridViewTextBoxColumn + ' + Me.LoadMaxDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader + Me.LoadMaxDataGridViewTextBoxColumn.DataPropertyName = "Load_Max" + Me.LoadMaxDataGridViewTextBoxColumn.HeaderText = "Load Maxium" + Me.LoadMaxDataGridViewTextBoxColumn.Name = "LoadMaxDataGridViewTextBoxColumn" + Me.LoadMaxDataGridViewTextBoxColumn.ReadOnly = True + Me.LoadMaxDataGridViewTextBoxColumn.Width = 95 + ' + 'FPSMinDataGridViewTextBoxColumn + ' + Me.FPSMinDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader + Me.FPSMinDataGridViewTextBoxColumn.DataPropertyName = "FPS_Min" + Me.FPSMinDataGridViewTextBoxColumn.HeaderText = "FPS Minimum" + Me.FPSMinDataGridViewTextBoxColumn.Name = "FPSMinDataGridViewTextBoxColumn" + Me.FPSMinDataGridViewTextBoxColumn.ReadOnly = True + Me.FPSMinDataGridViewTextBoxColumn.Width = 96 + ' + 'FPSMIDDataGridViewTextBoxColumn + ' + Me.FPSMIDDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader + Me.FPSMIDDataGridViewTextBoxColumn.DataPropertyName = "FPS_MID" + Me.FPSMIDDataGridViewTextBoxColumn.HeaderText = "FPS Medium" + Me.FPSMIDDataGridViewTextBoxColumn.Name = "FPSMIDDataGridViewTextBoxColumn" + Me.FPSMIDDataGridViewTextBoxColumn.ReadOnly = True + Me.FPSMIDDataGridViewTextBoxColumn.Width = 92 + ' + 'FPSMaxDataGridViewTextBoxColumn + ' + Me.FPSMaxDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader + Me.FPSMaxDataGridViewTextBoxColumn.DataPropertyName = "FPS_Max" + Me.FPSMaxDataGridViewTextBoxColumn.HeaderText = "FPS Maxium" + Me.FPSMaxDataGridViewTextBoxColumn.Name = "FPSMaxDataGridViewTextBoxColumn" + Me.FPSMaxDataGridViewTextBoxColumn.ReadOnly = True + Me.FPSMaxDataGridViewTextBoxColumn.Width = 91 + ' + 'CUPSMinDataGridViewTextBoxColumn + ' + Me.CUPSMinDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader + Me.CUPSMinDataGridViewTextBoxColumn.DataPropertyName = "CUPS_Min" + Me.CUPSMinDataGridViewTextBoxColumn.HeaderText = "CUPS Minimum" + Me.CUPSMinDataGridViewTextBoxColumn.Name = "CUPSMinDataGridViewTextBoxColumn" + Me.CUPSMinDataGridViewTextBoxColumn.ReadOnly = True + Me.CUPSMinDataGridViewTextBoxColumn.Visible = False + ' + 'CUPSMidDataGridViewTextBoxColumn + ' + Me.CUPSMidDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader + Me.CUPSMidDataGridViewTextBoxColumn.DataPropertyName = "CUPS_Mid" + Me.CUPSMidDataGridViewTextBoxColumn.HeaderText = "CUPS Medium" + Me.CUPSMidDataGridViewTextBoxColumn.Name = "CUPSMidDataGridViewTextBoxColumn" + Me.CUPSMidDataGridViewTextBoxColumn.ReadOnly = True + Me.CUPSMidDataGridViewTextBoxColumn.Visible = False + ' + 'CUPSMaxDataGridViewTextBoxColumn + ' + Me.CUPSMaxDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader + Me.CUPSMaxDataGridViewTextBoxColumn.DataPropertyName = "CUPS_Max" + Me.CUPSMaxDataGridViewTextBoxColumn.HeaderText = "CUPS Maxium" + Me.CUPSMaxDataGridViewTextBoxColumn.Name = "CUPSMaxDataGridViewTextBoxColumn" + Me.CUPSMaxDataGridViewTextBoxColumn.ReadOnly = True + Me.CUPSMaxDataGridViewTextBoxColumn.Visible = False + ' + 'CMSPowder + ' + Me.CMSPowder.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.DeleteToolStripMenuItem, Me.SetAsDefaultToolStripMenuItem}) + Me.CMSPowder.Name = "CMSPowder" + Me.CMSPowder.Size = New System.Drawing.Size(155, 48) + ' + 'DeleteToolStripMenuItem + ' + Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) + Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" + Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(154, 22) + Me.DeleteToolStripMenuItem.Text = "Delete" + ' + 'SetAsDefaultToolStripMenuItem + ' + Me.SetAsDefaultToolStripMenuItem.Image = CType(resources.GetObject("SetAsDefaultToolStripMenuItem.Image"), System.Drawing.Image) + Me.SetAsDefaultToolStripMenuItem.Name = "SetAsDefaultToolStripMenuItem" + Me.SetAsDefaultToolStripMenuItem.Size = New System.Drawing.Size(154, 22) + Me.SetAsDefaultToolStripMenuItem.Text = "Set As Default" + ' + 'ConfigListPowderDataNSGViewBindingSource + ' + Me.ConfigListPowderDataNSGViewBindingSource.DataMember = "Config_List_Powder_Data_NSG_View" + Me.ConfigListPowderDataNSGViewBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'TabPage3 + ' + Me.TabPage3.Controls.Add(Me.btnUpdate) + Me.TabPage3.Controls.Add(Me.btnAddNotes) + Me.TabPage3.Controls.Add(Me.txtNotes) + Me.TabPage3.Location = New System.Drawing.Point(4, 22) + Me.TabPage3.Name = "TabPage3" + Me.TabPage3.Padding = New System.Windows.Forms.Padding(3) + Me.TabPage3.Size = New System.Drawing.Size(705, 407) + Me.TabPage3.TabIndex = 2 + Me.TabPage3.Text = "Notes" + Me.TabPage3.UseVisualStyleBackColor = True + ' + 'btnUpdate + ' + Me.btnUpdate.Location = New System.Drawing.Point(128, 13) + Me.btnUpdate.Name = "btnUpdate" + Me.btnUpdate.Size = New System.Drawing.Size(75, 23) + Me.btnUpdate.TabIndex = 2 + Me.btnUpdate.Text = "Update Notes" + Me.btnUpdate.UseVisualStyleBackColor = True + Me.btnUpdate.Visible = False + ' + 'btnAddNotes + ' + Me.btnAddNotes.Location = New System.Drawing.Point(9, 13) + Me.btnAddNotes.Name = "btnAddNotes" + Me.btnAddNotes.Size = New System.Drawing.Size(101, 23) + Me.btnAddNotes.TabIndex = 1 + Me.btnAddNotes.Text = "Edit Notes" + Me.btnAddNotes.UseVisualStyleBackColor = True + ' + 'txtNotes + ' + Me.txtNotes.Location = New System.Drawing.Point(7, 39) + Me.txtNotes.Multiline = True + Me.txtNotes.Name = "txtNotes" + Me.txtNotes.ReadOnly = True + Me.txtNotes.Size = New System.Drawing.Size(627, 310) + Me.txtNotes.TabIndex = 0 + ' + 'TabPage4 + ' + Me.TabPage4.Controls.Add(Me.GroupBox8) + Me.TabPage4.Controls.Add(Me.GroupBox7) + Me.TabPage4.Location = New System.Drawing.Point(4, 22) + Me.TabPage4.Name = "TabPage4" + Me.TabPage4.Size = New System.Drawing.Size(705, 407) + Me.TabPage4.TabIndex = 3 + Me.TabPage4.Text = "Cost & Stats" + Me.TabPage4.UseVisualStyleBackColor = True + ' + 'GroupBox8 + ' + Me.GroupBox8.Controls.Add(Me.txtTCR) + Me.GroupBox8.Controls.Add(Me.txtNMR) + Me.GroupBox8.Controls.Add(Me.txtCBIS) + Me.GroupBox8.Controls.Add(Me.txtCCIS) + Me.GroupBox8.Controls.Add(Me.txtCPriIS) + Me.GroupBox8.Controls.Add(Me.Label47) + Me.GroupBox8.Controls.Add(Me.Label46) + Me.GroupBox8.Controls.Add(Me.Label45) + Me.GroupBox8.Controls.Add(Me.Label44) + Me.GroupBox8.Controls.Add(Me.Label43) + Me.GroupBox8.Controls.Add(Me.txtCPowIS) + Me.GroupBox8.Controls.Add(Me.Label42) + Me.GroupBox8.Location = New System.Drawing.Point(25, 175) + Me.GroupBox8.Name = "GroupBox8" + Me.GroupBox8.Size = New System.Drawing.Size(365, 177) + Me.GroupBox8.TabIndex = 23 + Me.GroupBox8.TabStop = False + Me.GroupBox8.Text = "Build Stats and Costs" + ' + 'txtTCR + ' + Me.txtTCR.Location = New System.Drawing.Point(203, 148) + Me.txtTCR.Name = "txtTCR" + Me.txtTCR.ReadOnly = True + Me.txtTCR.Size = New System.Drawing.Size(135, 20) + Me.txtTCR.TabIndex = 33 + ' + 'txtNMR + ' + Me.txtNMR.Location = New System.Drawing.Point(203, 123) + Me.txtNMR.Name = "txtNMR" + Me.txtNMR.ReadOnly = True + Me.txtNMR.Size = New System.Drawing.Size(135, 20) + Me.txtNMR.TabIndex = 32 + ' + 'txtCBIS + ' + Me.txtCBIS.Location = New System.Drawing.Point(203, 97) + Me.txtCBIS.Name = "txtCBIS" + Me.txtCBIS.ReadOnly = True + Me.txtCBIS.Size = New System.Drawing.Size(135, 20) + Me.txtCBIS.TabIndex = 31 + ' + 'txtCCIS + ' + Me.txtCCIS.Location = New System.Drawing.Point(203, 71) + Me.txtCCIS.Name = "txtCCIS" + Me.txtCCIS.ReadOnly = True + Me.txtCCIS.Size = New System.Drawing.Size(135, 20) + Me.txtCCIS.TabIndex = 30 + ' + 'txtCPriIS + ' + Me.txtCPriIS.Location = New System.Drawing.Point(203, 44) + Me.txtCPriIS.Name = "txtCPriIS" + Me.txtCPriIS.ReadOnly = True + Me.txtCPriIS.Size = New System.Drawing.Size(135, 20) + Me.txtCPriIS.TabIndex = 29 + ' + 'Label47 + ' + Me.Label47.AutoSize = True + Me.Label47.Location = New System.Drawing.Point(15, 151) + Me.Label47.Name = "Label47" + Me.Label47.Size = New System.Drawing.Size(110, 13) + Me.Label47.TabIndex = 28 + Me.Label47.Text = "Total Cost of Rounds:" + ' + 'Label46 + ' + Me.Label46.AutoSize = True + Me.Label46.Location = New System.Drawing.Point(15, 126) + Me.Label46.Name = "Label46" + Me.Label46.Size = New System.Drawing.Size(185, 13) + Me.Label46.TabIndex = 27 + Me.Label46.Text = "Number of rounds that you can make:" + ' + 'Label45 + ' + Me.Label45.AutoSize = True + Me.Label45.Location = New System.Drawing.Point(15, 100) + Me.Label45.Name = "Label45" + Me.Label45.Size = New System.Drawing.Size(172, 13) + Me.Label45.TabIndex = 26 + Me.Label45.Text = "Current Number of Bullets in Stock:" + ' + 'Label44 + ' + Me.Label44.AutoSize = True + Me.Label44.Location = New System.Drawing.Point(15, 74) + Me.Label44.Name = "Label44" + Me.Label44.Size = New System.Drawing.Size(170, 13) + Me.Label44.TabIndex = 25 + Me.Label44.Text = "Current Number of Cases in Stock:" + ' + 'Label43 + ' + Me.Label43.AutoSize = True + Me.Label43.Location = New System.Drawing.Point(15, 47) + Me.Label43.Name = "Label43" + Me.Label43.Size = New System.Drawing.Size(175, 13) + Me.Label43.TabIndex = 24 + Me.Label43.Text = "Current Number of Primers in Stock:" + ' + 'txtCPowIS + ' + Me.txtCPowIS.Location = New System.Drawing.Point(203, 18) + Me.txtCPowIS.Name = "txtCPowIS" + Me.txtCPowIS.ReadOnly = True + Me.txtCPowIS.Size = New System.Drawing.Size(135, 20) + Me.txtCPowIS.TabIndex = 23 + ' + 'Label42 + ' + Me.Label42.AutoSize = True + Me.Label42.Location = New System.Drawing.Point(15, 21) + Me.Label42.Name = "Label42" + Me.Label42.Size = New System.Drawing.Size(165, 13) + Me.Label42.TabIndex = 22 + Me.Label42.Text = "Current Powder In-Stock (Grains):" + ' + 'GroupBox7 + ' + Me.GroupBox7.Controls.Add(Me.Label41) + Me.GroupBox7.Controls.Add(Me.txtC1RA) + Me.GroupBox7.Controls.Add(Me.txtCOPMid) + Me.GroupBox7.Controls.Add(Me.txtCPC) + Me.GroupBox7.Controls.Add(Me.txtCPP) + Me.GroupBox7.Controls.Add(Me.txtCPB) + Me.GroupBox7.Controls.Add(Me.Label40) + Me.GroupBox7.Controls.Add(Me.Label39) + Me.GroupBox7.Controls.Add(Me.Label38) + Me.GroupBox7.Controls.Add(Me.Label37) + Me.GroupBox7.Location = New System.Drawing.Point(25, 13) + Me.GroupBox7.Name = "GroupBox7" + Me.GroupBox7.Size = New System.Drawing.Size(365, 160) + Me.GroupBox7.TabIndex = 22 + Me.GroupBox7.TabStop = False + Me.GroupBox7.Text = "General Costs" + ' + 'Label41 + ' + Me.Label41.AutoSize = True + Me.Label41.Location = New System.Drawing.Point(15, 129) + Me.Label41.Name = "Label41" + Me.Label41.Size = New System.Drawing.Size(185, 13) + Me.Label41.TabIndex = 19 + Me.Label41.Text = "Total for 1 Round of Live Ammunition:" + ' + 'txtC1RA + ' + Me.txtC1RA.Location = New System.Drawing.Point(206, 126) + Me.txtC1RA.Name = "txtC1RA" + Me.txtC1RA.ReadOnly = True + Me.txtC1RA.Size = New System.Drawing.Size(135, 20) + Me.txtC1RA.TabIndex = 18 + ' + 'txtCOPMid + ' + Me.txtCOPMid.Location = New System.Drawing.Point(206, 100) + Me.txtCOPMid.Name = "txtCOPMid" + Me.txtCOPMid.ReadOnly = True + Me.txtCOPMid.Size = New System.Drawing.Size(135, 20) + Me.txtCOPMid.TabIndex = 17 + ' + 'txtCPC + ' + Me.txtCPC.Location = New System.Drawing.Point(206, 74) + Me.txtCPC.Name = "txtCPC" + Me.txtCPC.ReadOnly = True + Me.txtCPC.Size = New System.Drawing.Size(135, 20) + Me.txtCPC.TabIndex = 16 + ' + 'txtCPP + ' + Me.txtCPP.Location = New System.Drawing.Point(206, 47) + Me.txtCPP.Name = "txtCPP" + Me.txtCPP.ReadOnly = True + Me.txtCPP.Size = New System.Drawing.Size(135, 20) + Me.txtCPP.TabIndex = 15 + ' + 'txtCPB + ' + Me.txtCPB.Location = New System.Drawing.Point(206, 19) + Me.txtCPB.Name = "txtCPB" + Me.txtCPB.ReadOnly = True + Me.txtCPB.Size = New System.Drawing.Size(135, 20) + Me.txtCPB.TabIndex = 14 + ' + 'Label40 + ' + Me.Label40.AutoSize = True + Me.Label40.Location = New System.Drawing.Point(15, 103) + Me.Label40.Name = "Label40" + Me.Label40.Size = New System.Drawing.Size(108, 13) + Me.Label40.TabIndex = 13 + Me.Label40.Text = "Cost of Powder (Mid):" + ' + 'Label39 + ' + Me.Label39.AutoSize = True + Me.Label39.Location = New System.Drawing.Point(15, 77) + Me.Label39.Name = "Label39" + Me.Label39.Size = New System.Drawing.Size(77, 13) + Me.Label39.TabIndex = 12 + Me.Label39.Text = "Cost Per Case:" + ' + 'Label38 + ' + Me.Label38.AutoSize = True + Me.Label38.Location = New System.Drawing.Point(15, 52) + Me.Label38.Name = "Label38" + Me.Label38.Size = New System.Drawing.Size(82, 13) + Me.Label38.TabIndex = 11 + Me.Label38.Text = "Cost Per Primer:" + ' + 'Label37 + ' + Me.Label37.AutoSize = True + Me.Label37.Location = New System.Drawing.Point(15, 22) + Me.Label37.Name = "Label37" + Me.Label37.Size = New System.Drawing.Size(79, 13) + Me.Label37.TabIndex = 10 + Me.Label37.Text = "Cost Per Bullet:" + ' + 'TabPage5 + ' + Me.TabPage5.Controls.Add(Me.DataGridView2) + Me.TabPage5.Location = New System.Drawing.Point(4, 22) + Me.TabPage5.Name = "TabPage5" + Me.TabPage5.Padding = New System.Windows.Forms.Padding(3) + Me.TabPage5.Size = New System.Drawing.Size(705, 407) + Me.TabPage5.TabIndex = 4 + Me.TabPage5.Text = "History/Audit" + Me.TabPage5.UseVisualStyleBackColor = True + ' + 'DataGridView2 + ' + Me.DataGridView2.AllowUserToAddRows = False + Me.DataGridView2.AutoGenerateColumns = False + Me.DataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridView2.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn1, Me.DtcDataGridViewTextBoxColumn, Me.QtyDataGridViewTextBoxColumn, Me.EcDataGridViewTextBoxColumn, Me.EcprDataGridViewTextBoxColumn}) + Me.DataGridView2.DataSource = Me.LoadersLogAmmunitionAuditBindingSource + Me.DataGridView2.Dock = System.Windows.Forms.DockStyle.Fill + Me.DataGridView2.Location = New System.Drawing.Point(3, 3) + Me.DataGridView2.Name = "DataGridView2" + Me.DataGridView2.ReadOnly = True + Me.DataGridView2.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DataGridView2.Size = New System.Drawing.Size(699, 401) + Me.DataGridView2.TabIndex = 0 + ' + 'LoadersLogAmmunitionAuditBindingSource + ' + Me.LoadersLogAmmunitionAuditBindingSource.DataMember = "Loaders_Log_Ammunition_Audit" + Me.LoadersLogAmmunitionAuditBindingSource.DataSource = Me.MLLDataSet + ' + 'TextBox11 + ' + Me.TextBox11.Location = New System.Drawing.Point(118, 43) + Me.TextBox11.Name = "TextBox11" + Me.TextBox11.ReadOnly = True + Me.TextBox11.Size = New System.Drawing.Size(146, 20) + Me.TextBox11.TabIndex = 17 + ' + 'TextBox12 + ' + Me.TextBox12.Location = New System.Drawing.Point(118, 17) + Me.TextBox12.Name = "TextBox12" + Me.TextBox12.ReadOnly = True + Me.TextBox12.Size = New System.Drawing.Size(146, 20) + Me.TextBox12.TabIndex = 16 + ' + 'GroupBox4 + ' + Me.GroupBox4.Controls.Add(Me.Label19) + Me.GroupBox4.Controls.Add(Me.Label20) + Me.GroupBox4.Controls.Add(Me.Label21) + Me.GroupBox4.Controls.Add(Me.Label22) + Me.GroupBox4.Location = New System.Drawing.Point(293, 173) + Me.GroupBox4.Name = "GroupBox4" + Me.GroupBox4.Size = New System.Drawing.Size(268, 125) + Me.GroupBox4.TabIndex = 10 + Me.GroupBox4.TabStop = False + Me.GroupBox4.Text = "Case Information" + ' + 'Label19 + ' + Me.Label19.AutoSize = True + Me.Label19.Location = New System.Drawing.Point(15, 84) + Me.Label19.Name = "Label19" + Me.Label19.Size = New System.Drawing.Size(66, 13) + Me.Label19.TabIndex = 15 + Me.Label19.Text = "Times Used:" + ' + 'Label20 + ' + Me.Label20.AutoSize = True + Me.Label20.Location = New System.Drawing.Point(15, 59) + Me.Label20.Name = "Label20" + Me.Label20.Size = New System.Drawing.Size(78, 13) + Me.Label20.TabIndex = 14 + Me.Label20.Text = "Trim to Length:" + ' + 'Label21 + ' + Me.Label21.AutoSize = True + Me.Label21.Location = New System.Drawing.Point(17, 39) + Me.Label21.Name = "Label21" + Me.Label21.Size = New System.Drawing.Size(38, 13) + Me.Label21.TabIndex = 13 + Me.Label21.Text = "Name:" + ' + 'Label22 + ' + Me.Label22.AutoSize = True + Me.Label22.Location = New System.Drawing.Point(12, 16) + Me.Label22.Name = "Label22" + Me.Label22.Size = New System.Drawing.Size(73, 13) + Me.Label22.TabIndex = 12 + Me.Label22.Text = "Manufacturer:" + ' + 'GroupBox5 + ' + Me.GroupBox5.Controls.Add(Me.Label23) + Me.GroupBox5.Controls.Add(Me.Label24) + Me.GroupBox5.Controls.Add(Me.Label25) + Me.GroupBox5.Location = New System.Drawing.Point(293, 74) + Me.GroupBox5.Name = "GroupBox5" + Me.GroupBox5.Size = New System.Drawing.Size(268, 95) + Me.GroupBox5.TabIndex = 9 + Me.GroupBox5.TabStop = False + Me.GroupBox5.Text = "Primer Information" + ' + 'Label23 + ' + Me.Label23.AutoSize = True + Me.Label23.Location = New System.Drawing.Point(19, 67) + Me.Label23.Name = "Label23" + Me.Label23.Size = New System.Drawing.Size(66, 13) + Me.Label23.TabIndex = 12 + Me.Label23.Text = "Primer Type:" + ' + 'Label24 + ' + Me.Label24.AutoSize = True + Me.Label24.Location = New System.Drawing.Point(21, 50) + Me.Label24.Name = "Label24" + Me.Label24.Size = New System.Drawing.Size(38, 13) + Me.Label24.TabIndex = 11 + Me.Label24.Text = "Name:" + ' + 'Label25 + ' + Me.Label25.AutoSize = True + Me.Label25.Location = New System.Drawing.Point(16, 27) + Me.Label25.Name = "Label25" + Me.Label25.Size = New System.Drawing.Size(73, 13) + Me.Label25.TabIndex = 10 + Me.Label25.Text = "Manufacturer:" + ' + 'GroupBox6 + ' + Me.GroupBox6.Controls.Add(Me.TextBox13) + Me.GroupBox6.Controls.Add(Me.TextBox14) + Me.GroupBox6.Controls.Add(Me.TextBox15) + Me.GroupBox6.Controls.Add(Me.TextBox16) + Me.GroupBox6.Controls.Add(Me.TextBox17) + Me.GroupBox6.Controls.Add(Me.TextBox18) + Me.GroupBox6.Controls.Add(Me.TextBox19) + Me.GroupBox6.Controls.Add(Me.TextBox20) + Me.GroupBox6.Controls.Add(Me.Label26) + Me.GroupBox6.Controls.Add(Me.Label27) + Me.GroupBox6.Controls.Add(Me.Label28) + Me.GroupBox6.Controls.Add(Me.Label29) + Me.GroupBox6.Controls.Add(Me.Label30) + Me.GroupBox6.Controls.Add(Me.Label31) + Me.GroupBox6.Controls.Add(Me.Label32) + Me.GroupBox6.Controls.Add(Me.Label33) + Me.GroupBox6.Location = New System.Drawing.Point(12, 74) + Me.GroupBox6.Name = "GroupBox6" + Me.GroupBox6.Size = New System.Drawing.Size(262, 226) + Me.GroupBox6.TabIndex = 8 + Me.GroupBox6.TabStop = False + Me.GroupBox6.Text = "Bullet Information" + ' + 'TextBox13 + ' + Me.TextBox13.Location = New System.Drawing.Point(106, 200) + Me.TextBox13.Name = "TextBox13" + Me.TextBox13.ReadOnly = True + Me.TextBox13.Size = New System.Drawing.Size(146, 20) + Me.TextBox13.TabIndex = 24 + ' + 'TextBox14 + ' + Me.TextBox14.Location = New System.Drawing.Point(106, 176) + Me.TextBox14.Name = "TextBox14" + Me.TextBox14.ReadOnly = True + Me.TextBox14.Size = New System.Drawing.Size(146, 20) + Me.TextBox14.TabIndex = 23 + ' + 'TextBox15 + ' + Me.TextBox15.Location = New System.Drawing.Point(106, 151) + Me.TextBox15.Name = "TextBox15" + Me.TextBox15.ReadOnly = True + Me.TextBox15.Size = New System.Drawing.Size(146, 20) + Me.TextBox15.TabIndex = 22 + ' + 'TextBox16 + ' + Me.TextBox16.Location = New System.Drawing.Point(106, 125) + Me.TextBox16.Name = "TextBox16" + Me.TextBox16.ReadOnly = True + Me.TextBox16.Size = New System.Drawing.Size(146, 20) + Me.TextBox16.TabIndex = 21 + ' + 'TextBox17 + ' + Me.TextBox17.Location = New System.Drawing.Point(106, 99) + Me.TextBox17.Name = "TextBox17" + Me.TextBox17.ReadOnly = True + Me.TextBox17.Size = New System.Drawing.Size(146, 20) + Me.TextBox17.TabIndex = 20 + ' + 'TextBox18 + ' + Me.TextBox18.Location = New System.Drawing.Point(106, 75) + Me.TextBox18.Name = "TextBox18" + Me.TextBox18.ReadOnly = True + Me.TextBox18.Size = New System.Drawing.Size(146, 20) + Me.TextBox18.TabIndex = 19 + ' + 'TextBox19 + ' + Me.TextBox19.Location = New System.Drawing.Point(106, 50) + Me.TextBox19.Name = "TextBox19" + Me.TextBox19.ReadOnly = True + Me.TextBox19.Size = New System.Drawing.Size(146, 20) + Me.TextBox19.TabIndex = 18 + ' + 'TextBox20 + ' + Me.TextBox20.Location = New System.Drawing.Point(106, 22) + Me.TextBox20.Name = "TextBox20" + Me.TextBox20.ReadOnly = True + Me.TextBox20.Size = New System.Drawing.Size(146, 20) + Me.TextBox20.TabIndex = 17 + ' + 'Label26 + ' + Me.Label26.AutoSize = True + Me.Label26.Location = New System.Drawing.Point(6, 203) + Me.Label26.Name = "Label26" + Me.Label26.Size = New System.Drawing.Size(63, 13) + Me.Label26.TabIndex = 15 + Me.Label26.Text = "Bullet Type:" + ' + 'Label27 + ' + Me.Label27.AutoSize = True + Me.Label27.Location = New System.Drawing.Point(6, 183) + Me.Label27.Name = "Label27" + Me.Label27.Size = New System.Drawing.Size(98, 13) + Me.Label27.TabIndex = 14 + Me.Label27.Text = "Ballistic Coefficient:" + ' + 'Label28 + ' + Me.Label28.AutoSize = True + Me.Label28.Location = New System.Drawing.Point(6, 154) + Me.Label28.Name = "Label28" + Me.Label28.Size = New System.Drawing.Size(69, 13) + Me.Label28.TabIndex = 13 + Me.Label28.Text = "Part Number:" + ' + 'Label29 + ' + Me.Label29.AutoSize = True + Me.Label29.Location = New System.Drawing.Point(6, 128) + Me.Label29.Name = "Label29" + Me.Label29.Size = New System.Drawing.Size(92, 13) + Me.Label29.TabIndex = 12 + Me.Label29.Text = "Sectional Density:" + ' + 'Label30 + ' + Me.Label30.AutoSize = True + Me.Label30.Location = New System.Drawing.Point(6, 102) + Me.Label30.Name = "Label30" + Me.Label30.Size = New System.Drawing.Size(44, 13) + Me.Label30.TabIndex = 11 + Me.Label30.Text = "Weight:" + ' + 'Label31 + ' + Me.Label31.AutoSize = True + Me.Label31.Location = New System.Drawing.Point(6, 78) + Me.Label31.Name = "Label31" + Me.Label31.Size = New System.Drawing.Size(52, 13) + Me.Label31.TabIndex = 10 + Me.Label31.Text = "Diameter:" + ' + 'Label32 + ' + Me.Label32.AutoSize = True + Me.Label32.Location = New System.Drawing.Point(6, 53) + Me.Label32.Name = "Label32" + Me.Label32.Size = New System.Drawing.Size(38, 13) + Me.Label32.TabIndex = 9 + Me.Label32.Text = "Name:" + ' + 'Label33 + ' + Me.Label33.AutoSize = True + Me.Label33.Location = New System.Drawing.Point(6, 27) + Me.Label33.Name = "Label33" + Me.Label33.Size = New System.Drawing.Size(73, 13) + Me.Label33.TabIndex = 8 + Me.Label33.Text = "Manufacturer:" + ' + 'Label34 + ' + Me.Label34.AutoSize = True + Me.Label34.Location = New System.Drawing.Point(290, 20) + Me.Label34.Name = "Label34" + Me.Label34.Size = New System.Drawing.Size(42, 13) + Me.Label34.TabIndex = 2 + Me.Label34.Text = "Caliber:" + ' + 'Label35 + ' + Me.Label35.AutoSize = True + Me.Label35.Location = New System.Drawing.Point(9, 46) + Me.Label35.Name = "Label35" + Me.Label35.Size = New System.Drawing.Size(91, 13) + Me.Label35.TabIndex = 1 + Me.Label35.Text = "Ammunition Type:" + ' + 'Label36 + ' + Me.Label36.AutoSize = True + Me.Label36.Location = New System.Drawing.Point(9, 20) + Me.Label36.Name = "Label36" + Me.Label36.Size = New System.Drawing.Size(103, 13) + Me.Label36.TabIndex = 0 + Me.Label36.Text = "Configuration Name:" + ' + 'ToolStrip1 + ' + Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1, Me.ToolStripButton3, Me.ToolStripButton2, Me.ToolStripButton4, Me.ToolStripButton5}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(713, 25) + Me.ToolStrip1.TabIndex = 1 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton1.Text = "Make Live Ammunition for this Configuration Load!" + ' + 'ToolStripButton3 + ' + Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) + Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton3.Name = "ToolStripButton3" + Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton3.Text = "Edit Configuration" + ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton2.Text = "Close this window." + ' + 'ToolStripButton4 + ' + Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton4.Image = CType(resources.GetObject("ToolStripButton4.Image"), System.Drawing.Image) + Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton4.Name = "ToolStripButton4" + Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton4.Text = "Print Configuration" + ' + 'ToolStripButton5 + ' + Me.ToolStripButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton5.Image = CType(resources.GetObject("ToolStripButton5.Image"), System.Drawing.Image) + Me.ToolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton5.Name = "ToolStripButton5" + Me.ToolStripButton5.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton5.Text = "Export to XML" + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(25, 462) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 2 + Me.btnCancel.Text = "&Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + Me.btnCancel.Visible = False + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'Config_List_Powder_Data_NSG_ViewTableAdapter + ' + Me.Config_List_Powder_Data_NSG_ViewTableAdapter.ClearBeforeFill = True + ' + 'Loaders_Log_Ammunition_AuditTableAdapter + ' + Me.Loaders_Log_Ammunition_AuditTableAdapter.ClearBeforeFill = True + ' + 'IDDataGridViewTextBoxColumn1 + ' + Me.IDDataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.IDDataGridViewTextBoxColumn1.DataPropertyName = "ID" + Me.IDDataGridViewTextBoxColumn1.HeaderText = "Lot No." + Me.IDDataGridViewTextBoxColumn1.Name = "IDDataGridViewTextBoxColumn1" + Me.IDDataGridViewTextBoxColumn1.ReadOnly = True + Me.IDDataGridViewTextBoxColumn1.Width = 67 + ' + 'DtcDataGridViewTextBoxColumn + ' + Me.DtcDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.DtcDataGridViewTextBoxColumn.DataPropertyName = "dtc" + Me.DtcDataGridViewTextBoxColumn.HeaderText = "Data Created" + Me.DtcDataGridViewTextBoxColumn.Name = "DtcDataGridViewTextBoxColumn" + Me.DtcDataGridViewTextBoxColumn.ReadOnly = True + Me.DtcDataGridViewTextBoxColumn.Width = 95 + ' + 'QtyDataGridViewTextBoxColumn + ' + Me.QtyDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.QtyDataGridViewTextBoxColumn.DataPropertyName = "qty" + Me.QtyDataGridViewTextBoxColumn.HeaderText = "Qty" + Me.QtyDataGridViewTextBoxColumn.Name = "QtyDataGridViewTextBoxColumn" + Me.QtyDataGridViewTextBoxColumn.ReadOnly = True + Me.QtyDataGridViewTextBoxColumn.Width = 48 + ' + 'EcDataGridViewTextBoxColumn + ' + Me.EcDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader + Me.EcDataGridViewTextBoxColumn.DataPropertyName = "ec" + Me.EcDataGridViewTextBoxColumn.HeaderText = "Estimated Cost." + Me.EcDataGridViewTextBoxColumn.Name = "EcDataGridViewTextBoxColumn" + Me.EcDataGridViewTextBoxColumn.ReadOnly = True + Me.EcDataGridViewTextBoxColumn.Width = 97 + ' + 'EcprDataGridViewTextBoxColumn + ' + Me.EcprDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader + Me.EcprDataGridViewTextBoxColumn.DataPropertyName = "ecpr" + Me.EcprDataGridViewTextBoxColumn.HeaderText = "Estimated Cost Per Round" + Me.EcprDataGridViewTextBoxColumn.Name = "EcprDataGridViewTextBoxColumn" + Me.EcprDataGridViewTextBoxColumn.ReadOnly = True + Me.EcprDataGridViewTextBoxColumn.Width = 114 + ' + 'frmView_Configuration_Sheet + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(713, 452) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.ToolStrip1) + Me.Controls.Add(Me.TabControl1) + Me.HelpProvider1.SetHelpKeyword(Me, "View Configuration Sheets") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "View Configuration Sheets") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.Name = "FrmViewConfigurationSheet" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "frmView_Configuration_Sheet" + Me.TabControl1.ResumeLayout(False) + Me.TabPage1.ResumeLayout(False) + Me.TabPage1.PerformLayout() + Me.GroupBox3.ResumeLayout(False) + Me.GroupBox3.PerformLayout() + Me.GroupBox2.ResumeLayout(False) + Me.GroupBox2.PerformLayout() + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() + Me.TabPage2.ResumeLayout(False) + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() + Me.CMSPowder.ResumeLayout(False) + CType(Me.ConfigListPowderDataNSGViewBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.TabPage3.ResumeLayout(False) + Me.TabPage3.PerformLayout() + Me.TabPage4.ResumeLayout(False) + Me.GroupBox8.ResumeLayout(False) + Me.GroupBox8.PerformLayout() + Me.GroupBox7.ResumeLayout(False) + Me.GroupBox7.PerformLayout() + Me.TabPage5.ResumeLayout(False) + CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LoadersLogAmmunitionAuditBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + Me.GroupBox4.ResumeLayout(False) + Me.GroupBox4.PerformLayout() + Me.GroupBox5.ResumeLayout(False) + Me.GroupBox5.PerformLayout() + Me.GroupBox6.ResumeLayout(False) + Me.GroupBox6.PerformLayout() + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents TabControl1 As System.Windows.Forms.TabControl - Friend WithEvents TabPage1 As System.Windows.Forms.TabPage - Friend WithEvents TabPage2 As System.Windows.Forms.TabPage - Friend WithEvents Label1 As System.Windows.Forms.Label - Friend WithEvents Label3 As System.Windows.Forms.Label - Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox - Friend WithEvents Label9 As System.Windows.Forms.Label - Friend WithEvents Label8 As System.Windows.Forms.Label - Friend WithEvents Label7 As System.Windows.Forms.Label - Friend WithEvents Label6 As System.Windows.Forms.Label - Friend WithEvents Label5 As System.Windows.Forms.Label - Friend WithEvents Label4 As System.Windows.Forms.Label - Friend WithEvents Label11 As System.Windows.Forms.Label - Friend WithEvents Label10 As System.Windows.Forms.Label - Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox - Friend WithEvents Label14 As System.Windows.Forms.Label - Friend WithEvents Label12 As System.Windows.Forms.Label - Friend WithEvents Label13 As System.Windows.Forms.Label - Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox - Friend WithEvents Label18 As System.Windows.Forms.Label - Friend WithEvents Label17 As System.Windows.Forms.Label - Friend WithEvents Label15 As System.Windows.Forms.Label - Friend WithEvents Label16 As System.Windows.Forms.Label - Friend WithEvents txtConfigName As System.Windows.Forms.TextBox - Friend WithEvents txtAmmoType As System.Windows.Forms.TextBox - Friend WithEvents txtBType As System.Windows.Forms.TextBox - Friend WithEvents txtBBCO As System.Windows.Forms.TextBox - Friend WithEvents txtBPartNo As System.Windows.Forms.TextBox - Friend WithEvents txtBSecDen As System.Windows.Forms.TextBox - Friend WithEvents txtBWei As System.Windows.Forms.TextBox - Friend WithEvents txtBDia As System.Windows.Forms.TextBox - Friend WithEvents txtBName As System.Windows.Forms.TextBox - Friend WithEvents txtBManu As System.Windows.Forms.TextBox - Friend WithEvents txtCal As System.Windows.Forms.TextBox - Friend WithEvents txtCTU As System.Windows.Forms.TextBox - Friend WithEvents txtCTOL As System.Windows.Forms.TextBox - Friend WithEvents txtCName As System.Windows.Forms.TextBox - Friend WithEvents txtCManu As System.Windows.Forms.TextBox - Friend WithEvents txtPType As System.Windows.Forms.TextBox - Friend WithEvents txtPName As System.Windows.Forms.TextBox - Friend WithEvents txtPManu As System.Windows.Forms.TextBox - Friend WithEvents TextBox11 As System.Windows.Forms.TextBox - Friend WithEvents TextBox12 As System.Windows.Forms.TextBox - Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox - Friend WithEvents Label19 As System.Windows.Forms.Label - Friend WithEvents Label20 As System.Windows.Forms.Label - Friend WithEvents Label21 As System.Windows.Forms.Label - Friend WithEvents Label22 As System.Windows.Forms.Label - Friend WithEvents GroupBox5 As System.Windows.Forms.GroupBox - Friend WithEvents Label23 As System.Windows.Forms.Label - Friend WithEvents Label24 As System.Windows.Forms.Label - Friend WithEvents Label25 As System.Windows.Forms.Label - Friend WithEvents GroupBox6 As System.Windows.Forms.GroupBox - Friend WithEvents TextBox13 As System.Windows.Forms.TextBox - Friend WithEvents TextBox14 As System.Windows.Forms.TextBox - Friend WithEvents TextBox15 As System.Windows.Forms.TextBox - Friend WithEvents TextBox16 As System.Windows.Forms.TextBox - Friend WithEvents TextBox17 As System.Windows.Forms.TextBox - Friend WithEvents TextBox18 As System.Windows.Forms.TextBox - Friend WithEvents TextBox19 As System.Windows.Forms.TextBox - Friend WithEvents TextBox20 As System.Windows.Forms.TextBox - Friend WithEvents Label26 As System.Windows.Forms.Label - Friend WithEvents Label27 As System.Windows.Forms.Label - Friend WithEvents Label28 As System.Windows.Forms.Label - Friend WithEvents Label29 As System.Windows.Forms.Label - Friend WithEvents Label30 As System.Windows.Forms.Label - Friend WithEvents Label31 As System.Windows.Forms.Label - Friend WithEvents Label32 As System.Windows.Forms.Label - Friend WithEvents Label33 As System.Windows.Forms.Label - Friend WithEvents Label34 As System.Windows.Forms.Label - Friend WithEvents Label35 As System.Windows.Forms.Label - Friend WithEvents Label36 As System.Windows.Forms.Label - Friend WithEvents ChkPerLoad As System.Windows.Forms.CheckBox - Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents ConfigListPowderDataNSGViewBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents Config_List_Powder_Data_NSG_ViewTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Config_List_Powder_Data_NSG_ViewTableAdapter - Friend WithEvents TabPage3 As System.Windows.Forms.TabPage - Friend WithEvents txtNotes As System.Windows.Forms.TextBox - Friend WithEvents TabPage4 As System.Windows.Forms.TabPage - Friend WithEvents btnUpdate As System.Windows.Forms.Button - Friend WithEvents btnAddNotes As System.Windows.Forms.Button - Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents CLNIDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents PIDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents PowderNameDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents LoadMinDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents LoadMidDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents LoadMaxDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents FPSMinDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents FPSMIDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents FPSMaxDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents CUPSMinDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents CUPSMidDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents CUPSMaxDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents btnRefresh As System.Windows.Forms.Button - Friend WithEvents lblReffer As System.Windows.Forms.Label - Friend WithEvents GroupBox7 As System.Windows.Forms.GroupBox - Friend WithEvents Label41 As System.Windows.Forms.Label - Friend WithEvents txtC1RA As System.Windows.Forms.TextBox - Friend WithEvents txtCOPMid As System.Windows.Forms.TextBox - Friend WithEvents txtCPC As System.Windows.Forms.TextBox - Friend WithEvents txtCPP As System.Windows.Forms.TextBox - Friend WithEvents txtCPB As System.Windows.Forms.TextBox - Friend WithEvents Label40 As System.Windows.Forms.Label - Friend WithEvents Label39 As System.Windows.Forms.Label - Friend WithEvents Label38 As System.Windows.Forms.Label - Friend WithEvents Label37 As System.Windows.Forms.Label - Friend WithEvents GroupBox8 As System.Windows.Forms.GroupBox - Friend WithEvents txtTCR As System.Windows.Forms.TextBox - Friend WithEvents txtNMR As System.Windows.Forms.TextBox - Friend WithEvents txtCBIS As System.Windows.Forms.TextBox - Friend WithEvents txtCCIS As System.Windows.Forms.TextBox - Friend WithEvents txtCPriIS As System.Windows.Forms.TextBox - Friend WithEvents Label47 As System.Windows.Forms.Label - Friend WithEvents Label46 As System.Windows.Forms.Label - Friend WithEvents Label45 As System.Windows.Forms.Label - Friend WithEvents Label44 As System.Windows.Forms.Label - Friend WithEvents Label43 As System.Windows.Forms.Label - Friend WithEvents txtCPowIS As System.Windows.Forms.TextBox - Friend WithEvents Label42 As System.Windows.Forms.Label - Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip - Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton - Friend WithEvents Label48 As System.Windows.Forms.Label - Friend WithEvents chkFav As System.Windows.Forms.CheckBox - Friend WithEvents rbstatus2 As System.Windows.Forms.RadioButton - Friend WithEvents rbstatus1 As System.Windows.Forms.RadioButton - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton - Friend WithEvents TabPage5 As System.Windows.Forms.TabPage - Friend WithEvents DataGridView2 As System.Windows.Forms.DataGridView - Friend WithEvents LoadersLogAmmunitionAuditBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents Loaders_Log_Ammunition_AuditTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_Ammunition_AuditTableAdapter - Friend WithEvents ToolStripButton4 As System.Windows.Forms.ToolStripButton - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider - Friend WithEvents CMSPowder As System.Windows.Forms.ContextMenuStrip - Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents ToolStripButton5 As System.Windows.Forms.ToolStripButton - Friend WithEvents SaveFileDialog1 As System.Windows.Forms.SaveFileDialog - Friend WithEvents SetAsDefaultToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents IDDataGridViewTextBoxColumn1 As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents DtcDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents QtyDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents EcDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents EcprDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn -End Class + End Sub + Friend WithEvents TabControl1 As System.Windows.Forms.TabControl + Friend WithEvents TabPage1 As System.Windows.Forms.TabPage + Friend WithEvents TabPage2 As System.Windows.Forms.TabPage + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox + Friend WithEvents Label9 As System.Windows.Forms.Label + Friend WithEvents Label8 As System.Windows.Forms.Label + Friend WithEvents Label7 As System.Windows.Forms.Label + Friend WithEvents Label6 As System.Windows.Forms.Label + Friend WithEvents Label5 As System.Windows.Forms.Label + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents Label11 As System.Windows.Forms.Label + Friend WithEvents Label10 As System.Windows.Forms.Label + Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox + Friend WithEvents Label14 As System.Windows.Forms.Label + Friend WithEvents Label12 As System.Windows.Forms.Label + Friend WithEvents Label13 As System.Windows.Forms.Label + Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox + Friend WithEvents Label18 As System.Windows.Forms.Label + Friend WithEvents Label17 As System.Windows.Forms.Label + Friend WithEvents Label15 As System.Windows.Forms.Label + Friend WithEvents Label16 As System.Windows.Forms.Label + Friend WithEvents txtConfigName As System.Windows.Forms.TextBox + Friend WithEvents txtAmmoType As System.Windows.Forms.TextBox + Friend WithEvents txtBType As System.Windows.Forms.TextBox + Friend WithEvents txtBBCO As System.Windows.Forms.TextBox + Friend WithEvents txtBPartNo As System.Windows.Forms.TextBox + Friend WithEvents txtBSecDen As System.Windows.Forms.TextBox + Friend WithEvents txtBWei As System.Windows.Forms.TextBox + Friend WithEvents txtBDia As System.Windows.Forms.TextBox + Friend WithEvents txtBName As System.Windows.Forms.TextBox + Friend WithEvents txtBManu As System.Windows.Forms.TextBox + Friend WithEvents txtCal As System.Windows.Forms.TextBox + Friend WithEvents txtCTU As System.Windows.Forms.TextBox + Friend WithEvents txtCTOL As System.Windows.Forms.TextBox + Friend WithEvents txtCName As System.Windows.Forms.TextBox + Friend WithEvents txtCManu As System.Windows.Forms.TextBox + Friend WithEvents txtPType As System.Windows.Forms.TextBox + Friend WithEvents txtPName As System.Windows.Forms.TextBox + Friend WithEvents txtPManu As System.Windows.Forms.TextBox + Friend WithEvents TextBox11 As System.Windows.Forms.TextBox + Friend WithEvents TextBox12 As System.Windows.Forms.TextBox + Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox + Friend WithEvents Label19 As System.Windows.Forms.Label + Friend WithEvents Label20 As System.Windows.Forms.Label + Friend WithEvents Label21 As System.Windows.Forms.Label + Friend WithEvents Label22 As System.Windows.Forms.Label + Friend WithEvents GroupBox5 As System.Windows.Forms.GroupBox + Friend WithEvents Label23 As System.Windows.Forms.Label + Friend WithEvents Label24 As System.Windows.Forms.Label + Friend WithEvents Label25 As System.Windows.Forms.Label + Friend WithEvents GroupBox6 As System.Windows.Forms.GroupBox + Friend WithEvents TextBox13 As System.Windows.Forms.TextBox + Friend WithEvents TextBox14 As System.Windows.Forms.TextBox + Friend WithEvents TextBox15 As System.Windows.Forms.TextBox + Friend WithEvents TextBox16 As System.Windows.Forms.TextBox + Friend WithEvents TextBox17 As System.Windows.Forms.TextBox + Friend WithEvents TextBox18 As System.Windows.Forms.TextBox + Friend WithEvents TextBox19 As System.Windows.Forms.TextBox + Friend WithEvents TextBox20 As System.Windows.Forms.TextBox + Friend WithEvents Label26 As System.Windows.Forms.Label + Friend WithEvents Label27 As System.Windows.Forms.Label + Friend WithEvents Label28 As System.Windows.Forms.Label + Friend WithEvents Label29 As System.Windows.Forms.Label + Friend WithEvents Label30 As System.Windows.Forms.Label + Friend WithEvents Label31 As System.Windows.Forms.Label + Friend WithEvents Label32 As System.Windows.Forms.Label + Friend WithEvents Label33 As System.Windows.Forms.Label + Friend WithEvents Label34 As System.Windows.Forms.Label + Friend WithEvents Label35 As System.Windows.Forms.Label + Friend WithEvents Label36 As System.Windows.Forms.Label + Friend WithEvents ChkPerLoad As System.Windows.Forms.CheckBox + Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents ConfigListPowderDataNSGViewBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents Config_List_Powder_Data_NSG_ViewTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Config_List_Powder_Data_NSG_ViewTableAdapter + Friend WithEvents TabPage3 As System.Windows.Forms.TabPage + Friend WithEvents txtNotes As System.Windows.Forms.TextBox + Friend WithEvents TabPage4 As System.Windows.Forms.TabPage + Friend WithEvents btnUpdate As System.Windows.Forms.Button + Friend WithEvents btnAddNotes As System.Windows.Forms.Button + Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents CLNIDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents PIDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents PowderNameDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents LoadMinDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents LoadMidDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents LoadMaxDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents FPSMinDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents FPSMIDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents FPSMaxDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents CUPSMinDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents CUPSMidDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents CUPSMaxDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents btnRefresh As System.Windows.Forms.Button + Friend WithEvents lblReffer As System.Windows.Forms.Label + Friend WithEvents GroupBox7 As System.Windows.Forms.GroupBox + Friend WithEvents Label41 As System.Windows.Forms.Label + Friend WithEvents txtC1RA As System.Windows.Forms.TextBox + Friend WithEvents txtCOPMid As System.Windows.Forms.TextBox + Friend WithEvents txtCPC As System.Windows.Forms.TextBox + Friend WithEvents txtCPP As System.Windows.Forms.TextBox + Friend WithEvents txtCPB As System.Windows.Forms.TextBox + Friend WithEvents Label40 As System.Windows.Forms.Label + Friend WithEvents Label39 As System.Windows.Forms.Label + Friend WithEvents Label38 As System.Windows.Forms.Label + Friend WithEvents Label37 As System.Windows.Forms.Label + Friend WithEvents GroupBox8 As System.Windows.Forms.GroupBox + Friend WithEvents txtTCR As System.Windows.Forms.TextBox + Friend WithEvents txtNMR As System.Windows.Forms.TextBox + Friend WithEvents txtCBIS As System.Windows.Forms.TextBox + Friend WithEvents txtCCIS As System.Windows.Forms.TextBox + Friend WithEvents txtCPriIS As System.Windows.Forms.TextBox + Friend WithEvents Label47 As System.Windows.Forms.Label + Friend WithEvents Label46 As System.Windows.Forms.Label + Friend WithEvents Label45 As System.Windows.Forms.Label + Friend WithEvents Label44 As System.Windows.Forms.Label + Friend WithEvents Label43 As System.Windows.Forms.Label + Friend WithEvents txtCPowIS As System.Windows.Forms.TextBox + Friend WithEvents Label42 As System.Windows.Forms.Label + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton + Friend WithEvents Label48 As System.Windows.Forms.Label + Friend WithEvents chkFav As System.Windows.Forms.CheckBox + Friend WithEvents rbstatus2 As System.Windows.Forms.RadioButton + Friend WithEvents rbstatus1 As System.Windows.Forms.RadioButton + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton + Friend WithEvents TabPage5 As System.Windows.Forms.TabPage + Friend WithEvents DataGridView2 As System.Windows.Forms.DataGridView + Friend WithEvents LoadersLogAmmunitionAuditBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents Loaders_Log_Ammunition_AuditTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_Ammunition_AuditTableAdapter + Friend WithEvents ToolStripButton4 As System.Windows.Forms.ToolStripButton + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + Friend WithEvents CMSPowder As System.Windows.Forms.ContextMenuStrip + Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents ToolStripButton5 As System.Windows.Forms.ToolStripButton + Friend WithEvents SaveFileDialog1 As System.Windows.Forms.SaveFileDialog + Friend WithEvents SetAsDefaultToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents IDDataGridViewTextBoxColumn1 As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents DtcDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents QtyDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents EcDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents EcprDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_Configuration_Sheet.vb b/BSMyLoadersLog/Viewing/frmView_Configuration_Sheet.vb index f82a8e8..1c1b069 100644 --- a/BSMyLoadersLog/Viewing/frmView_Configuration_Sheet.vb +++ b/BSMyLoadersLog/Viewing/frmView_Configuration_Sheet.vb @@ -1,430 +1,713 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc -Imports System.IO -Imports System.Xml -Imports System.Data +'Imports System.Data.Odbc +'Imports BSMyLoadersLog.LoadersClass +Imports BSMyLoadersLog.Adding +Imports BSMyLoadersLog.ViewReports +Imports BurnSoft.Applications.MLL.ConfigSheets +Imports BurnSoft.Applications.MLL.Global Imports BurnSoft.Applications.MLL.Helpers -Imports BurnSoft.Universal - -Public Class frmView_Configuration_Sheet - Public ConfigID As Long - Public ConfigName As String - Dim IsPersonal As Boolean - Dim IsShotGun As Boolean - Dim isFav As Boolean - Dim isActive As Boolean - Dim COST_BULLET As Double - Dim COST_PRIMER As Double - Dim COST_CASE As Double - Dim COST_POWDER As Double - Dim MID_POWDER As Double - Dim INSTOCK_BULLET As Long - Dim INSTOCK_PRIMER As Long - Dim INSTOCK_CASE As Long - Dim INSTOCK_POWDER As Double - Dim PrefferedPowderID As Long +Imports BurnSoft.Applications.MLL.Inventory +Imports BurnSoft.Applications.MLL.Types +Imports BurnSoft.Applications.MLL.Xml +'Imports BurnSoft.Universal +' TODO: #20 Code Cleanup +Namespace Viewing + ''' + ''' Class FrmViewConfigurationSheet. + ''' Implements the + ''' + ''' + Public Class FrmViewConfigurationSheet + ''' + ''' The error out + ''' + Dim _errOut as String + ''' + ''' The configuration identifier + ''' + Public ConfigId As Long + ''' + ''' The configuration name + ''' + Public ConfigName As String + ''' + ''' The is personal + ''' + Dim _isPersonal As Boolean + '''' + '''' The is shot gun + '''' + 'Dim IsShotGun As Boolean + ''' + ''' The is fav + ''' + Dim _isFavorite As Boolean + ''' + ''' The is active + ''' + Dim _isActive As Boolean + ''' + ''' The Cost per bullet + ''' + Dim _costBullet As Double + ''' + ''' The Cost per primer + ''' + Dim _costPrimer As Double + ''' + ''' The Cost per case + ''' + Dim _costCase As Double + ''' + ''' The Cost per powder + ''' + Dim _costPowder As Double + ''' + ''' The mid powder + ''' + Dim _midPowder As Double + ''' + ''' The instock bullet + ''' + Dim _instockBullet As Long + ''' + ''' The instock primer + ''' + Dim _instockPrimer As Long + ''' + ''' The instock case + ''' + Dim _instockCase As Long + ''' + ''' The instock powder + ''' + Dim _instockPowder As Double + ''' + ''' The preffered powder identifier + ''' + Dim _prefferedPowderId As Long #Region "Subs" - Sub UpdateActivity(ByVal iStat As Integer) - Dim Obj As New BSDatabase - Dim SQL As String = "UPDATE Config_List_Name set IsActive=" & iStat & " where id=" & ConfigID - Obj.ConnExec(SQL) - End Sub - Sub UpdateFav(ByVal iStat As Integer) - Dim Obj As New BSDatabase - Dim SQL As String = "UPDATE Config_List_Name set IsFav=" & iStat & " where id=" & ConfigID - Obj.ConnExec(SQL) - End Sub - Sub LoadPowderGrid() - '7,8,9 are FPS - '10,11,12 as CUPS - DataGridView1.Columns(7).Visible = ViewFps - DataGridView1.Columns(8).Visible = ViewFps - DataGridView1.Columns(9).Visible = ViewFps - DataGridView1.Columns(10).Visible = ViewCups - DataGridView1.Columns(11).Visible = ViewCups - DataGridView1.Columns(12).Visible = ViewCups - Me.Config_List_Powder_Data_NSG_ViewTableAdapter.FillBy_ConfigID(Me.MLLDataSet.Config_List_Powder_Data_NSG_View, ConfigID) - End Sub - Sub LoadCosts() - Try - Dim lnmr As Long = 0 - Dim dPowPerB As Double = 0 - Dim dC1RA As Double = 0 - Dim Obj As New InventoryMath - txtCPB.Text = Obj.ConvertToDollars(COST_BULLET) - txtCPP.Text = Obj.ConvertToDollars(COST_PRIMER) - txtCPC.Text = Obj.ConvertToDollars(COST_CASE) - txtCOPMid.Text = Obj.ConvertToDollars((COST_POWDER * MID_POWDER)) - 'Cost Seems higher txtC1RA - 'dC1RA = ((COST_POWDER * MID_POWDER) + COST_CASE + COST_PRIMER + COST_BULLET) - dC1RA = Converters.CostOfRoundsOfAmmoMetalic(COST_PRIMER, COST_CASE, COST_BULLET, COST_POWDER, MID_POWDER) - txtC1RA.Text = dC1RA - txtCBIS.Text = INSTOCK_BULLET - txtCPriIS.Text = INSTOCK_PRIMER - txtCPowIS.Text = INSTOCK_POWDER - txtCCIS.Text = INSTOCK_CASE + ' + 'Sub UpdateActivity(ByVal iStat As Integer) + ' Dim Obj As New BSDatabase + ' Dim SQL As String = "UPDATE Config_List_Name set IsActive=" & iStat & " where id=" & ConfigID + ' Obj.ConnExec(SQL) + 'End Sub + ' + 'Sub UpdateFav(ByVal iStat As Integer) + ' Dim Obj As New BSDatabase + ' Dim SQL As String = "UPDATE Config_List_Name set IsFav=" & iStat & " where id=" & ConfigID + ' Obj.ConnExec(SQL) + 'End Sub + ''' + ''' Loads the powder grid. + ''' Columns 7,8,9 are FPS, and columns 10,11,12 are CUPS + ''' + Sub LoadPowderGrid() + DataGridView1.Columns(7).Visible = ViewFps + DataGridView1.Columns(8).Visible = ViewFps + DataGridView1.Columns(9).Visible = ViewFps + DataGridView1.Columns(10).Visible = ViewCups + DataGridView1.Columns(11).Visible = ViewCups + DataGridView1.Columns(12).Visible = ViewCups + Config_List_Powder_Data_NSG_ViewTableAdapter.FillBy_ConfigID(MLLDataSet.Config_List_Powder_Data_NSG_View, ConfigId) + End Sub + ''' + ''' Loads the costs. + ''' + Sub LoadCosts() + Try + 'Dim lnmr As Long = 0 + 'Dim dPowPerB As Double = 0 + 'Dim costForOneRound As Double = 0 + 'Dim Obj As New InventoryMath + txtCPB.Text = Converters.ConvertToDollars(_costBullet) + txtCPP.Text = Converters.ConvertToDollars(_costPrimer) + txtCPC.Text = Converters.ConvertToDollars(_costCase) + txtCOPMid.Text = Converters.ConvertToDollars((_costPowder * _midPowder)) + 'Cost Seems higher txtC1RA + 'dC1RA = ((COST_POWDER * MID_POWDER) + COST_CASE + COST_PRIMER + COST_BULLET) + Dim costForOneRound As Double = Converters.CostOfRoundsOfAmmoMetalic(_costPrimer, _costCase, _costBullet, _costPowder, _midPowder) + txtC1RA.Text = costForOneRound + txtCBIS.Text = _instockBullet + txtCPriIS.Text = _instockPrimer + txtCPowIS.Text = _instockPowder + txtCCIS.Text = _instockCase - lnmr = INSTOCK_BULLET - If lnmr < INSTOCK_CASE Then - lnmr = INSTOCK_BULLET - ElseIf lnmr > INSTOCK_CASE Then - lnmr = INSTOCK_CASE - End If - dPowPerB = (INSTOCK_POWDER / MID_POWDER) - If lnmr > INSTOCK_PRIMER Then lnmr = INSTOCK_PRIMER - If lnmr > dPowPerB Then lnmr = CLng(dPowPerB) - txtNMR.Text = lnmr - txtTCR.Text = lnmr * Obj.ConvertToDollars(dC1RA) - Catch ex As Exception - Call LogError(Me.Name, "LoadCosts", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub LoadData() - Lastconfigedviewed = ConfigID - Try - Me.Loaders_Log_Ammunition_AuditTableAdapter.FillByConfigID(Me.MLLDataSet.Loaders_Log_Ammunition_Audit, ConfigID) - IsShotGun = False - IsPersonal = False - txtConfigName.Text = ConfigName - Dim Obj As New InventoryMath - PrefferedPowderID = Obj.GetPrefNSGPowderID(ConfigID, MID_POWDER) - COST_POWDER = Obj.GetPricePerPowder(PrefferedPowderID) - INSTOCK_POWDER = Obj.GetQTYPerPowder(PrefferedPowderID) - Call LoadPowderGrid() - Call Obj.LoadConfig(ConfigID, IsPersonal, IsShotGun, txtNotes.Text, isActive, isFav) - ChkPerLoad.Checked = IsPersonal - If isActive Then - rbstatus1.Checked = True - rbstatus2.Checked = False - Else - rbstatus1.Checked = False - rbstatus2.Checked = True - End If - chkFav.Checked = isFav - Call LoadConfig_RiflePistol() - Call LoadCosts() - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub LoadConfig_RiflePistol() - Try - Dim Obj As New BSDatabase - Dim ObjIM As New InventoryMath - Dim SQL As String = "SELECT * from Config_List_Data_NSG where CLNID=" & ConfigID - Call Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - While RS.Read - txtAmmoType.Text = ObjIM.GetAmmoType(RS("ATID")) - txtCal.Text = ObjIM.GetCaliber(RS("CALID")) - Call ObjIM.LoadBulletInfo(RS("BID"), txtBManu.Text, txtBName.Text, txtBDia.Text, _ - txtBWei.Text, txtBSecDen.Text, txtBPartNo.Text, txtBBCO.Text, _ - INSTOCK_BULLET, txtBType.Text, COST_BULLET) - Call ObjIM.LoadPrimerInfo(RS("PRID"), txtPManu.Text, txtPName.Text, _ - txtPType.Text, COST_PRIMER, INSTOCK_PRIMER) - Call ObjIM.LoadCaseInfo(RS("CAID"), txtCManu.Text, txtCName.Text, txtCTOL.Text, _ - txtCTU.Text, INSTOCK_CASE, COST_CASE) - If Not IsPersonal Then - If Not IsDBNull(RS("Source")) Then - lblReffer.Text = "(Refer to " & RS("Source") & ")" - Else - lblReffer.Text = "Unknown Referance" - End If + 'lnmr = INSTOCK_BULLET + 'If lnmr < INSTOCK_CASE Then + ' lnmr = INSTOCK_BULLET + 'ElseIf lnmr > INSTOCK_CASE Then + ' lnmr = INSTOCK_CASE + 'End If + 'dPowPerB = (INSTOCK_POWDER / MID_POWDER) + 'If lnmr > INSTOCK_PRIMER Then lnmr = INSTOCK_PRIMER + 'If lnmr > dPowPerB Then lnmr = CLng(dPowPerB) + Dim lowestQtyInStock As Long = GeneralCalculations.CalculateMetallicRoundsToMake(_instockBullet, _instockCase, _instockPrimer, + _instockPowder, _midPowder, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + txtNMR.Text = lowestQtyInStock + txtTCR.Text = lowestQtyInStock * Converters.ConvertToDollars(costForOneRound) + Catch ex As Exception + Call LogError(Name, "LoadCosts", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Loads the data. + ''' + Sub LoadData() + Lastconfigedviewed = ConfigId + Try + Loaders_Log_Ammunition_AuditTableAdapter.FillByConfigID(MLLDataSet.Loaders_Log_Ammunition_Audit, ConfigId) + 'IsShotGun = False + _isPersonal = False + txtConfigName.Text = ConfigName + 'Dim Obj As New InventoryMath + 'PrefferedPowderID = Obj.GetPrefNSGPowderID(ConfigID, MID_POWDER) + 'COST_POWDER = Obj.GetPricePerPowder(PrefferedPowderID) + 'INSTOCK_POWDER = Obj.GetQTYPerPowder(PrefferedPowderID) + + _prefferedPowderId = ConfigListDataPowder.GetDefaultPowderId(DatabasePath, ConfigId, _midPowder, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + _costPowder = PowderInventory.GetPricePerPowder(DatabasePath, _prefferedPowderId, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + _instockPowder = PowderInventory.GetQtyPerPowder(DatabasePath, _prefferedPowderId, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + + Call LoadPowderGrid() + 'Call Obj.LoadConfig(ConfigID, IsPersonal, IsShotGun, txtNotes.Text, isActive, _isFavorite) + Dim lst as List(Of ConfigNameList) = ConfigListDataName.GetDetails(DatabasePath, ConfigId, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + For Each o As ConfigNameList In lst + _isPersonal = o.IsPersonal + 'IsShotGun = o.IsShotGun + txtNotes.Text = o.Notes + _isActive = o.IsActive + _isFavorite = o.IsFavorite + Next + ChkPerLoad.Checked = _isPersonal + If _isActive Then + rbstatus1.Checked = True + rbstatus2.Checked = False + Else + rbstatus1.Checked = False + rbstatus2.Checked = True End If - End While - RS.Close() - RS = Nothing - CMD = Nothing - Catch ex As Exception - Call LogError(Me.Name, "LoadConfig_RiflePistol", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub XML_Generate(ByVal strPath As String) - Try - Dim sAns As String = "" - Dim NL As String = Chr(10) & Chr(13) - sAns = "" - sAns &= "" & NL - sAns &= XML_GenerateConfig() - sAns &= XML_GenerateBullets() - sAns &= XML_GeneratePrimers() - sAns &= XML_GenerateCases() - sAns &= XML_GeneratePowderList() - sAns &= "" & NL - sAns = Replace(sAns, "&", "&") - 'Dim ObjFS As New BSFileSystem - 'ObjFS.DeleteFile(strPath) - 'ObjFS.OutPutToFile(strPath, sAns) - Dim ObjFS As New FileIO - ObjFS.DeleteFile(strPath) - ObjFS.AppendToFile(strPath, sAns) - MsgBox("Config was exported to " & Chr(10) & strPath) - Catch ex As Exception - Call LogError(Me.Name, "XML_Generate", Err.Number, ex.Message.ToString) - End Try - End Sub - Function XML_GeneratePowderList() As String - Dim sAns As String = "" - Dim NL As String = Chr(10) & Chr(13) - Try - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim SQL As String = "SELECT * from qry_CFG_SR_PowderList where CLNID=" & ConfigID - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - While RS.Read - sAns &= " " & NL - sAns &= " " & RS("Manufacturer") & "" & NL - sAns &= " " & RS("Name") & "" & NL - sAns &= " " & RS("Load_Min") & "" & NL - sAns &= " " & RS("Load_Mid") & "" & NL - sAns &= " " & RS("Load_Max") & "" & NL - sAns &= " " & RS("FPS_Min") & "" & NL - sAns &= " " & RS("FPS_MID") & "" & NL - sAns &= " " & RS("FPS_Max") & "" & NL - sAns &= " " & RS("CUPS_Min") & "" & NL - sAns &= " " & RS("CUPS_Mid") & "" & NL - sAns &= " " & RS("CUPS_Max") & "" & NL - sAns &= " " & RS("IsPref") & "" & NL - sAns &= " " & NL - End While - RS.Close() - RS = Nothing - CMD = Nothing - Obj.CloseDB() - Catch ex As Exception - Call LogError(Me.Name, "XML_GeneratePowderList", Err.Number, ex.Message.ToString) - End Try - Return sAns - End Function - Function XML_GenerateConfig() As String - Dim sAns As String = "" - Dim NL As String = Chr(10) & Chr(13) - 'sAns = "" & NL - sAns &= "
" & NL - sAns &= " " & ConfigName & "" & NL - sAns &= " " & IsPersonal & "" & NL - sAns &= " " & IsShotGun & "" & NL - sAns &= " " & txtNotes.Text & "" & NL - sAns &= " " & txtAmmoType.Text & "" & NL - sAns &= " " & txtCal.Text & "" & NL - sAns &= " " & lblReffer.Text & "" & NL - sAns &= "
" & NL - 'sAns &= "
" & NL - Return sAns - End Function - Function XML_GenerateCases() As String - Dim sAns As String = "" - Dim NL As String = Chr(10) & Chr(13) - sAns = " " & NL - sAns &= " " & txtCManu.Text & "" & NL - sAns &= " " & txtCName.Text & "" & NL - sAns &= " " & txtCTOL.Text & "" & NL - sAns &= " " & txtCTU.Text & "" & NL - sAns &= " " & NL - Return sAns - End Function - Function XML_GeneratePrimers() As String - Dim sAns As String = "" - Dim NL As String = Chr(10) & Chr(13) - sAns = " " & NL - sAns &= " " & txtPManu.Text & "" & NL - sAns &= " " & txtPName.Text & "" & NL - sAns &= " " & txtPType.Text & "" & NL - sAns &= " " & NL - Return sAns - End Function - Function XML_GenerateBullets() As String - Dim sAns As String = "" - Dim NL As String = Chr(10) & Chr(13) - sAns = " " & NL - sAns &= " " & txtBManu.Text & "" & NL - sAns &= " " & txtBName.Text & "" & NL - sAns &= " " & txtBDia.Text & "" & NL - sAns &= " " & txtBWei.Text & "" & NL - sAns &= " " & txtBSecDen.Text & "" & NL - sAns &= " " & txtBPartNo.Text & "" & NL - sAns &= " " & txtBBCO.Text & "" & NL - sAns &= " " & txtBType.Text & "" & NL - sAns &= " " & NL - Return sAns - End Function + chkFav.Checked = _isFavorite + Call LoadConfig_RiflePistol() + Call LoadCosts() + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Loads the configuration rifle pistol. + ''' + Private Sub LoadConfig_RiflePistol() + Try + Dim lst As List(Of ConfigListDataMetalicData) = ConfigListDataMetalic.GetDetails(DatabasePath, ConfigId, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + For Each o As ConfigListDataMetalicData In lst + txtAmmoType.Text = AmmuntionType.GetAmmoType(DatabasePath, o.AmmoTypeId, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + txtCal.Text = CaliberInventory.GetName(DatabasePath, o.CaliberId, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + Dim bulletList as List(Of BulletListings) = BulletsInventory.GetDetails(DatabasePath, o.BulletId, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + For Each v As BulletListings In bulletList + txtBManu.Text = v.Manufacturer + txtBName.Text = v.Name + txtBDia.Text = v.Diameter + txtBWei.Text = v.Weight + txtBSecDen.Text = v.SectionDensity + txtBPartNo.Text = v.PartNumber + txtBBCO.Text = v.BallisticCoeffcient + _instockBullet = v.Qty + txtBType.Text = AmmuntionType.GetAmmoType(DatabasePath, v.BulletType, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + _costBullet = v.EsitmatedPricePerBullet + Next + + Dim primerList As List(Of PrimerListings) = PrimerInventory.GetDetails(DatabasePath, o.PrimerId, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + For Each v As PrimerListings In primerList + txtPManu.Text = v.Manufacturer + txtPName.Text = v.Name + txtPType.Text = v.PrimerType + _costPrimer = v.PricePerPrimer + _instockPrimer = v.Qty + Next + + Dim caseList As List(Of CaseListings) = CaseInventory.GetDetails(DatabasePath, o.CaseId, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + For Each v As CaseListings In caseList + txtCManu.Text = v.Manufacturer + txtCName.Text = v.Name + txtCTOL.Text = v.TrimToLength + txtCTU.Text = v.TimesUsed + _instockCase = v.Qty + _costCase = v.EstimatedPricePerCase + Next + + If Not _isPersonal Then + If Not IsDBNull(o.Source) Then + lblReffer.Text = $"(Refer to {o.Source})" + Else + lblReffer.Text = $"Unknown Referance" + End If + End If + Next + + 'Dim Obj As New BSDatabase + 'Dim ObjIM As New InventoryMath + 'Dim SQL As String = "SELECT * from Config_List_Data_NSG where CLNID=" & ConfigID + 'Call Obj.ConnectDB() + 'Dim CMD As New OdbcCommand(SQL, Obj.Conn) + 'Dim RS As OdbcDataReader + 'RS = CMD.ExecuteReader + 'While RS.Read + ' 'txtAmmoType.Text = ObjIM.GetAmmoType(RS("ATID")) + ' 'txtCal.Text = ObjIM.GetCaliber(RS("CALID")) + ''Call ObjIM.LoadBulletInfo(RS("BID"), txtBManu.Text, txtBName.Text, txtBDia.Text, _ + '' txtBWei.Text, txtBSecDen.Text, txtBPartNo.Text, txtBBCO.Text, _ + '' INSTOCK_BULLET, txtBType.Text, COST_BULLET) + ' 'Call ObjIM.LoadPrimerInfo(RS("PRID"), txtPManu.Text, txtPName.Text, _ + ' ' txtPType.Text, COST_PRIMER, INSTOCK_PRIMER) + ' 'Call ObjIM.LoadCaseInfo(RS("CAID"), txtCManu.Text, txtCName.Text, txtCTOL.Text, _ + ' ' txtCTU.Text, INSTOCK_CASE, COST_CASE) + ' If Not IsPersonal Then + ' If Not IsDBNull(RS("Source")) Then + ' lblReffer.Text = "(Refer to " & RS("Source") & ")" + ' Else + ' lblReffer.Text = "Unknown Referance" + ' End If + ' End If + 'End While + 'RS.Close() + 'RS = Nothing + 'CMD = Nothing + Catch ex As Exception + Call LogError(Name, "LoadConfig_RiflePistol", Err.Number, ex.Message.ToString) + End Try + End Sub + ' + 'Sub XML_Generate(ByVal strPath As String) + ' Try + ' Dim sAns As String = "" + ' Dim NL As String = Chr(10) & Chr(13) + ' sAns = "" + ' sAns &= "" & NL + ' sAns &= XML_GenerateConfig() + ' sAns &= XML_GenerateBullets() + ' sAns &= XML_GeneratePrimers() + ' sAns &= XML_GenerateCases() + ' sAns &= XML_GeneratePowderList() + ' sAns &= "" & NL + ' sAns = Replace(sAns, "&", "&") + ' 'Dim ObjFS As New BSFileSystem + ' 'ObjFS.DeleteFile(strPath) + ' 'ObjFS.OutPutToFile(strPath, sAns) + ' Dim ObjFS As New FileIO + ' ObjFS.DeleteFile(strPath) + ' ObjFS.AppendToFile(strPath, sAns) + ' MsgBox("Config was exported to " & Chr(10) & strPath) + ' Catch ex As Exception + ' Call LogError(Name, "XML_Generate", Err.Number, ex.Message.ToString) + ' End Try + 'End Sub + ' + 'Function XML_GeneratePowderList() As String + ' Dim sAns As String = "" + ' Dim NL As String = Chr(10) & Chr(13) + ' Try + ' Dim Obj As New BSDatabase + ' Call Obj.ConnectDB() + ' Dim SQL As String = "SELECT * from qry_CFG_SR_PowderList where CLNID=" & ConfigID + ' Dim CMD As New OdbcCommand(SQL, Obj.Conn) + ' Dim RS As OdbcDataReader + ' RS = CMD.ExecuteReader + ' While RS.Read + ' sAns &= " " & NL + ' sAns &= " " & RS("Manufacturer") & "" & NL + ' sAns &= " " & RS("Name") & "" & NL + ' sAns &= " " & RS("Load_Min") & "" & NL + ' sAns &= " " & RS("Load_Mid") & "" & NL + ' sAns &= " " & RS("Load_Max") & "" & NL + ' sAns &= " " & RS("FPS_Min") & "" & NL + ' sAns &= " " & RS("FPS_MID") & "" & NL + ' sAns &= " " & RS("FPS_Max") & "" & NL + ' sAns &= " " & RS("CUPS_Min") & "" & NL + ' sAns &= " " & RS("CUPS_Mid") & "" & NL + ' sAns &= " " & RS("CUPS_Max") & "" & NL + ' sAns &= " " & RS("IsPref") & "" & NL + ' sAns &= " " & NL + ' End While + ' RS.Close() + ' RS = Nothing + ' CMD = Nothing + ' Obj.CloseDB() + ' Catch ex As Exception + ' Call LogError(Name, "XML_GeneratePowderList", Err.Number, ex.Message.ToString) + ' End Try + ' Return sAns + 'End Function + ' + 'Function XML_GenerateConfig() As String + ' Dim sAns As String = "" + ' Dim NL As String = Chr(10) & Chr(13) + ' 'sAns = "" & NL + ' sAns &= "
" & NL + ' sAns &= " " & ConfigName & "" & NL + ' sAns &= " " & IsPersonal & "" & NL + ' sAns &= " " & IsShotGun & "" & NL + ' sAns &= " " & txtNotes.Text & "" & NL + ' sAns &= " " & txtAmmoType.Text & "" & NL + ' sAns &= " " & txtCal.Text & "" & NL + ' sAns &= " " & lblReffer.Text & "" & NL + ' sAns &= "
" & NL + ' 'sAns &= "
" & NL + ' Return sAns + 'End Function + ' + 'Function XML_GenerateCases() As String + ' Dim sAns As String = "" + ' Dim NL As String = Chr(10) & Chr(13) + ' sAns = " " & NL + ' sAns &= " " & txtCManu.Text & "" & NL + ' sAns &= " " & txtCName.Text & "" & NL + ' sAns &= " " & txtCTOL.Text & "" & NL + ' sAns &= " " & txtCTU.Text & "" & NL + ' sAns &= " " & NL + ' Return sAns + 'End Function + ' + 'Function XML_GeneratePrimers() As String + ' Dim sAns As String = "" + ' Dim NL As String = Chr(10) & Chr(13) + ' sAns = " " & NL + ' sAns &= " " & txtPManu.Text & "" & NL + ' sAns &= " " & txtPName.Text & "" & NL + ' sAns &= " " & txtPType.Text & "" & NL + ' sAns &= " " & NL + ' Return sAns + 'End Function + ' + 'Function XML_GenerateBullets() As String + ' Dim sAns As String = "" + ' Dim NL As String = Chr(10) & Chr(13) + ' sAns = " " & NL + ' sAns &= " " & txtBManu.Text & "" & NL + ' sAns &= " " & txtBName.Text & "" & NL + ' sAns &= " " & txtBDia.Text & "" & NL + ' sAns &= " " & txtBWei.Text & "" & NL + ' sAns &= " " & txtBSecDen.Text & "" & NL + ' sAns &= " " & txtBPartNo.Text & "" & NL + ' sAns &= " " & txtBBCO.Text & "" & NL + ' sAns &= " " & txtBType.Text & "" & NL + ' sAns &= " " & NL + ' Return sAns + 'End Function #End Region #Region "Form Related Subs" - Private Sub frmView_Configuration_Sheet_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Try - Dim ObjG As New GlobalFunctions - ConfigName = ObjG.GetTitle(ConfigID) - Me.Text = ConfigName & " Configuration Sheet" - Call LoadData() - Catch ex As Exception - Call LogError(Me.Name, "Load", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub btnAddNotes_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddNotes.Click - btnAddNotes.Enabled = False - btnUpdate.Visible = True - txtNotes.ReadOnly = False - End Sub - Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click - btnUpdate.Visible = False - btnAddNotes.Enabled = True - txtNotes.ReadOnly = True - Try - Dim Obj As New BSDatabase - Dim strNotes As String = GeneralHelpers.FluffContent(txtNotes.Text) - Dim SQL As String = "UPDATE Config_List_Name set Notes='" & strNotes & "' where ID=" & ConfigID - Obj.ConnExec(SQL) - Catch ex As Exception - Call LogError(Me.Name, "btnUpdate.Click", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmView_Configuration_Sheet_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize - If Me.Width > 0 Then - TabControl1.Width = Me.Width - 5 - TabControl1.Height = Me.Height - 60 - DataGridView1.Width = TabControl1.Width - 27 - DataGridView1.Height = TabControl1.Height - 69 - txtNotes.Width = TabControl1.Width - 27 - txtNotes.Height = TabControl1.Height - 69 - End If - End Sub - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click - Dim frmNew As New frmConfig_Add_Wizard_Powder - frmNew.ConfigID = ConfigID - frmNew.ConfigName = ConfigName - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - End Sub - Private Sub btnRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefresh.Click - Call LoadPowderGrid() - End Sub - Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click - Me.Close() - End Sub - Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click - Dim frmNew As New frmLoadMakeReady_Details - frmNew.MdiParent = Me.MdiParent - frmNew.ConfigID = ConfigID - frmNew.ConfigName = ConfigName - frmNew.Show() - Me.Close() - End Sub - Private Sub rbstatus1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbstatus1.CheckedChanged - If rbstatus1.Checked Then - rbstatus2.Checked = False - isActive = True - Call UpdateActivity(1) - Call MDIParentMain.RefreshConfigData() - End If - End Sub - Private Sub rbstatus2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbstatus2.CheckedChanged - If rbstatus2.Checked Then - rbstatus1.Checked = False - isActive = False - Call UpdateActivity(0) - Call MDIParentMain.RefreshConfigData() - End If - End Sub - Private Sub chkFav_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkFav.CheckedChanged - If chkFav.Checked Then - isFav = True - Call UpdateFav(1) - Else - isFav = False - Call UpdateFav(0) - End If - Call MDIParentMain.RefreshConfigData() - End Sub - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub - Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click - Me.Cursor = Cursors.WaitCursor - Dim frmNew As New frmEditConfig - frmNew.ConfigID = ConfigID - frmNew.ConfigName = ConfigName - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - Me.Close() - Me.Cursor = Cursors.Arrow - End Sub - Private Sub DeleteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click - Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strSQLTable As String = "Config_List_Powder_Data_NSG" - Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & ItemID - Obj.ConnExec(SQL) + ''' + ''' Handles the Load event of the frmView_Configuration_Sheet control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmView_Configuration_Sheet_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Try + 'Dim ObjG As New GlobalFunctions + 'ConfigName = ObjG.GetTitle(ConfigID) + ConfigName = GeneralFunctions.GetTitle(DatabasePath,ConfigId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Text = $"{ConfigName} Configuration Sheet" + Call LoadData() + Catch ex As Exception + Call LogError(Name, "Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the btnAddNotes control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnAddNotes_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAddNotes.Click + Try + btnAddNotes.Enabled = False + btnUpdate.Visible = True + txtNotes.ReadOnly = False + Catch ex As Exception + Call LogError(Name, "btnAddNotes_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the btnUpdate control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdate.Click + btnUpdate.Visible = False + btnAddNotes.Enabled = True + txtNotes.ReadOnly = True + Try + 'Dim Obj As New BSDatabase + Dim strNotes As String = GeneralHelpers.FluffContent(txtNotes.Text) + If Not ConfigListDataName.UpdateNotes(DatabasePath, ConfigId, strNotes, _errOut) Then Throw New Exception(_errOut) + ''TODO: Repalced by BurnSoft.Applications.MLL.ConfigSheets.ConfigListDataName.UpdateNotes + 'Dim SQL As String = "UPDATE Config_List_Name set Notes='" & strNotes & "' where ID=" & ConfigID + 'Obj.ConnExec(SQL) + Catch ex As Exception + Call LogError(Name, "btnUpdate.Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Resize event of the frmView_Configuration_Sheet control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmView_Configuration_Sheet_Resize(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Resize + Try + If Width > 0 Then + TabControl1.Width = Width - 5 + TabControl1.Height = Height - 60 + DataGridView1.Width = TabControl1.Width - 27 + DataGridView1.Height = TabControl1.Height - 69 + txtNotes.Width = TabControl1.Width - 27 + txtNotes.Height = TabControl1.Height - 69 + End If + Catch ex As Exception + Call LogError(Name, "frmView_Configuration_Sheet_Resize", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the btnAdd control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click + Try + Dim frmNew As New FrmConfigAddWizardPowder + frmNew.ConfigId = ConfigId + frmNew.ConfigName = ConfigName + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "btnAdd_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the btnRefresh control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnRefresh_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnRefresh.Click Call LoadPowderGrid() - Catch ex As Exception - Call LogError(Me.Name, "DeleteToolStripMenuItem_Click", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click - Me.Cursor = Cursors.WaitCursor - Try - Dim frmNew As New frmReport_Configuration_Sheet - frmNew.Config_ID = ConfigID - frmNew.Config_Name = ConfigName - frmNew.Config_AT = txtAmmoType.Text - frmNew.Config_Cal = txtCal.Text - frmNew.Config_Notes = txtNotes.Text - frmNew.Bul_Manu = txtBManu.Text - frmNew.Bul_Name = txtBName.Text - frmNew.Bul_Dia = txtBDia.Text - frmNew.Bul_Wei = txtBWei.Text - frmNew.Bul_SD = txtBSecDen.Text - frmNew.Bul_PN = txtBPartNo.Text - frmNew.Bul_BC = txtBBCO.Text - frmNew.Bul_BT = txtBType.Text - frmNew.Pri_Manu = txtPManu.Text - frmNew.Pri_Name = txtPName.Text - frmNew.Pri_PT = txtPType.Text - frmNew.Case_Manu = txtCManu.Text - frmNew.Case_Name = txtCName.Text - frmNew.Case_TTL = txtCTOL.Text - frmNew.Case_TU = txtCTU.Text - frmNew.Config_ISPersonal = IsPersonal - frmNew.Config_Ref = lblReffer.Text - frmNew.Config_Fav = chkFav.Checked - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - Catch ex As Exception - Call LogError(Me.Name, "ToolStripButton4_Click", Err.Number, ex.Message.ToString) - End Try - Me.Cursor = Cursors.Arrow - End Sub - Private Sub ToolStripButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton5.Click - Dim DefaultFileName As String = "ExportConfig_" & ConfigName & ".xml" - SaveFileDialog1.FilterIndex = 1 - SaveFileDialog1.Filter = "XML File(*.xml)|*.xml" - SaveFileDialog1.Title = "Export Data to XML File" - SaveFileDialog1.FileName = Replace(Replace(Replace(DefaultFileName, " ", "_"), "/", "-"), "\", "-") - If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.Cancel Then Exit Sub - Dim strFilePath As String = SaveFileDialog1.FileName - Call XML_Generate(strFilePath) - Me.Close() - End Sub + End Sub + ''' + ''' Handles the Click event of the ToolStripButton2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton2.Click + Close() + End Sub + ''' + ''' Handles the Click event of the ToolStripButton1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton1.Click + Try + Dim frmNew As New FrmLoadMakeReadyDetails + frmNew.MdiParent = MdiParent + frmNew.ConfigId = ConfigId + frmNew.ConfigName = ConfigName + frmNew.Show() + Close() + Catch ex As Exception + Call LogError(Name, "ToolStripButton1_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the CheckedChanged event of the rbstatus1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub rbstatus1_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles rbstatus1.CheckedChanged + Try + If rbstatus1.Checked Then + rbstatus2.Checked = False + _isActive = True + ConfigListDataName.SetActivity(DatabasePath, ConfigId, True, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + 'Call UpdateActivity(1) + Call MDIParentMain.RefreshConfigData() + End If + Catch ex As Exception + Call LogError(Name, "rbstatus1_CheckedChanged", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the CheckedChanged event of the rbstatus2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub rbstatus2_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles rbstatus2.CheckedChanged + Try + If rbstatus2.Checked Then + rbstatus1.Checked = False + _isActive = False + ConfigListDataName.SetActivity(DatabasePath, ConfigId, False, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + 'Call UpdateActivity(0) + Call MDIParentMain.RefreshConfigData() + End If + Catch ex As Exception + Call LogError(Name, "rbstatus2_CheckedChanged", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the CheckedChanged event of the chkFav control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub chkFav_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles chkFav.CheckedChanged + If chkFav.Checked Then + _isFavorite = True + ConfigListDataName.SetFavorite(DatabasePath, ConfigId, True, _errOut) + 'Call UpdateFav(1) + Else + _isFavorite = False + ConfigListDataName.SetFavorite(DatabasePath, ConfigId, False, _errOut) + 'Call UpdateFav(0) + End If + Call MDIParentMain.RefreshConfigData() + End Sub + ''' + ''' Handles the Click event of the btnCancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click + Close() + End Sub + ''' + ''' Handles the Click event of the ToolStripButton3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click + Cursor = Cursors.WaitCursor + Try + Dim frmNew As New frmEditConfig + frmNew.ConfigID = ConfigId + frmNew.ConfigName = ConfigName + frmNew.MdiParent = MdiParent + frmNew.Show() + Close() + Catch ex As Exception + Call LogError(Name, "ToolStripButton3_Click", Err.Number, ex.Message.ToString) + End Try + Cursor = Cursors.Arrow + End Sub + Private Sub DeleteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles DeleteToolStripMenuItem.Click + Try + Dim itemId As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + If Not ConfigListDataPowder.Delete(DatabasePath, CLng(itemId), _errOut) Then Throw New Exception(_errOut) + 'Dim Obj As New BSDatabase + 'Dim ObjG As New GlobalFunctions + 'Dim strSQLTable As String = "Config_List_Powder_Data_NSG" + 'Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & ItemID + 'Obj.ConnExec(SQL) + Call LoadPowderGrid() + Catch ex As Exception + Call LogError(Name, "DeleteToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton4 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton4.Click + Cursor = Cursors.WaitCursor + Try + Dim frmNew As New FrmReportConfigurationSheet + frmNew.ConfigId = ConfigId + frmNew.ConfigName = ConfigName + frmNew.ConfigAmmoType = txtAmmoType.Text + frmNew.ConfigCaliber = txtCal.Text + frmNew.ConfigNotes = txtNotes.Text + frmNew.BulletManufacturer = txtBManu.Text + frmNew.BulletName = txtBName.Text + frmNew.BulletDiameter = txtBDia.Text + frmNew.BulletWeight = txtBWei.Text + frmNew.BulletSectionalDensity = txtBSecDen.Text + frmNew.BulletPartNumber = txtBPartNo.Text + frmNew.BulletBallisticCoeffcient = txtBBCO.Text + frmNew.BulletType = txtBType.Text + frmNew.PrimerManufacturer = txtPManu.Text + frmNew.PrimerName = txtPName.Text + frmNew.PrimerType = txtPType.Text + frmNew.CaseManufacturer = txtCManu.Text + frmNew.CaseName = txtCName.Text + frmNew.CaseTrimToLength = txtCTOL.Text + frmNew.CaseTimesUsed = txtCTU.Text + frmNew.ConfigIsPersonal = _isPersonal + frmNew.ConfigReferance = lblReffer.Text + frmNew.ConfigFavorite = chkFav.Checked + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton4_Click", Err.Number, ex.Message.ToString) + End Try + Cursor = Cursors.Arrow + End Sub + ''' + ''' Handles the Click event of the ToolStripButton5 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton5_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton5.Click + Try + Dim defaultFileName As String = $"ExportConfig_{ConfigName}.xml" + SaveFileDialog1.FilterIndex = 1 + SaveFileDialog1.Filter = $"XML File(*.xml)|*.xml" + SaveFileDialog1.Title = $"Export Data to XML File" + SaveFileDialog1.FileName = Replace(Replace(Replace(defaultFileName, " ", "_"), "/", "-"), "\", "-") + If SaveFileDialog1.ShowDialog() = DialogResult.Cancel Then Exit Sub + Dim strFilePath As String = SaveFileDialog1.FileName + 'Call XML_Generate(strFilePath) + If not ConfigurationSheets.Generate(DatabasePath, ConfigId, strFilePath, _errOut) Then throw New Exception(_errOut) + MsgBox($"Was able to export {ConfigName} to {strFilePath}") + 'Close() + Catch ex As Exception + MsgBox($"Error Exporting {ConfigName} to Disk, check error Log") + Call LogError(Name, "ToolStripButton5_Click", Err.Number, ex.Message.ToString) + End Try + End Sub #End Region - - Private Sub SetAsDefaultToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetAsDefaultToolStripMenuItem.Click - Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strSQLTable As String = "Config_List_Powder_Data_NSG" - Dim SQL As String = "Update " & strSQLTable & " set IsPref=0 where CLNID=" & ConfigID - Obj.ConnExec(SQL) - SQL = "Update " & strSQLTable & " set IsPref=1 where ID=" & ItemID - Obj.ConnExec(SQL) - Call LoadData() - Catch ex As Exception - Call LogError(Me.Name, "DeleteToolStripMenuItem_Click", Err.Number, ex.Message.ToString) - End Try - End Sub -End Class \ No newline at end of file + ''' + ''' Handles the Click event of the SetAsDefaultToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub SetAsDefaultToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles SetAsDefaultToolStripMenuItem.Click + Try + Dim itemId As long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + If Not ConfigListDataPowder.ClearDefault(DatabasePath, ConfigId, _errOut) Then Throw New Exception(_errOut) + If Not ConfigListDataPowder.SetNewDefault(DatabasePath, itemId, _errOut) Then Throw New Exception(_errOut) + 'Dim Obj As New BSDatabase + ''Dim ObjG As New GlobalFunctions + 'Dim strSQLTable As String = "Config_List_Powder_Data_NSG" + 'Dim SQL As String = "Update " & strSQLTable & " set IsPref=0 where CLNID=" & ConfigID + 'Obj.ConnExec(SQL) + 'SQL = "Update " & strSQLTable & " set IsPref=1 where ID=" & ItemID + 'Obj.ConnExec(SQL) + Call LoadData() + Catch ex As Exception + Call LogError(Name, "DeleteToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_Configuration_Shotgun_Sheet.vb b/BSMyLoadersLog/Viewing/frmView_Configuration_Shotgun_Sheet.vb index faa8240..37546ad 100644 --- a/BSMyLoadersLog/Viewing/frmView_Configuration_Shotgun_Sheet.vb +++ b/BSMyLoadersLog/Viewing/frmView_Configuration_Shotgun_Sheet.vb @@ -3,10 +3,16 @@ Imports System.Data.Odbc Imports System.IO Imports System.Xml Imports System.Data +Imports BSMyLoadersLog.ViewReports +Imports BurnSoft.Applications.MLL.Global Imports BurnSoft.Applications.MLL.Helpers Imports BurnSoft.Universal Public Class frmView_Configuration_Shotgun_Sheet + ''' + ''' The error out + ''' + Dim errOut as String Public ConfigID As Long Public ConfigName As String Dim IsPersonal As Boolean @@ -126,15 +132,15 @@ Public Class frmView_Configuration_Shotgun_Sheet Dim dC1RA As Double = 0 Dim Obj As New InventoryMath If Not IsSlug Then - COST_BULLET = COST_SHOT * (SHOT_PREFLOAD * WeightGramsOz) ' * COST_SHOT + COST_BULLET = COST_SHOT * (SHOT_PREFLOAD * WeightValues.WEIGHT_GRAMS_OZ) ' * COST_SHOT Else COST_BULLET = COST_SLUG End If - txtCPB.Text = Obj.ConvertToDollars(COST_BULLET) - txtCPP.Text = Obj.ConvertToDollars(COST_PRIMER) - txtCPC.Text = Obj.ConvertToDollars(COST_CASE) - txtCOPMid.Text = Obj.ConvertToDollars((COST_POWDER * MID_POWDER)) - txtCPW.Text = Obj.ConvertToDollars(COST_WAD) + txtCPB.Text = Converters.ConvertToDollars(COST_BULLET) + txtCPP.Text = Converters.ConvertToDollars(COST_PRIMER) + txtCPC.Text = Converters.ConvertToDollars(COST_CASE) + txtCOPMid.Text = Converters.ConvertToDollars((COST_POWDER * MID_POWDER)) + txtCPW.Text = Converters.ConvertToDollars(COST_WAD) dC1RA = Converters.CostOfRoundsOfAmmoShotGun(COST_PRIMER, COST_CASE, COST_BULLET, COST_POWDER, MID_POWDER, COST_WAD) txtC1RA.Text = dC1RA txtCNWIS.Text = INSTOCK_WAD @@ -169,7 +175,7 @@ Public Class frmView_Configuration_Shotgun_Sheet End If txtNMR.Text = lnmr - txtTCR.Text = lnmr * Obj.ConvertToDollars(dC1RA) + txtTCR.Text = lnmr * Converters.ConvertToDollars(dC1RA) Catch ex As Exception Call LogError(Me.Name, "LoadCosts", Err.Number, ex.Message.ToString) End Try @@ -177,12 +183,14 @@ Public Class frmView_Configuration_Shotgun_Sheet Public Sub LoadData() Try Lastconfigedviewed = ConfigID - Dim ObjG As New GlobalFunctions + 'Dim ObjG As New GlobalFunctions Dim Obj As New InventoryMath Me.Loaders_Log_Ammunition_AuditTableAdapter.FillByConfigID(Me.MLLDataSet.Loaders_Log_Ammunition_Audit, ConfigID) IsShotGun = False IsPersonal = False - ConfigName = ObjG.GetTitle(ConfigID) + 'ConfigName = ObjG.GetTitle(ConfigID) + ConfigName = GeneralFunctions.GetTitle(DatabasePath,ConfigID, errOut) + If errOut.Length > 0 Then Throw New Exception(errOut) Me.Text = ConfigName & " Configuration Sheet" txtConfigName.Text = ConfigName PrefferedPowderID = Obj.GetPrefSGPowderID(ConfigID, MID_POWDER) @@ -333,11 +341,11 @@ Public Class frmView_Configuration_Shotgun_Sheet Return sAns End Function - Private Sub frmView_Configuration_Shotgun_Sheet_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed + Private Sub frmView_Configuration_Shotgun_Sheet_Disposed(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Disposed Dim objS As New ViewSizeSettings objS.SaveView_Configuration_Shotgun_Sheet(Me.Height, Me.Width, Me.Location.X, Me.Location.Y) End Sub - Private Sub frmView_Configuration_Shotgun_Sheet_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load + Private Sub frmView_Configuration_Shotgun_Sheet_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load Try Dim objS As New ViewSizeSettings objS.LoadView_Configuration_Shotgun_Sheet(Me.Height, Me.Width, Me.Location) @@ -349,7 +357,7 @@ Public Class frmView_Configuration_Shotgun_Sheet Call LogError(Me.Name, "Load", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub frmView_Configuration_Shotgun_Sheet_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize + Private Sub frmView_Configuration_Shotgun_Sheet_Resize(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Resize If Me.Width > 0 Then TabControl1.Width = Me.Width - 5 TabControl1.Height = Me.Height - 60 @@ -359,7 +367,7 @@ Public Class frmView_Configuration_Shotgun_Sheet txtNotes.Height = TabControl1.Height - 69 End If End Sub - Private Sub chkFav_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkFav.CheckedChanged + Private Sub chkFav_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles chkFav.CheckedChanged If chkFav.Checked Then isFav = True Call UpdateFav(1) @@ -369,7 +377,7 @@ Public Class frmView_Configuration_Shotgun_Sheet End If Call MdiParentMain.RefreshConfigData() End Sub - Private Sub rbstatus1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbstatus1.CheckedChanged + Private Sub rbstatus1_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles rbstatus1.CheckedChanged If rbstatus1.Checked Then rbstatus2.Checked = False isActive = True @@ -377,7 +385,7 @@ Public Class frmView_Configuration_Shotgun_Sheet Call MdiParentMain.RefreshConfigData() End If End Sub - Private Sub rbstatus2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbstatus2.CheckedChanged + Private Sub rbstatus2_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles rbstatus2.CheckedChanged If rbstatus2.Checked Then rbstatus1.Checked = False isActive = False @@ -385,7 +393,7 @@ Public Class frmView_Configuration_Shotgun_Sheet Call MdiParentMain.RefreshConfigData() End If End Sub - Private Sub DeleteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click + Private Sub DeleteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles DeleteToolStripMenuItem.Click Try Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value Dim Obj As New BSDatabase @@ -398,7 +406,7 @@ Public Class frmView_Configuration_Shotgun_Sheet Call LogError(Me.Name, "DeleteToolStripMenuItem_Click", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub SetAsDefaultToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetAsDefaultToolStripMenuItem.Click + Private Sub SetAsDefaultToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles SetAsDefaultToolStripMenuItem.Click Try Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value Dim Obj As New BSDatabase @@ -413,15 +421,15 @@ Public Class frmView_Configuration_Shotgun_Sheet Call LogError(Me.Name, "DeleteToolStripMenuItem_Click", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub btnRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefresh.Click + Private Sub btnRefresh_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnRefresh.Click Call LoadPowderGrid() End Sub - Private Sub btnAddNotes_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddNotes.Click + Private Sub btnAddNotes_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAddNotes.Click btnAddNotes.Enabled = False btnUpdate.Visible = True txtNotes.ReadOnly = False End Sub - Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click + Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdate.Click btnUpdate.Visible = False btnAddNotes.Enabled = True txtNotes.ReadOnly = True @@ -434,52 +442,52 @@ Public Class frmView_Configuration_Shotgun_Sheet Call LogError(Me.Name, "btnUpdate.Click", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click + Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click Dim frmNew As New frmConfig_Add_Wizard_SG_Powder frmNew.ConfigID = ConfigID frmNew.ConfigName = ConfigName frmNew.MdiParent = Me.MdiParent frmNew.Show() End Sub - Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click + Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton2.Click Me.Close() End Sub - Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click - Dim frmNew As New frmLoadMakeReady_Details + Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton1.Click + Dim frmNew As New FrmLoadMakeReadyDetails frmNew.MdiParent = Me.MdiParent - frmNew.ConfigID = ConfigID + frmNew.ConfigId = ConfigID frmNew.ConfigName = ConfigName frmNew.Show() Me.Close() End Sub - Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click + Private Sub ToolStripButton4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton4.Click Me.Cursor = Cursors.WaitCursor Try If Not IsSlug Then - Dim frmNew As New frmReport_Configuration_Sheet_SG - frmNew.Config_ID = ConfigID - frmNew.Config_Name = ConfigName - frmNew.Config_AT = txtAmmoType.Text - frmNew.Config_Cal = txtCal.Text - frmNew.Config_Notes = txtNotes.Text - frmNew.Pro_Manu = txtShotManu.Text - frmNew.Pro_Name = txtShotName.Text - frmNew.Pro_Material = txtShotMat.Text - frmNew.Pro_ShotNo = txtShotNo.Text - frmNew.Pro_SelectedLoad = txtPrefLoad.Text - frmNew.WAD_Manu = txtWADManu.Text - frmNew.WAD_Name = txtWADName.Text - frmNew.WAD_MaxLoad = txtWADLoad.Text - frmNew.Pri_Manu = txtPManu.Text - frmNew.Pri_Name = txtPName.Text - frmNew.Pri_PT = txtPType.Text - frmNew.Case_Manu = txtCManu.Text - frmNew.Case_Name = txtCName.Text - frmNew.Case_TTL = txtCTOL.Text - frmNew.Case_DRAM = txtDRAM.Text - frmNew.Config_ISPersonal = IsPersonal - frmNew.Config_Ref = lblReffer.Text - frmNew.Config_Fav = chkFav.Checked + Dim frmNew As New FrmReportConfigurationSheetSg + frmNew.ConfigId = ConfigID + frmNew.ConfigName = ConfigName + frmNew.ConfigAmmoType = txtAmmoType.Text + frmNew.ConfigCaliber = txtCal.Text + frmNew.ConfigNotes = txtNotes.Text + frmNew.ProjectileManufacturer = txtShotManu.Text + frmNew.ProjectileName = txtShotName.Text + frmNew.ProjectileMaterial = txtShotMat.Text + frmNew.ProjectileShotNo = txtShotNo.Text + frmNew.ProjectileSelectedLoad = txtPrefLoad.Text + frmNew.WadManufacturer = txtWADManu.Text + frmNew.WadName = txtWADName.Text + frmNew.WadMaxLoad = txtWADLoad.Text + frmNew.PrimerManufacturer = txtPManu.Text + frmNew.PrimerName = txtPName.Text + frmNew.PrimerType = txtPType.Text + frmNew.CaseManufacturer = txtCManu.Text + frmNew.CaseName = txtCName.Text + frmNew.CaseTrimToLength = txtCTOL.Text + frmNew.CaseDram = txtDRAM.Text + frmNew.ConfigIsPersonal = IsPersonal + frmNew.ConfigRefference = lblReffer.Text + frmNew.ConfigFavorite = chkFav.Checked frmNew.MdiParent = Me.MdiParent frmNew.Show() Else @@ -513,19 +521,19 @@ Public Class frmView_Configuration_Shotgun_Sheet End Try Me.Cursor = Cursors.Arrow End Sub - Private Sub ToolStripButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton5.Click + Private Sub ToolStripButton5_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton5.Click Dim DefaultFileName As String = "ExportConfig_" & ConfigName & ".xml" SaveFileDialog1.FilterIndex = 1 SaveFileDialog1.Filter = "XML File(*.xml)|*.xml" SaveFileDialog1.Title = "Export Data to XML File" SaveFileDialog1.FileName = Replace(Replace(Replace(Replace(DefaultFileName, " ", "_"), "/", "-"), "\", "-"), Chr(34), "") - If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.Cancel Then Exit Sub + If SaveFileDialog1.ShowDialog() = DialogResult.Cancel Then Exit Sub Dim strFilePath As String = SaveFileDialog1.FileName Call XML_Generate(strFilePath) Me.Close() End Sub - Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click + Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click Dim frmNew As New frmEditConfig frmNew.ConfigID = ConfigID frmNew.ConfigName = ConfigName @@ -534,11 +542,11 @@ Public Class frmView_Configuration_Shotgun_Sheet Me.Close() End Sub - Private Sub GroupBox6_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) + Private Sub GroupBox6_Enter(ByVal sender As Object, ByVal e As EventArgs) End Sub - Private Sub TabPage1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabPage1.Click + Private Sub TabPage1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles TabPage1.Click End Sub End Class \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_General_Calibers.Designer.vb b/BSMyLoadersLog/Viewing/frmView_General_Calibers.Designer.vb index f18fee7..8250d59 100644 --- a/BSMyLoadersLog/Viewing/frmView_General_Calibers.Designer.vb +++ b/BSMyLoadersLog/Viewing/frmView_General_Calibers.Designer.vb @@ -1,126 +1,128 @@ - _ -Partial Class frmView_General_Calibers - Inherits System.Windows.Forms.Form +Namespace Viewing + _ + Partial Class FrmViewGeneralCalibers + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmView_General_Calibers)) - Me.ToolStrip1 = New System.Windows.Forms.ToolStrip - Me.DataGridView1 = New System.Windows.Forms.DataGridView - Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.CalDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.GeneralCalibersBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.General_CalibersTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.General_CalibersTableAdapter - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.GeneralCalibersBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'ToolStrip1 - ' - Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) - Me.ToolStrip1.Name = "ToolStrip1" - Me.ToolStrip1.Size = New System.Drawing.Size(290, 25) - Me.ToolStrip1.TabIndex = 0 - Me.ToolStrip1.Text = "ToolStrip1" - ' - 'DataGridView1 - ' - Me.DataGridView1.AllowUserToOrderColumns = True - Me.DataGridView1.AutoGenerateColumns = False - Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.CalDataGridViewTextBoxColumn}) - Me.DataGridView1.DataSource = Me.GeneralCalibersBindingSource - Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill - Me.DataGridView1.Location = New System.Drawing.Point(0, 25) - Me.DataGridView1.Name = "DataGridView1" - Me.DataGridView1.Size = New System.Drawing.Size(290, 384) - Me.DataGridView1.TabIndex = 1 - ' - 'IDDataGridViewTextBoxColumn - ' - Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" - Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" - Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" - Me.IDDataGridViewTextBoxColumn.Visible = False - ' - 'CalDataGridViewTextBoxColumn - ' - Me.CalDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.CalDataGridViewTextBoxColumn.DataPropertyName = "Cal" - Me.CalDataGridViewTextBoxColumn.HeaderText = "Cal" - Me.CalDataGridViewTextBoxColumn.Name = "CalDataGridViewTextBoxColumn" - Me.CalDataGridViewTextBoxColumn.Width = 47 - ' - 'GeneralCalibersBindingSource - ' - Me.GeneralCalibersBindingSource.DataMember = "General_Calibers" - Me.GeneralCalibersBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'General_CalibersTableAdapter - ' - Me.General_CalibersTableAdapter.ClearBeforeFill = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmView_General_Calibers - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(290, 409) - Me.Controls.Add(Me.DataGridView1) - Me.Controls.Add(Me.ToolStrip1) - Me.HelpProvider1.SetHelpKeyword(Me, "Edit Pre-Loaded Caliber Lists") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Edit Pre-Loaded Caliber Lists") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmView_General_Calibers" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Pre-Loaded Caliber Lists" - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.GeneralCalibersBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmViewGeneralCalibers)) + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip + Me.DataGridView1 = New System.Windows.Forms.DataGridView + Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.CalDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.GeneralCalibersBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.General_CalibersTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.General_CalibersTableAdapter + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.GeneralCalibersBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'ToolStrip1 + ' + Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(290, 25) + Me.ToolStrip1.TabIndex = 0 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'DataGridView1 + ' + Me.DataGridView1.AllowUserToOrderColumns = True + Me.DataGridView1.AutoGenerateColumns = False + Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.CalDataGridViewTextBoxColumn}) + Me.DataGridView1.DataSource = Me.GeneralCalibersBindingSource + Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill + Me.DataGridView1.Location = New System.Drawing.Point(0, 25) + Me.DataGridView1.Name = "DataGridView1" + Me.DataGridView1.Size = New System.Drawing.Size(290, 384) + Me.DataGridView1.TabIndex = 1 + ' + 'IDDataGridViewTextBoxColumn + ' + Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" + Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" + Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" + Me.IDDataGridViewTextBoxColumn.Visible = False + ' + 'CalDataGridViewTextBoxColumn + ' + Me.CalDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.CalDataGridViewTextBoxColumn.DataPropertyName = "Cal" + Me.CalDataGridViewTextBoxColumn.HeaderText = "Cal" + Me.CalDataGridViewTextBoxColumn.Name = "CalDataGridViewTextBoxColumn" + Me.CalDataGridViewTextBoxColumn.Width = 47 + ' + 'GeneralCalibersBindingSource + ' + Me.GeneralCalibersBindingSource.DataMember = "General_Calibers" + Me.GeneralCalibersBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'General_CalibersTableAdapter + ' + Me.General_CalibersTableAdapter.ClearBeforeFill = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmView_General_Calibers + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(290, 409) + Me.Controls.Add(Me.DataGridView1) + Me.Controls.Add(Me.ToolStrip1) + Me.HelpProvider1.SetHelpKeyword(Me, "Edit Pre-Loaded Caliber Lists") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Edit Pre-Loaded Caliber Lists") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "FrmViewGeneralCalibers" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Pre-Loaded Caliber Lists" + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.GeneralCalibersBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip - Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents GeneralCalibersBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents General_CalibersTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.General_CalibersTableAdapter - Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents CalDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider -End Class + End Sub + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents GeneralCalibersBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents General_CalibersTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.General_CalibersTableAdapter + Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents CalDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_General_Calibers.vb b/BSMyLoadersLog/Viewing/frmView_General_Calibers.vb index 2979b6f..93dc137 100644 --- a/BSMyLoadersLog/Viewing/frmView_General_Calibers.vb +++ b/BSMyLoadersLog/Viewing/frmView_General_Calibers.vb @@ -1,29 +1,52 @@ -Public Class frmView_General_Calibers - Public UpdatePending As Boolean - Private Sub frmView_General_Calibers_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Try - Me.General_CalibersTableAdapter.Fill(Me.MLLDataSet.General_Calibers) - Catch ex As Exception - Call LogError(Me.Name, "Load", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub GeneralCalibersBindingSource_ListChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ListChangedEventArgs) Handles GeneralCalibersBindingSource.ListChanged - Try - If Me.MLLDataSet.HasChanges Then - Me.UpdatePending = True - End If - Catch ex As Exception - Call LogError(Me.Name, "GeneralCalibersBindingSource_ListChanged", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub DataGridView1_RowValidated(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.RowValidated - Try - If Me.UpdatePending Then - Me.General_CalibersTableAdapter.Update(Me.MLLDataSet.General_Calibers) - Me.UpdatePending = False - End If - Catch ex As Exception - Call LogError(Me.Name, "DataGridView1_RowValidated", Err.Number, ex.Message.ToString) - End Try - End Sub -End Class \ No newline at end of file +Imports System.ComponentModel + +Namespace Viewing + + Public Class FrmViewGeneralCalibers + ''' + ''' The update pending + ''' + Public UpdatePending As Boolean + ''' + ''' Handles the Load event of the frmView_General_Calibers control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmView_General_Calibers_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Try + General_CalibersTableAdapter.Fill(MLLDataSet.General_Calibers) + Catch ex As Exception + Call LogError(Name, "Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the ListChanged event of the GeneralCalibersBindingSource control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub GeneralCalibersBindingSource_ListChanged(ByVal sender As Object, ByVal e As ListChangedEventArgs) Handles GeneralCalibersBindingSource.ListChanged + Try + If MLLDataSet.HasChanges Then + UpdatePending = True + End If + Catch ex As Exception + Call LogError(Name, "GeneralCalibersBindingSource_ListChanged", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the RowValidated event of the DataGridView1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DataGridView1_RowValidated(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView1.RowValidated + Try + If UpdatePending Then + General_CalibersTableAdapter.Update(MLLDataSet.General_Calibers) + UpdatePending = False + End If + Catch ex As Exception + Call LogError(Name, "DataGridView1_RowValidated", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_Bullets.Designer.vb b/BSMyLoadersLog/Viewing/frmView_List_Bullets.Designer.vb index 7edd145..76d6cfa 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_Bullets.Designer.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_Bullets.Designer.vb @@ -1,6 +1,6 @@ Namespace Viewing _ - Partial Class frmView_List_Bullets + Partial Class FrmViewListBullets Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. @@ -24,7 +24,7 @@ Namespace Viewing _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmView_List_Bullets)) + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmViewListBullets)) Me.DataGridView1 = New System.Windows.Forms.DataGridView Me.cmnusGrid = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem @@ -341,7 +341,7 @@ Namespace Viewing Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) Me.HelpProvider1.SetHelpString(Me, "View Bullet List") Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmView_List_Bullets" + Me.Name = "FrmViewListBullets" Me.HelpProvider1.SetShowHelp(Me, True) Me.Text = "Bullet List" CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() diff --git a/BSMyLoadersLog/Viewing/frmView_List_Bullets.vb b/BSMyLoadersLog/Viewing/frmView_List_Bullets.vb index f53cdb9..e3c5650 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_Bullets.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_Bullets.vb @@ -1,139 +1,258 @@ Imports BSMyLoadersLog.Adding Imports BSMyLoadersLog.LoadersClass Imports BurnSoft.Applications.MLL.Global +Imports BSMyLoadersLog.ViewReports +Imports BurnSoft.Applications.MLL.Inventory Namespace Viewing - - Public Class frmView_List_Bullets + ''' + ''' Class frmView_List_Bullets. + ''' Implements the + ''' + ''' + Public Class FrmViewListBullets ''' ''' The error out ''' - Private errOut as String + Private _errOut as String + ''' + ''' + ''' Const RegViewName As String = "View_Bullets" + ''' + ''' Loads the data. + ''' Public Sub LoadData() Try Select Case LCase(ToolStripComboBox1.Text) Case LCase("All") - Me.List_Bullets_DetailsTableAdapter.FillByAllManu(Me.MLLDataSet.List_Bullets_Details) + List_Bullets_DetailsTableAdapter.FillByAllManu(MLLDataSet.List_Bullets_Details) Case LCase("Instock") - Me.List_Bullets_DetailsTableAdapter.FillByINSManu(Me.MLLDataSet.List_Bullets_Details) + List_Bullets_DetailsTableAdapter.FillByINSManu(MLLDataSet.List_Bullets_Details) Case LCase("Out-Of-Stock") - Me.List_Bullets_DetailsTableAdapter.FillByOOSManu(Me.MLLDataSet.List_Bullets_Details) + List_Bullets_DetailsTableAdapter.FillByOOSManu(MLLDataSet.List_Bullets_Details) Case LCase("Reference") - Me.List_Bullets_DetailsTableAdapter.FillBy_Reference(Me.MLLDataSet.List_Bullets_Details) + List_Bullets_DetailsTableAdapter.FillBy_Reference(MLLDataSet.List_Bullets_Details) Case Else - Me.List_Bullets_DetailsTableAdapter.Fill(Me.MLLDataSet.List_Bullets_Details) + List_Bullets_DetailsTableAdapter.Fill(MLLDataSet.List_Bullets_Details) End Select Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub frmView_List_Bullets_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing + ''' + ''' Handles the FormClosing event of the frmView_List_Bullets control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmView_List_Bullets_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) Handles Me.FormClosing 'Dim ObjR As New BSRegistry 'Call ObjR.SaveViewSettings(RegViewName, ToolStripComboBox1.Text) Try - If Not MyRegistry.SaveViewSettings(RegViewName, ToolStripComboBox1.Text, errOut) Then Throw New Exception(errOut) + If Not MyRegistry.SaveViewSettings(RegViewName, ToolStripComboBox1.Text, _errOut) Then Throw New Exception(_errOut) Catch ex As Exception - Call LogError(Me.Name, "frmView_List_Bullets_FormClosing", Err.Number, ex.Message.ToString) + Call LogError(Name, "frmView_List_Bullets_FormClosing", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub frmView_List_Bullets_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize - If Me.Height <> 0 Then - Me.DataGridView1.Height = Me.Height - (65) - Me.DataGridView1.Width = Me.Width - 15 - End If + ''' + ''' Handles the Resize event of the frmView_List_Bullets control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmView_List_Bullets_Resize(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Resize + Try + If Height <> 0 Then + DataGridView1.Height = Height - (65) + DataGridView1.Width = Width - 15 + End If + Catch ex As Exception + Call LogError(Name, "frmView_List_Bullets_Resize", Err.Number, ex.Message.ToString) + End Try End Sub - Private Sub frmView_List_Bullets_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load + ''' + ''' Handles the Load event of the frmView_List_Bullets control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmView_List_Bullets_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load 'Dim ObjR As New BSRegistry 'ToolStripComboBox1.Text = ObjR.GetViewSettings(RegViewName, "All") Try - ToolStripComboBox1.Text = MyRegistry.GetViewSettings(RegViewName, errOut, "All") - if errOut.Length > 0 Then Throw New Exception(errOut) + ToolStripComboBox1.Text = MyRegistry.GetViewSettings(RegViewName, _errOut, "All") + if _errOut.Length > 0 Then Throw New Exception(_errOut) Call LoadData() Catch ex As Exception - Call LogError(Me.Name, "frmView_List_Bullets_Load", Err.Number, ex.Message.ToString) + Call LogError(Name, "frmView_List_Bullets_Load", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click - Dim frmNew As New frmAddBullets - frmNew.MdiParent = Me.MdiParent - frmNew.Show() + ''' + ''' Handles the Click event of the ToolStripButton1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton1.Click + Try + Dim frmNew As New frmAddBullets + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton1_Click", Err.Number, ex.Message.ToString) + End Try End Sub + ''' + ''' Deletes the bullet. + ''' Private Sub DeleteBullet() Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strSQLTable As String = "List_Bullets" - Dim strName As String = ObjG.GetName("SELECT * from " & strSQLTable & " where ID=" & ItemID, "Name") + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + 'Dim Obj As New BSDatabase + 'Dim ObjG As New GlobalFunctions + 'Dim strSQLTable As String = "List_Bullets" + 'Dim strName As String = ObjG.GetName("SELECT * from " & strSQLTable & " where ID=" & itemId, "Name") + Dim strName As String = BulletsInventory.GetName(DatabasePath, itemId, _errOut) Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & ItemID - If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() + 'Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & itemId + 'If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() + If strAns = vbYes Then + If Not BulletsInventory.Delete(DatabasePath, itemId, _errOut) Then Throw New Exception(_errOut) + Call LoadData() + End If + Catch ex As Exception - Call LogError(Me.Name, "DeleteBullet", Err.Number, ex.Message.ToString) + Call LogError(Name, "DeleteBullet", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click + ''' + ''' Handles the Click event of the ToolStripButton2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton2.Click Try Call DeleteBullet() Catch ex As Exception - Call LogError(Me.Name, "ToolStripButton2.Click", Err.Number, ex.Message.ToString) + Call LogError(Name, "ToolStripButton2.Click", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click + ''' + ''' Handles the Click event of the ToolStripButton3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click Call LoadData() End Sub - Private Sub EditToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EditToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim frmNew As New frmEditBullets - frmNew.BID = ItemID - frmNew.FromView = True - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - End Sub - Private Sub AddToQtyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToQtyToolStripMenuItem.Click - Dim frmNew As New frmAddQtyBullets - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - frmNew.BID = ItemID - frmNew.FromView = True - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - End Sub - Private Sub DeleteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click + Private Sub EditToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EditToolStripMenuItem.Click + Try + Dim itemId As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim frmNew As New frmEditBullets + frmNew.BID = itemId + frmNew.FromView = True + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "EditToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the AddToQtyToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub AddToQtyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AddToQtyToolStripMenuItem.Click + Try + Dim frmNew As New frmAddQtyBullets + Dim itemId As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + frmNew.BulletId = itemId + frmNew.FromView = True + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "AddToQtyToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the DeleteToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DeleteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles DeleteToolStripMenuItem.Click Call DeleteBullet() End Sub - Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click - Me.Cursor = Cursors.WaitCursor - frmReport_BulletInventory.MdiParent = Me.MdiParent - frmReport_BulletInventory.Show() - Me.Cursor = Cursors.Arrow + ''' + ''' Handles the Click event of the ToolStripButton4 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton4.Click + Cursor = Cursors.WaitCursor + Try + FrmReportBulletInventory.MdiParent = MdiParent + FrmReportBulletInventory.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton4_Click", Err.Number, ex.Message.ToString) + End Try + Cursor = Cursors.Arrow End Sub - Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged + ''' + ''' Handles the SelectedIndexChanged event of the ToolStripComboBox1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged Call LoadData() End Sub - Private Sub OutOfStockToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OutOfStockToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim SQL As String = "UPDATE List_Bullets set QTY=0 where ID=" & ItemID - Dim Obj As New BSDatabase - Obj.ConnExec(SQL) - Call LoadData() + ''' + ''' Handles the Click event of the OutOfStockToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub OutOfStockToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles OutOfStockToolStripMenuItem.Click + Try + Dim itemId As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + 'Dim SQL As String = "UPDATE List_Bullets set QTY=0 where ID=" & itemId + 'Dim Obj As New BSDatabase + 'Obj.ConnExec(SQL) + If Not BulletsInventory.UpdateQty(DatabasePath, itemId, 0, _errOut) Then Throw New Exception(_errOut) + Call LoadData() + Catch ex As Exception + Call LogError(Name, "OutOfStockToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub - - Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.BindingContextChanged - If DataGridView1.DataSource Is Nothing Then - Return - End If - DataGridView1.AutoResizeColumns() + ''' + ''' Handles the BindingContextChanged event of the DataGridView1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DataGridView1.BindingContextChanged + Try + If DataGridView1.DataSource Is Nothing Then + Return + End If + DataGridView1.AutoResizeColumns() + Catch ex As Exception + Call LogError(Name, "DataGridView1_BindingContextChanged", Err.Number, ex.Message.ToString) + End Try End Sub - - Private Sub CopyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim frmNew As New frmAddBullets - frmNew.DoCopy = True - frmNew.Bid = ItemID - frmNew.MdiParent = Me.MdiParent - frmNew.Show() + ''' + ''' Handles the Click event of the CopyToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub CopyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CopyToolStripMenuItem.Click + Try + Dim itemId As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim frmNew As New frmAddBullets + frmNew.DoCopy = True + frmNew.BulletId = itemId + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "CopyToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub End Class End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_ConfigurationsByCal.Designer.vb b/BSMyLoadersLog/Viewing/frmView_List_ConfigurationsByCal.Designer.vb index 98c8fd2..bfb2bf6 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_ConfigurationsByCal.Designer.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_ConfigurationsByCal.Designer.vb @@ -1,155 +1,157 @@ - _ -Partial Class frmView_List_ConfigurationsByCal - Inherits System.Windows.Forms.Form +Namespace Viewing + _ + Partial Class FrmViewListConfigurationsByCal + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmView_List_ConfigurationsByCal)) - Me.lstConfigSheets = New System.Windows.Forms.ListBox - Me.ConfigListSimpleBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.ToolStrip1 = New System.Windows.Forms.ToolStrip - Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton - Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel - Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox - Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton - Me.ConfigList_SimpleTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.ConfigList_SimpleTableAdapter - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - CType(Me.ConfigListSimpleBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.ToolStrip1.SuspendLayout() - Me.SuspendLayout() - ' - 'lstConfigSheets - ' - Me.lstConfigSheets.DataSource = Me.ConfigListSimpleBindingSource - Me.lstConfigSheets.DisplayMember = "ConfigName" - Me.lstConfigSheets.FormattingEnabled = True - Me.lstConfigSheets.Location = New System.Drawing.Point(0, 28) - Me.lstConfigSheets.Name = "lstConfigSheets" - Me.lstConfigSheets.Size = New System.Drawing.Size(254, 290) - Me.lstConfigSheets.TabIndex = 0 - Me.lstConfigSheets.ValueMember = "ID" - ' - 'ConfigListSimpleBindingSource - ' - Me.ConfigListSimpleBindingSource.DataMember = "ConfigList_Simple" - Me.ConfigListSimpleBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'ToolStrip1 - ' - Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripLabel1, Me.ToolStripComboBox1, Me.ToolStripButton3}) - Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) - Me.ToolStrip1.Name = "ToolStrip1" - Me.ToolStrip1.Size = New System.Drawing.Size(256, 25) - Me.ToolStrip1.TabIndex = 1 - Me.ToolStrip1.Text = "ToolStrip1" - ' - 'ToolStripButton1 - ' - Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) - Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton1.Name = "ToolStripButton1" - Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton1.Text = "Add a Configuration to the List" - ' - 'ToolStripButton2 - ' - Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) - Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton2.Name = "ToolStripButton2" - Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton2.Text = "Delete One of the Configurations Selected Below" - ' - 'ToolStripLabel1 - ' - Me.ToolStripLabel1.Name = "ToolStripLabel1" - Me.ToolStripLabel1.Size = New System.Drawing.Size(46, 22) - Me.ToolStripLabel1.Text = "Sort By:" - ' - 'ToolStripComboBox1 - ' - Me.ToolStripComboBox1.Items.AddRange(New Object() {"All", "Active Only", "Inactive Only", "All Favorites", "Personal Loads", "Reffered Loads"}) - Me.ToolStripComboBox1.Name = "ToolStripComboBox1" - Me.ToolStripComboBox1.Size = New System.Drawing.Size(121, 25) - Me.ToolStripComboBox1.Text = "All" - ' - 'ToolStripButton3 - ' - Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) - Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton3.Name = "ToolStripButton3" - Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton3.Text = "Refresh" - ' - 'ConfigList_SimpleTableAdapter - ' - Me.ConfigList_SimpleTableAdapter.ClearBeforeFill = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmView_List_ConfigurationsByCal - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(256, 322) - Me.Controls.Add(Me.ToolStrip1) - Me.Controls.Add(Me.lstConfigSheets) - Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow - Me.HelpProvider1.SetHelpKeyword(Me, "Accessing Configurations") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Accessing Configurations") - Me.Name = "frmView_List_ConfigurationsByCal" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Configuration Sheets" - CType(Me.ConfigListSimpleBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ToolStrip1.ResumeLayout(False) - Me.ToolStrip1.PerformLayout() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmViewListConfigurationsByCal)) + Me.lstConfigSheets = New System.Windows.Forms.ListBox + Me.ConfigListSimpleBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton + Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel + Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox + Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton + Me.ConfigList_SimpleTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.ConfigList_SimpleTableAdapter + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + CType(Me.ConfigListSimpleBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ToolStrip1.SuspendLayout() + Me.SuspendLayout() + ' + 'lstConfigSheets + ' + Me.lstConfigSheets.DataSource = Me.ConfigListSimpleBindingSource + Me.lstConfigSheets.DisplayMember = "ConfigName" + Me.lstConfigSheets.FormattingEnabled = True + Me.lstConfigSheets.Location = New System.Drawing.Point(0, 28) + Me.lstConfigSheets.Name = "lstConfigSheets" + Me.lstConfigSheets.Size = New System.Drawing.Size(254, 290) + Me.lstConfigSheets.TabIndex = 0 + Me.lstConfigSheets.ValueMember = "ID" + ' + 'ConfigListSimpleBindingSource + ' + Me.ConfigListSimpleBindingSource.DataMember = "ConfigList_Simple" + Me.ConfigListSimpleBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'ToolStrip1 + ' + Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripLabel1, Me.ToolStripComboBox1, Me.ToolStripButton3}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(256, 25) + Me.ToolStrip1.TabIndex = 1 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton1.Text = "Add a Configuration to the List" + ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton2.Text = "Delete One of the Configurations Selected Below" + ' + 'ToolStripLabel1 + ' + Me.ToolStripLabel1.Name = "ToolStripLabel1" + Me.ToolStripLabel1.Size = New System.Drawing.Size(46, 22) + Me.ToolStripLabel1.Text = "Sort By:" + ' + 'ToolStripComboBox1 + ' + Me.ToolStripComboBox1.Items.AddRange(New Object() {"All", "Active Only", "Inactive Only", "All Favorites", "Personal Loads", "Reffered Loads"}) + Me.ToolStripComboBox1.Name = "ToolStripComboBox1" + Me.ToolStripComboBox1.Size = New System.Drawing.Size(121, 25) + Me.ToolStripComboBox1.Text = "All" + ' + 'ToolStripButton3 + ' + Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) + Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton3.Name = "ToolStripButton3" + Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton3.Text = "Refresh" + ' + 'ConfigList_SimpleTableAdapter + ' + Me.ConfigList_SimpleTableAdapter.ClearBeforeFill = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'frmView_List_ConfigurationsByCal + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(256, 322) + Me.Controls.Add(Me.ToolStrip1) + Me.Controls.Add(Me.lstConfigSheets) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.HelpProvider1.SetHelpKeyword(Me, "Accessing Configurations") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Accessing Configurations") + Me.Name = "FrmViewListConfigurationsByCal" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Configuration Sheets" + CType(Me.ConfigListSimpleBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents lstConfigSheets As System.Windows.Forms.ListBox - Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents ConfigListSimpleBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents ConfigList_SimpleTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.ConfigList_SimpleTableAdapter - Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider - Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel - Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox - Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton -End Class + End Sub + Friend WithEvents lstConfigSheets As System.Windows.Forms.ListBox + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents ConfigListSimpleBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents ConfigList_SimpleTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.ConfigList_SimpleTableAdapter + Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel + Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox + Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_ConfigurationsByCal.vb b/BSMyLoadersLog/Viewing/frmView_List_ConfigurationsByCal.vb index ce0ff8c..985da71 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_ConfigurationsByCal.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_ConfigurationsByCal.vb @@ -1,69 +1,144 @@ -Imports BSMyLoadersLog.LoadersClass -Public Class frmView_List_ConfigurationsByCal - Public CALID As Long - Public Sub LoadData() - ConfigListSimpleBindingSource.ResetBindings(True) - Dim SelectedView As String = ToolStripComboBox1.SelectedItem.ToString - Select Case UCase(SelectedView) - Case UCase("All") - Me.ConfigList_SimpleTableAdapter.FillBy_Caliber(Me.MLLDataSet.ConfigList_Simple, CALID) - Case UCase("Active Only") - Me.ConfigList_SimpleTableAdapter.FillBy_Active(Me.MLLDataSet.ConfigList_Simple, CALID) - Case UCase("Inactive Only") - Me.ConfigList_SimpleTableAdapter.FillBy_Inactive(Me.MLLDataSet.ConfigList_Simple, CALID) - Case UCase("All Favorites") - Me.ConfigList_SimpleTableAdapter.FillBy_Fav(Me.MLLDataSet.ConfigList_Simple, CALID) - Case UCase("Personal Loads") - Me.ConfigList_SimpleTableAdapter.FillBy_Personal(Me.MLLDataSet.ConfigList_Simple, CALID) - Case UCase("Reffered Loads") - Me.ConfigList_SimpleTableAdapter.FillBy_NonPersonal(Me.MLLDataSet.ConfigList_Simple, CALID) - Case Else - Me.ConfigList_SimpleTableAdapter.FillBy_Caliber(Me.MLLDataSet.ConfigList_Simple, CALID) - End Select - lstConfigSheets.Refresh() - End Sub - Private Sub frmView_List_ConfigurationsByCal_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - If CALID = 0 Then - Dim sMsg As String = "Please Select a Caliber from the Side Caliber List!" - MsgBox(sMsg) - Me.Close() - Else - lstConfigSheets.Text = "All" +'Imports BSMyLoadersLog.LoadersClass +Imports BSMyLoadersLog.Adding +Imports BurnSoft.Applications.MLL.ConfigSheets + +Namespace Viewing + + ''' + ''' Class frmView_List_ConfigurationsByCal. + ''' Implements the + ''' + ''' + Public Class FrmViewListConfigurationsByCal + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' The calid + ''' + Public CaliberId As Long + ''' + ''' Loads the data. + ''' + Public Sub LoadData() + Try + ConfigListSimpleBindingSource.ResetBindings(True) + Dim selectedView As String = ToolStripComboBox1.SelectedItem.ToString + Select Case UCase(selectedView) + Case UCase("All") + ConfigList_SimpleTableAdapter.FillBy_Caliber(MLLDataSet.ConfigList_Simple, CaliberId) + Case UCase("Active Only") + ConfigList_SimpleTableAdapter.FillBy_Active(MLLDataSet.ConfigList_Simple, CaliberId) + Case UCase("Inactive Only") + ConfigList_SimpleTableAdapter.FillBy_Inactive(MLLDataSet.ConfigList_Simple, CaliberId) + Case UCase("All Favorites") + ConfigList_SimpleTableAdapter.FillBy_Fav(MLLDataSet.ConfigList_Simple, CaliberId) + Case UCase("Personal Loads") + ConfigList_SimpleTableAdapter.FillBy_Personal(MLLDataSet.ConfigList_Simple, CaliberId) + Case UCase("Reffered Loads") + ConfigList_SimpleTableAdapter.FillBy_NonPersonal(MLLDataSet.ConfigList_Simple, CaliberId) + Case Else + ConfigList_SimpleTableAdapter.FillBy_Caliber(MLLDataSet.ConfigList_Simple, CaliberId) + End Select + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + lstConfigSheets.Refresh() + End Sub + ''' + ''' Handles the Load event of the frmView_List_ConfigurationsByCal control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmView_List_ConfigurationsByCal_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Try + If CaliberId = 0 Then + Dim sMsg As String = "Please Select a Caliber from the Side Caliber List!" + MsgBox(sMsg) + Close() + Else + lstConfigSheets.Text = $"All" + Call LoadData() + End If + Catch ex As Exception + Call LogError(Name, "frmView_List_ConfigurationsByCal_Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the DoubleClick event of the lstConfigSheets control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub lstConfigSheets_DoubleClick(ByVal sender As Object, ByVal e As EventArgs) Handles lstConfigSheets.DoubleClick + Try + Dim lngConfigId As Long = lstConfigSheets.SelectedValue + Dim frmNew As New FrmViewConfigurationSheet + frmNew.ConfigId = lngConfigId + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "lstConfigSheets_DoubleClick", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton1.Click + Try + FrmConfigAddWizard.MdiParent = MdiParent + FrmConfigAddWizard.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton1_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton2.Click + Try + Dim lngConfigId As Long = lstConfigSheets.SelectedValue + 'Dim Obj As New BSDatabase + 'Dim ObjG As New GlobalFunctions + 'Dim strName As String = ObjG.GetName("SELECT * from Config_List_Name where ID=" & lngConfigId, "ConfigName") + Dim strName As String = ConfigListDataName.GetName(DatabasePath, lngConfigId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + 'Dim SQL As String = "DELETE from Config_List_Powder_Data_NSG where CLNID=" & lngConfigId + If strAns = vbYes Then + If Not ConfigListDataName.Delete(DatabasePath, lngConfigId, _errOut) Then Throw New Exception(_errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + 'Obj.ConnExec(SQL) + 'SQL = "DELETE from Config_List_Data_NSG where CLNID=" & lngConfigId + 'Obj.ConnExec(SQL) + 'SQL = "DELETE from Config_List_Name where ID=" & lngConfigId + 'Obj.ConnExec(SQL) + Call LoadData() + Call MdiParentMain.RefreshConfigData() + End If + Catch ex As Exception + Call LogError(Name, "ToolStripButton2_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the SelectedIndexChanged event of the ToolStripComboBox1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged Call LoadData() - End If - End Sub - Private Sub lstConfigSheets_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstConfigSheets.DoubleClick - Dim lngConfigID As Long = lstConfigSheets.SelectedValue - Dim frmNew As New frmView_Configuration_Sheet - frmNew.ConfigID = lngConfigID - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - End Sub - Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click - frmConfig_Add_Wizard.MdiParent = Me.MdiParent - frmConfig_Add_Wizard.Show() - End Sub - Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click - Dim lngConfigID As Long = lstConfigSheets.SelectedValue - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strName As String = ObjG.GetName("SELECT * from Config_List_Name where ID=" & lngConfigID, "ConfigName") - Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim SQL As String = "DELETE from Config_List_Powder_Data_NSG where CLNID=" & lngConfigID - If strAns = vbYes Then - Obj.ConnExec(SQL) - SQL = "DELETE from Config_List_Data_NSG where CLNID=" & lngConfigID - Obj.ConnExec(SQL) - SQL = "DELETE from Config_List_Name where ID=" & lngConfigID - Obj.ConnExec(SQL) + End Sub + ''' + ''' Handles the Click event of the ToolStripButton3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click Call LoadData() - Call MDIParentMain.RefreshConfigData() - End If - End Sub - Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged - Call LoadData() - End Sub - Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click - Call LoadData() - End Sub -End Class \ No newline at end of file + End Sub + End Class +End Namespace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_ConfigurationsByCal_SG.Designer.vb b/BSMyLoadersLog/Viewing/frmView_List_ConfigurationsByCal_SG.Designer.vb index ad7473b..9d6fb9c 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_ConfigurationsByCal_SG.Designer.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_ConfigurationsByCal_SG.Designer.vb @@ -1,155 +1,157 @@ - _ -Partial Class frmView_List_ConfigurationsByCal_SG - Inherits System.Windows.Forms.Form +Namespace Viewing + _ + Partial Class FrmViewListConfigurationsByCalSg + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmView_List_ConfigurationsByCal_SG)) - Me.lstConfigSheets = New System.Windows.Forms.ListBox - Me.ToolStrip1 = New System.Windows.Forms.ToolStrip - Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton - Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel - Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox - Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.ConfigListSimpleSGBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.ConfigList_Simple_SGTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.ConfigList_Simple_SGTableAdapter - Me.ToolStrip1.SuspendLayout() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.ConfigListSimpleSGBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'lstConfigSheets - ' - Me.lstConfigSheets.DataSource = Me.ConfigListSimpleSGBindingSource - Me.lstConfigSheets.DisplayMember = "ConfigName" - Me.lstConfigSheets.FormattingEnabled = True - Me.lstConfigSheets.Location = New System.Drawing.Point(0, 28) - Me.lstConfigSheets.Name = "lstConfigSheets" - Me.lstConfigSheets.Size = New System.Drawing.Size(254, 290) - Me.lstConfigSheets.TabIndex = 0 - Me.lstConfigSheets.ValueMember = "ID" - ' - 'ToolStrip1 - ' - Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripLabel1, Me.ToolStripComboBox1, Me.ToolStripButton3}) - Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) - Me.ToolStrip1.Name = "ToolStrip1" - Me.ToolStrip1.Size = New System.Drawing.Size(256, 25) - Me.ToolStrip1.TabIndex = 1 - Me.ToolStrip1.Text = "ToolStrip1" - ' - 'ToolStripButton1 - ' - Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) - Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton1.Name = "ToolStripButton1" - Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton1.Text = "Add a Configuration to the List" - ' - 'ToolStripButton2 - ' - Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) - Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton2.Name = "ToolStripButton2" - Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton2.Text = "Delete One of the Configurations Selected Below" - ' - 'ToolStripLabel1 - ' - Me.ToolStripLabel1.Name = "ToolStripLabel1" - Me.ToolStripLabel1.Size = New System.Drawing.Size(46, 22) - Me.ToolStripLabel1.Text = "Sort By:" - ' - 'ToolStripComboBox1 - ' - Me.ToolStripComboBox1.Items.AddRange(New Object() {"All", "Active Only", "Inactive Only", "All Favorites", "Personal Loads", "Reffered Loads"}) - Me.ToolStripComboBox1.Name = "ToolStripComboBox1" - Me.ToolStripComboBox1.Size = New System.Drawing.Size(121, 25) - Me.ToolStripComboBox1.Text = "All" - ' - 'ToolStripButton3 - ' - Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) - Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton3.Name = "ToolStripButton3" - Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton3.Text = "Refresh" - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'ConfigListSimpleSGBindingSource - ' - Me.ConfigListSimpleSGBindingSource.DataMember = "ConfigList_Simple_SG" - Me.ConfigListSimpleSGBindingSource.DataSource = Me.MLLDataSet - ' - 'ConfigList_Simple_SGTableAdapter - ' - Me.ConfigList_Simple_SGTableAdapter.ClearBeforeFill = True - ' - 'frmView_List_ConfigurationsByCal_SG - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(256, 322) - Me.Controls.Add(Me.ToolStrip1) - Me.Controls.Add(Me.lstConfigSheets) - Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow - Me.HelpProvider1.SetHelpKeyword(Me, "Accessing Configurations") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Accessing Configurations") - Me.Name = "frmView_List_ConfigurationsByCal_SG" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Configuration Sheets" - Me.ToolStrip1.ResumeLayout(False) - Me.ToolStrip1.PerformLayout() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.ConfigListSimpleSGBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmViewListConfigurationsByCalSg)) + Me.lstConfigSheets = New System.Windows.Forms.ListBox + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton + Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel + Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox + Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.ConfigListSimpleSGBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.ConfigList_Simple_SGTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.ConfigList_Simple_SGTableAdapter + Me.ToolStrip1.SuspendLayout() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ConfigListSimpleSGBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'lstConfigSheets + ' + Me.lstConfigSheets.DataSource = Me.ConfigListSimpleSGBindingSource + Me.lstConfigSheets.DisplayMember = "ConfigName" + Me.lstConfigSheets.FormattingEnabled = True + Me.lstConfigSheets.Location = New System.Drawing.Point(0, 28) + Me.lstConfigSheets.Name = "lstConfigSheets" + Me.lstConfigSheets.Size = New System.Drawing.Size(254, 290) + Me.lstConfigSheets.TabIndex = 0 + Me.lstConfigSheets.ValueMember = "ID" + ' + 'ToolStrip1 + ' + Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripLabel1, Me.ToolStripComboBox1, Me.ToolStripButton3}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(256, 25) + Me.ToolStrip1.TabIndex = 1 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton1.Text = "Add a Configuration to the List" + ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton2.Text = "Delete One of the Configurations Selected Below" + ' + 'ToolStripLabel1 + ' + Me.ToolStripLabel1.Name = "ToolStripLabel1" + Me.ToolStripLabel1.Size = New System.Drawing.Size(46, 22) + Me.ToolStripLabel1.Text = "Sort By:" + ' + 'ToolStripComboBox1 + ' + Me.ToolStripComboBox1.Items.AddRange(New Object() {"All", "Active Only", "Inactive Only", "All Favorites", "Personal Loads", "Reffered Loads"}) + Me.ToolStripComboBox1.Name = "ToolStripComboBox1" + Me.ToolStripComboBox1.Size = New System.Drawing.Size(121, 25) + Me.ToolStripComboBox1.Text = "All" + ' + 'ToolStripButton3 + ' + Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) + Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton3.Name = "ToolStripButton3" + Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton3.Text = "Refresh" + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'ConfigListSimpleSGBindingSource + ' + Me.ConfigListSimpleSGBindingSource.DataMember = "ConfigList_Simple_SG" + Me.ConfigListSimpleSGBindingSource.DataSource = Me.MLLDataSet + ' + 'ConfigList_Simple_SGTableAdapter + ' + Me.ConfigList_Simple_SGTableAdapter.ClearBeforeFill = True + ' + 'frmView_List_ConfigurationsByCal_SG + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(256, 322) + Me.Controls.Add(Me.ToolStrip1) + Me.Controls.Add(Me.lstConfigSheets) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.HelpProvider1.SetHelpKeyword(Me, "Accessing Configurations") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "Accessing Configurations") + Me.Name = "FrmViewListConfigurationsByCalSg" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Configuration Sheets" + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ConfigListSimpleSGBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents lstConfigSheets As System.Windows.Forms.ListBox - Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip - Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider - Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel - Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox - Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents ConfigListSimpleSGBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents ConfigList_Simple_SGTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.ConfigList_Simple_SGTableAdapter -End Class + End Sub + Friend WithEvents lstConfigSheets As System.Windows.Forms.ListBox + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel + Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox + Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents ConfigListSimpleSGBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents ConfigList_Simple_SGTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.ConfigList_Simple_SGTableAdapter + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_ConfigurationsByCal_SG.vb b/BSMyLoadersLog/Viewing/frmView_List_ConfigurationsByCal_SG.vb index c89de17..f0192e8 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_ConfigurationsByCal_SG.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_ConfigurationsByCal_SG.vb @@ -1,70 +1,144 @@ -Imports BSMyLoadersLog.LoadersClass -Public Class frmView_List_ConfigurationsByCal_SG - Public CALID As Long - Public Sub LoadData() - ConfigListSimpleSGBindingSource.ResetBindings(True) - Dim SelectedView As String = ToolStripComboBox1.SelectedItem.ToString - Select Case UCase(SelectedView) - Case UCase("All") - Me.ConfigList_Simple_SGTableAdapter.FillBy_Caliber(Me.MLLDataSet.ConfigList_Simple_SG, CALID) - Case UCase("Active Only") - Me.ConfigList_Simple_SGTableAdapter.FillBy_Active(Me.MLLDataSet.ConfigList_Simple_SG, CALID) - Case UCase("Inactive Only") - Me.ConfigList_Simple_SGTableAdapter.FillBy_Inactive(Me.MLLDataSet.ConfigList_Simple_SG, CALID) - Case UCase("All Favorites") - Me.ConfigList_Simple_SGTableAdapter.FillBy_Fav(Me.MLLDataSet.ConfigList_Simple_SG, CALID) - Case UCase("Personal Loads") - Me.ConfigList_Simple_SGTableAdapter.FillBy_Personal(Me.MLLDataSet.ConfigList_Simple_SG, CALID) - Case UCase("Reffered Loads") - Me.ConfigList_Simple_SGTableAdapter.FillBy_NonPersonal(Me.MLLDataSet.ConfigList_Simple_SG, CALID) - Case Else - Me.ConfigList_Simple_SGTableAdapter.FillBy_Caliber(Me.MLLDataSet.ConfigList_Simple_SG, CALID) - 'Me.ConfigList_Simple_SGTableAdapter.Fill(Me.MLLDataSet.ConfigList_Simple_SG) - End Select - lstConfigSheets.Refresh() - End Sub - Private Sub frmView_List_ConfigurationsByCal_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - If CALID = 0 Then - Dim sMsg As String = "Please Select a Caliber from the Side Caliber List!" - MsgBox(sMsg) - Me.Close() - Else - lstConfigSheets.Text = "All" +'Imports BSMyLoadersLog.LoadersClass +Imports BSMyLoadersLog.Adding +Imports BurnSoft.Applications.MLL.ConfigSheets + +Namespace Viewing + ''' + ''' Class FrmViewListConfigurationsByCalSg. + ''' Implements the + ''' + ''' + Public Class FrmViewListConfigurationsByCalSg + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' The calid + ''' + Public CaliberId As Long + ''' + ''' Loads the data. + ''' + Public Sub LoadData() + Try + ConfigListSimpleSGBindingSource.ResetBindings(True) + Dim selectedView As String = ToolStripComboBox1.SelectedItem.ToString + Select Case UCase(selectedView) + Case UCase("All") + ConfigList_Simple_SGTableAdapter.FillBy_Caliber(MLLDataSet.ConfigList_Simple_SG, CaliberId) + Case UCase("Active Only") + ConfigList_Simple_SGTableAdapter.FillBy_Active(MLLDataSet.ConfigList_Simple_SG, CaliberId) + Case UCase("Inactive Only") + ConfigList_Simple_SGTableAdapter.FillBy_Inactive(MLLDataSet.ConfigList_Simple_SG, CaliberId) + Case UCase("All Favorites") + ConfigList_Simple_SGTableAdapter.FillBy_Fav(MLLDataSet.ConfigList_Simple_SG, CaliberId) + Case UCase("Personal Loads") + ConfigList_Simple_SGTableAdapter.FillBy_Personal(MLLDataSet.ConfigList_Simple_SG, CaliberId) + Case UCase("Reffered Loads") + ConfigList_Simple_SGTableAdapter.FillBy_NonPersonal(MLLDataSet.ConfigList_Simple_SG, CaliberId) + Case Else + ConfigList_Simple_SGTableAdapter.FillBy_Caliber(MLLDataSet.ConfigList_Simple_SG, CaliberId) + 'ConfigList_Simple_SGTableAdapter.Fill(MLLDataSet.ConfigList_Simple_SG) + End Select + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + lstConfigSheets.Refresh() + End Sub + ''' + ''' Handles the Load event of the frmView_List_ConfigurationsByCal control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmView_List_ConfigurationsByCal_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Try + If CaliberId = 0 Then + Dim sMsg As String = "Please Select a Caliber from the Side Caliber List!" + MsgBox(sMsg) + Close() + Else + lstConfigSheets.Text = $"All" + Call LoadData() + End If + Catch ex As Exception + Call LogError(Name, "frmView_List_ConfigurationsByCal_Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the DoubleClick event of the lstConfigSheets control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub lstConfigSheets_DoubleClick(ByVal sender As Object, ByVal e As EventArgs) Handles lstConfigSheets.DoubleClick + Try + Dim lngConfigId As Long = lstConfigSheets.SelectedValue + Dim frmNew As New frmView_Configuration_Shotgun_Sheet + frmNew.ConfigID = lngConfigId + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "lstConfigSheets_DoubleClick", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton1.Click + Try + FrmConfigAddWizard.MdiParent = MdiParent + FrmConfigAddWizard.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton1_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton2.Click + Try + Dim lngConfigId As Long = lstConfigSheets.SelectedValue + 'Dim obj As New BSDatabase + 'Dim objG As New GlobalFunctions + 'Dim strName As String = objG.GetName("SELECT * from Config_List_Name where ID=" & lngConfigId, "ConfigName") + Dim strName As String = ConfigListDataName.GetName(DatabasePath, lngConfigId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + 'Dim SQL As String = "DELETE from Config_List_Powder_Data_SG where CLNID=" & lngConfigId + If strAns = vbYes Then + If Not ConfigListDataName.Delete(DatabasePath, lngConfigId, _errOut) Then Throw New Exception(_errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + 'obj.ConnExec(SQL) + 'SQL = "DELETE from Config_List_Data_SG where CLNID=" & lngConfigId + 'obj.ConnExec(SQL) + 'SQL = "DELETE from Config_List_Name where ID=" & lngConfigId + 'obj.ConnExec(SQL) + Call LoadData() + Call MdiParentMain.RefreshConfigData() + End If + Catch ex As Exception + Call LogError(Name, "ToolStripButton2_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the SelectedIndexChanged event of the ToolStripComboBox1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged Call LoadData() - End If - End Sub - Private Sub lstConfigSheets_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstConfigSheets.DoubleClick - Dim lngConfigID As Long = lstConfigSheets.SelectedValue - Dim frmNew As New frmView_Configuration_Shotgun_Sheet - frmNew.ConfigID = lngConfigID - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - End Sub - Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click - frmConfig_Add_Wizard.MdiParent = Me.MdiParent - frmConfig_Add_Wizard.Show() - End Sub - Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click - Dim lngConfigID As Long = lstConfigSheets.SelectedValue - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strName As String = ObjG.GetName("SELECT * from Config_List_Name where ID=" & lngConfigID, "ConfigName") - Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim SQL As String = "DELETE from Config_List_Powder_Data_SG where CLNID=" & lngConfigID - If strAns = vbYes Then - Obj.ConnExec(SQL) - SQL = "DELETE from Config_List_Data_SG where CLNID=" & lngConfigID - Obj.ConnExec(SQL) - SQL = "DELETE from Config_List_Name where ID=" & lngConfigID - Obj.ConnExec(SQL) + End Sub + ''' + ''' Handles the Click event of the ToolStripButton3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click Call LoadData() - Call MDIParentMain.RefreshConfigData() - End If - End Sub - Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged - Call LoadData() - End Sub - Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click - Call LoadData() - End Sub -End Class \ No newline at end of file + End Sub + End Class +End Namespace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_Equipment.Designer.vb b/BSMyLoadersLog/Viewing/frmView_List_Equipment.Designer.vb index 107c27c..0eea871 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_Equipment.Designer.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_Equipment.Designer.vb @@ -1,269 +1,271 @@ - _ -Partial Class frmView_List_Equipment - Inherits System.Windows.Forms.Form +Namespace Viewing + _ + Partial Class FrmViewListEquipment + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmView_List_Equipment)) - Me.ToolStrip1 = New System.Windows.Forms.ToolStrip - Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton4 = New System.Windows.Forms.ToolStripButton - Me.tslCost = New System.Windows.Forms.ToolStripLabel - Me.DataGridView1 = New System.Windows.Forms.DataGridView - Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.AddToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.GeneralEquipmentBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.General_EquipmentTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.General_EquipmentTableAdapter - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.ManufacturerDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Me.NameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.UseDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.CostDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.NotesDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.ToolStrip1.SuspendLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.ContextMenuStrip1.SuspendLayout() - CType(Me.GeneralEquipmentBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'ToolStrip1 - ' - Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripButton3, Me.ToolStripButton4, Me.tslCost}) - Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) - Me.ToolStrip1.Name = "ToolStrip1" - Me.ToolStrip1.Size = New System.Drawing.Size(645, 25) - Me.ToolStrip1.TabIndex = 0 - Me.ToolStrip1.Text = "ToolStrip1" - ' - 'ToolStripButton1 - ' - Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) - Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton1.Name = "ToolStripButton1" - Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton1.Text = "Add to Equipment List" - Me.ToolStripButton1.ToolTipText = "Add Equipmen" - ' - 'ToolStripButton2 - ' - Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) - Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton2.Name = "ToolStripButton2" - Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton2.Text = "Delete Selected Equipment" - ' - 'ToolStripButton3 - ' - Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) - Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton3.Name = "ToolStripButton3" - Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton3.Text = "Refresh Collection List" - ' - 'ToolStripButton4 - ' - Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton4.Image = CType(resources.GetObject("ToolStripButton4.Image"), System.Drawing.Image) - Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton4.Name = "ToolStripButton4" - Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton4.Text = "View Report" - ' - 'tslCost - ' - Me.tslCost.Name = "tslCost" - Me.tslCost.Size = New System.Drawing.Size(33, 22) - Me.tslCost.Text = "Cost:" - ' - 'DataGridView1 - ' - Me.DataGridView1.AllowUserToAddRows = False - Me.DataGridView1.AllowUserToDeleteRows = False - Me.DataGridView1.AutoGenerateColumns = False - Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.ManufacturerDataGridViewTextBoxColumn, Me.NameDataGridViewTextBoxColumn, Me.UseDataGridViewTextBoxColumn, Me.CostDataGridViewTextBoxColumn, Me.NotesDataGridViewTextBoxColumn}) - Me.DataGridView1.ContextMenuStrip = Me.ContextMenuStrip1 - Me.DataGridView1.DataSource = Me.GeneralEquipmentBindingSource - Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill - Me.DataGridView1.Location = New System.Drawing.Point(0, 25) - Me.DataGridView1.MultiSelect = False - Me.DataGridView1.Name = "DataGridView1" - Me.DataGridView1.ReadOnly = True - Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DataGridView1.Size = New System.Drawing.Size(645, 272) - Me.DataGridView1.TabIndex = 1 - ' - 'ContextMenuStrip1 - ' - Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EditToolStripMenuItem, Me.AddToolStripMenuItem, Me.DeleteToolStripMenuItem}) - Me.ContextMenuStrip1.Name = "ContextMenuStrip1" - Me.ContextMenuStrip1.Size = New System.Drawing.Size(117, 70) - ' - 'EditToolStripMenuItem - ' - Me.EditToolStripMenuItem.Image = CType(resources.GetObject("EditToolStripMenuItem.Image"), System.Drawing.Image) - Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" - Me.EditToolStripMenuItem.Size = New System.Drawing.Size(116, 22) - Me.EditToolStripMenuItem.Text = "&Edit" - ' - 'AddToolStripMenuItem - ' - Me.AddToolStripMenuItem.Image = CType(resources.GetObject("AddToolStripMenuItem.Image"), System.Drawing.Image) - Me.AddToolStripMenuItem.Name = "AddToolStripMenuItem" - Me.AddToolStripMenuItem.Size = New System.Drawing.Size(116, 22) - Me.AddToolStripMenuItem.Text = "&Add" - ' - 'DeleteToolStripMenuItem - ' - Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) - Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" - Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(116, 22) - Me.DeleteToolStripMenuItem.Text = "&Delete" - ' - 'GeneralEquipmentBindingSource - ' - Me.GeneralEquipmentBindingSource.DataMember = "General_Equipment" - Me.GeneralEquipmentBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'General_EquipmentTableAdapter - ' - Me.General_EquipmentTableAdapter.ClearBeforeFill = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'IDDataGridViewTextBoxColumn - ' - Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" - Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" - Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" - Me.IDDataGridViewTextBoxColumn.ReadOnly = True - Me.IDDataGridViewTextBoxColumn.Visible = False - ' - 'ManufacturerDataGridViewTextBoxColumn - ' - Me.ManufacturerDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.ManufacturerDataGridViewTextBoxColumn.DataPropertyName = "Manufacturer" - Me.ManufacturerDataGridViewTextBoxColumn.HeaderText = "Manufacturer" - Me.ManufacturerDataGridViewTextBoxColumn.Name = "ManufacturerDataGridViewTextBoxColumn" - Me.ManufacturerDataGridViewTextBoxColumn.ReadOnly = True - Me.ManufacturerDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.ManufacturerDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic - Me.ManufacturerDataGridViewTextBoxColumn.Width = 111 - ' - 'NameDataGridViewTextBoxColumn - ' - Me.NameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.NameDataGridViewTextBoxColumn.DataPropertyName = "Name" - Me.NameDataGridViewTextBoxColumn.HeaderText = "Name" - Me.NameDataGridViewTextBoxColumn.Name = "NameDataGridViewTextBoxColumn" - Me.NameDataGridViewTextBoxColumn.ReadOnly = True - Me.NameDataGridViewTextBoxColumn.Width = 60 - ' - 'UseDataGridViewTextBoxColumn - ' - Me.UseDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.UseDataGridViewTextBoxColumn.DataPropertyName = "Use" - Me.UseDataGridViewTextBoxColumn.HeaderText = "Use" - Me.UseDataGridViewTextBoxColumn.Name = "UseDataGridViewTextBoxColumn" - Me.UseDataGridViewTextBoxColumn.ReadOnly = True - Me.UseDataGridViewTextBoxColumn.Width = 51 - ' - 'CostDataGridViewTextBoxColumn - ' - Me.CostDataGridViewTextBoxColumn.DataPropertyName = "Cost" - Me.CostDataGridViewTextBoxColumn.HeaderText = "Cost" - Me.CostDataGridViewTextBoxColumn.Name = "CostDataGridViewTextBoxColumn" - Me.CostDataGridViewTextBoxColumn.ReadOnly = True - ' - 'NotesDataGridViewTextBoxColumn - ' - Me.NotesDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.NotesDataGridViewTextBoxColumn.DataPropertyName = "Notes" - Me.NotesDataGridViewTextBoxColumn.HeaderText = "Notes" - Me.NotesDataGridViewTextBoxColumn.Name = "NotesDataGridViewTextBoxColumn" - Me.NotesDataGridViewTextBoxColumn.ReadOnly = True - Me.NotesDataGridViewTextBoxColumn.Width = 60 - ' - 'frmView_List_Equipment - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(645, 297) - Me.Controls.Add(Me.DataGridView1) - Me.Controls.Add(Me.ToolStrip1) - Me.HelpProvider1.SetHelpKeyword(Me, "View Equipment List") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "View Equipment List") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmView_List_Equipment" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Reloading Equipment List" - Me.ToolStrip1.ResumeLayout(False) - Me.ToolStrip1.PerformLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() - Me.ContextMenuStrip1.ResumeLayout(False) - CType(Me.GeneralEquipmentBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmViewListEquipment)) + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton4 = New System.Windows.Forms.ToolStripButton + Me.tslCost = New System.Windows.Forms.ToolStripLabel + Me.DataGridView1 = New System.Windows.Forms.DataGridView + Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.AddToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.GeneralEquipmentBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.General_EquipmentTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.General_EquipmentTableAdapter + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.ManufacturerDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Me.NameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.UseDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.CostDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.NotesDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.ToolStrip1.SuspendLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ContextMenuStrip1.SuspendLayout() + CType(Me.GeneralEquipmentBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'ToolStrip1 + ' + Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripButton3, Me.ToolStripButton4, Me.tslCost}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(645, 25) + Me.ToolStrip1.TabIndex = 0 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton1.Text = "Add to Equipment List" + Me.ToolStripButton1.ToolTipText = "Add Equipmen" + ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton2.Text = "Delete Selected Equipment" + ' + 'ToolStripButton3 + ' + Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) + Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton3.Name = "ToolStripButton3" + Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton3.Text = "Refresh Collection List" + ' + 'ToolStripButton4 + ' + Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton4.Image = CType(resources.GetObject("ToolStripButton4.Image"), System.Drawing.Image) + Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton4.Name = "ToolStripButton4" + Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton4.Text = "View Report" + ' + 'tslCost + ' + Me.tslCost.Name = "tslCost" + Me.tslCost.Size = New System.Drawing.Size(33, 22) + Me.tslCost.Text = "Cost:" + ' + 'DataGridView1 + ' + Me.DataGridView1.AllowUserToAddRows = False + Me.DataGridView1.AllowUserToDeleteRows = False + Me.DataGridView1.AutoGenerateColumns = False + Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.ManufacturerDataGridViewTextBoxColumn, Me.NameDataGridViewTextBoxColumn, Me.UseDataGridViewTextBoxColumn, Me.CostDataGridViewTextBoxColumn, Me.NotesDataGridViewTextBoxColumn}) + Me.DataGridView1.ContextMenuStrip = Me.ContextMenuStrip1 + Me.DataGridView1.DataSource = Me.GeneralEquipmentBindingSource + Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill + Me.DataGridView1.Location = New System.Drawing.Point(0, 25) + Me.DataGridView1.MultiSelect = False + Me.DataGridView1.Name = "DataGridView1" + Me.DataGridView1.ReadOnly = True + Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DataGridView1.Size = New System.Drawing.Size(645, 272) + Me.DataGridView1.TabIndex = 1 + ' + 'ContextMenuStrip1 + ' + Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EditToolStripMenuItem, Me.AddToolStripMenuItem, Me.DeleteToolStripMenuItem}) + Me.ContextMenuStrip1.Name = "ContextMenuStrip1" + Me.ContextMenuStrip1.Size = New System.Drawing.Size(117, 70) + ' + 'EditToolStripMenuItem + ' + Me.EditToolStripMenuItem.Image = CType(resources.GetObject("EditToolStripMenuItem.Image"), System.Drawing.Image) + Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" + Me.EditToolStripMenuItem.Size = New System.Drawing.Size(116, 22) + Me.EditToolStripMenuItem.Text = "&Edit" + ' + 'AddToolStripMenuItem + ' + Me.AddToolStripMenuItem.Image = CType(resources.GetObject("AddToolStripMenuItem.Image"), System.Drawing.Image) + Me.AddToolStripMenuItem.Name = "AddToolStripMenuItem" + Me.AddToolStripMenuItem.Size = New System.Drawing.Size(116, 22) + Me.AddToolStripMenuItem.Text = "&Add" + ' + 'DeleteToolStripMenuItem + ' + Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) + Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" + Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(116, 22) + Me.DeleteToolStripMenuItem.Text = "&Delete" + ' + 'GeneralEquipmentBindingSource + ' + Me.GeneralEquipmentBindingSource.DataMember = "General_Equipment" + Me.GeneralEquipmentBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'General_EquipmentTableAdapter + ' + Me.General_EquipmentTableAdapter.ClearBeforeFill = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'IDDataGridViewTextBoxColumn + ' + Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" + Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" + Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" + Me.IDDataGridViewTextBoxColumn.ReadOnly = True + Me.IDDataGridViewTextBoxColumn.Visible = False + ' + 'ManufacturerDataGridViewTextBoxColumn + ' + Me.ManufacturerDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.ManufacturerDataGridViewTextBoxColumn.DataPropertyName = "Manufacturer" + Me.ManufacturerDataGridViewTextBoxColumn.HeaderText = "Manufacturer" + Me.ManufacturerDataGridViewTextBoxColumn.Name = "ManufacturerDataGridViewTextBoxColumn" + Me.ManufacturerDataGridViewTextBoxColumn.ReadOnly = True + Me.ManufacturerDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.ManufacturerDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic + Me.ManufacturerDataGridViewTextBoxColumn.Width = 111 + ' + 'NameDataGridViewTextBoxColumn + ' + Me.NameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.NameDataGridViewTextBoxColumn.DataPropertyName = "Name" + Me.NameDataGridViewTextBoxColumn.HeaderText = "Name" + Me.NameDataGridViewTextBoxColumn.Name = "NameDataGridViewTextBoxColumn" + Me.NameDataGridViewTextBoxColumn.ReadOnly = True + Me.NameDataGridViewTextBoxColumn.Width = 60 + ' + 'UseDataGridViewTextBoxColumn + ' + Me.UseDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.UseDataGridViewTextBoxColumn.DataPropertyName = "Use" + Me.UseDataGridViewTextBoxColumn.HeaderText = "Use" + Me.UseDataGridViewTextBoxColumn.Name = "UseDataGridViewTextBoxColumn" + Me.UseDataGridViewTextBoxColumn.ReadOnly = True + Me.UseDataGridViewTextBoxColumn.Width = 51 + ' + 'CostDataGridViewTextBoxColumn + ' + Me.CostDataGridViewTextBoxColumn.DataPropertyName = "Cost" + Me.CostDataGridViewTextBoxColumn.HeaderText = "Cost" + Me.CostDataGridViewTextBoxColumn.Name = "CostDataGridViewTextBoxColumn" + Me.CostDataGridViewTextBoxColumn.ReadOnly = True + ' + 'NotesDataGridViewTextBoxColumn + ' + Me.NotesDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.NotesDataGridViewTextBoxColumn.DataPropertyName = "Notes" + Me.NotesDataGridViewTextBoxColumn.HeaderText = "Notes" + Me.NotesDataGridViewTextBoxColumn.Name = "NotesDataGridViewTextBoxColumn" + Me.NotesDataGridViewTextBoxColumn.ReadOnly = True + Me.NotesDataGridViewTextBoxColumn.Width = 60 + ' + 'frmView_List_Equipment + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(645, 297) + Me.Controls.Add(Me.DataGridView1) + Me.Controls.Add(Me.ToolStrip1) + Me.HelpProvider1.SetHelpKeyword(Me, "View Equipment List") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "View Equipment List") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.Name = "FrmViewListEquipment" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Reloading Equipment List" + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ContextMenuStrip1.ResumeLayout(False) + CType(Me.GeneralEquipmentBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip - Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents GeneralEquipmentBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents General_EquipmentTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.General_EquipmentTableAdapter - Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton - Friend WithEvents tslCost As System.Windows.Forms.ToolStripLabel - Friend WithEvents ContextMenuStrip1 As System.Windows.Forms.ContextMenuStrip - Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents AddToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents ToolStripButton4 As System.Windows.Forms.ToolStripButton - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider - Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents ManufacturerDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents NameDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents UseDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents CostDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents NotesDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn -End Class + End Sub + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents GeneralEquipmentBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents General_EquipmentTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.General_EquipmentTableAdapter + Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton + Friend WithEvents tslCost As System.Windows.Forms.ToolStripLabel + Friend WithEvents ContextMenuStrip1 As System.Windows.Forms.ContextMenuStrip + Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents AddToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents ToolStripButton4 As System.Windows.Forms.ToolStripButton + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents ManufacturerDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents NameDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents UseDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents CostDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents NotesDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_Equipment.vb b/BSMyLoadersLog/Viewing/frmView_List_Equipment.vb index a229f6f..f493ded 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_Equipment.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_Equipment.vb @@ -1,141 +1,185 @@ +Imports BSMyLoadersLog.Adding Imports BSMyLoadersLog.LoadersClass Imports BurnSoft.Applications.MLL.Global +Imports BurnSoft.Applications.MLL.Inventory -Public Class frmView_List_Equipment +Namespace Viewing ''' - ''' The error out + ''' Class FrmViewListEquipment. + ''' Implements the ''' - Dim errOut as String - ''' - ''' Handles the Resize event of the frmView_List_Equipment control. - ''' - ''' The source of the event. - ''' The instance containing the event data. - Private Sub frmView_List_Equipment_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize - If Me.Height <> 0 Then - Me.DataGridView1.Height = Me.Height - (65) - Me.DataGridView1.Width = Me.Width - 15 - End If - End Sub - ''' - ''' Loads the data. - ''' - Public Sub LoadData() - Me.General_EquipmentTableAdapter.Fill(Me.MLLDataSet.General_Equipment) - 'Dim Obj As New GlobalFunctions - tslCost.Text = "Current Total: " & GeneralFunctions.TotalCostEquipment(DatabasePath, errOut) - End Sub - ''' - ''' Handles the Load event of the frmView_List_Equipment control. - ''' - ''' The source of the event. - ''' The instance containing the event data. - Private Sub frmView_List_Equipment_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Try + ''' + Public Class FrmViewListEquipment + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' Handles the Resize event of the frmView_List_Equipment control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmView_List_Equipment_Resize(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Resize + Try + If Height <> 0 Then + DataGridView1.Height = Height - (65) + DataGridView1.Width = Width - 15 + End If + Catch ex As Exception + Call LogError(Name, "frmView_List_Equipment_Resize", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Loads the data. + ''' + Public Sub LoadData() + try + General_EquipmentTableAdapter.Fill(MLLDataSet.General_Equipment) + 'Dim Obj As New GlobalFunctions + tslCost.Text = $"Current Total: {GeneralFunctions.TotalCostEquipment(DatabasePath, _errOut)}" + if _errOut.Length > 0 Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmView_List_Equipment control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmView_List_Equipment_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Try + Call LoadData() + Catch ex As Exception + 'Dim ObjFS As New BSFileSystem + 'Dim sMessage As String = "frmView_List_Equipment.load" & "::" & Err.Number & "::" & ex.Message.ToString() + 'ObjFS.LogFile(MyLogFile, sMessage) + Call LogError(Name, "frmView_List_Equipment_Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton1.Click + try + frmAddEquipment.MdiParent = MdiParent + frmAddEquipment.Show() + Catch ex As Exception + Call LogError(Name, "", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Deletes the data. + ''' + Sub DeleteData() + Try + Dim itemId As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + 'Dim Obj As New BSDatabase + 'Dim ObjG As New GlobalFunctions + 'Dim strName As String = ObjG.GetName("SELECT * from General_Equipment where ID=" & itemId, "Name") + Dim strName As String = EquipmentInventory.GetName(DatabasePath, itemId, _errOut) + if _errOut.Length > 0 Then Throw New Exception(_errOut) + Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + 'Dim SQL As String = "DELETE from General_Equipment where ID=" & ItemID + 'If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() + If strAns = vbYes Then + If Not EquipmentInventory.Delete(DatabasePath, itemId, _errOut) Then Throw New Exception(_errOut) + Call LoadData() + End If + Catch ex As Exception + Call LogError(Name, "DeleteData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton2.Click + Try + Call DeleteData() + Catch ex As Exception + Call LogError(Name, "ToolStripButton2.Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click Call LoadData() - Catch ex As Exception - 'Dim ObjFS As New BSFileSystem - 'Dim sMessage As String = "frmView_List_Equipment.load" & "::" & Err.Number & "::" & ex.Message.ToString() - 'ObjFS.LogFile(MyLogFile, sMessage) - Call LogError(Name, "frmView_List_Equipment_Load", Err.Number, ex.Message.ToString) - End Try - End Sub - ''' - ''' Handles the Click event of the ToolStripButton1 control. - ''' - ''' The source of the event. - ''' The instance containing the event data. - Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click - frmAddEquipment.MdiParent = Me.MdiParent - frmAddEquipment.Show() - End Sub - ''' - ''' Deletes the data. - ''' - Sub DeleteData() - Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strName As String = ObjG.GetName("SELECT * from General_Equipment where ID=" & ItemID, "Name") - Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim SQL As String = "DELETE from General_Equipment where ID=" & ItemID - If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() - Catch ex As Exception - Call LogError(Me.Name, "DeleteData", Err.Number, ex.Message.ToString) - End Try - End Sub - ''' - ''' Handles the Click event of the ToolStripButton2 control. - ''' - ''' The source of the event. - ''' The instance containing the event data. - Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click - Try + End Sub + ''' + ''' Handles the Click event of the AddToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub AddToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AddToolStripMenuItem.Click + Try + frmAddEquipment.MdiParent = MdiParent + frmAddEquipment.FromView = True + frmAddEquipment.Show() + Catch ex As Exception + Call LogError(Name, "AddToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the DeleteToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DeleteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles DeleteToolStripMenuItem.Click Call DeleteData() - Catch ex As Exception - Call LogError(Me.Name, "ToolStripButton2.Click", Err.Number, ex.Message.ToString) - End Try - End Sub - ''' - ''' Handles the Click event of the ToolStripButton3 control. - ''' - ''' The source of the event. - ''' The instance containing the event data. - Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click - Call LoadData() - End Sub - ''' - ''' Handles the Click event of the AddToolStripMenuItem control. - ''' - ''' The source of the event. - ''' The instance containing the event data. - Private Sub AddToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToolStripMenuItem.Click - frmAddEquipment.MdiParent = Me.MdiParent - frmAddEquipment.FromView = True - frmAddEquipment.Show() - End Sub - ''' - ''' Handles the Click event of the DeleteToolStripMenuItem control. - ''' - ''' The source of the event. - ''' The instance containing the event data. - Private Sub DeleteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click - Call DeleteData() - End Sub - ''' - ''' Handles the Click event of the EditToolStripMenuItem control. - ''' - ''' The source of the event. - ''' The instance containing the event data. - Private Sub EditToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EditToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim frmNew As New frmEditEquipment - frmNew.MdiParent = Me.MdiParent - frmNew.EID = ItemID - frmNew.FromView = True - frmNew.Show() - End Sub - ''' - ''' Handles the Click event of the ToolStripButton4 control. - ''' - ''' The source of the event. - ''' The instance containing the event data. - Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click - Me.Cursor = Cursors.WaitCursor - frmReport_List_Equipment.MdiParent = Me.MdiParent - frmReport_List_Equipment.Show() - Me.Cursor = Cursors.Arrow - End Sub - ''' - ''' Handles the BindingContextChanged event of the DataGridView1 control. - ''' - ''' The source of the event. - ''' The instance containing the event data. - Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.BindingContextChanged - If DataGridView1.DataSource Is Nothing Then - Return - End If - DataGridView1.AutoResizeColumns() - End Sub -End Class \ No newline at end of file + End Sub + ''' + ''' Handles the Click event of the EditToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub EditToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EditToolStripMenuItem.Click + Try + Dim itemId As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim frmNew As New frmEditEquipment + frmNew.MdiParent = MdiParent + frmNew.EID = itemId + frmNew.FromView = True + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "EditToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton4 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton4.Click + Try + Cursor = Cursors.WaitCursor + frmReport_List_Equipment.MdiParent = MdiParent + frmReport_List_Equipment.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Call LogError(Name, "ToolStripButton4_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the BindingContextChanged event of the DataGridView1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DataGridView1.BindingContextChanged + Try + If DataGridView1.DataSource Is Nothing Then + Return + End If + DataGridView1.AutoResizeColumns() + Catch ex As Exception + Call LogError(Name, "DataGridView1_BindingContextChanged", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_Firearms.Designer.vb b/BSMyLoadersLog/Viewing/frmView_List_Firearms.Designer.vb index e2fe2fb..543893a 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_Firearms.Designer.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_Firearms.Designer.vb @@ -1,298 +1,300 @@ - _ -Partial Class frmView_List_Firearms - Inherits System.Windows.Forms.Form +Namespace Viewing + _ + Partial Class FrmViewListFirearms + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - MyBase.Dispose(disposing) - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + MyBase.Dispose(disposing) + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmView_List_Firearms)) - Me.DataGridView1 = New System.Windows.Forms.DataGridView - Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.AddToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.LoadersLogFirearmsBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.Loaders_Log_FirearmsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_FirearmsTableAdapter - Me.ToolStrip1 = New System.Windows.Forms.ToolStrip - Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton4 = New System.Windows.Forms.ToolStripButton - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.MGCIDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.FullNameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.ManuDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Me.ModelDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Me.GTypeDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Me.CalDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Me.BarrelDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.SerialNoDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.ContextMenuStrip1.SuspendLayout() - CType(Me.LoadersLogFirearmsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.ToolStrip1.SuspendLayout() - Me.SuspendLayout() - ' - 'DataGridView1 - ' - Me.DataGridView1.AllowUserToAddRows = False - Me.DataGridView1.AutoGenerateColumns = False - Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.MGCIDDataGridViewTextBoxColumn, Me.FullNameDataGridViewTextBoxColumn, Me.ManuDataGridViewTextBoxColumn, Me.ModelDataGridViewTextBoxColumn, Me.GTypeDataGridViewTextBoxColumn, Me.CalDataGridViewTextBoxColumn, Me.BarrelDataGridViewTextBoxColumn, Me.SerialNoDataGridViewTextBoxColumn}) - Me.DataGridView1.ContextMenuStrip = Me.ContextMenuStrip1 - Me.DataGridView1.DataSource = Me.LoadersLogFirearmsBindingSource - Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill - Me.DataGridView1.Location = New System.Drawing.Point(0, 25) - Me.DataGridView1.MultiSelect = False - Me.DataGridView1.Name = "DataGridView1" - Me.DataGridView1.ReadOnly = True - Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DataGridView1.Size = New System.Drawing.Size(807, 362) - Me.DataGridView1.TabIndex = 0 - ' - 'ContextMenuStrip1 - ' - Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EditToolStripMenuItem, Me.AddToolStripMenuItem, Me.DeleteToolStripMenuItem}) - Me.ContextMenuStrip1.Name = "ContextMenuStrip1" - Me.ContextMenuStrip1.Size = New System.Drawing.Size(117, 70) - ' - 'EditToolStripMenuItem - ' - Me.EditToolStripMenuItem.Image = CType(resources.GetObject("EditToolStripMenuItem.Image"), System.Drawing.Image) - Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" - Me.EditToolStripMenuItem.Size = New System.Drawing.Size(116, 22) - Me.EditToolStripMenuItem.Text = "&Edit" - ' - 'AddToolStripMenuItem - ' - Me.AddToolStripMenuItem.Image = CType(resources.GetObject("AddToolStripMenuItem.Image"), System.Drawing.Image) - Me.AddToolStripMenuItem.Name = "AddToolStripMenuItem" - Me.AddToolStripMenuItem.Size = New System.Drawing.Size(116, 22) - Me.AddToolStripMenuItem.Text = "&Add" - ' - 'DeleteToolStripMenuItem - ' - Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) - Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" - Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(116, 22) - Me.DeleteToolStripMenuItem.Text = "&Delete" - ' - 'LoadersLogFirearmsBindingSource - ' - Me.LoadersLogFirearmsBindingSource.DataMember = "Loaders_Log_Firearms" - Me.LoadersLogFirearmsBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'Loaders_Log_FirearmsTableAdapter - ' - Me.Loaders_Log_FirearmsTableAdapter.ClearBeforeFill = True - ' - 'ToolStrip1 - ' - Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripButton3, Me.ToolStripButton4}) - Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) - Me.ToolStrip1.Name = "ToolStrip1" - Me.ToolStrip1.Size = New System.Drawing.Size(807, 25) - Me.ToolStrip1.TabIndex = 1 - Me.ToolStrip1.Text = "ToolStrip1" - ' - 'ToolStripButton1 - ' - Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) - Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton1.Name = "ToolStripButton1" - Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton1.Text = "ToolStripButton1" - Me.ToolStripButton1.ToolTipText = "Add Firearm to Database" - ' - 'ToolStripButton2 - ' - Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) - Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton2.Name = "ToolStripButton2" - Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton2.Text = "ToolStripButton2" - Me.ToolStripButton2.ToolTipText = "Delete Selected Firearm" - ' - 'ToolStripButton3 - ' - Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) - Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton3.Name = "ToolStripButton3" - Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton3.Text = "ToolStripButton3" - Me.ToolStripButton3.ToolTipText = "Refresh Data Grid" - ' - 'ToolStripButton4 - ' - Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton4.Image = CType(resources.GetObject("ToolStripButton4.Image"), System.Drawing.Image) - Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton4.Name = "ToolStripButton4" - Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton4.Text = "View Report" - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'IDDataGridViewTextBoxColumn - ' - Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" - Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" - Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" - Me.IDDataGridViewTextBoxColumn.ReadOnly = True - Me.IDDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[False] - Me.IDDataGridViewTextBoxColumn.Visible = False - ' - 'MGCIDDataGridViewTextBoxColumn - ' - Me.MGCIDDataGridViewTextBoxColumn.DataPropertyName = "MGCID" - Me.MGCIDDataGridViewTextBoxColumn.HeaderText = "MGCID" - Me.MGCIDDataGridViewTextBoxColumn.Name = "MGCIDDataGridViewTextBoxColumn" - Me.MGCIDDataGridViewTextBoxColumn.ReadOnly = True - Me.MGCIDDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[False] - Me.MGCIDDataGridViewTextBoxColumn.Visible = False - ' - 'FullNameDataGridViewTextBoxColumn - ' - Me.FullNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill - Me.FullNameDataGridViewTextBoxColumn.DataPropertyName = "FullName" - Me.FullNameDataGridViewTextBoxColumn.FillWeight = 50.0! - Me.FullNameDataGridViewTextBoxColumn.HeaderText = "Full Name" - Me.FullNameDataGridViewTextBoxColumn.Name = "FullNameDataGridViewTextBoxColumn" - Me.FullNameDataGridViewTextBoxColumn.ReadOnly = True - Me.FullNameDataGridViewTextBoxColumn.Visible = False - ' - 'ManuDataGridViewTextBoxColumn - ' - Me.ManuDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill - Me.ManuDataGridViewTextBoxColumn.DataPropertyName = "Manu" - Me.ManuDataGridViewTextBoxColumn.FillWeight = 50.0! - Me.ManuDataGridViewTextBoxColumn.HeaderText = "Manufacturer" - Me.ManuDataGridViewTextBoxColumn.Name = "ManuDataGridViewTextBoxColumn" - Me.ManuDataGridViewTextBoxColumn.ReadOnly = True - Me.ManuDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.ManuDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic - ' - 'ModelDataGridViewTextBoxColumn - ' - Me.ModelDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill - Me.ModelDataGridViewTextBoxColumn.DataPropertyName = "Model" - Me.ModelDataGridViewTextBoxColumn.FillWeight = 50.0! - Me.ModelDataGridViewTextBoxColumn.HeaderText = "Model" - Me.ModelDataGridViewTextBoxColumn.Name = "ModelDataGridViewTextBoxColumn" - Me.ModelDataGridViewTextBoxColumn.ReadOnly = True - Me.ModelDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.ModelDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic - ' - 'GTypeDataGridViewTextBoxColumn - ' - Me.GTypeDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill - Me.GTypeDataGridViewTextBoxColumn.DataPropertyName = "GType" - Me.GTypeDataGridViewTextBoxColumn.HeaderText = "Firearm Type" - Me.GTypeDataGridViewTextBoxColumn.Name = "GTypeDataGridViewTextBoxColumn" - Me.GTypeDataGridViewTextBoxColumn.ReadOnly = True - Me.GTypeDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.GTypeDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic - ' - 'CalDataGridViewTextBoxColumn - ' - Me.CalDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill - Me.CalDataGridViewTextBoxColumn.DataPropertyName = "Cal" - Me.CalDataGridViewTextBoxColumn.HeaderText = "Caliber" - Me.CalDataGridViewTextBoxColumn.Name = "CalDataGridViewTextBoxColumn" - Me.CalDataGridViewTextBoxColumn.ReadOnly = True - Me.CalDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.CalDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic - ' - 'BarrelDataGridViewTextBoxColumn - ' - Me.BarrelDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill - Me.BarrelDataGridViewTextBoxColumn.DataPropertyName = "Barrel" - Me.BarrelDataGridViewTextBoxColumn.HeaderText = "Barrel" - Me.BarrelDataGridViewTextBoxColumn.Name = "BarrelDataGridViewTextBoxColumn" - Me.BarrelDataGridViewTextBoxColumn.ReadOnly = True - ' - 'SerialNoDataGridViewTextBoxColumn - ' - Me.SerialNoDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill - Me.SerialNoDataGridViewTextBoxColumn.DataPropertyName = "SerialNo" - Me.SerialNoDataGridViewTextBoxColumn.HeaderText = "Serial No." - Me.SerialNoDataGridViewTextBoxColumn.Name = "SerialNoDataGridViewTextBoxColumn" - Me.SerialNoDataGridViewTextBoxColumn.ReadOnly = True - ' - 'frmView_List_Firearms - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(807, 387) - Me.Controls.Add(Me.DataGridView1) - Me.Controls.Add(Me.ToolStrip1) - Me.HelpProvider1.SetHelpKeyword(Me, "View Firearm Inventory") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "View Firearm Inventory") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmView_List_Firearms" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Firearm Collection" - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() - Me.ContextMenuStrip1.ResumeLayout(False) - CType(Me.LoadersLogFirearmsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ToolStrip1.ResumeLayout(False) - Me.ToolStrip1.PerformLayout() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmViewListFirearms)) + Me.DataGridView1 = New System.Windows.Forms.DataGridView + Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.AddToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.LoadersLogFirearmsBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.Loaders_Log_FirearmsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_FirearmsTableAdapter + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton4 = New System.Windows.Forms.ToolStripButton + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.MGCIDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.FullNameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.ManuDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Me.ModelDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Me.GTypeDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Me.CalDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Me.BarrelDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.SerialNoDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ContextMenuStrip1.SuspendLayout() + CType(Me.LoadersLogFirearmsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ToolStrip1.SuspendLayout() + Me.SuspendLayout() + ' + 'DataGridView1 + ' + Me.DataGridView1.AllowUserToAddRows = False + Me.DataGridView1.AutoGenerateColumns = False + Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.MGCIDDataGridViewTextBoxColumn, Me.FullNameDataGridViewTextBoxColumn, Me.ManuDataGridViewTextBoxColumn, Me.ModelDataGridViewTextBoxColumn, Me.GTypeDataGridViewTextBoxColumn, Me.CalDataGridViewTextBoxColumn, Me.BarrelDataGridViewTextBoxColumn, Me.SerialNoDataGridViewTextBoxColumn}) + Me.DataGridView1.ContextMenuStrip = Me.ContextMenuStrip1 + Me.DataGridView1.DataSource = Me.LoadersLogFirearmsBindingSource + Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill + Me.DataGridView1.Location = New System.Drawing.Point(0, 25) + Me.DataGridView1.MultiSelect = False + Me.DataGridView1.Name = "DataGridView1" + Me.DataGridView1.ReadOnly = True + Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DataGridView1.Size = New System.Drawing.Size(807, 362) + Me.DataGridView1.TabIndex = 0 + ' + 'ContextMenuStrip1 + ' + Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EditToolStripMenuItem, Me.AddToolStripMenuItem, Me.DeleteToolStripMenuItem}) + Me.ContextMenuStrip1.Name = "ContextMenuStrip1" + Me.ContextMenuStrip1.Size = New System.Drawing.Size(117, 70) + ' + 'EditToolStripMenuItem + ' + Me.EditToolStripMenuItem.Image = CType(resources.GetObject("EditToolStripMenuItem.Image"), System.Drawing.Image) + Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" + Me.EditToolStripMenuItem.Size = New System.Drawing.Size(116, 22) + Me.EditToolStripMenuItem.Text = "&Edit" + ' + 'AddToolStripMenuItem + ' + Me.AddToolStripMenuItem.Image = CType(resources.GetObject("AddToolStripMenuItem.Image"), System.Drawing.Image) + Me.AddToolStripMenuItem.Name = "AddToolStripMenuItem" + Me.AddToolStripMenuItem.Size = New System.Drawing.Size(116, 22) + Me.AddToolStripMenuItem.Text = "&Add" + ' + 'DeleteToolStripMenuItem + ' + Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) + Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" + Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(116, 22) + Me.DeleteToolStripMenuItem.Text = "&Delete" + ' + 'LoadersLogFirearmsBindingSource + ' + Me.LoadersLogFirearmsBindingSource.DataMember = "Loaders_Log_Firearms" + Me.LoadersLogFirearmsBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'Loaders_Log_FirearmsTableAdapter + ' + Me.Loaders_Log_FirearmsTableAdapter.ClearBeforeFill = True + ' + 'ToolStrip1 + ' + Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripButton3, Me.ToolStripButton4}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(807, 25) + Me.ToolStrip1.TabIndex = 1 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton1.Text = "ToolStripButton1" + Me.ToolStripButton1.ToolTipText = "Add Firearm to Database" + ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton2.Text = "ToolStripButton2" + Me.ToolStripButton2.ToolTipText = "Delete Selected Firearm" + ' + 'ToolStripButton3 + ' + Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) + Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton3.Name = "ToolStripButton3" + Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton3.Text = "ToolStripButton3" + Me.ToolStripButton3.ToolTipText = "Refresh Data Grid" + ' + 'ToolStripButton4 + ' + Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton4.Image = CType(resources.GetObject("ToolStripButton4.Image"), System.Drawing.Image) + Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton4.Name = "ToolStripButton4" + Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton4.Text = "View Report" + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'IDDataGridViewTextBoxColumn + ' + Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" + Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" + Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" + Me.IDDataGridViewTextBoxColumn.ReadOnly = True + Me.IDDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[False] + Me.IDDataGridViewTextBoxColumn.Visible = False + ' + 'MGCIDDataGridViewTextBoxColumn + ' + Me.MGCIDDataGridViewTextBoxColumn.DataPropertyName = "MGCID" + Me.MGCIDDataGridViewTextBoxColumn.HeaderText = "MGCID" + Me.MGCIDDataGridViewTextBoxColumn.Name = "MGCIDDataGridViewTextBoxColumn" + Me.MGCIDDataGridViewTextBoxColumn.ReadOnly = True + Me.MGCIDDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[False] + Me.MGCIDDataGridViewTextBoxColumn.Visible = False + ' + 'FullNameDataGridViewTextBoxColumn + ' + Me.FullNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.FullNameDataGridViewTextBoxColumn.DataPropertyName = "FullName" + Me.FullNameDataGridViewTextBoxColumn.FillWeight = 50.0! + Me.FullNameDataGridViewTextBoxColumn.HeaderText = "Full Name" + Me.FullNameDataGridViewTextBoxColumn.Name = "FullNameDataGridViewTextBoxColumn" + Me.FullNameDataGridViewTextBoxColumn.ReadOnly = True + Me.FullNameDataGridViewTextBoxColumn.Visible = False + ' + 'ManuDataGridViewTextBoxColumn + ' + Me.ManuDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.ManuDataGridViewTextBoxColumn.DataPropertyName = "Manu" + Me.ManuDataGridViewTextBoxColumn.FillWeight = 50.0! + Me.ManuDataGridViewTextBoxColumn.HeaderText = "Manufacturer" + Me.ManuDataGridViewTextBoxColumn.Name = "ManuDataGridViewTextBoxColumn" + Me.ManuDataGridViewTextBoxColumn.ReadOnly = True + Me.ManuDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.ManuDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic + ' + 'ModelDataGridViewTextBoxColumn + ' + Me.ModelDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.ModelDataGridViewTextBoxColumn.DataPropertyName = "Model" + Me.ModelDataGridViewTextBoxColumn.FillWeight = 50.0! + Me.ModelDataGridViewTextBoxColumn.HeaderText = "Model" + Me.ModelDataGridViewTextBoxColumn.Name = "ModelDataGridViewTextBoxColumn" + Me.ModelDataGridViewTextBoxColumn.ReadOnly = True + Me.ModelDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.ModelDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic + ' + 'GTypeDataGridViewTextBoxColumn + ' + Me.GTypeDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.GTypeDataGridViewTextBoxColumn.DataPropertyName = "GType" + Me.GTypeDataGridViewTextBoxColumn.HeaderText = "Firearm Type" + Me.GTypeDataGridViewTextBoxColumn.Name = "GTypeDataGridViewTextBoxColumn" + Me.GTypeDataGridViewTextBoxColumn.ReadOnly = True + Me.GTypeDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.GTypeDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic + ' + 'CalDataGridViewTextBoxColumn + ' + Me.CalDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.CalDataGridViewTextBoxColumn.DataPropertyName = "Cal" + Me.CalDataGridViewTextBoxColumn.HeaderText = "Caliber" + Me.CalDataGridViewTextBoxColumn.Name = "CalDataGridViewTextBoxColumn" + Me.CalDataGridViewTextBoxColumn.ReadOnly = True + Me.CalDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.CalDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic + ' + 'BarrelDataGridViewTextBoxColumn + ' + Me.BarrelDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.BarrelDataGridViewTextBoxColumn.DataPropertyName = "Barrel" + Me.BarrelDataGridViewTextBoxColumn.HeaderText = "Barrel" + Me.BarrelDataGridViewTextBoxColumn.Name = "BarrelDataGridViewTextBoxColumn" + Me.BarrelDataGridViewTextBoxColumn.ReadOnly = True + ' + 'SerialNoDataGridViewTextBoxColumn + ' + Me.SerialNoDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill + Me.SerialNoDataGridViewTextBoxColumn.DataPropertyName = "SerialNo" + Me.SerialNoDataGridViewTextBoxColumn.HeaderText = "Serial No." + Me.SerialNoDataGridViewTextBoxColumn.Name = "SerialNoDataGridViewTextBoxColumn" + Me.SerialNoDataGridViewTextBoxColumn.ReadOnly = True + ' + 'frmView_List_Firearms + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(807, 387) + Me.Controls.Add(Me.DataGridView1) + Me.Controls.Add(Me.ToolStrip1) + Me.HelpProvider1.SetHelpKeyword(Me, "View Firearm Inventory") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "View Firearm Inventory") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.Name = "FrmViewListFirearms" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Firearm Collection" + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ContextMenuStrip1.ResumeLayout(False) + CType(Me.LoadersLogFirearmsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents LoadersLogFirearmsBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents Loaders_Log_FirearmsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_FirearmsTableAdapter - Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip - Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton - Friend WithEvents ContextMenuStrip1 As System.Windows.Forms.ContextMenuStrip - Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents AddToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents ToolStripButton4 As System.Windows.Forms.ToolStripButton - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider - Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents MGCIDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents FullNameDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents ManuDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents ModelDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents GTypeDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents CalDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents BarrelDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents SerialNoDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn -End Class + End Sub + Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents LoadersLogFirearmsBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents Loaders_Log_FirearmsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_FirearmsTableAdapter + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton + Friend WithEvents ContextMenuStrip1 As System.Windows.Forms.ContextMenuStrip + Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents AddToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents ToolStripButton4 As System.Windows.Forms.ToolStripButton + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents MGCIDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents FullNameDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents ManuDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents ModelDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents GTypeDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents CalDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents BarrelDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents SerialNoDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_Firearms.vb b/BSMyLoadersLog/Viewing/frmView_List_Firearms.vb index 5df942f..71a249d 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_Firearms.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_Firearms.vb @@ -1,84 +1,176 @@ -Imports BSMyLoadersLog.LoadersClass -Public Class frmView_List_Firearms - Public Sub LoadData() - Me.Loaders_Log_FirearmsTableAdapter.Fill(Me.MLLDataSet.Loaders_Log_Firearms) - End Sub - Private Sub frmView_List_Firearms_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Try - Call LoadData() - Catch ex As Exception - Call LogError(Me.Name, "Load", Err.Number, ex.Message.ToString) - End Try - End Sub - - Private Sub frmView_List_Firearms_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize - If Me.Height <> 0 Then - Me.DataGridView1.Height = Me.Height - (65) - Me.DataGridView1.Width = Me.Width - 15 - End If - End Sub - - Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click - frmAddFirearm.MdiParent = Me.MdiParent - frmAddFirearm.FromView = True - frmAddFirearm.Show() - End Sub +Imports BSMyLoadersLog.Adding +'Imports BSMyLoadersLog.LoadersClass +Imports BurnSoft.Applications.MLL.LoadersLog - Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click - Call LoadData() - End Sub - - Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click - Try +Namespace Viewing + ' TODO: #20 Clean up code + ''' + ''' Class FrmViewListFirearms. + ''' Implements the + ''' + ''' + Public Class FrmViewListFirearms + ''' + ''' The error out + ''' + Dim _errOut as String + ''' + ''' Loads the data. + ''' + Public Sub LoadData() + Loaders_Log_FirearmsTableAdapter.Fill(MLLDataSet.Loaders_Log_Firearms) + End Sub + ''' + ''' Handles the Load event of the frmView_List_Firearms control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmView_List_Firearms_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Try + Call LoadData() + Catch ex As Exception + Call LogError(Name, "Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Resize event of the frmView_List_Firearms control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmView_List_Firearms_Resize(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Resize + Try + If Height <> 0 Then + DataGridView1.Height = Height - (65) + DataGridView1.Width = Width - 15 + End If + Catch ex As Exception + Call LogError(Name, "frmView_List_Firearms_Resize", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton1.Click + try + FrmAddFirearm.MdiParent = MdiParent + FrmAddFirearm.FromView = True + FrmAddFirearm.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton1_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click + Call LoadData() + End Sub + ''' + ''' Handles the Click event of the ToolStripButton2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton2.Click + Try + Call DeleteFirearm() + Catch ex As Exception + Call LogError(Name, "ToolStripButton2.Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the DeleteToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DeleteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles DeleteToolStripMenuItem.Click Call DeleteFirearm() - Catch ex As Exception - Call LogError(Me.Name, "ToolStripButton2.Click", Err.Number, ex.Message.ToString) - End Try - End Sub - - Private Sub DeleteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click - Call DeleteFirearm() - End Sub - Sub DeleteFirearm() - Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strName As String = ObjG.GetName("SELECT * from Loaders_Log_Firearms where ID=" & ItemID, "FullName") - Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim SQL As String = "DELETE from Loaders_Log_Firearms where ID=" & ItemID - If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() - Catch ex As Exception - Call LogError(Me.Name, "DeleteFirearm", Err.Number, ex.Message.ToString) - End Try - End Sub - - Private Sub AddToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToolStripMenuItem.Click - frmAddFirearm.MdiParent = Me.MdiParent - frmAddFirearm.FromView = True - frmAddFirearm.Show() - End Sub - - Private Sub EditToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EditToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim frmNew As New frmEditFirearm - frmNew.MdiParent = Me.MdiParent - frmNew.FID = ItemID - frmNew.FromView = True - frmNew.Show() - End Sub - - Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click - Me.Cursor = Cursors.WaitCursor - frmReport_List_Firearms.MdiParent = Me.MdiParent - frmReport_List_Firearms.Show() - Me.Cursor = Cursors.Arrow - End Sub - - Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.BindingContextChanged - If DataGridView1.DataSource Is Nothing Then - Return - End If - DataGridView1.AutoResizeColumns() - End Sub -End Class \ No newline at end of file + End Sub + ''' + ''' Deletes the firearm. + ''' + Sub DeleteFirearm() + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + 'Dim Obj As New BSDatabase + 'Dim ObjG As New GlobalFunctions + 'Dim strName As String = ObjG.GetName("SELECT * from Loaders_Log_Firearms where ID=" & itemId, "FullName") + Dim strName As String = Firearms.GetName(DatabasePath, itemId, _errOut) + if _errOut.Length > 0 Then Throw New Exception(_errOut) + Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + 'Dim SQL As String = "DELETE from Loaders_Log_Firearms where ID=" & itemId + 'If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() + If strAns = vbYes Then + If Not Firearms.Delete(DatabasePath, itemId, _errOut) then Throw New Exception(_errOut) + Call LoadData() + End If + Catch ex As Exception + Call LogError(Name, "DeleteFirearm", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the AddToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub AddToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AddToolStripMenuItem.Click + Try + FrmAddFirearm.MdiParent = MdiParent + FrmAddFirearm.FromView = True + FrmAddFirearm.Show() + Catch ex As Exception + Call LogError(Name, "AddToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the EditToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub EditToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EditToolStripMenuItem.Click + try + Dim itemId As long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim frmNew As New frmEditFirearm + frmNew.MdiParent = MdiParent + frmNew.FID = itemId + frmNew.FromView = True + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "EditToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton4 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton4.Click + Try + Cursor = Cursors.WaitCursor + frmReport_List_Firearms.MdiParent = MdiParent + frmReport_List_Firearms.Show() + Cursor = Cursors.Arrow + Catch ex As Exception + Call LogError(Name, "ToolStripButton4_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the BindingContextChanged event of the DataGridView1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DataGridView1.BindingContextChanged + Try + If DataGridView1.DataSource Is Nothing Then + Return + End If + DataGridView1.AutoResizeColumns() + Catch ex As Exception + Call LogError(Name, "DataGridView1_BindingContextChanged", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_Powder.Designer.vb b/BSMyLoadersLog/Viewing/frmView_List_Powder.Designer.vb index 8aabf6b..a240365 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_Powder.Designer.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_Powder.Designer.vb @@ -1,6 +1,6 @@ Namespace Viewing _ - Partial Class frmView_List_Powder + Partial Class FrmViewListPowder Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. @@ -24,7 +24,7 @@ Namespace Viewing _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmView_List_Powder)) + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmViewListPowder)) Me.ToolStrip1 = New System.Windows.Forms.ToolStrip Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox @@ -287,7 +287,7 @@ Namespace Viewing Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) Me.HelpProvider1.SetHelpString(Me, "View Powder List") Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmView_List_Powder" + Me.Name = "FrmViewListPowder" Me.HelpProvider1.SetShowHelp(Me, True) Me.Text = "Powder List" Me.ToolStrip1.ResumeLayout(False) diff --git a/BSMyLoadersLog/Viewing/frmView_List_Powder.vb b/BSMyLoadersLog/Viewing/frmView_List_Powder.vb index cc9ba16..f10d8e7 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_Powder.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_Powder.vb @@ -1,183 +1,312 @@ -Imports System.Data -Imports System.Data.Odbc -Imports System.IO -Imports System.Xml +'Imports System.Data +'Imports System.Data.Odbc +'Imports System.IO +'Imports System.Xml +Imports BSMyLoadersLog.Adding Imports BSMyLoadersLog.LoadersClass Imports BurnSoft.Applications.MLL.Global +Imports BurnSoft.Applications.MLL.Inventory Namespace Viewing - - Public Class frmView_List_Powder + ' TODO: #20 clean up code + ''' + ''' Class FrmViewListPowder. + ''' Implements the + ''' + ''' + Public Class FrmViewListPowder ''' ''' The error out ''' - Private errOut as String + Private _errOut as String + ''' + ''' Registry View Name for settings + ''' Const RegViewName As String = "View_Powders" + ''' + ''' Loads the data. + ''' Public Sub LoadData() Try - 'Me.General_PowderTableAdapter.Fill(Me.MLLDataSet.General_Powder) + 'General_PowderTableAdapter.Fill(MLLDataSet.General_Powder) Select Case LCase(ToolStripComboBox1.SelectedItem.ToString) Case LCase("All") - Me.General_PowderTableAdapter.Fill(Me.MLLDataSet.General_Powder) + General_PowderTableAdapter.Fill(MLLDataSet.General_Powder) Case LCase("Instock") - Me.General_PowderTableAdapter.FillByInManu(Me.MLLDataSet.General_Powder) + General_PowderTableAdapter.FillByInManu(MLLDataSet.General_Powder) Case LCase("Out-Of-Stock") - Me.General_PowderTableAdapter.FillByOutManu(Me.MLLDataSet.General_Powder) + General_PowderTableAdapter.FillByOutManu(MLLDataSet.General_Powder) Case LCase("Reference") - Me.General_PowderTableAdapter.FillBy_Reference(Me.MLLDataSet.General_Powder) + General_PowderTableAdapter.FillBy_Reference(MLLDataSet.General_Powder) Case Else - Me.General_PowderTableAdapter.Fill(Me.MLLDataSet.General_Powder) + General_PowderTableAdapter.Fill(MLLDataSet.General_Powder) End Select Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub frmView_List_Powder_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing + ''' + ''' Handles the FormClosing event of the frmView_List_Powder control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmView_List_Powder_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) Handles Me.FormClosing 'Dim ObjR As New BSRegistry 'Call ObjR.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString) Try If Not MyRegistry.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString, - errOut) Then Throw New Exception(errOut) + _errOut) Then Throw New Exception(_errOut) Catch ex As Exception - Call LogError(Me.Name, "frmView_List_Powder_FormClosing", Err.Number, ex.Message.ToString) + Call LogError(Name, "frmView_List_Powder_FormClosing", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub frmView_List_Powder_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load + ''' + ''' Handles the Load event of the frmView_List_Powder control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmView_List_Powder_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load Try 'Dim ObjR As New BSRegistry 'ToolStripComboBox1.Text = ObjR.GetViewSettings(RegViewName, "All") - ToolStripComboBox1.Text = MyRegistry.GetViewSettings(RegViewName, errOut, "All") - if errOut.Length > 0 Then Throw New Exception(errOut) + ToolStripComboBox1.Text = MyRegistry.GetViewSettings(RegViewName, _errOut, "All") + if _errOut.Length > 0 Then Throw New Exception(_errOut) Call LoadData() Catch ex As Exception - Call LogError(Me.Name, "frmView_List_Powder_Load", Err.Number, ex.Message.ToString) + Call LogError(Name, "frmView_List_Powder_Load", Err.Number, ex.Message.ToString) End Try End Sub - - Private Sub frmView_List_Powder_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize - If Me.Height <> 0 Then - Me.DataGridView1.Height = Me.Height - (65) - Me.DataGridView1.Width = Me.Width - 15 - End If + ''' + ''' Handles the Resize event of the frmView_List_Powder control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmView_List_Powder_Resize(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Resize + Try + If Height <> 0 Then + DataGridView1.Height = Height - (65) + DataGridView1.Width = Width - 15 + End If + Catch ex As Exception + Call LogError(Name, "frmView_List_Powder_Resize", Err.Number, ex.Message.ToString) + End Try End Sub - - Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click - Dim frmNew As New frmAddPowder - frmNew.MdiParent = Me.MdiParent - frmNew.FromView = True - frmNew.Show() + ''' + ''' Handles the Click event of the ToolStripButton1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton1.Click + try + Dim frmNew As New frmAddPowder + frmNew.MdiParent = MdiParent + frmNew.FromView = True + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton1_Click", Err.Number, ex.Message.ToString) + End Try End Sub - Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click + ''' + ''' Handles the Click event of the ToolStripButton4 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton4.Click Call LoadData() End Sub + ''' + ''' Deletes the powder. + ''' Sub DeletePowder() Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strSQLTable As String = "General_Powder" - Dim strName As String = ObjG.GetName("SELECT * from " & strSQLTable & " where ID=" & ItemID, "Name") + Dim itemId As long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + 'Dim Obj As New BSDatabase + 'Dim ObjG As New GlobalFunctions + 'Dim strSQLTable As String = "General_Powder" + 'Dim strName As String = ObjG.GetName("SELECT * from " & strSQLTable & " where ID=" & itemId, "Name") + Dim strName As String = PowderInventory.GetName(DatabasePath, itemId, _errOut) + if _errOut.Length > 0 Then Throw New Exception(_errOut) Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & ItemID - If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() + 'Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & itemId + 'If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() + If strAns = vbYes Then + If Not PowderInventory.Delete(DatabasePath, itemId, _errOut) then Throw new Exception(_errOut) + Call LoadData() + End If Catch ex As Exception - Call LogError(Me.Name, "DeletePowder", Err.Number, ex.Message.ToString) + Call LogError(Name, "DeletePowder", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click + ''' + ''' Handles the Click event of the ToolStripButton2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton2.Click Try Call DeletePowder() Catch ex As Exception - Call LogError(Me.Name, "ToolStripButton2.Click", Err.Number, ex.Message.ToString) + Call LogError(Name, "ToolStripButton2.Click", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub DeleteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click + ''' + ''' Handles the Click event of the DeleteToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DeleteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles DeleteToolStripMenuItem.Click Call DeletePowder() End Sub - Private Sub AddToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToolStripMenuItem.Click - Dim frmNew As New frmAddPowder - frmNew.MdiParent = Me.MdiParent - frmNew.FromView = True - frmNew.Show() + ''' + ''' Handles the Click event of the AddToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub AddToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AddToolStripMenuItem.Click + Try + Dim frmNew As New frmAddPowder + frmNew.MdiParent = MdiParent + frmNew.FromView = True + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "AddToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub - Private Sub EditToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EditToolStripMenuItem.Click + ''' + ''' Handles the Click event of the EditToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub EditToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EditToolStripMenuItem.Click Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value Dim frmNew As New frmEditPowder - frmNew.MdiParent = Me.MdiParent - frmNew.PID = ItemID + frmNew.MdiParent = MdiParent + frmNew.PID = itemId frmNew.FromView = True frmNew.Show() Catch ex As Exception - Call LogError(Me.Name, "EditToolStripMenuItem.Click", Err.Number, ex.Message.ToString) + Call LogError(Name, "EditToolStripMenuItem.Click", Err.Number, ex.Message.ToString) End Try End Sub - - Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click - Me.Cursor = Cursors.WaitCursor - frmReport_PowderInventory.MdiParent = Me.MdiParent - frmReport_PowderInventory.Show() - Me.Cursor = Cursors.Arrow + ''' + ''' Handles the Click event of the ToolStripButton3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click + Cursor = Cursors.WaitCursor + Try + frmReport_PowderInventory.MdiParent = MdiParent + frmReport_PowderInventory.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton3_Click", Err.Number, ex.Message.ToString) + End Try + Cursor = Cursors.Arrow End Sub - - Private Sub AddtoCurrentToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddtoCurrentToolStripMenuItem.Click + ''' + ''' Handles the Click event of the AddtoCurrentToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub AddtoCurrentToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AddtoCurrentToolStripMenuItem.Click Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value Dim frmNew As New frmAddQtyPowder - frmNew.MdiParent = Me.MdiParent - frmNew.PID = ItemID + frmNew.MdiParent = MdiParent + frmNew.PID = itemId frmNew.FromView = True frmNew.Show() Catch ex As Exception - Call LogError(Me.Name, "AddtoCurrentToolStripMenuItem.Click", Err.Number, ex.Message.ToString) + Call LogError(Name, "AddtoCurrentToolStripMenuItem.Click", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub ToolStripComboBox1_SelectedIndexChanged1(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged + ''' + ''' Handles the SelectedIndexChanged1 event of the ToolStripComboBox1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripComboBox1_SelectedIndexChanged1(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged Call LoadData() End Sub - - Private Sub MarkAsOutOfStockToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MarkAsOutOfStockToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim Obj As New BSDatabase - Dim SQL As String = "UPDATE General_Powder set weightgn=0, weightlbs=0 where ID=" & ItemID - Obj.ConnExec(SQL) - Call LoadData() + ''' + ''' Handles the Click event of the MarkAsOutOfStockToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub MarkAsOutOfStockToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles MarkAsOutOfStockToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + If Not PowderInventory.UpdateQty(DatabasePath, itemId, 0,0, _errOut) Then Throw New Exception(_errOut) + 'Dim Obj As New BSDatabase + 'Dim SQL As String = "UPDATE General_Powder set weightgn=0, weightlbs=0 where ID=" & itemId + 'Obj.ConnExec(SQL) + Call LoadData() + Catch ex As Exception + Call LogError(Name, "MarkAsOutOfStockToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub - - Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.BindingContextChanged - If DataGridView1.DataSource Is Nothing Then - Return - End If - DataGridView1.AutoResizeColumns() + ''' + ''' Handles the BindingContextChanged event of the DataGridView1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DataGridView1.BindingContextChanged + try + If DataGridView1.DataSource Is Nothing Then + Return + End If + DataGridView1.AutoResizeColumns() + Catch ex As Exception + Call LogError(Name, "DataGridView1_BindingContextChanged", Err.Number, ex.Message.ToString) + End Try End Sub - - Private Sub ExportToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExportToolStripMenuItem.Click - Dim DefaultFileName As String = "Export_Inventory_Powder.xml" - SaveFileDialog1.FilterIndex = 1 - SaveFileDialog1.Filter = "XML File(*.xml)|*.xml" - SaveFileDialog1.Title = "Export Data to XML File" - SaveFileDialog1.FileName = Replace(Replace(Replace(DefaultFileName, " ", "_"), "/", "-"), "\", "-") - If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.Cancel Then Exit Sub - Dim strFilePath As String = SaveFileDialog1.FileName - Dim objE As New Inventory_Export_Import - objE.XML_Generate_Powder_Export(strFilePath) - MsgBox("Export Completed!") + ''' + ''' Handles the Click event of the ExportToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ExportToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ExportToolStripMenuItem.Click + Try + Dim DefaultFileName As String = "Export_Inventory_Powder.xml" + SaveFileDialog1.FilterIndex = 1 + SaveFileDialog1.Filter = $"XML File(*.xml)|*.xml" + SaveFileDialog1.Title = $"Export Data to XML File" + SaveFileDialog1.FileName = Replace(Replace(Replace(DefaultFileName, " ", "_"), "/", "-"), "\", "-") + If SaveFileDialog1.ShowDialog() = DialogResult.Cancel Then Exit Sub + Dim strFilePath As String = SaveFileDialog1.FileName + Dim objE As New Inventory_Export_Import + objE.XML_Generate_Powder_Export(strFilePath) + MsgBox("Export Completed!") + Catch ex As Exception + Call LogError(Name, "ExportToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub - - Private Sub ImportToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ImportToolStripMenuItem.Click - Dim DefaultFileName As String = "Export_Inventory_Powder.xml" - OpenFileDialog1.FilterIndex = 1 - OpenFileDialog1.Filter = "XML File(*.xml)|*.xml" - OpenFileDialog1.Title = "Import Powder XML into Database" - OpenFileDialog1.FileName = Replace(Replace(Replace(DefaultFileName, " ", "_"), "/", "-"), "\", "-") - If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.Cancel Then Exit Sub - Dim sFilePath As String = OpenFileDialog1.FileName - Dim objE As New Inventory_Export_Import - Me.Cursor = Cursors.WaitCursor - objE.XML_Generate_Powder_Import(sFilePath) - Me.Cursor = Cursors.Arrow - Call LoadData() - MsgBox("Import Completed!") + ''' + ''' Handles the Click event of the ImportToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ImportToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ImportToolStripMenuItem.Click + Try + Dim DefaultFileName As String = "Export_Inventory_Powder.xml" + OpenFileDialog1.FilterIndex = 1 + OpenFileDialog1.Filter = $"XML File(*.xml)|*.xml" + OpenFileDialog1.Title = $"Import Powder XML into Database" + OpenFileDialog1.FileName = Replace(Replace(Replace(DefaultFileName, " ", "_"), "/", "-"), "\", "-") + If OpenFileDialog1.ShowDialog() = DialogResult.Cancel Then Exit Sub + Dim sFilePath As String = OpenFileDialog1.FileName + Dim objE As New Inventory_Export_Import + Cursor = Cursors.WaitCursor + objE.XML_Generate_Powder_Import(sFilePath) + Cursor = Cursors.Arrow + Call LoadData() + MsgBox("Import Completed!") + Catch ex As Exception + Call LogError(Name, "ImportToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub End Class End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_Primer.Designer.vb b/BSMyLoadersLog/Viewing/frmView_List_Primer.Designer.vb index 140c4d1..8f85556 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_Primer.Designer.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_Primer.Designer.vb @@ -1,6 +1,6 @@ Namespace Viewing _ - Partial Class frmView_List_Primer + Partial Class FrmViewListPrimer Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. @@ -24,7 +24,7 @@ Namespace Viewing _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmView_List_Primer)) + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmViewListPrimer)) Me.ToolStrip1 = New System.Windows.Forms.ToolStrip Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox @@ -248,7 +248,7 @@ Namespace Viewing Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) Me.HelpProvider1.SetHelpString(Me, "View Primers List") Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmView_List_Primer" + Me.Name = "FrmViewListPrimer" Me.HelpProvider1.SetShowHelp(Me, True) Me.Text = "Primer List" Me.ToolStrip1.ResumeLayout(False) diff --git a/BSMyLoadersLog/Viewing/frmView_List_Primer.vb b/BSMyLoadersLog/Viewing/frmView_List_Primer.vb index c9fb97d..073c0e4 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_Primer.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_Primer.vb @@ -1,145 +1,260 @@ +Imports BSMyLoadersLog.Adding +Imports BSMyLoadersLog.Editing Imports BSMyLoadersLog.LoadersClass Imports BurnSoft.Applications.MLL.Global +Imports BurnSoft.Applications.MLL.Inventory Namespace Viewing - - Public Class frmView_List_Primer + ' TODO: #20 clean up code + ''' + ''' Class FrmViewListPrimer. + ''' Implements the + ''' + ''' + Public Class FrmViewListPrimer ''' ''' The error out ''' - Private errOut as String + Private _errOut as String + ''' + ''' Registry view setting name + ''' Const RegViewName As String = "View_Primers" + ''' + ''' Loads the data. + ''' Public Sub LoadData() Try Select Case LCase(UCase(ToolStripComboBox1.SelectedItem.ToString)) Case LCase("All") - Me.ViewPrimerListTableAdapter.FillByAllManu(Me.MLLDataSet.viewPrimerList) + ViewPrimerListTableAdapter.FillByAllManu(MLLDataSet.viewPrimerList) Case LCase("Instock") - Me.ViewPrimerListTableAdapter.FillByInManu(Me.MLLDataSet.viewPrimerList) + ViewPrimerListTableAdapter.FillByInManu(MLLDataSet.viewPrimerList) Case LCase("Out-Of-Stock") - Me.ViewPrimerListTableAdapter.FillByOutManu(Me.MLLDataSet.viewPrimerList) + ViewPrimerListTableAdapter.FillByOutManu(MLLDataSet.viewPrimerList) Case LCase("Reference") - Me.ViewPrimerListTableAdapter.FillBy_Reference(Me.MLLDataSet.viewPrimerList) + ViewPrimerListTableAdapter.FillBy_Reference(MLLDataSet.viewPrimerList) Case Else - Me.ViewPrimerListTableAdapter.Fill(Me.MLLDataSet.viewPrimerList) + ViewPrimerListTableAdapter.Fill(MLLDataSet.viewPrimerList) End Select Catch ex As Exception - Dim strProcedure As String = "LoadData" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) End Try End Sub - - Private Sub frmView_List_Primer_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing + ''' + ''' Handles the FormClosing event of the frmView_List_Primer control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmView_List_Primer_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) Handles Me.FormClosing Try 'Dim ObjR As New BSRegistry 'Call ObjR.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString) If Not MyRegistry.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString, - errOut) Then Throw New Exception(errOut) + _errOut) Then Throw New Exception(_errOut) Catch ex As Exception - Dim strProcedure As String = "frmView_List_Primer_FormClosing" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) + Call LogError(Name, "frmView_List_Primer_FormClosing", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub frmView_List_Primer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load + ''' + ''' Handles the Load event of the frmView_List_Primer control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmView_List_Primer_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load Try 'Dim ObjR As New BSRegistry 'ToolStripComboBox1.Text = ObjR.GetViewSettings(RegViewName, "All") - ToolStripComboBox1.Text = MyRegistry.GetViewSettings(RegViewName, errOut, "All") - if errOut.Length > 0 Then Throw New Exception(errOut) + ToolStripComboBox1.Text = MyRegistry.GetViewSettings(RegViewName, _errOut, "All") + if _errOut.Length > 0 Then Throw New Exception(_errOut) Call LoadData() Catch ex As Exception - Dim strProcedure As String = "frmView_List_Primer_Load" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) + Call LogError(Name, "frmView_List_Primer_Load", Err.Number, ex.Message.ToString) End Try End Sub - - Private Sub frmView_List_Primer_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize - If Me.Height <> 0 Then - Me.DataGridView1.Height = Me.Height - (65) - Me.DataGridView1.Width = Me.Width - 15 - End If + ''' + ''' Handles the Resize event of the frmView_List_Primer control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmView_List_Primer_Resize(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Resize + Try + If Height <> 0 Then + DataGridView1.Height = Height - (65) + DataGridView1.Width = Width - 15 + End If + Catch ex As Exception + Call LogError(Name, "frmView_List_Primer_Resize", Err.Number, ex.Message.ToString) + End Try End Sub - - Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click - Dim frmNew As New frmAddPrimer - frmNew.FromView = True - frmNew.MdiParent = Me.MdiParent - frmNew.Show() + ''' + ''' Handles the Click event of the ToolStripButton1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton1.Click + Try + Dim frmNew As New frmAddPrimer + frmNew.FromView = True + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton1_Click", Err.Number, ex.Message.ToString) + End Try End Sub - Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click + ''' + ''' Handles the Click event of the ToolStripButton3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click Call LoadData() End Sub - Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click + ''' + ''' Handles the Click event of the ToolStripButton2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton2.Click Try Call DeletePrimers() Catch ex As Exception - Dim strProcedure As String = "ToolStripButton2.Click" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) + Call LogError(Name, "ToolStripButton2.Click", Err.Number, ex.Message.ToString) End Try End Sub + ''' + ''' Deletes the primers. + ''' Sub DeletePrimers() Try Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strSQLTable As String = "General_Primer" - Dim strName As String = ObjG.GetName("SELECT * from " & strSQLTable & " where ID=" & ItemID, "Name") + 'Dim Obj As New BSDatabase + 'Dim ObjG As New GlobalFunctions + 'Dim strSQLTable As String = "General_Primer" + 'Dim strName As String = ObjG.GetName("SELECT * from " & strSQLTable & " where ID=" & ItemID, "Name") + 'Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + 'Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & ItemID + 'If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() + Dim strName As String = PrimerInventory.GetName(DatabasePath, itemId, _errOut) + if _errOut.Length > 0 Then Throw New Exception(_errOut) Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & ItemID - If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() + 'Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & itemId + 'If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() + If strAns = vbYes Then + If Not PrimerInventory.Delete(DatabasePath, itemId, _errOut) then Throw new Exception(_errOut) + Call LoadData() + End If Catch ex As Exception - Call LogError(Me.Name, "DeletePrimers", Err.Number, ex.Message.ToString) + Call LogError(Name, "DeletePrimers", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub DeleteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click + ''' + ''' Handles the Click event of the DeleteToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DeleteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles DeleteToolStripMenuItem.Click Call DeletePrimers() End Sub - Private Sub AddToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToolStripMenuItem.Click - Dim frmNew As New frmAddPrimer - frmNew.MdiParent = Me.MdiParent - frmNew.Show() + Private Sub AddToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AddToolStripMenuItem.Click + Try + Dim frmNew As New frmAddPrimer + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "AddToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub - - Private Sub EditToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EditToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim frmNew As New frmEditPrimer - frmNew.MdiParent = Me.MdiParent - frmNew.PID = ItemID - frmNew.Show() + ''' + ''' Handles the Click event of the EditToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub EditToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EditToolStripMenuItem.Click + Try + Dim itemId As long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim frmNew As New frmEditPrimer + frmNew.MdiParent = MdiParent + frmNew.PrimerId = itemId + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "EditToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub - - Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click - Me.Cursor = Cursors.WaitCursor - frmReport_PrimerInventory.MdiParent = Me.MdiParent - frmReport_PrimerInventory.Show() - Me.Cursor = Cursors.Arrow + ''' + ''' Handles the Click event of the ToolStripButton4 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton4.Click + Cursor = Cursors.WaitCursor + Try + frmReport_PrimerInventory.MdiParent = MdiParent + frmReport_PrimerInventory.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton4_Click", Err.Number, ex.Message.ToString) + End Try + Cursor = Cursors.Arrow End Sub - Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged + ''' + ''' Handles the SelectedIndexChanged event of the ToolStripComboBox1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged Call LoadData() End Sub - - Private Sub AddToQtyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToQtyToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim frmNew As New frmAddQtyPrimers - frmNew.MdiParent = Me.MdiParent - frmNew.PID = ItemID - frmNew.Show() + ''' + ''' Handles the Click event of the AddToQtyToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub AddToQtyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AddToQtyToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim frmNew As New frmAddQtyPrimers + frmNew.MdiParent = MdiParent + frmNew.PrimerId = itemId + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "AddToQtyToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub - - Private Sub MarkAsOutOfStockToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MarkAsOutOfStockToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim SQL As String = "UPDATE General_Primer set QTY=0 where ID=" & ItemID - Dim Obj As New BSDatabase - Obj.ConnExec(SQL) - Call LoadData() + ''' + ''' Handles the Click event of the MarkAsOutOfStockToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub MarkAsOutOfStockToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles MarkAsOutOfStockToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + If Not PrimerInventory.UpdateQty(DatabasePath,itemId, 0, _errOut) Then Throw New Exception(_errOut) + 'Dim SQL As String = "UPDATE General_Primer set QTY=0 where ID=" & itemId + 'Dim Obj As New BSDatabase + 'Obj.ConnExec(SQL) + Call LoadData() + Catch ex As Exception + Call LogError(Name, "MarkAsOutOfStockToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub - - Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.BindingContextChanged - If DataGridView1.DataSource Is Nothing Then - Return - End If - DataGridView1.AutoResizeColumns() + ''' + ''' Handles the BindingContextChanged event of the DataGridView1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DataGridView1.BindingContextChanged + Try + If DataGridView1.DataSource Is Nothing Then + Return + End If + DataGridView1.AutoResizeColumns() + Catch ex As Exception + Call LogError(Name, "DataGridView1_BindingContextChanged", Err.Number, ex.Message.ToString) + End Try End Sub End Class End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_ShellHulls.Designer.vb b/BSMyLoadersLog/Viewing/frmView_List_ShellHulls.Designer.vb index 777a599..8b0824f 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_ShellHulls.Designer.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_ShellHulls.Designer.vb @@ -1,321 +1,323 @@ - _ -Partial Class frmView_List_ShellHulls - Inherits System.Windows.Forms.Form +Namespace Viewing + _ + Partial Class FrmViewListShellHulls + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmView_List_ShellHulls)) - Me.ToolStrip1 = New System.Windows.Forms.ToolStrip() - Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel() - Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox() - Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton() - Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton() - Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton() - Me.ToolStripButton4 = New System.Windows.Forms.ToolStripButton() - Me.DataGridView1 = New System.Windows.Forms.DataGridView() - Me.DRAM = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() - Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.AddToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() - Me.AddToQtyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.MarkAsOutOfStockToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider() - Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.ManufacturerDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() - Me.NameDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() - Me.GaugeDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() - Me.LengthDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() - Me.QtyDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.PriceDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.ListSGCaseBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet() - Me.List_SG_CaseTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_CaseTableAdapter() - Me.ToolStrip1.SuspendLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.ContextMenuStrip1.SuspendLayout() - CType(Me.ListSGCaseBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'ToolStrip1 - ' - Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel1, Me.ToolStripComboBox1, Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripButton3, Me.ToolStripButton4}) - Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) - Me.ToolStrip1.Name = "ToolStrip1" - Me.ToolStrip1.Size = New System.Drawing.Size(687, 25) - Me.ToolStrip1.TabIndex = 0 - Me.ToolStrip1.Text = "ToolStrip1" - ' - 'ToolStripLabel1 - ' - Me.ToolStripLabel1.Name = "ToolStripLabel1" - Me.ToolStripLabel1.Size = New System.Drawing.Size(47, 22) - Me.ToolStripLabel1.Text = "Sort By:" - ' - 'ToolStripComboBox1 - ' - Me.ToolStripComboBox1.Items.AddRange(New Object() {"All", "Instock", "Out-Of-Stock", "Reference"}) - Me.ToolStripComboBox1.Name = "ToolStripComboBox1" - Me.ToolStripComboBox1.Size = New System.Drawing.Size(121, 25) - Me.ToolStripComboBox1.Text = "All" - ' - 'ToolStripButton1 - ' - Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) - Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton1.Name = "ToolStripButton1" - Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton1.Text = "Add to List" - ' - 'ToolStripButton2 - ' - Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) - Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton2.Name = "ToolStripButton2" - Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton2.Text = "Delete from list" - ' - 'ToolStripButton3 - ' - Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) - Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton3.Name = "ToolStripButton3" - Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton3.Text = "Refresh List" - ' - 'ToolStripButton4 - ' - Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton4.Image = CType(resources.GetObject("ToolStripButton4.Image"), System.Drawing.Image) - Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton4.Name = "ToolStripButton4" - Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton4.Text = "View Report" - ' - 'DataGridView1 - ' - Me.DataGridView1.AllowUserToAddRows = False - Me.DataGridView1.AutoGenerateColumns = False - Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.ManufacturerDataGridViewTextBoxColumn, Me.NameDataGridViewTextBoxColumn, Me.GaugeDataGridViewTextBoxColumn, Me.LengthDataGridViewTextBoxColumn, Me.DRAM, Me.QtyDataGridViewTextBoxColumn, Me.PriceDataGridViewTextBoxColumn}) - Me.DataGridView1.ContextMenuStrip = Me.ContextMenuStrip1 - Me.DataGridView1.DataSource = Me.ListSGCaseBindingSource - Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill - Me.DataGridView1.Location = New System.Drawing.Point(0, 25) - Me.DataGridView1.MultiSelect = False - Me.DataGridView1.Name = "DataGridView1" - Me.DataGridView1.ReadOnly = True - Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DataGridView1.Size = New System.Drawing.Size(687, 301) - Me.DataGridView1.TabIndex = 1 - ' - 'DRAM - ' - Me.DRAM.DataPropertyName = "DRAM" - Me.DRAM.HeaderText = "DRAM" - Me.DRAM.Name = "DRAM" - Me.DRAM.ReadOnly = True - ' - 'ContextMenuStrip1 - ' - Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EditToolStripMenuItem, Me.AddToolStripMenuItem, Me.DeleteToolStripMenuItem, Me.ToolStripSeparator1, Me.AddToQtyToolStripMenuItem, Me.MarkAsOutOfStockToolStripMenuItem}) - Me.ContextMenuStrip1.Name = "ContextMenuStrip1" - Me.ContextMenuStrip1.Size = New System.Drawing.Size(191, 120) - ' - 'EditToolStripMenuItem - ' - Me.EditToolStripMenuItem.Image = CType(resources.GetObject("EditToolStripMenuItem.Image"), System.Drawing.Image) - Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" - Me.EditToolStripMenuItem.Size = New System.Drawing.Size(190, 22) - Me.EditToolStripMenuItem.Text = "Edit" - ' - 'AddToolStripMenuItem - ' - Me.AddToolStripMenuItem.Image = CType(resources.GetObject("AddToolStripMenuItem.Image"), System.Drawing.Image) - Me.AddToolStripMenuItem.Name = "AddToolStripMenuItem" - Me.AddToolStripMenuItem.Size = New System.Drawing.Size(190, 22) - Me.AddToolStripMenuItem.Text = "Add" - ' - 'DeleteToolStripMenuItem - ' - Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) - Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" - Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(190, 22) - Me.DeleteToolStripMenuItem.Text = "Delete" - ' - 'ToolStripSeparator1 - ' - Me.ToolStripSeparator1.Name = "ToolStripSeparator1" - Me.ToolStripSeparator1.Size = New System.Drawing.Size(187, 6) - ' - 'AddToQtyToolStripMenuItem - ' - Me.AddToQtyToolStripMenuItem.Image = CType(resources.GetObject("AddToQtyToolStripMenuItem.Image"), System.Drawing.Image) - Me.AddToQtyToolStripMenuItem.Name = "AddToQtyToolStripMenuItem" - Me.AddToQtyToolStripMenuItem.Size = New System.Drawing.Size(190, 22) - Me.AddToQtyToolStripMenuItem.Text = "Add to Qty." - ' - 'MarkAsOutOfStockToolStripMenuItem - ' - Me.MarkAsOutOfStockToolStripMenuItem.Image = CType(resources.GetObject("MarkAsOutOfStockToolStripMenuItem.Image"), System.Drawing.Image) - Me.MarkAsOutOfStockToolStripMenuItem.Name = "MarkAsOutOfStockToolStripMenuItem" - Me.MarkAsOutOfStockToolStripMenuItem.Size = New System.Drawing.Size(190, 22) - Me.MarkAsOutOfStockToolStripMenuItem.Text = "Mark as Out-Of-Stock" - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'IDDataGridViewTextBoxColumn - ' - Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" - Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" - Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" - Me.IDDataGridViewTextBoxColumn.ReadOnly = True - Me.IDDataGridViewTextBoxColumn.Visible = False - ' - 'ManufacturerDataGridViewTextBoxColumn - ' - Me.ManufacturerDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.ManufacturerDataGridViewTextBoxColumn.DataPropertyName = "Manufacturer" - Me.ManufacturerDataGridViewTextBoxColumn.HeaderText = "Manufacturer" - Me.ManufacturerDataGridViewTextBoxColumn.Name = "ManufacturerDataGridViewTextBoxColumn" - Me.ManufacturerDataGridViewTextBoxColumn.ReadOnly = True - Me.ManufacturerDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.ManufacturerDataGridViewTextBoxColumn.Width = 111 - ' - 'NameDataGridViewTextBoxColumn - ' - Me.NameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.NameDataGridViewTextBoxColumn.DataPropertyName = "Name" - Me.NameDataGridViewTextBoxColumn.HeaderText = "Name" - Me.NameDataGridViewTextBoxColumn.Name = "NameDataGridViewTextBoxColumn" - Me.NameDataGridViewTextBoxColumn.ReadOnly = True - Me.NameDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.NameDataGridViewTextBoxColumn.Width = 76 - ' - 'GaugeDataGridViewTextBoxColumn - ' - Me.GaugeDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.GaugeDataGridViewTextBoxColumn.DataPropertyName = "Gauge" - Me.GaugeDataGridViewTextBoxColumn.HeaderText = "Gauge" - Me.GaugeDataGridViewTextBoxColumn.Name = "GaugeDataGridViewTextBoxColumn" - Me.GaugeDataGridViewTextBoxColumn.ReadOnly = True - Me.GaugeDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.GaugeDataGridViewTextBoxColumn.Width = 80 - ' - 'LengthDataGridViewTextBoxColumn - ' - Me.LengthDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.LengthDataGridViewTextBoxColumn.DataPropertyName = "Length" - Me.LengthDataGridViewTextBoxColumn.HeaderText = "Length" - Me.LengthDataGridViewTextBoxColumn.Name = "LengthDataGridViewTextBoxColumn" - Me.LengthDataGridViewTextBoxColumn.ReadOnly = True - Me.LengthDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.LengthDataGridViewTextBoxColumn.Width = 81 - ' - 'QtyDataGridViewTextBoxColumn - ' - Me.QtyDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.QtyDataGridViewTextBoxColumn.DataPropertyName = "Qty" - Me.QtyDataGridViewTextBoxColumn.HeaderText = "Qty" - Me.QtyDataGridViewTextBoxColumn.Name = "QtyDataGridViewTextBoxColumn" - Me.QtyDataGridViewTextBoxColumn.ReadOnly = True - Me.QtyDataGridViewTextBoxColumn.Width = 48 - ' - 'PriceDataGridViewTextBoxColumn - ' - Me.PriceDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.PriceDataGridViewTextBoxColumn.DataPropertyName = "Price" - Me.PriceDataGridViewTextBoxColumn.HeaderText = "Price" - Me.PriceDataGridViewTextBoxColumn.Name = "PriceDataGridViewTextBoxColumn" - Me.PriceDataGridViewTextBoxColumn.ReadOnly = True - Me.PriceDataGridViewTextBoxColumn.Width = 56 - ' - 'ListSGCaseBindingSource - ' - Me.ListSGCaseBindingSource.DataMember = "List_SG_Case" - Me.ListSGCaseBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'List_SG_CaseTableAdapter - ' - Me.List_SG_CaseTableAdapter.ClearBeforeFill = True - ' - 'frmView_List_ShellHulls - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(687, 326) - Me.Controls.Add(Me.DataGridView1) - Me.Controls.Add(Me.ToolStrip1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmView_List_ShellHulls" - Me.Text = "Shell Hull List" - Me.ToolStrip1.ResumeLayout(False) - Me.ToolStrip1.PerformLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() - Me.ContextMenuStrip1.ResumeLayout(False) - CType(Me.ListSGCaseBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmViewListShellHulls)) + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip() + Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel() + Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox() + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton() + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton() + Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton() + Me.ToolStripButton4 = New System.Windows.Forms.ToolStripButton() + Me.DataGridView1 = New System.Windows.Forms.DataGridView() + Me.DRAM = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() + Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.AddToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() + Me.AddToQtyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.MarkAsOutOfStockToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider() + Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.ManufacturerDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() + Me.NameDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() + Me.GaugeDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() + Me.LengthDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() + Me.QtyDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.PriceDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.ListSGCaseBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet() + Me.List_SG_CaseTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_CaseTableAdapter() + Me.ToolStrip1.SuspendLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ContextMenuStrip1.SuspendLayout() + CType(Me.ListSGCaseBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'ToolStrip1 + ' + Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel1, Me.ToolStripComboBox1, Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripButton3, Me.ToolStripButton4}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(687, 25) + Me.ToolStrip1.TabIndex = 0 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripLabel1 + ' + Me.ToolStripLabel1.Name = "ToolStripLabel1" + Me.ToolStripLabel1.Size = New System.Drawing.Size(47, 22) + Me.ToolStripLabel1.Text = "Sort By:" + ' + 'ToolStripComboBox1 + ' + Me.ToolStripComboBox1.Items.AddRange(New Object() {"All", "Instock", "Out-Of-Stock", "Reference"}) + Me.ToolStripComboBox1.Name = "ToolStripComboBox1" + Me.ToolStripComboBox1.Size = New System.Drawing.Size(121, 25) + Me.ToolStripComboBox1.Text = "All" + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton1.Text = "Add to List" + ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton2.Text = "Delete from list" + ' + 'ToolStripButton3 + ' + Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) + Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton3.Name = "ToolStripButton3" + Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton3.Text = "Refresh List" + ' + 'ToolStripButton4 + ' + Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton4.Image = CType(resources.GetObject("ToolStripButton4.Image"), System.Drawing.Image) + Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton4.Name = "ToolStripButton4" + Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton4.Text = "View Report" + ' + 'DataGridView1 + ' + Me.DataGridView1.AllowUserToAddRows = False + Me.DataGridView1.AutoGenerateColumns = False + Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.ManufacturerDataGridViewTextBoxColumn, Me.NameDataGridViewTextBoxColumn, Me.GaugeDataGridViewTextBoxColumn, Me.LengthDataGridViewTextBoxColumn, Me.DRAM, Me.QtyDataGridViewTextBoxColumn, Me.PriceDataGridViewTextBoxColumn}) + Me.DataGridView1.ContextMenuStrip = Me.ContextMenuStrip1 + Me.DataGridView1.DataSource = Me.ListSGCaseBindingSource + Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill + Me.DataGridView1.Location = New System.Drawing.Point(0, 25) + Me.DataGridView1.MultiSelect = False + Me.DataGridView1.Name = "DataGridView1" + Me.DataGridView1.ReadOnly = True + Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DataGridView1.Size = New System.Drawing.Size(687, 301) + Me.DataGridView1.TabIndex = 1 + ' + 'DRAM + ' + Me.DRAM.DataPropertyName = "DRAM" + Me.DRAM.HeaderText = "DRAM" + Me.DRAM.Name = "DRAM" + Me.DRAM.ReadOnly = True + ' + 'ContextMenuStrip1 + ' + Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EditToolStripMenuItem, Me.AddToolStripMenuItem, Me.DeleteToolStripMenuItem, Me.ToolStripSeparator1, Me.AddToQtyToolStripMenuItem, Me.MarkAsOutOfStockToolStripMenuItem}) + Me.ContextMenuStrip1.Name = "ContextMenuStrip1" + Me.ContextMenuStrip1.Size = New System.Drawing.Size(191, 120) + ' + 'EditToolStripMenuItem + ' + Me.EditToolStripMenuItem.Image = CType(resources.GetObject("EditToolStripMenuItem.Image"), System.Drawing.Image) + Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" + Me.EditToolStripMenuItem.Size = New System.Drawing.Size(190, 22) + Me.EditToolStripMenuItem.Text = "Edit" + ' + 'AddToolStripMenuItem + ' + Me.AddToolStripMenuItem.Image = CType(resources.GetObject("AddToolStripMenuItem.Image"), System.Drawing.Image) + Me.AddToolStripMenuItem.Name = "AddToolStripMenuItem" + Me.AddToolStripMenuItem.Size = New System.Drawing.Size(190, 22) + Me.AddToolStripMenuItem.Text = "Add" + ' + 'DeleteToolStripMenuItem + ' + Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) + Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" + Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(190, 22) + Me.DeleteToolStripMenuItem.Text = "Delete" + ' + 'ToolStripSeparator1 + ' + Me.ToolStripSeparator1.Name = "ToolStripSeparator1" + Me.ToolStripSeparator1.Size = New System.Drawing.Size(187, 6) + ' + 'AddToQtyToolStripMenuItem + ' + Me.AddToQtyToolStripMenuItem.Image = CType(resources.GetObject("AddToQtyToolStripMenuItem.Image"), System.Drawing.Image) + Me.AddToQtyToolStripMenuItem.Name = "AddToQtyToolStripMenuItem" + Me.AddToQtyToolStripMenuItem.Size = New System.Drawing.Size(190, 22) + Me.AddToQtyToolStripMenuItem.Text = "Add to Qty." + ' + 'MarkAsOutOfStockToolStripMenuItem + ' + Me.MarkAsOutOfStockToolStripMenuItem.Image = CType(resources.GetObject("MarkAsOutOfStockToolStripMenuItem.Image"), System.Drawing.Image) + Me.MarkAsOutOfStockToolStripMenuItem.Name = "MarkAsOutOfStockToolStripMenuItem" + Me.MarkAsOutOfStockToolStripMenuItem.Size = New System.Drawing.Size(190, 22) + Me.MarkAsOutOfStockToolStripMenuItem.Text = "Mark as Out-Of-Stock" + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'IDDataGridViewTextBoxColumn + ' + Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" + Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" + Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" + Me.IDDataGridViewTextBoxColumn.ReadOnly = True + Me.IDDataGridViewTextBoxColumn.Visible = False + ' + 'ManufacturerDataGridViewTextBoxColumn + ' + Me.ManufacturerDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.ManufacturerDataGridViewTextBoxColumn.DataPropertyName = "Manufacturer" + Me.ManufacturerDataGridViewTextBoxColumn.HeaderText = "Manufacturer" + Me.ManufacturerDataGridViewTextBoxColumn.Name = "ManufacturerDataGridViewTextBoxColumn" + Me.ManufacturerDataGridViewTextBoxColumn.ReadOnly = True + Me.ManufacturerDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.ManufacturerDataGridViewTextBoxColumn.Width = 111 + ' + 'NameDataGridViewTextBoxColumn + ' + Me.NameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.NameDataGridViewTextBoxColumn.DataPropertyName = "Name" + Me.NameDataGridViewTextBoxColumn.HeaderText = "Name" + Me.NameDataGridViewTextBoxColumn.Name = "NameDataGridViewTextBoxColumn" + Me.NameDataGridViewTextBoxColumn.ReadOnly = True + Me.NameDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.NameDataGridViewTextBoxColumn.Width = 76 + ' + 'GaugeDataGridViewTextBoxColumn + ' + Me.GaugeDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.GaugeDataGridViewTextBoxColumn.DataPropertyName = "Gauge" + Me.GaugeDataGridViewTextBoxColumn.HeaderText = "Gauge" + Me.GaugeDataGridViewTextBoxColumn.Name = "GaugeDataGridViewTextBoxColumn" + Me.GaugeDataGridViewTextBoxColumn.ReadOnly = True + Me.GaugeDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.GaugeDataGridViewTextBoxColumn.Width = 80 + ' + 'LengthDataGridViewTextBoxColumn + ' + Me.LengthDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.LengthDataGridViewTextBoxColumn.DataPropertyName = "Length" + Me.LengthDataGridViewTextBoxColumn.HeaderText = "Length" + Me.LengthDataGridViewTextBoxColumn.Name = "LengthDataGridViewTextBoxColumn" + Me.LengthDataGridViewTextBoxColumn.ReadOnly = True + Me.LengthDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.LengthDataGridViewTextBoxColumn.Width = 81 + ' + 'QtyDataGridViewTextBoxColumn + ' + Me.QtyDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.QtyDataGridViewTextBoxColumn.DataPropertyName = "Qty" + Me.QtyDataGridViewTextBoxColumn.HeaderText = "Qty" + Me.QtyDataGridViewTextBoxColumn.Name = "QtyDataGridViewTextBoxColumn" + Me.QtyDataGridViewTextBoxColumn.ReadOnly = True + Me.QtyDataGridViewTextBoxColumn.Width = 48 + ' + 'PriceDataGridViewTextBoxColumn + ' + Me.PriceDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.PriceDataGridViewTextBoxColumn.DataPropertyName = "Price" + Me.PriceDataGridViewTextBoxColumn.HeaderText = "Price" + Me.PriceDataGridViewTextBoxColumn.Name = "PriceDataGridViewTextBoxColumn" + Me.PriceDataGridViewTextBoxColumn.ReadOnly = True + Me.PriceDataGridViewTextBoxColumn.Width = 56 + ' + 'ListSGCaseBindingSource + ' + Me.ListSGCaseBindingSource.DataMember = "List_SG_Case" + Me.ListSGCaseBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'List_SG_CaseTableAdapter + ' + Me.List_SG_CaseTableAdapter.ClearBeforeFill = True + ' + 'frmView_List_ShellHulls + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(687, 326) + Me.Controls.Add(Me.DataGridView1) + Me.Controls.Add(Me.ToolStrip1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.Name = "FrmViewListShellHulls" + Me.Text = "Shell Hull List" + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ContextMenuStrip1.ResumeLayout(False) + CType(Me.ListSGCaseBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip - Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents ListSGCaseBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_SG_CaseTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_CaseTableAdapter - Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton - Friend WithEvents ContextMenuStrip1 As System.Windows.Forms.ContextMenuStrip - Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents AddToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents ToolStripButton4 As System.Windows.Forms.ToolStripButton - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider - Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel - Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox - Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents ManufacturerDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents NameDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents GaugeDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents LengthDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents DRAM As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents QtyDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents PriceDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents AddToQtyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator - Friend WithEvents MarkAsOutOfStockToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem -End Class + End Sub + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents ListSGCaseBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_SG_CaseTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_CaseTableAdapter + Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton + Friend WithEvents ContextMenuStrip1 As System.Windows.Forms.ContextMenuStrip + Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents AddToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents ToolStripButton4 As System.Windows.Forms.ToolStripButton + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel + Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox + Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents ManufacturerDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents NameDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents GaugeDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents LengthDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents DRAM As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents QtyDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents PriceDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents AddToQtyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator + Friend WithEvents MarkAsOutOfStockToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_ShellHulls.vb b/BSMyLoadersLog/Viewing/frmView_List_ShellHulls.vb index 257031e..28a9084 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_ShellHulls.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_ShellHulls.vb @@ -1,111 +1,243 @@ +Imports BSMyLoadersLog.Adding +Imports BSMyLoadersLog.Editing Imports BSMyLoadersLog.LoadersClass -Public Class frmView_List_ShellHulls - Const RegViewName As String = "View_ShellHulls" - Public Sub LoadData() - Try - Me.List_SG_CaseTableAdapter.Fill(Me.MLLDataSet.List_SG_Case) - Select Case LCase(ToolStripComboBox1.SelectedItem.ToString) - Case LCase("All") - Me.List_SG_CaseTableAdapter.Fill(Me.MLLDataSet.List_SG_Case) - Case LCase("Instock") - 'Me.List_SG_CaseTableAdapter. - Me.List_SG_CaseTableAdapter.FillBy_Menu_InStock(Me.MLLDataSet.List_SG_Case) - Case LCase("Out-Of-Stock") - Me.List_SG_CaseTableAdapter.FillBy_Menu_OutOfStock(Me.MLLDataSet.List_SG_Case) - Case LCase("Reference") - Me.List_SG_CaseTableAdapter.FillBy_Menu_Refferance(Me.MLLDataSet.List_SG_Case) - Case Else - Me.List_SG_CaseTableAdapter.Fill(Me.MLLDataSet.List_SG_Case) - End Select - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub DeleteData() - Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strSQLTable As String = "List_SG_Case" - Dim strName As String = ObjG.GetName("SELECT * from " & strSQLTable & " where ID=" & ItemID, "Name") - Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & ItemID - If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() - Catch ex As Exception - Call LogError(Me.Name, "DeleteData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmView_List_ShellHulls_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call LoadData() - End Sub +Imports BurnSoft.Applications.MLL.Global +Imports BurnSoft.Applications.MLL.Inventory - Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click - Call LoadData() - End Sub - Sub ADDShell() - Dim frmNew As New frmAddShell - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - End Sub - Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click - Call ADDShell() - End Sub - - Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click - Call DeleteData() - End Sub - - Private Sub AddToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToolStripMenuItem.Click - Call ADDShell() - End Sub - - Private Sub DeleteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click - Call DeleteData() - End Sub - Sub EditHulls() - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim frmNew As New frmEditHulls - frmNew.MdiParent = Me.MdiParent - frmNew.SID = ItemID - frmNew.FromView = True - frmNew.Show() - End Sub - - Private Sub EditToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EditToolStripMenuItem.Click - Call EditHulls() - End Sub - - Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click - Me.Cursor = Cursors.WaitCursor - frmReport_HullInventory.MdiParent = Me.MdiParent - frmReport_HullInventory.Show() - Me.Cursor = Cursors.Arrow - End Sub - - Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.BindingContextChanged - If DataGridView1.DataSource Is Nothing Then - Return - End If - DataGridView1.AutoResizeColumns() - End Sub - - Private Sub AddToQtyToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles AddToQtyToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim frmNew As New frmAddQtyHulls - frmNew.MdiParent = Me.MdiParent - frmNew.SID = ItemID - frmNew.FromView = True - frmNew.Show() - End Sub - - Private Sub MarkAsOutOfStockToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles MarkAsOutOfStockToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim SQL As String = "UPDATE List_SG_Case set QTY=0 where ID=" & ItemID - Dim Obj As New BSDatabase - Obj.ConnExec(SQL) - Call LoadData() - End Sub - Private Sub ToolStripComboBox1_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged - Call LoadData() - End Sub -End Class \ No newline at end of file +Namespace Viewing + ' TODO: #20 clean up code + ''' + ''' Class FrmViewListShellHulls. + ''' Implements the + ''' + ''' + Public Class FrmViewListShellHulls + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' Registry View name + ''' + Const RegViewName As String = "View_ShellHulls" + ''' + ''' Loads the data. + ''' + Public Sub LoadData() + Try + List_SG_CaseTableAdapter.Fill(MLLDataSet.List_SG_Case) + Select Case LCase(ToolStripComboBox1.SelectedItem.ToString) + Case LCase("All") + List_SG_CaseTableAdapter.Fill(MLLDataSet.List_SG_Case) + Case LCase("Instock") + 'List_SG_CaseTableAdapter. + List_SG_CaseTableAdapter.FillBy_Menu_InStock(MLLDataSet.List_SG_Case) + Case LCase("Out-Of-Stock") + List_SG_CaseTableAdapter.FillBy_Menu_OutOfStock(MLLDataSet.List_SG_Case) + Case LCase("Reference") + List_SG_CaseTableAdapter.FillBy_Menu_Refferance(MLLDataSet.List_SG_Case) + Case Else + List_SG_CaseTableAdapter.Fill(MLLDataSet.List_SG_Case) + End Select + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Deletes the data. + ''' + ''' + Sub DeleteData() + Try + Dim itemId As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + 'Dim Obj As New BSDatabase + 'Dim objG As New GlobalFunctions + 'Dim strSQLTable As String = "List_SG_Case" + 'Dim strName As String = objG.GetName("SELECT * from " & strSQLTable & " where ID=" & itemId, "Name") + 'Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + 'Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & itemId + 'If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() + Dim strName As String = ShotgunHullInventory.GetName(DatabasePath, itemId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + 'Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & itemId + 'If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() + If strAns = vbYes Then + If Not ShotgunHullInventory.Delete(DatabasePath, itemId, _errOut) Then Throw New Exception(_errOut) + Call LoadData() + End If + Catch ex As Exception + Call LogError(Name, "DeleteData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmView_List_ShellHulls control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmView_List_ShellHulls_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call LoadData() + End Sub + ''' + ''' Handles the Click event of the ToolStripButton3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click + Call LoadData() + End Sub + ''' + ''' Adds the shell. + ''' + Sub AddShell() + Try + Dim frmNew As New frmAddShell + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "ADDShell", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton1.Click + Call AddShell() + End Sub + ''' + ''' Handles the Click event of the ToolStripButton2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton2.Click + Call DeleteData() + End Sub + ''' + ''' Handles the Click event of the AddToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub AddToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AddToolStripMenuItem.Click + Call AddShell() + End Sub + ''' + ''' Handles the Click event of the DeleteToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DeleteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles DeleteToolStripMenuItem.Click + Call DeleteData() + End Sub + ''' + ''' Edits the hulls. + ''' + Sub EditHulls() + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim frmNew As New frmEditHulls + frmNew.MdiParent = MdiParent + frmNew.HullId = itemId + frmNew.FromView = True + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "EditHulls", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the EditToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub EditToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EditToolStripMenuItem.Click + Call EditHulls() + End Sub + ''' + ''' Handles the Click event of the ToolStripButton4 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton4.Click + Cursor = Cursors.WaitCursor + Try + frmReport_HullInventory.MdiParent = MdiParent + frmReport_HullInventory.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton4_Click", Err.Number, ex.Message.ToString) + End Try + Cursor = Cursors.Arrow + End Sub + ''' + ''' Handles the BindingContextChanged event of the DataGridView1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DataGridView1.BindingContextChanged + try + If DataGridView1.DataSource Is Nothing Then + Return + End If + DataGridView1.AutoResizeColumns() + Catch ex As Exception + Call LogError(Name, "DataGridView1_BindingContextChanged", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the AddToQtyToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub AddToQtyToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AddToQtyToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim frmNew As New FrmAddQtyHulls + frmNew.MdiParent = MdiParent + frmNew.SID = itemId + frmNew.FromView = True + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "AddToQtyToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the MarkAsOutOfStockToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub MarkAsOutOfStockToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles MarkAsOutOfStockToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + If Not ShotgunHullInventory.UpdateQty(DatabasePath, itemId, 0, _errOut) Then Throw New Exception(_errOut) + 'Dim SQL As String = "UPDATE List_SG_Case set QTY=0 where ID=" & itemId + 'Dim Obj As New BSDatabase + 'Obj.ConnExec(SQL) + Call LoadData() + Catch ex As Exception + Call LogError(Name, "MarkAsOutOfStockToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the SelectedIndexChanged event of the ToolStripComboBox1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged + Call LoadData() + End Sub + ''' + ''' Handles the FormClosing event of the FrmViewListShellHulls control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub FrmViewListShellHulls_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing + Try + If Not MyRegistry.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString, + _errOut) Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "FrmViewListShellHulls_FormClosing", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End Namespace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_Shells.vb b/BSMyLoadersLog/Viewing/frmView_List_Shells.vb index 8fd2b03..0699f3b 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_Shells.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_Shells.vb @@ -1,137 +1,251 @@ -Imports BSMyLoadersLog.LoadersClass +Imports BSMyLoadersLog.Adding +'Imports BSMyLoadersLog.LoadersClass Imports BurnSoft.Applications.MLL.Global +Imports BSMyLoadersLog.ViewReports +Imports BurnSoft.Applications.MLL.Inventory Namespace Viewing + ' TODO: #20 clean up code + ''' + ''' Class FrmViewListShells views the list of cases in inventory + ''' Implements the + ''' + ''' Public Class FrmViewListShells ''' ''' The error out ''' - Private errOut as String + Private _errOut as String + ''' + ''' The View Settings to store in registry + ''' Const RegViewName As String = "View_Shells" + ''' + ''' Loads the data. + ''' Public Sub LoadData() Try - Me.List_Case_DetailsTableAdapter.Fill(Me.MLLDataSet.List_Case_Details) + List_Case_DetailsTableAdapter.Fill(MLLDataSet.List_Case_Details) Select Case LCase(ToolStripComboBox1.SelectedItem.ToString) Case LCase("All") - Me.List_Case_DetailsTableAdapter.FillByAllManu(Me.MLLDataSet.List_Case_Details) + List_Case_DetailsTableAdapter.FillByAllManu(MLLDataSet.List_Case_Details) Case LCase("Instock") - Me.List_Case_DetailsTableAdapter.FillByINSManu(Me.MLLDataSet.List_Case_Details) + List_Case_DetailsTableAdapter.FillByINSManu(MLLDataSet.List_Case_Details) Case LCase("Out-Of-Stock") - Me.List_Case_DetailsTableAdapter.FillByOOSManu(Me.MLLDataSet.List_Case_Details) + List_Case_DetailsTableAdapter.FillByOOSManu(MLLDataSet.List_Case_Details) Case LCase("Reference") - Me.List_Case_DetailsTableAdapter.FillBy_Reference(Me.MLLDataSet.List_Case_Details) + List_Case_DetailsTableAdapter.FillBy_Reference(MLLDataSet.List_Case_Details) Case Else - Me.List_Case_DetailsTableAdapter.Fill(Me.MLLDataSet.List_Case_Details) + List_Case_DetailsTableAdapter.Fill(MLLDataSet.List_Case_Details) End Select Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) End Try End Sub - - Private Sub frmView_List_Shells_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing + ''' + ''' Handles the FormClosing event of the frmView_List_Shells control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmView_List_Shells_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) Handles Me.FormClosing Try 'Dim ObjR As New BSRegistry 'Call ObjR.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString) If Not MyRegistry.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString, - errOut) Then Throw New Exception(errOut) + _errOut) Then Throw New Exception(_errOut) Catch ex As Exception - Call LogError(Me.Name, "frmView_List_Shells_FormClosing", Err.Number, ex.Message.ToString) + Call LogError(Name, "frmView_List_Shells_FormClosing", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub frmView_List_Shells_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load + ''' + ''' Handles the Load event of the frmView_List_Shells control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmView_List_Shells_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Try 'Dim ObjR As New BSRegistry 'ToolStripComboBox1.Text = ObjR.GetViewSettings(RegViewName, "All") - ToolStripComboBox1.Text = MyRegistry.GetViewSettings(RegViewName, errOut, "All") - if errOut.Length > 0 Then Throw New Exception(errOut) + ToolStripComboBox1.Text = MyRegistry.GetViewSettings(RegViewName, _errOut, "All") + if _errOut.Length > 0 Then Throw New Exception(_errOut) Call LoadData() Catch ex As Exception - Call LogError(Me.Name, "Load", Err.Number, ex.Message.ToString) + Call LogError(Name, "Load", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub frmView_List_Shells_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize - If Me.Height <> 0 Then - Me.DataGridView1.Height = Me.Height - (65) - Me.DataGridView1.Width = Me.Width - 15 - End If + ''' + ''' Handles the Resize event of the frmView_List_Shells control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmView_List_Shells_Resize(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Resize + Try + If Height <> 0 Then + DataGridView1.Height = Height - (65) + DataGridView1.Width = Width - 15 + End If + Catch ex As Exception + Call LogError(Name, "frmView_List_Shells_Resize", Err.Number, ex.Message.ToString) + End Try End Sub - Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click + ''' + ''' Handles the Click event of the ToolStripButton2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton2.Click Try Call DeleteShell() Catch ex As Exception - Call LogError(Me.Name, "ToolStripButton2.Click", Err.Number, ex.Message.ToString) + Call LogError(Name, "ToolStripButton2.Click", Err.Number, ex.Message.ToString) End Try End Sub + ''' + ''' Deletes the shell. + ''' Sub DeleteShell() Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strSQLTable As String = "List_Case" - Dim strName As String = ObjG.GetName("SELECT * from " & strSQLTable & " where ID=" & ItemID, "Name") + Dim itemId As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + 'Dim obj As New BSDatabase + 'Dim objG As New GlobalFunctions + 'Dim strSQLTable As String = "List_Case" + 'Dim strName As String = objG.GetName("SELECT * from " & strSQLTable & " where ID=" & itemId, "Name") + 'Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + 'Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & itemId + 'If strAns = vbYes Then obj.ConnExec(SQL) : Call LoadData() + Dim strName As String = CaseInventory.GetName(DatabasePath, itemId, _errOut) + if _errOut.Length > 0 Then Throw New Exception(_errOut) Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & ItemID - If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() + + If strAns = vbYes Then + If Not CaseInventory.Delete(DatabasePath, itemId, _errOut) then Throw new Exception(_errOut) + Call LoadData() + End If Catch ex As Exception - Call LogError(Me.Name, "DeleteShell", Err.Number, ex.Message.ToString) + Call LogError(Name, "DeleteShell", Err.Number, ex.Message.ToString) End Try End Sub - Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click - Dim frmNew As New frmAddShells - frmNew.MdiParent = Me.MdiParent - frmNew.FromView = True - frmNew.Show() + Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton1.Click + Try + Dim frmNew As New frmAddShells + frmNew.MdiParent = MdiParent + frmNew.FromView = True + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton1_Click", Err.Number, ex.Message.ToString) + End Try End Sub - Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click + ''' + ''' Handles the Click event of the ToolStripButton3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click Call LoadData() End Sub - Private Sub DeleteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click + ''' + ''' Handles the Click event of the DeleteToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DeleteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles DeleteToolStripMenuItem.Click Call DeleteShell() End Sub - Private Sub AddToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToolStripMenuItem.Click - Dim frmNew As New frmAddShells - frmNew.MdiParent = Me.MdiParent - frmNew.FromView = True - frmNew.Show() + Private Sub AddToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AddToolStripMenuItem.Click + Try + Dim frmNew As New frmAddShells + frmNew.MdiParent = MdiParent + frmNew.FromView = True + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "AddToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub - Private Sub EditToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EditToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim frmNew As New frmEditShells - frmNew.MdiParent = Me.MdiParent - frmNew.SID = ItemID - frmNew.FromView = True - frmNew.Show() + Private Sub EditToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EditToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim frmNew As New frmEditShells + frmNew.MdiParent = MdiParent + frmNew.SID = itemId + frmNew.FromView = True + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "EditToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub - - Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click - Me.Cursor = Cursors.WaitCursor - frmReport_CaseInventory.MdiParent = Me.MdiParent - frmReport_CaseInventory.Show() - Me.Cursor = Cursors.Arrow + ''' + ''' Handles the Click event of the ToolStripButton4 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton4.Click + Cursor = Cursors.WaitCursor + Try + FrmReportCaseInventory.MdiParent = MdiParent + FrmReportCaseInventory.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton4_Click", Err.Number, ex.Message.ToString) + End Try + Cursor = Cursors.Arrow End Sub - Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged + ''' + ''' Handles the SelectedIndexChanged event of the ToolStripComboBox1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged Call LoadData() End Sub - Private Sub AddToQtyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToQtyToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim frmNew As New frmAddQtyShellcase - frmNew.MdiParent = Me.MdiParent - frmNew.SID = ItemID - frmNew.FromView = True - frmNew.Show() - End Sub - Private Sub MarkAsOutOfStockToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MarkAsOutOfStockToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim SQL As String = "UPDATE List_Case set QTY=0 where ID=" & ItemID - Dim Obj As New BSDatabase - Obj.ConnExec(SQL) - Call LoadData() + ''' + ''' Handles the Click event of the AddToQtyToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub AddToQtyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AddToQtyToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim frmNew As New frmAddQtyShellcase + frmNew.MdiParent = MdiParent + frmNew.CaseId = itemId + frmNew.FromView = True + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "AddToQtyToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the MarkAsOutOfStockToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub MarkAsOutOfStockToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles MarkAsOutOfStockToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + If Not CaseInventory.UpdateQty(DatabasePath, itemId, 0, _errOut) Then Throw new Exception(_errOut) + 'Dim SQL As String = "UPDATE List_Case set QTY=0 where ID=" & itemId + 'Dim Obj As New BSDatabase + 'Obj.ConnExec(SQL) + Call LoadData() + Catch ex As Exception + Call LogError(Name, "MarkAsOutOfStockToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try End Sub - Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.BindingContextChanged - If DataGridView1.DataSource Is Nothing Then - Return - End If - DataGridView1.AutoResizeColumns() + ''' + ''' Handles the BindingContextChanged event of the DataGridView1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DataGridView1.BindingContextChanged + Try + If DataGridView1.DataSource Is Nothing Then + Return + End If + DataGridView1.AutoResizeColumns() + Catch ex As Exception + Call LogError(Name, "DataGridView1_BindingContextChanged", Err.Number, ex.Message.ToString) + End Try End Sub End Class End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_Shot.Designer.vb b/BSMyLoadersLog/Viewing/frmView_List_Shot.Designer.vb index 7341000..affdaa9 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_Shot.Designer.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_Shot.Designer.vb @@ -1,290 +1,292 @@ - _ -Partial Class frmView_List_Shot - Inherits System.Windows.Forms.Form +Namespace Viewing + _ + Partial Class FrmViewListShot + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmView_List_Shot)) - Me.ListSGShotTypeDetailsBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.List_SG_ShotType_DetailsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotType_DetailsTableAdapter - Me.ToolStrip1 = New System.Windows.Forms.ToolStrip - Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel - Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox - Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton4 = New System.Windows.Forms.ToolStripButton - Me.DataGridView1 = New System.Windows.Forms.DataGridView - Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.ManufacturerDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Me.NameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.MatDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.ShotNoDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Me.WeightDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.PriceDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.cmnusGrid = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.AddToQtyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.OutOfStockToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - CType(Me.ListSGShotTypeDetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.ToolStrip1.SuspendLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.cmnusGrid.SuspendLayout() - Me.SuspendLayout() - ' - 'ListSGShotTypeDetailsBindingSource - ' - Me.ListSGShotTypeDetailsBindingSource.DataMember = "List_SG_ShotType_Details" - Me.ListSGShotTypeDetailsBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'List_SG_ShotType_DetailsTableAdapter - ' - Me.List_SG_ShotType_DetailsTableAdapter.ClearBeforeFill = True - ' - 'ToolStrip1 - ' - Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel1, Me.ToolStripComboBox1, Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripButton3, Me.ToolStripButton4}) - Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) - Me.ToolStrip1.Name = "ToolStrip1" - Me.ToolStrip1.Size = New System.Drawing.Size(648, 25) - Me.ToolStrip1.TabIndex = 2 - Me.ToolStrip1.Text = "ToolStrip1" - ' - 'ToolStripLabel1 - ' - Me.ToolStripLabel1.Name = "ToolStripLabel1" - Me.ToolStripLabel1.Size = New System.Drawing.Size(46, 22) - Me.ToolStripLabel1.Text = "Sort By:" - ' - 'ToolStripComboBox1 - ' - Me.ToolStripComboBox1.Items.AddRange(New Object() {"All", "Instock", "Out-Of-Stock", "Reference"}) - Me.ToolStripComboBox1.Name = "ToolStripComboBox1" - Me.ToolStripComboBox1.Size = New System.Drawing.Size(121, 25) - Me.ToolStripComboBox1.Text = "Default" - ' - 'ToolStripButton1 - ' - Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) - Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton1.Name = "ToolStripButton1" - Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton1.Text = "Add Bullet to List" - ' - 'ToolStripButton2 - ' - Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) - Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton2.Name = "ToolStripButton2" - Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton2.Text = "Delete" - ' - 'ToolStripButton3 - ' - Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) - Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton3.Name = "ToolStripButton3" - Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton3.Text = "Refresh" - ' - 'ToolStripButton4 - ' - Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton4.Image = CType(resources.GetObject("ToolStripButton4.Image"), System.Drawing.Image) - Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton4.Name = "ToolStripButton4" - Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton4.Text = "View Report" - ' - 'DataGridView1 - ' - Me.DataGridView1.AllowUserToAddRows = False - Me.DataGridView1.AllowUserToDeleteRows = False - Me.DataGridView1.AutoGenerateColumns = False - Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.ManufacturerDataGridViewTextBoxColumn, Me.NameDataGridViewTextBoxColumn, Me.MatDataGridViewTextBoxColumn, Me.ShotNoDataGridViewTextBoxColumn, Me.WeightDataGridViewTextBoxColumn, Me.PriceDataGridViewTextBoxColumn}) - Me.DataGridView1.ContextMenuStrip = Me.cmnusGrid - Me.DataGridView1.DataSource = Me.ListSGShotTypeDetailsBindingSource - Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill - Me.DataGridView1.Location = New System.Drawing.Point(0, 25) - Me.DataGridView1.Name = "DataGridView1" - Me.DataGridView1.ReadOnly = True - Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DataGridView1.Size = New System.Drawing.Size(648, 241) - Me.DataGridView1.TabIndex = 3 - ' - 'IDDataGridViewTextBoxColumn - ' - Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" - Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" - Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" - Me.IDDataGridViewTextBoxColumn.ReadOnly = True - Me.IDDataGridViewTextBoxColumn.Visible = False - ' - 'ManufacturerDataGridViewTextBoxColumn - ' - Me.ManufacturerDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.ManufacturerDataGridViewTextBoxColumn.DataPropertyName = "Manufacturer" - Me.ManufacturerDataGridViewTextBoxColumn.HeaderText = "Manufacturer" - Me.ManufacturerDataGridViewTextBoxColumn.Name = "ManufacturerDataGridViewTextBoxColumn" - Me.ManufacturerDataGridViewTextBoxColumn.ReadOnly = True - Me.ManufacturerDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.ManufacturerDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic - Me.ManufacturerDataGridViewTextBoxColumn.Width = 111 - ' - 'NameDataGridViewTextBoxColumn - ' - Me.NameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.NameDataGridViewTextBoxColumn.DataPropertyName = "Name" - Me.NameDataGridViewTextBoxColumn.HeaderText = "Name" - Me.NameDataGridViewTextBoxColumn.Name = "NameDataGridViewTextBoxColumn" - Me.NameDataGridViewTextBoxColumn.ReadOnly = True - Me.NameDataGridViewTextBoxColumn.Width = 60 - ' - 'MatDataGridViewTextBoxColumn - ' - Me.MatDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.MatDataGridViewTextBoxColumn.DataPropertyName = "mat" - Me.MatDataGridViewTextBoxColumn.HeaderText = "Material" - Me.MatDataGridViewTextBoxColumn.Name = "MatDataGridViewTextBoxColumn" - Me.MatDataGridViewTextBoxColumn.ReadOnly = True - Me.MatDataGridViewTextBoxColumn.Width = 69 - ' - 'ShotNoDataGridViewTextBoxColumn - ' - Me.ShotNoDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.ShotNoDataGridViewTextBoxColumn.DataPropertyName = "ShotNo" - Me.ShotNoDataGridViewTextBoxColumn.HeaderText = "Shot No." - Me.ShotNoDataGridViewTextBoxColumn.Name = "ShotNoDataGridViewTextBoxColumn" - Me.ShotNoDataGridViewTextBoxColumn.ReadOnly = True - Me.ShotNoDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.ShotNoDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic - Me.ShotNoDataGridViewTextBoxColumn.Width = 90 - ' - 'WeightDataGridViewTextBoxColumn - ' - Me.WeightDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.WeightDataGridViewTextBoxColumn.DataPropertyName = "weight" - Me.WeightDataGridViewTextBoxColumn.HeaderText = "Weight (lbs)" - Me.WeightDataGridViewTextBoxColumn.Name = "WeightDataGridViewTextBoxColumn" - Me.WeightDataGridViewTextBoxColumn.ReadOnly = True - Me.WeightDataGridViewTextBoxColumn.Width = 88 - ' - 'PriceDataGridViewTextBoxColumn - ' - Me.PriceDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.PriceDataGridViewTextBoxColumn.DataPropertyName = "Price" - Me.PriceDataGridViewTextBoxColumn.HeaderText = "Price" - Me.PriceDataGridViewTextBoxColumn.Name = "PriceDataGridViewTextBoxColumn" - Me.PriceDataGridViewTextBoxColumn.ReadOnly = True - Me.PriceDataGridViewTextBoxColumn.Width = 56 - ' - 'cmnusGrid - ' - Me.cmnusGrid.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EditToolStripMenuItem, Me.DeleteToolStripMenuItem, Me.AddToQtyToolStripMenuItem, Me.OutOfStockToolStripMenuItem}) - Me.cmnusGrid.Name = "cmnusGrid" - Me.cmnusGrid.Size = New System.Drawing.Size(191, 114) - ' - 'EditToolStripMenuItem - ' - Me.EditToolStripMenuItem.Image = CType(resources.GetObject("EditToolStripMenuItem.Image"), System.Drawing.Image) - Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" - Me.EditToolStripMenuItem.Size = New System.Drawing.Size(190, 22) - Me.EditToolStripMenuItem.Text = "&Edit" - ' - 'DeleteToolStripMenuItem - ' - Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) - Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" - Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(190, 22) - Me.DeleteToolStripMenuItem.Text = "&Delete" - ' - 'AddToQtyToolStripMenuItem - ' - Me.AddToQtyToolStripMenuItem.Image = CType(resources.GetObject("AddToQtyToolStripMenuItem.Image"), System.Drawing.Image) - Me.AddToQtyToolStripMenuItem.Name = "AddToQtyToolStripMenuItem" - Me.AddToQtyToolStripMenuItem.Size = New System.Drawing.Size(190, 22) - Me.AddToQtyToolStripMenuItem.Text = "&Add to Qty" - ' - 'OutOfStockToolStripMenuItem - ' - Me.OutOfStockToolStripMenuItem.Image = CType(resources.GetObject("OutOfStockToolStripMenuItem.Image"), System.Drawing.Image) - Me.OutOfStockToolStripMenuItem.Name = "OutOfStockToolStripMenuItem" - Me.OutOfStockToolStripMenuItem.Size = New System.Drawing.Size(190, 22) - Me.OutOfStockToolStripMenuItem.Text = "Mark As Out-Of-Stock" - ' - 'frmView_List_Shot - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(648, 266) - Me.Controls.Add(Me.DataGridView1) - Me.Controls.Add(Me.ToolStrip1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmView_List_Shot" - Me.Text = "Shot List" - CType(Me.ListSGShotTypeDetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ToolStrip1.ResumeLayout(False) - Me.ToolStrip1.PerformLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() - Me.cmnusGrid.ResumeLayout(False) - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmViewListShot)) + Me.ListSGShotTypeDetailsBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.List_SG_ShotType_DetailsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotType_DetailsTableAdapter + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip + Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel + Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton4 = New System.Windows.Forms.ToolStripButton + Me.DataGridView1 = New System.Windows.Forms.DataGridView + Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.ManufacturerDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Me.NameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.MatDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.ShotNoDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Me.WeightDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.PriceDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.cmnusGrid = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.AddToQtyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.OutOfStockToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + CType(Me.ListSGShotTypeDetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ToolStrip1.SuspendLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.cmnusGrid.SuspendLayout() + Me.SuspendLayout() + ' + 'ListSGShotTypeDetailsBindingSource + ' + Me.ListSGShotTypeDetailsBindingSource.DataMember = "List_SG_ShotType_Details" + Me.ListSGShotTypeDetailsBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'List_SG_ShotType_DetailsTableAdapter + ' + Me.List_SG_ShotType_DetailsTableAdapter.ClearBeforeFill = True + ' + 'ToolStrip1 + ' + Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel1, Me.ToolStripComboBox1, Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripButton3, Me.ToolStripButton4}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(648, 25) + Me.ToolStrip1.TabIndex = 2 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripLabel1 + ' + Me.ToolStripLabel1.Name = "ToolStripLabel1" + Me.ToolStripLabel1.Size = New System.Drawing.Size(46, 22) + Me.ToolStripLabel1.Text = "Sort By:" + ' + 'ToolStripComboBox1 + ' + Me.ToolStripComboBox1.Items.AddRange(New Object() {"All", "Instock", "Out-Of-Stock", "Reference"}) + Me.ToolStripComboBox1.Name = "ToolStripComboBox1" + Me.ToolStripComboBox1.Size = New System.Drawing.Size(121, 25) + Me.ToolStripComboBox1.Text = "Default" + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton1.Text = "Add Bullet to List" + ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton2.Text = "Delete" + ' + 'ToolStripButton3 + ' + Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) + Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton3.Name = "ToolStripButton3" + Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton3.Text = "Refresh" + ' + 'ToolStripButton4 + ' + Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton4.Image = CType(resources.GetObject("ToolStripButton4.Image"), System.Drawing.Image) + Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton4.Name = "ToolStripButton4" + Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton4.Text = "View Report" + ' + 'DataGridView1 + ' + Me.DataGridView1.AllowUserToAddRows = False + Me.DataGridView1.AllowUserToDeleteRows = False + Me.DataGridView1.AutoGenerateColumns = False + Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.ManufacturerDataGridViewTextBoxColumn, Me.NameDataGridViewTextBoxColumn, Me.MatDataGridViewTextBoxColumn, Me.ShotNoDataGridViewTextBoxColumn, Me.WeightDataGridViewTextBoxColumn, Me.PriceDataGridViewTextBoxColumn}) + Me.DataGridView1.ContextMenuStrip = Me.cmnusGrid + Me.DataGridView1.DataSource = Me.ListSGShotTypeDetailsBindingSource + Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill + Me.DataGridView1.Location = New System.Drawing.Point(0, 25) + Me.DataGridView1.Name = "DataGridView1" + Me.DataGridView1.ReadOnly = True + Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DataGridView1.Size = New System.Drawing.Size(648, 241) + Me.DataGridView1.TabIndex = 3 + ' + 'IDDataGridViewTextBoxColumn + ' + Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" + Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" + Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" + Me.IDDataGridViewTextBoxColumn.ReadOnly = True + Me.IDDataGridViewTextBoxColumn.Visible = False + ' + 'ManufacturerDataGridViewTextBoxColumn + ' + Me.ManufacturerDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.ManufacturerDataGridViewTextBoxColumn.DataPropertyName = "Manufacturer" + Me.ManufacturerDataGridViewTextBoxColumn.HeaderText = "Manufacturer" + Me.ManufacturerDataGridViewTextBoxColumn.Name = "ManufacturerDataGridViewTextBoxColumn" + Me.ManufacturerDataGridViewTextBoxColumn.ReadOnly = True + Me.ManufacturerDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.ManufacturerDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic + Me.ManufacturerDataGridViewTextBoxColumn.Width = 111 + ' + 'NameDataGridViewTextBoxColumn + ' + Me.NameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.NameDataGridViewTextBoxColumn.DataPropertyName = "Name" + Me.NameDataGridViewTextBoxColumn.HeaderText = "Name" + Me.NameDataGridViewTextBoxColumn.Name = "NameDataGridViewTextBoxColumn" + Me.NameDataGridViewTextBoxColumn.ReadOnly = True + Me.NameDataGridViewTextBoxColumn.Width = 60 + ' + 'MatDataGridViewTextBoxColumn + ' + Me.MatDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.MatDataGridViewTextBoxColumn.DataPropertyName = "mat" + Me.MatDataGridViewTextBoxColumn.HeaderText = "Material" + Me.MatDataGridViewTextBoxColumn.Name = "MatDataGridViewTextBoxColumn" + Me.MatDataGridViewTextBoxColumn.ReadOnly = True + Me.MatDataGridViewTextBoxColumn.Width = 69 + ' + 'ShotNoDataGridViewTextBoxColumn + ' + Me.ShotNoDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.ShotNoDataGridViewTextBoxColumn.DataPropertyName = "ShotNo" + Me.ShotNoDataGridViewTextBoxColumn.HeaderText = "Shot No." + Me.ShotNoDataGridViewTextBoxColumn.Name = "ShotNoDataGridViewTextBoxColumn" + Me.ShotNoDataGridViewTextBoxColumn.ReadOnly = True + Me.ShotNoDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.ShotNoDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic + Me.ShotNoDataGridViewTextBoxColumn.Width = 90 + ' + 'WeightDataGridViewTextBoxColumn + ' + Me.WeightDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.WeightDataGridViewTextBoxColumn.DataPropertyName = "weight" + Me.WeightDataGridViewTextBoxColumn.HeaderText = "Weight (lbs)" + Me.WeightDataGridViewTextBoxColumn.Name = "WeightDataGridViewTextBoxColumn" + Me.WeightDataGridViewTextBoxColumn.ReadOnly = True + Me.WeightDataGridViewTextBoxColumn.Width = 88 + ' + 'PriceDataGridViewTextBoxColumn + ' + Me.PriceDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.PriceDataGridViewTextBoxColumn.DataPropertyName = "Price" + Me.PriceDataGridViewTextBoxColumn.HeaderText = "Price" + Me.PriceDataGridViewTextBoxColumn.Name = "PriceDataGridViewTextBoxColumn" + Me.PriceDataGridViewTextBoxColumn.ReadOnly = True + Me.PriceDataGridViewTextBoxColumn.Width = 56 + ' + 'cmnusGrid + ' + Me.cmnusGrid.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EditToolStripMenuItem, Me.DeleteToolStripMenuItem, Me.AddToQtyToolStripMenuItem, Me.OutOfStockToolStripMenuItem}) + Me.cmnusGrid.Name = "cmnusGrid" + Me.cmnusGrid.Size = New System.Drawing.Size(191, 114) + ' + 'EditToolStripMenuItem + ' + Me.EditToolStripMenuItem.Image = CType(resources.GetObject("EditToolStripMenuItem.Image"), System.Drawing.Image) + Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" + Me.EditToolStripMenuItem.Size = New System.Drawing.Size(190, 22) + Me.EditToolStripMenuItem.Text = "&Edit" + ' + 'DeleteToolStripMenuItem + ' + Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) + Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" + Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(190, 22) + Me.DeleteToolStripMenuItem.Text = "&Delete" + ' + 'AddToQtyToolStripMenuItem + ' + Me.AddToQtyToolStripMenuItem.Image = CType(resources.GetObject("AddToQtyToolStripMenuItem.Image"), System.Drawing.Image) + Me.AddToQtyToolStripMenuItem.Name = "AddToQtyToolStripMenuItem" + Me.AddToQtyToolStripMenuItem.Size = New System.Drawing.Size(190, 22) + Me.AddToQtyToolStripMenuItem.Text = "&Add to Qty" + ' + 'OutOfStockToolStripMenuItem + ' + Me.OutOfStockToolStripMenuItem.Image = CType(resources.GetObject("OutOfStockToolStripMenuItem.Image"), System.Drawing.Image) + Me.OutOfStockToolStripMenuItem.Name = "OutOfStockToolStripMenuItem" + Me.OutOfStockToolStripMenuItem.Size = New System.Drawing.Size(190, 22) + Me.OutOfStockToolStripMenuItem.Text = "Mark As Out-Of-Stock" + ' + 'frmView_List_Shot + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(648, 266) + Me.Controls.Add(Me.DataGridView1) + Me.Controls.Add(Me.ToolStrip1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.Name = "FrmViewListShot" + Me.Text = "Shot List" + CType(Me.ListSGShotTypeDetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() + Me.cmnusGrid.ResumeLayout(False) + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents ListSGShotTypeDetailsBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_SG_ShotType_DetailsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotType_DetailsTableAdapter - Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip - Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel - Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox - Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton4 As System.Windows.Forms.ToolStripButton - Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView - Friend WithEvents cmnusGrid As System.Windows.Forms.ContextMenuStrip - Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents AddToQtyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents OutOfStockToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents ManufacturerDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents NameDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents MatDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents ShotNoDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents WeightDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents PriceDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn -End Class + End Sub + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents ListSGShotTypeDetailsBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_SG_ShotType_DetailsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotType_DetailsTableAdapter + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel + Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox + Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton4 As System.Windows.Forms.ToolStripButton + Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView + Friend WithEvents cmnusGrid As System.Windows.Forms.ContextMenuStrip + Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents AddToQtyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents OutOfStockToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents ManufacturerDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents NameDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents MatDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents ShotNoDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents WeightDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents PriceDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_Shot.vb b/BSMyLoadersLog/Viewing/frmView_List_Shot.vb index 590b86a..ee2800d 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_Shot.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_Shot.vb @@ -1,130 +1,233 @@ +Imports BSMyLoadersLog.Adding Imports BSMyLoadersLog.LoadersClass Imports BurnSoft.Applications.MLL.Global +Imports BurnSoft.Applications.MLL.Inventory -Public Class frmView_List_Shot - ''' - ''' The error out - ''' - Private errOut as String - Const RegViewName As String = "View_Shot" - Public Sub LoadData() - Try - Dim sValue As String = LCase(UCase(ToolStripComboBox1.SelectedItem.ToString)) - Select Case LCase(sValue) - Case LCase("All") - Me.List_SG_ShotType_DetailsTableAdapter.FillBy_Shot_All(Me.MLLDataSet.List_SG_ShotType_Details) - Case LCase("Instock") - Me.List_SG_ShotType_DetailsTableAdapter.FillBy_Shot_In_Stock(Me.MLLDataSet.List_SG_ShotType_Details) - Case LCase("Out-Of-Stock") - Me.List_SG_ShotType_DetailsTableAdapter.FillBy_Shot_Out_Of_Stock(Me.MLLDataSet.List_SG_ShotType_Details) - Case LCase("Reference") - Me.List_SG_ShotType_DetailsTableAdapter.FillBy_Shot_Referance(Me.MLLDataSet.List_SG_ShotType_Details) - Case Else - Me.List_SG_ShotType_DetailsTableAdapter.FillBy_Shot_All(Me.MLLDataSet.List_SG_ShotType_Details) - End Select - Catch ex As Exception - Dim strProcedure As String = "LoadData" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub DeleteShot() - Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strSQLTable As String = "List_SG_ShotType_Details" - Dim strName As String = ObjG.GetName("SELECT * from " & strSQLTable & " where ID=" & ItemID, "Name") - Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & ItemID - If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() - Catch ex As Exception - Dim strProcedure As String = "DeleteShot" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmView_List_Shot_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing +Namespace Viewing + + Public Class FrmViewListShot + ' TODO: #20 clean up code + ''' + ''' The error out + ''' + Private _errOut as String + ''' + ''' Registry setting for the selected list to view + ''' + Const RegViewName As String = "View_Shot" + ''' + ''' Loads the data. + ''' + Public Sub LoadData() + Try + Dim sValue As String = LCase(UCase(ToolStripComboBox1.SelectedItem.ToString)) + Select Case LCase(sValue) + Case LCase("All") + List_SG_ShotType_DetailsTableAdapter.FillBy_Shot_All(MLLDataSet.List_SG_ShotType_Details) + Case LCase("Instock") + List_SG_ShotType_DetailsTableAdapter.FillBy_Shot_In_Stock(MLLDataSet.List_SG_ShotType_Details) + Case LCase("Out-Of-Stock") + List_SG_ShotType_DetailsTableAdapter.FillBy_Shot_Out_Of_Stock(MLLDataSet.List_SG_ShotType_Details) + Case LCase("Reference") + List_SG_ShotType_DetailsTableAdapter.FillBy_Shot_Referance(MLLDataSet.List_SG_ShotType_Details) + Case Else + List_SG_ShotType_DetailsTableAdapter.FillBy_Shot_All(MLLDataSet.List_SG_ShotType_Details) + End Select + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Deletes the shot. + ''' + Private Sub DeleteShot() + Try + Dim itemId As long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + 'Dim Obj As New BSDatabase + 'Dim objG As New GlobalFunctions + 'Dim strSQLTable As String = "List_SG_ShotType_Details" + 'Dim strName As String = objG.GetName("SELECT * from " & strSQLTable & " where ID=" & itemId, "Name") + 'Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + 'Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & ItemID + 'If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() + + Dim strName As String = ShotgunShotTypeInventory.GetName(DatabasePath, itemId, _errOut) + if _errOut.Length > 0 Then Throw New Exception(_errOut) + Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + + If strAns = vbYes Then + If Not ShotgunShotTypeInventory.Delete(DatabasePath, itemId, _errOut) then Throw new Exception(_errOut) + Call LoadData() + End If + Catch ex As Exception + Call LogError(Name, "DeleteShot", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the FormClosing event of the frmView_List_Shot control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmView_List_Shot_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) Handles Me.FormClosing - Try - 'Dim ObjR As New BSRegistry - 'Call ObjR.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString) - If Not MyRegistry.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString, - errOut) Then Throw New Exception(errOut) - Catch ex As Exception - Dim strProcedure As String = "frmView_List_Shot_FormClosing" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmViewShotList_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - 'Dim ObjR As New BSRegistry - 'ToolStripComboBox1.Text = ObjR.GetViewSettings(RegViewName, "All") - 'Call LoadData() - Try - ToolStripComboBox1.Text = MyRegistry.GetViewSettings(RegViewName, errOut, "All") - if errOut.Length > 0 Then Throw New Exception(errOut) + Try + 'Dim ObjR As New BSRegistry + 'Call ObjR.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString) + If Not MyRegistry.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString, + _errOut) Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "frmView_List_Shot_FormClosing", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmViewShotList control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmViewShotList_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load 'Dim ObjR As New BSRegistry 'ToolStripComboBox1.Text = ObjR.GetViewSettings(RegViewName, "All") + 'Call LoadData() + Try + ToolStripComboBox1.Text = MyRegistry.GetViewSettings(RegViewName, _errOut, "All") + if _errOut.Length > 0 Then Throw New Exception(_errOut) + 'Dim ObjR As New BSRegistry + 'ToolStripComboBox1.Text = ObjR.GetViewSettings(RegViewName, "All") + Call LoadData() + Catch ex As Exception + Call LogError(Name, "frmViewShotList_Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click + Call LoadData() + End Sub + ''' + ''' Handles the Click event of the ToolStripButton1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton1.Click + Try + Dim frmNew As New frmAddShot + frmNew.FromView = True + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton1_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton2.Click + Call DeleteShot() + End Sub + ''' + ''' Handles the Click event of the ToolStripButton4 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton4.Click + Cursor = Cursors.WaitCursor + Try + frmReport_ShotInventory.MdiParent = MdiParent + frmReport_ShotInventory.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton4_Click", Err.Number, ex.Message.ToString) + End Try + Cursor = Cursors.Arrow + End Sub + ''' + ''' Handles the SelectedIndexChanged event of the ToolStripComboBox1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged Call LoadData() - Catch ex As Exception - Dim strProcedure As String = "frmViewShotList_Load" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click - Call LoadData() - End Sub - Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click - Dim frmNew As New frmAddShot - frmNew.FromView = True - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - End Sub - Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click - Call DeleteShot() - End Sub - Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click - Me.Cursor = Cursors.WaitCursor - frmReport_ShotInventory.MdiParent = Me.MdiParent - frmReport_ShotInventory.Show() - Me.Cursor = Cursors.Arrow - End Sub - Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged - Call LoadData() - End Sub - Private Sub DeleteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click - Call DeleteShot() - End Sub - Private Sub EditToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EditToolStripMenuItem.Click - Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim frmNew As New frmEditShot - frmNew.BID = ItemID - frmNew.FromView = True - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - Catch ex As Exception - Dim strProcedure As String = "EditToolStripMenuItem_Click" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub OutOfStockToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OutOfStockToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim SQL As String = "UPDATE List_SG_ShotType_Details set weight=0 where ID=" & ItemID - Dim Obj As New BSDatabase - Obj.ConnExec(SQL) - Call LoadData() - End Sub - Private Sub AddToQtyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToQtyToolStripMenuItem.Click - Dim frmNew As New frmAddQtyShot - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - frmNew.BID = ItemID - frmNew.FromView = True - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - End Sub - Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.BindingContextChanged - If DataGridView1.DataSource Is Nothing Then - Return - End If - DataGridView1.AutoResizeColumns() - End Sub -End Class \ No newline at end of file + End Sub + ''' + ''' Handles the Click event of the DeleteToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DeleteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles DeleteToolStripMenuItem.Click + Call DeleteShot() + End Sub + ''' + ''' Handles the Click event of the EditToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub EditToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EditToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim frmNew As New frmEditShot + frmNew.BID = itemId + frmNew.FromView = True + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "EditToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the OutOfStockToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub OutOfStockToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles OutOfStockToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + If Not ShotgunShotTypeInventory.UpdateQty(DatabasePath, itemId, 0, + 0, 0, _errOut) Then Throw new Exception(_errOut) + 'Dim SQL As String = "UPDATE List_SG_ShotType_Details set weight=0 where ID=" & itemId + 'Dim Obj As New BSDatabase + 'Obj.ConnExec(SQL) + Call LoadData() + Catch ex As Exception + Call LogError(Name, "OutOfStockToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the AddToQtyToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub AddToQtyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AddToQtyToolStripMenuItem.Click + Try + Dim frmNew As New frmAddQtyShot + Dim itemId As long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + frmNew.ShotId = itemId + frmNew.FromView = True + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "AddToQtyToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the BindingContextChanged event of the DataGridView1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DataGridView1.BindingContextChanged + Try + If DataGridView1.DataSource Is Nothing Then + Return + End If + DataGridView1.AutoResizeColumns() + Catch ex As Exception + Call LogError(Name, "DataGridView1_BindingContextChanged", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_Slug.Designer.vb b/BSMyLoadersLog/Viewing/frmView_List_Slug.Designer.vb index 099f016..ce3df3c 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_Slug.Designer.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_Slug.Designer.vb @@ -1,291 +1,293 @@ - _ -Partial Class frmView_List_Slug - Inherits System.Windows.Forms.Form +Namespace Viewing + _ + Partial Class FrmViewListSlug + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmView_List_Slug)) - Me.ToolStrip1 = New System.Windows.Forms.ToolStrip - Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel - Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox - Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton4 = New System.Windows.Forms.ToolStripButton - Me.DataGridView1 = New System.Windows.Forms.DataGridView - Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.ManufacturerDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Me.NameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.CALDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Me.WeightDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.QtyDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.PriceDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.EppsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.ListSGShotTypeDetailsBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.List_SG_ShotType_DetailsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotType_DetailsTableAdapter - Me.cmnusGrid = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.AddToQtyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.OutOfStockToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.ToolStrip1.SuspendLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.ListSGShotTypeDetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.cmnusGrid.SuspendLayout() - Me.SuspendLayout() - ' - 'ToolStrip1 - ' - Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel1, Me.ToolStripComboBox1, Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripButton3, Me.ToolStripButton4}) - Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) - Me.ToolStrip1.Name = "ToolStrip1" - Me.ToolStrip1.Size = New System.Drawing.Size(808, 25) - Me.ToolStrip1.TabIndex = 3 - Me.ToolStrip1.Text = "ToolStrip1" - ' - 'ToolStripLabel1 - ' - Me.ToolStripLabel1.Name = "ToolStripLabel1" - Me.ToolStripLabel1.Size = New System.Drawing.Size(46, 22) - Me.ToolStripLabel1.Text = "Sort By:" - ' - 'ToolStripComboBox1 - ' - Me.ToolStripComboBox1.Items.AddRange(New Object() {"All", "Instock", "Out-Of-Stock", "Reference"}) - Me.ToolStripComboBox1.Name = "ToolStripComboBox1" - Me.ToolStripComboBox1.Size = New System.Drawing.Size(121, 25) - Me.ToolStripComboBox1.Text = "Default" - ' - 'ToolStripButton1 - ' - Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) - Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton1.Name = "ToolStripButton1" - Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton1.Text = "Add Bullet to List" - ' - 'ToolStripButton2 - ' - Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) - Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton2.Name = "ToolStripButton2" - Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton2.Text = "Delete" - ' - 'ToolStripButton3 - ' - Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) - Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton3.Name = "ToolStripButton3" - Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton3.Text = "Refresh" - ' - 'ToolStripButton4 - ' - Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton4.Image = CType(resources.GetObject("ToolStripButton4.Image"), System.Drawing.Image) - Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton4.Name = "ToolStripButton4" - Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton4.Text = "View Report" - ' - 'DataGridView1 - ' - Me.DataGridView1.AllowUserToAddRows = False - Me.DataGridView1.AllowUserToDeleteRows = False - Me.DataGridView1.AutoGenerateColumns = False - Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.ManufacturerDataGridViewTextBoxColumn, Me.NameDataGridViewTextBoxColumn, Me.CALDataGridViewTextBoxColumn, Me.WeightDataGridViewTextBoxColumn, Me.QtyDataGridViewTextBoxColumn, Me.PriceDataGridViewTextBoxColumn, Me.EppsDataGridViewTextBoxColumn}) - Me.DataGridView1.ContextMenuStrip = Me.cmnusGrid - Me.DataGridView1.DataSource = Me.ListSGShotTypeDetailsBindingSource - Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill - Me.DataGridView1.Location = New System.Drawing.Point(0, 25) - Me.DataGridView1.Name = "DataGridView1" - Me.DataGridView1.ReadOnly = True - Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DataGridView1.Size = New System.Drawing.Size(808, 241) - Me.DataGridView1.TabIndex = 4 - ' - 'IDDataGridViewTextBoxColumn - ' - Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" - Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" - Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" - Me.IDDataGridViewTextBoxColumn.ReadOnly = True - Me.IDDataGridViewTextBoxColumn.Visible = False - ' - 'ManufacturerDataGridViewTextBoxColumn - ' - Me.ManufacturerDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.ManufacturerDataGridViewTextBoxColumn.DataPropertyName = "Manufacturer" - Me.ManufacturerDataGridViewTextBoxColumn.HeaderText = "Manufacturer" - Me.ManufacturerDataGridViewTextBoxColumn.Name = "ManufacturerDataGridViewTextBoxColumn" - Me.ManufacturerDataGridViewTextBoxColumn.ReadOnly = True - Me.ManufacturerDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.ManufacturerDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic - Me.ManufacturerDataGridViewTextBoxColumn.Width = 111 - ' - 'NameDataGridViewTextBoxColumn - ' - Me.NameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.NameDataGridViewTextBoxColumn.DataPropertyName = "Name" - Me.NameDataGridViewTextBoxColumn.HeaderText = "Name" - Me.NameDataGridViewTextBoxColumn.Name = "NameDataGridViewTextBoxColumn" - Me.NameDataGridViewTextBoxColumn.ReadOnly = True - Me.NameDataGridViewTextBoxColumn.Width = 60 - ' - 'CALDataGridViewTextBoxColumn - ' - Me.CALDataGridViewTextBoxColumn.DataPropertyName = "CAL" - Me.CALDataGridViewTextBoxColumn.HeaderText = "Caliber" - Me.CALDataGridViewTextBoxColumn.Name = "CALDataGridViewTextBoxColumn" - Me.CALDataGridViewTextBoxColumn.ReadOnly = True - Me.CALDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.CALDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic - ' - 'WeightDataGridViewTextBoxColumn - ' - Me.WeightDataGridViewTextBoxColumn.DataPropertyName = "weight" - Me.WeightDataGridViewTextBoxColumn.HeaderText = "Weight" - Me.WeightDataGridViewTextBoxColumn.Name = "WeightDataGridViewTextBoxColumn" - Me.WeightDataGridViewTextBoxColumn.ReadOnly = True - ' - 'QtyDataGridViewTextBoxColumn - ' - Me.QtyDataGridViewTextBoxColumn.DataPropertyName = "Qty" - Me.QtyDataGridViewTextBoxColumn.HeaderText = "Qty" - Me.QtyDataGridViewTextBoxColumn.Name = "QtyDataGridViewTextBoxColumn" - Me.QtyDataGridViewTextBoxColumn.ReadOnly = True - ' - 'PriceDataGridViewTextBoxColumn - ' - Me.PriceDataGridViewTextBoxColumn.DataPropertyName = "Price" - Me.PriceDataGridViewTextBoxColumn.HeaderText = "Price" - Me.PriceDataGridViewTextBoxColumn.Name = "PriceDataGridViewTextBoxColumn" - Me.PriceDataGridViewTextBoxColumn.ReadOnly = True - ' - 'EppsDataGridViewTextBoxColumn - ' - Me.EppsDataGridViewTextBoxColumn.DataPropertyName = "epps" - Me.EppsDataGridViewTextBoxColumn.HeaderText = "Price Per Slug" - Me.EppsDataGridViewTextBoxColumn.Name = "EppsDataGridViewTextBoxColumn" - Me.EppsDataGridViewTextBoxColumn.ReadOnly = True - ' - 'ListSGShotTypeDetailsBindingSource - ' - Me.ListSGShotTypeDetailsBindingSource.DataMember = "List_SG_ShotType_Details" - Me.ListSGShotTypeDetailsBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'List_SG_ShotType_DetailsTableAdapter - ' - Me.List_SG_ShotType_DetailsTableAdapter.ClearBeforeFill = True - ' - 'cmnusGrid - ' - Me.cmnusGrid.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EditToolStripMenuItem, Me.DeleteToolStripMenuItem, Me.AddToQtyToolStripMenuItem, Me.OutOfStockToolStripMenuItem}) - Me.cmnusGrid.Name = "cmnusGrid" - Me.cmnusGrid.Size = New System.Drawing.Size(191, 92) - ' - 'EditToolStripMenuItem - ' - Me.EditToolStripMenuItem.Image = CType(resources.GetObject("EditToolStripMenuItem.Image"), System.Drawing.Image) - Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" - Me.EditToolStripMenuItem.Size = New System.Drawing.Size(190, 22) - Me.EditToolStripMenuItem.Text = "&Edit" - ' - 'DeleteToolStripMenuItem - ' - Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) - Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" - Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(190, 22) - Me.DeleteToolStripMenuItem.Text = "&Delete" - ' - 'AddToQtyToolStripMenuItem - ' - Me.AddToQtyToolStripMenuItem.Image = CType(resources.GetObject("AddToQtyToolStripMenuItem.Image"), System.Drawing.Image) - Me.AddToQtyToolStripMenuItem.Name = "AddToQtyToolStripMenuItem" - Me.AddToQtyToolStripMenuItem.Size = New System.Drawing.Size(190, 22) - Me.AddToQtyToolStripMenuItem.Text = "&Add to Qty" - ' - 'OutOfStockToolStripMenuItem - ' - Me.OutOfStockToolStripMenuItem.Image = CType(resources.GetObject("OutOfStockToolStripMenuItem.Image"), System.Drawing.Image) - Me.OutOfStockToolStripMenuItem.Name = "OutOfStockToolStripMenuItem" - Me.OutOfStockToolStripMenuItem.Size = New System.Drawing.Size(190, 22) - Me.OutOfStockToolStripMenuItem.Text = "Mark As Out-Of-Stock" - ' - 'frmView_List_Slug - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(808, 266) - Me.Controls.Add(Me.DataGridView1) - Me.Controls.Add(Me.ToolStrip1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmView_List_Slug" - Me.Text = "Slug List" - Me.ToolStrip1.ResumeLayout(False) - Me.ToolStrip1.PerformLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.ListSGShotTypeDetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.cmnusGrid.ResumeLayout(False) - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmViewListSlug)) + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip + Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel + Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton4 = New System.Windows.Forms.ToolStripButton + Me.DataGridView1 = New System.Windows.Forms.DataGridView + Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.ManufacturerDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Me.NameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.CALDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Me.WeightDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.QtyDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.PriceDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.EppsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.ListSGShotTypeDetailsBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.List_SG_ShotType_DetailsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotType_DetailsTableAdapter + Me.cmnusGrid = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.AddToQtyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.OutOfStockToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.ToolStrip1.SuspendLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ListSGShotTypeDetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.cmnusGrid.SuspendLayout() + Me.SuspendLayout() + ' + 'ToolStrip1 + ' + Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel1, Me.ToolStripComboBox1, Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripButton3, Me.ToolStripButton4}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(808, 25) + Me.ToolStrip1.TabIndex = 3 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripLabel1 + ' + Me.ToolStripLabel1.Name = "ToolStripLabel1" + Me.ToolStripLabel1.Size = New System.Drawing.Size(46, 22) + Me.ToolStripLabel1.Text = "Sort By:" + ' + 'ToolStripComboBox1 + ' + Me.ToolStripComboBox1.Items.AddRange(New Object() {"All", "Instock", "Out-Of-Stock", "Reference"}) + Me.ToolStripComboBox1.Name = "ToolStripComboBox1" + Me.ToolStripComboBox1.Size = New System.Drawing.Size(121, 25) + Me.ToolStripComboBox1.Text = "Default" + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton1.Text = "Add Bullet to List" + ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton2.Text = "Delete" + ' + 'ToolStripButton3 + ' + Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) + Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton3.Name = "ToolStripButton3" + Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton3.Text = "Refresh" + ' + 'ToolStripButton4 + ' + Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton4.Image = CType(resources.GetObject("ToolStripButton4.Image"), System.Drawing.Image) + Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton4.Name = "ToolStripButton4" + Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton4.Text = "View Report" + ' + 'DataGridView1 + ' + Me.DataGridView1.AllowUserToAddRows = False + Me.DataGridView1.AllowUserToDeleteRows = False + Me.DataGridView1.AutoGenerateColumns = False + Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.ManufacturerDataGridViewTextBoxColumn, Me.NameDataGridViewTextBoxColumn, Me.CALDataGridViewTextBoxColumn, Me.WeightDataGridViewTextBoxColumn, Me.QtyDataGridViewTextBoxColumn, Me.PriceDataGridViewTextBoxColumn, Me.EppsDataGridViewTextBoxColumn}) + Me.DataGridView1.ContextMenuStrip = Me.cmnusGrid + Me.DataGridView1.DataSource = Me.ListSGShotTypeDetailsBindingSource + Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill + Me.DataGridView1.Location = New System.Drawing.Point(0, 25) + Me.DataGridView1.Name = "DataGridView1" + Me.DataGridView1.ReadOnly = True + Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DataGridView1.Size = New System.Drawing.Size(808, 241) + Me.DataGridView1.TabIndex = 4 + ' + 'IDDataGridViewTextBoxColumn + ' + Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" + Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" + Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" + Me.IDDataGridViewTextBoxColumn.ReadOnly = True + Me.IDDataGridViewTextBoxColumn.Visible = False + ' + 'ManufacturerDataGridViewTextBoxColumn + ' + Me.ManufacturerDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.ManufacturerDataGridViewTextBoxColumn.DataPropertyName = "Manufacturer" + Me.ManufacturerDataGridViewTextBoxColumn.HeaderText = "Manufacturer" + Me.ManufacturerDataGridViewTextBoxColumn.Name = "ManufacturerDataGridViewTextBoxColumn" + Me.ManufacturerDataGridViewTextBoxColumn.ReadOnly = True + Me.ManufacturerDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.ManufacturerDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic + Me.ManufacturerDataGridViewTextBoxColumn.Width = 111 + ' + 'NameDataGridViewTextBoxColumn + ' + Me.NameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.NameDataGridViewTextBoxColumn.DataPropertyName = "Name" + Me.NameDataGridViewTextBoxColumn.HeaderText = "Name" + Me.NameDataGridViewTextBoxColumn.Name = "NameDataGridViewTextBoxColumn" + Me.NameDataGridViewTextBoxColumn.ReadOnly = True + Me.NameDataGridViewTextBoxColumn.Width = 60 + ' + 'CALDataGridViewTextBoxColumn + ' + Me.CALDataGridViewTextBoxColumn.DataPropertyName = "CAL" + Me.CALDataGridViewTextBoxColumn.HeaderText = "Caliber" + Me.CALDataGridViewTextBoxColumn.Name = "CALDataGridViewTextBoxColumn" + Me.CALDataGridViewTextBoxColumn.ReadOnly = True + Me.CALDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.CALDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic + ' + 'WeightDataGridViewTextBoxColumn + ' + Me.WeightDataGridViewTextBoxColumn.DataPropertyName = "weight" + Me.WeightDataGridViewTextBoxColumn.HeaderText = "Weight" + Me.WeightDataGridViewTextBoxColumn.Name = "WeightDataGridViewTextBoxColumn" + Me.WeightDataGridViewTextBoxColumn.ReadOnly = True + ' + 'QtyDataGridViewTextBoxColumn + ' + Me.QtyDataGridViewTextBoxColumn.DataPropertyName = "Qty" + Me.QtyDataGridViewTextBoxColumn.HeaderText = "Qty" + Me.QtyDataGridViewTextBoxColumn.Name = "QtyDataGridViewTextBoxColumn" + Me.QtyDataGridViewTextBoxColumn.ReadOnly = True + ' + 'PriceDataGridViewTextBoxColumn + ' + Me.PriceDataGridViewTextBoxColumn.DataPropertyName = "Price" + Me.PriceDataGridViewTextBoxColumn.HeaderText = "Price" + Me.PriceDataGridViewTextBoxColumn.Name = "PriceDataGridViewTextBoxColumn" + Me.PriceDataGridViewTextBoxColumn.ReadOnly = True + ' + 'EppsDataGridViewTextBoxColumn + ' + Me.EppsDataGridViewTextBoxColumn.DataPropertyName = "epps" + Me.EppsDataGridViewTextBoxColumn.HeaderText = "Price Per Slug" + Me.EppsDataGridViewTextBoxColumn.Name = "EppsDataGridViewTextBoxColumn" + Me.EppsDataGridViewTextBoxColumn.ReadOnly = True + ' + 'ListSGShotTypeDetailsBindingSource + ' + Me.ListSGShotTypeDetailsBindingSource.DataMember = "List_SG_ShotType_Details" + Me.ListSGShotTypeDetailsBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'List_SG_ShotType_DetailsTableAdapter + ' + Me.List_SG_ShotType_DetailsTableAdapter.ClearBeforeFill = True + ' + 'cmnusGrid + ' + Me.cmnusGrid.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EditToolStripMenuItem, Me.DeleteToolStripMenuItem, Me.AddToQtyToolStripMenuItem, Me.OutOfStockToolStripMenuItem}) + Me.cmnusGrid.Name = "cmnusGrid" + Me.cmnusGrid.Size = New System.Drawing.Size(191, 92) + ' + 'EditToolStripMenuItem + ' + Me.EditToolStripMenuItem.Image = CType(resources.GetObject("EditToolStripMenuItem.Image"), System.Drawing.Image) + Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" + Me.EditToolStripMenuItem.Size = New System.Drawing.Size(190, 22) + Me.EditToolStripMenuItem.Text = "&Edit" + ' + 'DeleteToolStripMenuItem + ' + Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) + Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" + Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(190, 22) + Me.DeleteToolStripMenuItem.Text = "&Delete" + ' + 'AddToQtyToolStripMenuItem + ' + Me.AddToQtyToolStripMenuItem.Image = CType(resources.GetObject("AddToQtyToolStripMenuItem.Image"), System.Drawing.Image) + Me.AddToQtyToolStripMenuItem.Name = "AddToQtyToolStripMenuItem" + Me.AddToQtyToolStripMenuItem.Size = New System.Drawing.Size(190, 22) + Me.AddToQtyToolStripMenuItem.Text = "&Add to Qty" + ' + 'OutOfStockToolStripMenuItem + ' + Me.OutOfStockToolStripMenuItem.Image = CType(resources.GetObject("OutOfStockToolStripMenuItem.Image"), System.Drawing.Image) + Me.OutOfStockToolStripMenuItem.Name = "OutOfStockToolStripMenuItem" + Me.OutOfStockToolStripMenuItem.Size = New System.Drawing.Size(190, 22) + Me.OutOfStockToolStripMenuItem.Text = "Mark As Out-Of-Stock" + ' + 'frmView_List_Slug + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(808, 266) + Me.Controls.Add(Me.DataGridView1) + Me.Controls.Add(Me.ToolStrip1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.Name = "FrmViewListSlug" + Me.Text = "Slug List" + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ListSGShotTypeDetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.cmnusGrid.ResumeLayout(False) + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip - Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel - Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox - Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton4 As System.Windows.Forms.ToolStripButton - Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents ListSGShotTypeDetailsBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_SG_ShotType_DetailsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotType_DetailsTableAdapter - Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents ManufacturerDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents NameDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents CALDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents WeightDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents QtyDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents PriceDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents EppsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents cmnusGrid As System.Windows.Forms.ContextMenuStrip - Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents AddToQtyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents OutOfStockToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem -End Class + End Sub + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel + Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox + Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton4 As System.Windows.Forms.ToolStripButton + Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents ListSGShotTypeDetailsBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_SG_ShotType_DetailsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_ShotType_DetailsTableAdapter + Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents ManufacturerDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents NameDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents CALDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents WeightDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents QtyDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents PriceDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents EppsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents cmnusGrid As System.Windows.Forms.ContextMenuStrip + Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents AddToQtyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents OutOfStockToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_Slug.vb b/BSMyLoadersLog/Viewing/frmView_List_Slug.vb index 75e1c04..71ad6b0 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_Slug.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_Slug.vb @@ -1,129 +1,241 @@ -Imports BSMyLoadersLog.LoadersClass +Imports BSMyLoadersLog.Adding +'Imports BSMyLoadersLog.LoadersClass Imports BurnSoft.Applications.MLL.Global +Imports BurnSoft.Applications.MLL.Inventory -Public Class frmView_List_Slug +Namespace Viewing + ' TODO: #20 clean up code ''' - ''' The error out + ''' Class FrmViewListSlug. + ''' Implements the ''' - Private errOut as String - Const RegViewName As String = "View_Slug" + ''' + Public Class FrmViewListSlug + ''' + ''' The error out + ''' + Private _errOut As String + ''' + ''' Registry Selected View Settings + ''' + Const RegViewName As String = "View_Slug" #Region "Subs and Functions" - Public Sub LoadData() - Try - Dim sValue As String = LCase(UCase(ToolStripComboBox1.SelectedItem.ToString)) - Select Case LCase(sValue) - Case LCase("All") - Me.List_SG_ShotType_DetailsTableAdapter.FillBy_Slug_All(Me.MLLDataSet.List_SG_ShotType_Details) - Case LCase("Instock") - Me.List_SG_ShotType_DetailsTableAdapter.FillBy_Slug_Instock_Manu(Me.MLLDataSet.List_SG_ShotType_Details) - Case LCase("Out-Of-Stock") - Me.List_SG_ShotType_DetailsTableAdapter.FillBy_Slug_OutOfstock_Manu(Me.MLLDataSet.List_SG_ShotType_Details) - Case LCase("Reference") - Me.List_SG_ShotType_DetailsTableAdapter.FillBy_Slug_Ref_Manu(Me.MLLDataSet.List_SG_ShotType_Details) - Case Else - Me.List_SG_ShotType_DetailsTableAdapter.FillBy_Slug_All(Me.MLLDataSet.List_SG_ShotType_Details) - End Select - Catch ex As Exception - Dim strProcedure As String = "LoadData" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub DeleteSlug() - Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strSQLTable As String = "List_SG_ShotType_Details" - Dim strName As String = ObjG.GetName("SELECT * from " & strSQLTable & " where ID=" & ItemID, "Name") - Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & ItemID - If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() - Catch ex As Exception - Dim strProcedure As String = "DeleteSlug" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub + ''' + ''' Loads the data. + ''' + Public Sub LoadData() + Try + Dim sValue As String = LCase(UCase(ToolStripComboBox1.SelectedItem.ToString)) + Select Case LCase(sValue) + Case LCase("All") + List_SG_ShotType_DetailsTableAdapter.FillBy_Slug_All(MLLDataSet.List_SG_ShotType_Details) + Case LCase("Instock") + List_SG_ShotType_DetailsTableAdapter.FillBy_Slug_Instock_Manu(MLLDataSet.List_SG_ShotType_Details) + Case LCase("Out-Of-Stock") + List_SG_ShotType_DetailsTableAdapter.FillBy_Slug_OutOfstock_Manu(MLLDataSet.List_SG_ShotType_Details) + Case LCase("Reference") + List_SG_ShotType_DetailsTableAdapter.FillBy_Slug_Ref_Manu(MLLDataSet.List_SG_ShotType_Details) + Case Else + List_SG_ShotType_DetailsTableAdapter.FillBy_Slug_All(MLLDataSet.List_SG_ShotType_Details) + End Select + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Deletes the slug. + ''' + ''' + Private Sub DeleteSlug() + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + 'Dim obj As New BSDatabase + 'Dim objG As New GlobalFunctions + 'Dim strSqlTable As String = "List_SG_ShotType_Details" + 'Dim strName As String = objG.GetName("SELECT * from " & strSqlTable & " where ID=" & itemId, "Name") + 'Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + 'Dim sql As String = "DELETE from " & strSqlTable & " where ID=" & itemId + 'If strAns = vbYes Then obj.ConnExec(sql) : Call LoadData() + Dim strName As String = ShotgunShotTypeInventory.GetName(DatabasePath, itemId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + + If strAns = vbYes Then + If Not ShotgunShotTypeInventory.Delete(DatabasePath, itemId, _errOut) Then Throw New Exception(_errOut) + Call LoadData() + End If + Catch ex As Exception + Call LogError(Name, "DeleteSlug", Err.Number, ex.Message.ToString) + End Try + End Sub #End Region #Region "Form & DataGRid Subs" - Private Sub frmView_List_Slug_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing - 'Dim ObjR As New BSRegistry - 'Call ObjR.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString) - Try + ''' + ''' Handles the FormClosing event of the frmView_List_Slug control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmView_List_Slug_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) Handles Me.FormClosing 'Dim ObjR As New BSRegistry 'Call ObjR.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString) - If Not MyRegistry.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString, - errOut) Then Throw New Exception(errOut) - Catch ex As Exception - Dim strProcedure As String = "frmView_List_Slug_FormClosing" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmView_List_Slug_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - 'Dim ObjR As New BSRegistry - 'ToolStripComboBox1.Text = ObjR.GetViewSettings(RegViewName, "All") - 'Call LoadData() - Try - ToolStripComboBox1.Text = MyRegistry.GetViewSettings(RegViewName, errOut, "All") - if errOut.Length > 0 Then Throw New Exception(errOut) + Try + 'Dim ObjR As New BSRegistry + 'Call ObjR.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString) + If Not MyRegistry.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString, + _errOut) Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "frmView_List_Slug_FormClosing", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmView_List_Slug control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmView_List_Slug_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load 'Dim ObjR As New BSRegistry 'ToolStripComboBox1.Text = ObjR.GetViewSettings(RegViewName, "All") - Call LoadData() - Catch ex As Exception - Dim strProcedure As String = "frmView_List_Slug_Load" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.BindingContextChanged - If DataGridView1.DataSource Is Nothing Then - Return - End If - DataGridView1.AutoResizeColumns() - End Sub + 'Call LoadData() + Try + ToolStripComboBox1.Text = MyRegistry.GetViewSettings(RegViewName, _errOut, "All") + If _errOut.Length > 0 Then Throw New Exception(_errOut) + 'Dim ObjR As New BSRegistry + 'ToolStripComboBox1.Text = ObjR.GetViewSettings(RegViewName, "All") + Call LoadData() + Catch ex As Exception + Call LogError(Name, "frmView_List_Slug_Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the BindingContextChanged event of the DataGridView1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DataGridView1.BindingContextChanged + Try + If DataGridView1.DataSource Is Nothing Then + Return + End If + DataGridView1.AutoResizeColumns() + Catch ex As Exception + Call LogError(Name, "DataGridView1_BindingContextChanged", Err.Number, ex.Message.ToString) + End Try + End Sub #End Region #Region "Tool Strip Subs" - Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click - frmAddSlugs.MdiParent = Me.MdiParent - frmAddSlugs.FromView = True - frmAddSlugs.Show() - End Sub - Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click - Call LoadData() - End Sub - Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click - Call DeleteSlug() - End Sub - Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click - frmReport_SlugInventory.MdiParent = Me.MdiParent - frmReport_SlugInventory.Show() - End Sub - Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged - Call LoadData() - End Sub + ''' + ''' Handles the Click event of the ToolStripButton1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton1.Click + Try + frmAddSlugs.MdiParent = MdiParent + frmAddSlugs.FromView = True + frmAddSlugs.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton1_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click + Call LoadData() + End Sub + ''' + ''' Handles the Click event of the ToolStripButton2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton2.Click + Call DeleteSlug() + End Sub + ''' + ''' Handles the Click event of the ToolStripButton4 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton4.Click + Try + frmReport_SlugInventory.MdiParent = MdiParent + frmReport_SlugInventory.Show() + Catch ex As Exception + Call LogError(Name, "", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the SelectedIndexChanged event of the ToolStripComboBox1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged + Call LoadData() + End Sub #End Region #Region "Menu Subs" - Private Sub EditToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EditToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - frmEditSlug.MdiParent = Me.MdiParent - frmEditSlug.FromView = True - frmEditSlug.SID = ItemID - frmEditSlug.Show() - End Sub - Private Sub AddToQtyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToQtyToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - frmAddQtySlug.MdiParent = Me.MdiParent - frmAddQtySlug.fromview = True - frmAddQtySlug.SID = ItemID - frmAddQtySlug.Show() - End Sub - Private Sub DeleteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click - Call DeleteSlug() - End Sub - Private Sub OutOfStockToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OutOfStockToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim SQL As String = "UPDATE List_SG_ShotType_Details set qty=0 where ID=" & ItemID - Dim Obj As New BSDatabase - Obj.ConnExec(SQL) - Call LoadData() - End Sub + ''' + ''' Handles the Click event of the EditToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub EditToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EditToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + frmEditSlug.MdiParent = MdiParent + frmEditSlug.FromView = True + frmEditSlug.SID = itemId + frmEditSlug.Show() + Catch ex As Exception + Call LogError(Name, "", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the AddToQtyToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub AddToQtyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AddToQtyToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + FrmAddQtySlug.MdiParent = MdiParent + FrmAddQtySlug.FromView = True + FrmAddQtySlug.SlugId = itemId + FrmAddQtySlug.Show() + Catch ex As Exception + Call LogError(Name, "", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the DeleteToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DeleteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles DeleteToolStripMenuItem.Click + Call DeleteSlug() + End Sub + ''' + ''' Handles the Click event of the OutOfStockToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub OutOfStockToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles OutOfStockToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + If Not ShotgunShotTypeInventory.UpdateSlugQty(DatabasePath, itemId, 0, _errOut) Then Throw New Exception(_errOut) + 'Dim SQL As String = "UPDATE List_SG_ShotType_Details set qty=0 where ID=" & itemId + 'Dim Obj As New BSDatabase + 'Obj.ConnExec(SQL) + Call LoadData() + Catch ex As Exception + Call LogError(Name, "", Err.Number, ex.Message.ToString) + End Try + End Sub #End Region -End Class \ No newline at end of file + End Class +End Namespace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_WADS.Designer.vb b/BSMyLoadersLog/Viewing/frmView_List_WADS.Designer.vb index 0f4544d..b5db36c 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_WADS.Designer.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_WADS.Designer.vb @@ -1,299 +1,301 @@ - _ -Partial Class frmView_List_WADS - Inherits System.Windows.Forms.Form +Namespace Viewing + _ + Partial Class FrmViewListWads + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmView_List_WADS)) - Me.ToolStrip1 = New System.Windows.Forms.ToolStrip - Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel - Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox - Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton - Me.ToolStripButton4 = New System.Windows.Forms.ToolStripButton - Me.DataGridView1 = New System.Windows.Forms.DataGridView - Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.ManufacturerDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Me.WADDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.gauge = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Me.load_t = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Me.QtyDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.PriceDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn - Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.AddToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.ListSGWADBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.List_SG_WADTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_WADTableAdapter - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - Me.AddToQtyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.MarkAsOutOfStockToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem - Me.ToolStrip1.SuspendLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.ContextMenuStrip1.SuspendLayout() - CType(Me.ListSGWADBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'ToolStrip1 - ' - Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel1, Me.ToolStripComboBox1, Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripButton3, Me.ToolStripButton4}) - Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) - Me.ToolStrip1.Name = "ToolStrip1" - Me.ToolStrip1.Size = New System.Drawing.Size(614, 25) - Me.ToolStrip1.TabIndex = 0 - Me.ToolStrip1.Text = "ToolStrip1" - ' - 'ToolStripLabel1 - ' - Me.ToolStripLabel1.Name = "ToolStripLabel1" - Me.ToolStripLabel1.Size = New System.Drawing.Size(46, 22) - Me.ToolStripLabel1.Text = "Sort By:" - ' - 'ToolStripComboBox1 - ' - Me.ToolStripComboBox1.Items.AddRange(New Object() {"All", "Instock", "Out-Of-Stock", "Reference"}) - Me.ToolStripComboBox1.Name = "ToolStripComboBox1" - Me.ToolStripComboBox1.Size = New System.Drawing.Size(121, 25) - Me.ToolStripComboBox1.Text = "All" - ' - 'ToolStripButton1 - ' - Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) - Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton1.Name = "ToolStripButton1" - Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton1.Text = "Add to WAD List" - ' - 'ToolStripButton2 - ' - Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) - Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton2.Name = "ToolStripButton2" - Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton2.Text = "Delete from WAD List" - ' - 'ToolStripButton3 - ' - Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) - Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton3.Name = "ToolStripButton3" - Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton3.Text = "Refresh WAD List" - ' - 'ToolStripButton4 - ' - Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton4.Image = CType(resources.GetObject("ToolStripButton4.Image"), System.Drawing.Image) - Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton4.Name = "ToolStripButton4" - Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton4.Text = "View Report" - ' - 'DataGridView1 - ' - Me.DataGridView1.AllowUserToAddRows = False - Me.DataGridView1.AllowUserToDeleteRows = False - Me.DataGridView1.AutoGenerateColumns = False - Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.ManufacturerDataGridViewTextBoxColumn, Me.WADDataGridViewTextBoxColumn, Me.gauge, Me.load_t, Me.QtyDataGridViewTextBoxColumn, Me.PriceDataGridViewTextBoxColumn}) - Me.DataGridView1.ContextMenuStrip = Me.ContextMenuStrip1 - Me.DataGridView1.DataSource = Me.ListSGWADBindingSource - Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill - Me.DataGridView1.Location = New System.Drawing.Point(0, 25) - Me.DataGridView1.Name = "DataGridView1" - Me.DataGridView1.ReadOnly = True - Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DataGridView1.Size = New System.Drawing.Size(614, 241) - Me.DataGridView1.TabIndex = 1 - ' - 'IDDataGridViewTextBoxColumn - ' - Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" - Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" - Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" - Me.IDDataGridViewTextBoxColumn.ReadOnly = True - Me.IDDataGridViewTextBoxColumn.Visible = False - ' - 'ManufacturerDataGridViewTextBoxColumn - ' - Me.ManufacturerDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.ManufacturerDataGridViewTextBoxColumn.DataPropertyName = "Manufacturer" - Me.ManufacturerDataGridViewTextBoxColumn.HeaderText = "Manufacturer" - Me.ManufacturerDataGridViewTextBoxColumn.Name = "ManufacturerDataGridViewTextBoxColumn" - Me.ManufacturerDataGridViewTextBoxColumn.ReadOnly = True - Me.ManufacturerDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - Me.ManufacturerDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic - Me.ManufacturerDataGridViewTextBoxColumn.Width = 116 - ' - 'WADDataGridViewTextBoxColumn - ' - Me.WADDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.WADDataGridViewTextBoxColumn.DataPropertyName = "WAD" - Me.WADDataGridViewTextBoxColumn.HeaderText = "WAD" - Me.WADDataGridViewTextBoxColumn.Name = "WADDataGridViewTextBoxColumn" - Me.WADDataGridViewTextBoxColumn.ReadOnly = True - Me.WADDataGridViewTextBoxColumn.Width = 58 - ' - 'gauge - ' - Me.gauge.DataPropertyName = "gauge" - Me.gauge.HeaderText = "Gauge" - Me.gauge.Name = "gauge" - Me.gauge.ReadOnly = True - Me.gauge.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic - ' - 'load_t - ' - Me.load_t.DataPropertyName = "load_t" - Me.load_t.HeaderText = "Max Load (oz.)" - Me.load_t.Name = "load_t" - Me.load_t.ReadOnly = True - Me.load_t.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic - ' - 'QtyDataGridViewTextBoxColumn - ' - Me.QtyDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.QtyDataGridViewTextBoxColumn.DataPropertyName = "Qty" - Me.QtyDataGridViewTextBoxColumn.HeaderText = "Qty" - Me.QtyDataGridViewTextBoxColumn.Name = "QtyDataGridViewTextBoxColumn" - Me.QtyDataGridViewTextBoxColumn.ReadOnly = True - Me.QtyDataGridViewTextBoxColumn.Width = 48 - ' - 'PriceDataGridViewTextBoxColumn - ' - Me.PriceDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells - Me.PriceDataGridViewTextBoxColumn.DataPropertyName = "Price" - Me.PriceDataGridViewTextBoxColumn.HeaderText = "Price" - Me.PriceDataGridViewTextBoxColumn.Name = "PriceDataGridViewTextBoxColumn" - Me.PriceDataGridViewTextBoxColumn.ReadOnly = True - Me.PriceDataGridViewTextBoxColumn.Width = 56 - ' - 'ContextMenuStrip1 - ' - Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EditToolStripMenuItem, Me.AddToolStripMenuItem, Me.DeleteToolStripMenuItem, Me.AddToQtyToolStripMenuItem, Me.MarkAsOutOfStockToolStripMenuItem}) - Me.ContextMenuStrip1.Name = "ContextMenuStrip1" - Me.ContextMenuStrip1.Size = New System.Drawing.Size(190, 136) - ' - 'EditToolStripMenuItem - ' - Me.EditToolStripMenuItem.Image = CType(resources.GetObject("EditToolStripMenuItem.Image"), System.Drawing.Image) - Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" - Me.EditToolStripMenuItem.Size = New System.Drawing.Size(189, 22) - Me.EditToolStripMenuItem.Text = "Edit" - ' - 'AddToolStripMenuItem - ' - Me.AddToolStripMenuItem.Image = CType(resources.GetObject("AddToolStripMenuItem.Image"), System.Drawing.Image) - Me.AddToolStripMenuItem.Name = "AddToolStripMenuItem" - Me.AddToolStripMenuItem.Size = New System.Drawing.Size(189, 22) - Me.AddToolStripMenuItem.Text = "Add" - ' - 'DeleteToolStripMenuItem - ' - Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) - Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" - Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(189, 22) - Me.DeleteToolStripMenuItem.Text = "Delete" - ' - 'ListSGWADBindingSource - ' - Me.ListSGWADBindingSource.DataMember = "List_SG_WAD" - Me.ListSGWADBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'List_SG_WADTableAdapter - ' - Me.List_SG_WADTableAdapter.ClearBeforeFill = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'AddToQtyToolStripMenuItem - ' - Me.AddToQtyToolStripMenuItem.Name = "AddToQtyToolStripMenuItem" - Me.AddToQtyToolStripMenuItem.Size = New System.Drawing.Size(189, 22) - Me.AddToQtyToolStripMenuItem.Text = "Add to Qty" - ' - 'MarkAsOutOfStockToolStripMenuItem - ' - Me.MarkAsOutOfStockToolStripMenuItem.Name = "MarkAsOutOfStockToolStripMenuItem" - Me.MarkAsOutOfStockToolStripMenuItem.Size = New System.Drawing.Size(189, 22) - Me.MarkAsOutOfStockToolStripMenuItem.Text = "Mark as Out-Of-Stock" - ' - 'frmView_List_WADS - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(614, 266) - Me.Controls.Add(Me.DataGridView1) - Me.Controls.Add(Me.ToolStrip1) - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmView_List_WADS" - Me.Text = "WAD List" - Me.ToolStrip1.ResumeLayout(False) - Me.ToolStrip1.PerformLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() - Me.ContextMenuStrip1.ResumeLayout(False) - CType(Me.ListSGWADBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmViewListWads)) + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip + Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel + Me.ToolStripComboBox1 = New System.Windows.Forms.ToolStripComboBox + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton + Me.ToolStripButton4 = New System.Windows.Forms.ToolStripButton + Me.DataGridView1 = New System.Windows.Forms.DataGridView + Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.ManufacturerDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Me.WADDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.gauge = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Me.load_t = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Me.QtyDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.PriceDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn + Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.EditToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.AddToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.DeleteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.ListSGWADBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet + Me.List_SG_WADTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_WADTableAdapter + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider + Me.AddToQtyToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.MarkAsOutOfStockToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem + Me.ToolStrip1.SuspendLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.ContextMenuStrip1.SuspendLayout() + CType(Me.ListSGWADBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'ToolStrip1 + ' + Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripLabel1, Me.ToolStripComboBox1, Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripButton3, Me.ToolStripButton4}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(614, 25) + Me.ToolStrip1.TabIndex = 0 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripLabel1 + ' + Me.ToolStripLabel1.Name = "ToolStripLabel1" + Me.ToolStripLabel1.Size = New System.Drawing.Size(46, 22) + Me.ToolStripLabel1.Text = "Sort By:" + ' + 'ToolStripComboBox1 + ' + Me.ToolStripComboBox1.Items.AddRange(New Object() {"All", "Instock", "Out-Of-Stock", "Reference"}) + Me.ToolStripComboBox1.Name = "ToolStripComboBox1" + Me.ToolStripComboBox1.Size = New System.Drawing.Size(121, 25) + Me.ToolStripComboBox1.Text = "All" + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton1.Text = "Add to WAD List" + ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton2.Text = "Delete from WAD List" + ' + 'ToolStripButton3 + ' + Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) + Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton3.Name = "ToolStripButton3" + Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton3.Text = "Refresh WAD List" + ' + 'ToolStripButton4 + ' + Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton4.Image = CType(resources.GetObject("ToolStripButton4.Image"), System.Drawing.Image) + Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton4.Name = "ToolStripButton4" + Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton4.Text = "View Report" + ' + 'DataGridView1 + ' + Me.DataGridView1.AllowUserToAddRows = False + Me.DataGridView1.AllowUserToDeleteRows = False + Me.DataGridView1.AutoGenerateColumns = False + Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.ManufacturerDataGridViewTextBoxColumn, Me.WADDataGridViewTextBoxColumn, Me.gauge, Me.load_t, Me.QtyDataGridViewTextBoxColumn, Me.PriceDataGridViewTextBoxColumn}) + Me.DataGridView1.ContextMenuStrip = Me.ContextMenuStrip1 + Me.DataGridView1.DataSource = Me.ListSGWADBindingSource + Me.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill + Me.DataGridView1.Location = New System.Drawing.Point(0, 25) + Me.DataGridView1.Name = "DataGridView1" + Me.DataGridView1.ReadOnly = True + Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DataGridView1.Size = New System.Drawing.Size(614, 241) + Me.DataGridView1.TabIndex = 1 + ' + 'IDDataGridViewTextBoxColumn + ' + Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" + Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" + Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" + Me.IDDataGridViewTextBoxColumn.ReadOnly = True + Me.IDDataGridViewTextBoxColumn.Visible = False + ' + 'ManufacturerDataGridViewTextBoxColumn + ' + Me.ManufacturerDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.ManufacturerDataGridViewTextBoxColumn.DataPropertyName = "Manufacturer" + Me.ManufacturerDataGridViewTextBoxColumn.HeaderText = "Manufacturer" + Me.ManufacturerDataGridViewTextBoxColumn.Name = "ManufacturerDataGridViewTextBoxColumn" + Me.ManufacturerDataGridViewTextBoxColumn.ReadOnly = True + Me.ManufacturerDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + Me.ManufacturerDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic + Me.ManufacturerDataGridViewTextBoxColumn.Width = 116 + ' + 'WADDataGridViewTextBoxColumn + ' + Me.WADDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.WADDataGridViewTextBoxColumn.DataPropertyName = "WAD" + Me.WADDataGridViewTextBoxColumn.HeaderText = "WAD" + Me.WADDataGridViewTextBoxColumn.Name = "WADDataGridViewTextBoxColumn" + Me.WADDataGridViewTextBoxColumn.ReadOnly = True + Me.WADDataGridViewTextBoxColumn.Width = 58 + ' + 'gauge + ' + Me.gauge.DataPropertyName = "gauge" + Me.gauge.HeaderText = "Gauge" + Me.gauge.Name = "gauge" + Me.gauge.ReadOnly = True + Me.gauge.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic + ' + 'load_t + ' + Me.load_t.DataPropertyName = "load_t" + Me.load_t.HeaderText = "Max Load (oz.)" + Me.load_t.Name = "load_t" + Me.load_t.ReadOnly = True + Me.load_t.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic + ' + 'QtyDataGridViewTextBoxColumn + ' + Me.QtyDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.QtyDataGridViewTextBoxColumn.DataPropertyName = "Qty" + Me.QtyDataGridViewTextBoxColumn.HeaderText = "Qty" + Me.QtyDataGridViewTextBoxColumn.Name = "QtyDataGridViewTextBoxColumn" + Me.QtyDataGridViewTextBoxColumn.ReadOnly = True + Me.QtyDataGridViewTextBoxColumn.Width = 48 + ' + 'PriceDataGridViewTextBoxColumn + ' + Me.PriceDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells + Me.PriceDataGridViewTextBoxColumn.DataPropertyName = "Price" + Me.PriceDataGridViewTextBoxColumn.HeaderText = "Price" + Me.PriceDataGridViewTextBoxColumn.Name = "PriceDataGridViewTextBoxColumn" + Me.PriceDataGridViewTextBoxColumn.ReadOnly = True + Me.PriceDataGridViewTextBoxColumn.Width = 56 + ' + 'ContextMenuStrip1 + ' + Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.EditToolStripMenuItem, Me.AddToolStripMenuItem, Me.DeleteToolStripMenuItem, Me.AddToQtyToolStripMenuItem, Me.MarkAsOutOfStockToolStripMenuItem}) + Me.ContextMenuStrip1.Name = "ContextMenuStrip1" + Me.ContextMenuStrip1.Size = New System.Drawing.Size(190, 136) + ' + 'EditToolStripMenuItem + ' + Me.EditToolStripMenuItem.Image = CType(resources.GetObject("EditToolStripMenuItem.Image"), System.Drawing.Image) + Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" + Me.EditToolStripMenuItem.Size = New System.Drawing.Size(189, 22) + Me.EditToolStripMenuItem.Text = "Edit" + ' + 'AddToolStripMenuItem + ' + Me.AddToolStripMenuItem.Image = CType(resources.GetObject("AddToolStripMenuItem.Image"), System.Drawing.Image) + Me.AddToolStripMenuItem.Name = "AddToolStripMenuItem" + Me.AddToolStripMenuItem.Size = New System.Drawing.Size(189, 22) + Me.AddToolStripMenuItem.Text = "Add" + ' + 'DeleteToolStripMenuItem + ' + Me.DeleteToolStripMenuItem.Image = CType(resources.GetObject("DeleteToolStripMenuItem.Image"), System.Drawing.Image) + Me.DeleteToolStripMenuItem.Name = "DeleteToolStripMenuItem" + Me.DeleteToolStripMenuItem.Size = New System.Drawing.Size(189, 22) + Me.DeleteToolStripMenuItem.Text = "Delete" + ' + 'ListSGWADBindingSource + ' + Me.ListSGWADBindingSource.DataMember = "List_SG_WAD" + Me.ListSGWADBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'List_SG_WADTableAdapter + ' + Me.List_SG_WADTableAdapter.ClearBeforeFill = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'AddToQtyToolStripMenuItem + ' + Me.AddToQtyToolStripMenuItem.Name = "AddToQtyToolStripMenuItem" + Me.AddToQtyToolStripMenuItem.Size = New System.Drawing.Size(189, 22) + Me.AddToQtyToolStripMenuItem.Text = "Add to Qty" + ' + 'MarkAsOutOfStockToolStripMenuItem + ' + Me.MarkAsOutOfStockToolStripMenuItem.Name = "MarkAsOutOfStockToolStripMenuItem" + Me.MarkAsOutOfStockToolStripMenuItem.Size = New System.Drawing.Size(189, 22) + Me.MarkAsOutOfStockToolStripMenuItem.Text = "Mark as Out-Of-Stock" + ' + 'frmView_List_WADS + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(614, 266) + Me.Controls.Add(Me.DataGridView1) + Me.Controls.Add(Me.ToolStrip1) + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.Name = "FrmViewListWads" + Me.Text = "WAD List" + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ContextMenuStrip1.ResumeLayout(False) + CType(Me.ListSGWADBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip - Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents ListSGWADBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents List_SG_WADTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_WADTableAdapter - Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton - Friend WithEvents ContextMenuStrip1 As System.Windows.Forms.ContextMenuStrip - Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents AddToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents ToolStripButton4 As System.Windows.Forms.ToolStripButton - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider - Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel - Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox - Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents ManufacturerDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents WADDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents gauge As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents load_t As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents QtyDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents PriceDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents AddToQtyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents MarkAsOutOfStockToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem -End Class + End Sub + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents ListSGWADBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents List_SG_WADTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.List_SG_WADTableAdapter + Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton + Friend WithEvents ContextMenuStrip1 As System.Windows.Forms.ContextMenuStrip + Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents AddToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents DeleteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents ToolStripButton4 As System.Windows.Forms.ToolStripButton + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel + Friend WithEvents ToolStripComboBox1 As System.Windows.Forms.ToolStripComboBox + Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents ManufacturerDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents WADDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents gauge As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents load_t As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents QtyDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents PriceDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents AddToQtyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents MarkAsOutOfStockToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_List_WADS.vb b/BSMyLoadersLog/Viewing/frmView_List_WADS.vb index c128ada..2e1e3d7 100644 --- a/BSMyLoadersLog/Viewing/frmView_List_WADS.vb +++ b/BSMyLoadersLog/Viewing/frmView_List_WADS.vb @@ -1,131 +1,243 @@ +Imports BSMyLoadersLog.Adding Imports BSMyLoadersLog.LoadersClass Imports BurnSoft.Applications.MLL.Global +Imports BurnSoft.Applications.MLL.Inventory -Public Class frmView_List_WADS - ''' - ''' The error out - ''' - Private errOut as String - Const RegViewName As String = "View_WADS" - Public Sub LoadData() - Try - Select Case LCase(UCase(ToolStripComboBox1.SelectedItem.ToString)) - Case LCase("All") - Me.List_SG_WADTableAdapter.FillBy_Manufacturer(Me.MLLDataSet.List_SG_WAD) - Case LCase("Instock") - Me.List_SG_WADTableAdapter.FillBy_In_Stock(Me.MLLDataSet.List_SG_WAD) - Case LCase("Out-Of-Stock") - Me.List_SG_WADTableAdapter.FillBy_Out_Of_Stock(Me.MLLDataSet.List_SG_WAD) - Case LCase("Reference") - Me.List_SG_WADTableAdapter.FillBy_Referance(Me.MLLDataSet.List_SG_WAD) - Case Else - Me.List_SG_WADTableAdapter.Fill(Me.MLLDataSet.List_SG_WAD) - End Select - Catch ex As Exception - Dim strProcedure As String = "LoadData" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Sub DeleteData() - Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strSQLTable As String = "List_SG_WAD" - Dim strName As String = ObjG.GetName("SELECT * from " & strSQLTable & " where ID=" & ItemID, "WAD") - Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & ItemID - If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() - Catch ex As Exception - Dim strProcedure As String = "DeleteData" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Sub AddWAD() - Dim frmNew As New frmAddWad - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - End Sub - Private Sub frmView_List_WADS_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing - 'Dim ObjR As New BSRegistry - 'Call ObjR.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString) - Try +Namespace Viewing + + Public Class FrmViewListWads + ''' + ''' The error out + ''' + Private _errOut as String + ''' + ''' View settings for this form + ''' + Const RegViewName As String = "View_WADS" + ''' + ''' Loads the data. + ''' + Public Sub LoadData() + Try + Select Case LCase(UCase(ToolStripComboBox1.SelectedItem.ToString)) + Case LCase("All") + List_SG_WADTableAdapter.FillBy_Manufacturer(MLLDataSet.List_SG_WAD) + Case LCase("Instock") + List_SG_WADTableAdapter.FillBy_In_Stock(MLLDataSet.List_SG_WAD) + Case LCase("Out-Of-Stock") + List_SG_WADTableAdapter.FillBy_Out_Of_Stock(MLLDataSet.List_SG_WAD) + Case LCase("Reference") + List_SG_WADTableAdapter.FillBy_Referance(MLLDataSet.List_SG_WAD) + Case Else + List_SG_WADTableAdapter.Fill(MLLDataSet.List_SG_WAD) + End Select + Catch ex As Exception + Dim strProcedure As String = "LoadData" + Call LogError(Name, strProcedure, Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Deletes the data. + ''' + ''' + Sub DeleteData() + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + 'Dim obj As New BSDatabase + 'Dim objG As New GlobalFunctions + 'Dim strSqlTable As String = "List_SG_WAD" + 'Dim strName As String = objG.GetName("SELECT * from " & strSqlTable & " where ID=" & itemId, "WAD") + 'Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + 'Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & ItemID + 'If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() + Dim strName As String = WadInventory.GetName(DatabasePath, itemId, _errOut) + if _errOut.Length > 0 Then Throw New Exception(_errOut) + Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + + If strAns = vbYes Then + If Not WadInventory.Delete(DatabasePath, itemId, _errOut) then Throw new Exception(_errOut) + Call LoadData() + End If + Catch ex As Exception + Call LogError(Name, "DeleteData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Adds the wad. + ''' + Sub AddWad() + Try + Dim frmNew As New frmAddWad + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "AddWad", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the FormClosing event of the frmView_List_WADS control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmView_List_WADS_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) Handles Me.FormClosing 'Dim ObjR As New BSRegistry 'Call ObjR.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString) - If Not MyRegistry.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString, - errOut) Then Throw New Exception(errOut) - Catch ex As Exception - Dim strProcedure As String = "frmView_List_WADS_FormClosing" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmView_List_WADS_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - 'Call LoadData() - Try - ToolStripComboBox1.Text = MyRegistry.GetViewSettings(RegViewName, errOut, "All") - if errOut.Length > 0 Then Throw New Exception(errOut) - 'Dim ObjR As New BSRegistry - 'ToolStripComboBox1.Text = ObjR.GetViewSettings(RegViewName, "All") + Try + 'Dim ObjR As New BSRegistry + 'Call ObjR.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString) + If Not MyRegistry.SaveViewSettings(RegViewName, ToolStripComboBox1.SelectedItem.ToString, + _errOut) Then Throw New Exception(_errOut) + Catch ex As Exception + Call LogError(Name, "frmView_List_WADS_FormClosing", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmView_List_WADS control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + ''' + Private Sub frmView_List_WADS_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + 'Call LoadData() + Try + ToolStripComboBox1.Text = MyRegistry.GetViewSettings(RegViewName, _errOut, "All") + if _errOut.Length > 0 Then Throw New Exception(_errOut) + 'Dim ObjR As New BSRegistry + 'ToolStripComboBox1.Text = ObjR.GetViewSettings(RegViewName, "All") + Call LoadData() + Catch ex As Exception + Call LogError(Name, "frmView_List_WADS_Load", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton1.Click + Call AddWad() + End Sub + ''' + ''' Handles the Click event of the EditToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub EditToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EditToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim frmNew As New frmEditWADS + frmNew.MdiParent = MdiParent + frmNew.SID = itemId + frmNew.FromView = True + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "EditToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the AddToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub AddToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AddToolStripMenuItem.Click + Call AddWad() + End Sub + ''' + ''' Handles the Click event of the DeleteToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DeleteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles DeleteToolStripMenuItem.Click + Call DeleteData() + End Sub + ''' + ''' Handles the Click event of the ToolStripButton2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton2.Click + Call DeleteData() + End Sub + ''' + ''' Handles the Click event of the ToolStripButton3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click Call LoadData() - Catch ex As Exception - Dim strProcedure As String = "frmView_List_WADS_Load" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click - Call AddWAD() - End Sub - Private Sub EditToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EditToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim frmNew As New frmEditWADS - frmNew.MdiParent = Me.MdiParent - frmNew.SID = ItemID - frmNew.FromView = True - frmNew.Show() - End Sub - Private Sub AddToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToolStripMenuItem.Click - Call AddWAD() - End Sub - Private Sub DeleteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click - Call DeleteData() - End Sub - Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click - Call DeleteData() - End Sub - Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click - Call LoadData() - End Sub - Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click - Me.Cursor = Cursors.WaitCursor - frmReport_WADInventory.MdiParent = Me.MdiParent - frmReport_WADInventory.Show() - Me.Cursor = Cursors.Arrow - End Sub - Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged - Call LoadData() - End Sub - - Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.BindingContextChanged - If DataGridView1.DataSource Is Nothing Then - Return - End If - DataGridView1.AutoResizeColumns() - End Sub - - Private Sub AddToQtyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToQtyToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim frmNew As New frmAddQtyWAD - frmNew.FromView = True - frmNew.WID = ItemID - frmNew.MdiParent = Me.MdiParent - frmNew.Show() - End Sub - - Private Sub MarkAsOutOfStockToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MarkAsOutOfStockToolStripMenuItem.Click - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim SQL As String = "UPDATE List_SG_WAD set qty=0 where ID=" & ItemID - Dim Obj As New BSDatabase - Obj.ConnExec(SQL) - Call LoadData() - End Sub -End Class \ No newline at end of file + End Sub + ''' + ''' Handles the Click event of the ToolStripButton4 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton4.Click + Cursor = Cursors.WaitCursor + Try + frmReport_WADInventory.MdiParent = MdiParent + frmReport_WADInventory.Show() + Catch ex As Exception + Call LogError(Name, "ToolStripButton4_Click", Err.Number, ex.Message.ToString) + End Try + Cursor = Cursors.Arrow + End Sub + ''' + ''' Handles the SelectedIndexChanged event of the ToolStripComboBox1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged + Call LoadData() + End Sub + ''' + ''' Handles the BindingContextChanged event of the DataGridView1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DataGridView1.BindingContextChanged + Try + If DataGridView1.DataSource Is Nothing Then + Return + End If + DataGridView1.AutoResizeColumns() + Catch ex As Exception + Call LogError(Name, "DataGridView1_BindingContextChanged", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the AddToQtyToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub AddToQtyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AddToQtyToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + Dim frmNew As New frmAddQtyWAD + frmNew.FromView = True + frmNew.WadId = itemId + frmNew.MdiParent = MdiParent + frmNew.Show() + Catch ex As Exception + Call LogError(Name, "AddToQtyToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the MarkAsOutOfStockToolStripMenuItem control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub MarkAsOutOfStockToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles MarkAsOutOfStockToolStripMenuItem.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + If Not WadInventory.UpdateQty(DatabasePath, itemId, 0, _errOut) then Throw New Exception(_errOut) + 'Dim SQL As String = "UPDATE List_SG_WAD set qty=0 where ID=" & itemId + 'Dim Obj As New BSDatabase + 'Obj.ConnExec(SQL) + Call LoadData() + Catch ex As Exception + Call LogError(Name, "MarkAsOutOfStockToolStripMenuItem_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_Loaded_Ammunition.Designer.vb b/BSMyLoadersLog/Viewing/frmView_Loaded_Ammunition.Designer.vb index fdfe0eb..c38901e 100644 --- a/BSMyLoadersLog/Viewing/frmView_Loaded_Ammunition.Designer.vb +++ b/BSMyLoadersLog/Viewing/frmView_Loaded_Ammunition.Designer.vb @@ -1,263 +1,265 @@ - _ -Partial Class frmView_Loaded_Ammunition - Inherits System.Windows.Forms.Form +Namespace Viewing + _ + Partial Class FrmViewLoadedAmmunition + Inherits System.Windows.Forms.Form - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmView_Loaded_Ammunition)) - Me.ToolStrip1 = New System.Windows.Forms.ToolStrip() - Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton() - Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton() - Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton() - Me.ToolStripButton4 = New System.Windows.Forms.ToolStripButton() - Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() - Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel() - Me.ToolStripLabel2 = New System.Windows.Forms.ToolStripLabel() - Me.DataGridView1 = New System.Windows.Forms.DataGridView() - Me.LoadersLogAmmunitionBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet() - Me.Loaders_Log_AmmunitionTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_AmmunitionTableAdapter() - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider() - Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.ManufacturerDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.NameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.CalDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() - Me.GrainDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() - Me.JacketDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.QtyDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.Vel = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.DcalDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.ToolStrip1.SuspendLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.LoadersLogAmmunitionBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'ToolStrip1 - ' - Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden - Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripButton3, Me.ToolStripButton4, Me.ToolStripSeparator1, Me.ToolStripLabel1, Me.ToolStripLabel2}) - Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) - Me.ToolStrip1.Name = "ToolStrip1" - Me.ToolStrip1.Size = New System.Drawing.Size(722, 25) - Me.ToolStrip1.TabIndex = 0 - Me.ToolStrip1.Text = "ToolStrip1" - ' - 'ToolStripButton1 - ' - Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) - Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton1.Name = "ToolStripButton1" - Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton1.Text = "Export to My Gun Collection" - ' - 'ToolStripButton2 - ' - Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) - Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton2.Name = "ToolStripButton2" - Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton2.Text = "Delete" - ' - 'ToolStripButton3 - ' - Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) - Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton3.Name = "ToolStripButton3" - Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton3.Text = "Refresh" - ' - 'ToolStripButton4 - ' - Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton4.Image = CType(resources.GetObject("ToolStripButton4.Image"), System.Drawing.Image) - Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta - Me.ToolStripButton4.Name = "ToolStripButton4" - Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) - Me.ToolStripButton4.Text = "Close" - ' - 'ToolStripSeparator1 - ' - Me.ToolStripSeparator1.Name = "ToolStripSeparator1" - Me.ToolStripSeparator1.Size = New System.Drawing.Size(6, 25) - ' - 'ToolStripLabel1 - ' - Me.ToolStripLabel1.Name = "ToolStripLabel1" - Me.ToolStripLabel1.Size = New System.Drawing.Size(146, 22) - Me.ToolStripLabel1.Text = "Total Rounds in Inventory:" - ' - 'ToolStripLabel2 - ' - Me.ToolStripLabel2.Name = "ToolStripLabel2" - Me.ToolStripLabel2.Size = New System.Drawing.Size(0, 22) - ' - 'DataGridView1 - ' - Me.DataGridView1.AllowUserToAddRows = False - Me.DataGridView1.AllowUserToDeleteRows = False - Me.DataGridView1.AutoGenerateColumns = False - Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.ManufacturerDataGridViewTextBoxColumn, Me.NameDataGridViewTextBoxColumn, Me.CalDataGridViewTextBoxColumn, Me.GrainDataGridViewTextBoxColumn, Me.JacketDataGridViewTextBoxColumn, Me.QtyDataGridViewTextBoxColumn, Me.Vel, Me.DcalDataGridViewTextBoxColumn}) - Me.DataGridView1.DataSource = Me.LoadersLogAmmunitionBindingSource - Me.DataGridView1.Location = New System.Drawing.Point(0, 28) - Me.DataGridView1.MultiSelect = False - Me.DataGridView1.Name = "DataGridView1" - Me.DataGridView1.ReadOnly = True - Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.DataGridView1.Size = New System.Drawing.Size(721, 239) - Me.DataGridView1.TabIndex = 1 - ' - 'LoadersLogAmmunitionBindingSource - ' - Me.LoadersLogAmmunitionBindingSource.DataMember = "Loaders_Log_Ammunition" - Me.LoadersLogAmmunitionBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'Loaders_Log_AmmunitionTableAdapter - ' - Me.Loaders_Log_AmmunitionTableAdapter.ClearBeforeFill = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'IDDataGridViewTextBoxColumn - ' - Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" - Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" - Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" - Me.IDDataGridViewTextBoxColumn.ReadOnly = True - Me.IDDataGridViewTextBoxColumn.Visible = False - ' - 'ManufacturerDataGridViewTextBoxColumn - ' - Me.ManufacturerDataGridViewTextBoxColumn.DataPropertyName = "Manufacturer" - Me.ManufacturerDataGridViewTextBoxColumn.HeaderText = "Manufacturer" - Me.ManufacturerDataGridViewTextBoxColumn.Name = "ManufacturerDataGridViewTextBoxColumn" - Me.ManufacturerDataGridViewTextBoxColumn.ReadOnly = True - ' - 'NameDataGridViewTextBoxColumn - ' - Me.NameDataGridViewTextBoxColumn.DataPropertyName = "Name" - Me.NameDataGridViewTextBoxColumn.HeaderText = "Name" - Me.NameDataGridViewTextBoxColumn.Name = "NameDataGridViewTextBoxColumn" - Me.NameDataGridViewTextBoxColumn.ReadOnly = True - ' - 'CalDataGridViewTextBoxColumn - ' - Me.CalDataGridViewTextBoxColumn.DataPropertyName = "Cal" - Me.CalDataGridViewTextBoxColumn.HeaderText = "Cal" - Me.CalDataGridViewTextBoxColumn.Name = "CalDataGridViewTextBoxColumn" - Me.CalDataGridViewTextBoxColumn.ReadOnly = True - Me.CalDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - ' - 'GrainDataGridViewTextBoxColumn - ' - Me.GrainDataGridViewTextBoxColumn.DataPropertyName = "Grain" - Me.GrainDataGridViewTextBoxColumn.HeaderText = "Grain" - Me.GrainDataGridViewTextBoxColumn.Name = "GrainDataGridViewTextBoxColumn" - Me.GrainDataGridViewTextBoxColumn.ReadOnly = True - Me.GrainDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] - ' - 'JacketDataGridViewTextBoxColumn - ' - Me.JacketDataGridViewTextBoxColumn.DataPropertyName = "Jacket" - Me.JacketDataGridViewTextBoxColumn.HeaderText = "Jacket" - Me.JacketDataGridViewTextBoxColumn.Name = "JacketDataGridViewTextBoxColumn" - Me.JacketDataGridViewTextBoxColumn.ReadOnly = True - ' - 'QtyDataGridViewTextBoxColumn - ' - Me.QtyDataGridViewTextBoxColumn.DataPropertyName = "Qty" - Me.QtyDataGridViewTextBoxColumn.HeaderText = "Qty" - Me.QtyDataGridViewTextBoxColumn.Name = "QtyDataGridViewTextBoxColumn" - Me.QtyDataGridViewTextBoxColumn.ReadOnly = True - ' - 'Vel - ' - Me.Vel.DataPropertyName = "Vel" - Me.Vel.HeaderText = "Velocity" - Me.Vel.Name = "Vel" - Me.Vel.ReadOnly = True - ' - 'DcalDataGridViewTextBoxColumn - ' - Me.DcalDataGridViewTextBoxColumn.DataPropertyName = "dcal" - Me.DcalDataGridViewTextBoxColumn.HeaderText = "dcal" - Me.DcalDataGridViewTextBoxColumn.Name = "DcalDataGridViewTextBoxColumn" - Me.DcalDataGridViewTextBoxColumn.ReadOnly = True - Me.DcalDataGridViewTextBoxColumn.Visible = False - ' - 'frmView_Loaded_Ammunition - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(722, 266) - Me.Controls.Add(Me.DataGridView1) - Me.Controls.Add(Me.ToolStrip1) - Me.HelpProvider1.SetHelpKeyword(Me, "View Ready to Use Ammunition") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "View Ready to Use Ammunition") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmView_Loaded_Ammunition" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Ready to Use Ammunition" - Me.ToolStrip1.ResumeLayout(False) - Me.ToolStrip1.PerformLayout() - CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.LoadersLogAmmunitionBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmViewLoadedAmmunition)) + Me.ToolStrip1 = New System.Windows.Forms.ToolStrip() + Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton() + Me.ToolStripButton2 = New System.Windows.Forms.ToolStripButton() + Me.ToolStripButton3 = New System.Windows.Forms.ToolStripButton() + Me.ToolStripButton4 = New System.Windows.Forms.ToolStripButton() + Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() + Me.ToolStripLabel1 = New System.Windows.Forms.ToolStripLabel() + Me.ToolStripLabel2 = New System.Windows.Forms.ToolStripLabel() + Me.DataGridView1 = New System.Windows.Forms.DataGridView() + Me.LoadersLogAmmunitionBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet() + Me.Loaders_Log_AmmunitionTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_AmmunitionTableAdapter() + Me.HelpProvider1 = New System.Windows.Forms.HelpProvider() + Me.IDDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.ManufacturerDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.NameDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.CalDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() + Me.GrainDataGridViewTextBoxColumn = New DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn() + Me.JacketDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.QtyDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.Vel = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.DcalDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.ToolStrip1.SuspendLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LoadersLogAmmunitionBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'ToolStrip1 + ' + Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden + Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1, Me.ToolStripButton2, Me.ToolStripButton3, Me.ToolStripButton4, Me.ToolStripSeparator1, Me.ToolStripLabel1, Me.ToolStripLabel2}) + Me.ToolStrip1.Location = New System.Drawing.Point(0, 0) + Me.ToolStrip1.Name = "ToolStrip1" + Me.ToolStrip1.Size = New System.Drawing.Size(722, 25) + Me.ToolStrip1.TabIndex = 0 + Me.ToolStrip1.Text = "ToolStrip1" + ' + 'ToolStripButton1 + ' + Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image) + Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton1.Name = "ToolStripButton1" + Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton1.Text = "Export to My Gun Collection" + ' + 'ToolStripButton2 + ' + Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton2.Image = CType(resources.GetObject("ToolStripButton2.Image"), System.Drawing.Image) + Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton2.Name = "ToolStripButton2" + Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton2.Text = "Delete" + ' + 'ToolStripButton3 + ' + Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton3.Image = CType(resources.GetObject("ToolStripButton3.Image"), System.Drawing.Image) + Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton3.Name = "ToolStripButton3" + Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton3.Text = "Refresh" + ' + 'ToolStripButton4 + ' + Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image + Me.ToolStripButton4.Image = CType(resources.GetObject("ToolStripButton4.Image"), System.Drawing.Image) + Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta + Me.ToolStripButton4.Name = "ToolStripButton4" + Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) + Me.ToolStripButton4.Text = "Close" + ' + 'ToolStripSeparator1 + ' + Me.ToolStripSeparator1.Name = "ToolStripSeparator1" + Me.ToolStripSeparator1.Size = New System.Drawing.Size(6, 25) + ' + 'ToolStripLabel1 + ' + Me.ToolStripLabel1.Name = "ToolStripLabel1" + Me.ToolStripLabel1.Size = New System.Drawing.Size(146, 22) + Me.ToolStripLabel1.Text = "Total Rounds in Inventory:" + ' + 'ToolStripLabel2 + ' + Me.ToolStripLabel2.Name = "ToolStripLabel2" + Me.ToolStripLabel2.Size = New System.Drawing.Size(0, 22) + ' + 'DataGridView1 + ' + Me.DataGridView1.AllowUserToAddRows = False + Me.DataGridView1.AllowUserToDeleteRows = False + Me.DataGridView1.AutoGenerateColumns = False + Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.IDDataGridViewTextBoxColumn, Me.ManufacturerDataGridViewTextBoxColumn, Me.NameDataGridViewTextBoxColumn, Me.CalDataGridViewTextBoxColumn, Me.GrainDataGridViewTextBoxColumn, Me.JacketDataGridViewTextBoxColumn, Me.QtyDataGridViewTextBoxColumn, Me.Vel, Me.DcalDataGridViewTextBoxColumn}) + Me.DataGridView1.DataSource = Me.LoadersLogAmmunitionBindingSource + Me.DataGridView1.Location = New System.Drawing.Point(0, 28) + Me.DataGridView1.MultiSelect = False + Me.DataGridView1.Name = "DataGridView1" + Me.DataGridView1.ReadOnly = True + Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.DataGridView1.Size = New System.Drawing.Size(721, 239) + Me.DataGridView1.TabIndex = 1 + ' + 'LoadersLogAmmunitionBindingSource + ' + Me.LoadersLogAmmunitionBindingSource.DataMember = "Loaders_Log_Ammunition" + Me.LoadersLogAmmunitionBindingSource.DataSource = Me.MLLDataSet + ' + 'MLLDataSet + ' + Me.MLLDataSet.DataSetName = "MLLDataSet" + Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' + 'Loaders_Log_AmmunitionTableAdapter + ' + Me.Loaders_Log_AmmunitionTableAdapter.ClearBeforeFill = True + ' + 'HelpProvider1 + ' + Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" + ' + 'IDDataGridViewTextBoxColumn + ' + Me.IDDataGridViewTextBoxColumn.DataPropertyName = "ID" + Me.IDDataGridViewTextBoxColumn.HeaderText = "ID" + Me.IDDataGridViewTextBoxColumn.Name = "IDDataGridViewTextBoxColumn" + Me.IDDataGridViewTextBoxColumn.ReadOnly = True + Me.IDDataGridViewTextBoxColumn.Visible = False + ' + 'ManufacturerDataGridViewTextBoxColumn + ' + Me.ManufacturerDataGridViewTextBoxColumn.DataPropertyName = "Manufacturer" + Me.ManufacturerDataGridViewTextBoxColumn.HeaderText = "Manufacturer" + Me.ManufacturerDataGridViewTextBoxColumn.Name = "ManufacturerDataGridViewTextBoxColumn" + Me.ManufacturerDataGridViewTextBoxColumn.ReadOnly = True + ' + 'NameDataGridViewTextBoxColumn + ' + Me.NameDataGridViewTextBoxColumn.DataPropertyName = "Name" + Me.NameDataGridViewTextBoxColumn.HeaderText = "Name" + Me.NameDataGridViewTextBoxColumn.Name = "NameDataGridViewTextBoxColumn" + Me.NameDataGridViewTextBoxColumn.ReadOnly = True + ' + 'CalDataGridViewTextBoxColumn + ' + Me.CalDataGridViewTextBoxColumn.DataPropertyName = "Cal" + Me.CalDataGridViewTextBoxColumn.HeaderText = "Cal" + Me.CalDataGridViewTextBoxColumn.Name = "CalDataGridViewTextBoxColumn" + Me.CalDataGridViewTextBoxColumn.ReadOnly = True + Me.CalDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + ' + 'GrainDataGridViewTextBoxColumn + ' + Me.GrainDataGridViewTextBoxColumn.DataPropertyName = "Grain" + Me.GrainDataGridViewTextBoxColumn.HeaderText = "Grain" + Me.GrainDataGridViewTextBoxColumn.Name = "GrainDataGridViewTextBoxColumn" + Me.GrainDataGridViewTextBoxColumn.ReadOnly = True + Me.GrainDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.[True] + ' + 'JacketDataGridViewTextBoxColumn + ' + Me.JacketDataGridViewTextBoxColumn.DataPropertyName = "Jacket" + Me.JacketDataGridViewTextBoxColumn.HeaderText = "Jacket" + Me.JacketDataGridViewTextBoxColumn.Name = "JacketDataGridViewTextBoxColumn" + Me.JacketDataGridViewTextBoxColumn.ReadOnly = True + ' + 'QtyDataGridViewTextBoxColumn + ' + Me.QtyDataGridViewTextBoxColumn.DataPropertyName = "Qty" + Me.QtyDataGridViewTextBoxColumn.HeaderText = "Qty" + Me.QtyDataGridViewTextBoxColumn.Name = "QtyDataGridViewTextBoxColumn" + Me.QtyDataGridViewTextBoxColumn.ReadOnly = True + ' + 'Vel + ' + Me.Vel.DataPropertyName = "Vel" + Me.Vel.HeaderText = "Velocity" + Me.Vel.Name = "Vel" + Me.Vel.ReadOnly = True + ' + 'DcalDataGridViewTextBoxColumn + ' + Me.DcalDataGridViewTextBoxColumn.DataPropertyName = "dcal" + Me.DcalDataGridViewTextBoxColumn.HeaderText = "dcal" + Me.DcalDataGridViewTextBoxColumn.Name = "DcalDataGridViewTextBoxColumn" + Me.DcalDataGridViewTextBoxColumn.ReadOnly = True + Me.DcalDataGridViewTextBoxColumn.Visible = False + ' + 'frmView_Loaded_Ammunition + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(722, 266) + Me.Controls.Add(Me.DataGridView1) + Me.Controls.Add(Me.ToolStrip1) + Me.HelpProvider1.SetHelpKeyword(Me, "View Ready to Use Ammunition") + Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) + Me.HelpProvider1.SetHelpString(Me, "View Ready to Use Ammunition") + Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) + Me.Name = "FrmViewLoadedAmmunition" + Me.HelpProvider1.SetShowHelp(Me, True) + Me.Text = "Ready to Use Ammunition" + Me.ToolStrip1.ResumeLayout(False) + Me.ToolStrip1.PerformLayout() + CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LoadersLogAmmunitionBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub - Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip - Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents LoadersLogAmmunitionBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents Loaders_Log_AmmunitionTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_AmmunitionTableAdapter - Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton - Friend WithEvents ToolStripButton4 As System.Windows.Forms.ToolStripButton - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider - Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator - Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel - Friend WithEvents ToolStripLabel2 As System.Windows.Forms.ToolStripLabel - Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents ManufacturerDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents NameDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents CalDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents GrainDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn - Friend WithEvents JacketDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents QtyDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents Vel As System.Windows.Forms.DataGridViewTextBoxColumn - Friend WithEvents DcalDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn -End Class + End Sub + Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip + Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView + Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet + Friend WithEvents LoadersLogAmmunitionBindingSource As System.Windows.Forms.BindingSource + Friend WithEvents Loaders_Log_AmmunitionTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_AmmunitionTableAdapter + Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton2 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton3 As System.Windows.Forms.ToolStripButton + Friend WithEvents ToolStripButton4 As System.Windows.Forms.ToolStripButton + Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider + Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator + Friend WithEvents ToolStripLabel1 As System.Windows.Forms.ToolStripLabel + Friend WithEvents ToolStripLabel2 As System.Windows.Forms.ToolStripLabel + Friend WithEvents IDDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents ManufacturerDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents NameDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents CalDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents GrainDataGridViewTextBoxColumn As DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn + Friend WithEvents JacketDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents QtyDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents Vel As System.Windows.Forms.DataGridViewTextBoxColumn + Friend WithEvents DcalDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn + End Class +End NameSpace \ No newline at end of file diff --git a/BSMyLoadersLog/Viewing/frmView_Loaded_Ammunition.vb b/BSMyLoadersLog/Viewing/frmView_Loaded_Ammunition.vb index 9e79a2b..4d05154 100644 --- a/BSMyLoadersLog/Viewing/frmView_Loaded_Ammunition.vb +++ b/BSMyLoadersLog/Viewing/frmView_Loaded_Ammunition.vb @@ -1,127 +1,201 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc -Imports BurnSoft.Applications.MLL +'Imports System.Data.Odbc +'Imports System.Web.UI.WebControls.Expressions +'Imports BSMyLoadersLog.LoadersClass +Imports BurnSoft.Applications.MGC.LoadersLog +Imports BurnSoft.Applications.MGC.Types Imports BurnSoft.Applications.MLL.Global -Imports BurnSoft.Applications.MLL.Helpers +'Imports BurnSoft.Applications.MLL.Helpers +Imports BurnSoft.Applications.MLL.LoadersLog +Imports BurnSoft.Applications.MLL.Types -Public Class frmView_Loaded_Ammunition - Dim errOut As String - Sub LoadData() - Try - Me.Loaders_Log_AmmunitionTableAdapter.Fill(Me.MLLDataSet.Loaders_Log_Ammunition) - ToolStripButton1.Enabled = MDIParentMain.tsslMGCEnabled.Enabled - 'Dim ObjGF As New GlobalFunctions - 'ToolStripLabel2.Text = ObjGF.CountReadyToUseAmmo - ToolStripLabel2.Text = GeneralFunctions.CountReadyToUseAmmo(DatabasePath, errOut) - Catch ex As Exception - Dim strProcedure As String = "LoadData" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmView_Loaded_Ammunition_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call LoadData() - End Sub - Sub ExportToMGC() - Try - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim ObjMGC As New BSMGC - Dim iQty As Long = 0 - Dim AID As Long = 0 - Dim MID As Long = 0 - Dim cQty As Long = 0 - Dim strManu As String = "" - Dim strName As String = "" - Dim strCaliber As String = "" - Dim strGrains As String = "" - Dim strJacket As String = "" - Dim sVelocity As String = "" - Dim dcal As Double = 0 - Dim SQL As String = "SELECT * from Loaders_Log_Ammunition" - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - While RS.Read - cQty = RS("Qty") - MID = RS("ID") - strManu = GeneralHelpers.FluffContent(RS("Manufacturer")) - strName = GeneralHelpers.FluffContent(RS("Name")) - strCaliber = GeneralHelpers.FluffContent(RS("Cal")) - strGrains = GeneralHelpers.FluffContent(RS("Grain")) - strJacket = GeneralHelpers.FluffContent(RS("Jacket")) - sVelocity = GeneralHelpers.FluffContent(RS("Vel")) - dcal = RS("dcal") - If ObjMGC.AmmoIsAlreadyListed(strManu, strName, strCaliber, _ - strGrains, strJacket, iQty, AID) Then - SQL = "UPDATE Gun_Collection_Ammo set Qty='" & (cQty + iQty) & "' where id=" & AID - ObjMGC.ConnExec(SQL) - Else - SQL = "INSERT INTO Gun_Collection_Ammo(Manufacturer,Name,Cal,Grain,Jacket,Qty,dcal,vel_n) VALUES('" & _ - strManu & "','" & strName & "','" & strCaliber & "','" & strGrains & "','" & _ - strJacket & "'," & cQty & "," & dcal & "," & sVelocity & ")" - ObjMGC.ConnExec(SQL) - End If - Obj.ConnExec("DELETE from Loaders_Log_Ammunition where ID=" & MID) - End While - RS.Close() - RS = Nothing - CMD = Nothing - Catch ex As Exception - Dim strProcedure As String = "ExportToMGC" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmView_Loaded_Ammunition_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize - If Me.Height <> 0 Then - Me.DataGridView1.Height = Me.Height - (65) - Me.DataGridView1.Width = Me.Width - 15 - End If - End Sub - - Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click - Try - Dim NL As String = Chr(10) - Dim sMsg As String = "Exporting will Add your Ready to Use Ammunition to " & NL & "My Gun Collection and delete it from the local database." & NL & "Do you wish to continue?" - Dim sAns As String = MsgBox(sMsg, MsgBoxStyle.YesNo, Me.Text) - If sAns = vbYes Then - Call ExportToMGC() - MsgBox("Export of Ammunition to My Gun Collection is complete!") - Call LoadData() - End If - Catch ex As Exception - Dim strProcedure As String = "ToolStripButton1_Click" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub +Namespace Viewing + ' TODO: #20 Clean up Code + ''' + ''' Class FrmViewLoadedAmmunition. + ''' Implements the + ''' + ''' + Public Class FrmViewLoadedAmmunition + ''' + ''' The error out + ''' + Dim _errOut As String + ''' + ''' Loads the data. + ''' + Sub LoadData() + Try + Loaders_Log_AmmunitionTableAdapter.Fill(MLLDataSet.Loaders_Log_Ammunition) + ToolStripButton1.Enabled = MdiParentMain.tsslMGCEnabled.Enabled + 'Dim ObjGF As New GlobalFunctions + 'ToolStripLabel2.Text = ObjGF.CountReadyToUseAmmo + ToolStripLabel2.Text = GeneralFunctions.CountReadyToUseAmmo(DatabasePath, _errOut) + Catch ex As Exception + Call LogError(Name, "LoadData", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Load event of the frmView_Loaded_Ammunition control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmView_Loaded_Ammunition_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load + Call LoadData() + End Sub + ''' + ''' Exports to MGC. + ''' + Sub ExportToMgc() + Try + Dim loadedList As List(Of LoadersLogAmmunitionData) = LoadersLogAmmunition.GetAll(DatabasePath, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + Dim newList as List(Of Ammunition) = New List(Of Ammunition)() + For Each o As LoadersLogAmmunitionData In loadedList + newList = AmmoHelper.AddedToAmmoList(newList, o.Manufacturer, o.Name, o.Caliber, o.Grain, + o.Jacket, o.Qty, o.Velocity, _errOut) + If _errOut.Length > 0 Then throw New Exception(_errOut) + Next - Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click - Me.Close() - End Sub + If Not AmmoHelper.ImportAmmoMade(newList, _errOut) Then Throw New Exception(_errOut) - Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click - Call LoadData() - End Sub - - Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click - Try - Dim ItemID As String = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value - Dim Obj As New BSDatabase - Dim ObjG As New GlobalFunctions - Dim strSQLTable As String = "Loaders_Log_Ammunition" - Dim strName As String = ObjG.GetName("SELECT * from " & strSQLTable & " where ID=" & ItemID, "Name") - Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Dim SQL As String = "DELETE from " & strSQLTable & " where ID=" & ItemID - If strAns = vbYes Then Obj.ConnExec(SQL) : Call LoadData() - Catch ex As Exception - Dim strProcedure As String = "ToolStripButton2_Click" - Call LogError(Me.Name, strProcedure, Err.Number, ex.Message.ToString) - End Try - End Sub + 'Dim Obj As New BSDatabase + 'Call Obj.ConnectDB() + 'Dim ObjMGC As New BSMGC + 'Dim iQty As Long = 0 + 'Dim AID As Long = 0 + 'Dim MID As Long = 0 + 'Dim cQty As Long = 0 + 'Dim strManu As String = "" + 'Dim strName As String = "" + 'Dim strCaliber As String = "" + 'Dim strGrains As String = "" + 'Dim strJacket As String = "" + 'Dim sVelocity As String = "" + 'Dim dcal As Double = 0 + 'Dim SQL As String = "SELECT * from Loaders_Log_Ammunition" + 'Dim CMD As New OdbcCommand(SQL, Obj.Conn) + 'Dim RS As OdbcDataReader + 'RS = CMD.ExecuteReader + 'While RS.Read + ' cQty = RS("Qty") + ' MID = RS("ID") + ' strManu = GeneralHelpers.FluffContent(RS("Manufacturer")) + ' strName = GeneralHelpers.FluffContent(RS("Name")) + ' strCaliber = GeneralHelpers.FluffContent(RS("Cal")) + ' strGrains = GeneralHelpers.FluffContent(RS("Grain")) + ' strJacket = GeneralHelpers.FluffContent(RS("Jacket")) + ' sVelocity = GeneralHelpers.FluffContent(RS("Vel")) + ' dcal = RS("dcal") + ' If ObjMGC.AmmoIsAlreadyListed(strManu, strName, strCaliber, _ + ' strGrains, strJacket, iQty, AID) Then + ' SQL = "UPDATE Gun_Collection_Ammo set Qty='" & (cQty + iQty) & "' where id=" & AID + ' ObjMGC.ConnExec(SQL) + ' Else + ' SQL = "INSERT INTO Gun_Collection_Ammo(Manufacturer,Name,Cal,Grain,Jacket,Qty,dcal,vel_n) VALUES('" & _ + ' strManu & "','" & strName & "','" & strCaliber & "','" & strGrains & "','" & _ + ' strJacket & "'," & cQty & "," & dcal & "," & sVelocity & ")" + ' ObjMGC.ConnExec(SQL) + ' End If + ' Obj.ConnExec("DELETE from Loaders_Log_Ammunition where ID=" & MID) + 'End While + 'RS.Close() + 'RS = Nothing + 'CMD = Nothing + Catch ex As Exception + Call LogError(Name, "ExportToMGC", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Resize event of the frmView_Loaded_Ammunition control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmView_Loaded_Ammunition_Resize(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Resize + Try + If Height <> 0 Then + DataGridView1.Height = Height - (65) + DataGridView1.Width = Width - 15 + End If + Catch ex As Exception + Call LogError(Name, "frmView_Loaded_Ammunition_Resize", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton1.Click + Try + Dim NL As String = Chr(10) + Dim sMsg As String = "Exporting will Add your Ready to Use Ammunition to " & NL & "My Gun Collection and delete it from the local database." & NL & "Do you wish to continue?" + Dim sAns As String = MsgBox(sMsg, MsgBoxStyle.YesNo, Text) + If sAns = vbYes Then + Call ExportToMgc() + MsgBox("Export of Ammunition to My Gun Collection is complete!") + Call LoadData() + End If + Catch ex As Exception + Call LogError(Name, "ToolStripButton1_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the Click event of the ToolStripButton4 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton4.Click + Close() + End Sub + ''' + ''' Handles the Click event of the ToolStripButton3 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton3.Click + Call LoadData() + End Sub + ''' + ''' Handles the Click event of the ToolStripButton2 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub ToolStripButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolStripButton2.Click + Try + Dim itemId As Long = DataGridView1.SelectedRows.Item(0).Cells.Item(0).Value + 'Dim obj As New BSDatabase + 'Dim objG As New GlobalFunctions + 'Dim strSqlTable As String = "Loaders_Log_Ammunition" + 'Dim strName As String = objG.GetName("SELECT * from " & strSqlTable & " where ID=" & itemId, "Name") + 'Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") + 'Dim sql As String = "DELETE from " & strSqlTable & " where ID=" & itemId + 'If strAns = vbYes Then obj.ConnExec(sql) : Call LoadData() + Dim strName As String = LoadersLogAmmunition.GetName(DatabasePath, itemId, _errOut) + If _errOut.Length > 0 Then Throw New Exception(_errOut) + Dim strAns As String = MsgBox("Are you sure you want to delete " & strName & "?", MsgBoxStyle.YesNo, "Delete Item from the Database.") - Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.BindingContextChanged - If DataGridView1.DataSource Is Nothing Then - Return - End If - DataGridView1.AutoResizeColumns() - End Sub -End Class \ No newline at end of file + If strAns = vbYes Then + If Not LoadersLogAmmunition.Delete(DatabasePath, itemId, _errOut) Then Throw New Exception(_errOut) + Call LoadData() + End If + Catch ex As Exception + Call LogError(Name, "ToolStripButton2_Click", Err.Number, ex.Message.ToString) + End Try + End Sub + ''' + ''' Handles the BindingContextChanged event of the DataGridView1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub DataGridView1_BindingContextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DataGridView1.BindingContextChanged + Try + If DataGridView1.DataSource Is Nothing Then + Return + End If + DataGridView1.AutoResizeColumns() + Catch ex As Exception + Call LogError(Name, "DataGridView1_BindingContextChanged", Err.Number, ex.Message.ToString) + End Try + End Sub + End Class +End Namespace \ No newline at end of file diff --git a/BSMyLoadersLog/frmCopy_DataSheet_Copy_ShotGun.Designer.vb b/BSMyLoadersLog/frmCopy_DataSheet_Copy_ShotGun.Designer.vb deleted file mode 100644 index af0176e..0000000 --- a/BSMyLoadersLog/frmCopy_DataSheet_Copy_ShotGun.Designer.vb +++ /dev/null @@ -1,37 +0,0 @@ - _ -Partial Class frmCopy_DataSheet_Copy_ShotGun - Inherits System.Windows.Forms.Form - - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub - - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer - - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.SuspendLayout() - ' - 'frmCopy_DataSheet_Copy_ShotGun - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(284, 262) - Me.Name = "frmCopy_DataSheet_Copy_ShotGun" - Me.Text = "frmCopy_DataSheet_Copy_ShotGun" - Me.ResumeLayout(False) - - End Sub -End Class diff --git a/BSMyLoadersLog/frmCopy_DataSheet_Copy_ShotGun.vb b/BSMyLoadersLog/frmCopy_DataSheet_Copy_ShotGun.vb deleted file mode 100644 index 9c5c266..0000000 --- a/BSMyLoadersLog/frmCopy_DataSheet_Copy_ShotGun.vb +++ /dev/null @@ -1,7 +0,0 @@ -Public Class frmCopy_DataSheet_Copy_ShotGun - Public FromView As Boolean - Public CFGID As Integer - Private Sub frmCopy_DataSheet_Copy_ShotGun_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load - 'TODO: Finish the Copy Shotgun Copy Data Sheet Form - End Sub -End Class \ No newline at end of file diff --git a/BSMyLoadersLog/frmCopy_DataSheet_RiflePistol.Designer.vb b/BSMyLoadersLog/frmCopy_DataSheet_RiflePistol.Designer.vb deleted file mode 100644 index 1ece61c..0000000 --- a/BSMyLoadersLog/frmCopy_DataSheet_RiflePistol.Designer.vb +++ /dev/null @@ -1,438 +0,0 @@ - _ -Partial Class frmCopy_DataSheet_RiflePistol - Inherits System.Windows.Forms.Form - - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub - - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer - - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmCopy_DataSheet_RiflePistol)) - Me.txtCase = New System.Windows.Forms.TextBox - Me.txtPrimer = New System.Windows.Forms.TextBox - Me.txtBullet = New System.Windows.Forms.TextBox - Me.txtPowManu = New System.Windows.Forms.TextBox - Me.txtPowWei = New System.Windows.Forms.TextBox - Me.txtPowName = New System.Windows.Forms.TextBox - Me.Label14 = New System.Windows.Forms.Label - Me.Label13 = New System.Windows.Forms.Label - Me.Label12 = New System.Windows.Forms.Label - Me.Label11 = New System.Windows.Forms.Label - Me.Label10 = New System.Windows.Forms.Label - Me.Label4 = New System.Windows.Forms.Label - Me.nudYards = New System.Windows.Forms.NumericUpDown - Me.Label9 = New System.Windows.Forms.Label - Me.nudShots = New System.Windows.Forms.NumericUpDown - Me.Label8 = New System.Windows.Forms.Label - Me.btnCancel = New System.Windows.Forms.Button - Me.btnAdd = New System.Windows.Forms.Button - Me.txtNotes = New System.Windows.Forms.TextBox - Me.txtLen = New System.Windows.Forms.TextBox - Me.txtCon = New System.Windows.Forms.TextBox - Me.txtGroup = New System.Windows.Forms.TextBox - Me.dtpTested = New System.Windows.Forms.DateTimePicker - Me.cmbFirearm = New System.Windows.Forms.ComboBox - Me.LoadersLogFirearmsBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.MLLDataSet = New BSMyLoadersLog.MLLDataSet - Me.Label7 = New System.Windows.Forms.Label - Me.Label6 = New System.Windows.Forms.Label - Me.Label5 = New System.Windows.Forms.Label - Me.Label3 = New System.Windows.Forms.Label - Me.Label2 = New System.Windows.Forms.Label - Me.Label1 = New System.Windows.Forms.Label - Me.Loaders_Log_FirearmsTableAdapter = New BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_FirearmsTableAdapter - Me.HelpProvider1 = New System.Windows.Forms.HelpProvider - CType(Me.nudYards, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.nudShots, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.LoadersLogFirearmsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'txtCase - ' - Me.txtCase.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtCase.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtCase.Location = New System.Drawing.Point(132, 269) - Me.txtCase.Name = "txtCase" - Me.txtCase.Size = New System.Drawing.Size(200, 20) - Me.txtCase.TabIndex = 56 - ' - 'txtPrimer - ' - Me.txtPrimer.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPrimer.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPrimer.Location = New System.Drawing.Point(132, 243) - Me.txtPrimer.Name = "txtPrimer" - Me.txtPrimer.Size = New System.Drawing.Size(200, 20) - Me.txtPrimer.TabIndex = 55 - ' - 'txtBullet - ' - Me.txtBullet.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtBullet.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtBullet.Location = New System.Drawing.Point(132, 217) - Me.txtBullet.Name = "txtBullet" - Me.txtBullet.Size = New System.Drawing.Size(200, 20) - Me.txtBullet.TabIndex = 54 - ' - 'txtPowManu - ' - Me.txtPowManu.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPowManu.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPowManu.Location = New System.Drawing.Point(132, 191) - Me.txtPowManu.Name = "txtPowManu" - Me.txtPowManu.Size = New System.Drawing.Size(200, 20) - Me.txtPowManu.TabIndex = 53 - ' - 'txtPowWei - ' - Me.txtPowWei.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPowWei.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPowWei.Location = New System.Drawing.Point(132, 165) - Me.txtPowWei.Name = "txtPowWei" - Me.txtPowWei.Size = New System.Drawing.Size(200, 20) - Me.txtPowWei.TabIndex = 52 - ' - 'txtPowName - ' - Me.txtPowName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtPowName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtPowName.Location = New System.Drawing.Point(132, 140) - Me.txtPowName.Name = "txtPowName" - Me.txtPowName.Size = New System.Drawing.Size(200, 20) - Me.txtPowName.TabIndex = 51 - ' - 'Label14 - ' - Me.Label14.AutoSize = True - Me.Label14.Location = New System.Drawing.Point(12, 272) - Me.Label14.Name = "Label14" - Me.Label14.Size = New System.Drawing.Size(34, 13) - Me.Label14.TabIndex = 75 - Me.Label14.Text = "Case:" - ' - 'Label13 - ' - Me.Label13.AutoSize = True - Me.Label13.Location = New System.Drawing.Point(12, 246) - Me.Label13.Name = "Label13" - Me.Label13.Size = New System.Drawing.Size(39, 13) - Me.Label13.TabIndex = 74 - Me.Label13.Text = "Primer:" - ' - 'Label12 - ' - Me.Label12.AutoSize = True - Me.Label12.Location = New System.Drawing.Point(12, 220) - Me.Label12.Name = "Label12" - Me.Label12.Size = New System.Drawing.Size(36, 13) - Me.Label12.TabIndex = 73 - Me.Label12.Text = "Bullet:" - ' - 'Label11 - ' - Me.Label11.AutoSize = True - Me.Label11.Location = New System.Drawing.Point(12, 194) - Me.Label11.Name = "Label11" - Me.Label11.Size = New System.Drawing.Size(112, 13) - Me.Label11.TabIndex = 72 - Me.Label11.Text = "Powder Manufacturer:" - ' - 'Label10 - ' - Me.Label10.AutoSize = True - Me.Label10.Location = New System.Drawing.Point(12, 168) - Me.Label10.Name = "Label10" - Me.Label10.Size = New System.Drawing.Size(123, 13) - Me.Label10.TabIndex = 71 - Me.Label10.Text = "Weight of Powder Used:" - ' - 'Label4 - ' - Me.Label4.AutoSize = True - Me.Label4.Location = New System.Drawing.Point(12, 143) - Me.Label4.Name = "Label4" - Me.Label4.Size = New System.Drawing.Size(77, 13) - Me.Label4.TabIndex = 70 - Me.Label4.Text = "Powder Name:" - ' - 'nudYards - ' - Me.nudYards.Location = New System.Drawing.Point(132, 60) - Me.nudYards.Maximum = New Decimal(New Integer() {5000, 0, 0, 0}) - Me.nudYards.Name = "nudYards" - Me.nudYards.Size = New System.Drawing.Size(200, 20) - Me.nudYards.TabIndex = 48 - ' - 'Label9 - ' - Me.Label9.AutoSize = True - Me.Label9.Location = New System.Drawing.Point(12, 62) - Me.Label9.Name = "Label9" - Me.Label9.Size = New System.Drawing.Size(81, 13) - Me.Label9.TabIndex = 69 - Me.Label9.Text = "Yards tested at:" - ' - 'nudShots - ' - Me.nudShots.Location = New System.Drawing.Point(132, 114) - Me.nudShots.Maximum = New Decimal(New Integer() {1000, 0, 0, 0}) - Me.nudShots.Name = "nudShots" - Me.nudShots.Size = New System.Drawing.Size(200, 20) - Me.nudShots.TabIndex = 50 - ' - 'Label8 - ' - Me.Label8.AutoSize = True - Me.Label8.Location = New System.Drawing.Point(12, 116) - Me.Label8.Name = "Label8" - Me.Label8.Size = New System.Drawing.Size(89, 13) - Me.Label8.TabIndex = 68 - Me.Label8.Text = "Number of Shots:" - ' - 'btnCancel - ' - Me.btnCancel.Location = New System.Drawing.Point(257, 454) - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 61 - Me.btnCancel.Text = "Cancel" - Me.btnCancel.UseVisualStyleBackColor = True - ' - 'btnAdd - ' - Me.btnAdd.Location = New System.Drawing.Point(15, 454) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(75, 23) - Me.btnAdd.TabIndex = 60 - Me.btnAdd.Text = "Add" - Me.btnAdd.UseVisualStyleBackColor = True - ' - 'txtNotes - ' - Me.txtNotes.Location = New System.Drawing.Point(15, 362) - Me.txtNotes.Multiline = True - Me.txtNotes.Name = "txtNotes" - Me.txtNotes.Size = New System.Drawing.Size(317, 84) - Me.txtNotes.TabIndex = 59 - ' - 'txtLen - ' - Me.txtLen.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtLen.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtLen.Location = New System.Drawing.Point(132, 321) - Me.txtLen.Name = "txtLen" - Me.txtLen.Size = New System.Drawing.Size(200, 20) - Me.txtLen.TabIndex = 58 - ' - 'txtCon - ' - Me.txtCon.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtCon.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtCon.Location = New System.Drawing.Point(132, 295) - Me.txtCon.Name = "txtCon" - Me.txtCon.Size = New System.Drawing.Size(200, 20) - Me.txtCon.TabIndex = 57 - ' - 'txtGroup - ' - Me.txtGroup.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest - Me.txtGroup.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource - Me.txtGroup.Location = New System.Drawing.Point(132, 86) - Me.txtGroup.Name = "txtGroup" - Me.txtGroup.Size = New System.Drawing.Size(200, 20) - Me.txtGroup.TabIndex = 49 - ' - 'dtpTested - ' - Me.dtpTested.Location = New System.Drawing.Point(132, 33) - Me.dtpTested.Name = "dtpTested" - Me.dtpTested.Size = New System.Drawing.Size(200, 20) - Me.dtpTested.TabIndex = 47 - ' - 'cmbFirearm - ' - Me.cmbFirearm.DataSource = Me.LoadersLogFirearmsBindingSource - Me.cmbFirearm.DisplayMember = "FullName" - Me.cmbFirearm.FormattingEnabled = True - Me.cmbFirearm.Location = New System.Drawing.Point(132, 6) - Me.cmbFirearm.Name = "cmbFirearm" - Me.cmbFirearm.Size = New System.Drawing.Size(200, 21) - Me.cmbFirearm.TabIndex = 46 - Me.cmbFirearm.ValueMember = "ID" - ' - 'LoadersLogFirearmsBindingSource - ' - Me.LoadersLogFirearmsBindingSource.DataMember = "Loaders_Log_Firearms" - Me.LoadersLogFirearmsBindingSource.DataSource = Me.MLLDataSet - ' - 'MLLDataSet - ' - Me.MLLDataSet.DataSetName = "MLLDataSet" - Me.MLLDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema - ' - 'Label7 - ' - Me.Label7.AutoSize = True - Me.Label7.Location = New System.Drawing.Point(12, 346) - Me.Label7.Name = "Label7" - Me.Label7.Size = New System.Drawing.Size(35, 13) - Me.Label7.TabIndex = 67 - Me.Label7.Text = "Notes" - ' - 'Label6 - ' - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(12, 324) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(70, 13) - Me.Label6.TabIndex = 66 - Me.Label6.Text = "Total Length:" - ' - 'Label5 - ' - Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(12, 298) - Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(59, 13) - Me.Label5.TabIndex = 65 - Me.Label5.Text = "Conditions:" - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(12, 89) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(103, 13) - Me.Label3.TabIndex = 64 - Me.Label3.Text = "Group size or Score:" - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(12, 37) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(65, 13) - Me.Label2.TabIndex = 63 - Me.Label2.Text = "Date tested:" - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(12, 9) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(98, 13) - Me.Label1.TabIndex = 62 - Me.Label1.Text = "Firearm tested with:" - ' - 'Loaders_Log_FirearmsTableAdapter - ' - Me.Loaders_Log_FirearmsTableAdapter.ClearBeforeFill = True - ' - 'HelpProvider1 - ' - Me.HelpProvider1.HelpNamespace = "my_loaders_log_help.chm" - ' - 'frmCopy_DataSheet_RiflePistol - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(348, 489) - Me.Controls.Add(Me.txtCase) - Me.Controls.Add(Me.txtPrimer) - Me.Controls.Add(Me.txtBullet) - Me.Controls.Add(Me.txtPowManu) - Me.Controls.Add(Me.txtPowWei) - Me.Controls.Add(Me.txtPowName) - Me.Controls.Add(Me.Label14) - Me.Controls.Add(Me.Label13) - Me.Controls.Add(Me.Label12) - Me.Controls.Add(Me.Label11) - Me.Controls.Add(Me.Label10) - Me.Controls.Add(Me.Label4) - Me.Controls.Add(Me.nudYards) - Me.Controls.Add(Me.Label9) - Me.Controls.Add(Me.nudShots) - Me.Controls.Add(Me.Label8) - Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.btnAdd) - Me.Controls.Add(Me.txtNotes) - Me.Controls.Add(Me.txtLen) - Me.Controls.Add(Me.txtCon) - Me.Controls.Add(Me.txtGroup) - Me.Controls.Add(Me.dtpTested) - Me.Controls.Add(Me.cmbFirearm) - Me.Controls.Add(Me.Label7) - Me.Controls.Add(Me.Label6) - Me.Controls.Add(Me.Label5) - Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.Label1) - Me.HelpProvider1.SetHelpKeyword(Me, "Copy Loaders Log Entry") - Me.HelpProvider1.SetHelpNavigator(Me, System.Windows.Forms.HelpNavigator.KeywordIndex) - Me.HelpProvider1.SetHelpString(Me, "Copy Loaders Log Entry") - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmCopy_DataSheet_RiflePistol" - Me.HelpProvider1.SetShowHelp(Me, True) - Me.Text = "Copy Loaders Log Entry" - CType(Me.nudYards, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.nudShots, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.LoadersLogFirearmsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.MLLDataSet, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - Me.PerformLayout() - - End Sub - Friend WithEvents txtCase As System.Windows.Forms.TextBox - Friend WithEvents txtPrimer As System.Windows.Forms.TextBox - Friend WithEvents txtBullet As System.Windows.Forms.TextBox - Friend WithEvents txtPowManu As System.Windows.Forms.TextBox - Friend WithEvents txtPowWei As System.Windows.Forms.TextBox - Friend WithEvents txtPowName As System.Windows.Forms.TextBox - Friend WithEvents Label14 As System.Windows.Forms.Label - Friend WithEvents Label13 As System.Windows.Forms.Label - Friend WithEvents Label12 As System.Windows.Forms.Label - Friend WithEvents Label11 As System.Windows.Forms.Label - Friend WithEvents Label10 As System.Windows.Forms.Label - Friend WithEvents Label4 As System.Windows.Forms.Label - Friend WithEvents nudYards As System.Windows.Forms.NumericUpDown - Friend WithEvents Label9 As System.Windows.Forms.Label - Friend WithEvents nudShots As System.Windows.Forms.NumericUpDown - Friend WithEvents Label8 As System.Windows.Forms.Label - Friend WithEvents btnCancel As System.Windows.Forms.Button - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents txtNotes As System.Windows.Forms.TextBox - Friend WithEvents txtLen As System.Windows.Forms.TextBox - Friend WithEvents txtCon As System.Windows.Forms.TextBox - Friend WithEvents txtGroup As System.Windows.Forms.TextBox - Friend WithEvents dtpTested As System.Windows.Forms.DateTimePicker - Friend WithEvents cmbFirearm As System.Windows.Forms.ComboBox - Friend WithEvents Label7 As System.Windows.Forms.Label - Friend WithEvents Label6 As System.Windows.Forms.Label - Friend WithEvents Label5 As System.Windows.Forms.Label - Friend WithEvents Label3 As System.Windows.Forms.Label - Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents Label1 As System.Windows.Forms.Label - Friend WithEvents MLLDataSet As BSMyLoadersLog.MLLDataSet - Friend WithEvents LoadersLogFirearmsBindingSource As System.Windows.Forms.BindingSource - Friend WithEvents Loaders_Log_FirearmsTableAdapter As BSMyLoadersLog.MLLDataSetTableAdapters.Loaders_Log_FirearmsTableAdapter - Friend WithEvents HelpProvider1 As System.Windows.Forms.HelpProvider -End Class diff --git a/BSMyLoadersLog/frmCopy_DataSheet_RiflePistol.vb b/BSMyLoadersLog/frmCopy_DataSheet_RiflePistol.vb deleted file mode 100644 index 30838b2..0000000 --- a/BSMyLoadersLog/frmCopy_DataSheet_RiflePistol.vb +++ /dev/null @@ -1,95 +0,0 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc -Imports BurnSoft.Applications.MLL.Helpers - -Public Class frmCopy_DataSheet_RiflePistol - Public CFGID As Long - Public FromView As Boolean - Sub LoadData() - Try - Me.Loaders_Log_FirearmsTableAdapter.Fill(Me.MLLDataSet.Loaders_Log_Firearms) - Dim SQL As String = "SELECT * from Loaders_Log_NSG where ID=" & CFGID - Dim Obj As New BSDatabase - Call Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - Dim strSplit() As String - While RS.Read - cmbFirearm.SelectedValue = RS("fid") - dtpTested.Value = RS("dt") - txtGroup.Text = RS("gs") - nudShots.Value = RS("ns") - nudYards.Value = RS("yds") - strSplit = Split(RS("pwm"), " - ") - txtPowName.Text = Trim(strSplit(0)) - txtPowWei.Text = Trim(strSplit(1)) - txtPowManu.Text = Trim(strSplit(2)) - 'txtPowwtMFG.Text = RS("pwm") - txtBullet.Text = RS("bullet") - txtPrimer.Text = RS("primer") - txtCase.Text = RS("case") - txtCon.Text = RS("conditions") - txtLen.Text = RS("tl") - txtNotes.Text = RS("notes") - End While - RS.Close() - RS = Nothing - CMD = Nothing - Obj.CloseDB() - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - Sub SaveData() - Try - Dim lngFID As Long = cmbFirearm.SelectedValue - Dim strFireArm As String = cmbFirearm.Text - Dim strDateTested As String = dtpTested.Value - Dim strGroup As String = GeneralHelpers.FluffContent(txtGroup.Text) - Dim lngNumShots As Long = nudShots.Value - Dim lngYards As Long = nudYards.Value - Dim strPowName As String = GeneralHelpers.FluffContent(txtPowName.Text) - Dim strPowWei As String = GeneralHelpers.FluffContent(txtPowWei.Text) - Dim strPowManu As String = GeneralHelpers.FluffContent(txtPowManu.Text) - Dim strBullet As String = GeneralHelpers.FluffContent(txtBullet.Text) - Dim strPrimer As String = GeneralHelpers.FluffContent(txtPrimer.Text) - Dim strCase As String = GeneralHelpers.FluffContent(txtCase.Text) - Dim strCond As String = GeneralHelpers.FluffContent(txtCon.Text) - Dim strLen As String = GeneralHelpers.FluffContent(txtLen.Text) - Dim strNotes As String = GeneralHelpers.FluffContent(txtNotes.Text) - Dim ConfigName As String = "N/A" - Dim strBarLen As String = "" - Dim Caliber As String = "" - Dim Obj As New BSDatabase - Dim ObjIM As New InventoryMath - Dim ObjGF As New GlobalFunctions - Call ObjGF.GetFirearmDetails(lngFID, 0, "", "", "", Caliber, strBarLen) - Dim Sql As String = "INSERT INTO Loaders_Log_NSG (fid,dt,yds,gs,ns,pwm,bullet," & _ - "primer,case,conditions,tl,notes,ConfigName,FirearmName,Caliber,BarrelLen)" & _ - " VALUES (" & lngFID & ",'" & strDateTested & "'," & lngYards & _ - ",'" & strGroup & "'," & lngNumShots & ",'" & strPowName & " - " & strPowWei & _ - " - " & strPowManu & "','" & strBullet & _ - "','" & strPrimer & "','" & strCase & _ - "','" & strCond & "','" & strLen & "','" & strNotes & "','" & _ - ConfigName & "','" & strFireArm & "','" & Caliber & "','" & strBarLen & "')" - Obj.ConnExec(Sql) - MsgBox("Information was saved to the Loaders Log!") - If FromView Then Call frmViewDataSheet_RiflePistols.LoadDataCur() - Me.Close() - Catch ex As Exception - Call LogError(Me.Name, "SaveData", Err.Number, ex.Message.ToString) - End Try - End Sub - Private Sub frmCopy_DataSheet_RiflePistol_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call LoadData() - End Sub - - Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click - Call SaveData() - End Sub - - Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click - Me.Close() - End Sub -End Class \ No newline at end of file diff --git a/BSMyLoadersLog/frmForgotPassword.Designer.vb b/BSMyLoadersLog/frmForgotPassword.Designer.vb index 9a58472..cd551d1 100644 --- a/BSMyLoadersLog/frmForgotPassword.Designer.vb +++ b/BSMyLoadersLog/frmForgotPassword.Designer.vb @@ -1,5 +1,5 @@ _ -Partial Class frmForgotPassword +Partial Class FrmForgotPassword Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. diff --git a/BSMyLoadersLog/frmForgotPassword.vb b/BSMyLoadersLog/frmForgotPassword.vb index eef5010..b894d04 100644 --- a/BSMyLoadersLog/frmForgotPassword.vb +++ b/BSMyLoadersLog/frmForgotPassword.vb @@ -1,23 +1,36 @@ -Public Class frmForgotPassword - Private Sub btnAnswer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAnswer.Click +''' +''' Class FrmForgotPassword. +''' Implements the +''' +''' +Public Class FrmForgotPassword + ''' + ''' Handles the Click event of the btnAnswer control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub btnAnswer_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAnswer.Click Dim strword As String = LCase(Trim(txtWord.Text)) - Dim sMsg As String = "" If strword = UseMyForgotWord Then - sMsg = "Your password is " & UseMyPwd + Dim sMsg As String = "Your password is " & UseMyPwd txtWord.Text = "" MsgBox(sMsg) frmLogin.TopMost = True - Me.Close() + Close() Else - sMsg = "That is incorrect!" + Dim sMsg As String = "That is incorrect!" txtWord.Text = "" MsgBox(sMsg) End If End Sub - - Private Sub frmForgotPassword_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load + ''' + ''' Handles the Load event of the frmForgotPassword control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub frmForgotPassword_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load lblPhrase.Text = UseMyForgotPhrase - Me.TopMost = True + TopMost = True End Sub End Class \ No newline at end of file diff --git a/BSMyLoadersLog/frmLoadMakeReady_Details.vb b/BSMyLoadersLog/frmLoadMakeReady_Details.vb deleted file mode 100644 index a7090fa..0000000 --- a/BSMyLoadersLog/frmLoadMakeReady_Details.vb +++ /dev/null @@ -1,385 +0,0 @@ -Imports BSMyLoadersLog.LoadersClass -Imports System.Data.Odbc -Imports BurnSoft.Applications.MLL.Helpers - -''' -''' Class frmLoadMakeReady_Details. -''' Implements the -''' -''' -Public Class frmLoadMakeReady_Details - ''' - ''' The error out - ''' - Dim errOut As string - ''' - ''' The configuration name - ''' - Public ConfigName As String - ''' - ''' The configuration identifier - ''' - Public ConfigID As Long - ''' - ''' The is personal - ''' - Dim IsPersonal As Boolean - ''' - ''' The is shot gun' - ''' - Dim IsShotGun As Boolean - ''' - ''' The cost bullet - ''' - Dim COST_BULLET As Double - ''' - ''' The cost primer - ''' - Dim COST_PRIMER As Double - ''' - ''' The cost case - ''' - Dim COST_CASE As Double - ''' - ''' The cost powder - ''' - Dim COST_POWDER As Double - ''' - ''' The cost shot - ''' - Dim COST_SHOT As Double - ''' - ''' The cost slug - ''' - Dim COST_SLUG As Double - ''' - ''' The mid powder - ''' - Dim MID_POWDER As Double - ''' - ''' The l makeable rounds - ''' - Dim lMakeableRounds As Long - ''' - ''' The instock bullet - ''' - Dim INSTOCK_BULLET As Long - ''' - ''' The instock primer - ''' - Dim INSTOCK_PRIMER As Long - ''' - ''' The instock case - ''' - Dim INSTOCK_CASE As Long - ''' - ''' The instock powder - ''' - Dim INSTOCK_POWDER As Double - ''' - ''' The instock shot - ''' - Dim INSTOCK_SHOT As Double - ''' - ''' The instock shot oz - ''' - Dim INSTOCK_SHOT_OZ As Double - ''' - ''' The shot prefload - ''' - Dim SHOT_PREFLOAD As Double - ''' - ''' The instock slug - ''' - Dim INSTOCK_SLUG As Double - ''' - ''' The preffered powder identifier - ''' - Dim PrefferedPowderID As Long - ''' - ''' The wad maxload - ''' - Dim WAD_MAXLOAD As Double - ''' - ''' The instock wad - ''' - Dim INSTOCK_WAD As Double - ''' - ''' The shot details gr - ''' - Dim ShotDetails_GR As Double - ''' - ''' The cost wad - ''' - Dim COST_WAD As Double - ''' - ''' The FPS mid - ''' - Dim FPS_MID As Double - ''' - ''' The is slug - ''' - Dim IsSlug As Boolean - ''' - ''' The bid - ''' - Dim BID As Long - ''' - ''' The prid - ''' - Dim PRID As Long - ''' - ''' The cid - ''' - Dim CID As Long - ''' - ''' The Shot/SlugID - ''' - Dim SID As Long - ''' - ''' The Hull ID - ''' - Dim HID As Long - ''' - ''' The WAD ID - ''' - Dim WID As Long - ''' - ''' The d c1 ra - ''' - Dim dC1RA As Double -#Region "General Subs and Functions" - ''' - ''' Loads the costs. - ''' - Sub LoadCosts() - Dim lnmr As Long = 0 - Dim dPowPerB As Double = 0 - If Not IsShotGun Then - dC1RA = Converters.CostOfRoundsOfAmmoMetalic(COST_PRIMER, COST_CASE, COST_BULLET, COST_POWDER, MID_POWDER) - lnmr = INSTOCK_BULLET - If lnmr < INSTOCK_CASE Then - lnmr = INSTOCK_BULLET - ElseIf lnmr > INSTOCK_CASE Then - lnmr = INSTOCK_CASE - End If - dPowPerB = (INSTOCK_POWDER / MID_POWDER) - If lnmr > INSTOCK_PRIMER Then lnmr = INSTOCK_PRIMER - If lnmr > dPowPerB Then lnmr = CLng(dPowPerB) - Else - If Not IsSlug Then - COST_BULLET = COST_SHOT * (SHOT_PREFLOAD * WeightGramsOz) ' * COST_SHOT - Else - COST_BULLET = COST_SLUG - End If - dC1RA = Converters.CostOfRoundsOfAmmoShotGun(COST_PRIMER, COST_CASE, COST_BULLET, COST_POWDER, MID_POWDER, COST_WAD) - - If IsSlug Then - lnmr = INSTOCK_SLUG - If lnmr < INSTOCK_CASE Then - lnmr = INSTOCK_SLUG - ElseIf lnmr > INSTOCK_CASE Then - lnmr = INSTOCK_CASE - End If - If lnmr > INSTOCK_WAD Then lnmr = INSTOCK_WAD - dPowPerB = (INSTOCK_POWDER / MID_POWDER) - If lnmr > INSTOCK_PRIMER Then lnmr = INSTOCK_PRIMER - If lnmr > dPowPerB Then lnmr = CLng(dPowPerB) - Else - Dim CountMakeAble As Double = INSTOCK_SHOT_OZ / SHOT_PREFLOAD - lnmr = CountMakeAble - If lnmr < INSTOCK_CASE Then - lnmr = CountMakeAble - ElseIf lnmr > INSTOCK_CASE Then - lnmr = INSTOCK_CASE - End If - If lnmr > INSTOCK_WAD Then lnmr = INSTOCK_WAD - dPowPerB = (INSTOCK_POWDER / MID_POWDER) - If lnmr > INSTOCK_PRIMER Then lnmr = INSTOCK_PRIMER - If lnmr > dPowPerB Then lnmr = CLng(dPowPerB) - End If - End If - lMakeableRounds = lnmr - End Sub - ''' - ''' Loads the data. - ''' - Sub LoadData() - Try - IsShotGun = False - IsPersonal = False - Dim Obj As New InventoryMath - Call Obj.LoadConfig(ConfigID, IsPersonal, IsShotGun, "") - If Not IsShotGun Then - PrefferedPowderID = Obj.GetPrefNSGPowderID(ConfigID, MID_POWDER, FPS_MID) - COST_POWDER = Obj.GetPricePerPowder(PrefferedPowderID) - INSTOCK_POWDER = Obj.GetQTYPerPowder(PrefferedPowderID) - Call LoadConfig_RiflePistol() - Else - PrefferedPowderID = Obj.GetPrefSGPowderID(ConfigID, MID_POWDER, FPS_MID) - COST_POWDER = Obj.GetPricePerPowder(PrefferedPowderID) - INSTOCK_POWDER = Obj.GetQTYPerPowder(PrefferedPowderID) - LoadConfig_ShotGun() - End If - Call LoadCosts() - Catch ex As Exception - Call LogError(Me.Name, "LoadData", Err.Number, ex.Message.ToString) - End Try - End Sub - ''' - ''' Loads the configuration rifle pistol. - ''' - Private Sub LoadConfig_RiflePistol() - Try - Dim Obj As New BSDatabase - Dim ObjIM As New InventoryMath - Dim SQL As String = "SELECT * from Config_List_Data_NSG where CLNID=" & ConfigID - Call Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - RS = CMD.ExecuteReader - While RS.Read - txtManu.Text = OwnerLoadName - txtName.Text = ConfigName - txtCal.Text = ObjIM.GetCaliber(RS("CALID")) - BID = RS("BID") - PRID = RS("PRID") - CID = RS("CAID") - Call ObjIM.LoadBulletInfo(BID, "", txtJacket.Text, "", txtGrains.Text, _ - "", "", "", INSTOCK_BULLET, "", COST_BULLET) - Call ObjIM.LoadPrimerInfo(PRID, "", "", "", COST_PRIMER, INSTOCK_PRIMER) - Call ObjIM.LoadCaseInfo(CID, "", "", "", "", INSTOCK_CASE, COST_CASE) - End While - RS.Close() - RS = Nothing - CMD = Nothing - Catch ex As Exception - Call LogError(Me.Name, "LoadConfig_RiflePistol", Err.Number, ex.Message.ToString) - End Try - End Sub - ''' - ''' Loads the configuration shot gun. - ''' - Private Sub LoadConfig_ShotGun() - Try - Dim Obj As New BSDatabase - Dim ObjIM As New InventoryMath - Dim SQL As String = "SELECT * from Config_List_Data_SG where CLNID=" & ConfigID - Call Obj.ConnectDB() - Dim CMD As New OdbcCommand(SQL, Obj.Conn) - Dim RS As OdbcDataReader - Dim ShotDetails_Manu As String = "" - Dim ShotDetails_Name As String = "" - Dim ShotDetails_QTY As Double = 0 - Dim ShotDetails_EPPS As Double = 0 - Dim ShotDetails_ShotMat As String = "" - Dim ShotDetails_ShotNo As String = "" - Dim ShotDetails_SlugWeight As String = "" - RS = CMD.ExecuteReader - While RS.Read - txtCal.Text = ObjIM.GetCaliber(RS("ATID")) - SID = RS("SCL") - PRID = RS("PRID") - HID = RS("CAID") - WID = RS("WAD") - Call ObjIM.LoadSG_ShotType_Details(SID, ShotDetails_Manu, ShotDetails_Name, IsSlug, _ - ShotDetails_ShotMat, ShotDetails_ShotNo, ShotDetails_SlugWeight, "", ShotDetails_QTY, ShotDetails_EPPS, _ - 0, INSTOCK_SHOT_OZ, ShotDetails_GR) - txtManu.Text = OwnerLoadName - txtName.Text = ConfigName - txtJacket.Text = ShotDetails_ShotNo & " Shot" - If Not IsDBNull(RS("SW_t")) Then txtGrains.Text = RS("SW_t") & " oz. shot" - SHOT_PREFLOAD = RS("SW") - If Not IsSlug Then - COST_SHOT = ShotDetails_EPPS - INSTOCK_SHOT = ShotDetails_GR - Else - COST_SLUG = ShotDetails_EPPS - INSTOCK_SLUG = ShotDetails_QTY - End If - Call ObjIM.LoadWADInfo(WID, "", "", "", WAD_MAXLOAD, INSTOCK_WAD, COST_WAD) - Call ObjIM.LoadPrimerInfo(PRID, "", "", "", COST_PRIMER, INSTOCK_PRIMER) - Call ObjIM.LoadHullInfo(HID, "", "", "", INSTOCK_CASE, COST_CASE) - End While - RS.Close() - RS = Nothing - CMD = Nothing - Catch ex As Exception - Call LogError(Me.Name, "LoadConfig_RiflePistol", Err.Number, ex.Message.ToString) - End Try - End Sub - ''' - ''' Saves the audit. - ''' - ''' The qty. - Sub SaveAudit(ByVal qty As Long) - Dim Obj As New BSDatabase - Dim ObjIM As New InventoryMath - Dim SQL As String = "INSERT INTO Loaders_Log_Ammunition_Audit (CFID,dtc,qty,ec,ecpr) VALUES(" & _ - ConfigID & ",'" & Now & "'," & qty & "," & ObjIM.ConvertToDollars((qty * dC1RA)) & "," & ObjIM.ConvertToDollars(dC1RA) & ")" - Obj.ConnExec(SQL) - End Sub -#End Region -#Region "Form Subs" - ''' - ''' Handles the Load event of the frmLoadMakeReady_Details control. - ''' - ''' The source of the event. - ''' The instance containing the event data. - Private Sub frmLoadMakeReady_Details_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - Call LoadData() - lblInv.Text = "NOTE: Inventory states that you have enough to make " & lMakeableRounds & " rounds." - nudQty.Maximum = lMakeableRounds - End Sub - ''' - ''' Handles the Click event of the Cancel control. - ''' - ''' The source of the event. - ''' The instance containing the event data. - Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click - Me.Close() - End Sub - ''' - ''' Handles the Click event of the btnMake control. - ''' - ''' The source of the event. - ''' The instance containing the event data. - ''' - Private Sub btnMake_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMake.Click - Dim strManu As String = GeneralHelpers.FluffContent(txtManu.Text) - Dim strName As String = GeneralHelpers.FluffContent(txtName.Text) - Dim strCaliber As String = GeneralHelpers.FluffContent(txtCal.Text) - Dim strGrains As String = GeneralHelpers.FluffContent(txtGrains.Text) - Dim strJacket As String = GeneralHelpers.FluffContent(txtJacket.Text) - 'Dim dcal As Double = ConvToNum(strGrains) - 'Converters - Dim dcal As Double = Converters.ConvToNum(strGrains, errOut) - If errOut.Length > 0 Then Throw New Exception(errOut) - Dim iQty As Long = nudQty.Value - Dim cQty As Long = 0 - Dim ObjIM As New InventoryMath - Dim Obj As New BSDatabase - Dim SQL As String = "" - Dim MID As Long = 0 - - If ObjIM.IsAlreadyListed(strManu, strName, strCaliber, strGrains, strJacket, cQty, MID) Then - SQL = "UPDATE Loaders_Log_Ammunition set Qty='" & (cQty + iQty) & "' where id=" & MID - Obj.ConnExec(SQL) - Else - SQL = "INSERT INTO Loaders_Log_Ammunition(Manufacturer,Name,Cal,Grain,Jacket,Qty,dcal,Vel) VALUES('" & _ - strManu & "','" & strName & "','" & strCaliber & "','" & strGrains & "','" & _ - strJacket & "'," & iQty & "," & dcal & "," & FPS_MID & ")" - Obj.ConnExec(SQL) - End If - If Not IsShotGun Then - Call ObjIM.ARUNSG_UpdateInventoryQty(iQty, INSTOCK_BULLET, BID, INSTOCK_PRIMER, PRID, INSTOCK_CASE, CID, _ - INSTOCK_POWDER, PrefferedPowderID, MID_POWDER) - Else - Call ObjIM.ARUSG_UpdateInventoryQty(iQty, INSTOCK_SLUG, SID, INSTOCK_PRIMER, PRID, INSTOCK_CASE, HID, _ - INSTOCK_POWDER, PrefferedPowderID, MID_POWDER, INSTOCK_WAD, WID, IsSlug, INSTOCK_SHOT_OZ, ShotDetails_GR, SHOT_PREFLOAD) - End If - Call SaveAudit(iQty) - Me.Close() - End Sub -#End Region -End Class \ No newline at end of file diff --git a/BSMyLoadersLog/frmLogin.Designer.vb b/BSMyLoadersLog/frmLogin.Designer.vb index 4617dc5..d12be45 100644 --- a/BSMyLoadersLog/frmLogin.Designer.vb +++ b/BSMyLoadersLog/frmLogin.Designer.vb @@ -1,5 +1,5 @@ _ -Partial Class frmLogin +Partial Class FrmLogin Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. diff --git a/BSMyLoadersLog/frmLogin.vb b/BSMyLoadersLog/frmLogin.vb index 73f6398..c751526 100644 --- a/BSMyLoadersLog/frmLogin.vb +++ b/BSMyLoadersLog/frmLogin.vb @@ -1,5 +1,13 @@ -Public Class frmLogin - Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click +''' +''' Form Login Windows Code +''' +Public Class FrmLogin + ''' + ''' Handles the Click event of the OK control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub OK_Click(ByVal sender As Object, ByVal e As EventArgs) Handles OK.Click Dim strUID As String = LCase(UsernameTextBox.Text) Dim strPWD As String = LCase(PasswordTextBox.Text) If strUID = LCase(UseMyUid) Then @@ -8,23 +16,31 @@ Public Class frmLogin MDIParentMain.Show() Me.Close() Else - MsgBox("Incorrect Username/Password", MsgBoxStyle.Critical, Me.Text) + MsgBox("Incorrect Username/Password", MsgBoxStyle.Critical, Text) UsernameTextBox.Text = "" PasswordTextBox.Text = "" End If Else - MsgBox("Incorrect Username/Password", MsgBoxStyle.Critical, Me.Text) + MsgBox("Incorrect Username/Password", MsgBoxStyle.Critical, Text) UsernameTextBox.Text = "" PasswordTextBox.Text = "" End If End Sub - - Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click - Global.System.Windows.Forms.Application.Exit() + ''' + ''' Handles the Click event of the Cancel control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub Cancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Cancel.Click + Application.Exit() End Sub - - Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click - Me.TopMost = False + ''' + ''' Handles the Click event of the Label1 control. + ''' + ''' The source of the event. + ''' The instance containing the event data. + Private Sub Label1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Label1.Click + TopMost = False frmForgotPassword.Show() End Sub End Class diff --git a/BSMyLoadersLog/frmOptions.vb b/BSMyLoadersLog/frmOptions.vb index a3c884e..a958544 100644 --- a/BSMyLoadersLog/frmOptions.vb +++ b/BSMyLoadersLog/frmOptions.vb @@ -59,6 +59,7 @@ Public Class FrmOptions 'Exit Function End If End If + 'TODO: #20 Clean up Code 'If bSec Then iUsePassword = 1 'Dim sql As String = "" 'Dim obj As New BSDatabase @@ -85,20 +86,21 @@ Public Class FrmOptions _errOut) Then Throw New Exception(_errOut) End If 'obj.ConnExec(sql) - 'objR.SaveSettings("0000", chkBAKCleanup.Checked, nudDays.Value, + 'objR.SaveSettings("0000", chkBAKCleanup.Checked, nudDays.Value, ' False, False, chkAOBU.Checked, chkBackupOnExit.Checked, - ' chkDoOriginalImage.Checked, bShotGun, bRiflePistol, + ' chkDoOriginalImage.Checked, bShotGun, bRiflePistol, ' strDefaultList, chkIPer.Checked, chkViewFPS.Checked, chkViewCUPS.Checked) Dim mySettings As List(Of RegistrySettings) = MyRegistry.BuildRegistry( AlertOnBackUp := chkAOBU.Checked, BackupOnExit := chkBackupOnExit.Checked, UseOrgImage := chkDoOriginalImage.Checked, LOADERTYPE_SHOTGUN := bShotGun, LOADERTYPE_NONSHOTGUN := bRiflePistol, DefaultList := strDefaultList, IndvReports := chkIPer.Checked, - VIEW_FPS := chkViewFPS.Checked, VIEW_CUPS := chkViewCUPS.Checked) + VIEW_FPS := chkViewFPS.Checked, VIEW_CUPS := chkViewCUPS.Checked, + TrackHistory:=chkBAKCleanup.Checked, TrackHistoryDays := nudDays.Value) If Not MyRegistry.SaveSettings(mySettings, _errOut) Then Throw New Exception(_errOut) - LoadertypeShotgun = bShotGun + LoaderTypeShotGun = bShotGun OwnerLoadName = Replace(strLoadName, "''", "'") - LoadertypeNonshotgun = bRiflePistol + LoaderTypeMetalic = bRiflePistol ViewFps = chkViewFPS.Checked ViewCups = chkViewCUPS.Checked Defaultlist = strDefaultList @@ -124,13 +126,18 @@ Public Class FrmOptions chkAOBU.Checked = o.AlertOnBackUp nudDays.Value = o.TrackHistoryDays chkBAKCleanup.Checked = o.TrackHistory - chkBackupOnExit.Checked = o.AutoBackup + chkBackupOnExit.Checked = o.BackupOnExit chkDoOriginalImage.Checked = o.UseOrgImage chkIPer.Checked = o.IndvReports + LoaderTypeShotGun = o.LoaderTypeShotGun + LoaderTypeMetalic = o.LoaderTypeMetalic + Defaultlist = o.DefaultList + ViewFps = o.ViewFps + ViewCups = o.ViewCups Next - chkShotGun.Checked = LoadertypeShotgun - chkRiflePistol.Checked = LoadertypeNonshotgun + chkShotGun.Checked = LoaderTypeShotGun + chkRiflePistol.Checked = LoaderTypeMetalic cmbDefaultList.Text = Defaultlist chkViewFPS.Checked = ViewFps chkViewCUPS.Checked = ViewCups @@ -141,6 +148,7 @@ Public Class FrmOptions ''' Sub GetDbData() Try + 'TODO: #20 Clean up Code 'Dim obj As New BSDatabase 'Dim intUsePass As Integer 'Call obj.ConnectDB() @@ -193,14 +201,14 @@ Public Class FrmOptions txtState.Text = Trim(o.State) txtZip.Text = Trim(o.ZipCode) txtPhone.Text = Trim(o.Phone) ' oEncrypt.DecryptSHA(RS("Phone")) - txtLic.Text = One.Decrypt(o.License) + txtLic.Text = o.License chkSec.Checked = o.UseLock If o.UseLock Then txtPWD.Text = One.Decrypt(o.Password) txtCPWD.Text = txtPWD.Text - txtUID.Text = One.Decrypt(o.UserName) - txtPhrase.Text = One.Decrypt(o.ForgetPhrase) - txtWord.Text = One.Decrypt(o.Forgot) + txtUID.Text = o.UserName + txtPhrase.Text = o.ForgetPhrase + txtWord.Text = o.Forgot End If Next Else diff --git a/BSMyLoadersLog/packages.config b/BSMyLoadersLog/packages.config index dd60137..15ec69d 100644 --- a/BSMyLoadersLog/packages.config +++ b/BSMyLoadersLog/packages.config @@ -1,6 +1,7 @@  - + + diff --git a/docs/AboutProject/Forums.md b/docs/AboutProject/Forums.md index 0d3f899..3ff0198 100644 --- a/docs/AboutProject/Forums.md +++ b/docs/AboutProject/Forums.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -9,3 +10,5 @@ Github Allows Sections in the Repository for Announcements and Discussions about To participate in the Discussions Forum, you must be registered or sign-up with Github. To View the Discussions Forum [Click Here](https://github.com/burnsoftnet/MyLoadersLog/discussions) + +[back](./) \ No newline at end of file diff --git a/docs/AboutProject/How to Download.md b/docs/AboutProject/How to Download.md index b3d1d96..d4de68a 100644 --- a/docs/AboutProject/How to Download.md +++ b/docs/AboutProject/How to Download.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -6,4 +7,6 @@ layout: default You can download the Download the Latests Release or Past Releases at [My Loaders Log Repo Release Page](https://github.com/burnsoftnet/MyLoadersLog/releases) -**Note As of 2023, we let the SSL Certificate lapse, Since there is no income coming in for the windows applications, it was decided that the SSL Signing of the Install Application was no longer needed to spend an extra $300+ on keeping the certificate.** \ No newline at end of file +**Note As of 2023, we let the SSL Certificate lapse, Since there is no income coming in for the windows applications, it was decided that the SSL Signing of the Install Application was no longer needed to spend an extra $300+ on keeping the certificate.** + +[back](./) \ No newline at end of file diff --git a/docs/AboutProject/issues.md b/docs/AboutProject/issues.md index 45f7279..4c4017f 100644 --- a/docs/AboutProject/issues.md +++ b/docs/AboutProject/issues.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -8,4 +9,6 @@ The Issues Sections of the Project contains Bugs that was found and Future enhan To submit a but or request an issues you must be registered or sign-up with Github. -To view the issues section [Click here](https://github.com/burnsoftnet/MyLoadersLog/issues) \ No newline at end of file +To view the issues section [Click here](https://github.com/burnsoftnet/MyLoadersLog/issues) + +[back](./) \ No newline at end of file diff --git a/docs/help/Add_New_Config.md b/docs/help/Add_New_Config.md index b81c185..5eda1ea 100644 --- a/docs/help/Add_New_Config.md +++ b/docs/help/Add_New_Config.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -35,3 +36,4 @@ The Last Window will allow you to select the powder that was used for this confi If you wanted to add more powders to the list, you can click on the configuration from the side menu to view, then click on the Powder tab, use the Add button to add more powders to this configuration. +[back](./) \ No newline at end of file diff --git a/docs/help/Add_Powder2Inv.md b/docs/help/Add_Powder2Inv.md index 15b3243..68d9a81 100644 --- a/docs/help/Add_Powder2Inv.md +++ b/docs/help/Add_Powder2Inv.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -14,4 +15,7 @@ The only thing that is required on this form is the Manufacturer and the Name. ![](images/Add_Powder2Inv_Form_Filled.jpg) -Once you are finished entering in your information, just click on the Add button to store it to the database \ No newline at end of file +Once you are finished entering in your information, just click on the Add button to store it to the database + + +[back](./) \ No newline at end of file diff --git a/docs/help/Add_Primers2Inv.md b/docs/help/Add_Primers2Inv.md index 5d615f7..3b264a6 100644 --- a/docs/help/Add_Primers2Inv.md +++ b/docs/help/Add_Primers2Inv.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -15,3 +16,6 @@ The only thing that is required on this form is the Manufacturer and the Name. ![](images/Add_Primer2Inv_Form_Filled.jpg) Once you are finished entering in your information, just click on the Add button to store it to the database + + +[back](./) \ No newline at end of file diff --git a/docs/help/Add_Reloading_Equip.md b/docs/help/Add_Reloading_Equip.md index 4b8f136..3838cab 100644 --- a/docs/help/Add_Reloading_Equip.md +++ b/docs/help/Add_Reloading_Equip.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -16,4 +17,6 @@ Once the form comes up Just type in the Manufacturer, Name, Use, and Price. Once you are done, just click on the Add button to store the information. You can View your equipment list from the View Equipment List section -![](images/View_Reloading_Equipment.jpg) \ No newline at end of file +![](images/View_Reloading_Equipment.jpg) + +[back](./) \ No newline at end of file diff --git a/docs/help/Add_Wad2Inv.md b/docs/help/Add_Wad2Inv.md index 315d26f..94fdae1 100644 --- a/docs/help/Add_Wad2Inv.md +++ b/docs/help/Add_Wad2Inv.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -14,4 +15,6 @@ Everything on the form requires input except for the Qty, and Price. The infor ![](images/Add_Wad_Form_Filled.jpg) -Once you are done, click on the Add button to add it to the database. \ No newline at end of file +Once you are done, click on the Add button to add it to the database. + +[back](./) \ No newline at end of file diff --git a/docs/help/Copy_Config.md b/docs/help/Copy_Config.md index 2ab3df2..4609ab1 100644 --- a/docs/help/Copy_Config.md +++ b/docs/help/Copy_Config.md @@ -1,3 +1,5 @@ +[back](./) + --- layout: default --- @@ -18,4 +20,6 @@ The Following windows will appear: Type in the new name for the configuration, then click on the OK button. -Once you click on the Ok button, the menu list will update and you will be able to view or edit the configuration you just copied. \ No newline at end of file +Once you click on the Ok button, the menu list will update and you will be able to view or edit the configuration you just copied. + +[back](./) \ No newline at end of file diff --git a/docs/help/Copy_LoadersLog_Entry.md b/docs/help/Copy_LoadersLog_Entry.md index b091554..1a1bc19 100644 --- a/docs/help/Copy_LoadersLog_Entry.md +++ b/docs/help/Copy_LoadersLog_Entry.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -18,4 +19,6 @@ While you are viewing the Loaders Log, click on the entry that you want to copy Once you are finished making the changes, click on the Add button to save the information to the database. -![](images/Copy_LoadersLog_View_After.jpg) \ No newline at end of file +![](images/Copy_LoadersLog_View_After.jpg) + +[back](./) \ No newline at end of file diff --git a/docs/help/Database_Cleanup.md b/docs/help/Database_Cleanup.md index 22118e9..01e1991 100644 --- a/docs/help/Database_Cleanup.md +++ b/docs/help/Database_Cleanup.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -22,4 +23,6 @@ Once you have selected the option that you wish to perform, click on the Start B ![](images/DBCleanup_Form_Deleted.jpg) -Once the Delete is complete, it will let you know by displaying the message box above. Once you click on OK, it will go back to the Clean Up database window so you can select another action to perform, or close out the window if you are done. \ No newline at end of file +Once the Delete is complete, it will let you know by displaying the message box above. Once you click on OK, it will go back to the Clean Up database window so you can select another action to perform, or close out the window if you are done. + +[back](./) \ No newline at end of file diff --git a/docs/help/Edit_AmmunitionTypes.md b/docs/help/Edit_AmmunitionTypes.md index 3a33c18..8e15904 100644 --- a/docs/help/Edit_AmmunitionTypes.md +++ b/docs/help/Edit_AmmunitionTypes.md @@ -1,3 +1,5 @@ +[back](./) + --- layout: default --- @@ -37,4 +39,6 @@ If there was an ammunition type that you wanted to get rid of since it was not i Once you have the value selected, just hit your Delete key to delete the value from the database. -![](images/Edit_AmmunitionTypes_List_After_Delete.jpg) \ No newline at end of file +![](images/Edit_AmmunitionTypes_List_After_Delete.jpg) + +[back](./) \ No newline at end of file diff --git a/docs/help/Edit_Config_RP.md b/docs/help/Edit_Config_RP.md index 73675d7..c5994db 100644 --- a/docs/help/Edit_Config_RP.md +++ b/docs/help/Edit_Config_RP.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -34,3 +35,6 @@ Once you have made your changes in the Rifle and Pistol Details window, you can The Powder Tab/Window will allow you to change the details of the powder(s) that you have listed for this configuration and it will also allow you to change the default powder for the configuration. Once you have made your changes in the Powder window, you can click on Save Powder button to save your changes or you can click on Save button All to everything and to Exit the Edit Window. + + +[back](./) \ No newline at end of file diff --git a/docs/help/Edit_PreLoadedCalList.md b/docs/help/Edit_PreLoadedCalList.md index 7ad8d47..df2e525 100644 --- a/docs/help/Edit_PreLoadedCalList.md +++ b/docs/help/Edit_PreLoadedCalList.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -38,4 +39,6 @@ Double click on the Blank column and type in what you wish to add to the list. Once you are finished, just hit your Enter key or click on an another field to save your changes. -![](images/Edit_Re-LoadedCalList_After_Add.jpg) \ No newline at end of file +![](images/Edit_Re-LoadedCalList_After_Add.jpg) + +[back](./) \ No newline at end of file diff --git a/docs/help/Edit_PrimerTypes.md b/docs/help/Edit_PrimerTypes.md index 9641692..722d5ae 100644 --- a/docs/help/Edit_PrimerTypes.md +++ b/docs/help/Edit_PrimerTypes.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -37,3 +38,6 @@ If there was a primer type that you wanted to get rid of since it was not in use Once you have the value selected, just hit your Delete key to delete the value from the database. ![](images/Edit_PrimerTypes_List_After_Delete.jpg) + + +[back](./) \ No newline at end of file diff --git a/docs/help/Getting_Started.md b/docs/help/Getting_Started.md index 3e2ff8e..77a3954 100644 --- a/docs/help/Getting_Started.md +++ b/docs/help/Getting_Started.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -19,4 +20,6 @@ When you are getting started, you will need to the following before creating a c * Put in your current inventory of Shell Hulls (Shotgun Reloaders). * Put in your current inventory of Shot &/ Slugs (Shotgun Reloaders). * Put in the Caliber's that you reload for. -* Add in / import your firearm collection to the MLL database. \ No newline at end of file +* Add in / import your firearm collection to the MLL database. + +[back](./) \ No newline at end of file diff --git a/docs/help/Report_Inv_Ammunition.md b/docs/help/Report_Inv_Ammunition.md index 60fd1d3..77c5163 100644 --- a/docs/help/Report_Inv_Ammunition.md +++ b/docs/help/Report_Inv_Ammunition.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -20,3 +21,4 @@ Select the Printer that you want this report to go to, and click on the Print bu +[back](./) \ No newline at end of file diff --git a/docs/help/Report_Inv_Brass.md b/docs/help/Report_Inv_Brass.md index 6d14709..11b9f26 100644 --- a/docs/help/Report_Inv_Brass.md +++ b/docs/help/Report_Inv_Brass.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -16,3 +17,4 @@ As you can see it is how the report will look when you print it out. To print o ![](images/Report_PrintOptions.jpg) +[back](./) \ No newline at end of file diff --git a/docs/help/Report_Inv_Bullet.md b/docs/help/Report_Inv_Bullet.md index fc1198a..3979d59 100644 --- a/docs/help/Report_Inv_Bullet.md +++ b/docs/help/Report_Inv_Bullet.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -14,4 +15,6 @@ You Can use the Sort By Drop Down List to Sort the Columns in a particular order As you can see it is how the report will look when you print it out. To print out the report, just click on the Printer icon ( ![](images/Report_PrintIcon.jpg) ) that is located on the menu bar on the report, once you click on that the Print Options will appear: -![](images/Report_PrintOptions.jpg) \ No newline at end of file +![](images/Report_PrintOptions.jpg) + +[back](./) \ No newline at end of file diff --git a/docs/help/Report_Inv_Equipment.md b/docs/help/Report_Inv_Equipment.md index 6c07590..31d0e13 100644 --- a/docs/help/Report_Inv_Equipment.md +++ b/docs/help/Report_Inv_Equipment.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -15,3 +16,6 @@ You Can use the Sort By Drop Down List to Sort the Columns in a particular order As you can see it is how the report will look when you print it out. To print out the report, just click on the Printer icon ( ![](images/Report_PrintIcon.jpg) ) that is located on the menu bar on the report, once you click on that the Print Options will appear: ![](images/Report_PrintOptions.jpg) + + +[back](./) \ No newline at end of file diff --git a/docs/help/Report_Inv_Firearm.md b/docs/help/Report_Inv_Firearm.md index a8b060f..fb754b5 100644 --- a/docs/help/Report_Inv_Firearm.md +++ b/docs/help/Report_Inv_Firearm.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -15,3 +16,5 @@ You Can use the Sort By Drop Down List to Sort the Columns in a particular order As you can see it is how the report will look when you print it out. To print out the report, just click on the Printer icon ( ![](images/Report_PrintIcon.jpg) ) that is located on the menu bar on the report, once you click on that the Print Options will appear: ![](images/Report_PrintOptions.jpg) + +[back](./) \ No newline at end of file diff --git a/docs/help/Report_Inv_Hulls.md b/docs/help/Report_Inv_Hulls.md index 8823a18..0db9605 100644 --- a/docs/help/Report_Inv_Hulls.md +++ b/docs/help/Report_Inv_Hulls.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -14,4 +15,6 @@ You Can use the Sort By Drop Down List to Sort the Columns in a particular order As you can see it is how the report will look when you print it out. To print out the report, just click on the Printer icon ( ![](images/Report_PrintIcon.jpg) ) that is located on the menu bar on the report, once you click on that the Print Options will appear: -![](images/Report_PrintOptions.jpg) \ No newline at end of file +![](images/Report_PrintOptions.jpg) + +[back](./) \ No newline at end of file diff --git a/docs/help/Report_Inv_Powder.md b/docs/help/Report_Inv_Powder.md index 392f1ab..7253811 100644 --- a/docs/help/Report_Inv_Powder.md +++ b/docs/help/Report_Inv_Powder.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -14,4 +15,6 @@ You Can use the Sort By Drop Down List to Sort the Columns in a particular order As you can see it is how the report will look when you print it out. To print out the report, just click on the Printer icon ( ![](images/Report_PrintIcon.jpg) ) that is located on the menu bar on the report, once you click on that the Print Options will appear: -![](images/Report_PrintOptions.jpg) \ No newline at end of file +![](images/Report_PrintOptions.jpg) + +[back](./) \ No newline at end of file diff --git a/docs/help/Report_Inv_Primers.md b/docs/help/Report_Inv_Primers.md index 74f501e..eb9842a 100644 --- a/docs/help/Report_Inv_Primers.md +++ b/docs/help/Report_Inv_Primers.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -14,4 +15,7 @@ You Can use the Sort By Drop Down List to Sort the Columns in a particular order As you can see it is how the report will look when you print it out. To print out the report, just click on the Printer icon ( ![](images/Report_PrintIcon.jpg) ) that is located on the menu bar on the report, once you click on that the Print Options will appear: -![](images/Report_PrintOptions.jpg) \ No newline at end of file +![](images/Report_PrintOptions.jpg) + + +[back](./) \ No newline at end of file diff --git a/docs/help/Report_Inv_WAD.md b/docs/help/Report_Inv_WAD.md index 9bbf986..7356740 100644 --- a/docs/help/Report_Inv_WAD.md +++ b/docs/help/Report_Inv_WAD.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -14,4 +15,6 @@ You Can use the Sort By Drop Down List to Sort the Columns in a particular order As you can see it is how the report will look when you print it out. To print out the report, just click on the Printer icon ( ![](images/Report_PrintIcon.jpg) ) that is located on the menu bar on the report, once you click on that the Print Options will appear: -![](images/Report_PrintOptions.jpg) \ No newline at end of file +![](images/Report_PrintOptions.jpg) + +[back](./) \ No newline at end of file diff --git a/docs/help/Report_LoadersLog_w_config_RP.md b/docs/help/Report_LoadersLog_w_config_RP.md index 296d12d..d0bea34 100644 --- a/docs/help/Report_LoadersLog_w_config_RP.md +++ b/docs/help/Report_LoadersLog_w_config_RP.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -19,3 +20,5 @@ Once you click on that the report will appear. As you can see it is how the report will look when you print it out. To print out the report, just click on the Printer icon ( ![](images/Report_PrintIcon.jpg) ) that is located on the menu bar on the report, once you click on that the Print Options will appear: ![](images/Report_PrintOptions.jpg) + +[back](./) \ No newline at end of file diff --git a/docs/help/Report_LoadersLog_wo_Config_RP.md b/docs/help/Report_LoadersLog_wo_Config_RP.md index 9553008..51094ab 100644 --- a/docs/help/Report_LoadersLog_wo_Config_RP.md +++ b/docs/help/Report_LoadersLog_wo_Config_RP.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -19,4 +20,6 @@ Once you click on that the report will appear. As you can see it is how the report will look when you print it out. To print out the report, just click on the Printer icon ( ![](images/Report_PrintIcon.jpg) ) that is located on the menu bar on the report, once you click on that the Print Options will appear: -![](images/Report_PrintOptions.jpg) \ No newline at end of file +![](images/Report_PrintOptions.jpg) + +[back](./) \ No newline at end of file diff --git a/docs/help/Search_RP.md b/docs/help/Search_RP.md index 9c40a75..904a70e 100644 --- a/docs/help/Search_RP.md +++ b/docs/help/Search_RP.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -89,3 +90,4 @@ If you try to save the report using the same name of an existing report, it will The Regular Reports will allow you to export the reports to an Excel file or PDF File. In order to try and keep the custom reports up to par with the Stock reports and remain in compliance with BATFE regulations on being able to save the information to a computer file, we added the ability to export the custom report to Text, CSV, HTML or XML file formats. +[back](./) \ No newline at end of file diff --git a/docs/help/Tools_Options.md b/docs/help/Tools_Options.md index f953823..e99867f 100644 --- a/docs/help/Tools_Options.md +++ b/docs/help/Tools_Options.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -42,3 +43,4 @@ The Misc section allow you to set the Default Side list to display when the appl Once you are finished click on Save to save and exit or Apply to save. +[back](./) \ No newline at end of file diff --git a/docs/help/View_ConfigSheets.md b/docs/help/View_ConfigSheets.md index a83fe05..855bbf5 100644 --- a/docs/help/View_ConfigSheets.md +++ b/docs/help/View_ConfigSheets.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -102,3 +103,4 @@ Once it is finished, you will get a message box stating the the import was compl ![](images/View_Config_Import_ListUpdated.jpg) +[back](./) \ No newline at end of file diff --git a/docs/help/View_ConfigSheets_Audit.md b/docs/help/View_ConfigSheets_Audit.md index 9536227..e28fb25 100644 --- a/docs/help/View_ConfigSheets_Audit.md +++ b/docs/help/View_ConfigSheets_Audit.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -6,4 +7,6 @@ layout: default ![](images/View_Config_Audit.jpg) -The History/Audit is just a way you can see how many rounds of ammunition was created by using the Make Live Ammunition Feature that this program has. When you use that feature will mark the date and time that it was used, the qty that was made, the total cost for making that amount and the cost per round. This is a simple way to see if the cost of building ammunition has gone up or down and can also be used to compare costs with manufactured ammunition for that time period. \ No newline at end of file +The History/Audit is just a way you can see how many rounds of ammunition was created by using the Make Live Ammunition Feature that this program has. When you use that feature will mark the date and time that it was used, the qty that was made, the total cost for making that amount and the cost per round. This is a simple way to see if the cost of building ammunition has gone up or down and can also be used to compare costs with manufactured ammunition for that time period. + +[back](./) \ No newline at end of file diff --git a/docs/help/View_ConfigSheets_Costs.md b/docs/help/View_ConfigSheets_Costs.md index 3f8f661..ecc27bd 100644 --- a/docs/help/View_ConfigSheets_Costs.md +++ b/docs/help/View_ConfigSheets_Costs.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -24,4 +25,6 @@ Based on the example above, I have 6999.99 grains of powder ( 1 lbs. or also a n ![](images/View_Config_Cost_Stats_Update.jpg) -Now I can make 94 rounds of ammunition which will cost $17.89 or $19.00 for a 100 if I had it. Even beats the cost of some of the cheaper ammunition available. \ No newline at end of file +Now I can make 94 rounds of ammunition which will cost $17.89 or $19.00 for a 100 if I had it. Even beats the cost of some of the cheaper ammunition available. + +[back](./) \ No newline at end of file diff --git a/docs/help/View_ConfigSheets_Information.md b/docs/help/View_ConfigSheets_Information.md index 58f274a..ba3ff47 100644 --- a/docs/help/View_ConfigSheets_Information.md +++ b/docs/help/View_ConfigSheets_Information.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -25,4 +26,6 @@ When viewing a configuration, all you have to do is click on the Active or Inact ## Setting Favorite -When viewing a configuration, all you have to do is click on the checkbox near Favorite to mark it as a favorite, Once you click on it, it's set. \ No newline at end of file +When viewing a configuration, all you have to do is click on the checkbox near Favorite to mark it as a favorite, Once you click on it, it's set. + +[back](./) \ No newline at end of file diff --git a/docs/help/View_ConfigSheets_Notes.md b/docs/help/View_ConfigSheets_Notes.md index dc62cb7..3491a2c 100644 --- a/docs/help/View_ConfigSheets_Notes.md +++ b/docs/help/View_ConfigSheets_Notes.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -24,3 +25,4 @@ Type in what you wish, once you are done, click on the Update button to save. And that is how you add and edit the notes section. +[back](./) \ No newline at end of file diff --git a/docs/help/View_ConfigSheets_Powder.md b/docs/help/View_ConfigSheets_Powder.md index 61564ae..6d4134e 100644 --- a/docs/help/View_ConfigSheets_Powder.md +++ b/docs/help/View_ConfigSheets_Powder.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -16,4 +17,6 @@ The amount of powder that I used was only 23.5, no min or max on this configurat Remember, if you do not want to display the FPS or CUPs while viewing a Configuration, you can disable them in the application Options section under the Misc Tab. -Of Course if you wish to add more powders to this configuration, you can just by Clicking on the Add button. [Click here](Add_New_Config.md) on instructions on Adding Powders to a Configuration. \ No newline at end of file +Of Course if you wish to add more powders to this configuration, you can just by Clicking on the Add button. [Click here](Add_New_Config.md) on instructions on Adding Powders to a Configuration. + +[back](./) \ No newline at end of file diff --git a/docs/help/View_Inv_Equipment.md b/docs/help/View_Inv_Equipment.md index c784af4..a7903e2 100644 --- a/docs/help/View_Inv_Equipment.md +++ b/docs/help/View_Inv_Equipment.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -53,3 +54,4 @@ If you are sure this is the equipment that you wish to delete, then click on the ![](images/View_Inv_Equipm_Delete_List_After.jpg) +[back](./) \ No newline at end of file diff --git a/docs/help/View_Inv_Firearms.md b/docs/help/View_Inv_Firearms.md index 223eced..b54fc3e 100644 --- a/docs/help/View_Inv_Firearms.md +++ b/docs/help/View_Inv_Firearms.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -47,4 +48,6 @@ To Delete a firearm in the list, just click once on the firearm that you wish to If you are sure this is the firearm that you wish to delete, then click on the Yes button. -![](images/View_Firearm_Delete_List.jpg) \ No newline at end of file +![](images/View_Firearm_Delete_List.jpg) + +[back](./) \ No newline at end of file diff --git a/docs/help/View_Inv_Powder.md b/docs/help/View_Inv_Powder.md index 537b601..2acfa6e 100644 --- a/docs/help/View_Inv_Powder.md +++ b/docs/help/View_Inv_Powder.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -77,3 +78,5 @@ Since the list also stores powder that you may not have but is listed in a confi ### Reference ![](images/View_Powder_List_Reference.jpg) + +[back](./) \ No newline at end of file diff --git a/docs/help/View_Inv_Primers.md b/docs/help/View_Inv_Primers.md index 1b7a784..60a7c31 100644 --- a/docs/help/View_Inv_Primers.md +++ b/docs/help/View_Inv_Primers.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -78,3 +79,4 @@ Since the list also stores Primer that you may not have but is listed in a confi ![](images/View_Primer_List_Reference.jpg) +[back](./) \ No newline at end of file diff --git a/docs/help/View_Inv_ReadyToUseAmmo.md b/docs/help/View_Inv_ReadyToUseAmmo.md index 3fb60dc..1b7ec80 100644 --- a/docs/help/View_Inv_ReadyToUseAmmo.md +++ b/docs/help/View_Inv_ReadyToUseAmmo.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -40,3 +41,4 @@ Click on the Yes button to export Click on the Ammunition that you wish to delete, then click on the delete ( ![](images/delete_16x16.gif) ) button on the tool bar. +[back](./) \ No newline at end of file diff --git a/docs/help/View_LoadersLog_RP.md b/docs/help/View_LoadersLog_RP.md index 72a8a1e..1beb56f 100644 --- a/docs/help/View_LoadersLog_RP.md +++ b/docs/help/View_LoadersLog_RP.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -52,4 +53,6 @@ To Delete a Loaders Log entry in the list, just click once on the Log entry that ![](images/View_LoadersLog_Delete.jpg) -If you are sure this is the Log entry that you wish to delete, then click on the Yes button. \ No newline at end of file +If you are sure this is the Log entry that you wish to delete, then click on the Yes button. + +[back](./) \ No newline at end of file diff --git a/docs/help/View_inv_CaseList.md b/docs/help/View_inv_CaseList.md index 86f8551..6bfd967 100644 --- a/docs/help/View_inv_CaseList.md +++ b/docs/help/View_inv_CaseList.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -77,3 +78,4 @@ Since the list also stores Case that you may not have but is listed in a configu ![](images/View_Case_List_Reference.jpg) +[back](./) \ No newline at end of file diff --git a/docs/help/add_shellhulls2Inv.md b/docs/help/add_shellhulls2Inv.md index 4a6db88..2436794 100644 --- a/docs/help/add_shellhulls2Inv.md +++ b/docs/help/add_shellhulls2Inv.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -14,4 +15,6 @@ Everything on the form requires input except for the Qty, and Price. The infor ![](images/Add_Hulls_Form_Filled.jpg) -Once you are done, click on the Add button to add it to the database. \ No newline at end of file +Once you are done, click on the Add button to add it to the database. + +[back](./) \ No newline at end of file diff --git a/docs/help/backup_database.md b/docs/help/backup_database.md index a7f03c9..7413d74 100644 --- a/docs/help/backup_database.md +++ b/docs/help/backup_database.md @@ -1,3 +1,5 @@ +[back](./) + --- layout: default --- @@ -22,4 +24,6 @@ After you select the drive that you wish to backup the dB to, click on the "Back If the program successfully backed up the dB, or if there was an error, a message box will come up and tell you. -We recommend that should be done at least once a month. \ No newline at end of file +We recommend that should be done at least once a month. + +[back](./) \ No newline at end of file diff --git a/docs/help/import_database.md b/docs/help/import_database.md index 64bc90d..bd7fb5f 100644 --- a/docs/help/import_database.md +++ b/docs/help/import_database.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -24,4 +25,6 @@ Now Click on the "Import" button to restore the database. ![](images/import_5.jpg) -If the program successfully import the dB, or if there was an error, a message box will come up and tell you. \ No newline at end of file +If the program successfully import the dB, or if there was an error, a message box will come up and tell you. + +[back](./) \ No newline at end of file diff --git a/docs/help/toc.md b/docs/help/toc.md index 532eeb8..46aea3f 100644 --- a/docs/help/toc.md +++ b/docs/help/toc.md @@ -1,3 +1,4 @@ +[back](./) --- layout: default --- @@ -54,4 +55,5 @@ layout: default * [Add Shell Hulls to Inventory](add_shellhulls2Inv.md) * [Backing up your Database](backup_database.md) * [Restoring a Database](import_database.md) - \ No newline at end of file + +[back](./) \ No newline at end of file