// GET: Create Claim public async Task <ActionResult> AddClaim() { var customer = await ClaimUtil.GetCustomerMock(); ViewBag.MockInfo = new AddClaimViewModel { CustomerId = customer.Id, CustomerVehicleId = customer.Vehicles.First().Id, UserPhotoPath = AppSettings.CustomerMock.UserPhotoPath, DriverLicensePath = AppSettings.CustomerMock.DriverLicensePath, LicensePlatePath = AppSettings.CustomerMock.LicensePlatePath, PolicyIDPath = AppSettings.CustomerMock.PolicyIDPath, CrashImagesPaths = AppSettings.CustomerMock.CrashImagesPaths, SelectedVehiclePath = AppSettings.CustomerMock.SelectedVehiclePath }; return(View()); }
public async Task <ActionResult> AddClaim(string phonenumber, string description) { var newGuid = Guid.NewGuid(); var otherPartyImages = ClaimUtil.GetOtherPartyImages(); var claimImages = ClaimUtil.GetClaimImages(newGuid); var customer = await ClaimUtil.GetCustomerMock(); var vehicle = customer.Vehicles.First(); var postImages = new { otherPartyImages = otherPartyImages.Select(otherImg => new { plateJson = otherImg.Item1, kind = otherImg.Item2 }).ToArray(), claimImages = claimImages.Select(claimImg => new { plateJson = claimImg.Item1, imgName = claimImg.Item2 }).ToArray(), }; var response = await PostTo(AppSettings.CreateMobileClaimFromWebUrl, new { claimId = newGuid.ToString(), description = description ?? string.Empty, phonenumber = phonenumber ?? string.Empty, userId = customer.UserId, vehicleId = vehicle.Id, postImages = postImages }); return(Json(new { success = true })); }