Esempio n. 1
0
    public static Award[] GetAwardsByMovieID(string id)
    {
        DataSet ds = DBConn.RunDataSetSQL("select * from MoviesAndAwards where MovieID=" + id);

        Award[] a1 = new Award[ds.Tables[0].Rows.Count];

        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            Award tempAward = Awards.GetAwardByID(ds.Tables[0].Rows[i]["AwardID"].ToString());
            a1[i] = new Award(tempAward.GetID(), tempAward.GetAward(), int.Parse(ds.Tables[0].Rows[i]["Year"].ToString()));
        }
        return(a1);
    }
Esempio n. 2
0
    public static void AddMovieAward(Movie m1, Award a1)
    {
        string sqlCom = String.Format("INSERT INTO MoviesAndAwards(MovieID,AwardID,[Year]) VALUES({0},{1},{2})", m1.GetID(), a1.GetID(), a1.GetYear());

        DBConn.RunNonQuerySQL(sqlCom);
    }