public IActionResult GetByResumeId(int resumeId)
        {
            var entities = _experienceService.GetAll(resumeId);
            var model    = entities.ToModels();

            return(Ok(model));
        }
Esempio n. 2
0
        public async Task <IActionResult> Index()
        {
            var skills = await _skillService.GetAll();

            var sliders = await _homePageSliderService.GetAll();

            var messages = await _messageService.GetAll();

            var educations = await _educationService.GetAll();

            var experiences = await _experienceService.GetAll();

            var interesteds = await _interestedService.GetAll();

            var articles = await _articleService.GetAll();

            var categories = await _categoryService.GetAll();

            ViewBag.SkillCount      = skills.Data.Skills.Count;
            ViewBag.SliderCount     = sliders.Data.HomePageSliders.Count;
            ViewBag.MessageCount    = messages.Data.Messages.Count;
            ViewBag.EducationCount  = educations.Data.Educations.Count;
            ViewBag.ExperienceCount = experiences.Data.Experiences.Count;
            ViewBag.InterestedCount = interesteds.Data.Interesteds.Count;
            ViewBag.ArticleCount    = articles.Data.Articles.Count;
            ViewBag.CategoryCount   = categories.Data.Categories.Count;
            return(View());
        }
        public IActionResult LocationEdit(int?id)
        {
            if (id != null)
            {
                Location location = _LocationService.GetLocationWithCategoriesById((int)id);

                if (location != null)
                {
                    var allCategories             = _CategoryService.GetAll().ToList();
                    var categoriesOfThisLocation  = location.LocationCategoryJunctions.Select(s => s.Category).ToList();
                    var experiencesOfThisLocation = _ExperienceService.GetAll().Where(e => e.LocationId == id).ToList();
                    var locationModel             = new LocationModel()
                    {
                        Name                      = location.Name,
                        Country                   = location.Country,
                        City                      = location.City,
                        State                     = location.State,
                        Latitude                  = location.Latitude,
                        Longitude                 = location.Longitude,
                        DistanceToCenter          = location.DistanceToCenter,
                        CategoriesOfThisLocation  = categoriesOfThisLocation,
                        AllCategories             = allCategories,
                        ExperiencesOfThisLocation = experiencesOfThisLocation
                    };
                    return(View(locationModel));
                }
                ;
                return(NotFound());
            }
            return(NotFound());
        }
        public IActionResult LocationDelete(int id)
        {
            var locationToBeDeleted = _LocationService.GetById(id);

            if (locationToBeDeleted != null)
            {
                var experiencesToEdit = _ExperienceService.GetAll().Where(e => e.LocationId == id);

                foreach (var experience in experiencesToEdit)
                {
                    experience.LocationId = null;

                    _ExperienceService.Update(experience);
                }

                _LocationService.Delete(locationToBeDeleted);
            }

            return(Redirect("/admin/locationlist"));
        }
Esempio n. 5
0
        public async Task <IActionResult> Index()
        {
            var experiences = await _experienceService.GetAll();

            if (experiences.ResultStatus == ResultStatus.Error)
            {
                return(NotFound());
            }
            if (experiences.ResultStatus == ResultStatus.Success)
            {
                return(View(experiences.Data));
            }
            return(NotFound());
        }
Esempio n. 6
0
        public ActionResult <ObservableCollection <Experience> > Get()
        {
            ObservableCollection <Experience> experiences = new ObservableCollection <Experience>(_experienceService.GetAll());

            return(experiences);
        }