public UnderwriterClaimEditViewModel(ClaimDomainModel claim) { Id = claim.Id; Status = new ClaimStatusViewModel(claim.Status); LastModified = claim.WhenLastModified.ToString(); Notes = new List <NoteViewModel>(); //InitializeNotes(); }
public UnderwriterClaimViewModel(ClaimDomainModel claim) { Id = claim.Id; PolicyId = claim.Policy.Id; DeviceName = claim.Policy.DeviceName; PolicyHolderName = $"{claim.CustomerFirstName} {claim.CustomerLastName}"; Start = $"{claim.WhenStarted.ToShortDateString()} {claim.WhenStarted.ToShortTimeString()}"; Status = new ClaimStatusViewModel(claim.Status); Notes = new List <NoteViewModel>(); //InitializeNotes(); }
public static Status Map(ClaimStatusViewModel viewModel, Status entity) { if (viewModel == null || entity == null) { return(null); } entity.Id = viewModel.ClaimStatusId; entity.Name = viewModel.Status; entity.SortOrder = viewModel.SortOrder; entity.IsActive = viewModel.IsActive; return(entity); }
public async Task <ClaimStatusViewModel> Create(ClaimStatusViewModel viewModel) { var claimStatus = this.ClaimStatusRepository.Add(ViewModelToEntityMapper.Map(viewModel)); if (claimStatus.Id > 0) { viewModel.ClaimStatusId = claimStatus.Id; } else { viewModel.HasError = true; } return(viewModel); }
public static Status Map(ClaimStatusViewModel viewModel) { if (viewModel == null) { return(null); } return(new Status { Id = viewModel.ClaimStatusId, Name = viewModel.Status, SortOrder = viewModel.SortOrder, IsActive = viewModel.IsActive }); }
public async Task <ClaimStatusViewModel> Update(ClaimStatusViewModel viewModel) { var ClaimStatus = this.ClaimStatusRepository.Find(viewModel.ClaimStatusId); if (ClaimStatus != null && ClaimStatus.IsActive) { var lastModifiedDate = ClaimStatus.LastModifiedDate; ClaimStatus = this.ClaimStatusRepository.Update(ViewModelToEntityMapper.Map(viewModel, ClaimStatus)); if (lastModifiedDate < ClaimStatus.LastModifiedDate) { return(viewModel); } else { viewModel.HasError = true; } } return(viewModel); }