Exemplo n.º 1
0
        private void LoadFoodCategories()
        {
            var listCategory = foodCategory.GetFoodCategories();

            cbCategory.DataSource    = listCategory;
            cbCategory.DisplayMember = "nameFoodCategory";
        }
Exemplo n.º 2
0
        //List Category
        private void ListCategory()
        {
            var list = category.GetFoodCategories(true);

            foreach (var item in list)
            {
                ListViewItem x = new ListViewItem(item.idFoodCategory.ToString());
                x.SubItems.Add(item.nameFoodCategory);

                lsvCategory.Items.Add(x);
            }
        }
Exemplo n.º 3
0
        private void LoadCategory()
        {
            var listCate = category.GetFoodCategories();

            cbFoodCategory.Items.Clear();

            foreach (var item in listCate)
            {
                cbFoodCategory.Items.Add(item.nameFoodCategory);
            }
            cbFoodCategory.SelectedIndex = 0;
        }
Exemplo n.º 4
0
        public fEditFood(string id, string name, string price, string idCategory, fAdmin fAdmin)
        {
            InitializeComponent();
            this.fadmin     = fAdmin;
            this.id         = id;
            this.name       = name;
            this.price      = price;
            this.idCategory = idCategory;

            txbnameFood.Text = name;
            txbprice.Text    = price;

            var           listCategory = category.GetFoodCategories();
            List <string> listName     = new List <string>();

            foreach (var item in listCategory)
            {
                listName.Add(item.nameFoodCategory);
            }
            string nameCategory = category.GetNameCategoryById(int.Parse(idCategory));

            cbCategory.DataSource   = listName;
            cbCategory.SelectedItem = nameCategory;
        }