示例#1
0
        //DELETE TREE
        public static void Delete(string drugName)
        {
            DrugModel drugToDelete = new DrugModel();

            drugToDelete.Name = drugName;
            Storage.Instance.drugTree.DeleteAVL(Storage.Instance.drugTree.Root, drugToDelete);
        }
示例#2
0
 //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);
 }
示例#3
0
        //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));
        }