SAmple SDD Project Log Book

14
Process Log Book Evan Hooper

description

SAmple SDD Project Log Book

Transcript of SAmple SDD Project Log Book

Project log book

Process Log Book

Evan Hooper

Week 1

Today I looked at different project examples as I was unsure as to what I wanted to do. I wanted a project what would benefit me after it was completed. I have my own business so I was trying to mean my ideas towards it. I came up with an idea to make a program that would make it easy to keep track of products for the business. The main idea was to add a data base to the program and add products to the system. Once added it would keep track of the number of products this will allow me to know when a product is low on stock. A invoicing system will also be added to print of invoices for customers if needed

Today I planned my Gantt Chart and put the different steps on paper before organizing them into groups. The difficult part of this was breaking the assignment up into little sections. The Gantt chart took me about 20 mins to do and a rough approximation was given to the time allocation for each part

Today was a day where I just played around with Visual Basic trying to design a interface for my project. I came up with my first design on my paper I then made the design on visual basic

Week 2

I started to write up and think about my project description and the different features that I could add to help make it a better program.

This week I had to learn specific codes that I would need to or just practice to get used to visual basic.

Private Sub CmdAdd_Click()

CmdList.AddItem TxtItem.Text

End Sub

Private Sub CmdDel_Click()

CmdList.Clear

End Sub

Private Sub CmdDelSel_Click()

CmdList.RemoveItem CmdList.ListIndex

End Sub

Private Sub Command1_Click()

End Sub

Private Sub CmdDiv_Click()

Dim Number1 As Single

Dim Number2 As Single

Number1 = Text1.Text

Number2 = Text2.Text

Number1 = Number1 / Number2

MsgBox "Your Number" & Number1

End Sub

Private Sub CmdRev_Click()

Dim LstText As String

LstText = CmdList.List(CmdList.ListIndex)

MsgBox LstText

End Sub

Private Sub CmdReverse_Click()

Dim Lowint As Integer

Dim Highint As Integer

Lowint = 0

Highint = CmdList.ListCount - 1

Dim temp As String

Some of these codes had to be learnt before implementing them into the program.

Week 3

This week was organizing my charts such as input output and dataflow diagrams. I studied how to do each and did many rough sketches which is included at the back of my project. The dataflow diagram was quite changeling as gating all the information and putting it together in a neat way was quite a job. Many attempts where made before this could be complete.

Week 4

This is the final week before Phase 1 the assignment is due I have started to make final copies of all my work and have started to document in onto the word document. I have gathered all my papers that I have used to prepare and learn how to carry out this assignment. I made final copies of all my charts and gave descriptions to all my algorithms. Finally I have prepared my booklet ready for handing in

Week 5

After finalizing and evaluating stage one I realized there was a lot to be done. If I was to finish the project by the due date I would have to start designing and coding the program quite early as what I wanted to achieve was quite complicated and required a lot of timeA few changes needed to be made to the main form from that of the original design. These changes deleted all command buttons on this form.

Other Major Changes

Program will no longer contain Print Blank Invoice command

Program will no longer save invoices to hard drive

Will no longer delete products Will No longer Manually add products to the database

The main form was created

Main form was created and edited

List was created Pictures

Borders

The sub form was created

List Box Search Button

Add To Cart Button

Modify Button

Log Out Button

Hidden text boxes that read texts from database Data Box implemented to read excel spreadsheetDue to all these new added features this meant the need for the following documentation

Week 6

I started to create my program my first task was to link the data field to the excel spread sheet. I made the data base the excel spread sheet and then added data fields for the eight text boxes that would read the columns in the spread sheet.Also created the code in visual basic that generates the list on the main form

Created a function to aid in the loop of the code

Function Inlist(Category As String) As Boolean 'sets this funtion as a yes or no data type can be called

Dim Listnum As Integer 'sets list num as a integer data format

Dim count As Integer 'sets the counting moniter as a integer

Listnum = ListPro.ListCount - 1 '

For count = 0 To Listnum 'sets the count in the product list to 0

If ListPro.List(count) = Category Then 'if the string is in list then it is true and wont do anything

Inlist = True

Exit Function

End If

Next

Inlist = False

End Function ' this function is called by the Private Sub Form_Activate()to make it simple to codeThis code was created to generate the list

