Exemple #1
0
        public void createCard(string name, string imagepath, int friendship, int bravery, int humor, int starfactor)
        {
            db = new LinqToSQLDatacontext(connectionString);

            // Create new Card
            card newcard = new card();
            newcard.name = name;
            newcard.serialnumber = getCount()+1;
            newcard.imagepath = imagepath;
            newcard.friendship = friendship;
            newcard.bravery = bravery;
            newcard.humor = humor;
            newcard.starfactor = starfactor;

            // adds new card to  database
            db.cards.InsertOnSubmit(newcard);
            db.SubmitChanges();
        }
 partial void Updatecard(card instance);
 partial void Deletecard(card instance);
 partial void Insertcard(card instance);