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(); }
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)); }
private void LoadMedicines(DataReader dataReader, int MedCounter) { StructMedicine sMed = new StructMedicine(); ReimbursedMedicine rMed = new ReimbursedMedicine(); int length; for (int i = 0; i < MedCounter; i++) { length = dataReader.ReadInt32(); sMed.Name = dataReader.ReadString((uint)length); length = dataReader.ReadInt32(); sMed.Type = dataReader.ReadString((uint)length); sMed.Price = dataReader.ReadDouble(); sMed.AgeRestrictions = dataReader.ReadInt32(); length = dataReader.ReadInt32(); sMed.Intended = dataReader.ReadString((uint)length); length = dataReader.ReadInt32(); sMed.Composition = dataReader.ReadString((uint)length); length = dataReader.ReadInt32(); sMed.Comments = dataReader.ReadString((uint)length); rMed.FundingLimit = dataReader.ReadDouble(); rMed.Level = (LevelOfFunding)dataReader.ReadInt32(); medBase.Add(new Medicine(sMed, rMed)); medBase[i].GuidMed = dataReader.ReadGuid(); } }