using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Success : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        BLL.UserInfo user = new BLL.UserInfo();
        if (user.IsLogin() == false)
        {
            this.Response.Redirect("Member_Login.aspx");
        }
        else
        {
            BLL.Cart ocart = new BLL.Cart();
            string[] productids = Session["productids"].ToString().Split(',');
            string[] counts = Session["count"].ToString().Split(',');

            for (int i = 1; i < productids.Length; i++)
            {
                ocart.updatestate(int.Parse(productids[i]), user.getUserID(), true);
                ocart.updateproduct(int.Parse(productids[i]), int.Parse(counts[i]));
            }
        }
        Session.RemoveAll();
    }
}
