Exemplo n.º 1
0
        public List <string> getCourse(string teacherId)
        {
            List <string> a = new List <string>();

            using (var db = new EbysVol9Entities())
            {
                var result = from k in db.GIVENCOURSES
                             where k.GTeacherId == teacherId
                             select new
                {
                    k.GCourseId
                };
                foreach (var item in result)
                {
                    a.Add(item.GCourseId);
                }
            }

            return(a);

            //SqlConnection con = new SqlConnection("DESKTOP-RUVJ75R;initial catalog=EbysVol9;integrated security=True");


            //SqlCommand cmd = new SqlCommand("select GCourseId from GIVENCOURSES where GteacherId=@teacherId",con);
            //cmd.Parameters.AddWithValue("@teacherId", teacherId);
            //con.Open();
            //cmd.ExecuteNonQuery();
        }
Exemplo n.º 2
0
        public List <string> getSemesterCourse()
        {
            List <string> a = new List <string>();

            using (var db = new EbysVol9Entities())
            {
                var result = from k in db.SEMESTERCOURSE

                             select new
                {
                    k.CourseId
                };
                foreach (var item in result)
                {
                    a.Add(item.CourseId);
                }
            }

            return(a);
        }
Exemplo n.º 3
0
        public List <string> getStudents(string courseId)
        {
            List <string> a = new List <string>();

            using (var db = new EbysVol9Entities())
            {
                var result = from k in db.TAKENCOURSES
                             where k.TCourseId == courseId
                             select new
                {
                    k.TStudenId
                };
                foreach (var item in result)
                {
                    a.Add(item.TStudenId);
                }
            }

            return(a);
        }