Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

programming/Project.pdf Extended Business Programming Project This project involves working with all aspects of C# covered so far using Visual Studio. Outline Create a new C# Windows Forms App project...

1 answer below »
programming/Project.pdf
Extended Business Programming
Project
This project involves working with all aspects of C# covered so far using Visual Studio.
Outline
Create a new C# Windows Forms App project called YourNameProject, for example if I were naming
mine, I would call it ElaineTynanProject.
Follow the instructions to create a project that allows you to store, view, edit, add and delete
customers. The project will emulate a database project, but instead of using a database you will use a 2-
dimensional string a
ay. Because we are not using a database the data will not persist, which means
that each time you run the application you will have to load in new data. The data must persist from
one screen to the next (this can be done by making the 2D a
ay a public static variable in the Menu
form and accessing it from all other forms).
The data to be stored about a customer is their name, address and phone number.
The project will have a menu screen and screens to view, add, edit and delete customers.
The screens for view, add, edit and delete can all be done in 1 form or 4 separate forms. There will be
extra marks for doing it in 1 form.
The below forms are suggested layouts and may be modified if you prefer to create your own designs.
Ensure that all controls are named appropriately (according to standards) Including the forms
themselves, for example MenuForm & DetailsForm. If the forms have titles, make sure they are
appropriate.
Extended Business Programming
Extended Business Programming
Extended Business Programming
Notes:
• To make the buttons appear like a link to click on you can set the FlatStyle of the button, in
properties to Flat and set the BackColor to Control, the same as the form BackColor.
• The one screen can be used for view, edit, add & delete by hiding/showing the appropriate
uttons when the form is loaded.
• After changes are made to the customer details the form will have to be refreshed to see the
changes. This consists of loading the data into the list again as well as clearing any text boxes,
etc. It would be wise to create a refresh method to do this.
• Be sure your output is formatted into columns as per the images above. Some fonts are
monospaced, or fixed width. Others are not and therefore 20 spaces will be different depending
on the width of the characters. For example, w takes up more space than i. If you want to get
proper formatting use a font that is monospaced. Some examples of monospaced fonts are
Courier and Consolas.
• There should be validation on operations where suitable. For example, you should not be
allowed to add a blank name, address or phone number.
Steps:
1. When the application is run the Menu Screen should be shown.
2. Each link
utton on the main menu should take you to the co
ect screen option.
View
3. The view screen should display a list of all customers. There should be no blank lines loaded
into the list. When a customer is selected their details should be loaded into text boxes or
something similar, to allow for closer inspection.
Add
4. The view screen should display a list of all customers. There should be no blank lines loaded
into the list. When a customer is selected their details should be loaded into text boxes or
something similar, to allow for closer inspection.
5. When the user types in the text boxes they should be able to add the customer to the customer
details store.
6. When the user clicks the add button, the user should be presented with a message box asking
them if they are sure they want to add the customer. If they click No/Cancel, the details should
not be added, if they click Yes/OK the details should be added unless the store (the 2D a
ay) is
full, in which case the user should be notified of this.
Edit
7. The edit screen should display a list of all customers. There should be no blank lines loaded into
the list. When a customer is selected their details should be loaded into text boxes or
something similar, to allow the user to make changes.
8. When the user types in the text boxes they should be able to edit the selected customer. The
changes should be reflected in the customer details store (2D a
ay).
Extended Business Programming
9. When the user clicks the save button, the user should be presented with a message box asking
them if they are sure they want to edit the customer. If they click No/Cancel, the details should
not be changed, if they click Yes/OK the details should be edited.
Delete
10. The delete screen should display a list of all customers. There should be no blank lines loaded
into the list. When a customer is selected their details should be loaded into text boxes or
something similar, to allow the user to inspect the customer to be deleted.
11. When the user clicks the delete button, the user should be presented with a message box
asking them if they are sure they want to delete the customer. If they click No/Cancel, the
details should not be removed, if they click Yes/OK the details should be removed from the 2D
a
ay. No blank lines should be left in the middle of the a
ay.
Exit
12. When the Exit button is clicked close the form.
Testing
Download the word document called TestCasesTemplateForTesting.docx, complete it with the test
cases for the following methods:
• FindNextFreeSpace.
• Any 1 other method of your choosing that displays good testing ability.
This document should be filled out before you start to write the test code. Please spend some time
thinking about and doing this as this will determine whether you write good test code or not.
You must read the code and think of the possible types of input a user could pass into the methods.
Some sample input types are valid, boundary, invalid, positive, negative, null, 0, etc.
Write a test for each of these types of tests in the same format as shown.
This document should be saved in the project solution folder and uploaded with the assessment.
Follow the instructions given in the notes on moodle titled 08 UnitTestingVisualStudio to add a test
project to your project.
Run the test.
If any if the tests fail, go back to the code and fix it so that they all pass.
The assignment submission should include the project, the test project and the Test Case document.
Extended Business Programming
APPENDIX

