예제 #1
0
        public async Task <IActionResult> Edit(long id, [Bind("Id,Name,Password")] Admin admin)
        {
            if (id != admin.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(admin);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AdminExists(admin.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(admin));
        }
        public async Task<IActionResult> Edit(long id, [Bind("Id,Website")] ContactDetails contactDetails)
        {
            if (id != contactDetails.Id)
            {
                return NotFound();
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(contactDetails);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ContactDetailsExists(contactDetails.Id))
                    {
                        return NotFound();
                    }
                    else
                    {
                        throw;
                    }
                }
                return RedirectToAction(nameof(Index));
            }
            ViewData["Id"] = new SelectList(_context.Emails, "Id", "Email", contactDetails.Id);
            return View(contactDetails);
        }
        public async Task <IActionResult> Edit(long id, [Bind("Id,FirstName,LastName,Gender")] TeamLeaders teamLeaders)
        {
            if (id != teamLeaders.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(teamLeaders);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TeamLeadersExists(teamLeaders.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(teamLeaders));
        }
        public async Task <IActionResult> Edit(long id, [Bind("Id,PhoneNumber,IdcontactDetails")] PhoneNumbers phoneNumbers)
        {
            if (id != phoneNumbers.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(phoneNumbers);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PhoneNumbersExists(phoneNumbers.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdcontactDetails"] = new SelectList(_context.ContactDetails, "Id", "Id", phoneNumbers.IdcontactDetails);
            return(View(phoneNumbers));
        }
예제 #5
0
        public async Task <IActionResult> Edit(long id, [Bind("Id,Name")] Category category)
        {
            if (id != category.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(category);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CategoryExists(category.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(category));
        }
예제 #6
0
        public async Task <IActionResult> Edit(long id, [Bind("Id,Lat,Long,AddressDetails")] Address address)
        {
            if (id != address.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(address);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AddressExists(address.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(address));
        }
        public async Task <IActionResult> Edit(long id, [Bind("Id,Name,Idaddress,Idcategory,Description,MemberCount,Rating,IdcontactDetails,WomenPercentage,Sentiment")] RoboticEntity roboticEntity)
        {
            if (id != roboticEntity.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(roboticEntity);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RoboticEntityExists(roboticEntity.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Idaddress"]        = new SelectList(_context.Address, "Id", "AddressDetails", roboticEntity.Idaddress);
            ViewData["Idcategory"]       = new SelectList(_context.Category, "Id", "Name", roboticEntity.Idcategory);
            ViewData["IdcontactDetails"] = new SelectList(_context.ContactDetails, "Id", "Id", roboticEntity.IdcontactDetails);
            return(View(roboticEntity));
        }
        public async Task <IActionResult> Edit(long id, [Bind("Id,Name,Path,IdroboticEntity")] Photos photos)
        {
            if (id != photos.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(photos);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PhotosExists(photos.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdroboticEntity"] = new SelectList(_context.RoboticEntity, "Id", "Name", photos.IdroboticEntity);
            return(View(photos));
        }
        public async Task <IActionResult> Edit(long id, [Bind("Id,Network,Address,IdcontactDetails")] Social social)
        {
            if (id != social.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(social);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SocialExists(social.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdcontactDetails"] = new SelectList(_context.ContactDetails, "Id", "Id", social.IdcontactDetails);
            return(View(social));
        }
예제 #10
0
        public async Task <IActionResult> Edit(long id, [Bind("Id,Name,Description,IdteamLeader")] Projects projects)
        {
            if (id != projects.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(projects);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProjectsExists(projects.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdteamLeader"] = new SelectList(_context.TeamLeaders, "Id", "FirstName", projects.IdteamLeader);
            return(View(projects));
        }
예제 #11
0
        public async Task <IActionResult> Edit(long id, [Bind("Id,Type,Email,IdcontactDetails")] Emails emails)
        {
            if (id != emails.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(emails);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmailsExists(emails.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(emails));
        }