Пример #1
0
 public bool CreateTeacher(ref Teacher teacher, ref string message)
 {
     Boolean ret = false; ;
     TeacherBDO tbdo = new TeacherBDO();
     TranslateTeacherDTOToTeacherBDO(teacher, tbdo);
     ret= tLogic.CreateTeacher(ref tbdo, ref message);
     return ret;
 }
Пример #2
0
        public Teacher GetTeacher(string teacherId, ref string message)
        {
            Teacher teacher = new Teacher();
            TeacherBDO tbdo = tLogic.GetTeacher(teacherId);
            if (tbdo != null) {
                TranslateTeacherBDOToTeacherDTO(tbdo, teacher);
            }
            else message = "Teacher Does Not Exists";

            return teacher;
        }
Пример #3
0
 public List<Teacher> ToTeacherList(List<TeacherBDO> tc)
 {
     List<Teacher> tList = new List<Teacher>();
     foreach (TeacherBDO t in tc)
     {
         Teacher to = new Teacher();
         TranslateTeacherBDOToTeacherDTO(t,to);
         tList.Add(to);
     }
     return tList;
 }
Пример #4
0
        public Teacher GetTeacher(string lname, string fname, string mname)
        {
            string message = String.Empty;
            Teacher teacher = new Teacher();
            TeacherBDO tbdo = tLogic.GetTeacher(lname, fname,mname);
            if (tbdo != null)
            {
                TranslateTeacherBDOToTeacherDTO(tbdo, teacher);
            }
            else message = "Teacher Does Not Exists";

            return teacher;
        }
Пример #5
0
 public void TranslateTeacherDTOToTeacherBDO(Teacher teacher, TeacherBDO tb)
 {
     tb.BloodType = teacher.BloodType;
     tb.CivilStatus = teacher.CivilStatus;
     tb.DateOfAppointment = teacher.DateOfAppointment;
     tb.Deactivated = teacher.Deactivated;
     tb.DialectSpoken = teacher.DialectSpoken;
     tb.DOB = teacher.DOB;
     tb.EmailAddress = teacher.EmailAddress;
     tb.EmploymentStatus = teacher.EmploymentStatus;
     tb.FirstName = teacher.FirstName;
     tb.Gender = teacher.Gender;
     tb.HeightCm = teacher.HeightCm;
     tb.LastName = teacher.LastName;
     tb.MiddleName = teacher.MiddleName;
     tb.MobileNo = teacher.MobileNo;
     tb.PagIBIGNo = teacher.PagIBIGNo;
     tb.PAMunicipality = teacher.PAMunicipality;
     tb.PAProvince = teacher.PAProvince;
     tb.PARegion = teacher.PARegion;
     tb.PAStreetName = teacher.PAStreetName;
     tb.PhilHealthNo = teacher.PhilHealthNo;
     tb.POBMunicipality = teacher.POBMunicipality;
     tb.POBProvince = teacher.POBProvince;
     tb.PreviousSchool = teacher.PreviousSchool;
     tb.RAMunicipality = teacher.RAMunicipality;
     tb.RAProvince = teacher.RAProvince;
     tb.RARegion = teacher.RARegion;
     tb.RAStreetName = teacher.RAStreetName;
     tb.ResTelephoneNo = teacher.ResTelephoneNo;
     tb.SpouseBusinessAdd = teacher.SpouseBusinessAdd;
     tb.SpouseEmployerName = teacher.SpouseEmployerName;
     tb.SpouseFirstName = teacher.SpouseFirstName;
     tb.SpouseLastName = teacher.SpouseLastName;
     tb.SpouseMiddleName = teacher.SpouseMiddleName;
     tb.SpouseOccupation = teacher.SpouseOccupation;
     tb.SpouseTelephoneNo = teacher.SpouseTelephoneNo;
     tb.SSSNum = teacher.SSSNum;
     tb.TeacherId = teacher.TeacherId;
     tb.TIN = teacher.TIN;
     tb.WeightKg = teacher.WeightKg;
     tb.Image = teacher.Image;
     tb.PERAA = teacher.PERAA;
     tb.TeacherChildrens = ToChildrenBDO(teacher.TeacherChildrens);
     tb.TeacherEligibilities = ToEligibilityBDO(teacher.TeacherEligibilities);
     tb.TeacherEducationalBackgrounds = ToEducBacBDO(teacher.TeacherEducationalBackgrounds);
     tb.TrainingSeminars = ToTrainSemBDO(teacher.TrainingSeminars);
     tb.WorkExperiences = ToWorkExpBDO(teacher.WorkExperiences);
 }
