Beispiel #1
0
        public List<marks_users> getallusermarks(int k)
        {
            var Emplist = new List<marks_users>();
            onlinetestingEntities4 gt = new onlinetestingEntities4();
            foreach (var i in gt.marks.ToList())
            {
                if (i.test_id == k)
                {
                    marks_users m1 = new marks_users();
                    m1.ID = i.id;
                    m1.Test_ID = i.test_id;
                    m1.Name = i.Name;
                    m1.Email = i.Email;
                    m1.School_Colg = i.sch_colg;
                    m1.Obtained_Marks = i.obtained_marks;

                    Emplist.Add(m1);

                }
            }
            return Emplist;
        }
Beispiel #2
0
 public bool insertuserandmarks(marks_users insertMarks)
 {
     onlinetestingEntities4 tests = new onlinetestingEntities4();
     mark newuser = new mark();
     newuser.id = insertMarks.ID;
     newuser.test_id = insertMarks.Test_ID;
     newuser.Name = insertMarks.Name;
     newuser.Email = insertMarks.Email;
     newuser.sch_colg = insertMarks.School_Colg;
     newuser.obtained_marks = insertMarks.Obtained_Marks;
     tests.marks.Add(newuser);
     tests.SaveChanges();
     return true;
 }