Esempio n. 1
0
 public void NewMissionUserList(int missionID, int count
                                , MissionUserListItemHeadFootTemplate head
                                , MissionUserListItemHeadFootTemplate foot
                                , UserMissionTemplate item)
 {
     MissionUserList(missionID, 1, count, head, foot, item, null);
 }
Esempio n. 2
0
 public void MissionUserList(int missionID, int page, int pageSize
                             , MissionUserListItemHeadFootTemplate head
                             , MissionUserListItemHeadFootTemplate foot
                             , MissionUserListItemTemplate item)
 {
     MissionUserList(missionID, page, pageSize, head, foot, null, item);
 }
Esempio n. 3
0
        /// <summary>
        /// 任务的参与用户
        /// </summary>
        /// <param name="missionID"></param>
        /// <param name="page"></param>
        /// <param name="pageSize"></param>
        /// <param name="template"></param>
        private void MissionUserList(int missionID, int page, int pageSize
                                     , MissionUserListItemHeadFootTemplate head
                                     , MissionUserListItemHeadFootTemplate foot
                                     , UserMissionTemplate template
                                     , MissionUserListItemTemplate userTemplate)
        {
            if (page == 0)
            {
                page = 1;
            }

            int totalCount;
            UserMissionCollection userMissions = MissionBO.Instance.GetMissionUsers(missionID, page, pageSize, out totalCount);

            List <int> userIDs = new List <int>();

            foreach (UserMission userMission in userMissions)
            {
                userIDs.Add(userMission.UserID);
            }
            UserCollection users = UserBO.Instance.GetUsers(userIDs);

            head(totalCount > 0, totalCount);
            int i = 0;

            if (template != null)
            {
                foreach (UserMission userMission in userMissions)
                {
                    template(i++, userMission);
                }
            }
            if (userTemplate == null)
            {
                foot(totalCount > 0, totalCount);
                return;
            }


            if (userIDs.Count == 0)
            {
                foot(totalCount > 0, totalCount);
                return;
            }

            i = 0;
            int index  = (page - 1) * pageSize;
            int userID = UserBO.Instance.GetCurrentUserID();

            foreach (User user in users)
            {
                index++;
                userTemplate(i, index, user, i % 2 == 0, user.UserID == userID);
                i++;
            }
            foot(totalCount > 0, totalCount);
        }
Esempio n. 4
0
 public void NewMissionUserList(int missionID, int count
     , MissionUserListItemHeadFootTemplate head
     , MissionUserListItemHeadFootTemplate foot
     , UserMissionTemplate item)
 {
     MissionUserList(missionID, 1, count, head, foot, item, null);
 }
Esempio n. 5
0
        /// <summary>
        /// 任务的参与用户
        /// </summary>
        /// <param name="missionID"></param>
        /// <param name="page"></param>
        /// <param name="pageSize"></param>
        /// <param name="template"></param>
        private void MissionUserList(int missionID, int page, int pageSize
            , MissionUserListItemHeadFootTemplate head
            , MissionUserListItemHeadFootTemplate foot
            , UserMissionTemplate template
            , MissionUserListItemTemplate userTemplate)
        {

            if (page == 0)
                page = 1;

            int totalCount;
            UserMissionCollection userMissions = MissionBO.Instance.GetMissionUsers(missionID, page, pageSize, out totalCount);

            List<int> userIDs = new List<int>();
            foreach (UserMission userMission in userMissions)
            {
                userIDs.Add(userMission.UserID);
            }
            UserCollection users = UserBO.Instance.GetUsers(userIDs);

            head(totalCount > 0, totalCount);
            int i = 0;
            if (template != null)
            {
                foreach (UserMission userMission in userMissions)
                {
                    template(i++, userMission);
                }
            }
            if (userTemplate == null)
            {
                foot(totalCount > 0, totalCount);
                return;
            }


            if (userIDs.Count == 0)
            {
                foot(totalCount > 0, totalCount);
                return;
            }

            i = 0;
            int index = (page - 1) * pageSize;
            int userID = UserBO.Instance.GetCurrentUserID();
            foreach (User user in users)
            {
                index++;
                userTemplate(i, index, user, i % 2 == 0, user.UserID == userID);
                i++;
            }
            foot(totalCount > 0, totalCount);

        }
Esempio n. 6
0
 public void MissionUserList(int missionID, int page, int pageSize
     , MissionUserListItemHeadFootTemplate head
     , MissionUserListItemHeadFootTemplate foot
     , MissionUserListItemTemplate item)
 {
     MissionUserList(missionID, page, pageSize, head, foot, null, item);
 }