public async Task <IActionResult> Create([Bind("Id,CompanyId,CompanyBranchId,Name,PhoneNumber,PhoneNumberAlt,EmailAddress,EmailAddressAlt,IsActive")] CompanyContactData companyContactData)
        {
            if (ModelState.IsValid)
            {
                _context.Add(companyContactData);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(companyContactData));
        }
//[ValidateAntiForgeryToken]
        public async Task <IActionResult> Create(User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(Created(HttpContext.Request.Scheme + "://" + HttpContext.Request.Host + HttpContext.Request.Path + "/" + user.Id, user));
            }
            return(BadRequest("Model is not matching"));
        }
Ejemplo n.º 3
0
//[ValidateAntiForgeryToken]
        public async Task <IActionResult> Create([Bind("Id,CompanyId,JobExchangeId,AddressNation,AddressCity,AddressStreet,AddressState,PhoneNumber,PhoneNumberAlt,EmailAddress,IsActive")] HeadHunterContactData headHunterContactData)
        {
            if (ModelState.IsValid)
            {
                _context.Add(headHunterContactData);
                await _context.SaveChangesAsync();

                return(Ok());
            }
            return(new JsonResult(headHunterContactData));
        }
//[ValidateAntiForgeryToken]
        public async Task <IActionResult> Create([Bind("Id,CompanyId,Name,Content,Date")] CompanyHistory companyHistory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(companyHistory);
                await _context.SaveChangesAsync();

                return(Ok());
            }
            return(new JsonResult(companyHistory));
        }
        public async Task <IActionResult> Create([Bind("Id,UserId,Title,Facility,AddressNation,FacilityAddressCity,FacilityAddressStreet,FacilityAddressState,Graduation,TestimonyUrl,StartDate,EndDate")] UserEducation userEducation)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userEducation);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(userEducation));
        }
        public async Task <IActionResult> Create([Bind("Id,CompanyId,Name,Content,Date")] CompanyHistory companyHistory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(companyHistory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(companyHistory));
        }
//[ValidateAntiForgeryToken]
        public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,IsActive")] HeadHunter headHunter)
        {
            if (ModelState.IsValid)
            {
                _context.Add(headHunter);
                await _context.SaveChangesAsync();

                return(Ok());
            }
            return(new JsonResult(headHunter));
        }
Ejemplo n.º 8
0
        public async Task <IActionResult> Create([Bind("Id,UserId,SkillName,SkillDescritpion,SelfRating,Current")] UserSkill userSkill)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userSkill);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(userSkill));
        }
        public async Task <IActionResult> Create([Bind("Id,ApplicationnId,Title,Content")] ApplicationBody applicationBody)
        {
            if (ModelState.IsValid)
            {
                _context.Add(applicationBody);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(applicationBody));
        }
Ejemplo n.º 10
0
//[ValidateAntiForgeryToken]
        public async Task <IActionResult> Create([Bind("Id,UserId,JobOfferId,Title,Answer,DateSent,DateAnswered,Current")] Application application)
        {
            if (ModelState.IsValid)
            {
                _context.Add(application);
                await _context.SaveChangesAsync();

                return(Ok());
            }
            return(new JsonResult(application));
        }
//[ValidateAntiForgeryToken]
        public async Task <IActionResult> Create([Bind("Id,CompanyBranchId,JobId,HeadHunterId,JobExchangeId,ApplicationnId,SalaryOffered,IsActive,Releasedate,JobOfferUrl")] JobOffer jobOffer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobOffer);
                await _context.SaveChangesAsync();

                return(Ok());
            }
            return(new JsonResult(jobOffer));
        }
Ejemplo n.º 12
0
        public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,BirthDate,Religion,Sex,Gender,Picture,PictureAlt,Nationality,Nationality2")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
Ejemplo n.º 13
0
//[ValidateAntiForgeryToken]
        public async Task <IActionResult> Create([Bind("Id,JobOfferId,Title,TitleAlt,TitleAlt2")] Job job)
        {
            if (ModelState.IsValid)
            {
                _context.Add(job);
                await _context.SaveChangesAsync();

                return(Ok());
            }
            return(new JsonResult(job));
        }
//[ValidateAntiForgeryToken]
        public async Task <IActionResult> Create([Bind("Id,UserId,AddressNation,AddressCity,AddressStreet,AddressState,PhoneNumber,PhoneNumberAlt,EmailAddress,EmailAddressAlt,Current")] UserContactData userContactData)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userContactData);
                await _context.SaveChangesAsync();

                return(Ok());
            }
            return(new JsonResult(userContactData));
        }
