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

            _context.Attach(Wine).State = EntityState.Modified;//update wine

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!WineExists(Wine.ID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

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

            _context.RateList.Add(RateList);//adding the ratelist
            await _context.SaveChangesAsync();

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

            _context.Customer.Add(Customer);//adding customer
            await _context.SaveChangesAsync();

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

            _context.Wines.Add(Wine);//add wine
            await _context.SaveChangesAsync();

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

            Wine = await _context.Wines.FindAsync(id);

            if (Wine != null)
            {
                _context.Wines.Remove(Wine);//delete wine
                await _context.SaveChangesAsync();
            }

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

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

            if (Customer != null)
            {
                _context.Customer.Remove(Customer);//delete customer
                await _context.SaveChangesAsync();
            }

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

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

            if (RateList != null)
            {
                _context.RateList.Remove(RateList);//delete ratelist
                await _context.SaveChangesAsync();
            }

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