public async Task <IActionResult> Edit(int id, [Bind("ProjectPropertyId,Title,Value")] ProjectProperty projectProperty)
        {
            if (id != projectProperty.ProjectPropertyId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(projectProperty);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProjectPropertyExists(projectProperty.ProjectPropertyId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(projectProperty));
        }
Example #2
0
        public async Task <IActionResult> Edit(int id, [Bind("OrganizationId,Name")] Organization organization)
        {
            if (id != organization.OrganizationId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(organization);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrganizationExists(organization.OrganizationId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(organization));
        }
        public async Task <IActionResult> Edit(int id, [Bind("DocumentId,Name,Data,ModifiedTime")] Document document)
        {
            if (id != document.DocumentId)
            {
                return(NotFound());
            }

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