Esempio n. 1
0
        public IViewComponentResult Invoke(AgencyRepresentativeViewModel model)
        {
            var person = _personRepository.GetById(model.PersonId);

            model.EmployeeCode     = person.Code;
            model.EmployeeName     = person.PrimaryName;
            model.EmployeePosition = person.PersonCustomerWorkings.FirstOrDefault(w => w.IsWorking && w.IsMainPosition)?.Position;
            model.EmployeeEmail    = person.ContactInfo.Emails.FirstOrDefault(e => e.IsPrimary)?.Email;
            model.EmployeePhone    = person.ContactInfo.Phones.FirstOrDefault(p => p.IsPrimary)?.PhoneNumber;
            return(View(model));
        }
 public IActionResult AddAgencyRepresentative(AgencyRepresentativeViewModel model)
 {
     return(ViewComponent("AgencyRepresentative", new { model }));
 }