Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!((string)Session["Login"] == "admin"))
            {
                if (((string)Session["Login"] == "user"))
                {
                    Response.Redirect("User.aspx");
                }
                else
                {
                    Response.Redirect("Login.aspx");
                }
            }
            admin = new NetflixBL.Admin((int)Session["adminID"]);
            List <NetflixBL.Series> series = admin.mySeries;

            if (!Page.IsPostBack)
            {
                for (int i = 0; i < series.Count; i++)
                {
                    DropDownList1.Items.Add(series[i].seriesName);
                    DropDownList1.Items[i].Value = series[i].seriesID.ToString();
                    DropDownList1.Items[i].Text  = series[i].seriesName;
                }
            }
        }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!((string)Session["Login"] == "admin"))
     {
         if (((string)Session["Login"] == "user"))
         {
             Response.Redirect("User.aspx");
         }
         else
         {
             Response.Redirect("Login.aspx");
         }
     }
     NetflixBL.Admin admin = new NetflixBL.Admin((int)Session["adminID"]);
     if (!Page.IsPostBack)
     {
         NetflixWS.NetflixWS          proxyObj   = new NetflixWS.NetflixWS();
         NetflixWS.Transaction[]      IncomeArr  = proxyObj.Income("Netflix");
         List <NetflixWS.Transaction> IncomeList = new List <NetflixWS.Transaction>();
         for (int i = 0; i < IncomeArr.Length; i++)
         {
             IncomeList.Add(IncomeArr[i]);
         }
         admin.GetUsers();
         admin.GetSeries();
         GridView1.DataSource = admin.MyUsers;
         GridView1.DataBind();
         GridView2.DataSource = admin.mySeries;
         GridView2.DataBind();
         GridView3.DataSource = IncomeList;
         GridView3.DataBind();
     }
 }
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         NetflixBL.Admin admin = new NetflixBL.Admin((int)Session["adminID"]);
         admin.CreateSeries(TextBox1.Text, TextBox2.Text, DropDownList1.SelectedItem.Text, TextBox3.Text);
         error = "series created!";
     }
 }
Beispiel #4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string filename;

            if (FileUpload1.HasFile)
            {
                filename = @"C:\Users\razma\Source\Repos\razmashat\NetflixDALAndBL\NetflixUI\vids\" + DropDownList1.SelectedItem.Text + "S" + TextBox2.Text + "E" + TextBox3.Text + Path.GetExtension(FileUpload1.FileName);
                FileUpload1.SaveAs(filename);
                WindowsMediaPlayer player = new WindowsMediaPlayer();
                var             clip      = player.newMedia(filename);
                double          time      = clip.duration;
                NetflixBL.Admin admin     = new NetflixBL.Admin((int)Session["adminID"]);
                admin.AddEpisode(int.Parse(DropDownList1.SelectedItem.Value), int.Parse(TextBox2.Text), int.Parse(TextBox3.Text), TextBox4.Text, (int)time, filename);
            }
        }