Useful Code

Code to delete a line from a 2D a
ay with 3 columns
The line number that is deleted is stored in the variable index
int i;
for (i=index; i< a
.GetLength(0)-1; i++)
{
a
[i, 0] = a
[i + 1, 0];
a
[i, 1] = a
[i + 1, 1];
a
[i, 2] = a
[i + 1, 2];
}
a
[i, 0] = null;
a
[i, 1] = null;
a
[i, 2] = null;


Code to confirm the user wants to save customer details
MessageBoxButtons btns = MessageBoxButtons.YesNo;
DialogResult result = MessageBox.Show("Are you sure you want to
overwrite the customer details?", "Save", btns);
if (result == DialogResult.No)
{
return;
}


Method to find the next empty row in 2D a
ay, if none, return -1
private int FindNextFreeSpace(string[,] a
)
{
for (int i = 0; i < a
.GetLength(0); i++)
{
if (a
[i,0]==null)
{
return i;
}
}
return -1;
}


Code to get the selected item from the listbox and

eak it into name, address and phone number and
then put them into the text boxes
the function substring get a sub section of the text
stored in a string starting from the index in the
first parameter and the length is in the second parameter.
string cust = listBox1.SelectedItem.ToString();
txtAddress.Text = cust;
txtName.Text = cust.Substring(0, 30).Trim();
txtAddress.Text = cust.Substring(30,30).Trim();
Extended Business Programming
txtPhone.Text = cust.Substring(60).Trim();
programming/TestCasesTemplateForTesting.docx
FindNextFreeSpace
        Num
        Description
        Data Input
        Expected Outcome
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
AnOtherMethod
        Num
        Description
        Data Input
        Expected Outcome
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
FindNextFreeSpace

Num

Description

Data Input

Expected Outcome
A
nOtherMethod

Num

Description

Data Input

Expected Outcome
FindNextFreeSpace
Num Description Data Input Expected Outcome
AnOtherMethod
Num Description Data Input Expected Outcome

SQLite Lab 4
1. Design the following Database in SQLite.
2. Enter 4 Manager records (rows) in the Manager table
3. Enter 4 Account records in the Accounts table
4. Enter 4 Branch records in the Branch table.
5. Enter 4 Customer records in the Customer table.
6. Display all the records in all the tables.
7. Take a screen shot , save it in a word document and submit to Moodle.
Note: You can make up your own data for each record.
Answered 2 days After Apr 14, 2021

Solution

Aniket answered on Apr 17 2021
155 Votes
SQL COMMANDS
USE CarsDB;
CREATE TABLE Manage
(ManagerID varchar(20) primary key,
ManagerName varchar(20),
ManagerSalary int );
CREATE TABLE Account
(
AccountNumber varchar(10) primary key,
AccountType varchar(10),
AccountBalance int,
ManagerID varchar(20),
Foreign Key(ManagerID) references Manager(ManagerID)
);
CREATE TABLE Branch
(
BranchID varchar(10) primary key,
BranchName varchar(20),
BranchCity varchar(10),
BranchTelephone varchar(12),
ManagerID varchar(20),
Foreign Key(ManagerID) references...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here