private void btnCategoryDetails_Click(object sender, EventArgs e) { int catIndex = dgvCategoryTable.CurrentCell.RowIndex; CategoryEntity cat = AllCategories.ElementAt(catIndex); CRUD_Category crudCat = new CRUD_Category(cat); crudCat.makeReadOnly(); crudCat.Show(); }
private void btnCategoryAdd_Click(object sender, EventArgs e) { CategoryEntity cat = new CategoryEntity(); CRUD_Category crudCat = new CRUD_Category(cat); crudCat.ShowDialog(); if (crudCat.DialogResult == DialogResult.OK) { AllCategories.Add(cat); dgvCategoryTable.Invalidate(); } }
private void btnCategoryEdit_Click(object sender, EventArgs e) { int catIndex = dgvCategoryTable.CurrentCell.RowIndex; CategoryEntity cat = AllCategories.ElementAt(catIndex); CRUD_Category crudCat = new CRUD_Category(cat); crudCat.editing = true; crudCat.ShowDialog(); if (crudCat.DialogResult == DialogResult.OK) { dgvCategoryTable.InvalidateRow(catIndex); } }