예제 #1
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(TblUser).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TblUserExists(TblUser.Id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
예제 #2
0
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for
        // more details see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.TblUser.Add(TblUser);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./UserImage"));
        }
예제 #3
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TblUser = await _context.TblUser.FindAsync(id);

            if (TblUser != null)
            {
                _context.TblUser.Remove(TblUser);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
예제 #4
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TblLibrary = await _context.TblLibrary.FindAsync(id);

            if (TblLibrary != null)
            {
                _context.TblLibrary.Remove(TblLibrary);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Library"));
        }