private bool FilterPristroje_Laboratoria(Pristroje_Laboratoria entity)
 {
     return (entity.id_pristroj == this.id_pristroj);
 }
 private void AttachPristroje_Laboratoria(Pristroje_Laboratoria entity)
 {
     entity.Pristroje = this;
 }
 private void DetachPristroje_Laboratoria(Pristroje_Laboratoria entity)
 {
     entity.Pristroje = null;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Pristroje_Laboratoria EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPristroje_Laboratoria(Pristroje_Laboratoria pristroje_Laboratoria)
 {
     base.AddObject("Pristroje_Laboratoria", pristroje_Laboratoria);
 }
 /// <summary>
 /// Create a new Pristroje_Laboratoria object.
 /// </summary>
 /// <param name="id_pristroj">Initial value of the id_pristroj property.</param>
 /// <param name="id_laboratorium">Initial value of the id_laboratorium property.</param>
 /// <param name="tombstone">Initial value of the tombstone property.</param>
 public static Pristroje_Laboratoria CreatePristroje_Laboratoria(global::System.Int32 id_pristroj, global::System.Int32 id_laboratorium, global::System.Boolean tombstone)
 {
     Pristroje_Laboratoria pristroje_Laboratoria = new Pristroje_Laboratoria();
     pristroje_Laboratoria.id_pristroj = id_pristroj;
     pristroje_Laboratoria.id_laboratorium = id_laboratorium;
     pristroje_Laboratoria.tombstone = tombstone;
     return pristroje_Laboratoria;
 }
 public Pristroje GetPristrojForVysetrenieImport(string nazov, int idLaboratoria)
 {
     if (nazov == null || nazov == "")
     {
         return null;
     }
     else
     {
         Pristroje res = null;
         try
         {
             res = (from b in ObjectContext.Pristroje_Laboratoria
                    from c in ObjectContext.Pristrojes
                    where b.id_laboratorium == idLaboratoria
                    && b.id_pristroj == c.id_pristroj
                    && c.nazov == nazov
                    select c).First();
         }
         catch (InvalidOperationException)
         {
         }
         if (res != null)
         {
             return res;
         }
         else
         {
             Pristroje p = new Pristroje();
             p.nazov = nazov;
             InsertPristroje(p);
             Pristroje_Laboratoria pl = new Pristroje_Laboratoria();
             pl.id_laboratorium = idLaboratoria;
             pl.Pristroje = p;
             InsertPristroje_Laboratoria(pl);
             ObjectContext.SaveChanges();
             return p;
         }
     }
 }
 public void UpdatePristroje_Laboratoria(Pristroje_Laboratoria currentPristroje_Laboratoria)
 {
     this.ObjectContext.Pristroje_Laboratoria.AttachAsModified(currentPristroje_Laboratoria, this.ChangeSet.GetOriginal(currentPristroje_Laboratoria));
 }
        /*public IQueryable<Pristroje_Laboratoria> GetAllPristroje_Laboratoria()
        {
            return from a in this.ObjectContext.Pristroje_Laboratoria
                   where a.tombstone == false
                   select a;
        }*/

        public void InsertPristroje_Laboratoria(Pristroje_Laboratoria pristroje_Laboratoria)
        {
            if ((pristroje_Laboratoria.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pristroje_Laboratoria, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Pristroje_Laboratoria.AddObject(pristroje_Laboratoria);
            }
        }