/// <summary> /// /// </summary> public Lieky TransformPoToEntity() { Lieky liek = new Lieky(); liek.nazov = this.nazov; liek.kod = this.kod; return liek; }
private bool FilterLieky(Lieky entity) { return (entity.id_liek == this.id_liek); }
/// <summary> /// Deprecated Method for adding a new object to the Liekies EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToLiekies(Lieky lieky) { base.AddObject("Liekies", lieky); }
/// <summary> /// Create a new Lieky object. /// </summary> /// <param name="id_liek">Initial value of the id_liek property.</param> /// <param name="nazov">Initial value of the nazov property.</param> /// <param name="tombstone">Initial value of the tombstone property.</param> public static Lieky CreateLieky(global::System.Int32 id_liek, global::System.String nazov, global::System.Boolean tombstone) { Lieky lieky = new Lieky(); lieky.id_liek = id_liek; lieky.nazov = nazov; lieky.tombstone = tombstone; return lieky; }
/// <summary> /// button evet click handler, handles Lieky synchronization /// </summary> public void SynchronizeLieky() { ambulanceLieky = new BindableCollection<Cis_Lieky>(); AmbulanceSynchronizationDomainContext ambulance = _serviceLocator.GetInstance<AmbulanceSynchronizationDomainContext>(); EntityQuery<Cis_Lieky> query = ambulance.GetCis_LiekyQuery(); EntityQuery<Lieky> query2 = _laboratoryDomainContext.GetAllLiekiesQuery(); List<IResult> results = new List<IResult>(); results.Add(Show.Busy()); LoadData<Cis_Lieky> loadResult = new LoadData<Cis_Lieky>(ambulance, query, LoadBehavior.RefreshCurrent, (sender) => { ambulanceLieky.Clear(); ambulanceLieky.AddRange(((LoadOperation<Cis_Lieky>)sender).Entities); } ); LoadData<Lieky> loadResult2 = new LoadData<Lieky>(_laboratoryDomainContext, query2, LoadBehavior.RefreshCurrent, (sender) => { laboratoryLieky.Clear(); laboratoryLieky.AddRange(((LoadOperation<Lieky>)sender).Entities); bool found = false; foreach (var item in ambulanceLieky) { for (int i = 0; i < laboratoryLieky.Count; i++) { found = false; if (item.Nazov == laboratoryLieky[i].nazov && item.Kod == laboratoryLieky[i].kod) { laboratoryLieky.RemoveAt(i); found = true; break; } } if (found == false) { Lieky novyLiek = new Lieky(); novyLiek.nazov = item.Nazov; novyLiek.kod = item.Kod; _laboratoryDomainContext.Liekies.Add(novyLiek); } } _laboratoryDomainContext.SubmitChanges(); Coroutine.BeginExecuteFor(Show.NotBusy(), this); } ); results.Add(loadResult); results.Add(loadResult2); Coroutine.BeginExecuteFor(results, this); }
/// <summary> /// /// </summary> public void OnDeleteInterferLiek(Lieky liek) { if (liek != null) { InterferujuceLieky.Remove(liek); RaisePropertyChangedEventImmediately("InterferujuceLieky"); Lieky.Add(liek); RaisePropertyChangedEventImmediately("Lieky"); } }
public void UpdateLieky(Lieky currentLieky) { this.ObjectContext.Liekies.AttachAsModified(currentLieky, this.ChangeSet.GetOriginal(currentLieky)); }
public void InsertLieky(Lieky lieky) { if ((lieky.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(lieky, EntityState.Added); } else { this.ObjectContext.Liekies.AddObject(lieky); } }