public List <TeacherModel> GetAllTeachers() { TeacherGateWay aTeacherGateWay = new TeacherGateWay(); List <TeacherModel> teachers = aTeacherGateWay.GetAllTeachers(); return(teachers); }
public TeacherModel GetTeacherByTeacherId(int teacherId) { TeacherGateWay aTeacherGateWay = new TeacherGateWay(); TeacherModel aTeacherModel = new TeacherModel(); aTeacherModel = aTeacherGateWay.GetTeacherForEdit(teacherId); return(aTeacherModel); }
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); }
public int DeleteTeacher(int deleteId) { TeacherGateWay aTeacherGateWay = new TeacherGateWay(); // string message = ""; int rowAffected = aTeacherGateWay.DeleteTeacher(deleteId); //return message; return(rowAffected); }
public int UpdateTeacher(TeacherModel aTeacherModel) { TeacherGateWay aTeacherGateWay = new TeacherGateWay(); //{ //if (aTeacherGateWay.IsTeacherEmailExist(aTeacherModel.teacherEmail)) //{ // return 5; //} //else //{ int rowAffected = aTeacherGateWay.UpdateTeacher(aTeacherModel); return(rowAffected); // } //} }
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); }
public int GetCreditByTeacherId(int teacherId) { TeacherGateWay aTeacherGateWay = new TeacherGateWay(); return(aTeacherGateWay.GetCreditByTeacherId(teacherId)); }