private bool FilterPacientis(Pacienti entity)
 {
     return (entity.id_poistovna == this.id_poistovna);
 }
 private bool FilterPacienti(Pacienti entity)
 {
     return (entity.id_pacient == this.id_pacient);
 }
 private void AttachPacientis(Pacienti entity)
 {
     entity.Poistovne = this;
 }
 private void DetachPacientis(Pacienti entity)
 {
     entity.Poistovne = null;
 }
 private void DetachPacientis(Pacienti entity)
 {
     entity.Obcania = null;
 }
 private bool FilterPacientis(Pacienti entity)
 {
     return (entity.id_obcan == this.id_obcan);
 }
Пример #7
0
        /// <summary>
        /// 
        /// </summary>
        public Pacienti TransformPoToEntityPacient()
        {
            string pohlavie = GetPohlavie();
            Obcania obcan = new Obcania();
            obcan.meno = this.meno;
            obcan.priezvisko = this.priezvisko;
            obcan.datum_narodenia = this.datumNarodenia;
            obcan.pohlavie = pohlavie;
            obcan.titul = this.titul;
            Pacienti pacient = new Pacienti();
            pacient.Obcania = obcan;

            return pacient;
        }
 private void AttachPacientis(Pacienti entity)
 {
     entity.Obcania = this;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Pacientis EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPacientis(Pacienti pacienti)
 {
     base.AddObject("Pacientis", pacienti);
 }
 /// <summary>
 /// Create a new Pacienti object.
 /// </summary>
 /// <param name="id_pacient">Initial value of the id_pacient property.</param>
 /// <param name="id_poistovna">Initial value of the id_poistovna property.</param>
 /// <param name="id_obcan">Initial value of the id_obcan property.</param>
 /// <param name="tombstone">Initial value of the tombstone property.</param>
 public static Pacienti CreatePacienti(global::System.Int32 id_pacient, global::System.Int32 id_poistovna, global::System.Int32 id_obcan, global::System.Boolean tombstone)
 {
     Pacienti pacienti = new Pacienti();
     pacienti.id_pacient = id_pacient;
     pacienti.id_poistovna = id_poistovna;
     pacienti.id_obcan = id_obcan;
     pacienti.tombstone = tombstone;
     return pacienti;
 }
 public Pacienti GetPacientForVysetrenieImport(string meno, string priezvisko, DateTime? datumNar, string poistovna)
 {
     if ((meno == "" || meno == null) && 
         (priezvisko == "" || priezvisko == null) && 
         datumNar == null && 
         (poistovna == null || poistovna == "")
         )
     {
         return null;
     }
     else
     {
         Pacienti res = null;
         try
         {
             res = (from a in ObjectContext.Obcanias
                    from b in ObjectContext.Pacientis
                    where a.id_obcan == b.id_obcan
                    && a.meno == meno
                    && a.priezvisko == priezvisko
                    && a.datum_narodenia == datumNar
                    select b).First();
         }
         catch (InvalidOperationException)
         {
         }
         if (res != null)
         {
             return res;
         }
         else
         {
             Obcania obc = new Obcania();
             obc.meno = meno;
             obc.priezvisko = priezvisko;
             obc.datum_narodenia = datumNar;
             InsertObcania(obc);
             Pacienti pacient = new Pacienti();
             pacient.Obcania = obc;
             pacient.Poistovne = GetPoistovnaForVysetrenieImport(poistovna);
             InsertPacienti(pacient);
             ObjectContext.SaveChanges();
             return pacient;
         }
     }
 }
 public void UpdatePacienti(Pacienti currentPacienti)
 {
     this.ObjectContext.Pacientis.AttachAsModified(currentPacienti, this.ChangeSet.GetOriginal(currentPacienti));
 }
 public void InsertPacienti(Pacienti pacienti)
 {
     if ((pacienti.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(pacienti, EntityState.Added);
     }
     else
     {
         this.ObjectContext.Pacientis.AddObject(pacienti);
     }
 }