コード例 #1
0
        public async Task <string> UpdateManNotifications2(ManualReservations reservation)
        {
            try
            {
                var res = await _context.ManualReservations.Where(r => r.IDReservation == reservation.IDReservation).FirstAsync();

                res.CheckedFromApp = reservation.CheckedFromApp;

                await _context.SaveChangesAsync();

                return("Base de datos actualizada");
            }
            catch
            {
                return("Error. Hubo un error al actualizar la base de datos");
            }
        }
コード例 #2
0
        public async Task <string> AddManReservation(ManualReservations reservation)
        {
            try
            {
                ManualReservations manual = new ManualReservations();

                manual.IDTable        = reservation.IDTable;
                manual.Date           = reservation.Date;
                manual.AmountOfPeople = reservation.AmountOfPeople;
                manual.Checked        = reservation.Checked;
                manual.Name           = reservation.Name;
                manual.LastName       = reservation.LastName;

                _context.ManualReservations.Add(manual);
                await _context.SaveChangesAsync();

                return("Reservacion agregada");
            } catch
            {
                return("Error. Hubo un error al actualizar la base de datos");
            }
        }