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

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

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

                MaterialGroupViewModel viewModel = new MaterialGroupViewModel(this.MessageBoxService, selectedItem, (IMaterialGroupManager)ModelManager);

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

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