//DELETE TREE public static void Delete(string drugName) { DrugModel drugToDelete = new DrugModel(); drugToDelete.Name = drugName; Storage.Instance.drugTree.DeleteAVL(Storage.Instance.drugTree.Root, drugToDelete); }
//INSERT TREE public static void Add(DrugModel drug) { Storage.Instance.drugTree.Comparer = NameComparison; Storage.Instance.drugTree.Converter = IdConverter; Storage.Instance.drugTree.GetValue = GetValueString; Storage.Instance.drugTree.Root = Storage.Instance.drugTree.InsertAVL(Storage.Instance.drugTree.Root, drug); }
//SEARCH TREE public static int Search(string drugName) { DrugModel drugToSearch = new DrugModel(); drugToSearch.Name = drugName; Storage.Instance.drugTree.Comparer = NameComparison; Storage.Instance.drugTree.Converter = IdConverter; return(Storage.Instance.drugTree.Find(drugToSearch)); }