示例#1
0
        public ActionResult FullEdit(CvViewModel model)
        {
            updatePs(model);
            updateEdu(model);

            return(RedirectToAction("CV"));
        }
示例#2
0
        public async Task <CvViewModel> GetCvViewModel()
        {
            CvViewModel cvViewModel = new CvViewModel
            {
                PersonalDataViewModel =
                    new PersonalDataViewModel()
                {
                    Address           = "Borbowiecka 3A/208",
                    City              = "Warszawa",
                    PostCode          = "00-728",
                    FirstName         = "Damian",
                    LastName          = "Dziura",
                    PersonalPhotoLink = "/Assets/img/author_image.png"
                },
                ContactDataViewModel = new ContactDataViewModel()
                {
                    EmailAddress = "*****@*****.**",
                    GitHubLink   = "https://github.com/Dymekk208j",
                    HomePageLink = "www.DamianDziura.pl",
                    PhoneNumber  = "+48 510-075-067"
                },
                Projects            = await GetProjectsViewModel(),
                Technologies        = await _technologyLogic.GetTechnologiesToShowInCv(),
                Achievements        = await _achievementLogic.GetAchievementsToShowInCvAsync(),
                EmploymentHistories = await _employmentHistoryLogic.GetEmploymentHistoriesToShowInCvAsync(),
                ExtraInformation    = await _extraInformationLogic.GetExtraInformationToShowInCvAsync(),
                Educations          = await _educationLogic.GetEducationsToShowInCvAsync()
            };

            return(cvViewModel);
        }
示例#3
0
        public void updateEdu(CvViewModel model)
        {
            PersonalStatment ps;
            int id = model.qual[0].EduLevel_ID.Value;

            //1. Get statement from DB
            using (var db = new CVContext())
            {
                ps = db.personal.Where(s => s.iD == id).FirstOrDefault();
            }

            //2. change statement in disconnected mode (out of ctx scope)
            if (ps != null)
            {
                ps.PStatment = model.personal[0].PStatment;
            }

            //save modified entity using new Context
            using (var dbtx = new CVContext())
            {
                //3. Mark entity as modified
                dbtx.Entry(ps).State = EntityState.Modified;

                //4. call SaveChanges
                dbtx.SaveChanges();
            }
        }
示例#4
0
        public ViewResult Cv(int id)
        {
            CvViewModel CompleteCv      = new CvViewModel();
            Assigment   assigment       = new Assigment();
            Assigment   focusassingment = new Assigment();
            Employee    employee        = new Employee();

            Expertise  expertise  = new Expertise();
            Middleware middelware = new Middleware();
            Training   training   = new Training();
            Trade      trade      = new Trade();
            Technique  tech       = new Technique();

            var emp = EmployeeService.Get(id);

            CompleteCv.Employee        = employee.GetEmployeeView(emp);
            CompleteCv.Expertises      = expertise.GetExpertiseView(id);
            CompleteCv.Middlewares     = middelware.GetMiddlewareView(id);
            CompleteCv.Techniques      = tech.GetTechniqueView(id);
            CompleteCv.Trades          = trade.GetTradeView(id);
            CompleteCv.DegreeTraining  = training.GetDegreeTrainingView(id);
            CompleteCv.Trainings       = training.GetTrainingView(id);
            CompleteCv.Assigments      = assigment.GetAllNonFocusAssignments(id);
            CompleteCv.FocusAssigments = focusassingment.GetAllFocusAssignments(id);

            return(View(CompleteCv));
        }
        public async Task <IActionResult> Index()
        {
            //Get education list
            var         workUrl = "Works";
            List <Work> works   = await ApiHelper.GetAllObjects <Work>(workUrl);

            //Get education list
            var educationUrl            = "Educations";
            List <Education> educations = await ApiHelper.GetAllObjects <Education>(educationUrl);

            //Get project list
            var            projectUrl = "Projects";
            List <Project> projects   = await ApiHelper.GetAllObjects <Project>(projectUrl);

            //Get personal information list
            var personalInformationUrl = "PersonalInformations";
            List <PersonalInformation> personalInformation = await ApiHelper.GetAllObjects <PersonalInformation>(personalInformationUrl);

            //set value of list
            var viewModel = new CvViewModel
            {
                PersonalInformations = personalInformation,
                Educations           = educations,
                Projects             = projects,
                Works = works,
            };

            return(View(viewModel));
            //list of personal infomation
        }
 public ActionResult AddAchievementToCv(CvViewModel cvModel)
 {
     if (_repository.ChangeStatusInCv(cvModel.SelectedAchievement))
     {
         return(RedirectToAction("EditCv", "AdminPanel"));
     }
     return(RedirectToAction("ErrorPage"));
 }
