当前位置: 首页>>代码示例>>C#>>正文


C# Staff.GetSupervisor方法代码示例

本文整理汇总了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;
        }
开发者ID:nakirareizo,项目名称:Training,代码行数:58,代码来源:Utility.aspx.cs


注:本文中的Staff.GetSupervisor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。