예제 #1
0
        public async Task <bool> Create(Appointment appointment)
        {
            _contextPostgres
            .Appointments
            .Add(appointment);

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

            /* return*/
            return(await _contextPostgres.SaveChangesAsync() > 0);
        }
예제 #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); }
        }
예제 #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); }
        }
예제 #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); }
        }
예제 #6
0
 public async Task <bool> AddCustomer(Customer activity)
 {
     _context.Customers.Add(activity);
     return(await _context.SaveChangesAsync() > 0);
 }
예제 #7
0
 public async Task <bool> AddFavorite(Favorite favorite)
 {
     _context.Favorites.Add(favorite);
     return(await _context.SaveChangesAsync() > 0);
 }
예제 #8
0
 public async Task <bool> AddBooking(Booking booking)
 {
     _context.Bookings.Add(booking);
     return(await _context.SaveChangesAsync() > 0);
 }
예제 #9
0
 public async Task <bool> AddRating(Rating Rating)
 {
     _context.Ratings.Add(Rating);
     return(await _context.SaveChangesAsync() > 0);
 }