Download SuperBooks 4.0 - SCF Faculty Site Homepage
Transcript
4.0 User’s Manual By Justin Boyd SuperBooks 4.0 User’s Manual Table of Contents Table of Contents Introduction .................................................................................................. 3 Getting Started Login Form .................................................................................................... 3 User Interface ................................................................................................ 4 Setting Username and Password ................................................................... 5 Invoices Invoice Navigator .......................................................................................... 7 Create a New Invoice ..................................................................................... 7 Modifying an Invoice ..................................................................................... 8 Deleting an Invoice ........................................................................................ 8 Reports Single Invoices Viewer ................................................................................ 10 All Invoices Viewer ....................................................................................... 11 More SuperBooks Edit Font.......................................................................................................13 Edit Color .....................................................................................................13 Data Backup .................................................................................................14 Help ..............................................................................................................14 SuperBooks 4.0 User’s Manual Table of Contents Appendices Appendix 1: All Invoices Report ................................................................. 15 Appendix 2: Single Invoices Report ........................................................... 16 Appendix 3: Main Entry Code .................................................................... 17 Appendix 4: Splash Screen Code ............................................................... 29 Appendix 5: Login Form Code .................................................................... 31 Appendix 6: About Form Code .................................................................. 33 SuperBooks User’s Manual Getting Started Introduction Welcome to SuperBooks v. 4.0 by Justin Boyd. SuperBooks is an invoice program for web designers, graphic designers and related professions. With SuperBooks you can enter your clients billing information, store it in a database and print out invoices! SuperBooks is designed to handle all of your invoiceing needs. Login Form Login Form Upon launching the SuperBooks file, the user will be presented with a Login Form. By default, the username and password are both Admin (case sensitive) the first time the program is run and will be so until they are changed. It is highly recommended that you change the username and password upon its first run. For security purposes, the user is allowed three attempts at Username/Password Error logging in to the SuperBooks program. Upon a failed attempt the user will see a Username/Password Error dialog notifying them that the username or password they Failed Login have entered was incorrect. After user’s third try they will see a Failed Login dialog and then SuperBooks will Page 4 of 34 SuperBooks 4.0 User’s Manual Getting Started close. Contact your system administrator if you are unable to login or have forgotten your username or password. User Interface The menu bar, tab control and status bar are the main parts of the user interface. SuperBooks User Interface Page 5 of 34 SuperBooks 4.0 User’s Manual Getting Started The menu bar, highlighted in red, in the above image contains your traditional menu functions, as well as some additional tools. SuperBooks features an Invoice Tab for you to enter in your invoice information and a Viewer Tab that shows you a quick, yet complete list of all invoices in the database. The status bar displays the current time as well as userful information and hints based on where the cursor is located within the form. A more detailed explanation of the user interface and its different areas, functions and parts will be covered throughout this documentation. Setting Username and Password Now that you have logged into SuperBooks for the first time it is highly recommended that you set your username and password. First, click on the Tools menu and select Set Username and enter a username. Set Username dialog Second, click on the Tools menu again and select Set Password. Set Password dialog When setting your password it is important to choose a password that you can remember, but that someone could not guess. A strong password is highly Page 6 of 34 SuperBooks 4.0 User’s Manual Getting Started recommended. A strong password is at least eight characters long and should have at least two uppercase letters, two lowercase letters, two special character and two numbers. Page 7 of 34 SuperBooks User’s Manual Invoices SuperBooks is an invoicing program and does just that – accepts your invoices, calculates totals, stores your invoices and generates reports for your clients. Below you will learn how to navigate through your invoices, enter a new invoice , modify and save and invoice and delete an invoice. Invoice Navigator After logging in to SuperBooks, the Invoice Tab is displayed and your invoices are available, having populated their appropriate text boxes. The invoice navigator, located just below the Invoice Tab, allows you to: Invoice Navigator • • • • Scroll through invoices Create a new invoice Save an invoice Delete an invoice Create a New Invoice In order to create a new record, click the Create Invoice Tab is broken down into two groups: button. The Invoice Client Information: enter your client’s company and mailing information. Invoice Information: enter the product, rate and hours information. By default the rate and hours have a recommended maximum amount. If you enter a rate higher than 150 or more than 40 hours, you will see one of the two warnings displayed below. Simply choose No to confirm your rate and hours, or choose Yes to enter a different number. Page 8 of 34 SuperBooks 4.0 Rate Range Check User’s Manual Invoices Hours Range Check Finally, once you have created your new invoice, you must save! Your new invoice will not save automatically. To save your new invoice you have a few different options. You can choose to press the save button on the invoice navigator, the save button located below the Invoice Tab. Finally, you can select File and then Save or press Ctrl + S. File Save Modifying an Invoice Modifying an invoice is very straightforward. Because your current invoices are displayed in the same text boxes that you use to enter a new invoice, you can simply begin editing any invoice that is displayed on the Invoice Tab. However, in order for your modifications to save, you must use on of the saving methods discussed above. Deleting an Invoice Deleting Invoice Dialog The user only has one method, for deleting an invoice. Simply press the delete button on the Invoice Navigator to delete the invoice that is currently being viewed. Page 9 of 34 SuperBooks 4.0 User’s Manual Invoices When the user presses the delete button, a warning dialog will appear asking the user if they are sure that they want to delete the current file. Keep in mind, that if the user chooses Yes, then the invoice will be permanently removed. Page 10 of 34 SuperBooks User’s Manual Reports Now that you know how to create, save and delete your invoices, the next powerful feature available to you in SuperBooks includes Invoice Reports. To access reports, the user can click Reports from the Menu Bar or right click on the anywhere on the Invoice Tab. File Reports Single Invoices When you select Single Invoices from the Report menu, the Single Invoices Viewer will open in a separate window. Single Invoices Viewer Within this new window you will see a Single Invoice for the first invoice from your SuperBooks database. Use the left and right arrows to navigate Page 11 of 34 SuperBooks 4.0 User’s Manual Reports through the Single Invoice Reports. You can find a Single Invoice report at the end of this documentation in Appendix 1. To print a Single Invoice Report, click the print icon , at which point a default Windows Print dialog will open in a separate window and the user can choose to print one, multiple, or all single invoice reports. The Single Invoice Report lists the company and the product associated with the invoice, including the hours, rate, subtotal, tax and total – everything you will need to properly bill your client! All Invoices When you select All Invoices from the Report menu, the All Invoices Viewer will open in a separate window. All Invoices Viewer Within this new window you will see a single All Invoices report. This report is designed to show you a report that is similar to the information found on the Viewer Tab in the main program. The All Invoices report is designed to give the user a quick view of all invoices, including rate, hours and subtotal. Page 12 of 34 SuperBooks 4.0 User’s Manual Reports Additionally, at the bottom of the All Invoices report, you will find totals for rate, hours and subtotal. Finally, you will also find an average of the rate, hours and subtotals of all invoices. You can find an All Invoices report at the end of this documentation in Appendix 2. Page 13 of 34 SuperBooks User’s Manual More SuperBooks The following section is intended to show the user some more features found in SuperBooks that are not essential to the basic SuperBooks invoicing programs. Edit Font SuperBooks includes a function that allows the user to change the font, font size and font style of the Invoice program by selecting Edit and then Edit Font. This ease of use function is designed to help users choose a font of their choice, perhaps one that is easier for them to see. Font dialog Edit Color In addition changing the font, font size and font style, SuperBooks also includes a function that allows the user to change the font color. Found by selecting Edit Color from the Edit menu, this feature is designed to allow the user the ability to alter the user interface to their liking. The user can reset the both the custom font selection and custom color selection back to the SuperBooks default by select Reset from the Edit menu. Color Dialog Page 14 of 34 SuperBooks 4.0 User’s Manual More SuperBooks Data Backup Data Backup should be handled by the system administrator or delegated to a trained and qualified user by a system administrator. There is essentially only one file that must be backed up at a regular interval. That file is the superbooks.mdb file and is located in the same directory as the superbooks.exe application. The interval of backing up the database is at the discretion of the system administrator. The interval should be set depending on the amount of data being entered into the SuperBooks program and how often. Backups could be daily, weekly, monthly or any other interval the system administrator deems appropriate. FAQ SuperBooks includes a Frequently Asked Questions in place of a traditional help file and can be found under the Help menu. The FAQ file is designed to answer some of the most frequent questions asked by SuperBooks users. Additional help can be found with the system administrator, the SuperBooks website or the SuperBooks toll-free 800 number. FAQ and the Help menu Page 15 of 34 SuperBooks User’s Manual Appendix 1: Single Invoices Report Page 16 of 34 SuperBooks User’s Manual Appendix 2: All Invoices Report Page 17 of 34 SuperBooks 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 User’s Manual Appendix 3: Main Entry Code 'WHO: Justin Boyd 'WHAT: SuperBooks, VB 2008 Invoice Program 'WHEN: SCF, Spring 2010 - COP 2171C with Floyd J. Winters 'TO DO: 'Documentation Packet Option Strict On Imports Imports Imports Imports System.Drawing System.Drawing.Image System System.IO Public Class sbMainEntry #Region "START" 'GLOBAL VARIABLES 'calculation and formatting variables Dim varRate As Decimal Dim varHours As Decimal Dim varSubTotal As Decimal Dim varTaxRate As Decimal = 0.07D Dim varTax As Decimal Dim varTotal As Decimal 'collection and control variables Dim colFormControls As New Collection() Dim ctrlFormControls As New Control 'LOAD Private Sub sbMainEntry_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'SuperbooksDataSet.invoices' table. You can move, or remove it, as needed. Me.InvoicesTableAdapter.Fill(Me.SuperbooksDataSet.invoices) statSysDate.Text = CStr(Now()) statToolTip.Text = "" Me.Size = New System.Drawing.Size(660, 720) Call Calculation() 'Control Collection With colFormControls 'Client Info Labels .Add(lblCompany) .Add(lblFirstName) .Add(lblLastName) .Add(lblPhone) .Add(lblEmail) .Add(lblAddress1) .Add(lblAddress2) .Add(lblCity) .Add(lblState) .Add(lblZip) Page 18 of 34 SuperBooks 4.0 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 User’s Manual Appendix 3 (Main Entry Code) 'Invoice Info Labels .Add(lblInvoiceID) .Add(lblProduct) .Add(lblOther) .Add(lblRate) .Add(lblHours) .Add(lblInvoiceDate) .Add(lblSubTotal) .Add(cbxTax) .Add(lblTotal) 'Client Info TextBoxes / ComboBoxes .Add(DbCompanyTextBox) .Add(DbFirstNameTextBox) .Add(DbLastNameTextBox) .Add(DbPhoneNumberTextBox) .Add(DbEmailTextBox) .Add(DbAddress1TextBox) .Add(DbAddress2TextBox) .Add(DbCityTextBox) .Add(DbStateComboBox) .Add(DbZipTextBox) 'Invoice Info TextBoxes / ComboBoxes .Add(DbInvoiceIDTextBox) .Add(DbProductComboBox) .Add(DbOtherTextBox) .Add(DbRateTextBox) .Add(DbHoursTextBox) .Add(DbInvoiceDateDateTimePicker) .Add(txtTax) .Add(txtTotal) End With End Sub #End Region #Region "CLIENT INPUTS" 'Company Inputs Private Sub DbCompanyTextbox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbCompanyTextBox.Enter DbCompanyTextBox.BackColor = Color.PaleTurquoise DbCompanyTextBox.SelectAll() statToolTip.Text = ":: Enter or Edit Company Name" End Sub ' Company TextBox Enter Private Sub DbCompanyTextBox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbCompanyTextBox.Leave DbCompanyTextBox.BackColor = Color.White statToolTip.Text = "" End Sub ' Company TextBox Leave 'First Name Inputs Private Sub DbFirstNameTextbox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbFirstNameTextBox.Enter DbFirstNameTextBox.BackColor = Color.PaleTurquoise DbFirstNameTextBox.SelectAll() statToolTip.Text = ":: Enter or Edit First Name" Page 19 of 34 SuperBooks 4.0 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 User’s Manual Appendix 3 (Main Entry Code) End Sub 'First Name TextBox Enter Private Sub DbFirstNameTextbox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbFirstNameTextBox.Leave DbFirstNameTextBox.BackColor = Color.White statToolTip.Text = "" End Sub 'First Name TextBox Exit 'Last Name Inputs Private Sub DbLastNameTextbox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbLastNameTextBox.Enter DbLastNameTextBox.BackColor = Color.PaleTurquoise DbLastNameTextBox.SelectAll() statToolTip.Text = ":: Enter or Edit Last Name" End Sub 'Last Name TextBox Enter Private Sub DbLastNameTextbox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbLastNameTextBox.Leave DbLastNameTextBox.BackColor = Color.White statToolTip.Text = "" End Sub 'Last Name TextBox Leave 'Phone Inputs Private Sub DbPhoneNumberTextbox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbPhoneNumberTextBox.Enter DbPhoneNumberTextBox.BackColor = Color.PaleTurquoise DbPhoneNumberTextBox.SelectAll() statToolTip.Text = ":: Enter or Edit Phone Number" End Sub 'Phone TextBox Enter Private Sub DbPhoneNumberTextBox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbPhoneNumberTextBox.Leave DbPhoneNumberTextBox.BackColor = Color.White statToolTip.Text = "" End Sub 'Phone TextBox Leave 'Email Inputs Private Sub DbEmailTextbox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbEmailTextBox.Enter DbEmailTextBox.BackColor = Color.PaleTurquoise DbEmailTextBox.SelectAll() statToolTip.Text = ":: Enter or Edit Email Address" End Sub 'Email TextBox Enter Private Sub DbEmailTextBox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbEmailTextBox.Leave DbEmailTextBox.BackColor = Color.White statToolTip.Text = "" End Sub 'Email TextBox Leave 'Address1 Inputs Private Sub DbAddress1Textbox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbAddress1TextBox.Enter DbAddress1TextBox.BackColor = Color.PaleTurquoise DbAddress1TextBox.SelectAll() statToolTip.Text = ":: Enter or Edit Address Information" End Sub 'Address1 TextBox Enter Private Sub DbAddress1Textbox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbAddress1TextBox.Leave DbAddress1TextBox.BackColor = Color.White statToolTip.Text = "" Page 20 of 34 SuperBooks 4.0 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 User’s Manual Appendix 3 (Main Entry Code) End Sub 'Address1 TextBox Leave 'Address2 Inputs Private Sub DbAddress2Textbox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbAddress2TextBox.Enter DbAddress2TextBox.BackColor = Color.PaleTurquoise DbAddress2TextBox.SelectAll() statToolTip.Text = ":: Enter or Edit Supplemental Address Information" End Sub 'Address2 TextBox Enter Private Sub DbAddress2Textbox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbAddress2TextBox.Leave DbAddress2TextBox.BackColor = Color.White statToolTip.Text = "" End Sub 'Address2 TextBox Leave 'City Inputs Private Sub DbCityTextbox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbCityTextBox.Enter DbCityTextBox.BackColor = Color.PaleTurquoise DbCityTextBox.SelectAll() statToolTip.Text = ":: Enter or Edit City" End Sub 'City TextBox Enter Private Sub DbCityTextbox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbCityTextBox.Leave DbCityTextBox.BackColor = Color.White statToolTip.Text = "" End Sub 'City TextBox Leave 'State Inputs Private Sub DbStateComboBox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbStateComboBox.Enter DbStateComboBox.BackColor = Color.PaleTurquoise DbStateComboBox.SelectAll() statToolTip.Text = ":: Enter or Edit State" End Sub 'State ComboBox Enter Private Sub DbStateComboBox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbStateComboBox.Leave DbStateComboBox.BackColor = Color.White statToolTip.Text = "" End Sub 'State ComboBox Leave 'Zip Inputs Private Sub DbZipTextbox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbZipTextBox.Enter DbZipTextBox.BackColor = Color.PaleTurquoise DbZipTextBox.SelectAll() statToolTip.Text = ":: Enter or Edit Zip" End Sub 'Zip TextBox Enter Private Sub DbZipTextbox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbZipTextBox.Leave DbZipTextBox.BackColor = Color.White statToolTip.Text = "" End Sub 'Zip TextBox Leave #End Region Page 21 of 34 SuperBooks 4.0 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 User’s Manual Appendix 3 (Main Entry Code) #Region "INVOICE INPUTS" 'Product Inputs Private Sub DbProductComboBox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbProductComboBox.Enter DbProductComboBox.BackColor = Color.PaleTurquoise DbProductComboBox.SelectAll() statToolTip.Text = ":: Enter or Edit Product" Call Calculation() End Sub 'Product ComboBox Enter Private Sub DbProductComboBox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbProductComboBox.Leave DbProductComboBox.BackColor = Color.White statToolTip.Text = "" Call Calculation() End Sub 'Product ComboBox Leave Private Sub DbProductComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DbProductComboBox.SelectedIndexChanged If DbProductComboBox.Text = "Site Design" Then varRate = CDec(25.0) DbRateTextBox.Text = FormatNumber(varRate, 2) ElseIf DbProductComboBox.Text = "Page Design" Then varRate = CDec(20.0) DbRateTextBox.Text = FormatNumber(varRate, 2) ElseIf DbProductComboBox.Text = "Logo Design" Then varRate = CDec(100.0) DbRateTextBox.Text = FormatNumber(varRate, 2) ElseIf DbProductComboBox.Text = "Flash Design" Then varRate = CDec(150.0) DbRateTextBox.Text = FormatNumber(varRate, 2) ElseIf DbProductComboBox.Text = "SEO" Then varRate = CDec(25.0) DbRateTextBox.Text = FormatNumber(varRate, 2) ElseIf DbProductComboBox.Text = "Maintenance" Then varRate = CDec(25.0) DbRateTextBox.Text = FormatNumber(varRate, 2) ElseIf DbProductComboBox.Text = "Other" Then varRate = CDec(0.0) DbRateTextBox.Text = FormatNumber(varRate, 2) DbOtherTextBox.Enabled = True DbRateTextBox.Enabled = True End If Call Calculation() End Sub 'Product Combobox Set Rate 'Rate Inputs Private Sub DbOtherTextBox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbOtherTextBox.Enter DbOtherTextBox.BackColor = Color.PaleTurquoise DbOtherTextBox.SelectAll() statToolTip.Text = ":: Enter or Edit your own Product" Call Calculation() End Sub 'Rate TextBox Enter Private Sub DbOtherTextBox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbOtherTextBox.Leave DbOtherTextBox.BackColor = Color.White Page 22 of 34 SuperBooks 4.0 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 User’s Manual Appendix 3 (Main Entry Code) statToolTip.Text = "" Call Calculation() End Sub 'Rate TextBox Leave 'Rate Inputs Private Sub DbRateTextBox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbRateTextBox.Enter DbRateTextBox.BackColor = Color.PaleTurquoise DbRateTextBox.SelectAll() statToolTip.Text = ":: Enter or Edit Rate" Call Calculation() End Sub 'Rate TextBox Enter Private Sub DbRateTextBox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbRateTextBox.Leave varRate = CDec(Val(DbRateTextBox.Text)) Dim CheckRate As Windows.Forms.DialogResult If IsNumeric(DbRateTextBox.Text) Then DbRateTextBox.Text = Format(Val(DbRateTextBox.Text), "##,###0.00") Else MessageBox.Show("Please enter only numbers in the Rate TextBox.", "Rate TextBox Entry Error") DbRateTextBox.Focus() DbRateTextBox.SelectAll() Exit Sub 'Keeps Out of Range Check from executing on a nonnumeric entry End If If CDec(DbRateTextBox.Text) > 150 Then CheckRate = MessageBox.Show("Is that Rate too high?", "Rate Out of Bounds Check", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) If CheckRate = Windows.Forms.DialogResult.Yes Then DbRateTextBox.Focus() DbRateTextBox.SelectAll() End If End If DbRateTextBox.BackColor = Color.White statToolTip.Text = "" Call Calculation() End Sub 'Rate TextBox Leave 'Hours Inputs Private Sub DbHoursTextBox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbHoursTextBox.Enter DbHoursTextBox.BackColor = Color.PaleTurquoise DbHoursTextBox.SelectAll() statToolTip.Text = ":: Enter or Edit Hours" Call Calculation() End Sub 'Hours TextBox Enter Private Sub DbHoursTextBox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbHoursTextBox.Leave varHours = CDec(Val(DbHoursTextBox.Text)) Dim checkHours As Windows.Forms.DialogResult If IsNumeric(DbHoursTextBox.Text) Then DbHoursTextBox.Text = Format(Val(DbHoursTextBox.Text), "##,###0.00") Else Page 23 of 34 SuperBooks 4.0 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 User’s Manual Appendix 3 (Main Entry Code) MessageBox.Show("Please enter only numbers in the Hours TextBox.", "Hours TextBox Entry Error") DbHoursTextBox.Focus() DbHoursTextBox.SelectAll() Exit Sub 'Keeps Out of Range Check from executing on a nonnumeric entry End If If CDec(DbHoursTextBox.Text) > 40 Then checkHours = MessageBox.Show("Are those Hours too high?", "Hours Out of Bounds Check", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) If checkHours = Windows.Forms.DialogResult.Yes Then DbHoursTextBox.Focus() End If End If DbHoursTextBox.BackColor = Color.White statToolTip.Text = "" Call Calculation() End Sub 'Hours TextBox Leave 'Invoice Date Inputs Private Sub DbInvoiceDateDateTimePicker_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbInvoiceDateDateTimePicker.Enter DbInvoiceDateDateTimePicker.CalendarMonthBackground = Color.PaleTurquoise statToolTip.Text = ":: Enter or Edit Invoice Date" Call Calculation() End Sub 'Invoice Date DTP Enter Private Sub DbInvoiceDateDateTimePicker_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles DbInvoiceDateDateTimePicker.Leave DbInvoiceDateDateTimePicker.CalendarMonthBackground = Color.White statToolTip.Text = "" Call Calculation() End Sub 'Invoice Date DTP Leave 'Tax CheckBox Private Sub cbxTax_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbxTax.CheckedChanged If cbxTax.Checked = True Then varTaxRate = CDec(0.0) Else varTaxRate = 0.07D End If Call Calculation() End Sub 'Tax CheckBox #End Region #Region "FUNCTIONS" Private Sub Calculation() Try varSubTotal = CDec(Val(DbRateTextBox.Text) * Val(DbHoursTextBox.Text)) varTax = varSubTotal * varTaxRate varTotal = varSubTotal + varTax Page 24 of 34 SuperBooks 4.0 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 User’s Manual Appendix 3 (Main Entry Code) SubTotalTextBox.Text = "$" & " " & CStr(FormatNumber(varSubTotal, 2)) txtTax.Text = "$" & " " & CStr(FormatNumber(varTax, 2)) txtTotal.Text = "$" & " " & CStr(FormatNumber(varTotal, 2)) Catch ex As Exception MessageBox.Show("There was a calculation error", "Calculation Error") DbFirstNameTextBox.Focus() End Try End Sub #End Region #Region "MENUS & BUTTONS" 'Menu Strip Private Sub mnuFileNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFileNew.Click BindingNavigatorAddNewItem.PerformClick() End Sub 'File -> New Private Sub mnuFileSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFileSave.Click InvoicesBindingNavigatorSaveItem.PerformClick() End Sub 'File -> Save Private Sub mnuFileExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFileExit.Click Dim CheckExit As Windows.Forms.DialogResult CheckExit = MessageBox.Show("Are you sure you want to exit? Any unsaved changes will be lost.", "Exit SuperBooks", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) If CheckExit = Windows.Forms.DialogResult.OK Then Me.Close() End If End Sub 'File -> Exit Private Sub mnuReportsSingle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuReportsSingle.Click sbReportSingle.ShowDialog() End Sub 'Reports -> Single Private Sub mnuReportsAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuReportsAll.Click sbReportAll.ShowDialog() End Sub 'Reports -> All Private Sub mnuEditColor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuEditColor.Click dlogColor.ShowDialog() For Each Me.ctrlFormControls In colFormControls ctrlFormControls.ForeColor = dlogColor.Color Next End Sub 'Edit -> Color Private Sub mnuEditFont_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuEditFont.Click dlogFont.ShowDialog() For Each Me.ctrlFormControls In colFormControls If dlogFont.Font.SizeInPoints <= 14 Then Page 25 of 34 SuperBooks 4.0 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 User’s Manual Appendix 3 (Main Entry Code) ctrlFormControls.Font = dlogFont.Font Else MessageBox.Show("Font Size must be size 14 or less.", "Font Size Too Big!") dlogFont.ShowDialog() End If Next End Sub 'Edit -> Font Private Sub mnuEditReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuEditReset.Click For Each Me.ctrlFormControls In colFormControls ctrlFormControls.ForeColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer)) ctrlFormControls.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Next End Sub 'Edit -> Reset Private Sub mnuToolsSetUser_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuToolsSetUser.Click Dim UserFile As System.IO.StreamWriter Dim UserSet As String UserFile = System.IO.File.CreateText("system.nfo") UserSet = InputBox("Please enter your SuperBooks Username. The username will be used to log into the program.", "Set User Name") UserFile.WriteLine(UserSet) UserFile.Close() End Sub 'Tools -> Set User Private Sub mnuToolsSetPassword_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuToolsSetPassword.Click Dim PassFile As System.IO.StreamWriter Dim PassSet As String PassFile = System.IO.File.CreateText("accesss.nfo") PassSet = InputBox("Please enter your SuperBooks Password. This password will be used to log into the program.", "Set Password") PassFile.WriteLine(PassSet) PassFile.Close() End Sub 'Tools -> Set Password Private Sub mnuToolsCalculator_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuToolsCalculator.Click Try Process.Start("Calc") Catch ex As Exception MessageBox.Show("Calculator program was not found on this computer", "Calculator Launch Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub 'Tools -> Calculator Private Sub mnuToolsNotepad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuToolsNotepad.Click Try Process.Start("Notepad") Catch ex As Exception Page 26 of 34 SuperBooks 4.0 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 User’s Manual Appendix 3 (Main Entry Code) MessageBox.Show("Notepad program was not found on this computer", "Notepad Launch Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub 'Tools -> Notepad Private Sub mnuHelpContents_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuHelpContents.Click Process.Start("NotePad", "../../Resources/FAQ.txt") End Sub 'Help -> Contents Private Sub mnuHelpAbout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuHelpAbout.Click sbAboutBox.ShowDialog() End Sub 'Help -> About 'Data Binding Private Sub InvoicesBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InvoicesBindingNavigatorSaveItem.Click Try Me.Validate() Me.InvoicesBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.SuperbooksDataSet) Dim SaveData As Windows.Forms.DialogResult SaveData = MessageBox.Show("Your changes/additions have been saved.", "Save Dialog", MessageBoxButtons.OK, MessageBoxIcon.Information) If SaveData = Windows.Forms.DialogResult.OK Then Call Calculation() DbCompanyTextBox.Focus() End If Catch ex As Exception MessageBox.Show("SuperBooks was unable to save or modify your record. Please restart the program.", "Saving Error") Exit Sub End Try End Sub 'Binding Save Button Private Sub BindingNavigatorDeleteItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorDeleteItem.Click Dim DeleteItem As Windows.Forms.DialogResult DeleteItem = MessageBox.Show("Are you sure you want to delete this invoice?", "Deleting Invoice", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) If DeleteItem = Windows.Forms.DialogResult.Yes Then InvoicesBindingSource.RemoveCurrent() InvoicesBindingSource.EndEdit() InvoicesBindingNavigatorSaveItem.PerformClick() Else Exit Sub End If End Sub 'Binding Delete Button Private Sub BindingNavigatorMoveFirstItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorMoveFirstItem.Click Call Calculation() End Sub ' Binding First Button Page 27 of 34 SuperBooks 4.0 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 User’s Manual Appendix 3 (Main Entry Code) Private Sub BindingNavigatorMovePreviousItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorMovePreviousItem.Click Call Calculation() End Sub 'Binding Previous Button Private Sub BindingNavigatorMoveNextItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorMoveNextItem.Click Call Calculation() End Sub 'Binding Next Button Private Sub BindingNavigatorMoveLastItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorMoveLastItem.Click Call Calculation() End Sub 'Binding Last Button 'Right Click (Context) Menu Private Sub rtcReportAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rtcReportAll.Click mnuReportsAll.PerformClick() End Sub 'Right Click -> Report -> All Private Sub rtcReportSingle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rtcReportSingle.Click mnuReportsSingle.PerformClick() End Sub 'Right Click -> Report -> Single Private Sub rtcEditFont_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rtcEditFont.Click mnuEditFont.PerformClick() End Sub 'Right Click -> Edit Font Private Sub rtcEditColor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rtcEditColor.Click mnuEditColor.PerformClick() End Sub 'Right Click -> Edit Color Private Sub rtcHelp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rtcHelp.Click mnuHelpContents.PerformClick() End Sub 'Right Click -> Help 'Misc Buttons Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click InvoicesBindingNavigatorSaveItem.PerformClick() End Sub 'Save Button Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click Dim ClearInvoice As Windows.Forms.DialogResult ClearInvoice = MessageBox.Show("Clearing the form DOES NOT update your database. You still must save for changes to take effect.", "Clearing Invoice", MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) If ClearInvoice = Windows.Forms.DialogResult.OK Then DbCompanyTextBox.Clear() DbFirstNameTextBox.Clear() DbLastNameTextBox.Clear() DbPhoneNumberTextBox.Clear() DbEmailTextBox.Clear() DbAddress1TextBox.Clear() Page 28 of 34 SuperBooks 4.0 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 User’s Manual Appendix 3 (Main Entry Code) DbAddress2TextBox.Clear() DbCityTextBox.Clear() DbStateComboBox.Text = "FL" DbZipTextBox.Clear() DbInvoiceIDTextBox.Clear() DbInvoiceDateDateTimePicker.Text = CStr(Now()) DbRateTextBox.Clear() DbProductComboBox.SelectedItem = "Site Design" DbHoursTextBox.Clear() Call Calculation() End If End Sub 'Clear Button Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click mnuFileExit.PerformClick() End Sub 'Exit Button #End Region End Class Page 29 of 34 SuperBooks 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 User’s Manual Appendix 4: Splash Screen Code Public NotInheritable Class sbSplashScreen 'TODO: This form can easily be set as the splash screen for the application by going to the "Application" tab ' of the Project Designer ("Properties" under the "Project" menu). Private Sub frmSplashScreen_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'Set up the dialog text at runtime according to the application's assembly information. 'TODO: Customize the application's assembly information in the "Application" pane of the project ' properties dialog (under the "Project" menu). 'Application title If My.Application.Info.Title <> "" Then ApplicationTitle.Text = My.Application.Info.Title Else 'If the application title is missing, use the application name, without the extension ApplicationTitle.Text = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName) End If 'Format the version information using the text set into the Version control at design time as the ' formatting string. This allows for effective localization if desired. ' Build and revision information could be included by using the following code and changing the ' Version control's designtime text to "Version {0}.{1:00}.{2}.{3}" or something similar. See ' String.Format() in Help for more information. ' ' Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build, My.Application.Info.Version.Revision) Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor) 'Copyright info Copyright.Text = My.Application.Info.Copyright End Sub End Class Page 30 of 34 SuperBooks 4.0 User’s Manual Appendix 4 (Splash Screen Code) Application Events The following code is located in the ApplicationEvents.vb file, created when a Splash Screen is created and responsible for the Splash Screen’s display time. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Namespace My ' The following events are available for MyApplication: ' ' Startup: Raised when the application starts, before the startup form is created. ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally. ' UnhandledException: Raised if the application encounters an unhandled exception. ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected. Partial Friend Class MyApplication Protected Overrides Function OnInitialize( _ ByVal commandLineArgs As _ System.Collections.ObjectModel.ReadOnlyCollection(Of String) _ ) As Boolean ' Set the display time to 5000 milliseconds (5 seconds). Me.MinimumSplashScreenDisplayTime = 4000 Return MyBase.OnInitialize(commandLineArgs) End Function End Class End Namespace Page 31 of 34 SuperBooks 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 User’s Manual Appendix 5: Login Form Code Imports System Imports System.IO Public Class sbLoginForm ' TODO: Insert code to perform custom authentication using the provided username and password ' (See http://go.microsoft.com/fwlink/?LinkId=35339). ' The custom principal can then be attached to the current thread's principal as follows: ' My.User.CurrentPrincipal = CustomPrincipal ' where CustomPrincipal is the IPrincipal implementation used to perform authentication. ' Subsequently, My.User will return identity information encapsulated in the CustomPrincipal object ' such as the username, display name, etc. 'Dim varUserName As String = "j" 'Dim varLastName As String = "1" Dim userTry As Integer = 1 Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click Dim UserGet As String Dim PassGet As String Using ur As StreamReader = New StreamReader('Location of Username) Using pr As StreamReader = New StreamReader('Location of Password) Dim ULine As String Dim PLine As String ULine = ur.ReadLine() PLine = pr.ReadLine() UserGet = ULine PassGet = PLine If txtUserName.Text.Trim = UserGet And txtPassword.Text.Trim = PassGet Then sbMainEntry.Show() Me.Close() Else userTry += 1 If userTry > 3 Then MessageBox.Show("Too many failed attempts. Closing program. Contact your System Administrator.", "Failed Logon", MessageBoxButtons.OK, MessageBoxIcon.Error) Me.Close() Else MessageBox.Show("Incorrect User Name / Password Combination", "Username / Password Error", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) txtUserName.Focus() End If End If pr.Close() Page 32 of 34 SuperBooks 4.0 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 User’s Manual Appendix 5 (Login Form Code) ur.Close() End Using End Using End Sub Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click Me.Close() End Sub ' CLICK LOGO FOR TEMPORARY PASSWORD BYPASS :: Delete Before Finalized Private Sub lblBD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblBD.Click sbMainEntry.Show() Me.Close() End Sub End Class Page 33 of 34 SuperBooks User’s Manual Appendix 6: About Form Code Public NotInheritable Class sbAboutBox Private Sub AboutBox1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Set the title of the form. Dim ApplicationTitle As String If My.Application.Info.Title <> "" Then ApplicationTitle = My.Application.Info.Title Else ApplicationTitle = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName) End If Me.Text = String.Format("About {0}", ApplicationTitle) ' Initialize all of the text displayed on the About Box. ' TODO: Customize the application's assembly information in the "Application" pane of the project ' properties dialog (under the "Project" menu). Me.LabelProductName.Text = My.Application.Info.ProductName Me.LabelVersion.Text = String.Format("Version {0}", My.Application.Info.Version.ToString) Me.LabelCopyright.Text = My.Application.Info.Copyright Me.LabelCompanyName.Text = My.Application.Info.CompanyName Me.TextBoxDescription.Text = My.Application.Info.Description End Sub Private Sub OKButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OKButton.Click Me.Close() End Sub End Class Page 34 of 34