protected void lnk_Update_Click(object sender, EventArgs e) { panelViewFoodItem.Visible = true; int foodId = Convert.ToInt32((sender as LinkButton).CommandArgument); FoodItemBLL foodItemBLL = new FoodItemBLL(); FoodItem foodItem = foodItemBLL.DoRetrieveFoodItemByFoodId(foodId); panelUpdateFoodItem.Visible = true; txtFId.Text = foodId.ToString(); ddlFCategory.SelectedValue = foodItem.FoodCategory; txtFTitle.Text = foodItem.FoodTitle; txtPrice.Text = foodItem.Price.ToString(); txtDLimit.Text = foodItem.DailyLimit.ToString(); }
public void DoUpdateOrderCountOperation() { FoodItemBLL foodItemBLL = new FoodItemBLL(); for (int i = 0; i < gv_currFoodItemList.Rows.Count; i++) { int foodId = int.Parse(gv_currFoodItemList.Rows[i].Cells[2].Text.ToString()); FoodItem foodItem = foodItemBLL.DoRetrieveFoodItemByFoodId(foodId); foodItem.OrderCounter += int.Parse(gv_currFoodItemList.Rows[i].Cells[6].Text.ToString()); int result = foodItemBLL.DoUpdateOrderCount(foodId, foodItem.OrderCounter); if (result < 0) { alertFailure.Visible = true; lblErrorRetrieve.Text = "Unable to update order count for food item code " + foodId; break; } } }