예제 #1
0
 public async Task<bool> Create(Booking item)
 {
     try
     {
         db.Bookings.Add(item);
         await db.SaveChangesAsync();
         return true;
     }
     catch (Exception ex) { Console.Out.WriteLine(ex.Message); return false; }
 }
예제 #2
0
        public async Task <bool> Create(Employee item)
        {
            try
            {
                db.Employees.Add(item);
                await db.SaveChangesAsync();

                return(true);
            }
            catch { return(false); }
        }
예제 #3
0
        public async Task <bool> Create(WorkingBreak item)
        {
            try
            {
                db.WorkingBreaks.Add(item);
                await db.SaveChangesAsync();

                return(true);
            }
            catch (Exception ex) { Console.Out.WriteLine(ex.Message); return(false); }
        }
예제 #4
0
        public async Task <bool> Create(CustomerNotification item)
        {
            try
            {
                db.CustomerNotifications.Add(item);
                await db.SaveChangesAsync();

                return(true);
            }
            catch (Exception ex) { Console.Out.WriteLine(ex.Message); return(false); }
        }
예제 #5
0
        public async Task <bool> Create(CalendarSetting item)
        {
            try
            {
                db.CalendarSettings.Add(item);
                await db.SaveChangesAsync();

                return(true);
            }
            catch (Exception ex) { Console.Out.WriteLine(ex.Message); return(false); }
        }
예제 #6
0
        public async Task <bool> Create(ServiceCategory item)
        {
            try
            {
                db.ServiceCategories.Add(item);
                await db.SaveChangesAsync();

                return(true);
            }
            catch (Exception ex) { Console.Out.WriteLine(ex.Message); return(false); }
        }
예제 #7
0
        public async Task <IActionResult> Create([Bind("KId,Imie,Nazwisko,Pesel,DataUr")] Klient klient)
        {
            if (ModelState.IsValid)
            {
                _context.Add(klient);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(klient));
        }
예제 #8
0
        public async Task <IActionResult> Create([Bind("PId,KId,Wartosc,DataSplaty")] Pozyczki pozyczki)
        {
            if (ModelState.IsValid)
            {
                _context.Add(pozyczki);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["KId"] = new SelectList(_context.Klient, "KId", "Imie", pozyczki.KId);
            return(View(pozyczki));
        }
예제 #9
0
 public async void Save()
 {
     await db.SaveChangesAsync();
 }