Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 5th, 2004, 11:43 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

maybe in my code there are some public variable you should convert them to Properties but for simplicity I don't do that....

--------------------------------------------
Mehdi.:)
 
Old August 5th, 2004, 12:54 PM
Authorized User
 
Join Date: Jul 2004
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for precious time spending with me. u know c means it beneficial to me
I don't know C#.

But my specialisation will be in .Net
so it is more useful to me.

Also say to me what is the difference btwn C & C#.

I want to know it is possible to do this program i.e "Library management system"
in C.

 
Old August 5th, 2004, 12:56 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

wait another hour!!!

--------------------------------------------
Mehdi.:)
 
Old August 5th, 2004, 12:58 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

realy there is no difference but C# is easier.


--------------------------------------------
Mehdi.:)
 
Old August 5th, 2004, 01:04 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

even I don't use properties,like C

--------------------------------------------
Mehdi.:)
 
Old August 5th, 2004, 01:32 PM
Authorized User
 
Join Date: Jul 2004
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mehdi can u say what is the time Iran

No problem take ur own time to do this

But in c# can we store the data in database

 
Old August 5th, 2004, 01:32 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

before you go to sleep..it's better I tell you something
first I think we need here three base classes for Users,Books,managing the libraray
here this is the firs class(it's not complete)....
Have a look at it anyway...
=============================================
    public class User
    {
        private int userID;
        private string firstname;
        private string lastname;
        private string phonenumber;
        private string address;
        private DateTime DateUserBorrowed;//the date user borrows the book
        private DateTime DateUserBrought;//the date user brings back the book
        public Book TheLastBook;//current book or the last book the user has borrowed
        public static int count;
        public int a;
        private Stack ListOfBooksBorrowed=new Stack();//this stack shows all books this user borrowed
        public User()
        {
        }
        public User(int UserID,string FirstName,string LastName,string PhoneNumber,string Address)
        {
            this.userID=UserID;
            this.firstname=FirstName;
            this.lastname=LastName;
            this.phonenumber=PhoneNumber;
            this.address=Address;
            count++;//a static vaiable when evry instances created increases one unit
        }
        public int GetUserID()
        {
            return this.userID;
        }
        public string GetFirstName()
        {
            return this.firstname;
        }
        public string GetLastName()
        {
            return this.lastname;
        }
        public string GetPhoneNumber()
        {
            return this.phonenumber;
        }
        public string GetAddress()
        {
            return this.address;
        }
        public void PrintProperties()
        {
            //this prints all the fields on screen
        }
        public DateTime GetDateUserBorrowed()
        {
            return this.DateUserBorrowed;
        }
        public DateTime GetDateUserBrought()
        {
            return this.DateUserBrought;
        }
        public void SetDateUserBorrowed(int year,int month,int day)
        {
            this.DateUserBorrowed=new DateTime(year,month,day);
        }
        public void SetDateUserBrought(int year,int month,int day)
        {
            this.DateUserBrought=new DateTime(year,month,day);
        }
        public bool HasBorrowedAnyBook()
        {
            bool result=true;
            if(TheLastBook==null) result=false;
            return result;
        }
        public int fine()
        {
            DateTime now=DateTime.Now;
            if(!this.HasBorrowedAnyBook())return 0;//not complete
        }

    }
=====================================

any better opinion greatly appreciated

--------------------------------------------
Mehdi.:)
 
Old August 5th, 2004, 01:37 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

in Iran time is 11:20 PM


--------------------------------------------
Mehdi.:)
 
Old August 5th, 2004, 01:52 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

ask your questions....

--------------------------------------------
Mehdi.:)
 
Old August 5th, 2004, 02:12 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

I will go it on tomorrow about 7:30 PM(GMT)

--------------------------------------------
Mehdi.:)









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.