Permalink
Browse files

Corrected the constructors, so it's broke again :)

  • Loading branch information...
1 parent 7b47bde commit f38dfeb3476be0e216ef3c8c5104aff4763d283c @AlexanderLea committed Mar 26, 2012
View
Binary file not shown.
@@ -26,7 +26,7 @@ class Branch
///////////////////////////////////////////////////////////////////////////////////
//<branch> Constructor
- public void branch(string inBranchID, string inBranchNickname, string inBranchAddressNo,
+ public Branch(string inBranchID, string inBranchNickname, string inBranchAddressNo,
string inBranchAddressStreet, string inBranchAddressCity, string inBranchAddressCounty,
string inBranchAddressPostCode, string inNearestBranch1,
string inNearestBranch2, string inNearestBranch3, int inNoCategories)
@@ -17,7 +17,7 @@ class Category
///////////////////////////////////////////////////////////////////////////////////
//<Catergory> class constructor
- public void category(int inCategoryID, string inCategoryName, int inNoProducts)
+ public Category(int inCategoryID, string inCategoryName, int inNoProducts)
{
categoryID = inCategoryID;
categoryName = inCategoryName;
@@ -44,20 +44,23 @@ private void frmLogin_Load(object sender, EventArgs e)
}
//new instance of Branch Class
- Branch tempBranch = new Branch();
+ Branch tempBranch = new Branch(branchData[0], branchData[1], branchData[2],
+ branchData[3], branchData[4], branchData[5],
+ branchData[6], branchData[7], branchData[8],
+ branchData[9], Convert.ToInt32(branchData[10]));
//set branch values from branchData array
- tempBranch.setBranchID(branchData[0]);
- tempBranch.setBranchNickname(branchData[1]);
- tempBranch.setBranchAddressNo(branchData[2]);
- tempBranch.setBranchAddressStreet(branchData[3]);
- tempBranch.setBranchAddressCity(branchData[4]);
- tempBranch.setBranchAddressCounty(branchData[5]);
- tempBranch.setBranchAddressPostCode(branchData[6]);
- tempBranch.setNearestBranch1(branchData[7]);
- tempBranch.setNearestBranch2(branchData[8]);
- tempBranch.setNearestBranch3(branchData[9]);
- tempBranch.setNoCategories(Convert.ToInt32(branchData[10]));
+ //tempBranch.setBranchID(branchData[0]);
+ //tempBranch.setBranchNickname(branchData[1]);
+ //tempBranch.setBranchAddressNo(branchData[2]);
+ //tempBranch.setBranchAddressStreet(branchData[3]);
+ //tempBranch.setBranchAddressCity(branchData[4]);
+ //tempBranch.setBranchAddressCounty(branchData[5]);
+ //tempBranch.setBranchAddressPostCode(branchData[6]);
+ //tempBranch.setNearestBranch1(branchData[7]);
+ //tempBranch.setNearestBranch2(branchData[8]);
+ //tempBranch.setNearestBranch3(branchData[9]);
+ //tempBranch.setNoCategories(Convert.ToInt32(branchData[10]));
//add branch to main arrayList
tempBranch.addBranchToMainArgus(tempBranch);
@@ -75,12 +78,13 @@ private void frmLogin_Load(object sender, EventArgs e)
}
//new instance of Category Class
- Category tempCategory = new Category();
+ Category tempCategory = new Category(Convert.ToInt32(categoryData[0]), categoryData[1],
+ Convert.ToInt32(categoryData[2]));
//set values
- tempCategory.setCategoryID(Convert.ToInt32(categoryData[0])); //ERROR! reading the line below it should be
- tempCategory.setCategoryName(categoryData[1]);
- tempCategory.setNoProducts(Convert.ToInt32(categoryData[2]));
+ //tempCategory.setCategoryID(Convert.ToInt32(categoryData[0])); //ERROR! reading the line below it should be
+ //tempCategory.setCategoryName(categoryData[1]);
+ //tempCategory.setNoProducts(Convert.ToInt32(categoryData[2]));
//add category to Categories in branch arrayList
tempBranch.addCategoryToBranch(tempCategory);
@@ -97,15 +101,16 @@ private void frmLogin_Load(object sender, EventArgs e)
}
//new instance of Product Class
- Product tempProduct = new Product();
+ Product tempProduct = new Product(Convert.ToInt32(productData[0]), productData[1], productData[2],
+ productData[3], Convert.ToSingle(productData[4]), Convert.ToInt32(productData[5]));
//add values to temp product
- tempProduct.setProductID(Convert.ToInt32(productData[0]));
- tempProduct.setProductTitle(productData[1]);
- tempProduct.setProductDetails(productData[2]);
- tempProduct.setProductImageSource(productData[3]);
- tempProduct.setProductPrice(Convert.ToSingle(productData[4]));
- tempProduct.setProductStockLevel(Convert.ToInt32(productData[5]));
+ //tempProduct.setProductID(Convert.ToInt32(productData[0]));
+ //tempProduct.setProductTitle(productData[1]);
+ //tempProduct.setProductDetails(productData[2]);
+ //tempProduct.setProductImageSource(productData[3]);
+ //tempProduct.setProductPrice(Convert.ToSingle(productData[4]));
+ //tempProduct.setProductStockLevel(Convert.ToInt32(productData[5]));
//add product to productsincategory arraylist
tempCategory.addProduct(tempProduct);
Oops, something went wrong.
@@ -74,5 +74,15 @@ private void button4_Click(object sender, EventArgs e)
{
MessageBox.Show("This will display the full catergory details in the message box.");
}
+
+ private void MainBranch_Load(object sender, EventArgs e)
+ {
+ //create object array
+
+ //create new instance of category
+
+
+
+ }
}
}
@@ -15,7 +15,7 @@ class Product
private int productStockLevel;
- public void product(int inProductID, string inProductTitle, string inProductDetails,
+ public Product(int inProductID, string inProductTitle, string inProductDetails,
string inProductImageSource, float inProductPrice, int inProductStockLevel)
{
productID = inProductID;
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+ <security>
+ <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+ <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+</assembly>
Binary file not shown.
Binary file not shown.
@@ -116,7 +116,17 @@ C:\Users\Jake\Dropbox\University\SOFT130\Assignment\SOFT130CWKProgram\WindowsFor
C:\Users\Jake\Dropbox\University\SOFT130\Assignment\SOFT130CWKProgram\WindowsFormsApplication1\obj\x86\Debug\GenerateResource.write.1.tlog
C:\Users\Jake\Dropbox\University\SOFT130\Assignment\SOFT130CWKProgram\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.MainBranch.resources
C:\Users\Jake\Dropbox\University\SOFT130\Assignment\SOFT130CWKProgram\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.ProductDetails.resources
-C:\Users\Alexander\Dropbox\University\SOFT130\Argus---acronym\Argus---acronym\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.exe
-C:\Users\Alexander\Dropbox\University\SOFT130\Argus---acronym\Argus---acronym\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.pdb
C:\Users\Jake\Dropbox\University\SOFT130\Assignment\Argus---acronym\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.exe
C:\Users\Jake\Dropbox\University\SOFT130\Assignment\Argus---acronym\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.pdb
+C:\Users\Alexander\Dropbox\University\SOFT130\Argus---acronym\Argus---acronym\WindowsFormsApplication1\bin\Debug\Argus.exe
+C:\Users\Alexander\Dropbox\University\SOFT130\Argus---acronym\Argus---acronym\WindowsFormsApplication1\bin\Debug\Argus.pdb
+C:\Users\Alexander\Dropbox\University\SOFT130\Argus---acronym\Argus---acronym\WindowsFormsApplication1\obj\x86\Debug\ResolveAssemblyReference.cache
+C:\Users\Alexander\Dropbox\University\SOFT130\Argus---acronym\Argus---acronym\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.frmLogin.resources
+C:\Users\Alexander\Dropbox\University\SOFT130\Argus---acronym\Argus---acronym\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.frmBranchDetails.resources
+C:\Users\Alexander\Dropbox\University\SOFT130\Argus---acronym\Argus---acronym\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.MainBranch.resources
+C:\Users\Alexander\Dropbox\University\SOFT130\Argus---acronym\Argus---acronym\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.ProductDetails.resources
+C:\Users\Alexander\Dropbox\University\SOFT130\Argus---acronym\Argus---acronym\WindowsFormsApplication1\obj\x86\Debug\Argus.Properties.Resources.resources
+C:\Users\Alexander\Dropbox\University\SOFT130\Argus---acronym\Argus---acronym\WindowsFormsApplication1\obj\x86\Debug\GenerateResource.read.1.tlog
+C:\Users\Alexander\Dropbox\University\SOFT130\Argus---acronym\Argus---acronym\WindowsFormsApplication1\obj\x86\Debug\GenerateResource.write.1.tlog
+C:\Users\Alexander\Dropbox\University\SOFT130\Argus---acronym\Argus---acronym\WindowsFormsApplication1\obj\x86\Debug\Argus.exe
+C:\Users\Alexander\Dropbox\University\SOFT130\Argus---acronym\Argus---acronym\WindowsFormsApplication1\obj\x86\Debug\Argus.pdb

0 comments on commit f38dfeb

Please sign in to comment.