Ejemplo n.º 1
0
 // 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());
 }
Ejemplo n.º 2
0
        // 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));
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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;
            }));
        }
Ejemplo n.º 5
0
        // GET: Admin/County
        public ActionResult Index()
        {
            var counties         = countyService.GetAll();
            var countyViewModels = Mapper.Map <IEnumerable <CountyViewModel> >(counties);

            return(View(countyViewModels));
        }
Ejemplo n.º 6
0
        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 }));
        }
Ejemplo n.º 7
0
        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));
        }
Ejemplo n.º 8
0
        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;
        }
Ejemplo n.º 9
0
 // GET: Admin/Counties
 public IActionResult Index()
 {
     return(View(countyService.GetAll()));
 }