Ejemplo n.º 1
0
        public async Task <bool> Create(Appointment appointment)
        {
            _contextPostgres
            .Appointments
            .Add(appointment);

            /* return*/
            return(await _contextPostgres.SaveChangesAsync() > 0);
        }
Ejemplo n.º 2
0
        public async Task <bool> Create(Calendar calendar)
        {
            _contextPostgres
            .Calendars
            .Add(calendar);

            /* return*/
            return(await _contextPostgres.SaveChangesAsync() > 0);
        }
Ejemplo n.º 3
0
        public async Task <bool> Create(PriceList price)
        {
            if (!_setting.IsMongoDb)
            {
                _contextPostgres
                .PriceLists
                .Add(price);

                /* return*/
                return(await _contextPostgres.SaveChangesAsync() > 0);
            }

            try
            {
                await _context.PriceLists.InsertOneAsync(price);

                return(true);
            }
            catch (Exception exc) { return(false); }
        }
Ejemplo n.º 4
0
        public async Task <bool> Create(BeautySalon beautysalon)
        {
            if (!_setting.IsMongoDb)
            {
                _contextPostgres
                .BeautySalons
                .Add(beautysalon);

                /* return*/
                return(await _contextPostgres.SaveChangesAsync() > 0);
            }

            try
            {
                await _context.BeautySalons.InsertOneAsync(beautysalon);

                return(true);
            }
            catch (Exception exc) { return(false); }
        }
Ejemplo n.º 5
0
        public async Task <bool> Create(Category category)
        {
            if (!_setting.IsMongoDb)
            {
                _contextPostgres
                .Categorys
                .Add(category);

                /* return*/
                return(await _contextPostgres.SaveChangesAsync() > 0);
            }

            try
            {
                await _context.Categorys.InsertOneAsync(category);

                return(true);
            }
            catch (Exception exc) { return(false); }
        }
Ejemplo n.º 6
0
 public async Task <bool> AddCustomer(Customer activity)
 {
     _context.Customers.Add(activity);
     return(await _context.SaveChangesAsync() > 0);
 }
Ejemplo n.º 7
0
 public async Task <bool> AddFavorite(Favorite favorite)
 {
     _context.Favorites.Add(favorite);
     return(await _context.SaveChangesAsync() > 0);
 }
Ejemplo n.º 8
0
 public async Task <bool> AddBooking(Booking booking)
 {
     _context.Bookings.Add(booking);
     return(await _context.SaveChangesAsync() > 0);
 }
Ejemplo n.º 9
0
 public async Task <bool> AddRating(Rating Rating)
 {
     _context.Ratings.Add(Rating);
     return(await _context.SaveChangesAsync() > 0);
 }