private bool DoLoad() { TUser user = new TUser(_dbpath, PassWord); ListUser = user.Load_User(); if (ListUser == null || ListUser.Count <= 0) return false; else return true; }
private bool DoSelect() { TUser user = new TUser(_dbpath, PassWord); if (UserName == null || UserName.Length <= 0) return false; ListUser = user.Sel_User(UserName); if (ListUser == null || ListUser.Count <= 0) return false; else return true; }
private bool DoInsert() { if (ListUser == null || ListUser.Count <= 0) return false; TUser user = new TUser(_dbpath, PassWord); int count = 0; foreach (CUser u in ListUser) { CUser tmp = u; if (user.Insert_User(ref tmp)) { count++; } } if (count <= 0) return false; else return true; }
private bool DoUpdate() { TUser user = new TUser(_dbpath, PassWord); return user.Update_User(ListUser); }
private bool DoClear() { TUser user = new TUser(_dbpath, PassWord); return user.Clear_User(); }
private bool DoDelete() { if (ListUser == null || ListUser.Count <= 0) return false; TUser user = new TUser(_dbpath, PassWord); int count = 0; foreach (CUser u in ListUser) { if (user.Delete_User(u)) { count++; } } if (count <= 0) return false; else return true; }