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; } }
public async Task <bool> Create(Employee item) { try { db.Employees.Add(item); await db.SaveChangesAsync(); return(true); } catch { return(false); } }
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); } }
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); } }
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); } }
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); } }
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)); }
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)); }
public async void Save() { await db.SaveChangesAsync(); }