コード例 #1
0
 private void ManageUser_Load(object sender, EventArgs e)
 {
     try
     {
         DataTable dt = new DataTable();
         dt = ub.GetAllUser();
         dgvUsers.DataSource = dt;
     }
     catch (Exception)
     {
     }
 }
コード例 #2
0
 public IActionResult GetAllUser()
 {
     try
     {
         var result = userBUS.GetAllUser();
         return(Ok(result));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #3
0
ファイル: Item.cs プロジェクト: baobeta/ToDoListCsharp
        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";
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 public static List <User> GetAllUser()
 {
     return(UserBUS.GetAllUser());
 }