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

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

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

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

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

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

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

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

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

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

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

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

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

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