static void Main(string[] args)
        {
            //HomeTask DeleteDrug Methodu yazmaliyiq.Id qebul edecek int tipinden.
            //Eger bu Id-li Drug varsa onu silecek, eger yoxdursa ekrana yazilacaq ki,
            //bu Id -li derman yoxdur onu sile bilmersiniz.


            TypeDrug type1 = new TypeDrug("HeadAche");
            TypeDrug type2 = new TypeDrug("HeartAche");
            Drug     drug1 = new Drug("Analgin", type1, 0.80, 100);
            Drug     drug2 = new Drug("Valerian", type2, 0.20, 1000);
            //Console.WriteLine(drug1);
            //Console.WriteLine(drug2);

            Pharmacy zeferan = new Pharmacy("Zeferan");

            zeferan.AddDrug(drug1);
            zeferan.AddDrug(drug2);

            //zeferan.DrugList();
            zeferan.SaleDrug(0, 105, 100);
        }
        private async void AddButtonClick(object sender, RoutedEventArgs e)
        {
            string name          = txtName.Text;
            string ingredient    = txtIngredient.Text;
            string symptom       = txtSymptom.Text;
            string adverseEffect = txtAdverseEffect.Text;

            Drug drug = new Drug
            {
                AdverseEffect   = adverseEffect,
                Ingredient      = ingredient,
                Name            = name,
                RelievedSymptom = symptom,
                UserId          = _user.Id,
                User            = _user
            };

            await _service.AddDrugAsync(_user, drug);

            MessageBox.Show("İlaç başarıyla eklendi.");

            this.Close();
        }
        public DrugDetailsWindow(Drug drug)
        {
            InitializeComponent();

            _drug = drug;
        }
Beispiel #4
0
 public void AddDrug(Drug newDrug)
 {
     Array.Resize(ref drugs, drugs.Length + 1);
     drugs[drugs.Length - 1] = newDrug;
     //Console.WriteLine($"{newDrug} - elave olundu!!!");
 }