Вы находитесь на странице: 1из 97

Executive summary

This is an assignment comes under Object Oriented Programming module at HND in IT


program. For the completion of this assignment, I have to produce an Inventory System for
Zeus Pvt Limited assuming that I work as a C# programmer.

Zeus Pvt Limited is a Small Medium Enterprise, which renounce for importing a very rare
“Power™” branded nutrition supplements for patients who are suffering from Diabetes in Sri
Lanka. Therefore, I had to create a transaction processing system for Zeus Pvt Ltd.

To complete the Task1 in this assignment, I have described the characteristics and principles
of Object Oriented Programming and provided a comprehensive report on how these
characteristics could apply in the required system.

For the Task 2, I have been identified the objects (Classes) from the scenario and list all the
attributes and methods of each object.

Within Task 3, I have drawn use case diagram, class diagram and sequence diagram for
Inventory System of Zeus Pvt Limited to create better and effective system solution.

To complete Task 4, I have designed and proposed an effective Inventory system solution for
Zeus Pvt Limited considering all functions should perform through the system by aid of the
Object Oriented solution using C#.Net.

In Task 5, I have provided the evidences of use of association, aggregation, composition and
generalization relationships from Inventory System of Zeus Pvt Limited.

There are two subtasks inside the Task 6 and within first subtask I have explain how the
concept of polymorphism used in Inventory System of Zeus Pvt Limited. In second subtask,
briefly explained about control structures and how those effectively have used in Inventory
System.

In Task 7, I have discussed the advantages of using Integrated Development Environment


when developing the system.

To complete Task 8, I had to prepare a test plan for Inventory System of Zeus Pvt Limited,
and then, I have critically reviewed and tested Inventory System according to the plan.

R.M. Sandali Geethma Rathnayake Page no 1


Object Oriented Programming
HND in Computing and System Development
Within Task 9, I have to analyze the actual test results against the expected results and have
to identify whether there are any inconsistencies in Inventory System.

To complete the Task 10, I have to gather the independent feedbacks from different users on
Inventory System, which I have implemented. In order to gather feedbacks from users I used
interviews as a feedback collecting method. Using feedbacks, I was able to get more
recommendations and improvements about Inventory System.

To complete Task 11, I have to explain and prove the user friendliness of Inventory System
for Zeus Pvt Limited.

In final Task, I prepared technical documentation for the supporting and maintenance of the
Inventory System including an installation and maintenance guide.

R.M. Sandali Geethma Rathnayake Page no 2


Object Oriented Programming
HND in Computing and System Development
Acknowledgement
First, I would like to thank to our supervisor of this project, lecturers for the valuable
guidance and advice. They propelled us greatly to work in this project and ability to motivate
us committed immensely to my assignment. A special gratitude I give to our Lecturer Mr.
Dewa Kumaraurunathan, who covered Object Oriented Program module under the HND
program, also whose contribution in stimulating suggestions and encouragement, helped me
to create my assignment.

Furthermore, The Authors, Publishers of Books, Journal Articles & Web pages appreciated
for keeping their precious pieces of works available for my references.

I have taken undertakings in this assignment. However, it might not have been possible
without the kind backing and help of many individuals and organizations. I might want to
develop my sincere thanks to staff of ESOFT. I am highly indebted to for their guidance and
constant supervision as well as for providing necessary information regarding the assignment
& for their backing in finishing the assignment.

I dedicate this dissertation to my family for their unconditional support and love given in
every way possible throughout the process of this degree program.

I would like to express my special appreciation and thanks to all of you.

Thank You!

R.M. Sandali Geethma Rathnayake Page no 3


Object Oriented Programming
HND in Computing and System Development
Table of Contents
Executive summary.................................................................................................................... 1

Acknowledgement ..................................................................................................................... 3

TASK 01 .................................................................................................................................... 6

Discuss the characteristics and principles of Object Oriented Programming and provide
a comprehensive report on how these characteristics could be apply in the required system.
................................................................................................................................................ 6

TASK 02 .................................................................................................................................. 13

Identifying the objects (Classes) from the scenario and list all the data and methods. ....... 13

TASK 03 .................................................................................................................................. 14

Use Case Diagram................................................................................................................ 14

Class Diagram ...................................................................................................................... 15

Sequence diagram ................................................................................................................ 16

TASK 04 .................................................................................................................................. 17

Implement the Object Oriented solution using C#.Net for the proposed Design ................ 17

TASK 05 .................................................................................................................................. 27

Provide evidences of use of association, aggregation, composition and generalization


relationships from your system. ........................................................................................... 27

TASK 06 .................................................................................................................................. 34

a) Demonstrate how concept of polymorphism used in your system. .............................. 34

b) Explain briefly how effectively control structures have used in your system. ......... 39

TASK 07 .................................................................................................................................. 41

Discuss the advantages of using Integrated Development Environment in the system


development. ........................................................................................................................ 41

TASK 08 .................................................................................................................................. 50

Prepare a test plan, then critically review and test your solution according to the plan. ..... 50

TASK 09 .................................................................................................................................. 52

Analyze actual test results against expected results and identify inconsistencies. .............. 52

R.M. Sandali Geethma Rathnayake Page no 4


Object Oriented Programming
HND in Computing and System Development
TASK 10 .................................................................................................................................. 57

Get independent feedback on your solution (use surveys, questioners, interviews or any
other feedback collecting method) and suggest recommendations and improvements. ...... 57

TASK 11 .................................................................................................................................. 60

Explain and prove user friendliness of your solution. ......................................................... 60

TASK 12 .................................................................................................................................. 69

Prepare the technical documentation for the support and maintenance of the software ...... 69

Zeus Inventory Control System Support Guide ................................................................... 69

Zeus Inventory Control System Maintenance Guide ........................................................... 79

Conclusion ............................................................................................................................... 92

Self-Evaluation ........................................................................................................................ 93

Gantt chart ................................................................................................................................ 94

References ................................................................................................................................ 95

R.M. Sandali Geethma Rathnayake Page no 5


Object Oriented Programming
HND in Computing and System Development
TASK 01

Discuss the characteristics and principles of Object Oriented Programming


and provide a comprehensive report on how these characteristics could be
apply in the required system.

Object-Oriented Programming uses a different set of programming languages to build a


system or web applications using programming languages like C#, Vb.net than old procedural
programming languages (C, Pascal).OOP contains list of elements that are very helpful to
make object oriented programming stronger. Here is the list of top characteristics and
principles that we can implement in all major programming languages like c#, vb.net etc.

Characteristics and Principles of Object-Oriented Programming

1) Encapsulation

Encapsulation is the process of keeping or enclosing one or more items within a single
physical or logical package. In OOP the encapsulation mainly achieved by creating classes,
the classes expose public methods and properties.
Table1.1: Coding for Encapsulation
Code
class Rectangle{
public double length;
public double width;

public double GetArea(){


return length * width;
}
public void Display(){
Console.WriteLine("Length: {0}", length);
Console.WriteLine("Width: {0}", Width);
Console.WriteLine("Area: {0}", GetArea());
}
}
classEecuteRectangle{
static void Main(String [] args){
Rectangle r=new Rectangle();
r.length=45;
r.width=3.5;
r.Display();
Console.ReadLne();
}}

R.M. Sandali Geethma Rathnayake Page no 6


Object Oriented Programming
HND in Computing and System Development
2) Polymorphism

The word Polymorphism means having many forms. In OOP the polymorphisms is achieved
by using many different techniques named method overloading, operator overloading, and
method overriding, The following example shows using function print () to print different
data types:
Table1.2: Coding example for Polymorphism
Code
classPrintData{
void print(int i){
Console.WriteLine("Printing int: {0}", i);}
void print(string s){
Console.WriteLine("Printing string: {0}", s);}
static void Main(string[] args){
PrintData p=newPrintData();
p.print(5);
p.print("Hello C++");
Console.ReadKey();}}

3) Inheritance

Inheritance allows us to define a class in terms of another class, which makes it easier to
create and maintain an application. This also provides an opportunity to reuse the code
functionality and speeds up implementation time.
Table1.3: Coding example for Inheritance
Code
class Shape{
public void setWidth(int w){
width=w;}
public void setHeight(int w){
height=h;}
protect dint width;
protect dint height;}
class Rectangle: Shape{
public int getArea(){
return(width * height);}}
classRectangleTester{
static void Main(string[] args){
Rectangle rect=new Rectangle();
rect.setHeight(5);
rect.setWidth(7);
Console.WriteLine("Total area: {0}", rect.getArea());
Console.ReadKey();}}

R.M. Sandali Geethma Rathnayake Page no 7


Object Oriented Programming
HND in Computing and System Development
4) Abstract Class

The abstract modifier can use with classes, methods, properties, indexers, and events.
Members marked as abstract or included in an abstract class, must implement by classes that
derive from the abstract class.

Table1.4: Coding example for Abstract Class


Code
class Square : ShapeClass{
int side = 0;

public Square(int n){


side = n;
}
Public override int Area(){
return side * side;
}
static void Main(){
Square sq = new Square(12);
Console.WriteLine("Area of Square = {0}", sq.Area());
}
Interface Intl{
void M();
}
Abstract class C : I
{
Public abstract void M();
}

5) Interface

Interfaces define properties, methods, and events, which are the members of the interface. It
is the responsibility of the deriving class to define the members.

Table1.5: Coding example for Interface


Code
Public class ITransactions{
void showTransaction();
double getAmount();
}
Public class Transaction: ITransactions{
Private string tCode,date;
Private double amount;
public Transaction(){
tCode = "";
date = "";
amount = 00;
}
public Transaction(string c, string d, double a){

R.M. Sandali Geethma Rathnayake Page no 8


Object Oriented Programming
HND in Computing and System Development
tCode = c;
date = d;
amount = a;
}
Public double getAmount(){
return amount;
}
Public void showTransaction(){
Console.WriteLine("Transaction: {0}", tCode);
Console.WriteLine("Date: {0}", date);
Console.WriteLine("Amount: {0}", getAmount);
}}
Class Tester{
Static void Main(string[] args){
Transaction t1 = new Transaction("001", "8/10/2012", 78900.00);
Transaction t2 = new Transaction("002", "9/10/2012", 451900.00);
t1.showTransaction();
t2.showTransaction();
}}

6) Collection

Collection classes are specialized classes for data storage and retrieval. Most collection
classes implement the same interfaces. The following are the various commonly used classes
of the System.Collection namespace.

Table1.6: Class Collections


Class Description and Usage

ArrayList It represents ordered collection of an object that, can


beindexed individually.

Hashtable It uses a key to access the elements in the collection.

