Exemplo n.º 1
0
    public void initTime()
    {
        TimeInfoSample tsample = TimeConfigManager.Instance.getTimeInfoSampleBySid(timeID);

        activeTime = ActiveTime.getActiveTimeByType(tsample);
        activeTime.initTime(ServerTimeKit.getSecondTime());
    }
Exemplo n.º 2
0
    public void setStarMultiple(int timeId, int hit)
    {
        TimeInfoSample tsample = TimeConfigManager.Instance.getTimeInfoSampleBySid(timeId);

        if (starTime == null)
        {
            starTime = ActiveTime.getActiveTimeByType(tsample);
            //starTime.initTime (ServerTimeKit.getSecondTime ());
        }
        this.starHit = hit;
    }
Exemplo n.º 3
0
    public void initTime(int _timeId)
    {
        timeId    = _timeId;
        timeLimit = new TimeLimit(null);
        TimeInfoSample tsample = TimeConfigManager.Instance.getTimeInfoSampleBySid(timeId);

        days       = tsample.mainTimeInfoo;
        activeTime = ActiveTime.getActiveTimeByType(tsample);
        activeTime.initTime(ServerTimeKit.getSecondTime());
        times = new long[] {
            activeTime.getDetailStartTime(),
                activeTime.getDetailEndTime()
        };
        updateTime();
    }
Exemplo n.º 4
0
    public override bool isValid()
    {
        TimeInfoSample tsample = TimeConfigManager.Instance.getTimeInfoSampleBySid(getSample().timeID);

        if (activeTime == null)
        {
            activeTime = ActiveTime.getActiveTimeByType(tsample);
            activeTime.initTime(ServerTimeKit.getSecondTime());
        }
        if (activeTime.getIsFinish())
        {
            return(false);
        }
        return(ServerTimeKit.getSecondTime() >= activeTime.getPreShowTime());
    }
Exemplo n.º 5
0
    /// <summary>
    /// 获得时间描述
    /// </summary>
    public string getTimeDesc()
    {
        int        nowTime    = ServerTimeKit.getSecondTime();
        ExamSample examSample = QuizManagerment.Instance.getExamSampleBySid(this);

        if (examSample == null)
        {
            return(LanguageConfigManager.Instance.getLanguage("notice_quiz01"));            //活动已经结束
        }
        SidNoticeContent content = getSample().content as SidNoticeContent;
        TimeInfoSample   tsample = TimeConfigManager.Instance.getTimeInfoSampleBySid(getSample().timeID);

        if (activeTime == null)
        {
            activeTime = ActiveTime.getActiveTimeByType(tsample);
            activeTime.initTime(ServerTimeKit.getSecondTime());
        }
        else
        {
            activeTime.doRefresh();
        }
        //具体开始时间
        int detailStartTime = activeTime.getDetailStartTime();
        //具体结束时间
        int detailEndTime = activeTime.getDetailEndTime();

        if (detailStartTime < nowTime && detailEndTime > nowTime && examSample.getAwardType == 1)
        {
            return(LanguageConfigManager.Instance.getLanguage("notice09"));            //可以答题
        }
        else if (DateKit.isInSameDay(detailStartTime, nowTime) && detailStartTime > nowTime)
        {
            return(LanguageConfigManager.Instance.getLanguage("notice08", TimeKit.dateToFormat(detailStartTime, LanguageConfigManager.Instance.getLanguage("notice05"))));              //尚未开启
        }
        else if (activeTime.getIsFinish())
        {
            return(LanguageConfigManager.Instance.getLanguage("notice_quiz01"));            //活动已经结束
        }
        else if (detailEndTime < nowTime)
        {
            return(LanguageConfigManager.Instance.getLanguage("notice_quiz01"));            //活动已经结束
        }
        else
        {
            return(LanguageConfigManager.Instance.getLanguage("notice_quiz01"));            //活动已经结束
        }
    }
Exemplo n.º 6
0
    /// <summary>
    /// 能否答题
    /// </summary>
    public bool isCanAnswer()
    {
        int              nowTime    = ServerTimeKit.getSecondTime();
        ExamSample       examSample = QuizManagerment.Instance.getExamSampleBySid(this);
        SidNoticeContent content    = getSample().content as SidNoticeContent;
        TimeInfoSample   tsample    = TimeConfigManager.Instance.getTimeInfoSampleBySid(getSample().timeID);

        if (activeTime == null)
        {
            activeTime = ActiveTime.getActiveTimeByType(tsample);
            activeTime.initTime(ServerTimeKit.getSecondTime());
        }
        else
        {
            activeTime.doRefresh();
        }
        //具体开始时间
        int detailStartTime = activeTime.getDetailStartTime();
        //具体结束时间
        int detailEndTime = activeTime.getDetailEndTime();

        if (examSample == null)
        {
            if (detailStartTime < nowTime && detailEndTime > nowTime)
            {
                return(true);               //可以答题
            }
            else
            {
                return(false);
            }
        }
        else
        {
            if (detailStartTime < nowTime && detailEndTime > nowTime && examSample.getAwardType == 1)
            {
                return(true);               //可以答题
            }
            else
            {
                return(false);
            }
        }
    }
Exemplo n.º 7
0
    /// <summary>
    /// 得到结束时间
    /// </summary>
    public string getEndTime()
    {
        TimeInfoSample tsample = TimeConfigManager.Instance.getTimeInfoSampleBySid(getSample().timeID);

        if (activeTime == null)
        {
            activeTime = ActiveTime.getActiveTimeByType(tsample);
            //activeTime.initTime (ServerTimeKit.getSecondTime ());
        }
        else
        {
            activeTime.doRefresh();
        }
        //具体结束时间
        int endTime = activeTime.getEndTime();         //+ServerTimeKit.onlineTime;

        System.DateTime date = TimeKit.getDateTime(endTime);
        return(LanguageConfigManager.Instance.getLanguage("s0125", date.Month.ToString(), date.Day.ToString()));
    }
Exemplo n.º 8
0
    /// <summary>
    /// 获得答题活动开放时间
    /// </summary>
    public string getOpenTimeDesc()
    {
        SidNoticeContent content = getSample().content as SidNoticeContent;
        TimeInfoSample   tsample = TimeConfigManager.Instance.getTimeInfoSampleBySid(getSample().timeID);

        if (activeTime == null)
        {
            activeTime = ActiveTime.getActiveTimeByType(tsample);
            activeTime.initTime(ServerTimeKit.getSecondTime());
        }
        else
        {
            activeTime.doRefresh();
        }
        //具体开始时间
        int startTime = activeTime.getStartTime();
        //具体结束时间
        int      endTime  = activeTime.getEndTime();
        DateTime dt       = TimeKit.getDateTime(endTime);
        int      currTime = dt.Hour * 3600 + dt.Minute * 60 + dt.Second;

        if (currTime == 0)
        {
            endTime -= 1;
        }

        if (DateKit.isInSameDay(startTime, endTime))
        {
            return(LanguageConfigManager.Instance.getLanguage("notice11", TimeKit.dateToFormat(startTime, LanguageConfigManager.Instance.getLanguage("notice04"))));
        }
        else
        {
            return(LanguageConfigManager.Instance.getLanguage("notice02", TimeKit.dateToFormat(startTime, LanguageConfigManager.Instance.getLanguage("notice04")),
                                                              TimeKit.dateToFormat(endTime, LanguageConfigManager.Instance.getLanguage("notice04"))));
        }
    }