Example #1
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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

            Saledocumentposition = await _context.Saledocumentposition
                                   .Include(s => s.Document)
                                   .Include(s => s.Product)
                                   .Include(s => s.Vatrate).FirstOrDefaultAsync(m => m.Saledocumentpositionid == id);

            if (Saledocumentposition == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Example #3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Saledocumentposition = await _context.Saledocumentposition
                                   .Include(s => s.Document)
                                   .Include(s => s.Product)
                                   .Include(s => s.Vatrate).FirstOrDefaultAsync(m => m.Saledocumentpositionid == id);

            if (Saledocumentposition == null)
            {
                return(NotFound());
            }
            ViewData["Documentid"] = new SelectList(_context.Saledocument, "Documentid", "Documentnumber");
            ViewData["Productid"]  = new SelectList(_context.Product, "Productid", "Name");
            ViewData["Vatrateid"]  = new SelectList(_context.Vatrate, "Vatrateid", "Vatrateid");
            return(Page());
        }