//Send order to database private void SendOrder() { ArrayList orderList = (ArrayList)Session["orders"]; ConnectionClass.AddOrder(orderList); Session["orders"] = null; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string check = Session["nameofproduct"].ToString(); string name = Session["login"].ToString(); Product product = ConnectionClass.GetProductByName(check); User user = ConnectionClass.GetUserByName(name); string externalIP; externalIP = (new WebClient()).DownloadString("http://checkip.dyndns.org/"); externalIP = (new Regex(@"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}")) .Matches(externalIP)[0].ToString(); Order o = new Order(user.FirstName, user.LastName, name, user.Email, user.ContactNo, product.ProductNumber, product.ProductName, product.Price, DateTime.Now, "Success", externalIP, ""); ConnectionClass.AddOrder(o); } }