Sorted List It uses a key as well as an index to access the items in a list.

Stack It represents a last in, first out collection of object.

Queue It represents a first-in, first out collection of object.

Bit Array It represents an array of the binary representation using the values 1
and 0.

R.M. Sandali Geethma Rathnayake Page no 9


Object Oriented Programming
HND in Computing and System Development
7) Constructor

Constructors have the same name as the class or struct, and they usually initialize the data
members of the new object.

Table1.7: Coding example for Constructor


Code
Public class Taxi{
Public bool isInitialized;
public Taxi();{
isInitialized = true; }}
class TestTaxi{
static void Main(){
Taxi t = new Taxi();
Console.WriteLine(t.isInitialized);}}

8) Destructor

As we all know, ‘Destructors’ are used to destruct instances of classes. When using
destructors in C#, keep in mind the following things:

1. A class can only have one destructor.


2. Destructors cannot inherit or overload.
3. A destructor does not take modifiers or have parameters.

The following is a declaration of a destructor for the class MyClass:

Table1.8: Coding example for Destructor


Code
~MyClass()
{
//Cleaning up code goes here
}

9) Instant Variable

Instance variables declare in a class, but outside a method, constructor or any block. Instance
variables create when an object is created with the use of the keyword 'new' and destroyed
when the object destroys. Access modifiers can give for instance variables.

R.M. Sandali Geethma Rathnayake Page no 10


Object Oriented Programming
HND in Computing and System Development
Table1.9: Coding example for Instant Variable
Code
Public class Employee
{
Public String name;
Private double salary;

public Employee(String empName)


{
name = empName;
}
public voi setSalary(double empSal)
{
salary = empSal;
}

10) Instant Method

Instance methods in a class can make use of any of the public or private static data that
belongs to that class.

Table1.10: Coding example for Instant Method


Code
Public string Name{get; set}
Public int Age{get; set}

Public static Dog LastGuyThatBarked{get; protected set}

Public readonly static string TheDogMotto = "Man's Best Friend";

Public static int TotalNumDogs = 0;

public Dog(string name, int age)


{
Name =name;
Age = age;
TotalNumDogs++;
}
Public void Bark()
{
Console.WriteLine("{0} says Woof", Name);

Dog.LastGuyThatBarked{get = this;

Console.WriteLine("There are {0} total dogs", Dog.TotalNumDogs);


Console.WriteLine("Remember our motto: {0}", Dog.TheDogMotto);}}

R.M. Sandali Geethma Rathnayake Page no 11


Object Oriented Programming
HND in Computing and System Development
11) Class Relationship

Classes that cooperate with each other, or are associated with each other through the model of
our problem, need each other’s names to message back and forth.

Table1.11: Coding example for Class Relationship


Code
publicclassCar
{
public Car()
{
Wheel frontLeft = new Wheel();
Wheel frontRight = new Wheel();
Wheel backLeft = new Wheel();
Wheel backRight = new Wheel();
Brake frontBrakes = new Wheel();
Brake backBrakes = new Wheel();}}

Public class Wheel


{
Public int Size;
Public string Brand;
Public Brake AttachedTo {get, set}
}
Public class Brake
{
Public string Type;
}

R.M. Sandali Geethma Rathnayake Page no 12


Object Oriented Programming
HND in Computing and System Development
TASK 02

Identifying the objects (Classes) from the scenario and list all the data and
methods.
Table2.12: Attributes and Method of Classes
Zeus Pvt Limited Hospital
Company Name : varchar Name : varchar
Address : varchar Address : varchar

Import(numberOfItems ) : int Make_Order() : int


Deliver() : int Send_Order() : int

Inventory Registry Zeus Office


Product_ID : int Name : varchar
Product_Name : varchar Location : varchar

Balance_Invenory() : int Collect_purchasedOrder() : varchar


Update_Inventory() : int Send_purchasedOrder() : varchar

Zeus Warehouse Issue Officer


Name : varchar Emp_ID : int
Location : varchar Name : varchar

Collect_Invoice() : varchar Update_Inventory() : varchar


Issue_Product() : varchar Issue_Products() : varchar

Sales Officer
Emp_ID : int
Name : varchar
Send_Order() : varchar
Make_Order(): varchar

R.M. Sandali Geethma Rathnayake Page no 13


Object Oriented Programming
HND in Computing and System Development
TASK 03

Use Case Diagram

Figure3.1: Use Case Diagram for Zeus Inventory System

R.M. Sandali Geethma Rathnayake Page no 14


Object Oriented Programming
HND in Computing and System Development
Class Diagram

Figure3.2: Class Diagram for Zeus Inventory System


R.M. Sandali Geethma Rathnayake Page no 15
Object Oriented Programming
HND in Computing and System Development
Sequence diagram

Figure3.3: Sequence Diagram for Zeus Inventory System


R.M. Sandali Geethma Rathnayake Page no 16
Object Oriented Programming
HND in Computing and System Development
TASK 04

Implement the Object Oriented solution using C#.Net for the proposed
Design
Table4.13: Login Form Interface and coding
Login Form Interface

Figure4.4: Login Form


