コード例 #1
0
    private void FillPage()
    {
        ArrayList chocolateList = new ArrayList();

        chocolateList = ConnectionClass.GetChocolateByType("name", "%%");
        OutputFunctions.listItems(chocolateList, pnlProducts);
    }
コード例 #2
0
    private void printOrders(string begindate, string endDate, bool shipped)
    {
        StringBuilder sb = OutputFunctions.GenerateOrders(begindate, endDate, shipped);

        if (shipped == false)
        {
            lblOpenOrders.Text = sb.ToString();
        }
        else
        {
            lblClosedOrders.Text = sb.ToString();
        }
    }
コード例 #3
0
    public void btn_Remove(object sender, EventArgs e)
    {
        Button button = sender as Button;

        OutputFunctions.removeBasketItem(button);
        GenerateControls();
        List <Tuple <int, int> > basketItems = (List <Tuple <int, int> >)Session["ordersIds"];

        if (basketItems.Count() == 0)
        {
            btnOrder.Visible   = false;
            lblResult.Visible  = false;
            txtAddress.Visible = false;
            lblError.Text      = "Your basket is empty!";
        }
    }
コード例 #4
0
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        ArrayList chocolateList = new ArrayList();
        string    what          = txtSearch.Text;

        what          = what.Replace("'", "");
        what          = what.Replace("\"", "");
        chocolateList = ConnectionClass.ChocolateSearch(what);
        pnlProducts.Controls.Clear();
        OutputFunctions.listItems(chocolateList, pnlProducts);
        if (pnlProducts.Controls.Count == 0)
        {
            Label lbl = new Label()
            {
                Text = "No data found!", ForeColor = System.Drawing.ColorTranslator.FromHtml("#34000D")
            };
            pnlProducts.Controls.Add(lbl);
        }
    }
コード例 #5
0
    private void FillPage()
    {
        ArrayList chocolateList = new ArrayList();

        if (!IsPostBack)
        {
            chocolateList = ConnectionClass.GetChocolateByType("type", "seasonal");
        }
        else
        {
            string type = "holiday";
            string what = DropDownList1.SelectedValue;
            if (what.Equals("All"))
            {
                what = "seasonal"; type = "type";
            }
            ;
            chocolateList = ConnectionClass.GetChocolateByType(type, what);
        }

        OutputFunctions.listItems(chocolateList, pnlProducts);
    }