Example #1
0
        public Medicine(string name = "", string type = "", double price = 0, int ageRestrictions = 0, string intended = "", string composition = "", string comments = "")
            : base(name, type, price, ageRestrictions, intended, composition, comments)
        {
            reimbursedMedicine = new ReimbursedMedicine();
            replacements       = new ObservableCollection <Medicine>();

            GuidMed = Guid.NewGuid();
        }
Example #2
0
        public Medicine(StructMedicine structMedicine_, ReimbursedMedicine reimbursedMedicine_)
            : base(structMedicine_.Name, structMedicine_.Type, structMedicine_.Price, structMedicine_.AgeRestrictions, structMedicine_.Intended, structMedicine_.Composition, structMedicine_.Comments)
        {
            reimbursedMedicine = (ReimbursedMedicine)reimbursedMedicine_.Clone();

            replacements = new ObservableCollection <Medicine>();

            GuidMed = Guid.NewGuid();
        }
Example #3
0
        public void Copy(Medicine med)
        {
            Name            = med.Name;
            Type            = med.Type;
            Price           = med.Price;
            AgeRestrictions = med.AgeRestrictions;
            Intended        = med.Intended;
            Composition     = med.Composition;
            Comments        = med.Comments;

            GuidMed      = med.GuidMed;
            replacements = new ObservableCollection <Medicine>(med.replacements);

            reimbursedMedicine = (ReimbursedMedicine)this.reimbursedMedicine.Clone();
        }
Example #4
0
        public static void AddRandomMedicineToDatabase(Database database)
        {
            string nameMed = RandomText(3, 20);

            while (Regex.IsMatch(nameMed, "^[^ ].*$") == false)
            {
                nameMed = RandomText(3, 20);
            }


            StructMedicine     sMed = new StructMedicine(nameMed, RandomText(0, 15), RandomPrice(1000), rnd.Next(80), RandomText(0, 200), RandomText(0, 200), RandomText(0, 200));
            ReimbursedMedicine rMed = new ReimbursedMedicine(RandomPrice(1000), RandomLevelOfFunding());

            database.AddMedicine(new Medicine(sMed, rMed));
        }