在 sitefinity-cms 中,有没有办法通过 mvc 控制器发送电子邮件?我看到了很多有关电子邮件活动设置的信息,但没有与通过代码发送电子邮件相关的信息?
主页
/
user-206567
Jefferson's questions
Jefferson
Asked:
2024-08-15 13:21:23 +0800 CST
我在一个表中有这些数据,我正在尝试执行循环或递归方法。我需要根据会议 ID 获取结果。如果我使用会议 ID 1,它将返回 2,3。如果我使用会议 ID 2,我将得到 1,3,如果我使用 3,我将得到 1,2。我有这个方法,但我需要多次调用,我想知道是否有更好的方法。我相信我需要 linq 来遍历父/先前会议链和遍历子/延续会议链。
MeetingId ContinuedMeetingId
---------- -------------
1 2
2 3
3 null
EF / Linq:
var y = (from m in Meetings
where m.MeetingId == MeetingId
select new
{
ContinuedMeetingsId = db.Meetings
.Where(s => s.MeetingId == m.MeetingId)
.Select(s => s.ContinuedMeetingId).FirstOrDefault()
}).FirstOrDefault();
Jefferson
Asked:
2024-03-15 00:40:47 +0800 CST
我想按天分组并返回以逗号分隔的 id。
桌子
CREATE TABLE data (
Id INT IDENTITY(1, 1),
Days VARCHAR(255)
);
数据
INSERT INTO data (Id, Days)
VALUES
(2612,'4'),
(2614,'4'),
(2617,'5'),
(2651,'6'),
(2652,'7');
SQL
Select
Ids =
STUFF((SELECT ',' + CAST(b.Id AS varchar)
FROM data b
WHERE b.Id = a.Id
FOR XML PATH('')), 1, 2, '')
from
data a
group by Days
预期结果
Ids
---------------------------------------------------
2612,2614
2617
2651
2652
错误
(没有结果输出)
修正样本
https://sqlfiddle.com/sql-server/online-compiler?id=f688372d-3952-4de9-ad10-7930a6428ee8
Jefferson
Asked:
2024-02-06 01:38:35 +0800 CST
我在 MauiApp 中创建了这个方法AddAppSetting
,并在我的 json 文件中读取它。我遇到的问题是如何在不传递任何参数的情况下访问所有类中的数据?
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseTelerik()
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
builder.AddAppSetting();
return builder.Build();
}
public static void AddAppSetting(this MauiAppBuilder builder)
{
using Stream stream = Assembly
.GetExecutingAssembly()
.GetManifestResourceStream("AppMaui.appsettings.json");
if (stream != null)
{
IConfigurationRoot config = new ConfigurationBuilder()
.AddJsonStream(stream)
.Build();
builder.Configuration.AddConfiguration(config);
}
}
我喜欢访问配置文件的类。
public abstract class MobileAPIServiceBase
{
private readonly string _rootUrl;
private readonly string _commonQueryString;
IConfiguration configuration;
protected MobileAPIServiceBase()
{
}
}
Jefferson
Asked:
2024-01-30 23:43:59 +0800 CST
在此示例中,我有一个 onclick 方法,我想将行从加号更改为减号。我还希望所有其他的都回到默认的 plus。有办法做到这一点吗?
$(document).ready(function() {
collapsed();
});
var collapsed = function(e, counter) {
$("#data tr").each(function() {
console.log('Data')
});
};
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<table id="data">
<tr>
<td>
<span class="btn tooltips btn-green" id="maincounter_1" data-maincounter="1" data-container="body" data-placement="top" onclick="collapsed(this,1)"><i id="icon_1" class="fa fa-plus"></i></span>
</tr>
<td>
<span class="btn tooltips btn-green" id="maincounter_2" data-maincounter="2" data-container="body" data-placement="top" onclick="collapsed(this,2)"><i id="icon_1" class="fa fa-plus"></i></span>
</tr>
<td>
<span class="btn tooltips btn-green" id="maincounter_1" data-maincounter="1" data-container="body" data-placement="top" onclick="collapsed(this,3)"><i id="icon_1" class="fa fa-plus"></i></span>
</tr>
<td>
<span class="btn tooltips btn-green" id="maincounter_1" data-maincounter="1" data-container="body" data-placement="top" onclick="collapsed(this,4)"><i id="icon_1" class="fa fa-plus"></i></span>
</tr>
<td>
<span class="btn tooltips btn-green" id="maincounter_1" data-maincounter="1" data-container="body" data-placement="top" onclick="collapsed(this,5)"><i id="icon_1" class="fa fa-plus"></i></span>
</tr>
</table>