Example #1
0
 public static TeacherDTO ToDto(DAL.Teacher t)
 {
     return(new TeacherDTO()
     {
         teacherId = t.teacherId, teacherName = t.teacherName, teacherPassword = t.teacherPassword
     });
 }
Example #2
0
        public int Delete(string[] Ids)
        {
            //防止注入式漏洞
            string ids = string.Join(",", Ids);

            DAL.Teacher dal = new DAL.Teacher();
            return(dal.Delete(ids));
        }
        public ECRoom101()
        {
            InitializeComponent();
            DataClassesLinqDataContext db = new DataClassesLinqDataContext(DataAccessClassLinq.connectionStringLinq);

            DAL.Admission_Student admissionstudent = new DAL.Admission_Student();
            DAL.Teacher           teach            = new DAL.Teacher();

            List <string> objList  = new List <string>();
            List <string> objList2 = new List <string>();

            var a = from e in db.Admission_Students
                    select e;

            var b = from e in db.Teachers
                    select e;

            foreach (DAL.Admission_Student st in a)
            {
                objList.Add(st.Admission_Student_ID);
            }

            foreach (DAL.Teacher t in b)
            {
                objList2.Add(t.Full_Name);
            }

            _1.ItemsSource  = objList;
            _2.ItemsSource  = objList;
            _3.ItemsSource  = objList;
            _4.ItemsSource  = objList;
            _5.ItemsSource  = objList;
            _6.ItemsSource  = objList;
            _7.ItemsSource  = objList;
            _8.ItemsSource  = objList;
            _9.ItemsSource  = objList;
            _10.ItemsSource = objList;
            _11.ItemsSource = objList;
            _12.ItemsSource = objList;
            _13.ItemsSource = objList;
            _14.ItemsSource = objList;
            _15.ItemsSource = objList;
            _16.ItemsSource = objList;
            _17.ItemsSource = objList;
            _18.ItemsSource = objList;
            _19.ItemsSource = objList;
            _20.ItemsSource = objList;
            _21.ItemsSource = objList;
            _22.ItemsSource = objList;
            _23.ItemsSource = objList;
            _24.ItemsSource = objList;

            Invi1.ItemsSource = objList2;
            Invi2.ItemsSource = objList2;
            // _1.Content = objList.First();
        }
Example #4
0
 public bool Add(Model.Teacher teacher, string password, out string message)
 {
     message = "";
     if (teacher.TeacherNo.Trim() == "")
     {
         message = "学号不可为空白";
         return(false);
     }
     if (teacher.TeacherName.Trim() == "")
     {
         message = "姓名不可为空白";
         return(false);
     }
     if (teacher.Subject.Trim() == "")
     {
         message = "专业不可为空白";
         return(false);
     }
     if (teacher.College.Trim() == "")
     {
         message = "学院不可为空白";
         return(false);
     }
     if (teacher.Research.Trim() == "")
     {
         message = "研究方向不可为空白";
         return(false);
     }
     if (teacher.Brief.Trim() == "")
     {
         message = "详细情况不可为空白";
         return(false);
     }
     if (password.Trim() == "")
     {
         message = "默认密码不可空白";
         return(false);
     }
     DAL.Teacher model = new DAL.Teacher();
     if (model.CheckExist(teacher.TeacherNo.Trim()))
     {
         message = "该导师已被录入!!!";
         return(false);
     }
     message = "导入成功";
     model.Add(teacher);
     Model.TeacherAccount account = new Model.TeacherAccount();
     account.TeacherNo = teacher.TeacherNo;
     account.Password  = Encode.GenerateMD5(password);
     return(new DAL.TeacherAccount().Add(account));
 }
Example #5
0
 public int EditSave(int EditId, string EditTeacherName, string EditTeacherWorkNum,
                     int EditSex, int EditIsLeader, int EditSchool, int EditCourse, string EditTeacherPWD)
 {
     DAL.Teacher dal = new DAL.Teacher();
     return(dal.EditSave(EditId, EditTeacherName, EditTeacherWorkNum, EditSex, EditIsLeader, EditSchool, EditCourse, EditTeacherPWD));
 }
Example #6
0
 public Model.Teacher GetTeacher(int Id)
 {
     DAL.Teacher dal = new DAL.Teacher();
     return(dal.GetTeacher(Id));
 }
Example #7
0
 public int AddSave(string AddTeacherName, string AddTeacherWorkNum,
                    int AddSex, int AddIsLeader, int AddSchool, int AddCourse, string AddTeacherPWD)
 {
     DAL.Teacher dal = new DAL.Teacher();
     return(dal.AddSave(AddTeacherName, AddTeacherWorkNum, AddSex, AddIsLeader, AddSchool, AddCourse, AddTeacherPWD));
 }
Example #8
0
 public int GetCount()
 {
     DAL.Teacher dal = new DAL.Teacher();
     return(dal.GetCount());
 }
Example #9
0
 public List <Model.Teacher> GetList(int pageSize, int pageNumber, string TeacherWorkNum, string TeacherName, string CourseName)
 {
     DAL.Teacher dal = new DAL.Teacher();
     return(dal.GetList(pageSize, pageNumber, TeacherWorkNum, TeacherName, CourseName));
 }