SubForm.Data1.Recordset.MoveFirst 'gets the information for the excel document from the recordset in subform

Do

If Not Inlist(SubForm.txtproductgroup.Text) Then 'if a item is not list it will add it

ListPro.AddItem (SubForm.txtproductgroup.Text)

End If

SubForm.Data1.Recordset.MoveNext ' will move the down till it finds next different value

Loop Until SubForm.txtproductgroup.Text = "" ' loop until a empty space in database

No real problems arose with this section of the program and everything ran smoothlyWeek 7

This is where the core of the program has been created most of the work has been done in this week. The most important task to achieve this week was to generate the product list on the sub form depending on what category was selected on the main from. Before this was done the list on the sub form had to be correctly created this was done had to be created

The follow gave the columns number values for the array

Private Const CODE_NUM As Integer = 0 'corresponds text box to colums

Private Const PRODGROUP_NUM As Integer = 1 'corresponds text box to colums

Private Const CATEGORY_NUM As Integer = 2 'corresponds text box to colums

Private Const TITLE_NUM As Integer = 3 'corresponds text box to colums

Private Const DESCRIPTION_NUM As Integer = 4 'corresponds text box to colums

Private Const PRICEEXE_NUM As Integer = 5 'corresponds text box to colums

Private Const PRICEINC_NUM As Integer = 6 'corresponds text box to colums

Private Const QUANTITY_NUM As Integer = 7 'corresponds text box to colums

This created the Column Headers

ProList.ColumnHeaders.Add , , "Code"

ProList.ColumnHeaders.Add , , "Prod Group"

ProList.ColumnHeaders.Add , , "Category"

ProList.ColumnHeaders.Add , , "Title"

ProList.ColumnHeaders.Add , , "Description"

ProList.ColumnHeaders.Add , , "Price Ex Gst"

ProList.ColumnHeaders.Add , , "Price Inc Gst"

