public async Task <IActionResult> Edit(int id, [Bind("ID,Title,Job_Type,Company,FromDate,ToDate,Description,Responsibilities")] WorkExperience workExperience)
        {
            if (id != workExperience.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(workExperience);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!WorkExperienceExists(workExperience.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(workExperience));
        }
Beispiel #2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,ProjectName,Description,Period,Technologies,Languages")] Projects projects)
        {
            if (id != projects.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(projects);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProjectsExists(projects.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(projects));
        }
Beispiel #3
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Skill,Proficiency")] Skills skills)
        {
            if (id != skills.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(skills);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SkillsExists(skills.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(skills));
        }
Beispiel #4
0
        public async Task <IActionResult> Edit(CurriculumVitae curriculumVitae, IFormFile image)
        {
            if (curriculumVitae == null)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    try
                    {
                        ImageFile imagefile = await GetUploadedImage(image).ConfigureAwait(false);

                        curriculumVitae.PersonalInformation.ImageFile.Content = imagefile.Content;
                    }
                    catch (Exception)
                    {
                    }
                    _context.Update(curriculumVitae);
                    await _context.SaveChangesAsync()
                    .ConfigureAwait(false);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CurriculumVitaeExists(curriculumVitae.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(curriculumVitae));
        }