Example #1
0
        private void UpdateBadge()
        {
            var span = (System.Web.UI.HtmlControls.HtmlGenericControl) this.Master.FindControl("cartBadge");
            ECommerceBusiness ecb = new ECommerceBusiness();
            DataTable         dt  = (DataTable)Session["UserWholeRecord"];

            int userID = Convert.ToInt32(dt.Rows[0]["user_id"].ToString());

            dt = ecb.SelectAllCartedProduct(userID);

            if (dt.Rows.Count == 1)
            {
                span.Style.Add("visibility", "visible");
                span.InnerText = "1";
            }
            else
            {
                span.InnerText = dt.Rows.Count.ToString();
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["User"] == null)
            {
                flag = 0;
            }

            if (Session["User"] != null)
            {
                if (!IsPostBack)
                {
                    UserName.Text    = Session["User"].ToString();
                    lblUserName.Text = Session["User"].ToString();

                    if (!string.IsNullOrEmpty(Session["UserImage"].ToString()))
                    {
                        userImage.ImageUrl  = Session["UserImage"].ToString();
                        userImage2.ImageUrl = Session["UserImage"].ToString();
                    }
                }

                DataTable dt = (DataTable)Session["UserWholeRecord"];

                int userID = Convert.ToInt32(dt.Rows[0]["user_id"].ToString());

                ECommerceBusiness ecb = new ECommerceBusiness();

                dt = ecb.SelectAllCartedProduct(userID);
                string noOfCartedProduct = dt.Rows.Count.ToString();

                if (Convert.ToInt32(noOfCartedProduct) > 0)
                {
                    cartBadge.InnerText = noOfCartedProduct;
                    cartBadge.Style.Add("visibility", "visible");
                }
            }
        }
Example #3
0
        private void CartedList(int userID)
        {
            ECommerceBusiness ecb = new ECommerceBusiness();

            Application["CartList"] = ecb.SelectAllCartedProduct(userID);
        }