private void ManageUser_Load(object sender, EventArgs e) { try { DataTable dt = new DataTable(); dt = ub.GetAllUser(); dgvUsers.DataSource = dt; } catch (Exception) { } }
public IActionResult GetAllUser() { try { var result = userBUS.GetAllUser(); return(Ok(result)); } catch (Exception ex) { throw; } }
private void show() { UserBUS db = new UserBUS(); List <DAO.User> result = db.GetAllUser(); DataTable dt = new DataTable("User"); dt.Columns.Add("ID", typeof(Int32)); dt.Columns.Add("Username", typeof(string)); foreach (DAO.User user in result) { int id = user.IDUser; string name = user.Username; dt.Rows.Add(id, name); } comboBox.DataSource = dt; comboBox.DisplayMember = "Username"; comboBox.ValueMember = "ID"; }
public async Task <List <UserViewModel> > GetAllUsers() { List <UserViewModel> userList = new List <UserViewModel>(); var users = await userBUS.GetAllUser(); if (users.Count > 0) { foreach (var user in users) { UserViewModel currentUser = new UserViewModel { Id = user.Id, Username = user.Username, Password = user.Password, Email = user.Email, AuthLevelId = user.AuthLevelRefId }; userList.Add(currentUser); } } return(userList); }
public static List <User> GetAllUser() { return(UserBUS.GetAllUser()); }