コード例 #1
0
        public List <TeacherModel> GetAllTeachers()
        {
            TeacherGateWay      aTeacherGateWay = new TeacherGateWay();
            List <TeacherModel> teachers        = aTeacherGateWay.GetAllTeachers();

            return(teachers);
        }
コード例 #2
0
        public TeacherModel GetTeacherByTeacherId(int teacherId)
        {
            TeacherGateWay aTeacherGateWay = new TeacherGateWay();
            TeacherModel   aTeacherModel   = new TeacherModel();

            aTeacherModel = aTeacherGateWay.GetTeacherForEdit(teacherId);
            return(aTeacherModel);
        }
コード例 #3
0
        public List <TeacherModel> GetTeachersByDepartmentId(int deptId)
        {
            TeacherGateWay aTeacherGateWay = new TeacherGateWay();
            //          TeacherGateWay aTeacherGateWay = new TeacherGateWay();
            List <TeacherModel> teachers = new List <TeacherModel>();

            teachers = aTeacherGateWay.GetTeachersByDept(deptId);
            return(teachers);
        }
コード例 #4
0
        public int DeleteTeacher(int deleteId)
        {
            TeacherGateWay aTeacherGateWay = new TeacherGateWay();
            //          string message = "";
            int rowAffected = aTeacherGateWay.DeleteTeacher(deleteId);

            //return message;
            return(rowAffected);
        }
コード例 #5
0
        public int UpdateTeacher(TeacherModel aTeacherModel)
        {
            TeacherGateWay aTeacherGateWay = new TeacherGateWay();
            //{

            //if (aTeacherGateWay.IsTeacherEmailExist(aTeacherModel.teacherEmail))
            //{
            //    return 5;
            //}
            //else
            //{
            int rowAffected = aTeacherGateWay.UpdateTeacher(aTeacherModel);

            return(rowAffected);
            //    }

            //}
        }
コード例 #6
0
        public string SaveTeacher(TeacherModel aTeacherModel)
        {
            TeacherGateWay aTeacherGateWay = new TeacherGateWay();
            string         message         = "";

            if (aTeacherGateWay.IsTeacherEmailExist(aTeacherModel.TeacherEmail))
            {
                message = "Teacher Email Exists";
            }
            else
            {
                int rowAffected = aTeacherGateWay.SaveTeacher(aTeacherModel);// aDepartmentGateway.SaveDepartment(aDepartmetModel);
                if (rowAffected > 0)
                {
                    message = "Teacher Saved Successfully";
                }
                else
                {
                    message = "Sorry! Teacher Save Failed !!";
                }
            }
            return(message);
        }
コード例 #7
0
        public int GetCreditByTeacherId(int teacherId)
        {
            TeacherGateWay aTeacherGateWay = new TeacherGateWay();

            return(aTeacherGateWay.GetCreditByTeacherId(teacherId));
        }