Beispiel #1
0
        public async Task <IActionResult> Create([Bind("ID1,Dateofbirth,Telno,Email,ID,FName,LName")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("ID,CPname,Cost,Date,Time")] Bookings bookings)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bookings);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));       // Bind method allows all the attributes to be created on the system
            }
            return(View(bookings));
        }
Beispiel #3
0
        public async Task <IActionResult> Create([Bind("ID,Mname,Price,Date,Time,Availability")] EInfo eInfo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(eInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(eInfo));
        }
Beispiel #4
0
        public async Task <IActionResult> Create([Bind("ID,FName,LName")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
        public async Task <IActionResult> Create([Bind("ID,Postcode,City,State")] SAddress sAddress)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sAddress);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(sAddress));
        }
        public async Task <IActionResult> Create([Bind("ID,FName,LName,Email,Telno,Jobrole")] SInfo sInfo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(sInfo));
        }