コード例 #1
0
        /// <summary>
        /// 
        /// </summary>
        public Pristroje TransformPoToEntity()
        {
            Pristroje pristroj = new Pristroje();
            pristroj.nazov = this.nazov;
            pristroj.popis = this.popis;

            return pristroj;
        }
コード例 #2
0
 private bool FilterPristroje(Pristroje entity)
 {
     return (entity.id_pristroj == this.id_pristroj);
 }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Pristrojes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPristrojes(Pristroje pristroje)
 {
     base.AddObject("Pristrojes", pristroje);
 }
コード例 #4
0
 /// <summary>
 /// Create a new Pristroje object.
 /// </summary>
 /// <param name="id_pristroj">Initial value of the id_pristroj property.</param>
 /// <param name="nazov">Initial value of the nazov property.</param>
 /// <param name="tombstone">Initial value of the tombstone property.</param>
 public static Pristroje CreatePristroje(global::System.Int32 id_pristroj, global::System.String nazov, global::System.Boolean tombstone)
 {
     Pristroje pristroje = new Pristroje();
     pristroje.id_pristroj = id_pristroj;
     pristroje.nazov = nazov;
     pristroje.tombstone = tombstone;
     return pristroje;
 }
コード例 #5
0
 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;
         }
     }
 }
コード例 #6
0
 public void UpdatePristroje(Pristroje currentPristroje)
 {
     this.ObjectContext.Pristrojes.AttachAsModified(currentPristroje, this.ChangeSet.GetOriginal(currentPristroje));
 }
コード例 #7
0
 public void InsertPristroje(Pristroje pristroje)
 {
     if ((pristroje.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(pristroje, EntityState.Added);
     }
     else
     {
         this.ObjectContext.Pristrojes.AddObject(pristroje);
     }
 }