Ejemplo n.º 1
0
 //Lấy danh sách nhóm người dùng của 1 tài khoản MySQL
 public List <string> GetListIdGroupUserMySQL(string pUserName)
 {
     try
     {
         C_Account        acc  = new C_Account();
         List <string>    list = new List <string>();
         DataTable        tb   = new DataTable();
         MySqlDataAdapter dt   = new MySqlDataAdapter("SELECT ID_GROUP_USER FROM user_group_user WHERE USER_NAME='" + pUserName + "'", Properties.Settings.Default.DbSpaDataContextConnectionString);
         dt.Fill(tb);
         foreach (System.Data.DataRow r in tb.Rows)
         {
             foreach (System.Data.DataColumn c in tb.Columns)
             {
                 list.Add(r[c].ToString());
             }
         }
         return(list);
     }
     catch
     {
         return(null);
     }
 }
Ejemplo n.º 2
0
 //Lấy danh sách nhóm người dùng của 1 tài khoản
 public List <string> GetListIdGroupUser(string pUserName)
 {
     try
     {
         C_Account      acc  = new C_Account();
         List <string>  list = new List <string>();
         DataTable      tb   = new DataTable();
         SqlDataAdapter dt   = new SqlDataAdapter("select ID_GROUP from USER_GROUP_USER where ID_USER='******'", Properties.Settings.Default.DB_SPAConnectionString);
         dt.Fill(tb);
         foreach (System.Data.DataRow r in tb.Rows)
         {
             foreach (System.Data.DataColumn c in tb.Columns)
             {
                 list.Add(r[c].ToString());
             }
         }
         return(list);
     }
     catch
     {
         return(null);
     }
 }