Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("ID,Name,Type,Location,Available")] Resource resource)
        {
            if (ModelState.IsValid)
            {
                resource.ID = Guid.NewGuid();
                _context.Add(resource);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(resource));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,Active,ExpirationDate")] Subscription subscription)
        {
            if (ModelState.IsValid)
            {
                subscription.Id = Guid.NewGuid();
                _context.Add(subscription);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(subscription));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("ID,Amount,ServiceType")] Invoice invoice)
        {
            if (ModelState.IsValid)
            {
                invoice.ID = Guid.NewGuid();
                _context.Add(invoice);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(invoice));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("Id")] Attendee attendee)
        {
            if (ModelState.IsValid)
            {
                attendee.Id = Guid.NewGuid();
                _context.Add(attendee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(attendee));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("ID,Date,Amount")] Payment payment)
        {
            if (ModelState.IsValid)
            {
                payment.ID = Guid.NewGuid();
                _context.Add(payment);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(payment));
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> Create([Bind("ID")] Booking booking)
        {
            if (ModelState.IsValid)
            {
                booking.ID = Guid.NewGuid();
                _context.Add(booking);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(booking));
        }
Ejemplo n.º 7
0
        public async Task <IActionResult> Create([Bind("ID,Name,Description,StartDate,EndDate")] Event @event)
        {
            if (ModelState.IsValid)
            {
                @event.ID = Guid.NewGuid();
                _context.Add(@event);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(@event));
        }