예제 #1
0
        public async Task <Job> CreateJobAsync(Job job)
        {
            _context.Jobs.Add(job);
            await _context.SaveChangesAsync();

            return(job);
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("FirstName,LastName,Email,CoverLetter")] Resume resume)
        {
            if (ModelState.IsValid)
            {
                _context.Add(resume);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(resume));
        }
        public async Task <IActionResult> Create([Bind("FirstName,LastName,Email,IsActive")] Candidate candidate)
        {
            if (ModelState.IsValid)
            {
                _context.Add(candidate);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(candidate));
        }
예제 #4
0
        public async Task <IActionResult> Create([Bind("Email,CompanyName,isActive,CreatedDate")] Employer employer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employer));
        }
        public async Task <IActionResult> Create([Bind("ExperienceId,StartDate,EndDate,CompanyName,Position,WorkDone")] Experience experience)
        {
            if (ModelState.IsValid)
            {
                _context.Add(experience);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(experience));
        }
        public async Task <IActionResult> Create([Bind("EducationId,SchoolName,EducationType,StartDate,EndDate")] Education education)
        {
            if (ModelState.IsValid)
            {
                _context.Add(education);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(education));
        }
예제 #7
0
        public async Task <IActionResult> Create([Bind("JobApplicationId,JobId,applicantId")] JobApplication jobApplication)
        {
            if (ModelState.IsValid)
            {
                jobApplication.JobApplicationId = Guid.NewGuid();
                _context.Add(jobApplication);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(jobApplication));
        }
        public async Task <IActionResult> Create([Bind("JobId,Title,JobFunction,Description,Requirement,Responsibilities,Qualifications,Skills,ModifiedDate,CreatedDate,StartDate,EndDate,IsPublic,IsDraft,OwnerId")] JobPosting jobPosting)
        {
            if (ModelState.IsValid)
            {
                jobPosting.JobId = Guid.NewGuid();
                _context.Add(jobPosting);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(jobPosting));
        }
        public async Task <IActionResult> Create([Bind("JobId,JobTitle,Category,Location,Jobtype,MaxSalary,MinSalary,JobDescription,PayPeriod,NumberOfPosition,JobPostDate,JobExpiryDate,CompnayId")] JobDetails jobDetails)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobDetails);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CompnayId"] = new SelectList(_context.CompanyDetails, "CompanyId", "CompanyId", jobDetails.CompnayId);
            return(View(jobDetails));
        }
예제 #10
0
        public async Task <IActionResult> Create([Bind("UserName,Password,RoleId")] AccountInformation accountInformation)
        {
            if (ModelState.IsValid)
            {
                _context.Add(accountInformation);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RoleId"] = new SelectList(_context.Role, "RoleId", "PermissionType", accountInformation.RoleId);
            return(View(accountInformation));
        }
예제 #11
0
 /// <summary>
 /// Update a job
 /// </summary>
 /// <param name="job">Job object</param>
 public async Task <int> UpdateJob(JobEntity oJob)
 {
     using var db          = new JobBoardContext(Configuration, InMemory);
     db.Attach(oJob).State = EntityState.Modified;
     //db.Jobs.Update(oJob);
     return(await db.SaveChangesAsync());
 }
예제 #12
0
 public async Task Seed()
 {
     if (!_context.Countries.Any())
     {
         // AddAsync Data
         _context.AddRange(_sampleCountries);
         await _context.SaveChangesAsync();
     }
 }
        public async Task <IActionResult> CreateCompany([Bind("CompanyId,CompanyName,CompanyAddress,CompanyCity,CompanyPostalCode,CompanyLandLinePhoneNumber,CompanyLandLineExtensionNumber,CompanyEmailId,CompanyRegistrationDateTime,CompanyContactPerson,RoleId,UserName")] CompanyDetails companyDetails)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    _context.Add(companyDetails);
                    await _context.SaveChangesAsync();

                    TempData["success"] = true;
                    return(View(companyDetails));
                }
                ViewData["RoleId"]   = new SelectList(_context.Role, "RoleId", "PermissionType", companyDetails.RoleId);
                ViewData["UserName"] = new SelectList(_context.AccountInformation, "UserName", "UserName", companyDetails.UserName);
                return(View(companyDetails));
            } catch (Exception Ex)
            {
                ViewData["ErrorMessage"] = Ex.InnerException.Message;
                return(View(companyDetails));
            }
        }
예제 #14
0
        public async Task <IActionResult> Create([Bind("JobId,JobTitle,Category,Location,Jobtype,MaxSalary,MinSalary,JobDescription,PayPeriod,NumberOfPosition,JobPostDate,JobExpiryDate,CompnayId")] JobDetails jobDetails)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    _context.Add(jobDetails);
                    await _context.SaveChangesAsync();

                    TempData["success"] = true;
                    return(RedirectToAction(nameof(Create)));
                }
                ViewData["CompanyName"] = new SelectList(_context.CompanyDetails, "CompanyId", "CompanyName");
                return(View(jobDetails));
            }
            catch (Exception Ex)
            {
                ViewData["ErrorMessage"] = Ex.GetBaseException().Message;
                ViewData["CompanyName"]  = new SelectList(_context.CompanyDetails, "CompanyId", "CompanyName");
                return(View(jobDetails));
            }
        }
예제 #15
0
 /// <summary>
 /// Delete Job
 /// </summary>
 /// <param name="job">Job object</param>
 public async Task <int> DeleteJob(JobEntity job)
 {
     using var db = new JobBoardContext(Configuration, InMemory);
     db.Jobs.Remove(job);
     return(await db.SaveChangesAsync());
 }