public List <DrugStateChange> GetAllByDrug(Drug drug) { List <string[]> data = Persistence.ReadEntryByKey(path, drug.GetId().ToString(), 1); List <DrugStateChange> ret = new List <DrugStateChange>(); foreach (string[] temp in data) { ret.Add(new DrugStateChange(uint.Parse(temp[0]), new DateTime(long.Parse(temp[2])), int.Parse(temp[3]), int.Parse(temp[4]), uint.Parse(temp[1]))); } return(ret); }
public List <DrugBatch> GetDrugBatches(Drug drug) { List <DrugBatch> temp = DrugBatchRepository.GetInstance().GetAll(); List <DrugBatch> ret = new List <DrugBatch>(); foreach (DrugBatch db in temp) { if (db.DrugId == drug.GetId()) { ret.Add(db); } } return(ret); }