private void frmAddMeasure_Load(object sender, EventArgs e) { ingredientBLL = new IngredientBLL(); dt = new DataTable(); LoadIngredients(); txtProduct.Text = this.productName; }
public void showData() { var Ingredients = IngredientBLL.Search(pageIndex, pageSize, sortBy, sortOrder, keyword); dgIngredients1.ItemsSource = Ingredients.Items; pageCount = Ingredients.PageCount; }
private void frmAddInput_Load(object sender, EventArgs e) { ingredientBLL = new IngredientBLL(); inputDetailBLL = new InputDetailBLL(); dt = new DataTable(); LoadIngredients(); txtProduct.Text = this.inputId; }
private void btnSave_Click(object sender, RoutedEventArgs e) { var op = IngredientBLL.Update(new Ingredient() { Name = txtName.Text, UnitMeasure = txtUnitofMeasure.Text }); if (op.Code != "200") { MessageBox.Show("Error : " + op.Message); } else { MessageBox.Show("Succesfully Update"); } myParentWindow.showData(); this.Close(); }
public frmRpt_Inventory() { InitializeComponent(); //Load nguyen lieu ingredientBLL = new IngredientBLL(); DataTable dt = ingredientBLL.GetIngredients(); //Thêm option chọn tất cả DataRow allIgre = dt.NewRow(); allIgre["IngredientName"] = "Tất cả"; allIgre["IngredientId"] = "0"; dt.Rows.Add(allIgre); cbNguyenLieu.DisplayMember = "IngredientName"; cbNguyenLieu.ValueMember = "IngredientId"; cbNguyenLieu.DataSource = dt; cbNguyenLieu.SelectedIndex = cbNguyenLieu.Items.Count - 1; inventoryResource = new InventoryBLL(); }
private void btnDelete_Click(object sender, RoutedEventArgs e) { Ingredient ingredient = ((FrameworkElement)sender).DataContext as Ingredient; if (MessageBox.Show("Are you sure you want to delete " + ingredient.Name + "?", "Are you sure?", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { var op = IngredientBLL.Delete(ingredient.Name); if (op.Code != "200") { MessageBox.Show("Error : " + op.Message); } else { MessageBox.Show("Ingredient is successfully deleted from table"); showData(); } } ; }
private void frmManageProduct_Load(object sender, EventArgs e) { // khởi tạo các đối tượng supBLL = new IngredientBLL(); }