

























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


























































































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();}}
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();}}
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(); }
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){
Code Public class Taxi{ Public bool isInitialized; public Taxi();{ isInitialized = true; }} class TestTaxi{ static void Main(){ Taxi t = new Taxi(); Console.WriteLine(t.isInitialized);}}
Code ~MyClass() { //Cleaning up code goes here }
Code Public class Employee { Public String name; Private double salary; public Employee(String empName) { name = empName; } public voi setSalary(double empSal) { salary = empSal; }
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);}}
Zeus Pvt Limited Hospital Company Name : varchar Address : varchar Name : varchar Address : varchar Import(numberOfItems ) : int Deliver() : int Make_Order() : int Send_Order() : int Inventory Registry Zeus Office Product_ID : int Product_Name : varchar Name : varchar Location : varchar Balance_Invenory() : int Update_Inventory() : int Collect_purchasedOrder() : varchar Send_purchasedOrder() : varchar Zeus Warehouse Issue Officer Name : varchar Location : varchar Emp_ID : int Name : varchar Collect_Invoice() : varchar Issue_Product() : varchar Update_Inventory() : varchar Issue_Products() : varchar Sales Officer Emp_ID : int Name : varchar Send_Order() : varchar Make_Order(): varchar
Sequence diagram
Login Form Interface
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(); } }
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(); }
Purchase Product Interface
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); }
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;}}}
Update Product Interface
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