Пример #6
0
 public bool UpdateTeacher(ref Teacher teacher, ref string message)
 {
     TeacherBDO tbdo = new TeacherBDO();
     TranslateTeacherDTOToTeacherBDO(teacher, tbdo);
     return tLogic.UpdateTeacher(ref tbdo, ref message);
 }
Пример #7
0
 public void TranslateGradeSectionBDOToGradeSection(GradeSectionBDO gs, GradeSection gsb)
 {
     RoomService rService = new RoomService();
     Room room = new Room();
     TeacherService tService = new TeacherService();
     Teacher teacher = new Teacher();
     string message = string.Empty;
        room= rService.GetRoom(gs.HomeRoomNumber);
        teacher=  tService.GetTeacher(gs.HomeRoomTeacherId, ref message);
     gsb.Deactivated = gs.Deactivated;
     gsb.GradeLevel = gs.GradeLevel;
     gsb.GradeSectionCode = gs.GradeSectionCode;
     gsb.HomeRoom = room;
     gsb.HomeRoomNumber = gs.HomeRoomNumber;
     gsb.HomeRoomTeacherId = gs.HomeRoomTeacherId;
     gsb.HomeRoomTeacher = teacher;
     if(teacher.MiddleName==String.Empty)
        gsb.TeacherName = teacher.LastName + ", " + teacher.FirstName ;
     else
     gsb.TeacherName = teacher.LastName + ", " + teacher.FirstName + " " + teacher.MiddleName.Substring(0, 1);
     gsb.Class = gs.Class;
     gsb.SY = gs.SY;
     gsb.Section = gs.Section;
 }
Пример #8
0
        public void TranslateScheduleBDOToSchedule(SubjectAssignmentBDO sabdo, SubjectAssignment sched)
        {
            GradeSectionService gs = new GradeSectionService();
            GradeSection g = new GradeSection();
            gs.TranslateGradeSectionBDOToGradeSection(sabdo.GradeSection, g);
            sched.GradeSection = g;
            sched.Section = g.Section;
            sched.GradeLevel = g.GradeLevel;
            sched.Class = (int)g.Class;

            RoomService rs = new RoomService();
            Room r = new Room();
            rs.TranslateRoomBDOtoRoomDTO(sabdo.Room, r);
            sched.Room = r;
            sched.RoomCode = r.RoomCode;

            SubjectService ss = new SubjectService();
            Subject s = new Subject();
            ss.TranslateSubjectBDOToSubject(sabdo.Subject, s);
            sched.Subject = s;

            TeacherService ts = new TeacherService();
            Teacher t = new Teacher();
            ts.TranslateTeacherBDOToTeacherDTO(sabdo.Teacher, t);
            sched.Teacher = t;
            if (t.MiddleName == String.Empty)
                sched.TeacherName = t.LastName + ", " + t.FirstName;
            else
                sched.TeacherName = t.LastName + ", " + t.FirstName + " " + t.MiddleName.Substring(0, 1) + ".";

            TimeslotService times = new TimeslotService();
            Timeslot time = new Timeslot();
            times.TranslateTimeslotBDOToTimeslotDTo(sabdo.Timeslot, time);
            sched.Timeslot = time;
            sched.Timestart = time.TimeStart;
            sched.TimeEnd = time.TimeEnd;
            sched.Days = time.Days;

            sched.Deactivated = sabdo.Deactivated;
            sched.GradeSectionCode = sabdo.GradeSectionCode;
            sched.RoomId = sabdo.RoomId;
            sched.SubjectAssignmentsID = sabdo.SubjectAssignmentsID;
            sched.SubjectCode = sabdo.SubjectCode;

            sched.SY = sabdo.SY;
            sched.TeacherId = sabdo.TeacherId;
            sched.TimeSlotCode = sabdo.TimeSlotCode;

            sched.TimeslotInfo = time.Days + " " + time.TimeStart + "-" + time.TimeEnd;
            sched.SubjectInfo = sabdo.SubjectCode + " " + sched.Section + " " + sched.TimeslotInfo;

            sched.SubjectDescription = s.Description;
        }