Пример #1
0
        //Get the details of a particular Game



        public TblGameDes GetGameData(int id)
        {
            try
            {
                TblGameDes game = db.TblGameDes.Find(id);
                return(game);
            }
            catch
            {
                throw;
            }
        }
Пример #2
0
 //To Update the records of a particluar Game
 public int UpdateGame(TblGameDes game)
 {
     try
     {
         db.Entry(game).State = EntityState.Modified;
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
Пример #3
0
 //To Add new Game Record
 public int AddGame(TblGameDes game)
 {
     try
     {
         db.TblGameDes.Add(game);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
Пример #4
0
 //To Delete the record of a particulargame
 public int DeleteGame(int id)
 {
     try
     {
         TblGameDes game = db.TblGameDes.Find(id);
         db.TblGameDes.Remove(game);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }