예제 #1
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

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

            return(RedirectToPage("./Create"));
        }
예제 #2
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

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

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

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

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

            return(RedirectToPage("./Index"));
        }
예제 #4
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
            }

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