Example #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,InputText,SecondaryInputText,AdditionalInputText,FirstInputValidLength,SecondaryInputValidLength,AdditionalInputValidLength,GroupProviderId")] ProviderAdditionalInformation providerAdditionalInformation)
        {
            if (id != providerAdditionalInformation.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(providerAdditionalInformation);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProviderAdditionalInformationExists(providerAdditionalInformation.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GroupProviderId"] = new SelectList(_context.GroupProviders, "Id", "BackColor", providerAdditionalInformation.GroupProviderId);
            return(View(providerAdditionalInformation));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("Id,InputText,SecondaryInputText,AdditionalInputText,FirstInputValidLength,SecondaryInputValidLength,AdditionalInputValidLength,GroupProviderId")] ProviderAdditionalInformation providerAdditionalInformation)
        {
            if (ModelState.IsValid)
            {
                _context.Add(providerAdditionalInformation);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GroupProviderId"] = new SelectList(_context.GroupProviders, "Id", "BackColor", providerAdditionalInformation.GroupProviderId);
            return(View(providerAdditionalInformation));
        }