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); }
Setting ISettingManager.GetSettingsByContext(Guid tenantId, SettingContextTypeEnum contexttype) { var setting = _IReviewSetting.GetSettingsByContext(tenantId, contexttype); setting.ContextName = DataUtility.GetEnumDescription((SettingContextTypeEnum)setting.Context); return(setting); }
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); }
Setting ISettingReview.GetSettingsByContext(Guid tenantId, SettingContextTypeEnum contexttype) { return(_dataSetting.GetSettingsBycontext(tenantId, contexttype)); }