Ejemplo n.º 15
0
//[ValidateAntiForgeryToken]
        public async Task <ActionResult <Jobsuche> > Create([Bind("Id,UserId,JobOfferId,CompanyId,Email,JobId,Status,DateSent,DateAnswered,Proof")] Jobsuche jobsuche)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobsuche);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(jobsuche);
        }
Ejemplo n.º 16
0
        public async Task <IActionResult> Create([Bind("Id,JobOfferId,Title,TitleAlt,TitleAlt2")] Job job)
        {
            if (ModelState.IsValid)
            {
                _context.Add(job);
                await _context.SaveChangesAsync();

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

                return(RedirectToAction(nameof(Index)));
            }
            return(View(headHunter));
        }
//[ValidateAntiForgeryToken]
        public async Task <IActionResult> Create([Bind("Id,ApplicationnId,Title,Content")] ApplicationFooter applicationFooter)
        {
            if (ModelState.IsValid)
            {
                _context.Add(applicationFooter);
                await _context.SaveChangesAsync();

                return(Ok());
            }
            return(new JsonResult(applicationFooter));
        }
//[ValidateAntiForgeryToken]
        public async Task <IActionResult> Create([Bind("Id,JobId,DescriptionShort,DescriptionLong,Nation,Region,MinSalary,MaxSalary,Current")] JobData jobData)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobData);
                await _context.SaveChangesAsync();

                return(Ok());
            }
            return(new JsonResult(jobData));
        }
Ejemplo n.º 20
0
//[ValidateAntiForgeryToken]
        public async Task <IActionResult> Create([Bind("Id,UserId,SkillName,SkillDescritpion,SelfRating,Current")] UserSkill userSkill)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userSkill);
                await _context.SaveChangesAsync();

                return(Ok());
            }
            return(new JsonResult(userSkill));
        }
        public async Task <IActionResult> Create([Bind("Id,UserId,Name,Content,Url")] UserWebsite userWebsite)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userWebsite);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(userWebsite));
        }
Ejemplo n.º 22
0
        public async Task <IActionResult> Create([Bind("Id,JobId,Name,Content")] JobSkill jobSkill)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobSkill);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(jobSkill));
        }
Ejemplo n.º 23
0
//[ValidateAntiForgeryToken]
        public async Task <IActionResult> Create([Bind("Id,JobId,Name,Content")] JobSkill jobSkill)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobSkill);
                await _context.SaveChangesAsync();

                return(Ok());
            }
            return(new JsonResult(jobSkill));
        }
//[ValidateAntiForgeryToken]
        public async Task <IActionResult> Create([Bind("Id,UserId,Title,Description,SkillSummary,TestimonyUrl,Salary,StartDate,EndDate,Current")] UserJobHistory userJobHistory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userJobHistory);
                await _context.SaveChangesAsync();

                return(Ok());
            }
            return(new JsonResult(userJobHistory));
        }
        //[ValidateAntiForgeryToken]
        public async Task <IActionResult> Create([Bind("Id,Name,Url,Current")] JobExchange jobExchange)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobExchange);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(new JsonResult(jobExchange));
        }
Ejemplo n.º 26
0
 public IActionResult ProcessAddEmployerForm(AddEmployerViewModel addEmployerViewModel)
 {
     if (ModelState.IsValid)
     {
         Employer employer = new Employer()
         {
             Name     = addEmployerViewModel.Name,
             Location = addEmployerViewModel.Location
         };
         context.Add(employer);
         context.SaveChanges();
     }
     return(Redirect("/Employer"));
 }
        public IActionResult ProcessAddEmployerForm(AddEmployerViewModel addEmployerViewModel)
        {
            if (ModelState.IsValid)
            {
                Employer newEmployers = new Employer
                {
                    Name     = addEmployerViewModel.Name,
                    Location = addEmployerViewModel.Location
                };

                context.Add(newEmployers);
                context.SaveChanges();
                return(Redirect("/Employer/About"));
            }
            return(View(addEmployerViewModel));
        }
Ejemplo n.º 28
0
        public async Task <IActionResult> Create([Bind("CompanyId,Name,Description,AddressNation,AddressCity,AddressStreet,AddressState")] CompanyBranch companyBranch)
        {
            if (ModelState.IsValid)
            {
                _context.Add(companyBranch);
                await _context.SaveChangesAsync();

                // TODO fix redirect
                // return RedirectToAction(nameof(Index), new { companyBranch.CompanyId });
                return(RedirectToRoute(new
                {
                    controller = "CompanyBranches",
                    action = "Index",
                    id = companyBranch.CompanyId
                }));
            }
            return(View(companyBranch));
        }