コード例 #1
0
        public async Task <IActionResult> Edit(Guid id, [Bind("EcryptorRequestRowid,UserRequestorRid,ResquestStatus,FileRid,RequestSession,RequestDate,RequestorNotes,RequestIsActive,TenantRid,WorkloadRid,EvisordwCorrelationId,SourceLoadSession,SourceLoadDate,LastChangeDateTime,LastChangeSession,RowVersion")] EcryptorRequest ecryptorRequest)
        {
            if (id != ecryptorRequest.EcryptorRequestRowid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(ecryptorRequest);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EcryptorRequestExists(ecryptorRequest.EcryptorRequestRowid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FileRid"]          = new SelectList(_context.File, "FileRid", "FileName", ecryptorRequest.FileRid);
            ViewData["UserRequestorRid"] = new SelectList(_context.User, "UserRid", "UserName", ecryptorRequest.UserRequestorRid);
            return(View(ecryptorRequest));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("EcryptorRequestRowid,UserRequestorRid,ResquestStatus,FileRid,RequestSession,RequestDate,RequestorNotes,RequestIsActive,TenantRid,WorkloadRid,EvisordwCorrelationId,SourceLoadSession,SourceLoadDate,LastChangeDateTime,LastChangeSession,RowVersion")] EcryptorRequest ecryptorRequest)
        {
            if (ModelState.IsValid)
            {
                ecryptorRequest.EcryptorRequestRowid = Guid.NewGuid();
                _context.Add(ecryptorRequest);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FileRid"]          = new SelectList(_context.File, "FileRid", "FileName", ecryptorRequest.FileRid);
            ViewData["UserRequestorRid"] = new SelectList(_context.User, "UserRid", "UserName", ecryptorRequest.UserRequestorRid);
            return(View(ecryptorRequest));
        }