Exemple #1
0
        //Lấy danh sách accounts

        /* public List<Account> GetAllAccounts()
         * {
         *   return accounts;
         * }*/

        public String getRoleAccount(int id)
        {
            db = new LinQDataContext();
            var result = db.getAccountById(id).FirstOrDefault();

            return(result.Role);
        }
Exemple #2
0
        public Account getAccountById(int id)
        {
            db = new LinQDataContext();
            var result = db.getAccountById(id).FirstOrDefault();

            if (result != null)
            {
                Account account = new Account();
                account.AccountId = result.AccountId;
                account.Password  = result.Password;
                account.Role      = result.Role;
                account.UserName  = result.UserName;
                return(account);
            }
            return(null);
        }