public async Task <IActionResult> Create([Bind("Id,Name,Desp,Position,Skill,Vacancy,Nature,Experience,Requirements,Salary,AddedDate,Address,LastDate")] JobPost jobPost)
        {
            if (ModelState.IsValid)
            {
                jobPost.AddedDate = DateTime.Now;
                _context.Add(jobPost);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }


            return(View(jobPost));
        }
Пример #2
0
        public async Task <IActionResult> DeleteConfirmed(long id)
        {
            var contactPerson = await _context.ContactPerson.FindAsync(id);

            _context.ContactPerson.Remove(contactPerson);
            await _context.SaveChangesAsync();

            return(RedirectToAction(nameof(Index)));
        }
Пример #3
0
        public async Task <IActionResult> Contact([Bind("Id,Name,Phone,Email,Message")] ContactPerson contactPerson)
        {
            if (ModelState.IsValid)
            {
                _context.Add(contactPerson);
                await _context.SaveChangesAsync();

                return(Content($"Succesfully Submitted"));
                //return RedirectToAction(nameof(Contact));
            }
            return(View("Home", "Contact"));
        }
Пример #4
0
        // GET: JobPosts/Delete/5
        public async Task <IActionResult> Delete(long?id)
        {
            var re = await _context.Recruiter
                     .FirstOrDefaultAsync(m => m.Id == id);

            var path = Path.Combine(_hostingEnvironment.WebRootPath, re.Cv);

            if (System.IO.File.Exists(path))
            {
                System.IO.File.Delete(path);
            }
            _context.Recruiter.Remove(re);
            await _context.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }