示例#1
0
 /// <summary>
 /// Show details about recipe and its drug list
 /// </summary>
 /// <param name="recept"></param>
 public IResult OnGetDrugDetail(Recept recept)
 {
     if (recept != null)
     {
         RecipeDrugListViewModel recipeDrugListViewModel = _serviceLocator.GetInstance<RecipeDrugListViewModel>();
         recipeDrugListViewModel.RecipeID = recept.id_recept;
         recipeDrugListViewModel.CaseType = 1;
         return Show.Child(recipeDrugListViewModel).In<IShellViewModel>();
     }
     else
     {
         MessageBox.Show("Pre danú akciu je potrebné zvoliť aspoň jeden recept z tabuľky!");
         return null;
     }
 }
示例#2
0
 public void DeleteRecept(Recept recept)
 {
     if ((recept.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(recept, EntityState.Deleted);
     }
     else
     {
         this.ObjectContext.Recept.Attach(recept);
         this.ObjectContext.Recept.DeleteObject(recept);
     }
 }
示例#3
0
 public void UpdateRecept(Recept currentRecept)
 {
     this.ObjectContext.Recept.AttachAsModified(currentRecept, this.ChangeSet.GetOriginal(currentRecept));
 }
示例#4
0
 public void InsertRecept(Recept recept)
 {
     if ((recept.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(recept, EntityState.Added);
     }
     else
     {
         this.ObjectContext.Recept.AddObject(recept);
     }
 }
示例#5
0
        /// <summary>
        /// Save recipe into database
        /// </summary>
        public void AddRecipeWithActiveSubstanceAction()
        {
            if (string.IsNullOrEmpty(SelectedDoctor) || string.IsNullOrEmpty(SelectedPatient) ||
                string.IsNullOrEmpty(SelectedDrugBarCodeWithActiveSubstance))
            {
                MessageBox.Show("Niektoré povinné údaje neboli vybraté alebo vyplnené!");
            }
            else
            {
                if (ChemistID <= 0)
                {
                    MessageBox.Show("Nie ste registrovaným lekárnikom!");
                    return;
                }
                Recept recept = new Recept();
                recept.id_lekar = Int32.Parse(SelectedDoctor);
                recept.id_pacient = Int32.Parse(SelectedPatient);
                recept.datum_vystavenia = DateTime.Now;

                _pharmacyDomainContext.Recepts.Add(recept);

                Liecivo_na_recepte lnr = new Liecivo_na_recepte();
                lnr.ciarovy_kod = SelectedDrugBarCodeWithActiveSubstance;
                lnr.id_lekarnik = ChemistID;

                _pharmacyDomainContext.SubmitChanges().Completed += (args, e) =>
                {
                    //lambda iba koli idcku, ktore az v tomto momente poznam
                    RecipeID = recept.id_recept;
                    lnr.id_recept = RecipeID;
                    _pharmacyDomainContext.Liecivo_na_receptes.Add(lnr);
                    _pharmacyDomainContext.SubmitChanges();
                };

                MessageBox.Show("Recept bol úspešne pridaný do databázy");
            }
        }
示例#6
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Recept EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToRecept(Recept recept)
 {
     base.AddObject("Recept", recept);
 }
示例#7
0
 /// <summary>
 /// Create a new Recept object.
 /// </summary>
 /// <param name="id_recept">Initial value of the id_recept property.</param>
 /// <param name="id_lekar">Initial value of the id_lekar property.</param>
 /// <param name="id_pacient">Initial value of the id_pacient property.</param>
 public static Recept CreateRecept(global::System.Int32 id_recept, global::System.Int32 id_lekar, global::System.Int32 id_pacient)
 {
     Recept recept = new Recept();
     recept.id_recept = id_recept;
     recept.id_lekar = id_lekar;
     recept.id_pacient = id_pacient;
     return recept;
 }
 private bool FilterRecept(Recept entity)
 {
     return (entity.id_recept == this.id_recept);
 }
 private bool FilterRecept1(Recept entity)
 {
     return (entity.id_pacient == this.OsCislo);
 }
 private void DetachRecept1(Recept entity)
 {
     entity.IdentifikacneUdaje1 = null;
 }
 private void AttachRecept1(Recept entity)
 {
     entity.IdentifikacneUdaje1 = this;
 }
 private bool FilterRecept(Recept entity)
 {
     return (entity.id_lekar == this.OsCislo);
 }