public bool IsShowApplyMissionButton(Mission mission, UserMission userMission)
 {
     if (userMission != null) //已经申请过了
         return false;
     return MissionBO.Instance.CanApplyMission(User.Current, mission);
 }
 public UserMissionParams(UserMission userMission)
 {
     m_UserMission = userMission;
 }
        public int GetUserMissionFinishPercent(UserMission userMission)
        {
            if (userMission == null)
                return 0;

            return (int)(userMission.FinishPercent * 100);
        }
 public bool IsShowMissionProcedures(Mission mission, UserMission userMission)
 {
     if (!mission.MissionBase.HaveStepDescriptions)
         return false;
     if (userMission == null)
         return true;
     if (userMission.Status == MissionStatus.Underway)
         return true;
     return false;
 }
 public UserMissionListItemParams(UserMission userMission, MissionStatus currentStatus)
 {
     m_UserMission = userMission;
     m_CurrentStatus = currentStatus;
 }
 public bool IsShowAbandonMissionButton(string status, UserMission userMission)
 {
     MissionStatus missionStatus;
     try
     {
         missionStatus = (MissionStatus)Enum.Parse(typeof(MissionStatus), status, true);
     }
     catch
     {
         missionStatus = MissionStatus.Underway;
     }
     if (missionStatus == MissionStatus.Underway && userMission.FinishPercent < 1)
         return true;
     else
         return false;
 }
 public bool IsShowReApplyMissionButton(UserMission userMission)
 {
     if (userMission == null)
         return false;
     if (userMission.Status == MissionStatus.Abandon)
         return true;
     return false;
 }
 public bool IsShowAbandonMissionButton(UserMission userMission)
 {
     if (userMission == null)
         return true;
     if (userMission.Status == MissionStatus.Underway && userMission.FinishPercent != 1)
         return true;
     return false;
 }
        private bool IsShowGetMissionPrizeButton(MissionStatus missionStatus, UserMission userMission)
        {
            if (missionStatus == MissionStatus.Underway && userMission.FinishPercent == 1 && userMission.Mission.Prize.PrizeTypes.Count > 0)
                return true;

            return false;
        }
 public bool IsShowGetMissionPrizeButton(string status, UserMission userMission)
 {
     MissionStatus missionStatus;
     try
     {
         missionStatus = (MissionStatus)Enum.Parse(typeof(MissionStatus), status, true);
     }
     catch
     {
         missionStatus = MissionStatus.Underway;
     }
     return IsShowGetMissionPrizeButton(missionStatus, userMission);
 }
        public bool IsShowGetMissionPrizeButton(UserMission userMission)
        {
            if (userMission == null)
                return false;
            if (userMission.FinishPercent == 1 && userMission.IsPrized == false && userMission.Mission.Prize.PrizeTypes.Count > 0)
                return true;

            return false;
        }
 public bool IsShowApplyMissionAgainButton(Mission mission, UserMission userMission)
 {
     return MissionBO.Instance.CanApplyMissionAgain(User.Current, mission, userMission);
 }