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); }
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); }
/* 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); }
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); }
public void Delete(string id) { repoUsers.Remove(id); FilesDao.Add(repoUsers); }
public void Add(User user) { repoUsers.Add(user.Id, user); FilesDao.Add(repoUsers); }
static UserDao() { repoUsers = FilesDao.Read(); }
public void AddAward(Award award) { repoAwards.Add(award.Id, award); FilesDao.AddAward(repoAwards); }
static AwardDao() { repoAwards = FilesDao.ReadAward(); }