Exemplo n.º 1
0
        /// <summary>
        /// Create a new dictaat based on a given template.
        /// </summary>
        /// <param name="name">Name of the dictaat. Must be unique.</param>
        /// <param name="template">optional template name, default = defaultTemplate</param>
        public void CreateDictaat(string name, ApplicationUser user, string template)
        {
            //Create the database entry
            var dictaatDetails = new DictaatDetails()
            {
                Name           = name,
                DictaatOwnerId = user.Id,
                IsEnabled      = false, //by default we don't show the dictaten
            };

            var dictaatSession = new DictaatSession()
            {
                DictaatDetailsId = name,
                StartedOn        = DateTime.Now,
            };

            _context.DictaatSession.Add(dictaatSession);
            _context.DictaatDetails.Add(dictaatDetails);
            _context.SaveChanges();

            //Create the folder
            Domain.Dictaat dictaat = _dictaatFactory.CreateDictaat(name, template);
        }
Exemplo n.º 2
0
        public void CreateDictaat(string name, string template)
        {
            string pagesPath = name + _pagesDirectory;

            Domain.Dictaat dictaat = _dictaatFactory.CreateDictaat(name, template);
        }