Hey Everyone,
I'm a student and I've got quite good experience so far in the console application.
the problem is, I'm weak, very weak in windows application in return, sothat I need your help in this program.
I've finished writing the source code, <b>the only thing left is the forms and making a link between forms and the source code</b> (That's The Big Problem I'm Facing!)
so, If you agree to help me, continue reading please:
program Details:
<pre> /*
*write a computer company program that includes:
*customer, emp (for employee), product, & order.
*I've written the source code, but still I'm not sure If it's right or wrong
*I only need ONE Single form, with a tab pages inside, so it will be easy no navigate!
*the 1st tab is a " home" tab, it's gonna ask the user whether to go to the "customer" area <tab 2> or to the employee area <tab 3>
*the 2nd tab is the "customer" tab
*customer has name & password for registering, name and password to sign in, and a hidden list box
*when the customer presses "sign up", name and password will be saved in the list box.
*when the customer wants to press "sign in", a search method will be used in the list box, and if "not found" a message box
*will pop up saying "wrong username or password" and if "found" then, the "product" tab will open.
*the employee area <tab 3> has the same as the customer area <two username, password areas & a hidden list box, so the info of the employees will be safe and unseen.
*once the employee press "sign in", other tab, called order <tab 4> is gonna open up showing the pending products.
*it's gonna have the customer's name, the product's name (in a list box, i guess) and there are two radio buttons, one is checked to calculate the total, then when the "OK" is pressed a message box
*pops up telling the customer's name, employee's name, product's name, and of course the total.
*the other radio box is "make a [empty textbox] % sale " the employee enters the value in the textbox, and when pressed "ok" it'll print as the step before but "the price after sale" is going to be added.
*the last remaining tab is the product tab....if the employee is signed up, then he can add new products or delete them <as he wants>.
*when the customer is signed in, he can browse the products, choose, and press buy....then a recipt (with info of the customer and the product) will be headed to the order tab awaiting the employee to check them.
*whether the employee chooes the total or make some % sale, after pressing "ok " button and after showing the message box, the info about customer, product, should be gone (as they were finally checked and completely bought from the store)
* hope I gave you enough information about this issue...now I'll leave you to my code I've created.
*/
computer.cs
static class computer
{
public static ArrayList custmer = new ArrayList();
public static ArrayList emp = new ArrayList();
public static ArrayList order = new ArrayList();
public static ArrayList product = new ArrayList();
}
custmer.cs
class custmer
{
private int id;
public string fname;
public string lname;
public DateTime fbdate;
public DateTime lbdate;
public int totalprice;
public int Id
{
get
{
return id;
}
set
{
id = value;
}
}
public custumer(int i, string fn, string ln, DateTime fd, DateTime ld, int tt)
{
id = i;
fname = fn;
lname = ln;
fbdate = fd;
lbdate = ld;
totalprice = tt;
}
public int period()
{
return lbdate.Year - fbdate.Year;
}
}
emp.cs
abstract class emp
{
private int id;
public string fname;
public string lastname;
public DateTime joindate;
public int salary;
public int Id
{
get
{
return id;
}
set
{
id = value;
}
}
public emp(int i, string l, string f, DateTime b, int a)
{
id = i;
fname = f;
lastname = l;
joindate = b;
salary = a;
}
public int workingperiod()
{
return DateTime.Now.Year - joindate.Year;
}
}
saler.cs
class saler : emp
{
private int reqamount;
public int Reqamount
{
get
{
return reqamount;
}
set
{
reqamount = value;
}
}
public saler(int i, string l, string f, DateTime b, int a, int r)
: base(i, l, f, b, a)
{
reqamount = r;
}
public int saling()
{
return reqamount = +reqamount;
}
}
product.cs
abstract class product
{
public static ArrayList desktop = new ArrayList();
public static ArrayList laptop = new ArrayList();
private int id;
public string name;
public int count;
public int price;
public int Id
{
get
{
return id;
}
set
{
id = value;
}
}
public product(int y, string x, int c, int p)
{
id = y;
name = x;
count = c;
price = p;
}
public int discount()
{
return price - price * 10 / 100;
}
public static void Add(desktop x)
{
desktop.Add(x);
}
public static void Delete(int i)
{
desktop.RemoveAt(i);
}
public static void Add(laptop y)
{
laptop.Add(y);
}
}
desktop.cs
class desktop : product
{
private string casetype;
public int cable;
public string Casetype
{
get
{
return casetype;
}
set
{
casetype = value;
}
}
public desktop(int y, string x, int c, int p, string g, int t)
: base(y, x, c, p)
{
casetype = g;
cable = t;
}
public int dis()
{
return price - 1000;
}
public string id { get; set; }
}
laptop.cs
class laptop : product
{
private int weight;
public int batlife;
public int Weight
{
get
{
return weight;
}
set
{
weight = value;
}
}
public laptop(int y, string x, int c, int p, int w, int r)
: base(y, x, c, p)
{
weight = w;
batlife = r;
}
public int morebat()
{
return batlife + 1;
}
}
order.cs
class order
{
public int id;
public int id_emp;
public int id_period;
public int countt;
private DateTime date;
public DateTime Date
{
get
{
return date;
}
set
{
date = value;
}
}
public order(int dd, int de, int dp, int ctt, DateTime da)
{
id = dd;
id_emp = de;
id_period = dp;
countt = ctt;
Date = da;
}
}
well, that's what I could write, could anyone just make the forms and link them to the code?