Click here to Skip to main content
15,843,727 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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?
Posted
Updated 27-May-11 17:11pm
v2
Comments
CS2011 27-May-11 6:27am    
As john said you should try and do it by your self and there are a lot of videos on net which will tell you where to start. now if you are stuck somewhere after you have tried then come back here. we will be happy to help you then for now all i can say is use google

If you're using a visual IDE (e.g. Visual Studio or SharpDevelop), constructing UIs is not difficult. You aren't going to get someone to just do it for you, and nor should you, since you are a student and you are supposed to be learning how to do it yourself.

All you have provided here are data classes, there is no functionality or business logic here, so to state that you've 'finished the source code' is incorrect in quite a major way. Everything you put in your comment needs to be written, as well (much of it in event handlers on your form).

In classic 3-tier terms you have 'solved' one third of the problem: the data structure. (You didn't really solve it, it was given to you in the problem, you just coded it.) The other two parts – business logic and UI – are also part of the exercise.

A couple of minor points about your coding style: in C#, method and class names are traditionally started with an upper case letter (abstract class Emp); and you shouldn't be using ArrayList, unless you are restricted to .Net 1.1, you should be using the generic List<T> (i.e. a List<Customer> for your customer list, etc).
 
Share this answer
 
v2
Guys,
First of all, I'm using visual C# 2008

One thing, important thing to be presice...I don't know how to work with forms!
that's the problem, and I gotta finish this program before the deadline, or I'd better be erasing this subject.

the codes above proves that I can write, but only a console application..

please guys please help me, I have no idea what should I do.

all I know is the drag and drop thing....the problem is, I don't really know what code should I write when I double click on a THING!

I just can design a form, with tabs, buttons; but don't have an idea about what to write in them...

I was absent due to problems, then I found the assignment on the web...

dear MR.BobJanova, you seem a helpful person, but can't you put some helpful internal/external links so I can get an idea of what should I really work. I really got touched of what you said...and yeah, I really felt that writing classes wont be helpful to the program...but my friends told me "that's the rules obey it" and so do for the arraylist thing....but I dont mind learning the generic list, It might be more useful...

I say, I want to learn it the way I want, and I'm starting to like your way; wish you were teaching in our university. If you teach in our university, you will make hundreds of students like me graduate as real programmers, and negate dozens of other people from changing their major. ^_^

could you leave me your email, so I can contact you?
I don't know how I can thank you for your help and your effort.
Thanks Again
 
Share this answer
 
Comments
yesotaso 27-May-11 19:36pm    
Take a look at "http://www.homeandlearn.co.uk/csharp/csharp_s1p5.html" it might feel like "Submarine Operation Manual For Complete ..iots" if you have absolutely no C# Windows Forms it might give you a start. The rest depends on how you use "Properties" window and google :) oh I almost forgot holy "F1" key.
Nobody here is going to to your homework for you. It's not because we feel like we're superior or elite or anything like that, but because YOU won't learn anything if we do it for you. It seems to me that the hard part of your project is done - you've implemented your data layer, and you've identified what the interface needs to do. Go forth, and code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900