Exemplo n.º 1
0
        /// <summary>
        /// Set the Default Template for a ModuleType in this System.
        /// </summary>
        public void SetDefaultTemplate(ModuleType moduleType, SystemTemplate template)
        {
            if (!moduleType.IsTemplateModule())
            {
                throw new Exception("Module does not support Templates.");
            }
            if (template.ModuleType != moduleType)
            {
                throw new Exception("Template is not for this Module Type.");
            }

            DefaultTemplateCollection[moduleType] = template.Id;
        }
Exemplo n.º 2
0
        internal Template(Guid dataEntryContractId, Guid agencyId, ModuleType moduleType, string name)
        {
            if (agencyId == Guid.Empty)
            {
                throw new Exception("Templates must belong to an Agency.");
            }
            if (!moduleType.IsTemplateModule())
            {
                throw new Exception("Module does not support Templates.");
            }

            AgencyId            = agencyId;
            DataEntryContractId = dataEntryContractId;
            ModuleType          = moduleType;
            Name = name;
        }