예제 #1
0
 public static bool RateBook(RatingTable rating)
 {
     try
     {
         using (BooksLibraryProjectEntities db = new BooksLibraryProjectEntities())
         {
             db.RatingTable.Add(rating);
             db.SaveChanges();
             return(true);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #2
0
        public static int rateBook(RatingTable b)
        {
            int idB;

            try
            {
                using (BooksLibraryProjectEntities db = new BooksLibraryProjectEntities())
                {
                    db.RatingTable.Add(b);
                    //????????????????????????????????????????????????????
                    db.SaveChanges();
                    idB = b.id;
                }
                return(idB);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }