Esempio n. 1
0
 public IActionResult AddEducation(Education entity)
 {
     ViewBag.resumepages = new SelectList(_resumepageService.GetAll(), "ResumepageId", "ResumepageTitle");
     if (ModelState.IsValid)
     {
         _educationService.Create(entity);
         TempData.Put("message", new ResultMessage()
         {
             Title   = "Bildirim",
             Message = "Eğitim Bilgisi başarılı bir şekilde oluşturuldu.",
             Css     = "success"
         });
         return(RedirectToAction("Educations"));
     }
     return(View(entity));
 }
        public ActionResult Create([FromRoute] int systemUserId, [FromBody] NewEducationViewModel model)
        {
            var education = new UserEducationModel()
            {
                DateAttendedEnd    = model.DateAttendedEnd,
                DateAttendedStart  = model.DateAttendedStart,
                Degree             = model.Degree,
                IsCurrentEducation = model.IsCurrentEducation,
                ModeOfStudy        = model.ModeOfStudy,
                School             = model.School,
                SystemUserId       = systemUserId
            };

            _educationService.Create(education);
            return(Ok(MessageHelper.Success("The education have been created.")));
        }
Esempio n. 3
0
        public async Task <IActionResult> Create(ProgrammeRequest model)
        {
            if (model == null)
            {
                return(BadRequest());
            }
            var programme = model.ToProgramme();

            try
            {
                await _context.Create(programme);
            }
            catch (Exception e)
            {
                return(Conflict(e.Message));
            }

            return(NoContent());
        }
Esempio n. 4
0
        public IActionResult Create(JobSeekerEducationViewModelContainer jobSeekerEducationViewModelContainer)
        {
            var seekerId = HttpContext.Session.Get <string>("JobSeekerId");

            //call create method.
            if (ModelState.IsValid)
            {
                TempData["EducationCreate"] = "Education Create Successfully";
                jobSeekerEducationViewModelContainer.JobSeekerEducationViewModel.JobSeekerId = seekerId;
                educationService.Create(jobSeekerEducationViewModelContainer.JobSeekerEducationViewModel);
                //Redirect to success page
                logger.LogInformation("Created Education successfully");
                return(View("Index", new JobSeekerEducationViewModelContainer {
                    Qualifications = jobSeekerService.GetQualification()
                }));
            }

            return(View("Index", new JobSeekerEducationViewModelContainer {
                Qualifications = jobSeekerService.GetQualification()
            }));
        }