Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> GetCities(long countryId, long departmentId)
        {
            var service = new TypesService();
            var deps    = await service.GetCities(departmentId, countryId);

            return(Json(deps, JsonRequestBehavior.AllowGet));
        }