C#Rad桌面警报-显示正确的名称
我正在为我的CRM系统编写rad桌面警报,在gridview中有我想回拨的人,其中有一列保存回拨日期和时间。这是迄今为止的完整代码:C#Rad桌面警报-显示正确的名称,c#,alert,desktop,rad,C#,Alert,Desktop,Rad,我正在为我的CRM系统编写rad桌面警报,在gridview中有我想回拨的人,其中有一列保存回拨日期和时间。这是迄今为止的完整代码: public async void ScheduleAction(Action action, DateTime ExecutionTime) { try { if (DateTime.Now < ExecutionTime)//ExecutionTime - not passed
public async void ScheduleAction(Action action, DateTime ExecutionTime)
{
try
{
if (DateTime.Now < ExecutionTime)//ExecutionTime - not passed
{
await Task.Delay((int)ExecutionTime.Subtract(DateTime.Now).TotalMilliseconds);
action();
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
public void action()
{
radDesktopAlert1.CaptionText = "Telefonmøde";
radDesktopAlert1.ContentText = navn;
radDesktopAlert1.Show();
}
string navn = "";
private void radButton1_Click(object sender, EventArgs e)
{
try
{
for(int i = 0; i < radGridView4.Rows.Count; i++)
{
string dateTime = radGridView4.Rows[i].Cells[10].Value.ToString();
DateTime executionTime = Convert.ToDateTime(dateTime);
navn = radGridView4.Rows[i].Cells[1].Value.ToString();
ScheduleAction(action, executionTime);
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
public async void ScheduleAction(Action Action,DateTime ExecutionTime)
{
尝试
{
if(DateTime.Now
我的问题是,当navn被指定为radDesktopAlert1.ContentText时,它将始终是gridview中的最后一行。如何克服这一问题,以便为每个回调显示正确的名称
提前感谢第1步:删除所有可怕的try-catch块,并确保程序在没有它们的情况下运行。这是我首先做的,它工作正常,问题是navn始终是gridview中的最后一行