Click here to Skip to main content
15,909,498 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for clsFootballPage
/// </summary>
public class clsFootballPage
{
    //footballteamNo private member variable
    private Int32 footballteamNo;
    //teamName private member variable
    private string teamName;
    //footballLeague private member variable
    private Boolean footballLeague;
    //teamCaptain private member variable
	private string teamCaptain;
    //teamManager private member variable
    private string teamManager;
    //teamTitles private member variable
    private int teamTitles;
    //teamEstablishment private member variable
    private DateTime teamEstablishment;
}

    //FootballTeamNo public property
    public int FootballTeamNo
    {
        get
        {
            return footballteamNo;
        }
        set
        {
            footballteamNo = value;
        }
    }

    //TeamName public property
    public string TeamName
    {
        get
        {
            return teamName;
        }
        set
        {
            teamName = value;
        }
    }

    //FootballLeague public property
    public Boolean FootballLeague
    {
        get
        {
            return footballLeague;
        }
        set
        {
            footballLeague = value;
        }
    }

    //TeamCaptain public property
    public string TeamCaptain
    {
        get
        {
            return teamCaptain;
        }
        set
        {
            teamCaptain = value;
        }
    }

    //TeamManager public property
    public string TeamManager
    {
        get
        {
            return teamManager;
        }
        set
        {
            teamManager = value;
        }
    }

    //TeamTitles public property
    public Int TeamTitles
    {
        get
        {
            return teamTitles;
        }
        set
        {
            teamTitles = value;
        }
    }

    //TeamEstablishment public property
    public DateTime TeamEstablishment
    {
        get
        {
            return teamEstablishment;
        }
        set
        {
            teamEstablishment = value;
        }
    }

        //create an object based on the football page class
        clsFootballPage AFootballTeam = new clsFootballPage();
        //set the Team Establishment property
        AFootballTeam.TeamEstablishment = "Team Establishment";
        //declare a variable to store the Team Establishment
        DateTime TheTeamEstablishment;
        //copy the data from the middle layer to the RAM
        TheTeamEstablishment = AFootballTeam.TeamEstablishment;
Posted
Updated 3-Dec-14 11:27am
v4
Comments
Gomez786 3-Dec-14 17:17pm    
Where would I put it?

AFootballTeam.TeamEstablishment = "Team Establishment";

TeamEstablishment is a DateTime.

C#
    //teamEstablishment private member variable
    private DateTime teamEstablishment;
}  <== This semi-colon looks out of place.
 
    //FootballTeamNo public property
 
Share this answer
 
I am not sure exactly what you are trying to do but this gives no errors. I repositioned some brace characters, changed DateTime to string in a couple of places to ensure consistency and separated the code that instantiated clsFootballPage into a separate class. A separate class because I didn't think you wanted to instantiate clsFootballPage within itself.

CSS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
public class clsFootballPage
{
    //footballteamNo private member variable
    private Int32 footballteamNo;
    //teamName private member variable
    private string teamName;
    //footballLeague private member variable
    private Boolean footballLeague;
    //teamCaptain private member variable
    private string teamCaptain;
    //teamManager private member variable
    private string teamManager;
    //teamTitles private member variable
    private int teamTitles;
    //teamEstablishment private member variable
    private string teamEstablishment;


    //FootballTeamNo public property
    public int FootballTeamNo
    {
        get
        {
            return footballteamNo;
        }
        set
        {
            footballteamNo = value;
        }
    }

    //TeamName public property
    public string TeamName
    {
        get
        {
            return teamName;
        }
        set
        {
            teamName = value;
        }
    }

    //FootballLeague public property
    public Boolean FootballLeague
    {
        get
        {
            return footballLeague;
        }
        set
        {
            footballLeague = value;
        }
    }

    //TeamCaptain public property
    public string TeamCaptain
    {
        get
        {
            return teamCaptain;
        }
        set
        {
            teamCaptain = value;
        }
    }

    //TeamManager public property
    public string TeamManager
    {
        get
        {
            return teamManager;
        }
        set
        {
            teamManager = value;
        }
    }

    //TeamTitles public property
    public int TeamTitles
    {
        get
        {
            return teamTitles;
        }
        set
        {
            teamTitles = value;
        }
    }

    //TeamEstablishment public property
    public string TeamEstablishment
    {
        get
        {
            return teamEstablishment;
        }
        set
        {
            teamEstablishment = value;
        }
    }
} // end Class

class SomePartOfTheProgram
{

     void SomethingToDo()
        {
        //create an object based on the football page class
        clsFootballPage AFootballTeam = new clsFootballPage();
        //set the Team Establishment property
        AFootballTeam.TeamEstablishment = "Team Establishment";
        //declare a variable to store the Team Establishment
        string TheTeamEstablishment;
        //copy the data from the middle layer to the RAM
        TheTeamEstablishment = AFootballTeam.TeamEstablishment;
        }

} //end Class

} //end NameSpace
 
Share this answer
 
v2
Comments
Gomez786 4-Dec-14 17:13pm    
OMG! Thank you! It was something so simple :)))))))))))))))))))))))))))))))))))))))))))) Much appreciated!

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