コード例 #1
0
ファイル: AddLiekPo.cs プロジェクト: aytacozkan/nisproject
        /// <summary>
        /// 
        /// </summary>
        public Lieky TransformPoToEntity()
        {
            Lieky liek = new Lieky();
            liek.nazov = this.nazov;
            liek.kod = this.kod;

            return liek;
        }
コード例 #2
0
 private bool FilterLieky(Lieky entity)
 {
     return (entity.id_liek == this.id_liek);
 }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Liekies EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToLiekies(Lieky lieky)
 {
     base.AddObject("Liekies", lieky);
 }
コード例 #4
0
 /// <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;
 }
コード例 #5
0
        /// <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);
        }
コード例 #6
0
 /// <summary>
 /// 
 /// </summary>
 public void OnDeleteInterferLiek(Lieky liek)
 {
     if (liek != null)
     {
         InterferujuceLieky.Remove(liek);
         RaisePropertyChangedEventImmediately("InterferujuceLieky");
         Lieky.Add(liek);
         RaisePropertyChangedEventImmediately("Lieky");
     }
 }
コード例 #7
0
 public void UpdateLieky(Lieky currentLieky)
 {
     this.ObjectContext.Liekies.AttachAsModified(currentLieky, this.ChangeSet.GetOriginal(currentLieky));
 }
コード例 #8
0
 public void InsertLieky(Lieky lieky)
 {
     if ((lieky.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(lieky, EntityState.Added);
     }
     else
     {
         this.ObjectContext.Liekies.AddObject(lieky);
     }
 }