예제 #1
0
        /// <summary>
        /// Create new item and add into database
        /// </summary>
        protected override void CreateNewItem()
        {
            try
            {
                ProductGroupViewModel viewModel = new ProductGroupViewModel(this.MessageBoxService, (IProductGroupManager)ModelManager);

                // open dialog and return result when it is closed
                bool?result = this.UIVisualizerService.ShowDialog("ProductGroupPopup", viewModel);

                // code to check result
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #2
0
        /// <summary>
        /// Edit an existing item and update in database
        /// </summary>
        protected override void EditItem(ProductGroup selectedItem)
        {
            try
            {
                if (selectedItem == null)
                {
                    throw new ArgumentNullException("selectedItem");
                }

                ProductGroupViewModel viewModel = new ProductGroupViewModel(this.MessageBoxService, selectedItem, (IProductGroupManager)ModelManager);

                // open dialog and return result when it is closed
                bool?result = this.UIVisualizerService.ShowDialog("ProductGroupPopup", viewModel);

                // code to check result
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }