コード例 #1
0
 protected void ConfirmType_Click(object sender, EventArgs e)
 {
     FoodData _food = new FoodData();
     int foodid = Convert.ToInt32(Session["FoodId"]);
     Food tempfood = _food.GetFoodById(foodid);
     tempfood.FoodType = TypeTextBox.Text;
     _food.UpdateFood(tempfood);
     TypeLabel.Visible = true;
     ChangeType.Visible = true;
     TypeTextBox.Visible = false ;
     ConfirmType.Visible = false;
     TypeLabel.Text = TypeTextBox.Text;
 }
コード例 #2
0
    protected void StatusLinkButton_Click(object sender, EventArgs e)
    {
        int foodstatus = 0;
        if ("上菜" == StatusLinkButton.Text)
        {
            foodstatus = 1;
        }
        else foodstatus = 0;

        FoodData _food = new FoodData();
        int foodid = Convert.ToInt32(Session["FoodId"]);
        Food tempfood = _food.GetFoodById(foodid);
        tempfood.Status = foodstatus;
        _food.UpdateFood(tempfood);

        if (1 == foodstatus)
        {
            StatusLabel.Text = "已上架";
            StatusLinkButton.Text = "下架";
        }
        else
        {
            StatusLabel.Text = "已下架";
            StatusLinkButton.Text = "上菜";
        }
    }
コード例 #3
0
 protected void ConfirmPrice_Click(object sender, EventArgs e)
 {
     FoodData _food = new FoodData();
     int foodid = Convert.ToInt32(Session["FoodId"]);
     Food tempfood = _food.GetFoodById(foodid);
     PriceLabel.Visible = true;
     ChangeType.Visible = true;
     PriceTextBox.Visible = false;
     ConfirmPrice.Visible = false;
     try { tempfood.FoodPrice = Convert.ToDouble(PriceTextBox.Text); }
     catch { return; }
     _food.UpdateFood(tempfood);
     PriceLabel.Text = PriceTextBox.Text;
 }