Exemplo n.º 1
0
        public void UpdateItem(CollectionItem item, Window owner)
        {
            EditTemplateWindow window = new EditTemplateWindow(owner, ((TemplateItem)item.ItemContent).TaskTemplate);

            if (window.ShowDialog() ?? false)
            {
                using (IRepository <Template, long> repository = PersistentFactory.GetContext().GetRepository <Template, long>())
                    repository.Update(window.EditedTemplate);

                ((TemplateItem)item.ItemContent).Update();
            }
        }
Exemplo n.º 2
0
        public CollectionItem AddItem(Window owner)
        {
            EditTemplateWindow window = new EditTemplateWindow(owner);

            if (window.ShowDialog() ?? false)
            {
                using (IRepository <Template, long> repository = PersistentFactory.GetContext().GetRepository <Template, long>())
                    repository.Add(window.EditedTemplate);

                return(new CollectionItem(new TemplateItem(window.EditedTemplate)));
            }

            return(null);
        }