Code
namespace ZeusInventoryControlSystem{
public partial class frmLogin : Form
{
public frmLogin(){
InitializeComponent();
}
Private void btnLogIn_Click(object sender, EventArgs e){
if (txtUserName.Text == "Zeuspvt"&& txtPassword.Text == "inventory@zeus"){
this.Hide();
frmMain objMain = new frmMain();
objMain.Show();}
else{
Message box Show ("Sorry! You have entered wrong username or password. Try it again!", "Zeus Pvt
Limited", MessageBoxButtons.OK, MessageBoxIcon.Error);
txtUserName.Clear();
txtPassword.Clear();
}
}

R.M. Sandali Geethma Rathnayake Page no 17


Object Oriented Programming
HND in Computing and System Development
Table4. 14: Main Form Interface and coding
Main Form Interface

Figure4.5: Main Form


Code
Private void toolStripMenuItem1_Click(object sender, EventArgs e)
{
frmPurchaseProducts objPurchaseProduct = new frmPurchaseProducts();
objPurchaseProduct.MdiParent = this;
objPurchaseProduct.Show();
}

Private void toolStripMenuItem2_Click(object sender, EventArgs e)


{
frmUpdatePurchaseProductDetails objUpdateDetails = new frmUpdatePurchaseProductDetails();
objUpdateDetails.MdiParent = this;
objUpdateDetails.Show();
}

Private void sellingProductsToolStripMenuItem_Click(object sender, EventArgs e)


{
frmSellProduct objSellProduct = new frmSellProduct();
objSellProduct.MdiParent = this;
objSellProduct.Show();
}

Private void currentProductInventoryToolStripMenuItem_Click(object sender, EventArgs e)


{
frmProductInventory objInventory = new frmProductInventory();
objInventory.MdiParent = this;
objInventory.Show();
}

Private void orderingProductsToolStripMenuItem_Click(object sender, EventArgs e)

R.M. Sandali Geethma Rathnayake Page no 18


Object Oriented Programming
HND in Computing and System Development
{
frmOrderingProducts objOder = new frmOrderingProducts();
objOder.MdiParent = this;
objOder.Show();
}

Private void toolStripMenuItem3_Click(object sender, EventArgs e)


{
frmDeleteEntry objOder = new frmDeleteEntry();
objOder.MdiParent = this;
objOder.Show();
}

Private void toolStripMenuItem4_Click(object sender, EventArgs e)


{
frmHelp objHelp = new frmHelp();
objHelp.MdiParent = this;
objHelp.Show();
}

Private void toolStripMenuItem5_Click(object sender, EventArgs e)


{
Application.Exit();
}

Table4.15: Purchase Product Interface and coding


Purchase Product Interface

Figure4.6: Purchase Product Form


Code
Private void btnPAdd_Click_2(object sender, EventArgs e){
if (txtPName.Text == "" || txtPPrice.Text == "" || txtPQuantity.Text == "")
{
MessageBox.Show("Please fill the value", "Product Inventory Control System, Zeus PVT Limited",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
R.M. Sandali Geethma Rathnayake Page no 19
Object Oriented Programming
HND in Computing and System Development
else {
ClassConnection objConnection = new ClassConnection();
string getString = objConnection.conMethod();
SqlConnection con = new SqlConnection(getString);
try
{
string productName = txtPName.Text;
float productPrice = float.Parse(txtPPrice.Text);
int productQuantity = int.Parse(txtPQuantity.Text);
con.Open();

SqlCommand command = new SqlCommand("INSERT INTO [Product]


(ProductName,Price,Quantity) VALUES('" + productName + "'," + productPrice + "," +
productQuantity + ")", con);
command.ExecuteNonQuery();
MessageBox.Show("Data Inserted successfully", "Product Inventory Control System, Zeus PVT
Limited", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex) {
MessageBox.Show(ex.ToString());
}
finally {
con.Close;}}}

Table4.16: Update Product Interface and coding


Update Product Interface

Figure4.7: Update Product Form


Code
Private void btnUpdate_Click(object sender, EventArgs e)
{
if (txtUPName.Text == "" || txtUPPrice.Text == "" || txtUPQuantity.Text == "")
{
MessageBox.Show("Please Fill the value", "Product Inventory Control System, Zeus PVT Limited",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
R.M. Sandali Geethma Rathnayake Page no 20
Object Oriented Programming
HND in Computing and System Development
{
ClassConnection objConnection = new ClassConnection();
string getString = objConnection.conMethod();
SqlConnection con = new SqlConnection(getString);
try
{
con.Open();
SqlCommand command = new SqlCommand("UPDATE [Product] SET ProductName='" +
txtUPName.Text + "',Price='" + txtUPPrice.Text + "',Quantity='" + txtUPQuantity.Text + "' WHERE
PID='" + cmbUPID.Text + "'", con);
command.ExecuteNonQuery();
MessageBox.Show("Updated Successfully", "Product Inventory Control System, Zeus PVT Limited",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
finally
{
con.Close();}}}

Table4.17: Selling Product Interface and coding


Selling Product Interface

Figure4.8: Selling Product Form


Code
Private void btnSSave_Click(object sender, EventArgs e)
{
if (txtSPName.Text == "" || txtSPPrice.Text == "" || txtSPQuantity.Text == "")
{
MessageBox.Show("Please fill the value", "Product Inventory Control System, Zeus PVT Limited",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else

R.M. Sandali Geethma Rathnayake Page no 21


Object Oriented Programming
HND in Computing and System Development
{
Update(2);
Update();
}
}
Public void Update(int quantity)
{
float unitPrice = float.Parse(txtSPPrice.Text);
int Quantity = int.Parse(txtSPQuantity.Text);

string totalPrice = (unitPrice * Quantity).ToString();

txtSTotalPrice.Text = totalPrice.ToString();
}
Public void Update()
{
ClassConnection objConnection = new ClassConnection();
string getString = objConnection.conMethod();
SqlConnection con = new SqlConnection(getString);
try{
con.Open();
SqlCommand command = new SqlCommand("SELECT Quantity FROM [Product] WHERE PID ='"
+ cmbSPID.Text + "'", con);
SqlDataReader reader;
reader = command.ExecuteReader();
ArrayList pQuantity = new ArrayList();

string productQty = "";


while (reader.Read())
{
productQty = reader[0].ToString();
}
int ProductQty = int.Parse(productQty.ToString());
try
{
con.Close();
con.Open();

int deductQuantity = int.Parse(txtSPQuantity.Text);


ProductQty = ProductQty - deductQuantity;

SqlCommand commands = new SqlCommand("UPDATE [Product] SET Quantity='" + ProductQty +


"' WHERE PID ='" + cmbSPID.Text + "'", con);
commands.ExecuteNonQuery();
MessageBox.Show("Updated Successfully", "Product Inventory Control System, Zeus PVT Limited",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
Table4.18: Product Inventory Interface and coding

R.M. Sandali Geethma Rathnayake Page no 22


Object Oriented Programming
HND in Computing and System Development
Product Inventory Interface

Figure4.9: Product Inventory Form


Code
Private void frmProductInventory_Load(object sender, EventArgs e)
{
txtCurrentDate.Text = DateTime.Today.ToShortDateString();

ClassConnection objConnection = new ClassConnection();


string getString = objConnection.conMethod();
SqlConnection con = new SqlConnection(getString);

try
{
SqlDataAdapter adapter = new SqlDataAdapter("SELECT PID , ProductName, Price, Quantity
FROM [Product]", con);
DataTable ds = new DataTable();
adapter.Fill(ds);

dgvInventory.DataSource = ds;

dgvInventory.Columns[0].HeaderText = "Product ID";


dgvInventory.Columns[1].HeaderText = "Product Name";
dgvInventory.Columns[2].HeaderText = "Price";
dgvInventory.Columns[3].HeaderText = "Quantity";
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
finally
{
con.Close();
}
}

Bitmap Btmap;
Private void btnPrint_Click(object sender, EventArgs e)
R.M. Sandali Geethma Rathnayake Page no 23
Object Oriented Programming
HND in Computing and System Development
{
//Add a Panel control
Panel panal = new Panel();
this.Controls.Add(panel);

//Create a Bitmap of size same as that of the Form.


Graphics grp = panel.CreateGraphics();
Size formSize = this.ClientSize;
bitmap = new Bitmap(formSize.Width, formSize.Height, grp);
grp = Graphics.FromImage(bitmap);

//Copy screen area that that the Panel covers


Point panelLocation = PointToScreen(panel.Location);
grp.CopyFromScreen(panelLocation.X, panelLocation.Y, 0, 0, formSize);

//Show the Print Preview Dialog


printPreviewDialog1.Document = printDocument1;
printPreviewDialog1.PrintPreviewControl.Zoom = 1;
printPreviewDialog1.ShowDialog();
}

Private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs


e)
{
//Print the contents
//e.Graphics.DrawImage(bitmap, 0, 0);

Bitmap bm = new Bitmap(this.dgvInventory.Width, this.dgvInventory.Height);


dgvInventory.DrawToBitmap(bm, new Rectangle(0, 0, this.dgvInventory.Width,
this.dgvInventory.Height));
e.Graphics.DrawImage(bm, 0, 0);
}
}

R.M. Sandali Geethma Rathnayake Page no 24


Object Oriented Programming
HND in Computing and System Development
Table4.19: Ordering Product Interface and coding
Ordering Product Interface

Figure4.10: Ordering Product Form


Code
Private void frmOrderingProducts_Load(object sender, EventArgs e)
{
txtOrderDate.Text = DateTime.Today.ToShortDateString();

ClassConnection objConnection = new ClassConnection();


string getString = objConnection.conMethod();
SqlConnection con = new SqlConnection(getString);

try
{
SqlDataAdapter adapter = new SqlDataAdapter("SELECT PID, ProductName, Price, Quantity FROM
[Product] WHERE Quantity < 5", con);
DataTable ds = new DataTable();
adapter.Fill(ds);

dgvOrderingProduct.DataSource = ds;

dgvOrderingProduct.Columns[0].HeaderText = "Product ID";


dgvOrderingProduct.Columns[1].HeaderText = "Product Name";
dgvOrderingProduct.Columns[2].HeaderText = "Price";
dgvOrderingProduct.Columns[3].HeaderText = "Quantity";
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
finally
{
con.Close();
}
}

R.M. Sandali Geethma Rathnayake Page no 25


Object Oriented Programming
HND in Computing and System Development
Bitmap bitmaps;
Private void button1_Click(object sender, EventArgs e)
{
//Add a Panel control
Panel panels = new Panel();
this.Controls.Add(panel);

//Create a Bitmap of size same as that of the Form.


Graphics grp = panels.CreateGraphics();
Size formSize = this.ClientSize;
bitmaps = new Bitmap(formSize.Width, formSize.Height, grp);
grp = Graphics.FromImage(bitmaps);

//Copy screen area that that the Panel covers


Point panelLocation = PointToScreen(panel.Location);
grp.CopyFromScreen(panelLocation.X, panelLocation.Y, 0, 0, formSize);

//Show the Print Preview Dialog.


printPreviewDialog1.Document = printDocument1;
printPreviewDialog1.PrintPreviewControl.Zoom = 1;
printPreviewDialog1.ShowDialog();
}

Private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs


e)
{
//Print the contents
//e.Graphics.DrawImage(bitmap, 0, 0);

Bitmap bm = new Bitmap(this.dgvOrderingProduct.Width, this.dgvOrderingProduct.Height);


dgvOrderingProduct.DrawToBitmap(bm, new Rectangle(0, 0, this.dgvOrderingProduct.Width,
this.dgvOrderingProduct.Height));
e.Graphics.DrawImage(bm, 0, 0);
}
}

R.M. Sandali Geethma Rathnayake Page no 26


Object Oriented Programming
HND in Computing and System Development
TASK 05

Provide evidences of use of association, aggregation, composition and


generalization relationships from your system.

Association

Association is a relationship between two classes. It allows one object instance to cause
another to perform an action on its behalf. In my system, I have provided best example for
Association. Within Table 5.20, it will display the coding for purchase product for the first
time in Zeus pvt limited. Then I created a class for purchase product and in which create the
product Id for each new product.

Table5.20: Coding example for Association from Zeus System


Code
Private void frmPurchaseProducts_Load(object sender, EventArgs e){
ClassConnection objConnection = new ClassConnection();
string getString = objConnection.conMethod();
SqlConnection con = new SqlConnection(getString);
try{
string pid = "0";
con.Open();
SqlCommand command = new SqlCommand("SELECT MAX(PID) FROM [Product]", con);
SqlDataReader reader;
reader = command.ExecuteReader();

while (reader.Read()){
pid = reader[0].ToString();
}
if (pid == ""){
int newProdctId = 1;
txtPID.Text = newProdctId.ToString();
}
else{
int oldProductID = int.Parse(pid);
int newProductID = oldProductID + 1;
txtPID.Text = newProductID.ToString();
}
}
catch (Exception ex){
MessageBox.Show(ex.ToString());
}
finally{
con.Close();
}}
In Table 5.21, it will display the coding for selling product in Zeus pvt limited. In which I
have created a class, which is sell product. In order to sell product there should be product
R.M. Sandali Geethma Rathnayake Page no 27
Object Oriented Programming
HND in Computing and System Development
details such as product name, quantity and unit price. In that case, there should be a
relationship between purchase products class and selling product class. Because of products
can sell, if only Zeus pvt limited had purchased the relevant product.

Table5.21: Coding example for Association from Zeus System


Code
Private void frmSellProduct_Load(object sender, EventArgs e)
{
txtDate.Text = DateTime.Today.ToShortDateString();
getProductD();
}

Public void getProductD()


{
ClassConnection objConnection = new ClassConnection();
string getString = objConnection.conMethod();
SqlConnection con = new SqlConnection(getString);

try
{
con.Open();
SqlCommand command = new SqlCommand("SELECT PID FROM[Product]", con);
SqlDataReader reader;
reader = command.ExecuteReader();
ArrayList productIDs = new ArrayList();

while (reader.Read())
{
productIDs.Add(reader[0].ToString());
}
cmbSPID.Items.Clear();
cmbSPID.Items.AddRange(productIDs.ToArray());
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
finally
{
con.Close();}}

R.M. Sandali Geethma Rathnayake Page no 28


Object Oriented Programming
HND in Computing and System Development
Aggregation

Aggregation is a weak type of Association with partial ownership. This is weak compared to
Composition. Then again, weak meaning the linked components of the aggregator may
survive the aggregations life cycle without the existence of their parent objects.

Table5.22: Coding example for Aggregation from Zeus System


Code
Private void btnSSave_Click(object sender, EventArgs e)
{
if (txtSPName.Text == "" || txtSPPrice.Text == "" || txtSPQuantity.Text == "")
{
MessageBox.Show("Please fill the value", "Product Inventory Control System, Zeus PVT Limited",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
Update(2);
Update();
}
}

Public void Update(int quantity)


{
float unitPrice = float.Parse(txtSPPrice.Text);
int Quantity = int.Parse(txtSPQuantity.Text);

string totalPrice = (unitPrice * Quantity).ToString();

txtSTotalPrice.Text = totalPrice.ToString();
}

Public void Update()


{
ClassConnection objConnection = new ClassConnection();
string getString = objConnection.conMethod();
SqlConnection con = new SqlConnection(getString);

try
{
con.Open();
SqlCommand command = new SqlCommand("SELECT Quantity FROM [Product] WHERE PID ='"
+ cmbSPID.Text + "'", con);
SqlDataReader reader;
reader = command.ExecuteReader();
ArrayList pQuantity = new ArrayList();

string productQty = "";

while (reader.Read())
{
productQty = reader[0].ToString();
R.M. Sandali Geethma Rathnayake Page no 29
Object Oriented Programming
HND in Computing and System Development
}

int ProductQty = int.Parse(productQty.ToString());

try
{
con.Close();
con.Open();

int deductQuantity = int.Parse(txtSPQuantity.Text);


ProductQty = ProductQty - deductQuantity;

SqlCommand commands = new SqlCommand("UPDATE [Product] SET Quantity='" + ProductQty +


"' WHERE PID ='" + cmbSPID.Text + "'", con);
commands.ExecuteNonQuery();
MessageBox.Show("Updated Successfully", "Product Inventory Control System, Zeus PVT Limited",
MessageBoxButtons.OK, MessageBoxIcon.Information);

}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
finally
{
con.Close();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}

In this example, the method Update is responsible to update the product quantity for product
table. For the first time, the quantity should select from the product table then only it can
identified what about the current quantity.

Next time it means after selling products the quantity should reduce from the database. In that
case the same entity, which is Quantity, will works as its own. Here both entities meet for
some work and then get separated but here one entity has to be an owner and at a same time
they should be independent from each other (having own life time).

R.M. Sandali Geethma Rathnayake Page no 30


Object Oriented Programming
HND in Computing and System Development
Composition

On the other hand, Composition is a strong type of Association with full ownership. This is
strong, compared to the weak Aggregation. For a Composition relationship, we can use the
term owns to imply a strong relationship.

Table 5.23: Coding example for Composition from Zeus System


Code
Private void frmSellProduct_Load(object sender, EventArgs e){
txtDate.Text = DateTime.Today.ToShortDateString();
getProductD();
}

Public void getProductD(){


ClassConnection objConnection = new ClassConnection();
string getString = objConnection.conMethod();
SqlConnection con = new SqlConnection(getString);

try{
con.Open();
SqlCommand command = new SqlCommand("SELECT PID FROM[Product]", con);
SqlDataReader reader;
reader = command.ExecuteReader();
ArrayList productIDs = new ArrayList();

while (reader.Read())
{
productIDs.Add(reader[0].ToString());
}
cmbSPID.Items.Clear();
cmbSPID.Items.AddRange(productIDs.ToArray());
}
catch (Exception ex){
MessageBox.Show(ex.ToString());
}
finally{
con.Close();
}
}

In Table 5.23, it will show how to get the product Id from database and in Table 5.24 will
show how to access the product details from the database. In order to perform these two
functions both classes should have interdependent from each other. It means to get the
product details there should be the product Id and vice versa, it can create a product Id if only
there are some product details.

R.M. Sandali Geethma Rathnayake Page no 31


Object Oriented Programming
HND in Computing and System Development
Table 5.24: Coding example for Composition from Zeus System
Code
Private void cmbSPID_SelectedIndexChanged(object sender, EventArgs e)
{
ClassConnection objConnection = new ClassConnection();
string getString = objConnection.conMethod();
SqlConnection con = new SqlConnection(getString);

try
{
con.Open();
SqlCommand command = new SqlCommand("SELECT ProductName, Price FROM [Product]
WHERE PID = " + int.Parse(cmbSPID.Text) + "", con);
SqlDataReader reader;
reader = command.ExecuteReader();
ArrayList productItems = new ArrayList();

string productName = "";


string productPrice = "";

while (reader.Read())
{
productName = reader[0].ToString();
productPrice = reader[1].ToString();
}

txtSPName.Text = productName.ToString();
txtSPPrice.Text = productPrice.ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
finally
{
con.Close();
}
}

R.M. Sandali Geethma Rathnayake Page no 32


Object Oriented Programming
HND in Computing and System Development
Generalization

Generalization reduces complexity by replacing multiple entities, which perform similar


functions with a single construct. Generalization is kind of relationship to include the objects
of the same or different type. Programming languages provide generalization through
variables, parameterization, generics and polymorphism. It places the emphasis on the
similarities between objects. Thus, it helps to manage complexity by collecting individuals
into groups and providing a representative, which can use to specify any individual of the
group.

Table 5.25: Coding example for Generalization from Zeus System


Code
Private void cmbSPID_SelectedIndexChanged(object sender, EventArgs e){
ClassConnection objConnection = new ClassConnection();
string getString = objConnection.conMethod();
SqlConnection con = new SqlConnection(getString);
try{
con.Open();
SqlCommand command = new SqlCommand("SELECT ProductName, Price FROM [Product]
WHERE PID = " + int.Parse(cmbSPID.Text) + "", con);
SqlDataReader reader;
reader = command.ExecuteReader();
ArrayList productItems = new ArrayList();
string productName = "";
string productPrice = "";
while (reader.Read()){
productName = reader[0].ToString();
productPrice = reader[1].ToString();
}
txtSPName.Text = productName.ToString();
txtSPPrice.Text = productPrice.ToString();
}
catch (Exception ex){
MessageBox.Show(ex.ToString());
}
finally{
con.Close();
}}

In this example, the Table 5.25 displays the coding how to access the product details to
relevant product Id. It means according to the product Id it will display the product name and
the price. In which these entities are already created under first time purchasing of product
and in here, these entities derive from that purchase class. Therefore, this is how
generalization works in this program.

R.M. Sandali Geethma Rathnayake Page no 33


Object Oriented Programming
HND in Computing and System Development
TASK 06

a) Demonstrate how concept of polymorphism used in your system.

Polymorphism

Polymorphism is a generic term that means 'many shapes'. More precisely Polymorphism
means the ability to request that a wide range of different types of things perform the same
operations.

In OOP the polymorphisms is achieved by using many different techniques named method
overloading and method overriding,

What is Method Overloading?

Method overloading is the ability to define several methods all with the same name. In my
project solution for Zeus PVT Limited, I have done the Method over Loading for Selling
Product section. When, the products have ordered by hospital, the sales officer is responsible
to sell products and make invoices for ordered products to handover to warehouse in order to
deliver products to hospitals.

After entering the product details according to the order then sales officer is responsible to
save the data to the system database of Zeus pvt limited inventory control system. Then the
system will produce the Total Price of the relevant product and as well as updating the system
database.

Figure6.11: Sell Product Form


R.M. Sandali Geethma Rathnayake Page no 34
Object Oriented Programming
HND in Computing and System Development
In order to perform this job, I have created two methods but within same name. This is the
where concept of Method overloading will perform its functions. Here is the example coding:

Table 6.26: Coding example for Method overloading


Code
Private void btnSSave_Click(object sender, EventArgs e)
{
if (txtSPName.Text == "" || txtSPPrice.Text == "" || txtSPQuantity.Text == "")
{
MessageBox.Show("Please fill the value", "Product Inventory Control System, Zeus PVT Limited",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
Update(2);
Update();
}
}

Public void Update(int quantity)


{
float unitPrice = float.Parse(txtSPPrice.Text);
int Quantity = int.Parse(txtSPQuantity.Text);

string totalPrice = (unitPrice * Quantity).ToString();

txtSTotalPrice.Text = totalPrice.ToString();
}

Public void Update()


{
ClassConnection objConnection = new ClassConnection();
string getString = objConnection.conMethod();
SqlConnection con = new SqlConnection(getString);

try
{
con.Open();
SqlCommand command = new SqlCommand("SELECT Quantity FROM [Product] WHERE PID ='"
+ cmbSPID.Text + "'", con);
SqlDataReader reader;
reader = command.ExecuteReader();
ArrayList pQuantity = new ArrayList();

string productQty = "";

while (reader.Read())
{
productQty = reader[0].ToString();
}

int ProductQty = int.Parse(productQty.ToString());

R.M. Sandali Geethma Rathnayake Page no 35


Object Oriented Programming
HND in Computing and System Development
try
{
con.Close();
con.Open();

int deductQuantity = int.Parse(txtSPQuantity.Text);


ProductQty = ProductQty - deductQuantity;

SqlCommand commands = new SqlCommand("UPDATE [Product] SET Quantity='" + ProductQty +


"' WHERE PID ='" + cmbSPID.Text + "'", con);
commands.ExecuteNonQuery();
MessageBox.Show("Updated Successfully", "Product Inventory Control System, Zeus PVT Limited",
MessageBoxButtons.OK, MessageBoxIcon.Information);

}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
finally
{
con.Close();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}

What is Method Overriding?

Method overriding is a language feature that allows a subclass to override a specific


implementation of a method that already provided by one of its super-classes.

A subclass can give its own definition of methods but need to have the same signature as the
method in its super-class. This means that when overriding a method the subclass's method
has to have the same name and parameter list as the super-class' overridden method.

Here is the example from my project solution identifying how concept of Method overriding
is applicable.

In order to view current Product Inventory details of Zeus pvt limited there is function in the
system to Issue Officers. Using that function, they are able to check the current product
details as well as which product should order in the future. This is the system interface, in
order to check current product details for relevant date.

R.M. Sandali Geethma Rathnayake Page no 36


Object Oriented Programming
HND in Computing and System Development
Figure6.12: Product Inventory Form
Following is the example coding.

Table 6.27: Coding example for Method Overriding


Code
Private void frmProductInventory_Load(object sender, EventArgs e)
{
txtCurrentDate.Text = DateTime.Today.ToShortDateString();

ClassConnection objConnection = new ClassConnection();


string getString = objConnection.conMethod();
SqlConnection con = new SqlConnection(getString);

try
{
SqlDataAdapter adapter = new SqlDataAdapter("SELECT PID , ProductName, Price, Quantity
FROM [Product]", con);
DataTable ds = new DataTable();
adapter.Fill(ds);

dgvInventory.DataSource = ds;
dgvInventory.Columns[0].HeaderText = "Product ID";
dgvInventory.Columns[1].HeaderText = "Product Name";
dgvInventory.Columns[2].HeaderText = "Price";
dgvInventory.Columns[3].HeaderText = "Quantity";

Here is the system interface for checking which product should be purchase before it will
reduce from the current stock.

R.M. Sandali Geethma Rathnayake Page no 37


Object Oriented Programming
HND in Computing and System Development
Figure6.13: Ordering Product Form
Following is the example coding.

Table 6.28: Coding example for Method Overriding


Code
Private void frmOrderingProducts_Load(object sender, EventArgs e)
{
txtOrderDate.Text = DateTime.Today.ToShortDateString();

ClassConnection objConnection = new ClassConnection();


string getString = objConnection.conMethod();
SqlConnection con = new SqlConnection(getString);
try
{
SqlDataAdapter adapter = new SqlDataAdapter("SELECT PID, ProductName, Price, Quantity FROM
[Product] WHERE Quantity < 10", con);
DataTable ds = new DataTable();
adapter.Fill(ds);

dgvOrderingProduct.DataSource = ds;

dgvOrderingProduct.Columns[0].HeaderText = "Product ID";


dgvOrderingProduct.Columns[1].HeaderText = "Product Name";
dgvOrderingProduct.Columns[2].HeaderText = "Price";
dgvOrderingProduct.Columns[3].HeaderText = "Quantity";

R.M. Sandali Geethma Rathnayake Page no 38


Object Oriented Programming
HND in Computing and System Development
b) Explain briefly how effectively control structures have used in your
system.
1) Sequence

The following is example for how to apply a Sequence statement into Zeus pvt limited
Product Inventory System. When the products sell to hospital, the total price of the product
should calculate. This Update method will perform the calculating under Sequence statement.

First, I declared unit price of a product under data type, which called “Float” a well as how
much of quantity of product will buy from the hospital under “integer” data type. Then
declared another variable which is called “total Price” under string data type, in order to
multiply the values both unit price and quantity.

Table6.29: Coding example for Sequence Structure


Code
Public void Update(int quantity){
float unitPrice = float.Parse(txtSPPrice.Text);
int Quantity = int.Parse(txtSPQuantity.Text);
string totalPrice = (unitPrice * Quantity).ToString();
txtSTotalPrice.Text = totalPrice.ToString();
}

2) Selection

If – Else condition

In the IF Else statement in Selection constructor, it has two choices and the user must select a
choice from that selection which is preferred. In my project solution for Zeus pvt Limited, I
have created some If Else conditions to get some selections, to perform some methods. The
following are example for IF Else Condition:

Table 6.30: Coding example for If-Else condition


Code
private void btnSSave_Click(object sender, EventArgs e){
if (txtSPName.Text == "" || txtSPPrice.Text == "" || txtSPQuantity.Text == ""){
MessageBox.Show("Please fill the value", "Product Inventory Control System, Zeus PVT Limited",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else{
Update(2);
Update(); }}

R.M. Sandali Geethma Rathnayake Page no 39


Object Oriented Programming
HND in Computing and System Development
3) Repetition

While Loop

While loops in use, when the numbers of repeats are unknown and the while, statement
continuously executes a block of statements while a condition remains true.

Here is the example where I used While Loop in my project.

Table6.31: Coding example for While Loop


Code
Try
{
con.Open();
SqlCommand command = new SqlCommand("SELECT Quantity FROM [Product] WHERE PID ='"
+ cmbSPID.Text + "'", con);
SqlDataReader reader;
reader = command.ExecuteReader();
ArrayList Quantity = new ArrayList();

string pQuantity = "";

while (reader.Read())
{
pQuantity = reader[0].ToString();
}
int currentQuantity = int.Parse(pQuantity.ToString());

if (currentQuantity <= 0)
{
MessageBox.Show("Product is out of stock !", "Product Inventory Control System, Zeus PVT
Limited", MessageBoxButtons.OK, MessageBoxIcon.Error);

}
}

R.M. Sandali Geethma Rathnayake Page no 40


Object Oriented Programming
HND in Computing and System Development
TASK 07
Discuss the advantages of using Integrated Development Environment in
the system development.

Using an IDE will save you a lot of effort in writing a program. Some advantages
include:

1. The entire purpose of an IDE is to make developing faster and easier.


2. Its tools and features are supposed to help you organize resources, prevent mistakes, and
provide shortcuts.
3. Simply by working in the same development environment, a group of programmers will
adhere to a standard way of doing things.
4. Standards can further enforced if the IDE offers predefined templates, or if code libraries
share between different team members/teams working on the same project.
5. Many IDEs have documentation tools that either automate the entry of developer
comments, or may actually force developers to write comments in different areas.
6. Simply by having a visual presentation of resources, it should be a lot easier to know how
an application lay out as opposed to traversing the file system for arcane files in the file
system.

Create a Simple Application with Visual C#

By completing this walkthrough, you will become familiar with many of the tools, dialog
boxes, and designers that you can use when you develop applications with Visual Studio.
You will create a simple application, design the UI, add code, and debug errors, while you
learn more about working in the integrated development environment (IDE).

Figure7.14: Visual Studio IDE


R.M. Sandali Geethma Rathnayake Page no 41
Object Oriented Programming
HND in Computing and System Development
Figure7.15: Visual Studio IDE

You can make additional customizations to Visual Studio, such as changing the font face and
size of the text in the editor or the color theme of the IDE, by using the Options dialog box.

Figure7.16: Optional Dialog Box

To change the color theme of the IDE Open the Options dialog box by choosing
the Tools menu at the top and then the Options … item.

Figure7.17: Tool Menu

R.M. Sandali Geethma Rathnayake Page no 42


Object Oriented Programming
HND in Computing and System Development
Change the Color theme to Dark, and then click OK.

Figure7.18: Optional Dialog Box

Create a simple windows application

When you create an application in Visual Studio, you first create a project and a solution. For
this example, you will create a Windows Form Application project. Create a new project. On
the menu bar, choose File, New, and Project….

Figure7.19: Visual Studio File Menu

Choose the Visual Basic or the Visual C# WF Application template by choosing in the left
pane Installed, Templates, Visual C#, Windows,

Figure7.20: New Project Dialog Box

R.M. Sandali Geethma Rathnayake Page no 43


Object Oriented Programming
HND in Computing and System Development
Visual Studio creates the Student Management System project and solution, and the Solution
Explorer shows the various files. The WF Designer shows a design view. The following
items appear in Solution Explorer:

Figure7.21: Project Items


After you create the project, you can customize it. By using the Properties window (found
on the View menu), you can display and change options for project items, controls, and other
items in an application. By using the project properties and property pages, you can display
and change options for projects and solutions.

To change the name of Form

In Solution Explorer, select Form1.cs You should see the Properties window, but if you do
not; choose the View menu and the Property Window item. Change the File Name property
frmMain. Solution Explorer shows that the name of the file is now frmMain.cs

Figure7.22: Property Window

R.M. Sandali Geethma Rathnayake Page no 44


Object Oriented Programming
HND in Computing and System Development
Design the user interface (UI)

We will add three types of controls to this application: a Text Box control, two Radio Button
controls, and a Button control.

To add a Text Box control

Open the Toolbox window by choosing the View menu and the Toolbox item. In
the Toolbox, search for the Text Box control.

Figure7.23: Tool Box


Add a Text Box control to the design surface by choosing the Text Box item and dragging it
to the window on the design surface. Center the control near the top of the window. Window
should resemble the following illustration:

Figure7.24: Main Form with Text Box control

To add radio buttons


In the Toolbox, search for the Radio Button control.

Figure7.25: Tool Box2

R.M. Sandali Geethma Rathnayake Page no 45


Object Oriented Programming
HND in Computing and System Development
Add two Radio Button controls to the design surface by choosing the Radio Button item.

Figure7.26: Radio Buttons in the Main Form

Change the Name property of both Radio Buttons.

Figure7.27: Radio Button Property Window

To add display text for each radio button change the display content from Property choosing
“Text”.

To add the button control, go to the Toolbox, search for the Button control, and then add it
to the design surface

Figure7.28: Final Design Interface

R.M. Sandali Geethma Rathnayake Page no 46


Object Oriented Programming
HND in Computing and System Development
Add code to the Display Button

When this application runs, a message box appears after a user first chooses a radio button
and then chooses the Display button. One message box will appear for Hello, and another
will appear for Goodbye. To create this behavior, you will add code to the Button_Click
event in frmMain.cs

Add code to display message boxes

On the design surface, double-click the Display button.


Table 7.32: Button Click Event
Code
private void button1_Click(object sender, EventArgs e)
{

The following coding should be inside the button event.

Table 7.33: Coding examplebutton event


Code
if (radioButton1.Checked == true){
textBox1.Text = "Hello";
}
else{
radioButton2.Checked == true;
textBox1.Text = "Good Bye";
}

Debug and test the application

Next, you will debug the application to look for errors and test that both Radio Buttons work
correctly. The following instructions tell you how to build and launch the debugger.

Find and fix errors


In this step, you will find the error that we caused earlier by changing the name of the form.

Figure7.29: Error Window

R.M. Sandali Geethma Rathnayake Page no 47


Object Oriented Programming
HND in Computing and System Development
To start debugging and find the error

Start the debugger by selecting Debug, then Start Debugging.

Figure7.30: Debug Menu

Choose the OK button, and then stop the debugger.

Figure7.31: Debug Menu 2

In the Main window, if you choose the Hello radio button, and click on Display button then
the text box will show “Hello” and if choose the Goodbye radio button the text will show
“Good Bye” inside the text box

Figure7.32: Running Form1 Window


R.M. Sandali Geethma Rathnayake Page no 48
Object Oriented Programming
HND in Computing and System Development
Writing Code in the Code and Text Editor

Table 7.34: Editor Features

Syntax Coloring Some syntax elements of code and markup files color differently to
distinguish them.

Error and You may see different-colored wavy underlines appearing in your
Warning Marks code that notify you problems has detected in your code.

Brace Matching When the insertion point place on an open brace in a code file, both it
and the closing braces will highlight

Line Numbers Line numbers can display in the left margin of the code window.

Zoom You can zoom in or out in any code window.

Virtual Space By default, lines in Visual Studio editors end after the last character,
so that the RIGHT ARROW key at the end of a line moves the cursor
to the beginning of the next line.

Automatic Code Generation

Automatic Code Generation features are IntelliSense features that sense locations for
standard code, and add code at the user's command. It can significantly increase your
productivity because you can select from a drop-down menu when you are coding and reduce
the time that you spend typing.

Figure7.33: Visual C# IntelliSense features

R.M. Sandali Geethma Rathnayake Page no 49


Object Oriented Programming
HND in Computing and System Development
TASK 08

Prepare a test plan, then critically review and test your solution according
to the plan.
Table 8.35: Test Plan for Zeus Inventory System
Test Plan 1
Test Item Login Interface
Test Description Make a successful login and redirect to the Main window.
Test Data Username: Zeuspvt Password: inventory@zeus
Expected Output Redirect to the Main window.
Actual Output As expected.

Test Plan 2
Test Item Login Interface
Test Description Provide incorrect User Name and Password.
Test Data Username: zeuspvt Password: inventoryzeus
Expected Output Display Error Message
Actual Output As expected.

Test Plan 3
Test Item Purchase Product Interface
Test Description Make a successful product adding
Test Data Product Name Unit price
Product Quantity
Expected Output Add product.
Actual Output As expected.

Test Plan 4
Test Item Update Product Interface
Test Description Make a successful product updating.
Test Data Product Name Unit price
Product Quantity
Expected Output Update product.
Actual Output As expected.

R.M. Sandali Geethma Rathnayake Page no 50


Object Oriented Programming
HND in Computing and System Development
Test Plan 5
Test Item Sell Product Interface
Test Description Make a successful product selling
Test Data Product Name Unit price
Product Quantity Total price
Expected Output Sell product.
Actual Output As expected.

Test Plan 6
Test Item Product Inventory Interface
Test Description Make a successful checking for current product inventory.
Test Data Click Current Product Inventory menu strip.
Expected Output Show product inventory.
Actual Output As expected.

Test Plan 7
Test Item Ordering Product Interface
Test Description Make a successful checking which products should be ordered
Test Data Click Ordering Product menu strip.
Expected Output Add product.
Actual Output As expected.

Test Plan 8
Test Item Delete Entry Interface
Test Description Make a successful deleing of existing products.
Test Data Product ID
Expected Output Delete product from inventory.
Actual Output As expected.

Test Plan 9
Test Item Help Interface
Test Description Make a successful access for getting help about Zeus Inventory System
Test Data Click Help menu strip.
Expected Output Show User Guide.
Actual Output As expected.

R.M. Sandali Geethma Rathnayake Page no 51


Object Oriented Programming
HND in Computing and System Development
TASK 09

Analyze actual test results against expected results and identify


inconsistencies.
Table 9.36: Test Results against Expected Results
Test Case ID 01
Test Case Enter valid name and password & click on login button
Excepted Result Redirect to the Main window.

Actual Result

Figure9.34: Main Form


Status 

Test Case ID 02

Test Case Enter invalid username and password or leave empty & click on login.
Excepted Result Display error message.

Actual Result

Figure9.35: Login Form


Status 

R.M. Sandali Geethma Rathnayake Page no 52


Object Oriented Programming
HND in Computing and System Development
Test Case ID 01

Test Case Make a successful product adding


Excepted Result Display the message as “Data Inserted Successfully!”

Actual Result

Figure9.36: Purchase Product Form


Status 

Test Case ID 04

Test Case Make a successful product updating.

Excepted Result Display the message as “Updated Successfully”.

Actual Result

Figure9.37: Update Purchase Product Form


Status 

R.M. Sandali Geethma Rathnayake Page no 53


Object Oriented Programming
HND in Computing and System Development
Test Case ID 05

Test Case Make a successful product selling


Excepted Result Display the message as “Successful Book Registration!”

Actual Result

Figure9.38: Sell Product Form


Status 

Test Case ID 06
Test Case Make a successful checking for current product inventory.
Excepted Result Can be seen the details of Product inventory.
Actual Result

Figure9.39: Product Inventory Form


Status 

Test Case ID 07
Test Case Make a successful checking which products should be ordered
Excepted Result Can be seen the details of Products which should be order.

Actual Result

Figure9.40: Ordering Products Form

Status 

R.M. Sandali Geethma Rathnayake Page no 54


Object Oriented Programming
HND in Computing and System Development
Test Case ID 08
Test Case Make a successful deleting of existing products.
Excepted Result Display the message as “Deleted Successfully”.

Actual Result

Figure9.41: Delete Entry Form


Status 

Test Case ID 09
Test Case Make a successful access for getting help about Zeus Inventory System
Can be seen the html document of support and maintenance about Zeus
Excepted Result
Inventory System

Actual Result

Figure9.42: Help Form

Status 

R.M. Sandali Geethma Rathnayake Page no 55


Object Oriented Programming
HND in Computing and System Development
Test Case ID 10
Test Case When sell product, if there are no products available.
Excepted Result Display the message as “Product is out of stock!”

Actual Result

Figure9.43: Message Box Displays


Status 

Test Case ID 11
Test Case Print product details of relevant day.
Excepted Result Can be seen the Print Preview of product details.

Actual Result

Figure9.44: Print Preview of Products Details


Status 

R.M. Sandali Geethma Rathnayake Page no 56


Object Oriented Programming
HND in Computing and System Development
TASK 10

Get independent feedback on your solution (use surveys, questioners,


interviews or any other feedback collecting method) and suggest
recommendations and improvements.
Interview Questions

1) What do you think about the speed and efficiency of Zeus Inventory Control
System?

Feedbacks from different users

i. Zeus inventory management system makes everything from inputting information to


taking inventory easier.
ii. Doing a hand count of inventory can take days, but with a computerized inventory
management system, the same process can be done in a matter of hours.
iii. The operator can also use the inventory management system to order products
automatically when they run low.

2) Do you think if this system is user friendly?

Feedbacks from different users

i. Most of the users decision is this system is very user friendliness and easy to handle.

3) What do you think about the time efficiency of Zeus Inventory Control System?

Feedbacks from different users

i. With this inventory management system, the user can pull a report instantly and see
how many units are on the floor, how many have sold and which products are selling
the fastest.

4) What do you think about the security level of Zeus Inventory Control System?

R.M. Sandali Geethma Rathnayake Page no 57


Object Oriented Programming
HND in Computing and System Development
Feedbacks from different users

i. The Zeus inventory management system will ask username and password when log
into the system.
ii. User Login is a kind of a security level that unauthorized users cannot access and
control the system.

5) What do you think about the document generation from Zeus Inventory Control
System?
Feedbacks from different users

i. Users can access to generate some kinds of documents such as current product
inventory.

6) Do you agree if some kind of failure such as system failure will affect to Zeus
Inventory System?
Feedbacks from different users

i. Outside factors like a power failure or the loss of Internet or network connectivity can
render the system temporarily useless.

7) Do you imagine that Zeus Inventory System will be affect from some risks?
Feedbacks from different users

i. Dishonest employees could hack the system to check the system, change the some
details of products and delete products from the system.

8) Are there any improvement of this system should be done in further?


Feedbacks from different users

i. The idea of most of users say to implement the user mistake validation mechanism
should improve to this system.

R.M. Sandali Geethma Rathnayake Page no 58


Object Oriented Programming
HND in Computing and System Development
9) Can you easily store and retrieve data?

Feedbacks from different users

i. Most of users agreed with that.


ii. Most of users like the way of data handling in this system.

10) Do you satisfy with Zeus Inventory Control system?

Feedbacks from different users

i. 90percentagesof users are more satisfied with this system.

Final Recommendations and suggestions

1. No need to separate interfaces to add product, update product and delete product.
It can handle in one interface instead of three interfaces
2. Need more validations.

R.M. Sandali Geethma Rathnayake Page no 59


Object Oriented Programming
HND in Computing and System Development
TASK 11
Explain and prove user friendliness of your solution.
A product that is difficult to figure out, inefficient to use, or poorly supported is not going to
win much of a user friendly. User friendly is a term used frequently when talking about
software. It tells you not only how easy or awkward the software might be to operate, but also
about the vendor and their care in developing the product.

Proper training can make unfriendly more friendly. The difference between friendly and
unfriendly can also depend on attitude on the part of the user as well as the quality, conditions
and appearance of the software. Here are some characteristics of user friendly software and I
have explained and proved hose characteristics with Zeus Inventory Control System whether
I have achieved the goal or not

1. Simple to install

This applies to everything from operating systems to browser plug-ins. Installation is the first
point of contact for users, so it had better be a friendly process. Otherwise, they are going to
be fed-up using your tool. It does not matter whether it is an operating system or a single-
client user application, the installation should be simple and well documented.

To install the Zeus Inventory Control System I have chased the software, which calls Install
Shield Limited Edition. First, I downloaded the software and installed then I started to create
a setup wizard in order to install Zeus Inventory Control System.

Figure11.45: Installation Setup

R.M. Sandali Geethma Rathnayake Page no 60


Object Oriented Programming
HND in Computing and System Development
2. Easy to remove

Along with being easy to install and use, a piece of software should be easy to remove.
Without a simple removal process, that software becomes awkward.

Figure11.46: Uninstallation System


3. Clear

Clarity is the most important element of user interface design. Indeed, the whole purpose of
user interface design is to enable people to interact with your system by communicating
meaning and function. If user cannot figure out how your application works, they will get
confused and frustrated.

Figure11.47: Main Window

R.M. Sandali Geethma Rathnayake Page no 61


Object Oriented Programming
HND in Computing and System Development
4. Concise

Clarity in a user interface is great; however, I should be careful not to fall into the trap of
over-clarifying. It is easy to add definitions and explanations, but every time I do that, I add
mass. My interface grows. Add too many explanations and users will have to spend too much
time reading them. So keep things clear but also keep things concise is good user-friendly
thing.

Figure11.48: Concise Functions


5. Responsive

Responsive means a couple of things. Firstly, responsive means fast. Waiting for things to
load and using awkward and slow interfaces is frustrating. Seeing things load quickly, or at
the very least, an interface that loads quickly improves the user experience.

Responsive also means the interface provides some form of feedback. The interface should
talk back to the user to inform them about what is happening.

Figure11.49: Error Message Response


R.M. Sandali Geethma Rathnayake Page no 62
Object Oriented Programming
HND in Computing and System Development
6. Consistent

Consistent interfaces allow users to develop usage patterns; they will learn what the different
buttons, tabs, icons and other interface elements look like and will recognize them and realize
what they do in different contexts. They will also learn how certain things work, and will be
able to work out how to operate new features quicker, extrapolating from those previous
experiences.

Figure11.50: Show Details

Figure11.51: Print Details in Print Preview

R.M. Sandali Geethma Rathnayake Page no 63


Object Oriented Programming
HND in Computing and System Development
7. Attractive

Attractive in a sense that makes the use of that interface enjoyable. Yes, I can make your UI
simple, easy to use, efficient and responsive, and it will do its job well. When your software
is pleasant to use, users will not simply be using it; user will look forward to using it.

Figure11.52: Pleasant User Interface

8. Number of clicks

How many mouse clicks need to see all relevant data information screens, for say part
information? It is nice to have lots of detail to look at but only if it useful to user’s operation.

In the main window of the system, I have created menu items to access different functions.
When using this form, in order to access the menu bar, user has to press “Alt” on keyboard
and press “Enter” to access. As well as to move left or right menu items user can press left
and right arrow keys on keyboard. Therefore, here is no point to use the mouse.

Figure11.53: Selecting Menu Items

R.M. Sandali Geethma Rathnayake Page no 64


Object Oriented Programming
HND in Computing and System Development
User can select Product ID using “Down Arrow key “at the first time when the form opened
and after selecting the relevant data from drop down box user press “Enter” key to save the
data.

Figure11.54: Select from Drop down List

9. Proofs of Transactions

The Zeus Inventory Control System is an automated system. User is enabling to enter data,
update data, check current values and delete data. Somehow if there any function to make
evidence of the daily transactions it means the system is really user friendly because if user
had a mistake the reports or documents can be preview as evidence. Therefore, I created a
print function for report generating.

Figure11.55: Show Inventory

R.M. Sandali Geethma Rathnayake Page no 65


Object Oriented Programming
HND in Computing and System Development
Figure11.56: Print Report in Print Preview

Figure11.57: Printed PDF file

R.M. Sandali Geethma Rathnayake Page no 66


Object Oriented Programming
HND in Computing and System Development
10. User documentation
Prospective buyers often overlook this aspect of the software. Is there comprehensive, easy to
find content that explains how the system works with easy- to-follow examples.

Figure11.58: User Documentation

11. Process flow

Are the menus organized methodically in a way that relates to the way you do things, e.g.
from purchase to sales and orders in process?

Figure11.59: Process Flow

R.M. Sandali Geethma Rathnayake Page no 67


Object Oriented Programming
HND in Computing and System Development
12. Forgiving

Nobody is perfect, and people are bound to make mistakes when using your software. How
well I can handle those mistakes will be an important indicator of your software’s quality. Do
not punish the user and build a forgiving interface to remedy issues that come up.

Figure 11.60: Delete Entry


A forgiving interface is one that can save your users from costly mistakes. For example, if
someone deletes an important piece of information, enters wrong information, can they easily
retrieve it or undo this action?

R.M. Sandali Geethma Rathnayake Page no 68


Object Oriented Programming
HND in Computing and System Development
TASK 12
Prepare the technical documentation for the support and maintenance of
the software

Zeus Inventory Control System Support Guide


In this documentation, I am going to explain how to operate this Zeus Inventory System in
the manner of user friendly to whom going to use this application. In the system, it has main
six functions as following relevant to the Inventory Control.

1. How to Purchase Products


2. How to Update Purchased Products
3. How to Delete Products from Database
4. How to Sell Products
5. How to check Current Inventory
6. How to check Ordering Products

1. How to Purchase Products

In the Purchase Product form, user can add the details of purchased products to the system.
The Product ID will automatically generate to the text field.

Figure 12.61: Purchase Product


Then user can input Product Name, Price and Quantity of purchased products. Next click on
the Add button and message box will display as following. Then user can input Product
Name, Price and Quantity of purchased products.

R.M. Sandali Geethma Rathnayake Page no 69


Object Oriented Programming
HND in Computing and System Development
Figure 12.62: Purchase Product Details
Next click on the Add button and message box will display as following.

Figure 12.63: Data Inserted Successfully Dialog Box for Purchase Product

R.M. Sandali Geethma Rathnayake Page no 70


Object Oriented Programming
HND in Computing and System Development
2. How to Update Purchased Products

If user added wrong product details to the system by mistakenly from the Purchase Product
form, those mistakes can be correct from this Update Purchase Product Details form. To
arrange those mistakes user can select the relevant Product ID from the Drop down List.

Figure 12.64: Update Purchase Details Drop Down List


When user select the Product ID all details relevant to the product will display on the fields as
following.

.
Figure 12.65: Update Purchase Details

R.M. Sandali Geethma Rathnayake Page no 71


Object Oriented Programming
HND in Computing and System Development
The data relevant to the Product ID 6 details are same as the Update Purchase Product Details

.
Figure 12.66: Details from Product Table
Then user can input the correct details and click on Update button. Then updated successfully
message will display.

Figure 12.67: Update Purchase Details Figure 12.68: Updated Successfully Dialog
Box for Update Purchase details

The changes have made inside the database also.

Figure 12.69: Details from Product Table


R.M. Sandali Geethma Rathnayake Page no 72
Object Oriented Programming
HND in Computing and System Development
3. How to Delete Products from Database

If user wants to remove the products, which unwanted can be deleted by using Delete Product
form. As same as above, user can select the relevant Product ID I order to delete and data will
display on the fields.

Figure 12.70: Delete Entry


Then click on the Delete button and it will display the message box as below.

Figure 12.71: Deleted Successfully Dialog Box

R.M. Sandali Geethma Rathnayake Page no 73


Object Oriented Programming
HND in Computing and System Development
This is the data before deleting.

Figure 12.72: Product Table before deleting entry


Here is the data after deleting.

Figure 12.73: Product Table after deleting entry

4. How to Sell Products

When receiving the product invoice from the hospital the user is responsible to sell the
products to the hospital. It means the current inventory will reduce.

According to the invoice from hospital user should insert the data to the form. The current
data automatically generate to the form and user can select the product ID then automatically
Product Name and Price will display. However, user has to input the quantity according to
the invoice but no need to input Total Price.

R.M. Sandali Geethma Rathnayake Page no 74


Object Oriented Programming
HND in Computing and System Development
Figure 12.74: Sell Product
After entering above requirement, click on the Save button then Total Cost field is
automatically filled. In addition, message box will display as below.

Figure 12.75: Updated Successfully Dialog Box for Sell Product


Here is the database before receiving Product Invoice from Hospital.

Figure 12.76: Product Table before deleting entry


R.M. Sandali Geethma Rathnayake Page no 75
Object Oriented Programming
HND in Computing and System Development
After receiving Product Invoice;

Figure 12.77: Product Table after deleting entry


When user tries to select Product ID and if the product is not available in the stock, the
message box will display to inform to the user.

Figure 12.78: Error Message response for Sell Product form

5. How to check Current Inventory

In order to check the Current Inventory of the system user can select the Current Inventory
from the menu bar of main form. This is an important function of an Inventory System.

Figure 12.79: Product Inventory


R.M. Sandali Geethma Rathnayake Page no 76
Object Oriented Programming
HND in Computing and System Development
According to the above-mentioned form, it displays the current date as well as current
inventory of the day. This inventory details are valid only the relevant day. Therefore, there
should be a proper way to proof these details.

Therefore, there is function to print the details then user can make the proofs of the current
inventory. Click on the Print button on the form. Then the details are display on the Print
Preview as below.

Figure 12.80: Print Preview


To take a print screen of this document, click on the Print icon on the upper left corner. Then
the system asks to save the printed contents through a save dialog box. User can input the file
name and select the location to save.

Figure 12.81: Save Dialog Box

R.M. Sandali Geethma Rathnayake Page no 77


Object Oriented Programming
HND in Computing and System Development
The saved printed document is like this as below:

Figure 12.82: PDF file

6. How to check Ordering Products

The user who is operate the Zeus Inventory Control System, is responsible for checking the
products which are out of stock from the inventory. Using this form user is able to view only
the products, which are out of stock.

Figure12.83: Ordering Product


As same as in this form user can print the form contents using print button.

Figure 12.84: Ordering Print Preview

R.M. Sandali Geethma Rathnayake Page no 78


Object Oriented Programming
HND in Computing and System Development
Zeus Inventory Control System Maintenance Guide
1. Review the system requirements
2. How to Install Zeus Inventory Control System
3. How to Uninstall Zeus Inventory Control System
4. How to Upgrade Zeus Inventory Control System

1. Review the system requirements

To develop the Zeus Inventory Control System I chased the software as Visual Studio 2012
Ultimate and system requirements are shown below:

Supported operating systems:

1) Windows 10(x86 and x64)


2) Windows Server 2012 (x64)

Supported architectures:

1) 32-bit (x86)
2) 64-bit (x64)

Hardware requirements:

1) 1.6 GHz or faster processor


2) 1 GB of RAM (1.5 GB if running on a virtual machine)
3) 10 GB of available hard disk space
4) 600 MB of available hard disk space (language pack)
5) 5400 RPM hard drive
6) DirectX 9-capable video card running at 1024 x 768 or higher display resolution

Other Application Software:

1) InstallShield Limited Edition for Visual Studio 2012

R.M. Sandali Geethma Rathnayake Page no 79


Object Oriented Programming
HND in Computing and System Development
2. How to Install Zeus Inventory Control System

For the first time we need to download software, when we click on the "OK" button as in the
below screen.

Figure 12.85: InstallShield


It will open a link to download the InstallShield software. It will look as in the following
image:

Figure 12.86: InstallShield Download

R.M. Sandali Geethma Rathnayake Page no 80


Object Oriented Programming
HND in Computing and System Development
When you click on the Step 2: Go to the Download Web site you will be able to see the
page as in the following image. You just have to download the InstallShield LE software
from this page.

Figure 12.87: InstallShield Download 2


Install it and now open VS2012 and add the InstallShield project to the solution as shown in
following image.

Figure 12.88: Add New Project

R.M. Sandali Geethma Rathnayake Page no 81


Object Oriented Programming
HND in Computing and System Development
In addition, change the project name click OK.

Figure 12.89: InstallShield Setup


After adding the InstallShield Project, you will be able to see this screen:

Figure 12.90: Project Assistant

R.M. Sandali Geethma Rathnayake Page no 82


Object Oriented Programming
HND in Computing and System Development
Then click on Application Information in the bottom of the screen and fill in the information.

Figure 12.91: Application Information


Click on Installation Requirements

Figure 12.92: Installation Requirements


You can use any of these buttons to insert the application output file or necessary files. By
clicking On Add Project Outputs and you can select the options depending on your
requirements.

R.M. Sandali Geethma Rathnayake Page no 83


Object Oriented Programming
HND in Computing and System Development
Figure 12.93: Application Files

Here click on new and select the output file.

Figure 12.94: Application Shortcuts

R.M. Sandali Geethma Rathnayake Page no 84


Object Oriented Programming
HND in Computing and System Development
Click on programFilesFolder => ZEUS PVT LIMITED => My product Name =>select
output file.

Figure 12.95: Browse Destination File Figure 12.96: Browse Destination File 2

Figure 12.97: Browse Destination File 3 Figure 12.98: Browse Destination File 4

Here you can rename the application. If you want to create short cut key on desktop you can
click on check box items.

Figure 12.99: Application Shortcuts 2

R.M. Sandali Geethma Rathnayake Page no 85


Object Oriented Programming
HND in Computing and System Development
Figure 12.100: Application Shortcut 3

If your application requires you to change something in the registry then you can use this
option:

Figure 12.101: Application Registry

Here you can use an option as per your application requirements.

Figure 12.102: Installation Interview

R.M. Sandali Geethma Rathnayake Page no 86


Object Oriented Programming
HND in Computing and System Development
Once you completed the above steps, go to the solution explorer, select the Zeus Inventory
Setup and right click. Then select Install.

Figure 12.103: Install

The setup wizard for Zeus Inventory System will preview as following.

Figure 12.104: Preparing Installation Wizard

Click on next button to continue the installation.

Figure 12.105: Installing Setup


Then click on “I accept the terms in the license agreement” radio button and click next.

R.M. Sandali Geethma Rathnayake Page no 87


Object Oriented Programming
HND in Computing and System Development
Figure 12.106: Accepting License Agreement

Here you have to fill the customer information as following for your system.

Figure 12.107: Provide Customer Information

If you click on Install, the wizard is ready to begin the installation. 12.

Figure 12.108: Installation of program

R.M. Sandali Geethma Rathnayake Page no 88


Object Oriented Programming
HND in Computing and System Development
If Zeus Inventory Setup is successfully installed the wizard will preview as following. Then
click finish button.

Figure 12.109: Installation completed Wizard


You can see the Zeus Inventory System short cut on the desktop as an icon and double
clicking on the icon you can open the Zeus Inventory Control System.

Figure 12.110: Desktop shortcut


Once, the setup installed and configured, Zeus Inventory Control System is functional.

R.M. Sandali Geethma Rathnayake Page no 89


Object Oriented Programming
HND in Computing and System Development
3. How to Uninstall Zeus Inventory Control System

As same as installation if you want to uninstall the Zeus Inventory System you can follow
these steps.

Figure 12.111: Uninstallation Application


Then the Zeus Inventory Control System will uninstall and the short cut, which has created
on the desktop, will automatically remove.

4. How to Upgrade Zeus Inventory Control System

After releasing, the earlier version of Zeus Inventory Control System and user want to
upgrade the existing system without manually installing the earlier version and then installing
the current version, use the Upgrade Path.

1. Go to the Solution Explorer and under the Zeus Inventory Setup.


2. Double click on the Organize your setup.
3. Then double click on the Upgrade Path.
4. To add an upgrade entry, right click on the Upgrade path.
5. Select New Upgrade Path

R.M. Sandali Geethma Rathnayake Page no 90


Object Oriented Programming
HND in Computing and System Development
Figure 12.112: Upgrade System
Then open the Zeus_Inventory_Setup msi file through the dialog box window.

Figure 12.113: Upgrade System 2


The upgrading of the system is completed.

Figure 12.114: Upgrade System 3

R.M. Sandali Geethma Rathnayake Page no 91


Object Oriented Programming
HND in Computing and System Development
Conclusion
Zeus Pvt Limited is a Small Medium Enterprise, which renounce for importing a very rare
“Power™” branded nutrition supplements for patients who are suffering from Diabetes in Sri
Lanka. For the completion of this assignment, I have created a transaction processing system
for Zeus Pvt Ltd.

Firstly, I have described the characteristics and principles of Object Oriented Programming
providedexample coding on how these characteristics couldapply in the required system.
Next, I have been identifiedthe objects (Classes) according to the scenario and listed all
theirattributes and methods.After identifying the objects, I have drawnthe use case diagram,
class diagram and sequence diagram for Zeus Pvt Limited to create better and effective
system solution for anInventory System.

Next, I have proposed and designedan effective Inventory system for Zeus Pvt Limited
considering all functions should perform through the system by aid of the Object Oriented
solution using C#.Net. Then, I have provided the evidences of use of association,
aggregation, composition and generalization relationships from Inventory System of Zeus Pvt
Limited. Next, I explained how the concept of polymorphism used in Inventory System and
about control structures and how those effectively have used in Inventory System.

To design this system, I have chosen C#.Net as Object Oriented Programming and discussed
the advantages of using Integrated Development Environment when developing the system.

Next, I prepared a test plan for Inventory System of Zeus Pvt Limited, and next, I critically
reviewed and testedInventory System according to the plan. A well as, I have analyzedthe
actual test results against the expected results and there are no any inconsistencies in
Inventory System.

After completing the Test Plan, I gathered the independent feedbacks from different
interviewing some questionsas a feedback collecting methodand I was able to get more
recommendations and improvements about Inventory System.

Next, I explained and proved the user friendliness of Inventory System for Zeus Pvt Limited.
Finally, I prepareda technical documentation for the supporting and maintenance of the
Inventory System including an installation and maintenance guide.

R.M. Sandali Geethma Rathnayake Page no 92


Object Oriented Programming
HND in Computing and System Development
Self-Evaluation
1. Goals
According to the assignment brief, as an Object Oriented Programmer, I have to propose and
design an inventory system an organization.

I have to select the Visual Studio 2012 to create the system.

2. Benefits
I got many benefits while doing this assignment. I have learned how to gather data for an
assignment, how to get help from the lecturers, how to write relevant contents according to
the tasks.

In addition, I have got the knowledge how to create an Inventory Processing System and its
functions.

3. An assignment within the timeline

To do the assignment within the timeline, I had to plan whole assignment and had to allocate
durations for every work. Sometime allocated time were not enough to do some work, so I
had to spend more time to complete the assignment before the deadline.

5. Protecting the quality

I tried to protect the quality of my assignment when I was completing. Therefore, I had to
edit assignment contents, page layouts several times.

R.M. Sandali Geethma Rathnayake Page no 93


Object Oriented Programming
HND in Computing and System Development
Gantt chart

R.M. Sandali Geethma Rathnayake Page no 94


Object Oriented Programming
HND in Computing and System Development
References
Agrahari, M. (2013).Introduction to Object Oriented Programming Concepts in C#. (Online)
Available at: http://www.c-sharpcorner.com/UploadFile/mkagrahari/introduction-to-object-
oriented-programming-concepts-in-C-Sharp/[Accessed29thFebruary 2016]

Modi, M. (2014). Top 10 OOPS Concepts In C# .NET With Examples. (Online) Available
at:http://www.aspneto.com/oop-concepts-object-oriented-programming-concepts-with-
examples.html [Accessed 29thFebruary2016]

Nirosh. (2015). Introduction to Object Oriented Programming Concepts (OOP) and More.
(Online) Available at:http://www.codeproject.com/Articles/22769/Introduction-to-Object-
Oriented-Programming-Concep [Accessed 29thFebruary2016]

Chauhan, S. (2011) Object-Oriented Programming Concepts. (Online) Available


at:http://www.dotnet-tricks.com/Tutorial/oops/HQJI280212-Object-Oriented-Programming-
Concepts.html [Accessed 1stMarch 2016]

Trivedi, J. (2014). Association, Aggregation and Composition.(Online) Available


at:http://www.c-sharpcorner.com/UploadFile/ff2f08/association-aggregation-and-
composition/ [Accessed 2ndMarch2016]

Singh, J. (2015).Dependency, Generalization, Association, Aggregation, Composition in


Object Oriented Programming.(Online) Available at:http://www.c-
sharpcorner.com/UploadFile/b1df45/dependency-generalization-association-aggregation-
compos/ [Accessed 2ndMarch2016]

Stackoverflow. (2016).C# code for association, aggregation, composition. (Online) Available


at: http://stackoverflow.com/questions/12604031/c-sharp-code-for-association-aggregation-
composition [Accessed 2ndMarch2016]

Chauhan, S. (2015).Understanding Association, Aggregation, Composition and


Dependency relationship.(Online) Available at:http://www.dotnet-
tricks.com/Tutorial/oops/T0Lb270813-Understanding-Association,-Aggregation,-
Composition-and-Dependency-relationship.html [Accessed 3rdMarch2016]

R.M. Sandali Geethma Rathnayake Page no 95


Object Oriented Programming
HND in Computing and System Development
Lucidchart. (2016).Sequence Diagram for Inventory Management System(UML). (Online)
Available at:https://www.lucidchart.com/pages/sequence-diagram-for-inventory-
management-system-UML [Accessed 4thMarch2016]

Uml-diagrams. (2016).UML Diagrams Examples. (Online) Available at:http://www.uml-


diagrams.org/index-examples.html [Accessed 4thMarch2016]
Msdn.(2016).Polymorphism (C# Programming Guide).(Online) Available
at:https://msdn.microsoft.com/en-us/library/ms173152.aspx [Accessed 4thMarch2016]

Csharp-station. (2016).Lesson 3: Control Statements – Selection. (Online) Available


at:http://csharp-station.com/Tutorial/CSharp/Lesson03 [Accessed 6thMarch2016]

Moosad, P.(2015).Control Statements in C#.(Online) Available at:http://www.c-


sharpcorner.com/uploadfile/prvn_131971/control-statements-in-C-Sharp/ [Accessed
6thMarch2016]

Searchsoftwarequality.(2016). Visual Studio IDE offers many advantages for developers.(Online)


Available at:http://searchsoftwarequality.techtarget.com/feature/Visual-Studio-IDE-offers-
many-advantages-for-developers [Accessed 8thMarch2016]

Cybrary. (2016). Advantages of the Integrated Development Environment. (Online)Available


at: https://www.cybrary.it/study-guides/cisa/advantages-of-the-integrated-development-
environment/ [Accessed 8thMarch2016]

Lambert, S. (2012). Quick Tip: The OOP Principle of Encapsulation (Online) Available at:
http://gamedevelopment.tutsplus.com/tutorials/quick-tip-the-oop-principle-of-encapsulation--
gamedev-2187. [Accessed 10thMarch2016]

Dogi, G. (2013). Abstraction in C# using an example.(Online) Available at:


http://www.onlinebuff.com/article_oops-principle-abstraction-in-c-with-an-example-and-
explanation_5.html. [Accessed 12thMarch2016]

Rouse, M. (2015). Object-oriented programming. (Online) Available at:


http://searchsoa.techtarget.com/definition/object-oriented-programming. [Accessed
15thMarch2016]

R.M. Sandali Geethma Rathnayake Page no 96


Object Oriented Programming
HND in Computing and System Development
Williams,F. (2015). What is Polymorphism?(Online) Available at:
https://www.fayewilliams.com/2011/07/27/what-is-polymorphism/. [Accessed
15thMarch2016]

Yaiser,M. (2015). Object-oriented programming concepts.(Online) Available at:


http://www.adobe.com/devnet/actionscript/learning/oop-concepts/encapsulation.html.
[Accessed 15th March 2016]

Lambert, S. (2012). Quick Tip: The OOP Principle of Encapsulation.(Online) Available at:
http://gamedevelopment.tutsplus.com/tutorials/quick-tip-the-oop-principle-of-encapsulation--
gamedev-2187. [Accessed 16thMarch2016]

Stack exchange inc. (2015). What is polymorphism, what is it for, and how is it used?(Online)
Available at: http://stackoverflow.com/questions/1031273/what-is-polymorphism-what-is-it-
for-and-how-is-it-used. [Accessed 16thMarch2016]

TechTarget. (2015). polymorphism.(Online) Available at:


http://whatis.techtarget.com/definition/polymorphism. [Accessed 16thMarch 2016]

Tutorialspoint. (2015). C#.(Online) Available at:


http://www.tutorialspoint.com/csharp/csharp_polymorphism.htm. [Accessed 16thMarch2016]

R.M. Sandali Geethma Rathnayake Page no 97


Object Oriented Programming
HND in Computing and System Development

Вам также может понравиться