protected void Page_Load(object sender, EventArgs e) { error = ""; user = new NetflixBL.User((string)Session["username"]); s = new NetflixBL.Series((int)Session["sid"]); user.GetSeries(); drop.Visible = false; GridView1.Visible = false; for (int i = 0; i < user.SeriesList1.Count; i++) { bool a = user.SeriesList1[i].seriesID == s.seriesID; if (a == true) { add.Visible = false; drop.Visible = true; GridView1.Visible = true; break; } } name.Text = s.seriesName; desc.Text = s.Description; Stats.Text = "watched by " + s.GetWatchers().ToString() + " users"; DataSet ds = episodeDAL.GetAll(); List <int> seasons = new List <int>(); for (int i = 0; i < ds.Tables["episodeTBL"].Rows.Count; i++) { if (!seasons.Contains((int)ds.Tables["episodeTBL"].Rows[i]["SeasonNum"]) && (int)ds.Tables["episodeTBL"].Rows[i]["EpiSeries"] == s.seriesID) { seasons.Add((int)ds.Tables["episodeTBL"].Rows[i]["SeasonNum"]); } } if (!Page.IsPostBack) { for (int i = 0; i < seasons.Count; i++) { drop.Items.Add(seasons[i].ToString()); } SeriesPoster.ImageUrl = s.Posterurl; DataSet ds1 = episodeDAL.GetAll(); List <NetflixBL.Episode> episodes = new List <NetflixBL.Episode>(); if (seasons.Count > 0) { for (int i = 0; i < ds1.Tables["episodeTBL"].Rows.Count; i++) { if ((int)ds1.Tables["episodeTBL"].Rows[i]["SeasonNum"] == seasons[0] && (int)ds.Tables["episodeTBL"].Rows[i]["EpiSeries"] == s.seriesID) { NetflixBL.Episode episode = new NetflixBL.Episode((int)ds1.Tables["episodeTBL"].Rows[i]["EpisdeID"]); episodes.Add(episode); } GridView1.DataSource = episodes; GridView1.DataBind(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Login"] == null) { Response.Redirect("Main.aspx"); } user = new NetflixBL.User((string)Session["Username"]); user.GetSeries(); DataList1.DataSource = user.SeriesList1; if (!IsPostBack) { DataList1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!((string)Session["Login"] == "user")) { Response.Redirect("Login.aspx"); } user = new NetflixBL.User((string)Session["Username"]); if (!Page.IsPostBack) { NetflixWS.NetflixWS proxyObj = new NetflixWS.NetflixWS(); card = proxyObj.UserPayment(user.CreditCard); NetflixWS.Transaction payment = proxyObj.UserLatesPay("Netflix", card.CardNumber); PaymentID.Text += (" " + payment.ID); PaymentCard.Text += (" " + payment.CardNumber); PaymentAmount.Text += (" " + payment.Amount); PayerName.Text += (" " + card.FirstName + " " + card.LastName); NewEmail.Text = user.Email; NewPass.Text = user.Pass; username.Text += user.Username; Subscription.Text += " " + user.Sub.Description + " " + user.Sub.Seriesamount + " seriers includes"; } }