本文整理汇总了C#中Staff.GetSupervisor方法的典型用法代码示例。如果您正苦于以下问题:C# Staff.GetSupervisor方法的具体用法?C# Staff.GetSupervisor怎么用?C# Staff.GetSupervisor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Staff
的用法示例。
在下文中一共展示了Staff.GetSupervisor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoSurveyReminderByStaff
private void DoSurveyReminderByStaff(int selectedID, string SelectedUsername, string surveyType)
{
List<AttendedEvent> unsubmittedEvents = new List<AttendedEvent>();
if (surveyType == "PTA")
{
unsubmittedEvents = AttendedEvent.GetUnsubmitted(surveyType, selectedID);
}
else
{
unsubmittedEvents = AttendedEvent.GetUnsubmitted(surveyType, SelectedUsername);
}
EventDate ed = EventDate.GetById(selectedID);
TrainingEvent ev = TrainingEvent.GetById(ed.EventId);
foreach (AttendedEvent ae in unsubmittedEvents)
{
Staff staff = new Staff();
Staff supervisor = new Staff();
if (surveyType == "PTA")
{
staff = Staff.GetFromUsername(ae.StaffUsername);
}
else
{
staff = Staff.GetFromUsername(SelectedUsername);
}
if (staff == null)
continue;
if (surveyType == "PTA")
{
supervisor = Staff.GetFromUsername(SelectedUsername);
}
else
{
supervisor = staff.GetSupervisor();
}
if (supervisor == null)
continue;
Dictionary<string, string> replacements =
new Dictionary<string, string>();
replacements["Name"] = staff.Name;
replacements["SupervisorName"] = supervisor.Name;
replacements["EventName"] = ev.Title;
replacements["StartDate"] = ed.StartDate.ToString("dd/MM/yyyy");
replacements["EndDate"] = ed.EndDate.ToString("dd/MM/yyyy");
replacements["CurrentDate"] = DateTime.Now.ToString("dd/MM/yyyy");
replacements["EventID"] = ev.SAPId.ToString();
string emailTemplateFile = System.IO.Path.Combine(EmailTemplateFolder, "Invite" + surveyType + ".htm");
emailTemplateFile = Server.MapPath(emailTemplateFile);
if (surveyType == "PTA")
UtilityEmail.Send(supervisor.Email, staff.Email, "Your Post-Training Assessment is Required", emailTemplateFile, replacements);
else
UtilityEmail.Send(staff.Email, supervisor.Email, "Your Course Evaluation is Required", emailTemplateFile, replacements);
}
string sScript0 = "window.alert('Email Notification has been sent to selected staff.')";
ScriptManager.RegisterClientScriptBlock(Page, GetType(), "SaveDraft_Script_20", sScript0, true);
return;
}