示例#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));
        }
示例#2
0
        public async Task <ActionResult> GetDepartments(long countryId)
        {
            var service = new TypesService();
            var deps    = await service.GetDepartments(countryId);

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