Exemplo n.º 1
0
        public override void ProviderLoaded(object sender, ProviderLoadedEventArgs e)
        {
            base.ProviderLoaded(sender, e);

            List<Absence> absenceList = null;

            if (e.IsSuccess)
            {
                switch (e.RequestCode)
                {
                    case RC_GET_ALL:
                    case RC_GET_ALL_CHANGEABLE:
                        absenceList = Parser.SerializeList<Absence>();
                        break;
                    default:
                        break;
                }
            }

            if (AbsenceEvent != null)
            {
                AbsenceEventArgs eventArgs = new AbsenceEventArgs(absenceList);
                eventArgs.LoadEventArgs(e);

                AbsenceEvent(this, eventArgs);
            }
        }
Exemplo n.º 2
0
        public override void ProviderLoaded(object sender, ProviderLoadedEventArgs e)
        {
            base.ProviderLoaded(sender, e);

            List<Profile> profileList = null;
            string randomPwd = null;

            switch (e.RequestCode)
            {
                case RC_GET_ALL:
                    if (e.IsSuccess)
                    {
                        profileList = Parser.Serialize<List<Profile>>();
                    }
                    break;
                case RC_RESET_PASSWORD:
                    if (e.IsSuccess)
                    {
                        randomPwd = Parser.Serialize<string>();
                    }
                    break;
                default:
                    break;
            }

            if (ProfileEvent != null)
            {
                UserManageEventArgs userManageEventArgs = new UserManageEventArgs(profileList);
                userManageEventArgs.RandomPassword = randomPwd;
                userManageEventArgs.LoadEventArgs(e);

                ProfileEvent(this, userManageEventArgs);
            }
        }
Exemplo n.º 3
0
        public override void ProviderLoaded(object sender, ProviderLoadedEventArgs e)
        {
            base.ProviderLoaded(sender, e);

            List<Major> majorList = null;

            switch (e.RequestCode)
            {
                case RC_GET_ALL:
                    if (e.IsSuccess)
                    {
                        majorList = Parser.Serialize<List<Major>>();
                    }
                    break;
                default:
                    break;
            }

            if (MajorEvent != null)
            {
                MajorEventArgs majorEventArgs = new MajorEventArgs(majorList);
                majorEventArgs.LoadEventArgs(e);

                MajorEvent(this, majorEventArgs);
            }
        }
        public override void ProviderLoaded(object sender, ProviderLoadedEventArgs e)
        {
            base.ProviderLoaded(sender, e);

            List<DispatchInfo> dispatchStudentList = null;

            if (e.IsSuccess)
            {
                switch (e.RequestCode)
                {
                    case RC_GET_ALL:
                        dispatchStudentList = Parser.Serialize<List<DispatchInfo>>();
                        break;
                    default:
                        break;
                }
            }

            if (DispatchStudentEvent != null)
            {
                DispatchStudentEventArgs eventArgs = new DispatchStudentEventArgs(dispatchStudentList);
                eventArgs.LoadEventArgs(e);

                DispatchStudentEvent(this, eventArgs);
            }
        }
Exemplo n.º 5
0
        public override void ProviderLoaded(object sender, ProviderLoadedEventArgs e)
        {
            base.ProviderLoaded(sender, e);

            Profile userProfile = null;

            switch (e.RequestCode)
            {
                case RC_GET_PROFILE:
                    if (e.IsSuccess)
                    {
                        userProfile = Parser.Serialize<Profile>();
                    }
                    break;
                default:
                    break;
            }

            if (ProfileEvent != null)
            {
                ProfileEventArgs profileEventArgs = new ProfileEventArgs(userProfile);
                profileEventArgs.LoadEventArgs(e);

                ProfileEvent(this, profileEventArgs);
            }
        }
Exemplo n.º 6
0
        public override void ProviderLoaded(object sender, ProviderLoadedEventArgs e)
        {
            base.ProviderLoaded(sender, e);

            List<DispatchManage> dispatcManageList = null;

            switch (e.RequestCode)
            {
                case RC_GET_ALL:
                    if (e.IsSuccess)
                    {
                        dispatcManageList = Parser.Serialize<List<DispatchManage>>();
                    }
                    break;
                default:
                    break;
            }

            if (DispatchManageEvent != null)
            {
                DispatchManageEventArgs dispatchEventArgs = new DispatchManageEventArgs(dispatcManageList);
                dispatchEventArgs.LoadEventArgs(e);

                DispatchManageEvent(this, dispatchEventArgs);
            }
        }
