Esempio n. 1
0
 public clsTeams(clsCountry country, List <clsPlayer> players, int captainId, int viceCaptainId, int wicketKeeperId)
 {
     _country        = country;
     _players        = players;
     _captainId      = captainId;
     _viceCaptainId  = viceCaptainId;
     _wicketKeeperId = wicketKeeperId;
 }
Esempio n. 2
0
        /// <summary>
        /// Insert a country in to the database anr returns the affected row count (which should be one if successfully inserted.
        /// </summary>
        /// <param name="country"></param>
        /// <returns></returns>
        internal static int addCountry(clsCountry country)
        {
            SqlCeCommand com = new SqlCeCommand("INSERT INTO tblCountry VALUES(@p1,@p2)", connection.CON);

            com.Parameters.AddWithValue("@p1", country.countryId);
            com.Parameters.AddWithValue("@p2", country.countryName);
            try
            {
                return(com.ExecuteNonQuery());
            }
            catch (Exception e)
            {
                clsMessages.showMessage(clsMessages.msgType.error, e.Message);
            }
            return(0);
        }
Esempio n. 3
0
        internal static clsCountry getCountry(string countryName)
        {
            clsCountry   country;
            int          code = 0;
            SqlCeCommand com  = new SqlCeCommand("SELECT countryId FROM tblCountry WHERE CountryName=@p1", connection.CON);

            com.Parameters.AddWithValue("@p1", countryName);
            try
            {
                int.TryParse(com.ExecuteScalar().ToString(), out code);
            }
            catch (NullReferenceException)
            {
            }
            //com.Dispose();
            country = new clsCountry(code, countryName);
            return(country);
        }
Esempio n. 4
0
        public clsMatch(int matchid, string mName, clsMatchTypes type, DateTime mDate, string mPath, clsCountry country, clsGround ground, List <clsTeams> squad, string tossWon, string firstBat)
        {
            matchID   = matchid;
            matchName = mName;
            matchType = type;
            matchDate = mDate;

            savePath       = mPath;
            countryPlayed  = country;
            groundPlayed   = ground;
            currentSquards = squad;

            tossWonBy    = tossWon;
            firstBatting = firstBat;

            team1 = squad[0];
            team2 = squad[1];

            //currentMatch = this;
            currentMatch = this;
        }