// GET: Claim/Create public ActionResult Create(string returnUrl) { List <ExistingClientsViewModel> clients; clients = Uow.Clients.GetAll() .Where(c => c.Policies.Count() != 0) .ProjectTo <ExistingClientsViewModel>().ToList(); foreach (var item in clients) { if (item.IsOrganization) { item.ClientName = item.OrganizationName; } } var vm = new ClaimItemViewModel { Clients = clients.OrderBy(c => c.ClientName).ToList(), StatusName = "New", ClaimDate = DateTime.Now, ReturnUrl = returnUrl }; return(View(vm)); }
public void SetClaims(List <ClaimDto> claims) { _dialogService.ShowLoadingIndicator("Loading..."); DispatcherHelper.RunAsync(() => { // save payment settings ClaimItemViewModel [] old = new ClaimItemViewModel[ClaimItems.Count]; ClaimItems.CopyTo(old, 0); ClaimItems.Clear(); foreach (var c in claims) { var oldClaim = old.FirstOrDefault(m => m.Id == c.Id); var numberOfPayments = oldClaim?.NumberOfPayments ?? c.NumberOfPayments; var firstMonthlyPaymentDate = oldClaim?.FirstMonthlyPaymentDate ?? c.FirstMonthlyPaymentDate; var downPayment = oldClaim?.DownPayment ?? c.DownPayment; ClaimItems.Add(new ClaimItemViewModel(this, _paymentsCalculationViewModel) { Id = c.Id, ProviderId = c.ProviderId, Date = c.Date, PatientName = c.PatientName, ChewsiId = c.ChewsiId, State = c.State, StatusText = c.StatusText, PatientId = c.PatientId, SubscriberFirstName = c.SubscriberFirstName, IsClaimStatus = c.IsClaimStatus, IsCptError = c.IsCptError, ClaimNumber = c.ClaimNumber, FirstMonthlyPaymentDate = firstMonthlyPaymentDate, DownPayment = downPayment, NumberOfPayments = numberOfPayments, Locked = false, PmsModifiedDate = c.PmsModifiedDate, EligibleForPayments = c.EligibleForPayments }); } _dialogService.HideLoadingIndicator(); }); }