Esempio n. 1
0
        public override void Create(Pharmacy pharmacy)
        {
            base.Create(pharmacy);
            //automatically insert the default message suite for the new pharmacy
            using (var service = new MessageTemplateService())
            {
                List <MessageTemplate> templates = new List <MessageTemplate>();
                foreach (var entry in defaultMessageTemplates)
                {
                    templates.Add(
                        new MessageTemplate()
                    {
                        Pharmacy = pharmacy,
                        Type     = entry.Key.Type,
                        Media    = entry.Key.Media,
                        Content  = entry.Value
                    }
                        );
                }
                service.Create(templates);
            }
            //automatically insert the response options linked to the defautl message suite

            using (var service = new MessageResponseOptionService())
            {
                foreach (var opt in defaultMessageResponseOptions)
                {
                    service.Create(opt);
                }
            }
        }
Esempio n. 2
0
        public static List <MessageResponseOption> GetResponseOptions(MessageTemplateType templateType)
        {
            List <MessageResponseOption> opts;

            using (var service = new MessageResponseOptionService())
            {
                opts = service.GetWhere(MessageResponseOptionService.MessageTemplateTypeCol == templateType);
            }
            return(opts);
        }