コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var Cart = Session["Cart"] as cart;

        item[] arr = new item[Cart.Size];

        for (var i = 0; i < Cart.Size; i++)
        {
            arr[i] = Cart.ArrItem[i];
        }

        RptProd.DataSource = arr;
        RptProd.DataBind();

        var    total     = (int)Session["tot"];
        string parameter = (string)Request["para"];

        if (parameter == "11")
        {
            tot.Text  = null;
            tot.Text += total;
            Session["order_total"] = tot.Text;
        }
        else
        {
            tot.Text += total;
            Session["order_total"] = tot.Text;
        }
    }
コード例 #2
0
    protected void Selection_Ch(Object sender, EventArgs e)
    {
        var             ArrProdli = Application["ArrP"] as List <products>;
        List <products> newarr1   = new List <products>();


        int i = 0, j = 0;
        int theStatus = Convert.ToInt32(pr_search.SelectedValue);

        if (theStatus == 500)
        {
            for (i = 0, j = 0; i < ArrProdli.Count; i++)
            {
                if (ArrProdli[i].price <= 500)
                {
                    newarr1.Insert(j, ArrProdli[i]);
                    j++;
                }
            }

            RptProd.DataSource = newarr1;
            RptProd.DataBind();
        }
        else if (theStatus == 1)
        {
            RptProd.DataSource = ArrProdli;
            RptProd.DataBind();
        }
        else if (theStatus == 1501)
        {
            for (i = 0, j = 0; i < ArrProdli.Count; i++)
            {
                if (ArrProdli[i].price >= 1500)
                {
                    newarr1.Insert(j, ArrProdli[i]);
                    j++;
                }
            }

            RptProd.DataSource = newarr1;
            RptProd.DataBind();
        }
        else if (theStatus == 1500)
        {
            for (i = 0, j = 0; i < ArrProdli.Count; i++)
            {
                if (ArrProdli[i].price > 500 && ArrProdli[i].price <= 1500)
                {
                    newarr1.Insert(j, ArrProdli[i]);
                    j++;
                }
            }

            RptProd.DataSource = newarr1;
            RptProd.DataBind();
        }
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            var ArrProd = Application["ArrP"] as List <products>;

            RptProd.DataSource = ArrProd;
            RptProd.DataBind();
        }
    }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         var ArrProd = Application["ArrP"] as List <products>;
         RptProd.DataSource = ArrProd;
         RptProd.DataBind();
     }
     if (Session["Login"] == null)
     {
         Page.ClientScript.RegisterStartupScript(this.GetType(), "popup", "$('#enquirypopup').modal('show');", true);
     }
 }
コード例 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["Login"] != null)
     {
         GlobalFunc.LoadProds();
         var ArrProd = Application["ArrP"] as List <Product>;
         RptProd.DataSource = ArrProd;
         RptProd.DataBind();
     }
     else
     {
         Response.Redirect("connexion.aspx");
     }
 }
コード例 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int prodID = int.Parse(Request["pid"]);
        int i      = 0;

        Session["ProdID"] = prodID;

        var             ArrProd = Application["ArrP"] as List <products>;
        List <products> newarr  = new List <products>();

        for (i = 0; i < ArrProd.Count; i++)
        {
            if (ArrProd[i].pid == prodID)
            {
                newarr.Insert(0, ArrProd[i]);
                RptProd.DataSource = newarr;
                RptProd.DataBind();
            }
        }
    }
コード例 #7
0
ファイル: Prods.aspx.cs プロジェクト: negev5614/WebSite
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Login"] == null)
        {
            Response.Redirect("LogIn.aspx");
        }
        string    TypeProd  = (Request["Type"]);
        string    TypeBrand = (Request["Brand"]);
        DataTable Dp        = new DataTable();

        Dp = GlobalFunc.GetTypeProdes(TypeProd);
        RptProd.DataSource = Dp;
        RptProd.DataBind();
        if (TypeProd == null)
        {
            Dp = GlobalFunc.GetProdFromBrand(TypeBrand);
            RptProd.DataSource = Dp;
            RptProd.DataBind();
        }
    }
コード例 #8
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string          ConnStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\\database.accdb";
        OleDbConnection Conn    = new OleDbConnection(ConnStr);

        Conn.Open();
        OleDbCommand Cmd = new OleDbCommand();
        string       Sql = "Select * From Products";

        Cmd.Connection  = Conn;
        Cmd.CommandText = Sql;
        List <products> newarr = new List <products>();
        var             ArrProdli = Application["ArrP"] as List <products>;
        int             i = 0, j = 0;
        OleDbDataReader rd = Cmd.ExecuteReader();

        while (rd.Read())
        {
            if (filter.Value == (string)rd["ProdName"])
            {
                newarr.Insert(i, ArrProdli[j]);
                i++;
            }
            j++;
        }
        Conn.Close();
        if (i == 0)
        {
            msg.Text = "Please enter the full name of the telescope";
        }
        else
        {
            RptProd.DataSource = newarr;
            RptProd.DataBind();
        }
    }