Example #1
0
        /// <summary>
        /// Fill predefined values
        /// </summary>
        private void FillPredefinedValues()
        {
            object item = (DataContext as ViewModelBase).GetPropertyValue("DetailItem");

            try
            {
                item = Convert.ChangeType(item, uiModule.ModuleItemType);
            }
            catch (ArgumentNullException e)
            {
                throw new Base.Exceptions.ArgumentNullException("Argument is null", e);
            }
            catch (FormatException e)
            {
                throw new Base.Exceptions.ArgumentException("Argument format exception", e);
            }
            catch (Exception e)
            {
                throw new Base.Exceptions.Exception("Unhandled exception", e);
            }

            var formControls = FormDataMiner.GetControlsFromForm(this);

            FormDataMiner.FillValuesIntoForm(formControls, item, true);
        }
Example #2
0
        /// <summary>
        /// Fill values from item into form
        /// </summary>
        private void FillValuesFromItemIntoForm()
        {
            if (form == null)
            {
                return;
            }

            var formControls = FormDataMiner.GetControlsFromForm(form);

            FormDataMiner.FillValuesIntoForm(formControls, AddEditItem);
        }
Example #3
0
        /// <summary>
        /// Fill values from form into item
        /// </summary>
        private void FillValuesFromFormIntoItem()
        {
            var formControls = FormDataMiner.GetControlsFromForm(form);

            AddEditItem = FormDataMiner.FillValuesIntoProperty(formControls, AddEditItem);
        }