本文整理汇总了C#中Employee.GetEmail方法的典型用法代码示例。如果您正苦于以下问题:C# Employee.GetEmail方法的具体用法?C# Employee.GetEmail怎么用?C# Employee.GetEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Employee
的用法示例。
在下文中一共展示了Employee.GetEmail方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Given_person_seen_is_an_employee_and_not_in_list_when_AddPersonSeen_then_added_to_list
public void Given_person_seen_is_an_employee_and_not_in_list_when_AddPersonSeen_then_added_to_list()
{
//GIVEN
var checklist = new BusinessSafe.Domain.Entities.SafeCheck.Checklist();
var employee = new Employee();
employee.Id = Guid.NewGuid();
employee.Forename = "Alester";
employee.Surname = "Oakheart";
employee.SetEmail("[email protected]",null);
var personSeen = ChecklistPersonSeen.Create(employee);
//WHEN
checklist.AddPersonSeen(personSeen);
//THEN
Assert.That(checklist.PersonsSeen.Count, Is.EqualTo(1));
Assert.That(checklist.PersonsSeen[0].Id, Is.Not.EqualTo(string.Empty));
Assert.That(checklist.PersonsSeen[0].Employee.Id, Is.EqualTo(employee.Id));
Assert.That(checklist.PersonsSeen[0].FullName, Is.EqualTo(employee.FullName));
Assert.That(checklist.PersonsSeen[0].EmailAddress, Is.EqualTo(employee.GetEmail()));
Assert.That(checklist.PersonsSeen[0].Checklist, Is.EqualTo(checklist));
}
示例2: SendReviewOverdueToRiskAssessor
private void SendReviewOverdueToRiskAssessor(Task overDueTask, Employee taskAssignedTo, Employee riskAssessorEmployee)
{
var recipientEmail = riskAssessorEmployee.GetEmail();
if (string.IsNullOrEmpty(recipientEmail))
{
Log4NetHelper.Log.Debug("ERROR - Sent ReviewOverdueToRiskAssessorEmail - no recipient email specified - taskID " + overDueTask.TaskGuid.ToString());
}
else
{
_bus.Send(new SendReviewOverdueRiskAssessorEmail()
{
RecipientEmail = recipientEmail,
TaskReference = overDueTask.Reference,
Title = overDueTask.Title,
Description = overDueTask.Description,
TaskAssignedTo = taskAssignedTo.FullName,
TaskCompletionDueDate =
overDueTask.TaskCompletionDueDate.Value.ToString("d", new CultureInfo("en-GB"))
});
Log4NetHelper.Log.Debug("Sent ReviewOverdueToRiskAssessorEmail");
}
}
示例3: LogEmployeeTasks
private void LogEmployeeTasks(Employee employee, EmployeeTasks employeeTasks)
{
try
{
if (TotalTaskCount(employeeTasks) == 0)
{
Log.Debug(string.Format("{0} {1} has NO Overdue, Completed or DueTomorrow tasks", employee.FullName,
employee.GetEmail()));
}
else
{
Log.Debug(
string.Format(
"{0} {1} - {2} Overdue tasks - {3} Completed tasks - {4} DueTomorrow tasks", employee.FullName, employee.GetEmail()
, (employeeTasks.GeneralRiskAssessmentTasksOverdue.Count
+ employeeTasks.PersonalRiskAssessmentTasksOverdue.Count
+ employeeTasks.FireRiskAssessmentTasksOverdue.Count
+ employeeTasks.HazadousSubstanceRiskAssessmentTasksOverdue.Count
+ employeeTasks.RiskAssessmentReviewTasksOverdue.Count
+ employeeTasks.ResponsibilityTaskOverdue.Count
+ employeeTasks.ActionTasksOverdue.Count),
(employeeTasks.HazardousSubstanceTasksCompleted.Count
+ employeeTasks.FireRiskAssessmentTasksCompleted.Count
+ employeeTasks.PersonalRiskAssessmentTasksCompleted.Count
+ employeeTasks.GeneralRiskAssessmentTasksCompleted.Count
+ employeeTasks.RiskAssessmentReviewTasksCompleted.Count),
(employeeTasks.GeneralRiskAssessmentTasksDueTomorrow.Count
+ employeeTasks.PersonalRiskAssessmentTasksDueTomorrow.Count
+ employeeTasks.FireRiskAssessmentTasksDueTomorrow.Count
+ employeeTasks.HazardousSubstanceTasksDueTomorrow.Count
+ employeeTasks.RiskAssessmentReviewTasksDueTomorrow.Count
+ employeeTasks.ResponsibilityTasksDueTomorrow.Count
+ employeeTasks.ActionTasksDueTomorrow.Count)
));
}
}
catch (Exception ex)
{
Log.Debug("Exception " + ex.Message);
throw;
}
}
示例4: CreateAndSendEmployeeEmailDigest
public void CreateAndSendEmployeeEmailDigest(ISession session, Employee employee)
{
try
{
//Log.Debug("CreateAndSendEmployeeEmailDigest()");
var employeeTasks = GetEmployeeTasks(session, employee.Id);
LogEmployeeTasks(employee, employeeTasks);
if (employeeTasks.AnyOverdueTasks(employee) || employeeTasks.AnyCompletedTasks(employee) ||
employeeTasks.AnyDueTomorrowTasks(employee))
{
//Log.Debug(string.Format("{0} {1} - Digest Email Tasks present", employee.FullName, employee.GetEmail()));
var employeeDigestEmailCommand =
EmployeeNotificationsHelper.CreateSendEmployeeDigestEmailCommand(employee, employeeTasks);
//Log.Debug(string.Format("{0} {1} - Digest Email created", employee.FullName, employee.GetEmail()));
_bus.Send(employeeDigestEmailCommand);
Log.Debug(string.Format("{0} {1} - Digest Email sent", employee.FullName, employee.GetEmail()));
//if any email is sent for completed tasks then save those tasks to employee notification History
if (employeeDigestEmailCommand.GeneralRiskAssessmentTasksCompleted.Any()
|| employeeDigestEmailCommand.FireRiskAssessmentTasksCompleted.Any()
|| employeeDigestEmailCommand.PersonalRiskAssessmentTasksCompleted.Any()
|| employeeDigestEmailCommand.HazardousSubstanceTasksCompleted.Any()
|| employeeDigestEmailCommand.RiskAssessmentReviewTasksCompleted.Any())
{
Log.Debug(string.Format("{0} {1} - Completed Tasks In Digest Email", employee.FullName,
employee.GetEmail()));
UpdateEmployeeNotificationEmailSent(employee, employeeTasks);
Log.Debug(string.Format("{0} {1} - Completed Tasks Updated", employee.FullName,
employee.GetEmail()));
}
}
employeeTasks.ClearEmployeeTasks();
}
catch (Exception ex)
{
Log.Debug("Exception - CreateAndSendEmployeeEmailDigest" + ex.Message);
throw;
}
}
示例5: SendTaskOverdueToUserEmail
private void SendTaskOverdueToUserEmail(Task overDueTask, Employee taskAssignedTo, Employee riskAssessorEmployee)
{
var riskAssessor = "Currently No Risk Assessor";
if (riskAssessorEmployee != null)
{
riskAssessor = riskAssessorEmployee.FullName;
}
var recipientEmail = taskAssignedTo.GetEmail();
if (string.IsNullOrEmpty(recipientEmail))
{
Log4NetHelper.Log.Debug("ERROR - Sent TaskOverdueToUserEmail - no recipient email specified - taskID " + overDueTask.TaskGuid.ToString() );
}
else
{
_bus.Send(new SendTaskOverdueUserEmail()
{
TaskGuid = overDueTask.TaskGuid,
RecipientEmail = recipientEmail,
TaskReference = overDueTask.Reference,
Title = overDueTask.Title,
Description = overDueTask.Description,
RiskAssessor = riskAssessor,
TaskCompletionDueDate =
overDueTask.TaskCompletionDueDate.Value.ToString("d", new CultureInfo("en-GB")),
TaskAssignedTo = overDueTask.TaskAssignedTo.FullName
});
Log4NetHelper.Log.Debug("Sent TaskOverdueToUserEmail");
}
}
示例6: CreateSendEmployeeDigestEmailCommand
public static SendEmployeeDigestEmail CreateSendEmployeeDigestEmailCommand(Employee employee, EmployeeTasks employeeTasks)
{
var employeeDigestEmail = new SendEmployeeDigestEmail()
{
RecipientEmail = employee.GetEmail()
//overdue tasks
,GeneralRiskAssessmentsOverdueTasks = employeeTasks.GeneralRiskAssessmentTasksOverdue
.Where(task => CanSendTaskOverdueNotification(task,employee))
.Select(MapToTaskDetails).ToList()
,PersonalRiskAssessmentTasksOverdue = employeeTasks.PersonalRiskAssessmentTasksOverdue
.Where(task => CanSendTaskOverdueNotification(task, employee))
.Select(MapToTaskDetails).ToList()
,FireRiskAssessmentsOverdueTasks = employeeTasks.FireRiskAssessmentTasksOverdue
.Where(task => CanSendTaskOverdueNotification(task, employee))
.Select(MapToTaskDetails).ToList()
,HazardousSubstanceRiskAssessmentTasksOverdue = employeeTasks.HazadousSubstanceRiskAssessmentTasksOverdue
.Where(task => CanSendTaskOverdueNotification(task, employee))
.Select(MapToTaskDetails).ToList()
,RiskAssessmentReviewTasksOverdue = employeeTasks.RiskAssessmentReviewTasksOverdue
.Where(task => CanSendReviewTaskOverdueNotification(task, employee))
.Select(MapToTaskDetails).ToList()
, ResponsibilitiesTasksOverdue = employeeTasks.ResponsibilityTaskOverdue
.Where(task => CanSendResponsibilityTaskOverdueNotification(task, employee))
.Select(MapToTaskDetails).ToList()
,ActionTasksOverdue = employeeTasks.ActionTasksOverdue
.Where( task => CanSendTaskOverdueNotification(task, employee))
.Select(MapToTaskDetails)
.ToList()
//Completed tasks
,HazardousSubstanceTasksCompleted = employeeTasks.HazardousSubstanceTasksCompleted
.Where(task => CanSendTaskCompletedNotification(task, employee))
.Select(MapToTaskDetails)
.ToList()
, FireRiskAssessmentTasksCompleted = employeeTasks.FireRiskAssessmentTasksCompleted
.Where(task => CanSendTaskOverdueNotification(task, employee))
.Select(MapToTaskDetails).ToList()
, GeneralRiskAssessmentTasksCompleted = employeeTasks.GeneralRiskAssessmentTasksCompleted
.Where(task => CanSendTaskCompletedNotification(task, employee))
.Select(MapToTaskDetails)
.ToList()
,PersonalRiskAssessmentTasksCompleted = employeeTasks.PersonalRiskAssessmentTasksCompleted
.Where(task => CanSendTaskCompletedNotification(task, employee))
.Select(MapToTaskDetails)
.ToList()
,RiskAssessmentReviewTasksCompleted = employeeTasks.RiskAssessmentReviewTasksCompleted
.Where(task => CanSendTaskCompletedNotification(task, employee))
.Select(MapToTaskDetails)
.ToList()
//Due Tomorrow tasks
,GeneralRiskAssessmentsTasksDueTomorrow = employeeTasks.GeneralRiskAssessmentTasksDueTomorrow
.Where(task => CanSendTaskDueTomorrowNotification(task, employee))
.Select(MapToTaskDetails).ToList()
,PersonalRiskAssessmentTasksDueTomorrow = employeeTasks.PersonalRiskAssessmentTasksDueTomorrow
.Where(task => CanSendTaskDueTomorrowNotification(task, employee))
.Select(MapToTaskDetails).ToList()
,FireRiskAssessmentsTasksDueTomorrow = employeeTasks.FireRiskAssessmentTasksDueTomorrow
.Where(task => CanSendTaskDueTomorrowNotification(task, employee))
.Select(MapToTaskDetails).ToList()
,HazardousSubstanceRiskAssessmentTasksDueTomorrow = employeeTasks.HazardousSubstanceTasksDueTomorrow
.Where(task => CanSendTaskDueTomorrowNotification(task, employee))
.Select(MapToTaskDetails).ToList()
,RiskAssessmentReviewTasksDueTomorrow = employeeTasks.RiskAssessmentReviewTasksDueTomorrow
.Where(task => CanSendReviewTaskDueTomorrowNotification(task, employee))
.Select(MapToTaskDetails).ToList()
,ResponsibilitiesTasksDueTomorrow = employeeTasks.ResponsibilityTasksDueTomorrow
.Where(task => CanSendTaskDueTomorrowNotification(task, employee))
.Select(MapToTaskDetails).ToList()
,ActionTasksDueTomorrow = employeeTasks.ActionTasksDueTomorrow
.Where(task => CanSendActionTaskDueTomorrowNotification(task, employee))
.Select(MapToTaskDetails).ToList()
};
return employeeDigestEmail;
}
示例7: Given_contact_details_with_email_When_GetEmail_Then_should_return_correct_result
public void Given_contact_details_with_email_When_GetEmail_Then_should_return_correct_result()
{
// Given
var employee = new Employee()
{
ContactDetails = new List<EmployeeContactDetail>()
{
new EmployeeContactDetail()
{
Email = "[email protected]"
}
}
};
// When
var result = employee.GetEmail();
// Then
Assert.That(result, Is.EqualTo("[email protected]"));
}
示例8: Given_a_checklist_with_an_employee_as_persons_seen_then_person_seen_model_is_correct
public void Given_a_checklist_with_an_employee_as_persons_seen_then_person_seen_model_is_correct()
{
//GIVEN
var employee1 = new Employee() { Id = Guid.NewGuid(), Forename = "Ilyn", Surname = "Payne"};
employee1.SetEmail("[email protected]", null);
var employee2 = new Employee() {Id = Guid.NewGuid() };
var checklist = new Checklist() {Id = Guid.NewGuid()};
checklist.AddPersonSeen(ChecklistPersonSeen.Create(employee1));
checklist.AddPersonSeen(ChecklistPersonSeen.Create(employee2));
checklistRepo.Setup(x => x.GetById(It.IsAny<Guid>()))
.Returns(() => checklist);
//when
var target = new ChecklistController(dependencyFactory.Object);
var result = target.GetChecklist(checklist.Id);
//THEN
Assert.That(result.PersonsSeen.Count,Is.EqualTo(2));
Assert.That(result.PersonsSeen[0].EmployeeId, Is.EqualTo(employee1.Id));
Assert.That(result.PersonsSeen[0].FullName, Is.EqualTo(employee1.FullName));
Assert.That(result.PersonsSeen[0].EmailAddress, Is.EqualTo(employee1.GetEmail()));
}
示例9: Employee
public void Given_an_employee_is_a_persons_seen_and_is_removed_WHEN_PostChecklist_then_removed_from_persons_seen_list()
{
//GIVEN
var employee1 = new Employee() { Id = Guid.Parse("11111111-ef43-4bc6-87a6-8cf48f1fcae7"), Forename = "Ser Lorus", Surname = "Tyrell" };
var employee2 = new Employee() { Id = Guid.Parse("22222222-ef43-4bc6-87a6-8cf48f1fcae7"), Forename = "Maid", Surname = "of Tarth" };
var personsSeenViewModel = new PersonsSeenViewModel() { Id = Guid.NewGuid(), EmployeeId = employee2.Id, EmailAddress = employee2.GetEmail(), FullName = employee2.FullName };
var viewModel = new ChecklistViewModel();
viewModel.Id = Guid.NewGuid();
viewModel.SiteId = 123;
viewModel.ClientId = 7227;
viewModel.Status = Checklist.STATUS_DRAFT;
viewModel.PersonsSeen.Add(personsSeenViewModel);
var checklist = new Checklist { Id = viewModel.Id, Status = Checklist.STATUS_DRAFT };
checklist.AddPersonSeen(ChecklistPersonSeen.Create(employee1));
_employeeRespository
.Setup(x => x.GetById(It.IsAny<Guid>()))
.Returns<Guid>((id) => new Employee() {Id = id});
_checklistRepository
.Setup(x => x.GetById(viewModel.Id))
.Returns(() => checklist);
Checklist savedChecklist = null;
_checklistRepository.Setup(x => x.SaveOrUpdate(It.IsAny<Checklist>()))
.Callback(
delegate(Checklist x)
{
savedChecklist = x;
}
);
var controller = GetTarget();
controller.Request = new HttpRequestMessage();
controller.Request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration());
//WHEN
controller.PostChecklist(viewModel.Id, viewModel);
//THEN
Assert.That(savedChecklist.PersonsSeen.Count, Is.EqualTo(1));
}
示例10: Given_employee_is_a_persons_seen_WHEN_PostChecklist_then_employee_added_to_persons_seen_list
public void Given_employee_is_a_persons_seen_WHEN_PostChecklist_then_employee_added_to_persons_seen_list()
{
//GIVEN
var employee = new Employee() {Id = Guid.NewGuid(), Forename = "Ser Lorus", Surname = "Tyrell"};
var personsSeenViewModel = new PersonsSeenViewModel() { Id = Guid.NewGuid(), EmployeeId = employee.Id, EmailAddress = employee.GetEmail(), FullName = employee.FullName };
var viewModel = new ChecklistViewModel();
viewModel.Id = Guid.NewGuid();
viewModel.SiteId = 123;
viewModel.ClientId = 7227;
viewModel.Status = Checklist.STATUS_DRAFT;
viewModel.PersonsSeen.Add(personsSeenViewModel);
_employeeRespository
.Setup(x => x.GetById(personsSeenViewModel.EmployeeId.Value))
.Returns(() => new Employee() { Id = personsSeenViewModel.EmployeeId.Value, Forename = "Ser Lorus", Surname = "Tyrell"});
_checklistRepository
.Setup(x => x.GetById(viewModel.Id))
.Returns(() => new Checklist { Id = viewModel.Id, Status = Checklist.STATUS_DRAFT });
Checklist savedChecklist = null;
_checklistRepository.Setup(x => x.SaveOrUpdate(It.IsAny<Checklist>()))
.Callback(
delegate(Checklist x)
{
savedChecklist = x;
}
);
var controller = GetTarget();
controller.Request = new HttpRequestMessage();
controller.Request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration());
//WHEN
controller.PostChecklist(viewModel.Id, viewModel);
//THEN
Assert.That(savedChecklist.PersonsSeen.Count, Is.EqualTo(1));
Assert.That(savedChecklist.PersonsSeen[0].Employee.Id, Is.EqualTo(personsSeenViewModel.EmployeeId));
Assert.That(savedChecklist.PersonsSeen[0].FullName, Is.EqualTo(personsSeenViewModel.FullName));
Assert.That(savedChecklist.PersonsSeen[0].EmailAddress, Is.EqualTo(personsSeenViewModel.EmailAddress));
}