Exemplo n.º 1
0
    public void FillRepeater()
    {
        using (cart obj = new cart())
        {
            DataSet ds = new DataSet();
            if (Request.QueryString["oid"] == "")
            {
                Response.Redirect("Default.aspx");
            }
            else if (Request.QueryString["oid"] != null)
            {
                using (order objo = new order())
                {
                    objo.id = Convert.ToInt64(Request.QueryString["oid"].ToString());
                    ds      = objo.order_byid();
                    lbltotalprice.Visible = false;
                    ptag.Visible          = false;
                }
            }
            else
            {
                obj._userid    = Convert.ToInt64(Session["UserID"].ToString());
                obj._sessionid = Session["Current"].ToString();
                obj._orderid   = Convert.ToInt64("1");
                DataSet dsr = new DataSet();

                ds = obj.cart_details();

                dsr = obj.cart_total();
                lbltotalprice.Text = dsr.Tables[0].Rows[0]["total"].ToString();
            }
            if (ds.Tables[0].Rows.Count > 0)
            {
                rptcart.DataSource = ds;
                rptcart.DataBind();
            }
            else
            {
                rptcart.Visible = false;
            }
        }
    }