public void Delete(User entity) { User item = _source.FirstOrDefault(o => o.ID == entity.ID); if (item != null) { _source.Remove(item); } }
public void Update(User entity) { string query = string.Format("UPDATE USERS SET nom='{0}', prenom='{1}', mail='{2}', pass='******' WHERE id={4};", entity.Nom, entity.Prenom, entity.Mail, entity.Password, entity.ID); using (SqlCommand cmd = AccessBD.Connection.CreateCommand()) { cmd.CommandText = query; cmd.ExecuteNonQuery(); } }
public void Insert(User entity) { string query = string.Format("INSERT INTO USERS(nom, prenom, mail, pass) VALUES('{0}', '{1}', '{2}', '{3}');", entity.Nom, entity.Prenom, entity.Mail, entity.Password); using (SqlCommand cmd = AccessBD.Connection.CreateCommand()) { cmd.CommandText = query; cmd.ExecuteNonQuery(); } }
public void Delete(User entity) { string query = string.Format("DELETE FROM USERS WHERE id={0};", entity.ID); using (SqlCommand cmd = AccessBD.Connection.CreateCommand()) { cmd.CommandText = query; cmd.ExecuteNonQuery(); } }
public void Update(User entity) { User item = _source.FirstOrDefault(o => o.ID == entity.ID); if (item != null) { item.Mail = entity.Mail; item.Nom = entity.Nom; item.Password = entity.Password; item.Prenom = entity.Prenom; } }
public void Insert(User entity) { _source.Add(entity); }
private void SaveAction() { User user = new User(); user.Mail = this.UserMail; user.Nom = this.UserName; user.Prenom = this.UserFirstName; user.ID = this.Context.ApplicationUser.ID; user.Password = this.Context.ApplicationUser.Password; UserRepo.Update(user); this.Context.ApplicationUser = user; this.Context.HostWindow.UserName = user.Nom.ToUpper(); this.Context.HostWindow.FirstName = user.Prenom; }
private List<User> MapUSERSbo(IDataReader dataReader) { List<User> list = new List<User>(); while (dataReader.Read()) { User user = new User() { ID = Tools.ChangeType<int>(dataReader["id"]), Nom = Tools.ChangeType<string>(dataReader["nom"]), Prenom = Tools.ChangeType<string>(dataReader["prenom"]), Mail = Tools.ChangeType<string>(dataReader["mail"]), Password = Tools.ChangeType<string>(dataReader["pass"]) }; list.Add(user); } return list; }
public void Update(User entity) { _userRepo.Update(entity); }
public void Insert(User user) { _userRepo.Insert(user); }
public void Delete(User user) { _userRepo.Delete(user); }