Пример #1
0
        public async Task <IActionResult> AddSkills(int id, [Bind("Id,FirstName,LastName,Age,ProfilePicutre,CoverPhoto,CV,CoverLetter,GitHubLink,CurrentPosition,WantedPosition,Description,Location,PhoneNumber,Mail,Password,Skills")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(employee);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmployeeExists(employee.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToPage(""));
            }
            AppUser user = await userManager.GetUserAsync(User);

            if (id != user.EmployeeId)
            {
                return(RedirectToAction("AccessDenied", "Account", null));
            }
            return(View(employee));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,ProfilePicture,Description,CEOName,Location,PhoneNumber,Mail,Password")] Employer employer)
        {
            if (id != employer.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(employer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmployerExists(employer.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(employer));
        }
Пример #3
0
        public async Task <IActionResult> EditContact(int id, [Bind("Id,Name,ProfilePicture,Description,CEOName,Location,PhoneNumber,Mail,Password")] Employer employer)
        {
            if (id != employer.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(employer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmployerExists(employer.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToPage(""));
            }
            AppUser user = await userManager.GetUserAsync(User);

            if (employer.Id != user.EmployerId)
            {
                return(RedirectToAction("AccessDenied", "Account", null));
            }
            return(View(employer));
        }
Пример #4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,EmployeeId,EmployerId")] Interest interest)
        {
            if (id != interest.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(interest);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!InterestExists(interest.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeeId"] = new SelectList(_context.Employee, "Id", "FullName", interest.EmployeeId);
            ViewData["EmployerId"] = new SelectList(_context.Employer, "Id", "Name", interest.EmployerId);
            return(View(interest));
        }
Пример #5
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,EmployeeId,OglasId")] Apliciraj apliciraj)
        {
            if (id != apliciraj.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(apliciraj);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AplicirajExists(apliciraj.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeeId"] = new SelectList(_context.Employee, "Id", "FullName", apliciraj.EmployeeId);
            ViewData["OglasId"]    = new SelectList(_context.Oglas, "Id", "JobTitle", apliciraj.OglasId);
            return(View(apliciraj));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,JobTitle,Description,EmployeeId,EmployerId")] Oglas oglas)
        {
            if (id != oglas.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(oglas);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OglasExists(oglas.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToPage(""));
            }
            ViewData["EmployeeId"] = new SelectList(_context.Employee, "Id", "FullName", oglas.EmployeeId);
            ViewData["EmployerId"] = new SelectList(_context.Employer, "Id", "Name", oglas.EmployerId);
            return(View(oglas));
        }