private void btnAddProduct_Click(object sender, EventArgs e) { using (frmAddEditProduct frmProductDetail = new frmAddEditProduct() { Categories = listCategories, CurrentCategoryId = currentCategory.Id }) { frmProductDetail.ShowDialog(); LoadDataFromDBBaseCategory(currentCategory); } }
private void dgvProduct_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int index = dgvProduct.SelectedCells[0].RowIndex; var product = dgvProduct.Rows[index].Tag as ProductModel; using (frmAddEditProduct frmProductDetail = new frmAddEditProduct() { ProductSelected = product, Categories = listCategories, CurrentCategoryId = currentCategory.Id }) { frmProductDetail.ShowDialog(); if (currentCategory != null) { LoadDataFromDBBaseCategory(currentCategory); } } }
private void btnEdit_Click(object sender, EventArgs e) { frmAddEditProduct frmAddEditProduct = new frmAddEditProduct(); frmAddEditProduct.ShowDialog(); }