Beispiel #1
0
        public async Task <IActionResult> Create([Bind("StaffMemberID,FirstName,LastName,Email,Phone")] StaffMember staffMember)
        {
            if (ModelState.IsValid)
            {
                _context.Add(staffMember);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(staffMember));
        }
        public async Task <IActionResult> Create([Bind("InventoryID,ProductNo,ProductName,ProductAmount")] Inventory inventory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(inventory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(inventory));
        }
Beispiel #3
0
        public async Task <IActionResult> Create([Bind("SupervisorID,FirstName,LastName,Email,Phone,InventoryID")] Supervisor supervisor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(supervisor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["InventoryID"] = new SelectList(_context.Inventories, "InventoryID", "ProductName", supervisor.InventoryID);
            return(View(supervisor));
        }
Beispiel #4
0
        public async Task <IActionResult> Create([Bind("ClientID,Name,Phone,Address,City,Province,PostalCode,Email,StaffMemberID,SupervisorID")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StaffMemberID"] = new SelectList(_context.StaffMembers, "StaffMemberID", "Email", client.StaffMemberID);
            ViewData["SupervisorID"]  = new SelectList(_context.Supervisors, "SupervisorID", "Email", client.SupervisorID);
            return(View(client));
        }