ProList.ColumnHeaders.Add , , "Stock Qty"This code generates the list on the sub form depending on what product category was selected on the main form. One bug that was encounted was every time the sub form was activated the list would duplicate its self, this was fixed by making it generating a fresh list each time it was activated (ProList.ListItems.Clear 'clears list)Private Sub Form_Activate() 'this generates the product list

Data1.Recordset.MoveFirst 'moves the record to first entry

ProList.ListItems.Clear 'clears list

Do

If MainForm.ListPro.List(MainForm.ListPro.ListIndex) = txtproductgroup.Text Then ' this loads up all objects in that category based on what was clicked in the main form

Call Addtolist ' calls this function

End If

Data1.Recordset.MoveNext 'moves 1 step in array

Loop Until txtcode.Text = "" ' loops until empty slot

End SubWith this now done the core of the program was completed all that was left to do was create a search function, modify function and add to cart function.Week 8

Worked on the goodies of the program

Search

Modify

Add to Cart

I wanted to make the search find an item in the list. I wanted the string in the search text box to find a match in the list if there was one. Discovering how to do the search function took some time but finally after some research the code was worked out. The search loops though the list until it finds an entry that matches the text. If a match was discovered it would highlist the product code to signify a matchPrivate Sub CmdOk_Click() 'seaching

Dim count As Integer 'declares counting vairble

For count = 1 To ProList.ListItems.count 'starts of at one and moves through the list

If LCase(txtSearch.Text) = LCase(ProList.ListItems(count).Text) Then 'searchs list for text in textbox (lcase case is not a issue)

ProList.ListItems(count).EnsureVisible 'adjusts screen to focus on searched item

ProList.ListItems(count).Selected = True 'highlights searched item

ProList.SetFocus ' puts focus on the list

End If

Next

End SubThe modify function would be activated once a user logged into the administration account this was quite simple. Once logged in the hidden text boxes would be displayed

Private Sub Command1_Click()

If LCase(usertxt.Text) = "admin" And LCase(passtxt.Text) = "password" Then ' sets password

SubForm.txtcode.Visible = True ' allows these boxes to be shown

SubForm.txtproductgroup.Visible = True

SubForm.txtcategory.Visible = True

SubForm.txttitle.Visible = True

SubForm.txtdescription.Visible = True

SubForm.txtpriceex.Visible = True

SubForm.txtpriceinclude.Visible = True

This revealed the text boxes and this could be undone by clicking logout. The lcase feature was added so the password and log in were not case sensitive

Another feature that had to be added was one that displayed the contents of the list in the text boxes when an item was selected in the list this was done with the following code.

Once the contents of the list was displayed in the text boxes the item could then be modified and because the text boxes are directly linked to the spreadsheet it updates automaticllyPrivate Sub ProList_ItemClick(ByVal Item As MSComctlLib.ListItem)

Data1.Recordset.MoveFirst 'moves the record to first entry

While ProList.SelectedItem txtcode.Text ' as long as the text in textcode box is not equal to selected item the code will continue

Data1.Recordset.MoveNext ' moves record forward one

Wend

End SubThe code would loop until the text was equalThe add to cart feature was made to put a selected item into the invoice list once add to cart was clicked. This was achieved with the following codePrivate Sub Cmdaddtocart_Click() 'adds products to the invoice form

Dim Numitems As Integer

If txtcode.Text "" Then ' this stops blank lines to being entered to into the code

Invoice.Invoicelist.ListItems.Add 'create blank line

'

Numitems = Invoice.Invoicelist.ListItems.count 'getting the index of the last entry

Invoice.Invoicelist.ListItems(Numitems).Text = txtcode.Text ' adds these coloulms reason invoice is used at front is because it is located on a different form

Invoice.Invoicelist.ListItems(Numitems).SubItems(1) = txtproductgroup.Text

Invoice.Invoicelist.ListItems(Numitems).SubItems(2) = txtcategory.Text

Invoice.Invoicelist.ListItems(Numitems).SubItems(3) = txttitle.Text

Invoice.Invoicelist.ListItems(Numitems).SubItems(4) = txtdescription.Text

Invoice.Invoicelist.ListItems(Numitems).SubItems(5) = Format(txtpriceinclude.Text, "##,##0.00") ' also incluldes format in which numbers need to be added

Invoice.ShowOne error arose though in the early stages of the add to cart coding if add to cart was clicked and no item in the list was selected a blank line would be added to the invoice this was fixed by this line of code If txtcode.Text "" Then this stopped empty string being addedWeek 9

This is the final week before the project is due and one element of the project was missing and that was the printing of the invoices. It came to a point that I thought I would leave it out of the program because it was too hard to work out but then I learnt the idea. Then I finally learnt the idea of merging strings and after reading this example I was able to finish my program. eg

string1 = & &

And so on for each column,

This string should form the mentioned earlier

You need to repeat this for every listitem in the list.

I set the printer propertiesPrivate Sub cmdprint_Click()

Dim Printline As String

Dim num As Integer

MsgBox "Check printer is on and on-line", vbExclamation, "Invoicelist"

With Printer ' all these are Printer Properties

.FontName = "Times New Roman" 'set the printer font

.FontSize = 14 ' Set the font size

.FontUnderline = True 'underline off

Printer.Print ""

Printer.Print "Client Invoice" 'print the heading"

Printer.Print ""

Printer.Print ""

.FontSize = 11

.FontUnderline = False 'underline off

End With

Printer.Print "Code" + vbTab + vbTab + vbTab + "Prod Group" + vbTab + vbTab + vbTab + "Category" + vbTab + vbTab + vbTab + "Description" + vbTab + vbTab + vbTab + "Price"

And created this code. I used vbtabs to align the column together I got them as best I could Printline = Left(Invoicelist.ListItems(1).Text, 12)

Printline = Printline + vbTab + vbTab + vbTab + Left(Invoicelist.ListItems(1).SubItems(1), 12)

Printline = Printline + vbTab + vbTab + vbTab + Left(Invoicelist.ListItems(1).SubItems(2), 12)

Printline = Printline + vbTab + vbTab + vbTab + Left(Invoicelist.ListItems(1).SubItems(4), 12)

Printline = Printline + vbTab + vbTab + vbTab + Left(Invoicelist.ListItems(1).SubItems(5), 12)

Printer.Print Printline

Printer.EndDoc

End Sub

Testing of the project commenced

Test data

Live Testing

Desk Checking

Documentation needed to be upgraded

Installation guide

Help Manual

Collaborators in project

Update data dictionary

Update project requirements

Update Dataflow diagram

End User agreement

Social And ethical issues

Make it tidy and organized

Burned Project to a CD and make it an installer