Exemplo n.º 7
0
        public override void ProviderLoaded(object sender, ProviderLoadedEventArgs e)
        {
            base.ProviderLoaded(sender, e);

            List<Classroom> classroomList = null;

            switch (e.RequestCode)
            {
                case RC_GET_ALL:
                    if (e.IsSuccess)
                    {
                        classroomList = Parser.Serialize<List<Classroom>>();
                    }
                    break;
                default:
                    break;
            }

            if (ClassroomEvent != null)
            {
                ClassroomEventArgs classroomEventArgs = new ClassroomEventArgs(classroomList);
                classroomEventArgs.LoadEventArgs(e);

                ClassroomEvent(this, classroomEventArgs);
            }
        }
Exemplo n.º 8
0
        public override void ProviderLoaded(object sender, ProviderLoadedEventArgs e)
        {
            base.ProviderLoaded(sender, e);

            string sessionId = null;
            switch (e.RequestCode)
            {
                case RC_LOGIN:
                    if (e.IsSuccess)
                    {
                        sessionId = Parser.GetSessionId();
                    }
                    break;
                default:
                    break;
            }

            if (LoginEvent != null)
            {
                LoginEventArgs eventArgs = new LoginEventArgs(sessionId);
                eventArgs.LoadEventArgs(e);

                LoginEvent(this, eventArgs);
            }
        }
        public override void ProviderLoaded(object sender, ProviderLoadedEventArgs e)
        {
            base.ProviderLoaded(sender, e);

            List<CourseAttendance> courseAttendanceList = null;

            if (e.IsSuccess)
            {
                switch (e.RequestCode)
                {
                    case RC_GET_ALL:
                        courseAttendanceList = Parser.SerializeList<CourseAttendance>();
                        break;
                    default:
                        break;
                }
            }

            if (CourseAbsenceEvent != null)
            {
                CourseAttendanceEventArgs eventArgs = new CourseAttendanceEventArgs(courseAttendanceList);
                eventArgs.LoadEventArgs(e);

                CourseAbsenceEvent(this, eventArgs);
            }
        }
Exemplo n.º 10
0
        public virtual void ProviderLoaded(object sender, ProviderLoadedEventArgs e)
        {
            Parser.Payload = e.Payload;

            e.IsSuccess = Parser.IsSuccess;
            // Try to extract the error messages
            e.ErrorMessage = Parser.GetErrorMessage();

            e.ErrorCode = Parser.ErrorCode;
        }
Exemplo n.º 11
0
        public override void ProviderLoaded(object sender, ProviderLoadedEventArgs e)
        {
            base.ProviderLoaded(sender, e);

            List<DispatchCourse> dispatchList = null;
            Dictionary<string, List<DispatchCourse>> availableCourseList = null;

            if (e.IsSuccess)
            {
                switch (e.RequestCode)
                {
                    case RC_GET_USER_COUSR:
                        dispatchList = Parser.SerializeList<DispatchCourse>();
                        break;
                    case RC_GET_AVAILABLE_COURSE:
                        availableCourseList = Parser.SerializeDict<string, List<DispatchCourse>>();
                        break;
                    default:
                        break;
                }
            }

            if (DispatchCouseEvent != null)
            {
                DispatchCourseEventArgs eventArgs = new DispatchCourseEventArgs(dispatchList);
                eventArgs.LoadEventArgs(e);

                DispatchCouseEvent(this, eventArgs);
            }

            if (AvailableCourseEvent != null)
            {
                AvailableCourseEventArgs eventArgs = new AvailableCourseEventArgs(availableCourseList);
                eventArgs.LoadEventArgs(e);

                AvailableCourseEvent(this, eventArgs);
            }
        }
Exemplo n.º 12
0
 private void Handle(ProviderLoadedEventArgs eventArgs)
 {
     if (ProviderLoadedEvent != null)
         ProviderLoadedEvent(Instance, eventArgs);
 }