Пример #1
0
        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();
            }
        }
Пример #2
0
        private void NewItemOperation()
        {
            try
            {
                using (var prodViewFrm = new ProductViewForm(Enums.Crud.Create))
                    prodViewFrm.ShowDialog();

                itemDataGrid.Rows.Clear();
                InitializeProductsOperation();
            }
            catch (Exception x)
            {
                x.ShowException();
            }
        }