示例#1
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var cv = await _context.CVs.FindAsync(id);

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

            try
            {
                _context.CVs.Remove(cv);
                await _context.SaveChangesAsync();

                return(RedirectToPage("./MyCVS"));
            }
            catch (DbUpdateException)
            {
                return(RedirectToAction("./DeleteCV", new { id, saveChangesError = true }));
            }
        }
示例#2
0
        public async Task <IActionResult> OnPostAsync()
        {
            var emptyCV = new CV();

            if (await TryUpdateModelAsync <CV>(
                    emptyCV,
                    "CV",
                    c => c.Summary))
            {
                _context.CVs.Add(emptyCV);
                await _context.SaveChangesAsync();

                return(RedirectToPage("./Index"));
            }

            return(Page());
        }
示例#3
0
        public async Task <IActionResult> OnPostAsync(int id)
        {
            var emptyReference = new Reference();

            if (await TryUpdateModelAsync <Reference>(
                    emptyReference,
                    "Reference",
                    e => e.CVID,
                    e => e.ReferenceName,
                    e => e.ReferencePhoneNumber))
            {
                _context.References.Add(emptyReference);
                await _context.SaveChangesAsync();

                return(RedirectToPage("./MyCVs"));
            }

            return(Page());
        }
示例#4
0
        public async Task <IActionResult> OnPostAsync(int id)
        {
            var emptySkill = new Skill();

            if (await TryUpdateModelAsync <Skill>(
                    emptySkill,
                    "Skill",
                    e => e.CVID,
                    e => e.SkillTitle,
                    e => e.SkillText,
                    e => e.SkillRating))
            {
                _context.Skills.Add(emptySkill);
                await _context.SaveChangesAsync();

                return(RedirectToPage("./MyCVs"));
            }

            return(Page());
        }
        public async Task <IActionResult> OnPostAsync(int id)
        {
            var emptyExperience = new Experience();

            if (await TryUpdateModelAsync <Experience>(
                    emptyExperience,
                    "Experience",
                    e => e.CVID,
                    e => e.ExperienceTitle,
                    e => e.ExperienceText,
                    e => e.ExperienceDateBegin,
                    e => e.ExperienceDateEnd))
            {
                _context.Experiences.Add(emptyExperience);
                await _context.SaveChangesAsync();

                return(RedirectToPage("./MyCVs"));
            }

            return(Page());
        }
示例#6
0
        public async Task <IActionResult> OnPostAsync(int id)
        {
            var cvToUpdate = await _context.CVs.FindAsync(id);

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

            if (await TryUpdateModelAsync <CV>(
                    cvToUpdate,
                    "CV",
                    c => c.Summary))
            {
                await _context.SaveChangesAsync();

                return(RedirectToPage("./MyCVs"));
            }

            return(Page());
        }
        public async Task <IActionResult> OnPostAsync(int id)
        {
            var emptyEducation = new Education();

            if (await TryUpdateModelAsync <Education>(
                    emptyEducation,
                    "Education",
                    e => e.CVID,
                    e => e.EducationTitle,
                    e => e.EducationText,
                    e => e.EducationDateBegin,
                    e => e.EducationDateEnd))
            {
                _context.Educations.Add(emptyEducation);
                await _context.SaveChangesAsync();

                return(RedirectToPage("./MyCVs"));
            }

            return(Page());
        }
        public async Task <IActionResult> OnPostAsync(int id)
        {
            var referenceToUpdate = await _context.References.FindAsync(id);

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

            if (await TryUpdateModelAsync <Reference>(
                    referenceToUpdate,
                    "Reference",
                    c => c.ReferenceName,
                    c => c.ReferencePhoneNumber))
            {
                await _context.SaveChangesAsync();

                return(RedirectToPage("./MyCVs"));
            }

            return(Page());
        }
示例#9
0
        public async Task <IActionResult> OnPostAsync(int id)
        {
            var skillToUpdate = await _context.Skills.FindAsync(id);

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

            if (await TryUpdateModelAsync <Skill>(
                    skillToUpdate,
                    "Skill",
                    c => c.SkillTitle,
                    c => c.SkillText,
                    c => c.SkillRating))
            {
                await _context.SaveChangesAsync();

                return(RedirectToPage("./MyCVs"));
            }

            return(Page());
        }
示例#10
0
        public async Task <IActionResult> OnPostAsync(int id)
        {
            var educationToUpdate = await _context.Educations.FindAsync(id);

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

            if (await TryUpdateModelAsync <Education>(
                    educationToUpdate,
                    "Education",
                    c => c.EducationTitle,
                    c => c.EducationText,
                    c => c.EducationDateBegin,
                    c => c.EducationDateEnd))
            {
                await _context.SaveChangesAsync();

                return(RedirectToPage("./MyCVs"));
            }

            return(Page());
        }