예제 #1
0
        public bool Delete(Guid id)
        {
            var temp = ListOfAwards.FirstOrDefault(x => x.Id == id);

            if (temp == null)
            {
                return(false);
            }
            ListOfAwards.Remove(temp);
            return(true);
        }
예제 #2
0
        public bool Save()
        {
            FileStream   fs = new FileStream(filename, FileMode.Create);
            StreamWriter sw = new StreamWriter(fs);

            for (int i = 0; i < ListOfAwards.Count(); i++)
            {
                sw.Write(ListOfAwards[i].Id.ToString() + "{" + ListOfAwards[i].Title + "\r\n");
            }
            sw.Close();
            return(true);
        }