Example #1
0
        public ActionResult edit(string Id, string BackUrl)
        {
            CustomerViewModel viewModelCustomer;
            Customer          customer = _customerService.GetCustomer(Guid.Parse(Id));

            viewModelCustomer = Mapper.Map <Customer, CustomerViewModel>(customer);
            viewModelCustomer.PetCollection    = _customerPetService.GetPetsByCustomerId(Guid.Parse(Id)).ToList();
            viewModelCustomer.CustomerKeysList = _customerKeysService.GetCustomerKeys(Guid.Parse(Id)).ToList();
            viewModelCustomer.Type             = _employeeTypeService.GetAllEmployeeTypesDropdown();
            viewModelCustomer.PetList          = _petService.GetAllPetDropdown();
            // viewModelCustomer.PetId = customerFormViewModel.PetId;
            return(View(viewModelCustomer));
        }
 public CustomerListModel ConvertToModel(Customer item)
 {
     return(new CustomerListModel
     {
         Id = item.Id,
         Active = item.Active,
         del = item.del,
         Address = item.Street + ", " + item.PostCode + " " + item.City,
         Email = item.Email,
         CustomerId = item.CustomerId,
         HourlyRate = item.HourlyRate,
         Name = item.Name,
         Tlf = item.Tlf,
         Type = employeeTypeRepository.GetById(item.TypeId).Name,
         CVR = item.CVR,
         EAN = item.EAN,
         CustomerKeysList = customerKeysService.GetCustomerKeys(item.Id).ToList()
     });
 }