Esempio n. 1
0
 //מחזיר את כל המורות
 public List <Teacher> GetTeachers()
 {
     using (HomeWorkProjectEntities2 db = new HomeWorkProjectEntities2())
     {
         return(db.Teacher.ToList());
     }
 }
 public List <StudyGroup> GetStudyGroup()
 {
     using (HomeWorkProjectEntities2 db = new HomeWorkProjectEntities2())
     {
         return(db.StudyGroup.ToList());
     }
 }
Esempio n. 3
0
 //מחזיר את כל ש"ב
 public List <HwToStydyClassOnDate> GetHW()
 {
     using (HomeWorkProjectEntities2 db = new HomeWorkProjectEntities2())
     {
         return(db.HwToStydyClassOnDate.ToList());
     }
 }
Esempio n. 4
0
 //מחזיר תלמיד לפי תז
 public Student GetStudent(string TZ)
 {
     using (HomeWorkProjectEntities2 db = new HomeWorkProjectEntities2())
     {
         return(db.Student.FirstOrDefault(student => student.studentTz == TZ));
     }
 }
Esempio n. 5
0
 //מחזיר את כל התלמידים
 public List <Student> GetStudents()
 {
     using (HomeWorkProjectEntities2 db = new HomeWorkProjectEntities2())
     {
         return(db.Student.ToList());
     }
 }
Esempio n. 6
0
 //מחזיר מורה לפי שם וסיסמא
 public Teacher GetTeacher(string Name, string password)
 {
     using (HomeWorkProjectEntities2 db = new HomeWorkProjectEntities2())
     {
         Teacher t = new Teacher();
         t = db.Teacher.FirstOrDefault(teacher => teacher.teacherFirstName == Name && teacher.teacherPassword == password);
         return(t);
     }
 }
        //שליפת כיתות למורה
        public List <string> GetStudyClassForTeacher(int teacherID)
        {
            List <string> list = new List <string>();

            using (HomeWorkProjectEntities2 db = new HomeWorkProjectEntities2())
            {
                var q = db.getListClassesForTeacher(teacherID).ToList();

                foreach (var item in q)
                {
                    list.Add(item);
                }
            }

            return(list);
        }
Esempio n. 8
0
 //מוסיף ש"ב
 public int AddHw(HwToStydyClassOnDate hw)
 {
     try
     {
         using (HomeWorkProjectEntities2 db = new HomeWorkProjectEntities2())
         {
             db.HwToStydyClassOnDate.Add(hw);
             db.SaveChanges();
             return(1);
         }
     }
     catch (Exception)
     {
         return(0);
     }
 }
Esempio n. 9
0
 //הוספת תלמידה -צריך להוסיף לכיתת לימוד
 public int AddStudentDAL(Student s)
 {
     using (HomeWorkProjectEntities2 db = new HomeWorkProjectEntities2())
     {
         try
         {
             db.Student.Add(s);
             db.SaveChanges();
             return(1);
         }
         catch (Exception)
         {
             return(0);
         }
     }
 }
Esempio n. 10
0
 public void AddHW(HwToStydyClassOnDate hw)
 {
     try
     {
         using (HomeWorkProjectEntities2 db = new HomeWorkProjectEntities2())
         {
             db.HwToStydyClassOnDate.Add(hw);
             db.SaveChanges();
             //return 1;
             //return teacher.id??
         }
     }
     catch (Exception)
     {
         //return 0;
     }
 }
Esempio n. 11
0
 //מוסיף מורה חדשה
 public int AddTeacher(Teacher teacher)
 {
     try
     {
         using (HomeWorkProjectEntities2 db = new HomeWorkProjectEntities2())
         {
             db.Teacher.Add(teacher);
             db.SaveChanges();
             return(1);
             //return teacher.id??
         }
     }
     catch (Exception e)
     {
         //Console.WriteLine(e);
         return(0);
     }
 }
Esempio n. 12
0
        //מחזיר את התלמידים וסטטוס הכנה לפי כיתה
        public List <StatusStudentByClass> StatusByClass(string studyGroupClass)
        {
            List <StatusStudentByClass> list = new List <StatusStudentByClass>();

            using (HomeWorkProjectEntities2 db = new HomeWorkProjectEntities2())
            {
                var q  = db.StatusStudentByClass(studyGroupClass).ToList();
                var q2 = db.s(studyGroupClass).ToList();
                foreach (var item in q2)
                {
                    StatusStudentByClass status = new StatusStudentByClass();
                    status.StudentId           = item.studentId;
                    status.StudentFirstName    = item.studentFirstName;
                    status.StudentLastName     = item.studentLastName;
                    status.StatusOfPreparation = (bool)item.statusOfPreparation;
                    //status.StudyGroupClass = item.studyGroupClass;
                    list.Add(status);
                }
            }
            return(list);
        }
Esempio n. 13
0
        //מחזיר את התלמידים וסטטוס הכנה לפי מקצוע
        public List <StatusesStudentHomeWork> StatusPupil(string proffesion)
        {
            List <StatusesStudentHomeWork> list = new List <StatusesStudentHomeWork>();

            using (HomeWorkProjectEntities2 db = new HomeWorkProjectEntities2())
            {
                var q  = db.StatusPupilByDay(proffesion).ToList();
                var q2 = db.p(proffesion).ToList();
                foreach (var item in q2)
                {
                    StatusesStudentHomeWork status = new StatusesStudentHomeWork();
                    status.StudentId           = item.studentId;
                    status.StudentFirstName    = item.studentFirstName;
                    status.StudentLastName     = item.studentLastName;
                    status.StatusOfPreparation = (bool)item.statusOfPreparation;
                    //status.ProfessionDescription = item.professionDescription;
                    list.Add(status);
                }
            }
            return(list);
        }
Esempio n. 14
0
        //מחזיר שב לתלמיד להיום
        public List <HwForStudentForToday> GetHwForToday(int id)
        {
            List <HwForStudentForToday> list = new List <HwForStudentForToday>();

            using (HomeWorkProjectEntities2 db = new HomeWorkProjectEntities2())
            {
                var q3 = db.HwS(id).ToList();
                foreach (var item in q3)
                {
                    HwForStudentForToday hw = new HwForStudentForToday();
                    hw.HwDate                = (DateTime)item.hwToStydyClassOnDate_Date;
                    hw.HwDescription         = item.hwDescription;
                    hw.Deadline              = (DateTime)item.deadline;
                    hw.DurationOfPreparation = (int)item.durationOfPreparation;
                    hw.VerificationQuestion  = item.verificationQuestion;
                    hw.VerificationAnswer    = (int)item.verificationAnswer;
                    hw.professionDescription = item.professionDescription;
                    list.Add(hw);
                }
            }
            return(list);
        }