Click here to Skip to main content
15,889,899 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Connecting Sql Server Pin
vijaylumar29-Sep-10 21:17
vijaylumar29-Sep-10 21:17 
GeneralRe: Connecting Sql Server Pin
SeMartens29-Sep-10 21:23
SeMartens29-Sep-10 21:23 
GeneralRe: Connecting Sql Server Pin
vijaylumar29-Sep-10 22:01
vijaylumar29-Sep-10 22:01 
GeneralRe: Connecting Sql Server Pin
SeMartens29-Sep-10 22:18
SeMartens29-Sep-10 22:18 
AnswerRe: Connecting Sql Server Pin
Gamzun2-Oct-10 1:12
Gamzun2-Oct-10 1:12 
GeneralRe: Connecting Sql Server Pin
vijaylumar2-Oct-10 1:43
vijaylumar2-Oct-10 1:43 
GeneralRe: Connecting Sql Server Pin
Gamzun3-Oct-10 10:20
Gamzun3-Oct-10 10:20 
QuestionInheritance Pin
future383929-Sep-10 4:09
future383929-Sep-10 4:09 
Hello,I have a case scenario and will appreciate if some one help me.
1) I have small Inn which has a series room and people. the owner need people from Korea insert their specific details.

I define the classes as below:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.ComponentModel;

namespace DuryHouse.Repository.BusinessLayer
{
    public class Room
    {
        public int _id = -1;
        public int _bed = -1;
        public int _floor = -1;
        public string _roomName = string.Empty;
        public string _type = string.Empty;

        [DataObjectFieldAttribute(true, true, false)]
        public int Id
        {
            set { _id = value; }
            get { return _id; }
        }

        public int Bed
        {
            set { _bed = value;
            if (value > 10)
            { throw new ArgumentException(string.Format("Maximum bed is 10!!!")); }
            }
            get { return _bed; }
        }

        public int Floor
        {
            set { _floor = value; }
            get { return _floor; }
        }

        public string RoomName
        {
            set { _roomName = value; }
            get { return _roomName; }
        }

        public string Type
        {
            set { _type = value; }
            get { return _typeass; }
        }

        public Room(int id, int bed, int floor, string roomName, string type)
        {
            this._id = id;
            this._bed = bed;
            this._floor = floor;
            this._roomName = roomName;
            this._type = type;
        }


    }
}


next class is for people
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.ComponentModel;

namespace DuryHouse.Repository.BusinessLayer
{
    public class People
    {
        protected int _id = -1;
        protected string _name = string.Empty;
        protected string _passportNumber = string.Empty;
        protected string _naionality = string.Empty;


        [DataObjectFieldAttribute(true, true, false)]
        public int Id
        {
            set { _id = value; }
            get { return _id; }
        }

        public int Name
        {
            set { _name = value; }
            get { return _name; }
        }

        public int PassportNumber
        {
            set { _passportNumber = value; }
            get { return _passportNumber; }
        }

        public int Nationality
        {
            set { _naionality = value; }
            get { return _naionality; }
        }



        public People(int id, string name, string passportNumber, string nationality)
        {
            this._id = id;
            this._name = name;
            this._passportNumber = passportNumber;
            this._naionality = nationality;
        }

        public People()
        {
        }

  

    }
}



then I have another class Korea which inherit from People
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace DuryHouse.Repository.BusinessLayer
{
    public class Korea:People
    {
        public string _city = string.Empty;
        public string _state = string.Empty;
        public string _street = string.Empty;
        public string _phone = string.Empty;
        public string _mobile = string.Empty;
        public string _email = string.Empty;


        public string City
        {
            set { _city = value; }
            get { return _city; }
        }
        public string State
        {
            set { _state = value; }
            get { return _state; }
        }
        public string Street
        {
            set { _street = value; }
            get { return _street; }
        }
        public string Phone
        {
            set { _phone = value; }
            get { return _phone; }
        }
        public string Mobile
        {
            set { _mobile = value; }
            get { return _mobile; }
        }
        public string Email
        {
            set { _email = value; }
            get { return _email; }
        }

        public Korea(int id, string name, string passportNumber, string nationality
            , string city, string state, string street, string phone, string mobile, string email) :
            base(id, name, passportNumber, nationality)
        {
            this._city = city;
            this._state = state;
            this._street = street;
            this._phone = phone;
            this._mobile = mobile;
            this._email = email;
        }

    }
}


because of I am practicing on inheritance just wondering to know am I in right track? do I get the meaning? by the way if you have any suggestion or idea regarding Inn please let me know.I know I should define another class checkInOut and transaction.
AnswerRe: Inheritance [Longish Post] Pin
Keith Barrow29-Sep-10 21:48
professionalKeith Barrow29-Sep-10 21:48 
GeneralRe: Inheritance [Longish Post] Pin
future383930-Sep-10 4:19
future383930-Sep-10 4:19 
GeneralRe: Inheritance [Longish Post] Pin
Keith Barrow30-Sep-10 9:39
professionalKeith Barrow30-Sep-10 9:39 
QuestionAsp.net Cross Page Post Back issue Pin
AndieDu28-Sep-10 20:44
AndieDu28-Sep-10 20:44 
AnswerRe: Asp.net Cross Page Post Back issue Pin
Not Active29-Sep-10 2:43
mentorNot Active29-Sep-10 2:43 
GeneralRe: Asp.net Cross Page Post Back issue Pin
AndieDu29-Sep-10 13:36
AndieDu29-Sep-10 13:36 
QuestionWhich approach is faster ? calculate Image size in Server or Client ? Pin
Nadia Monalisa28-Sep-10 19:40
Nadia Monalisa28-Sep-10 19:40 
AnswerRe: Which approach is faster ? calculate Image size in Server or Client ? Pin
vaghelabhavesh29-Sep-10 18:08
vaghelabhavesh29-Sep-10 18:08 
GeneralRe: Which approach is faster ? calculate Image size in Server or Client ? Pin
Nadia Monalisa29-Sep-10 19:05
Nadia Monalisa29-Sep-10 19:05 
QuestionAsynchronous webmethods Pin
david vermeulen28-Sep-10 19:19
david vermeulen28-Sep-10 19:19 
AnswerRe: Asynchronous webmethods Pin
Not Active29-Sep-10 2:51
mentorNot Active29-Sep-10 2:51 
AnswerRe: Asynchronous webmethods Pin
NeverHeardOfMe29-Sep-10 3:54
NeverHeardOfMe29-Sep-10 3:54 
QuestionPost via email Pin
Jassim Rahma28-Sep-10 12:35
Jassim Rahma28-Sep-10 12:35 
QuestionNavigationURL question Pin
Jassim Rahma28-Sep-10 12:26
Jassim Rahma28-Sep-10 12:26 
AnswerRe: NavigationURL question Pin
Not Active28-Sep-10 13:49
mentorNot Active28-Sep-10 13:49 
QuestionExpires question Pin
Jassim Rahma28-Sep-10 10:46
Jassim Rahma28-Sep-10 10:46 
AnswerRe: Expires question Pin
thatraja28-Nov-10 1:24
professionalthatraja28-Nov-10 1:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.