示例#7
0
        public ActionResult ShowAll()
        {
            CvViewModel vm = new CvViewModel();

            vm.EducationInfo   = db.tbl_Education.ToList();
            vm.ExperiencesInfo = db.tbl_Experiences.ToList();


            return(View(vm));
        }
        public ActionResult AddEmploymentHistoryToCv(CvViewModel cvModel)
        {
            EmploymentHistory employmentHistory = _repository.Get(cvModel.SelectedEmploymentHistory);

            if (employmentHistory != null)
            {
                employmentHistory.ShowInCv = true;
                _repository.Update(employmentHistory);
            }

            return(RedirectToAction("EditCv", "AdminPanel"));
        }
示例#9
0
        public ActionResult AddEducationToCv(CvViewModel cvModel)
        {
            Education education = _repository.Get(cvModel.SelectedEducation);

            if (education != null)
            {
                education.ShowInCv = true;
                _repository.Update(education);
            }

            return(RedirectToAction("EditCv", "AdminPanel"));
        }
示例#10
0
        public ActionResult CVEdit(CvViewModel model)
        {
            CvViewModel model1 = new CvViewModel();

            using (CVDataModelContext cvData = new CVDataModelContext())

            {
                //UPDATE METHOD HERE
            }

            return(RedirectToAction("CV", "Home"));
        }
        public ActionResult AddToCv(CvViewModel cvModel, Technology.LevelOfKnowledge levelOfKnowledge)
        {
            Technology technology = _repository.Get(cvModel.SelectedTechnology);

            if (technology != null)
            {
                technology.ShowInCv       = true;
                technology.KnowledgeLevel = levelOfKnowledge;

                _repository.Update(technology);
            }

            return(RedirectToAction("EditCv", "AdminPanel"));
        }
        public void Redirect_to_Error_Page_when_adding_achievement_to_CV_if_it_does_not_exist()
        {
            //Arrange
            CvViewModel cvViewModel = new CvViewModel()
            {
                SelectedAchievement = -1
            };

            //Act
            RedirectToRouteResult result = _controller.AddAchievementToCv(cvViewModel) as RedirectToRouteResult;

            //Assert
            Assert.NotNull(result);
            Assert.Equal("ErrorPage", result.RouteValues["action"]);
        }
示例#13
0
        public ActionResult EditCvPages(PrivateInformationViewModel privateInformationViewModel)
        {
            _cvViewModel = new CvViewModel();
            _db          = new ApplicationDbContext();

            _cvViewModel.PrivateInformationViewModel = privateInformationViewModel;

            GetAchivments();
            GetAdditionalInfos();
            GetEducations();
            GetEmploymentHistories();
            GetProjects();
            GetTechnologies();

            return(View("cvmgt/Index", _cvViewModel));
        }
        public ActionResult PrintPDF()
        {
            _cvViewModel = new CvViewModel();
            _db          = new ApplicationDbContext();

            _cvViewModel.PrivateInformationViewModel = new PrivateInformationViewModel();

            GetAchivments();
            GetAdditionalInfos();
            GetEducations();
            GetEmploymentHistories();
            GetProjects();
            GetTechnologies();

            return(View(_cvViewModel));
        }
        public void Redirect_To_EditAction_In_AdminPanelController_When_Selected_Achievement_is_exist_while_adding_to_cv()
        {
            //Arrange
            CvViewModel cvViewModel = new CvViewModel()
            {
                SelectedAchievement = 1
            };

            //Act
            RedirectToRouteResult result = (RedirectToRouteResult)_controller.AddAchievementToCv(cvViewModel);

            //Assert
            Assert.NotNull(result);
            Assert.Equal("EditCv", result.RouteValues["action"]);
            Assert.Equal("AdminPanel", result.RouteValues["controller"]);
        }
        public ActionResult PrintCv()
        {
            CvViewModel cvViewModel = new CvViewModel()
            {
                Contact             = _contactRepository.GetAll().FirstOrDefault(),
                PrivateInformation  = _privateInformationRepository.GetAll().FirstOrDefault(),
                Achievements        = _achievementRepository.GetAll().ToList(),
                AdditionalInfos     = _additionalInformationRepository.GetAll().ToList(),
                Educations          = _educationRepository.GetAll().ToList(),
                EmploymentHistories = _employmentHistoryRepository.GetAll().ToList(),
                Projects            = _projectsRepository.GetAll().ToList(),
                Technologies        = _technologyRepository.GetAll().ToList()
            };

            return(View(cvViewModel));
        }
