Example #1
0
        public async Task <IActionResult> OnPostAsync()
        {
            CurrentUser = await _usermgr.GetUserAsync(User);

            if (!ModelState.IsValid)
            {
                return(Page());
            }

            byte[] bytes;
            var    files = HttpContext.Request.Form.Files;

            if (files.Any())
            {
                using (var ms = new MemoryStream())
                {
                    files[0].CopyTo(ms);
                    bytes = ms.ToArray();
                }

                string base64 = Convert.ToBase64String(bytes);
                applicant1.Upload = base64;
            }

            System.Diagnostics.Debug.WriteLine("current user: "******"./Index"));
        }
Example #2
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(jobPosting).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!jobPostingExists(jobPosting.jobID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Example #3
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.jobPosting.Add(jobPosting);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Example #4
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            applicant1 = await _context.applicant1.FindAsync(id);

            if (applicant1 != null)
            {
                _context.applicant1.Remove(applicant1);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Example #5
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            jobPosting = await _context.jobPosting.FindAsync(id);

            if (jobPosting != null)
            {
                _context.jobPosting.Remove(jobPosting);
                await _context.SaveChangesAsync();
            }

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