private void btnEditFood_Click(object sender, EventArgs e) { decimal x = decimal.Parse(txbprice.Text); string nameCate = cbCategory.SelectedValue.ToString(); int idCategory = category.GetIDCategoryByName(nameCate); food.UpdateFood(int.Parse(id), txbnameFood.Text, x, idCategory); fadmin.LoadFoodGrid(); MessageBox.Show("Updated thành công"); this.Close(); }
private void btnAddFood_Click(object sender, EventArgs e) { int idCategory = category.GetIDCategoryByName(cbFoodCategory.SelectedItem.ToString()); food.InsertFood(txbnameFood.Text, int.Parse(txbpriceFood.Text), idCategory); if (MessageBox.Show("Bạn Thêm Thành Công.", "Thông báo", MessageBoxButtons.OK) == System.Windows.Forms.DialogResult.OK) { fadmin.LoadFoodGrid(); this.Close(); } }