public async Task <ActionResult> UpdateIndex(long id) { var service = new CustomerService(); var types = new TypesService(); var model = new CustomerModel(); var result = await service.ReadCustomerByIdOrName(id); if (result.Code == 200) { var documentTypes = await types.GetDocumentTypes(); var countries = await types.GetCountries(); var departments = await types.GetDepartments(result.Data.CountryId); var cities = await types.GetCities(result.Data.DepartmentId, result.Data.CountryId); model = result.Data; model.DocumentTypes = documentTypes.Data; model.Countries = countries.Data; model.Departments = departments.Data; model.Cities = cities.Data; } return(View(model)); }
public async Task <ActionResult> CreateIndex() { var service = new TypesService(); var model = new CustomerModel(); var documentsTypes = await service.GetDocumentTypes(); var countries = await service.GetCountries(); model.DocumentTypes = documentsTypes.Data; model.Countries = countries.Data; return(View(model)); }