Ejemplo n.º 1
0
        public ActionResult Create()
        {
            var project = new Project();

            ViewBag.Technologies = new SelectList(technologyService.GetAll(), "Id", "Name", project.TechnologyId);
            return(View(project));
        }
Ejemplo n.º 2
0
        // GET: Project
        public ActionResult Index()
        {
            var projects = projectService.GetAll();

            ViewBag.Technologies = technologyService.GetAll();
            return(View(projects));
        }
Ejemplo n.º 3
0
        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)));
            }
        }
Ejemplo n.º 4
0
        // 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));
        }
Ejemplo n.º 5
0
        // 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));
        }
Ejemplo n.º 6
0
        // 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));
        }
Ejemplo n.º 7
0
        // 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));
        }