Example #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");
         }
     }
     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();
     }
 }
Example #2
0
 protected void submit_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         Subscription        SelectedSub = new Subscription(int.Parse(subscription.SelectedValue));
         NetflixWS.NetflixWS proxyObj    = new NetflixWS.NetflixWS();
         NetflixWS.Card      c           = new NetflixWS.Card();
         c.CardNumber = CreditCard.Text;
         c.Owner      = int.Parse(Owner.Text);
         c.CVV        = int.Parse(CVV.Text);
         c.ExpMonth   = int.Parse(ExpMonth.Text);
         c.ExpYear    = int.Parse(ExpYear.Text);
         c.FirstName  = FirstName.Text;
         c.LastName   = LastName.Text;
         NetflixWS.Transaction t = new NetflixWS.Transaction();
         t.CardNumber = CreditCard.Text;
         t.Payee      = "Netflix";
         t.Amount     = SelectedSub.Amountpermonth;
         if (proxyObj.IsPaid(t.Payee, t.CardNumber))
         {
             err = " Card allready is in use for another account";
             return;
         }
         if (!proxyObj.CanPay(c, t))
         {
             err = "Cant pay for this subscription with this card";
             return;
         }
         bool worked = NetflixBL.General.SignUp(username.Text, password.Text, 1, subscription.SelectedIndex + 1, email.Text, CreditCard.Text);
         if (!worked)
         {
             err = "username already exist! please change username";
             return;
         }
         if (!proxyObj.Pay(c, t))
         {
             //NOTREACHED!
             err = "user registed but couldnt pay for some reasone";
             return;
         }
         err = "you have sucsussfully signed up!";
         Response.Redirect("Login.aspx");
     }
 }
Example #3
0
        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";
            }
        }