Exemplo n.º 1
0
        internal static int udpdateMatchType(clsMatchTypes matchtype)
        {
            int result = 0;

            SqlCeCommand com = new SqlCeCommand("UPDATE tblmatchType set Name=@p2 WHERE ID=@p1", connection.CON);

            com.Parameters.AddWithValue("@p1", matchtype.matchTypeId);
            com.Parameters.AddWithValue("@p2", matchtype.matchTypeName);
            result = com.ExecuteNonQuery();
            return(result);
        }
Exemplo n.º 2
0
        internal static int addMatchType(clsMatchTypes matchType)
        {
            SqlCeCommand com = new SqlCeCommand("INSERT INTO tblmatchType VALUES(@p1,@p2)", connection.CON);

            com.Parameters.AddWithValue("@p1", matchType.matchTypeId);
            com.Parameters.AddWithValue("@p2", matchType.matchTypeName);
            try
            {
                return(com.ExecuteNonQuery());
            }
            catch (Exception e)
            {
                clsMessages.showMessage(clsMessages.msgType.error, e.Message);
            }
            return(0);
        }
Exemplo n.º 3
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;
        }
Exemplo n.º 4
0
        public static clsMatchTypes getMatchType(int matchTypeId)
        {
            if (matchTypeId < 0)
            {
                return(null);
            }

            clsMatchTypes mt = new clsMatchTypes();

            SqlCeCommand com = new SqlCeCommand("SELECT * FROM tblmatchType WHERE matchTypeId=@p1", connection.CON);

            com.Parameters.AddWithValue("p1", matchTypeId);

            DataSet          ds = new DataSet("matchTypeId");
            SqlCeDataAdapter ad = new SqlCeDataAdapter(com);

            ad.Fill(ds, "matchTypeId");

            DataRow r = ds.Tables["matchTypeId"].Rows[0];

            return(new clsMatchTypes(Convert.ToInt32(r[0].ToString()), r[1].ToString()));
        }