private void EditItemOperation(int pId) { try { var product = S.ProductService .ListByCriteria(new ProductCriteriaDto { Id = pId }) .FirstOrDefault(); if (product == null) { return; } using (var prodViewFrm = new ProductViewForm(Enums.Crud.Update, product)) prodViewFrm.ShowDialog(); if (FiltersOn()) { return; } itemDataGrid.Rows.Clear(); InitializeProductsOperation(); } catch (Exception x) { x.ShowException(); } }
private void NewItemOperation() { try { using (var prodViewFrm = new ProductViewForm(Enums.Crud.Create)) prodViewFrm.ShowDialog(); itemDataGrid.Rows.Clear(); InitializeProductsOperation(); } catch (Exception x) { x.ShowException(); } }