Example #1
0
        public void DeleteByNo(int no)
        {
            int    count = 0;
            string id    = string.Empty;

            foreach (var item in repoUsers)
            {
                if (count == no)
                {
                    id = item.Key;
                }

                count++;
            }

            repoUsers.Remove(id);
            FilesDao.Add(repoUsers);
        }
Example #2
0
        public void DeleteFromAwards(int no)
        {
            int    count = 0;
            string id    = string.Empty;

            foreach (var item in repoAwards)
            {
                if (count == no)
                {
                    id = item.Key;
                }

                count++;
            }

            repoAwards.Remove(id);
            FilesDao.AddAward(repoAwards);
        }
Example #3
0
        /* public void AddAwardWithImg(Award award)
         * {
         *   repoAwards.Add(award.Id, award);
         *   FilesDao.AddAwardWithImg(repoAwards);
         * }*/

        public void Change(int no, string newname)
        {
            int    count = 0;
            string id    = string.Empty;

            foreach (var item in repoAwards)
            {
                if (count == no)
                {
                    id = item.Key;
                }

                count++;
            }

            repoAwards[id].Title = newname;
            FilesDao.AddAward(repoAwards);
        }
Example #4
0
        public void Change(int no, string newname, string newdate)
        {
            int    count = 0;
            string id    = string.Empty;

            foreach (var item in repoUsers)
            {
                if (count == no)
                {
                    id = item.Key;
                }

                count++;
            }

            repoUsers[id].Name        = newname;
            repoUsers[id].DateOfBirth = DateTime.Parse(newdate);
            FilesDao.Add(repoUsers);
        }
Example #5
0
 public void Delete(string id)
 {
     repoUsers.Remove(id);
     FilesDao.Add(repoUsers);
 }
Example #6
0
 public void Add(User user)
 {
     repoUsers.Add(user.Id, user);
     FilesDao.Add(repoUsers);
 }
Example #7
0
 static UserDao()
 {
     repoUsers = FilesDao.Read();
 }
Example #8
0
 public void AddAward(Award award)
 {
     repoAwards.Add(award.Id, award);
     FilesDao.AddAward(repoAwards);
 }
Example #9
0
 static AwardDao()
 {
     repoAwards = FilesDao.ReadAward();
 }