Ejemplo n.º 1
0
 public void addFirmRoute(Route route, Client client)
 {
     try {
         CarpoolingDAL.FirmRoute fr = new FirmRoute();
         fr.idClient = client.Id;
         fr.idRoute = route.Id;
         db.FirmRoutes.InsertOnSubmit(fr);
         db.SubmitChanges();
     } catch (Exception) {
         //TODO saznaj koje su iznimke
         //iznimka se generira ako se narusi bilo koje pravilo vezano uz primary key ili foreign key. Znači, iznimka se
         //generira ako se pokuša dodati osoba koja ima JMBAG koji koristi neka druga osoba, zatim ako se pod osoba.sifUloga
         //stavi neki broj kojeg nema u tablici Uloga, itd..
         //return false;
     }
     //return true;
 }
		private void detach_FirmRoutes(FirmRoute entity)
		{
			this.SendPropertyChanging();
			entity.Client = null;
		}
		private void attach_FirmRoutes(FirmRoute entity)
		{
			this.SendPropertyChanging();
			entity.Client = this;
		}
 partial void DeleteFirmRoute(FirmRoute instance);
 partial void UpdateFirmRoute(FirmRoute instance);
 partial void InsertFirmRoute(FirmRoute instance);