Esempio n. 1
0
 private void RemoveEmployeeFromDB(Employee employee)
 {
     using (BusStationDatabase db = new BusStationDatabase())
     {
         db.Employee.Remove(employee);
         db.SaveChanges();
     }
 }
Esempio n. 2
0
 public static void BuyTicket(Ticket ticket)
 {
     using (BusStationDatabase db = new BusStationDatabase())
     {
         db.Ticket.Add(ticket);
         db.SaveChanges();
     }
 }
Esempio n. 3
0
 public static bool Registration(Client client)
 {
     using (BusStationDatabase db = new BusStationDatabase())
     {
         db.Client.Add(client);
         try
         {
             db.SaveChanges();
             return(true);
         }
         catch (DbUpdateException)
         {
             return(false);
         }
     }
 }
Esempio n. 4
0
 private bool AddNewEmployee(Employee employee)
 {
     using (BusStationDatabase db = new BusStationDatabase())
     {
         try
         {
             db.Employee.Add(employee);
             db.SaveChanges();
             return(true);
         }
         catch (DbUpdateException)
         {
             return(false);
         }
     }
 }