public List <CourseAssignToTeacherModel> GetAllCourseAssignedTeachers()
        {
            //TeacherManager aTeacherManager = new TeacherManager();
            //DepartmentManager aDepartmentManager = new DepartmentManager();
            //CourseManager aCourseManager = new CourseManager();
            CourseAssignGateway aCourseAssignGateway = new CourseAssignGateway();

            return(aCourseAssignGateway.GetAllCourseAssignedTeachers());
        }
        public CourseAssignToTeacherModel GetAssignedCourseToTeacherModelById(int assignedCourseId)
        {
            //TeacherManager aTeacherManager = new TeacherManager();
            //DepartmentManager aDepartmentManager = new DepartmentManager();
            //CourseManager aCourseManager = new CourseManager();
            CourseAssignGateway        aCourseAssignGateway        = new CourseAssignGateway();
            CourseAssignToTeacherModel aCourseAssignToTeacherModel = aCourseAssignGateway.GetSingleCourseAssignToTeacherModel(assignedCourseId);

            return(aCourseAssignToTeacherModel);
        }
        public bool IsCourseExist(int courseID)
        {
            //TeacherManager aTeacherManager = new TeacherManager();
            //DepartmentManager aDepartmentManager = new DepartmentManager();
            //CourseManager aCourseManager = new CourseManager();
            CourseAssignGateway aCourseAssignGateway = new CourseAssignGateway();
            bool isCourseExists = aCourseAssignGateway.IsCourseExist(courseID);

            return(isCourseExists);
        }
        public int SaveCourseAssignToTeacher(CourseAssignToTeacherModel courseAssignToTeacherModel)
        {
            //TeacherManager aTeacherManager = new TeacherManager();
            //DepartmentManager aDepartmentManager = new DepartmentManager();
            //CourseManager aCourseManager = new CourseManager();
            CourseAssignGateway aCourseAssignGateway = new CourseAssignGateway();

            int input = aCourseAssignGateway.SaveCourseAssignToTeacher(courseAssignToTeacherModel);

            return(input);
        }
 public int UpdateAssignedCourseToTeacherModel(CourseAssignToTeacherModel aCourseAssignToTeacherModel)
 {
     {
         //TeacherManager aTeacherManager = new TeacherManager();
         //DepartmentManager aDepartmentManager = new DepartmentManager();
         //CourseManager aCourseManager = new CourseManager();
         CourseAssignGateway aCourseAssignGateway = new CourseAssignGateway();
         int rowAffected = aCourseAssignGateway.UpdateCourseAssign(aCourseAssignToTeacherModel);
         return(rowAffected);
     }
 }
        /// <summary>
        /// takes id and fetch list of assign credit list
        /// then uses GetTotalAssignedCreditFromAssignedTeachers method to get total
        /// </summary>
        /// <param name="teacherId"></param>
        /// <returns>total assigned credit</returns>
        public int GetAssignedCreditByTeacherId(int teacherId)
        {
            //TeacherManager aTeacherManager = new TeacherManager();
            //DepartmentManager aDepartmentManager = new DepartmentManager();
            //CourseManager aCourseManager = new CourseManager();
            CourseAssignGateway aCourseAssignGateway         = new CourseAssignGateway();
            List <int>          courseIdFromAssignedTeachers = new List <int>();

            courseIdFromAssignedTeachers = aCourseAssignGateway.GetAssignedCreditByTeacherId(teacherId);
            int totalAssignedCredit = GetTotalAssignedCreditFromAssignedTeachers(courseIdFromAssignedTeachers);

            return(totalAssignedCredit);
        }
        public int DeleteAssignedCourseByCourseAssignId(int AssignedCourseId)
        {
            //          string message = "";
            //TeacherManager aTeacherManager = new TeacherManager();
            //DepartmentManager aDepartmentManager = new DepartmentManager();
            //CourseManager aCourseManager = new CourseManager();
            CourseAssignGateway aCourseAssignGateway = new CourseAssignGateway();

            int rowAffected = aCourseAssignGateway.DeleteAssignedCourseByAssignedCourseId(AssignedCourseId);


            //return message;
            return(rowAffected);
        }