Ejemplo n.º 1
0
        private void OnDreamCategoryEdited(CreateEditDreamCategoryPage page, DreamCategoryEditorViewModel model)
        {
            DreamCategory original = this.datalayer.GetDreamCategory(model.CategoryId);

            original.Update(model);

            this.datalayer.SaveChanges();
            this.LoadCategoriesCommand.Execute(null);
            this.IsBusy = false;
        }
Ejemplo n.º 2
0
        private void OnDreamCategoryCreated(CreateEditDreamCategoryPage page, DreamCategoryEditorViewModel model)
        {
            DreamCategory category = model.Copy <DreamCategory>();

            category.CategoryId = 0;

            if (this.datalayer.AddDreamCategory(category))
            {
                model.CategoryId = category.CategoryId;
                this.Items.Add(model);
            }

            this.IsBusy = false;
        }