public void UpdateAddress(Pobyt address)
            {
                Pobyt AddressChanges = this.ChangeSet.GetOriginal(address);
                if (AddressChanges != null)
                {
                    this.ObjectContext.CreateObjectSet<Pobyt>().AttachAsModified(address, AddressChanges);
                }
                else
                {
                    this.ObjectContext.Pobyt.Attach(address);
                }

                this.ObjectContext.SaveChanges();
            }
 public void InsertAdrress(Pobyt address)
 {
     if ((address.EntityState != EntityState.Added))
     {
         if ((address.EntityState != EntityState.Detached))
         {
             this.ObjectContext.ObjectStateManager.
                 ChangeObjectState(address, EntityState.Added);
         }
         else
         {
             this.ObjectContext.AddToPobyt(address);
         }
     }
 }
 private bool FilterPobyt(Pobyt entity)
 {
     return (entity.OsCislo == this.OsCislo);
 }
 private void AttachPobyt(Pobyt entity)
 {
     entity.IdentifikacneUdaje = this;
 }
 private void DetachPobyt(Pobyt entity)
 {
     entity.IdentifikacneUdaje = null;
 }
 private bool FilterPobyt(Pobyt entity)
 {
     return (entity.IdObec == this.Id);
 }
 private void DetachPobyt(Pobyt entity)
 {
     entity.Cis_Obec = null;
 }
 private void AttachPobyt(Pobyt entity)
 {
     entity.Cis_Obec = this;
 }
 /// <summary>
 /// Create a new Pobyt object.
 /// </summary>
 /// <param name="idAdresa">Initial value of the IdAdresa property.</param>
 /// <param name="idObec">Initial value of the IdObec property.</param>
 /// <param name="osCislo">Initial value of the OsCislo property.</param>
 public static Pobyt CreatePobyt(global::System.Int32 idAdresa, global::System.Int32 idObec, global::System.Int32 osCislo)
 {
     Pobyt pobyt = new Pobyt();
     pobyt.IdAdresa = idAdresa;
     pobyt.IdObec = idObec;
     pobyt.OsCislo = osCislo;
     return pobyt;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Pobyt EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPobyt(Pobyt pobyt)
 {
     base.AddObject("Pobyt", pobyt);
 }