Example #1
0
        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();
        }
Example #2
0
        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();
            }
        }
Example #3
0
        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);
            }
        }