Ejemplo n.º 1
0
		public void BindShoppingCart()
		{
			BPShoppingCartDetails bpDetails = new BPShoppingCartDetails();

			if (CustomerID != 0)
			{
				BPShoppingCarts bpCart = new BPShoppingCarts();
				DSShoppingCarts = bpCart.SelectByCustomerID (CustomerID);
				DSShoppingCarts.Merge(bpDetails.SelectAllByCustomerID(CustomerID));
			}
			else
			{
				DSShoppingCarts = bpDetails.SelectAllByCartID(CartID);
			}
			rptProductsList.DataBind ();
		}
Ejemplo n.º 2
0
		private void btnLogin_Click(object sender, EventArgs e)
		{
			string email = txtEmail.Text.Trim();
			string password = txtPassword.Text.Trim();

			if(email == "" || password == "")
			{
				lblCreateError.Visible = false;
				lblLoginError.Visible = true;
				lblLoginError.Text = "Error: Please enter your Email Address and Password";
				return;
			}

			if (Login(txtEmail.Text, txtPassword.Text))
			{
				Session["LoggedIn"] = true;
				//ExtendSession = true;
				if (CartID != 0)
				{
					ConvertTempCart(CartID,CustomerID);
				}else
				{
					BEShoppingCarts cartsDS = new BEShoppingCarts();
					BPShoppingCarts bp = new BPShoppingCarts();
					//BEShoppingCarts.tbl_ShoppingCartsRow cartRow;

					//cart = bp.SelectByCustomerID(CustomerID).tbl_ShoppingCarts[0]; //bug fix - 25-Mar-08 hs

					cartsDS = bp.SelectByCustomerID(CustomerID);
					if(cartsDS.tbl_ShoppingCarts.Count > 0)
						CartID = cartsDS.tbl_ShoppingCarts[0].ShoppingCartID;

				}
				if (Request.QueryString["return"]!=null)
				{
					Response.Redirect(Request.QueryString["return"].ToString());
				}
				else
				{
					Response.Redirect("CustomerInformation.aspx");
				}
			}
			else
			{
				lblCreateError.Visible = false;
				lblLoginError.Visible = true;
				lblLoginError.Text = "Error: Your username or password is incorrect.";
			}
		}
Ejemplo n.º 3
0
		public void BindShoppingCart()
		{
			BPShoppingCartDetails bpDetails = new BPShoppingCartDetails();

			if (CustomerID != 0)
			{
				int ShippingMethodID, ShippingRegionID;

				BPShoppingCarts bpCart = new BPShoppingCarts();
				DSShoppingCarts = bpCart.SelectByCustomerID (CustomerID);
				if (DSShoppingCarts.tbl_ShoppingCarts.Count > 0)
				{
					ShippingMethodID = DSShoppingCarts.tbl_ShoppingCarts[0].ShippingMethodID;
					ShippingRegionID = DSShoppingCarts.tbl_ShoppingCarts[0].ShippingRegionID;

					ShippingCost = GetShippingCost(ShippingMethodID, ShippingRegionID);
				}
				DSShoppingCarts.Merge(bpDetails.SelectAllByCustomerID(CustomerID));
			}
			else
			{
				DSShoppingCarts = bpDetails.SelectAllByCartID(CartID);
			}
			rptProductsList.DataBind ();
		}