Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Location,RoleId")] Staff staff)
        {
            if (ModelState.IsValid)
            {
                _context.Add(staff);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RoleId"] = new SelectList(_context.Role, "Id", "RoleName", staff.RoleId);
            return(View(staff));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Add(TransactionHead cus)
        {
            _context.Add(cus);
            await _context.SaveChangesAsync();

            return(RedirectToRoute("sales"));
        }
Exemplo n.º 3
0
        public async Task <ActionResult> Add(Product cus)
        {
            _context.Add(cus);
            await _context.SaveChangesAsync();

            return(RedirectToRoute("product"));
        }
Exemplo n.º 4
0
        public async Task <ActionResult> Add(Customer cus)
        {
            _context.Add(cus);
            await _context.SaveChangesAsync();

            return(RedirectToRoute("customer"));
        }