示例#17
0
        //Model1 dbModel = new Model1();


        // GET: CV
        public ActionResult CV()
        {
            CvViewModel model = new CvViewModel();

            //model.edu = dbModel.tblEducationLevels.ToList();
            //model.instit = dbModel.tblInstitutions.ToList();
            //model.personal = dbModel.tblPersonalStatements.ToList();
            //model.qual = dbModel.tblQualifications.ToList();


            model.edu      = cvcontext.education.ToList();
            model.qual     = cvcontext.qualification.ToList();
            model.personal = cvcontext.personal.ToList();
            model.instit   = cvcontext.institute.ToList();

            return(View(model));
        }
示例#18
0
        public ActionResult AddAdditionalInfoToCv(CvViewModel cvModel)
        {
            try
            {
                AdditionalInfo additionalInfo = _repository.Get(cvModel.SelectedAddtinionaInformation);
                additionalInfo.ShowInCv = true;
                if (_repository.Update(additionalInfo))
                {
                    return(RedirectToAction("EditCv", "AdminPanel"));
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            return(View("ErrorPage"));
        }
示例#19
0
        public ActionResult AddAchivmentToCv(CvViewModel cvModel)
        {
            _db = new ApplicationDbContext();

            var cvm = (from u in _db.Achivments
                       where u.AchivmentId == cvModel.SelectedAchivment
                       select u).FirstOrDefault();

            if (cvm == null)
            {
                return(RedirectToAction("EditCvPage"));
            }

            cvm.ShowInCv         = true;
            _db.Entry(cvm).State = System.Data.Entity.EntityState.Modified;
            _db.SaveChanges();

            return(RedirectToAction("EditCvPage"));
        }
示例#20
0
        public ActionResult CV()
        {
            CvViewModel model = new CvViewModel();

            using (CVDataModelContext cvData = new CVDataModelContext())
            {
                model.personalStatements = cvData.personalStatements.ToList();

                model.educationLevels = cvData.educationLevels.ToList();
                model.institutions    = cvData.institutions.ToList();
                model.qualifications  = cvData.qualifications.ToList();

                model.interestes  = cvData.interestes.ToList();
                model.experiences = cvData.experiences.ToList();

                model.CVReferences1 = cvData.CVReferences1.ToList();
            }

            return(View(model));
        }
示例#21
0
        public ActionResult AddToCvKnowTechnology(CvViewModel cvModel)
        {
            _db = new ApplicationDbContext();

            var cvm = (from u in _db.Technologies
                       where u.TechnologyId == cvModel.SelectedTechnology
                       select u).FirstOrDefault();

            if (cvm == null)
            {
                return(RedirectToAction("EditCvPage"));
            }

            cvm.ShowInCv         = true;
            cvm.LevelOfKnowledge = 2;
            _db.Entry(cvm).State = System.Data.Entity.EntityState.Modified;
            _db.SaveChanges();

            return(RedirectToAction("EditCvPage"));
        }
示例#22
0
        // GET: Employees/Details/5
        public async Task <IActionResult> Details(int id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var      context  = new SqlLiteContext();
            Employee employee = await context.Employees
                                .FirstOrDefaultAsync(m => m.EmployeeId == id);

            if (employee == null)
            {
                return(NotFound());
            }

            CvViewModel CompleteCv      = new CvViewModel();
            Assigment   assigment       = new Assigment();
            Assigment   focusassingment = new Assigment();

            Expertise  expertise  = new Expertise();
            Middleware middelware = new Middleware();
            Training   training   = new Training();
            Trade      trade      = new Trade();
            Technique  tech       = new Technique();


            CompleteCv.Employee        = employee.GetEmployeeView(employee);
            CompleteCv.Expertises      = expertise.GetExpertiseView(id);
            CompleteCv.Middlewares     = middelware.GetMiddlewareView(id);
            CompleteCv.Techniques      = tech.GetTechniqueView(id);
            CompleteCv.Trades          = trade.GetTradeView(id);
            CompleteCv.DegreeTraining  = training.GetDegreeTrainingView(id);
            CompleteCv.Trainings       = training.GetTrainingView(id);
            CompleteCv.Assigments      = assigment.GetAllNonFocusAssignments(id);
            CompleteCv.FocusAssigments = focusassingment.GetAllFocusAssignments(id);

            return(View(CompleteCv));
        }
示例#23
0
        public ActionResult AddProjectToCv(CvViewModel cvModel)
        {
            _repository.AddToPortfolio(cvModel.SelectedProject);

            return(RedirectToAction("EditCv", "AdminPanel"));
        }