Пример #1
0
 public List <Course_tbl> GetCourses()
 {
     using (LMSDBEntities db = new LMSDBEntities())
     {
         C_List = db.Course_tbl.ToList();
     }
     return(C_List);
 }
Пример #2
0
        public override string[] GetRolesForUser(string username)
        {
            using (LMSDBEntities db = new LMSDBEntities())
            {
                var userRoles = new List <string>();
                if (db.Student_tbl.Any(user => user.Email == username))
                {
                    userRoles.Add("Student");
                }
                else if (db.Lecturer_tbl.Any(user => user.Email == username))
                {
                    userRoles.Add("Lecturer");
                }
                else if (db.Admin_tbl.Any(user => user.Email == username))
                {
                    userRoles.Add("Admin");
                }

                return(userRoles.ToArray());
            }
        }