// GET: Admin/Companies/Create public IActionResult Create() { ViewData["CityId"] = new SelectList(cityService.GetAll(), "Id", "Name"); ViewData["CountryId"] = new SelectList(countryService.GetAll(), "Id", "Name"); ViewData["CountyId"] = new SelectList(countyService.GetAll(), "Id", "Name"); ViewData["SectorId"] = new SelectList(sectorService.GetAll(), "Id", "Name"); return(View()); }
// GET: Admin/Resumes/Create public IActionResult Create() { var resume = new Resume(); ViewData["CityId"] = new SelectList(cityService.GetAll(), "Id", "Name"); ViewData["CountryId"] = new SelectList(countryService.GetAll(), "Id", "Name"); ViewData["CountyId"] = new SelectList(countyService.GetAll(), "Id", "Name"); ViewData["OccupationId"] = new SelectList(occupationService.GetAll(), "Id", "Name"); return(View(resume)); }
public IList <County> GetCounties(string cityId) { IList <County> counties; if (string.IsNullOrEmpty(cityId)) { counties = countyService.GetAll().ToList(); } counties = countyService.GetAll().Where(r => r.CityId == cityId).OrderBy(o => o.Name).ToList(); return(counties); }
public HttpResponseMessage GetAll(HttpRequestMessage request) { return(CreateHttpResponse(request, () => { var list = _countyService.GetAll(); var responseData = Mapper.Map <IEnumerable <County>, IEnumerable <CountyViewModel> >(list); var response = request.CreateResponse(HttpStatusCode.OK, responseData); return response; })); }
// GET: Admin/County public ActionResult Index() { var counties = countyService.GetAll(); var countyViewModels = Mapper.Map <IEnumerable <CountyViewModel> >(counties); return(View(countyViewModels)); }
public JsonResult GetCounties(Guid CityId) { if (CityId == null) { return(Json(new { success = false, message = "hata!" })); } var counties = countyService.GetAll(w => w.CityId == CityId).Select(c => new { Id = c.Id, Name = c.Name }); return(Json(new { success = true, counties = counties })); }
public ActionResult AddEdit(long?id) { OrderViewModel viewModel = new OrderViewModel(); if (id != null) { viewModel.Order = orderService.FindOrderById((long)id).CreateFromServerToClient(); } viewModel.Counties = countyService.GetAll(); viewModel.OrderStatuses = orderStatusService.GetAll(); return(View(viewModel)); }
public async Task WhenToRunTheGetAllMethod() { _serviceMock = new Mock <ICountyService>(); _serviceMock.Setup(m => m.GetAll()).ReturnsAsync(listCountyDto); _serviceCounty = _serviceMock.Object; var result = await _serviceCounty.GetAll(); Assert.NotNull(result); Assert.True(result.Count() == 10); var _listResult = new List <CountyDto>(); _serviceMock = new Mock <ICountyService>(); _serviceMock.Setup(m => m.GetAll()).ReturnsAsync(_listResult.AsEnumerable); _serviceCounty = _serviceMock.Object; }
// GET: Admin/Counties public IActionResult Index() { return(View(countyService.GetAll())); }