예제 #1
0
        public string GetSenderNameByContext(Guid tenantId, SettingContextTypeEnum contexttype)
        {
            string sendername = string.Empty;
            var    conetext   = _IReviewSetting.GetSettingsByContext(tenantId, contexttype);

            if (conetext != null)
            {
                var content = JsonConvert.DeserializeObject <dynamic>(conetext.Content);

                if (content != null)
                {
                    switch (contexttype)
                    {
                    case SettingContextTypeEnum.EMAIL:
                        sendername = content.emailSender;
                        break;

                    case SettingContextTypeEnum.SMS:
                        sendername = content.smsSender;
                        break;

                    default:
                        break;
                    }
                }
            }

            return(sendername);
        }
예제 #2
0
        Setting ISettingManager.GetSettingsByContext(Guid tenantId, SettingContextTypeEnum contexttype)
        {
            var setting = _IReviewSetting.GetSettingsByContext(tenantId, contexttype);

            setting.ContextName = DataUtility.GetEnumDescription((SettingContextTypeEnum)setting.Context);

            return(setting);
        }
예제 #3
0
        internal Setting GetSettingsBycontext(Guid tenantId, SettingContextTypeEnum contexttype)
        {
            Setting settingLst = new Setting();

            try
            {
                var cmd = CreateProcedureCommand("dbo.Setting_GetByContextType");
                cmd.AppendGuid("@guidTenantId", tenantId);
                cmd.AppendInt("@contexttype", (int)contexttype);

                using (SqlDataReader reader = ExecuteCommandAndReturnReader(cmd))
                {
                    while (reader.Read())
                    {
                        settingLst = ReadSetting(reader);
                    }
                }
            }
            catch (SqlException e)
            {
                throw ReportAndTranslateException(e, "Settings::Setting_GetByContextType");
            }
            return(settingLst);
        }
예제 #4
0
 Setting ISettingReview.GetSettingsByContext(Guid tenantId, SettingContextTypeEnum contexttype)
 {
     return(_dataSetting.GetSettingsBycontext(tenantId, contexttype));
 }