コード例 #1
0
        /// <summary>
        /// Get notification email model assembly qualified name by module
        /// </summary>
        /// <param name="module"></param>
        /// <returns></returns>
        public string GetNotificationEmailModelAssemblyName(NotificationEnums.NotificationModule module)
        {
            switch (module)
            {
            case NotificationEnums.NotificationModule.Page:
                return(typeof(NotificationPageEmailModel).AssemblyQualifiedName);
            }

            return(string.Empty);
        }
コード例 #2
0
 /// <summary>
 /// Get all active notification templates of a module
 /// </summary>
 /// <param name="module"></param>
 /// <param name="selectDefault"></param>
 /// <returns></returns>
 public IEnumerable <SelectListItem> GetNotificationTemplates(NotificationEnums.NotificationModule module,
                                                              bool selectDefault = false)
 {
     return(Fetch(m => m.Module == module).Select(m => new SelectListItem
     {
         Text = m.Name,
         Value = SqlFunctions.StringConvert((double)m.Id).Trim(),
         Selected = selectDefault && m.IsDefaultTemplate
     }));
 }
コード例 #3
0
        public JsonResult GeneratePropertyDropdown(NotificationEnums.NotificationModule module)
        {
            var type = _notificationTemplateService.GetNotificationEmailModelAssemblyName(module);

            var model = _widgetService.GetPropertyListFromType(type);

            return(Json(new ResponseModel
            {
                Success = true,
                Data = RenderPartialViewToString("Partials/_PropertyDropdown", model)
            }));
        }
コード例 #4
0
 public NotificationInitializeModel(NotificationEnums.NotificationModule module, dynamic parameters)
     : this()
 {
     Module     = module;
     Parameters = SerializeUtilities.Serialize(parameters);
 }
コード例 #5
0
 public NotificationInitializeModel(NotificationEnums.NotificationModule module, string parameters)
     : this()
 {
     Module     = module;
     Parameters = parameters;
 }
コード例 #6
0
 /// <summary>
 /// Get default notification template by module
 /// </summary>
 /// <param name="module"></param>
 /// <returns></returns>
 public NotificationTemplate GetDefaultNotificationTemplate(NotificationEnums.NotificationModule module)
 {
     return(FetchFirst(m => m.IsDefaultTemplate && m.Module == module));
 }
コード例 #7
0
 /// <summary>
 /// Get notification initialize model
 /// </summary>
 /// <param name="module"></param>
 /// <param name="parameters"></param>
 /// <returns></returns>
 public NotificationInitializeModel GetNotificationInitializeModel(NotificationEnums.NotificationModule module,
                                                                   string parameters)
 {
     return(new NotificationInitializeModel(module, parameters));
 }
コード例 #8
0
 public NotificationTemplateSetupModel(NotificationEnums.NotificationModule module)
     : this()
 {
     NotificationTemplates = _notificationTemplateService.GetNotificationTemplates(module);
 }