Пример #1
0
        public static Genre VerwerkRij(IDataRecord rij)
        {
            Genre type = new Genre();

            type.ID = Convert.ToInt32(rij["ID"].ToString());
            type.Name = rij["Name"].ToString();
     
            return type;

        }
Пример #2
0
        public static void AddType(Genre newgenre)
        {
            try
            {

                DbParameter paramName = Database.AddParameter("@Name", newgenre.Name);
                Database.ModifyData("INSERT INTO Genre (Name) values (@Name)", paramName);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Пример #3
0
        public static void DeleteType(Genre genre)
        {
            try
            {
                DbParameter paramName = Database.AddParameter("@Name", genre.Name);

                Database.ModifyData("DELETE FROM Genre WHERE Name = @Name", paramName);
            }
            catch (Exception e)
            {

                throw e;
            }
            
        }