Exemplo n.º 1
0
 public void NewMissionUserList(int missionID, int count
                                , MissionUserListItemHeadFootTemplate head
                                , MissionUserListItemHeadFootTemplate foot
                                , UserMissionTemplate item)
 {
     MissionUserList(missionID, 1, count, head, foot, item, null);
 }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
 public void NewMissionUserList(int missionID, int count
     , MissionUserListItemHeadFootTemplate head
     , MissionUserListItemHeadFootTemplate foot
     , UserMissionTemplate item)
 {
     MissionUserList(missionID, 1, count, head, foot, item, null);
 }
Exemplo n.º 4
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);

        }