public ActionResult Create() { var project = new Project(); ViewBag.Technologies = new SelectList(technologyService.GetAll(), "Id", "Name", project.TechnologyId); return(View(project)); }
// GET: Project public ActionResult Index() { var projects = projectService.GetAll(); ViewBag.Technologies = technologyService.GetAll(); return(View(projects)); }
public IActionResult Get() { try { var tecnologies = _technologyService.GetAll <TechnologyDto>(); if (tecnologies == null) { return(BadRequest()); } return(Json(tecnologies)); } catch (Exception ex) { return(StatusCode((int)HttpStatusCode.BadRequest, new ErrorResponse(ex))); } }
// GET: Admin/Project/Create public ActionResult Create() { var viewModel = new ProjectViewModel { ClientsSelectList = Mapper.Map <List <Client>, List <SelectListItem> >(_clientService.GetAll()), StartDate = DateTime.Now, EndDate = DateTime.Now }; viewModel.TechnologiesSelectList = Mapper.Map <List <Technology>, List <SelectListItem> >(_technologyService.GetAll()); viewModel.ContributorsSelectList = Mapper.Map <List <User>, List <SelectListItem> >(_userService.GetAll()); viewModel.ServicesSelectList = Mapper.Map <List <Service>, List <SelectListItem> >(_serviceService.GetAll()); AddLocales(viewModel.Locales, (locale, languageId) => { }); return(View(viewModel)); }
// GET: Admin/User/Edit public ActionResult Edit(int id) { var entity = _userService.GetById(id); var viewModel = Mapper.Map <User, UserViewModel>(entity); viewModel.TechnologiesSelectList = Mapper.Map <List <Technology>, List <SelectListItem> >(_technologyService.GetAll()); viewModel.TechnologiesSelectList.ForEach(item => { item.Selected = viewModel.TechnologiesIds.Contains(int.Parse(item.Value)); }); AddLocales(viewModel.Locales, (locale, languageId) => { locale.Title = entity.GetLocalized(x => x.Title, languageId); locale.Biography = entity.GetLocalized(x => x.Biography, languageId); locale.UserName = entity.GetLocalized(x => x.UserName, languageId); }); return(View(viewModel)); }
// GET: Admin/Vacancy/Create public ActionResult Create() { var viewModel = new VacancyViewModel { CreatedDate = DateTime.Now, }; viewModel.TechnologiesSelectList = Mapper.Map <List <Technology>, List <SelectListItem> >(_technologyService.GetAll()); AddLocales(viewModel.Locales, (locale, languageId) => { }); return(View(viewModel)); }
// GET: Admin/Technology public ActionResult Index() { var viewModel = Mapper.Map <List <Technology>, List <TechnologyViewModel> >(_technologyService.GetAll()); return(View(viewModel)); }
public ActionResult Index() { var technology = technologyService.GetAll(); return(View(technology)); }