public DataSet MostView() { try { MyConnction.Open(); Mycommand = new OleDbCommand("MostView", MyConnction); Mycommand.CommandType = CommandType.StoredProcedure; ds = new DataSet(); adapter = new OleDbDataAdapter(Mycommand); adapter.Fill(ds, "UserHistory"); ImDb.WebService Db = new ImDb.WebService(); DataTable TableMovies = Db.GetMoviesName(); ds.Tables[0].Columns.Add(new DataColumn(("MovieName"), typeof(string))); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow dr = TableMovies.Rows.Find(ds.Tables[0].Rows[i]["MovieID"]); ds.Tables[0].Rows[i]["MovieName"] = dr["MovieName"]; } return(ds); } catch (Exception err) { throw err; } finally { MyConnction.Close(); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["G"] == null || Session["User"] == null) { if (Request.QueryString["m"] != null) { ImDb.WebService ImDb = new ImDb.WebService(); MovieUrl = ImDb.GetURLAddress(int.Parse(Request.QueryString["m"])); } else { Response.Redirect("HomePage.aspx"); } } else { GroupId = int.Parse(Request.QueryString["G"]); //if (((GroupsDetails) Page.Application["Rooms"]).Rooms.Count != 0) GroupsDetails groupsDetails = (GroupsDetails)Cache.Get("Rooms"); if (groupsDetails.Rooms.Count != 0) { //Gr = ((GroupsDetails)Page.Application["Rooms"]).GetTheSerchGroup(GroupId); Gr = groupsDetails.GetTheSerchGroup(GroupId); this.LabelCurrent.Text = Gr.CurrentTime.ToString(); Gr.EndMovie = int.Parse(this.LabelEend.Text); //startTimer(Gr.MenngerGroup, ((UserDetail)Session["User"]).UserId); if (Gr.Active) { Page.ClientScript.RegisterStartupScript(this.ButtonStop.GetType(), "startVideo", "playVideo()", true); } else { Page.ClientScript.RegisterStartupScript(this.ButtonStop.GetType(), "pauseVideo", "pauseVideo()", true); } } else { this.LabelCurrent.Text = "0"; } ImDb.WebService ImDb = new ImDb.WebService(); MovieUrl = ImDb.GetURLAddress(Gr.MovieID); } if (Gr != null) { PopChat(); } else { this.TextBoxChat.Visible = false; this.TextBoxMessge.Visible = false; } }
public void PopMoiveDetails() { ImDb.WebService Wb = new ImDb.WebService(); ImDb.MovieDetails Movie = Wb.GetMoviesDetails(int.Parse(MovieId)); this.LabelMovieName.Text = Movie.MoivesName; this.LabelDescription.Text = Movie.description; this.ImageMoviePhoto.ImageUrl = Movie.UrlPicture; this.LabelYearRate.Text += Movie.YearRate; this.LabelDate.Text += Movie.Date.ToShortDateString(); this.Labelcategory.Text = Movie.Category; this.DataListPlayers.DataSource = Movie.PlayersNRevive.Tables["PlayersTBbl"]; this.DataListPlayers.DataBind(); this.DataListReview.DataSource = Movie.PlayersNRevive.Tables["ReviewsTBbl"]; this.DataListReview.DataBind(); }
private void AddMoviesNames(DataSet ds) //הוספת שמות הסרטים מ IMDB לטבלת הסטוריית סרטים למשתמש { ds.Tables["UserHistory"].Columns.Add(new DataColumn(("MovieName"), typeof(string))); ds.Tables["GroupHistory"].Columns.Add(new DataColumn(("MovieName"), typeof(string))); ImDb.WebService Db = new ImDb.WebService(); DataTable TableMovies = Db.GetMoviesName(); for (int i = 0; i < ds.Tables["UserHistory"].Rows.Count; i++) { DataRow dr = TableMovies.Rows.Find(ds.Tables["UserHistory"].Rows[i][1]); ds.Tables["UserHistory"].Rows[i]["MovieName"] = dr["MovieName"]; } for (int i = 0; i < ds.Tables["GroupHistory"].Rows.Count; i++) { DataRow dr = TableMovies.Rows.Find(ds.Tables["GroupHistory"].Rows[i]["MovieID"]); ds.Tables["GroupHistory"].Rows[i]["MovieName"] = dr["MovieName"]; } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["G"] == null || Session["User"] == null) { if (Request.QueryString["m"] != null) { ImDb.WebService ImDb = new ImDb.WebService(); MovieUrl = ImDb.GetURLAddress(int.Parse(Request.QueryString["m"])); } else { Response.Redirect("HomePage.aspx"); } } else { GroupId = int.Parse(Request.QueryString["G"]); //if (((GroupsDetails) Page.Application["Rooms"]).Rooms.Count != 0) GroupsDetails groupsDetails = (GroupsDetails)Cache.Get("Rooms"); if (groupsDetails.Rooms.Count != 0) { //Gr = ((GroupsDetails)Page.Application["Rooms"]).GetTheSerchGroup(GroupId); Gr = groupsDetails.GetTheSerchGroup(GroupId); this.LabelCurrent.Text = Gr.CurrentTime.ToString(); Gr.EndMovie = int.Parse(this.LabelEend.Text); //startTimer(Gr.MenngerGroup, ((UserDetail)Session["User"]).UserId); UserName = ((UserDetail)Session["User"]).UserName; } else { GroupId = 0; this.LabelCurrent.Text = "0"; } ImDb.WebService ImDb = new ImDb.WebService(); MovieUrl = ImDb.GetURLAddress(Gr.MovieID); } }
protected void ButtonTrailler_Click(object sender, EventArgs e) { ImDb.WebService Wb = new ImDb.WebService(); ImDb.MovieDetails Movie = Wb.GetMoviesDetails(int.Parse(MovieId)); Response.Redirect(Movie.TrailerAdd); }