public async Task <IActionResult> Edit(int id, [Bind("SkillId,GeneralareaId,ProfId,Level,Description")] Skill skill)
        {
            if (id != skill.SkillId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(skill);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SkillExists(skill.SkillId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GeneralareaId"] = new SelectList(_context.GeneralArea, "GeneralareaId", "Name", skill.GeneralareaId);
            ViewData["ProfId"]        = new SelectList(_context.Professionists, "ProfId", "Lastname" + "Firstname", skill.ProfId);
            return(View(skill));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("CompId,Name,Type,Address,City,Region,Postalcode,DestinationId,GeneralareaId,Mission")] Company companies)
        {
            if (id != companies.CompId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(companies);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CompaniesExists(companies.CompId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DestinationId"] = new SelectList(_context.Destinations, "DestinationId", "Name", companies.DestinationId);
            ViewData["GeneralareaId"] = new SelectList(_context.GeneralArea, "GeneralareaId", "Name", companies.GeneralareaId);
            return(View(companies));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ProfId,Lastname,Firstname,Profession,Birthdate,Address,City,Region,Postalcode,DestinationId,Phone,Mail,Minavailability,Maxavailability")] Professionist professionist)
        {
            if (id != professionist.ProfId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(professionist);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProfessionistExists(professionist.ProfId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DestinationId"] = new SelectList(_context.Destinations, "DestinationId", "Name", professionist.DestinationId);
            return(View(professionist));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ReqId,CompId,ProjId,SkillId,DestinationId,BeginningDate,EndingDate,Description")] Request request)
        {
            if (id != request.ReqId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(request);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RequestExists(request.ReqId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CompId"]        = new SelectList(_context.Companies, "CompId", "Address", request.CompId);
            ViewData["DestinationId"] = new SelectList(_context.Destinations, "DestinationId", "Name", request.DestinationId);
            ViewData["ProjId"]        = new SelectList(_context.Projects, "ProjId", "Description", request.ProjId);
            ViewData["SkillId"]       = new SelectList(_context.Skills, "SkillId", "Description", request.SkillId);
            return(View(request));
        }