public async Task <IActionResult> Edit(string id, [Bind("Name,SurName,City,Country,PartTime_FullTime,WorkExperience,StatusOfUser,DateOfBirth,Sex,NoteField,DateCreated,Id,UserName,NormalizedUserName,Email,NormalizedEmail,EmailConfirmed,PasswordHash,SecurityStamp,ConcurrencyStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEnd,LockoutEnabled,AccessFailedCount")] User user)
        {
            if (id != user.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(user);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserExists(user.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(user));
        }
示例#2
0
        public async Task <IActionResult> Edit(int id, [Bind("JobName,JobDesc,JobCity,JobCountry,JobCategories,JobSalary,JobReqXp,JobPartFull,JobKeyword")] Job job)
        {
            if (id != job.JobId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _jobctx.Update(job);
                    await _jobctx.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (JobExists(job.JobId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View("~/Views/General/Job/Index.cshtml", job));
        }
        public async Task <IActionResult> Edit(string id, [Bind("RegUserName,statusOfUser,RegUserLastName,RegUserCity,RegUserCountry,LocationChange,RegUserPartFull,WorkXp,RegUserKeyword,RegUserSex,RegUserDoB,RegUserAdditionalInfo,Id,UserName,NormalizedUserName,Email,NormalizedEmail,EmailConfirmed,PasswordHash,SecurityStamp,ConcurrencyStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEnd,LockoutEnabled,AccessFailedCount")] RegUser regUser)
        {
            if (id != regUser.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(regUser);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RegUserExists(regUser.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View("~/Views/BackOffice/User/Index.cshtml", regUser));
        }
示例#4
0
        public async Task <IActionResult> Edit(int?id, [Bind("CompanyName,CompanyDesc,CompanyCity,CompanyCountry,CompanyPhone,CompanyEmail,CompanyWebSite")] Company company)
        {
            if (id == null)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(company);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CompanyExists(company.CompanyId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View("~/Views/BackOffice/Company/Index.cshtml", company));
        }
示例#5
0
        public async Task <IActionResult> Edit(int id, [Bind("JobId,Name,Description,City,Country,PartTime_FullTime,Keywords,CreatedById")] JobPosition jobPosition)
        {
            if (id != jobPosition.JobId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(jobPosition);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!JobPositionExists(jobPosition.JobId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            ViewData["CreatedById"] = new SelectList(_context.RegUsers, "Id", "Id", jobPosition.CreatedById);
            return(View(jobPosition));
        }
示例#6
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] Employee employee)
        {
            if (id != employee.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(employee);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmployeeExists(employee.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
        public async Task <IActionResult> Edit(int id, [Bind("CompanyId,Name,Description,City,Country,Phone,EmailAddress,Website")] Company company)
        {
            if (id != company.CompanyId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(company);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CompanyExists(company.CompanyId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(company));
        }