Example #1
0
        public List <ucRM_MenuItem> GetOwnedRestFoodList()
        {
            db = new DB();
            List <ucRM_MenuItem> FoodList = new List <ucRM_MenuItem>();

            if (db.Connect())
            {
                int             j     = 0;
                string          query = string.Format("SELECT * FROM Foods WHERE RestaurantID = '{0}'", this.ID);
                MySqlDataReader dr    = db.GetQuery(query);
                while (dr.Read())
                {
                    ucRM_MenuItem ucTempFoodList = new ucRM_MenuItem(dr, this);
                    if (j % 2 == 0)
                    {
                        ucTempFoodList.BackColor = Color.FromArgb(255, 245, 255);
                    }
                    FoodList.Add(ucTempFoodList);
                    j++;
                }
                db.Close();
                return(FoodList);
            }
            else
            {
                return(FoodList);
            }
        }
Example #2
0
 public EditFoodScreen(ucRM_MenuItem foodItem, Restaurant ownedRestaurant)
 {
     InitializeComponent();
     tboxRMFoodName.Text  = foodItem.FoodName;
     tboxRMFoodDesc.Text  = foodItem.Desc;
     tboxRMFoodPrice.Text = foodItem.Price.ToString("0.00");
     this.foodItem        = foodItem;
     this.ownedRestaurant = ownedRestaurant;
 }