コード例 #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();
        }
コード例 #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();
        }
コード例 #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();
        }
コード例 #4
0
ファイル: Testing.cs プロジェクト: dominikbis/Project_PK4_WPF
        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));
        }