Esempio n. 1
0
    /** 是否有效 */
    public override bool isValid()
    {
        NoticeSample             noticeSample  = getSample();
        EquipRemakeNoticeContent noticeContent = noticeSample.content as EquipRemakeNoticeContent;

        if (noticeContent != null)
        {
            User user = UserManager.Instance.self;
            if (user.getVipLevel() < noticeContent.getShowVipLevel() || user.getUserLevel() < noticeContent.getShowUserLevel())
            {
                return(false);
            }
        }
        activeTime = ActiveTime.getActiveTimeByID(getSample().timeID);
        if (activeTime.getIsFinish())
        {
            return(false);
        }
        object obj = NoticeActiveManagerment.Instance.getActiveInfoBySid(sid);

        if (obj is DoubleRMBInfo)
        {
            DoubleRMBInfo doubleRMBInfo = obj as DoubleRMBInfo;
            if (doubleRMBInfo != null && doubleRMBInfo.state)
            {
                return(false);
            }
        }
        return(ServerTimeKit.getSecondTime() >= activeTime.getPreShowTime());
    }
Esempio n. 2
0
    private void showAward()
    {
        int          index        = 0;
        int          inter        = 0;
        NoticeSample noticeSample = null;

        showPrizes.Clear();
        //List<PrizeSample> showPrizes = new List<PrizeSample> ();
        while (index < NoticeManagerment.Instance.noticeLimit.Count)
        {
            noticeSample = NoticeSampleManager.Instance.getNoticeSampleBySid(NoticeManagerment.Instance.noticeLimit[index].sid);
            if (noticeSample != null && noticeSample.name.Contains(LanguageConfigManager.Instance.getLanguage("AlchemyContent_continueButton")))
            {
                lianjinSid = noticeSample.sid;
                inter      = NoticeManagerment.Instance.noticeLimit[index].integral;
                RankAward rankAward = LucklyActivityAwardConfigManager.Instance.updateAwardDateByIntegral(lianjinSid, inter);
                if (rankAward != null)
                {
                    ListKit.AddRange(showPrizes, AllAwardViewManagerment.Instance.exchangeArrayToList(rankAward.prizes));
                }
                NoticeManagerment.Instance.noticeLimit.RemoveAt(index);
                index--;
            }
            index++;
        }
        if (lianjinSid != 0)
        {
            (FPortManager.Instance.getFPort("LuckyXianshiFPort") as LuckyXianshiFPort).access(lianjinSid, setIntegralRank, 4);
        }
    }
Esempio n. 3
0
 public void initContent(NoticeWindow win, Notice notice)
 {
     mFatherWindow = win;
     this.notice   = notice as DoubleRMBNotice;
     activeTime    = ActiveTime.getActiveTimeByID(notice.sid);
     NoticeSample sample = notice.getSample();
 }
Esempio n. 4
0
    public void initData(NoticeWindow faWin, Notice notice)
    {
        this.faWin   = faWin;
        this.notice  = notice as QuizNotice;
        noticeSample = notice.getSample();
        buttonAnswer.fatherWindow   = faWin;
        buttonGetAward.fatherWindow = faWin;
        for (int i = 0; i < buttonAnswerKey.Length; i++)
        {
            buttonAnswerKey [i].fatherWindow = faWin;
        }

        //获取题库
        instance.getQuestions(() => {
            this.examSample = QuizManagerment.Instance.getExamSampleBySid(notice);
            if (examSample != null && examSample.getAwardType == 1 && examSample.getQuestionSid() == -1)
            {
                initAwardUI();
            }
            else
            {
                initNormalUI();
            }
        });
    }
    public void initContent()
    {
        List <FestivalWish> list = new List <FestivalWish>();

        noObj.SetActive(false);
        this.sample = NoticeSampleManager.Instance.getNoticeSampleBySid(this.notice.getSample().sid);
        allSids     = (sample.content as SidNoticeContent).sids;
        sids        = "";
        if (allSids.Length > 0)
        {
            for (int i = 0; i < allSids.Length; i++)
            {
                sids += allSids[i] + ",";
            }
        }
        FestivalWishManagerment.Instance.getAllFestivalWishInfo(() => {
            list = FestivalWishManagerment.Instance.getAllFestivalWish();
            if (list == null || list.Count == 0)
            {
                noObj.SetActive(true);
            }
            else
            {
                noObj.SetActive(false);
            }
            content.Initialize(list, updateUI, this.win);
            content.reLoad(list.Count);
        }, sids);
    }
Esempio n. 6
0
    public void updateItem(NoticeActiveGoods goods, NoticeSample sample)
    {
        NoticeActiveServerInfo serverInfo = fatherContent.serverInfo;

        activeGoods = goods;
        //2014.7.17 modified
        //conditionDes.text = Language ("ConsumeRebate_01", activeGoods.getSample().rmbCondition,
        //                             Mathf.Min (serverInfo.consumeValue, activeGoods.getSample().rmbCondition), activeGoods.getSample().rmbCondition);
        conditionDes.text = Language("ConsumeRebate_01", activeGoods.getSample().rmbCondition,
                                     activeGoods.getRoleCountCanBuy(), activeGoods.getSample().maxBuyCount);
        costNumLabel.text    = "X " + activeGoods.getCostPrice();
        totalCountLabel.text = Language("ConsumeRebate_04", activeGoods.getServerCountCanBuy());
        //maxBuyLabel.text = Language ("ConsumeRebate_03", activeGoods.getRoleCountCanBuy (), activeGoods.getSample().maxBuyCount);
        maxBuyLabel.text = Language("ConsumeRebate_03", activeGoods.getSample().rmbCondition - serverInfo.consumeValue > 0 ? activeGoods.getSample().rmbCondition - serverInfo.consumeValue : 0);
        if (goodsShowPos.transform.childCount > 0)
        {
            goodsShowPos.transform.GetChild(0).GetComponent <GoodsView> ().init(activeGoods.getGoodsType(), activeGoods.getGoodsSid(), activeGoods.getGoodsShowNum());
        }
        else
        {
            GoodsView goodsView = (NGUITools.AddChild(goodsShowPos, goodsViewPref) as GameObject).GetComponent <GoodsView> ();
            goodsView.init(activeGoods.getGoodsType(), activeGoods.getGoodsSid(), activeGoods.getGoodsShowNum());
            goodsView.fatherWindow = fatherContent.win;
        }
        if (activeGoods.getRoleCountCanBuy() < 1 || activeGoods.getServerCountCanBuy() < 1)
        {
            buyButton.disableButton(true);
        }
        else
        {
            buyButton.disableButton(false);
            buyButton.fatherWindow = fatherContent.win;
            buyButton.onClickEvent = clickBuyButton;
        }
    }
Esempio n. 7
0
    private void showAward()
    {
        int          index        = 0;
        int          inter        = 0;
        NoticeSample noticeSample = null;

        showPrizes.Clear();
        while (index < NoticeManagerment.Instance.noticeLimit.Count)
        {
            noticeSample = NoticeSampleManager.Instance.getNoticeSampleBySid(NoticeManagerment.Instance.noticeLimit[index].sid);
            if (noticeSample != null && noticeSample.name.Contains(LanguageConfigManager.Instance.getLanguage("StarSoulWindow_tap_hunt")))
            {
                hountSid = noticeSample.sid;
                inter    = NoticeManagerment.Instance.noticeLimit[index].integral;
                RankAward rankAward = LucklyActivityAwardConfigManager.Instance.updateAwardDateByIntegral(hountSid, inter);
                if (rankAward != null)
                {
                    ListKit.AddRange(showPrizes, AllAwardViewManagerment.Instance.exchangeArrayToList(rankAward.prizes));
                }
                NoticeManagerment.Instance.noticeLimit.RemoveAt(index);
                index--;
            }
            index++;
        }
        if (hountSid != 0)
        {
            (FPortManager.Instance.getFPort("LuckyXianshiFPort") as LuckyXianshiFPort).access(hountSid, setIntegralRank, 3);
        }

        //if(showPrizes.Count > 0){
        //    UiManager.Instance.openDialogWindow<AllAwardViewWindow>((win)=>{
        //        win.Initialize(showPrizes,LanguageConfigManager.Instance.getLanguage("notice_xianshi_01",integral.ToString()));
        //    });
        //}
    }
Esempio n. 8
0
 public void initContent(Notice notice, WindowBase win, MonoBase activityBase)
 {
     this.win          = win;
     this.notice       = notice;
     this.activityBase = activityBase;
     sample            = NoticeSampleManager.Instance.getNoticeSampleBySid(notice.sid);
     if (sample.type == NoticeType.EXCHANGENOTICE)
     {
         exchangeList = ExchangeManagerment.Instance.getCanUseExchanges((sample.content as SidNoticeContent).sids, sample.type, false);
         clearExchangeOver();
     }
     else if (sample.type == NoticeType.TOPUPNOTICE || sample.type == NoticeType.COSTNOTICE || sample.type == NoticeType.TIME_RECHARGE)
     {
         rechargeList = RechargeManagerment.Instance.getCanUseRecharges((sample.content as SidNoticeContent).sids);
         clearRechargeOver();
     }
     else if (sample.type == NoticeType.CONSUME_REBATE)
     {
         consumeRebateList = NoticeActiveManagerment.Instance.getGoodsList((sample.content as NewExchangeNoticeContent).actives);
     }
     else if (sample.type == NoticeType.NEW_RECHARGE || sample.type == NoticeType.NEW_CONSUME)
     {
         rechargeList = NoticeActiveManagerment.Instance.getRechargeList((sample.content as SidNoticeContent).sids);
     }
     else if (sample.type == NoticeType.NEW_EXCHANGE)
     {
         exchangeList = NoticeActiveManagerment.Instance.getExchangeList((sample.content as NewExchangeNoticeContent).actives);
     }
     else if (sample.type == NoticeType.ONE_MANY_RECHARGE)
     {
         rechargeList = RechargeManagerment.Instance.getOneManyRecharges((sample.content as SidNoticeContent).sids);
         clearRechargeOver();
     }
     startTime();
 }
Esempio n. 9
0
    /// <summary>
    /// 判断是否某个sid的公告有内容可以领取
    /// </summary>
    public bool isNoticeBySidDraw(int sid)
    {
        NoticeSample sample = NoticeSampleManager.Instance.getNoticeSampleBySid(sid);
        int          type   = sample.type;

        if (type == NoticeType.TOPUPNOTICE || type == NoticeType.TIME_RECHARGE)
        {
            List <Recharge> rechargeList = RechargeManagerment.Instance.getCanUseRecharges((sample.content as SidNoticeContent).sids);
            for (int i = 1; i < rechargeList.Count; i++)
            {
                if (rechargeList[i].isComplete() && rechargeList[i].isRecharge() && RechargeManagerment.Instance.testTime(rechargeList[i], ServerTimeKit.getSecondTime()))
                {
                    return(true);
                }
            }
        }
        else if (type == NoticeType.EXCHANGENOTICE)
        {
            List <Exchange> exchangeList = ExchangeManagerment.Instance.getCanUseExchanges((sample.content as SidNoticeContent).sids, sample.type);
            for (int i = 1; i < exchangeList.Count; i++)
            {
                ExchangeSample temp = exchangeList[i].getExchangeSample();
                if (ExchangeManagerment.Instance.isCheckPremises(temp) && ExchangeManagerment.Instance.isCheckConditions(temp) && ExchangeManagerment.Instance.testTime(exchangeList[i], ServerTimeKit.getSecondTime()))
                {
                    return(true);
                }
            }
        }
        return(false);
    }
Esempio n. 10
0
    /** 获得指定答题活动的题目类型 */
    public int getQuizIndex(Notice _notice)
    {
        NoticeSample noticeSample = _notice.getSample();

        int[] sids = (noticeSample.content as SidNoticeContent).sids;
        return(sids[0]);
    }
Esempio n. 11
0
    //解析模板数据
    public override void parseSample(int sid)
    {
        NoticeSample sample  = new NoticeSample();
        string       dataStr = getSampleDataBySid(sid);

        sample.parse(sid, dataStr);
        samples.Add(sid, sample);
    }
    private void startTimer()  //开始计时
    {
        timer = TimerManager.Instance.getTimer(UserManager.TIMER_DELAY);
        NoticeSample sample = NoticeSampleManager.Instance.getNoticeSampleBySid(notice.sid);

        activeTime = ActiveTime.getActiveTimeByID(sample.timeID);
        timer.addOnTimer(updateNoticeWindow);
        timer.start();
    }
Esempio n. 13
0
 /* methods */
 public void initContent(NoticeWindow win, Notice notice)
 {
     this.equipReamkeNotice = notice as EquipRemakeNotice;
     this.win      = win;
     noticeSample  = notice.getSample();
     noticeContent = noticeSample.content as EquipRemakeNoticeContent;
     initButton();
     initUI();
 }
Esempio n. 14
0
    public RebateDayInfo(int _dayID)
    {
        //NoticeSample sample = NoticeSampleManager.Instance.getNoticeSampleBySid(RebateNoticeID);
        NoticeSample sample    = NoticeSampleManager.Instance.getNoticeSampleBySid(RebateInfoManagement.Instance.rebateNoticeID);
        int          delayTime = sample.order;

        this.dayID = _dayID;
        startTime  = getStartTime(_dayID, TimeConfigManager.Instance.getTimeInfoSampleBySid(sample.timeID).mainTimeInfo[0]);
        endTime    = getEndTime(_dayID, startTime, delayTime);
    }
Esempio n. 15
0
    // 显示活动描述文本//
    public void showDescribLabel()
    {
        //NoticeSample sample = NoticeSampleManager.Instance.getNoticeSampleBySid(RebateDayInfo.RebateNoticeID);
        if (m_notice != null)
        {
            NoticeSample sample    = NoticeSampleManager.Instance.getNoticeSampleBySid(m_notice.sid);
            string       delayTime = sample.order.ToString();

            describLabel.text = string.Format(ns.activiteDesc, delayTime);
        }
    }
Esempio n. 16
0
    /// <summary>
    /// 开启计时器
    /// </summary>
    private void startTimer()
    {
        if (timer1 == null)
        {
            timer1 = TimerManager.Instance.getTimer(UserManager.TIMER_DELAY);
        }
        NoticeSample sample = NoticeSampleManager.Instance.getNoticeSampleBySid(notice.sid);

        activeTime1 = ActiveTime.getActiveTimeByID(sample.timeID);
        timer1.addOnTimer(updateNotice);
        timer1.start();
    }
Esempio n. 17
0
    public string ToString(NoticeSample noticeSample)
    {
        string str = "";

        for (int i = 0; i < prizes.Length; i++)
        {
            str += prizes[i].ToString();
            if (i < prizes.Length - 1)
            {
                str += ",";
            }
        }
        return(ParseDesc(desc, condition, noticeSample) + " 次数:" + count + " 奖励:" + str);
    }
    public void initContent(Notice notice, WindowBase win)
    {
        this.notice              = notice as LimitCollectNotice;
        this.win                 = win;
        this.openTimeNoticeText  = LanguageConfigManager.Instance.getLanguage("LuckyCardContent_timeOpen");
        this.closeTimeNoticeText = LanguageConfigManager.Instance.getLanguage("LuckyCardContent_timeOver");
        datas = new List <LimitCollectSample>();
        NoticeSample sample = NoticeSampleManager.Instance.getNoticeSampleBySid(notice.sid);

        sids       = (sample.content as SidNoticeContent).sids;
        activeTime = ActiveTime.getActiveTimeByID(this.notice.getSample().timeID);
        setNoticeOpenTime();
        updateData(sids);
    }
Esempio n. 19
0
    private string ParseDesc(string desc, int condition, NoticeSample noticeSample)
    {
        if (string.IsNullOrEmpty(desc))
        {
            return("");
        }
        int value = condition;

        if (noticeSample.type == NoticeType.TOPUPNOTICE || noticeSample.type == NoticeType.TIME_RECHARGE ||
            noticeSample.type == NoticeType.NEW_RECHARGE)
        {
            value /= 10;
        }
        return(desc.Replace("%1", value.ToString()));
    }
Esempio n. 20
0
    //得到置顶公告数量
    public int getTopNoticeNum()
    {
        List <Notice> list = new List <Notice>();

        for (int i = 0; i < array.Count; i++)
        {
            NoticeSample sample = NoticeSampleManager.Instance.getNoticeSampleBySid(array[i].sid);
            if (sample.type == NoticeType.STICKNOTICE)
            {
                list.Add(array[i]);
                continue;
            }
        }
        return(list.Count);
    }
Esempio n. 21
0
    //获得符合条件的公告信息
    public Notice[] getNotices(int time)
    {
        List <Notice> list = new List <Notice>();

        for (int i = 0; i < array.Count; i++)
        {
            NoticeSample sample = NoticeSampleManager.Instance.getNoticeSampleBySid(array[i].sid);
            if (sample.type == NoticeType.STICKNOTICE)
            {
                list.Add(array[i]);
                continue;
            }
            list.Add(array[i]);
        }
        return(list.ToArray());
    }
Esempio n. 22
0
 void OnEnable()
 {
     if (notice != null)
     {
         sample = NoticeSampleManager.Instance.getNoticeSampleBySid(this.notice.sid);
         // 与服务器通讯
         if (sample.activiteDesc == "KUAFU")
         {
             (FPortManager.Instance.getFPort("LuckyCardFPort") as LuckyCardFPort).access(notice.sid, OnLoadDataResault);
         }
         else if (sample.activiteDesc == "LOCAL")
         {
             (FPortManager.Instance.getFPort("LuckyCardLocalFPort") as LuckyCardLocalFPort).access(notice.sid, OnLoadDataResault);
         }
     }
 }
Esempio n. 23
0
    public override bool isValid()
    {
        NoticeSample sample = NoticeSampleManager.Instance.getNoticeSampleBySid(sid);

        activeTime = ActiveTime.getActiveTimeByID(sample.timeID);
        if (activeTime.getIsFinish())
        {
            return(false);
        }
        if (activeTime.getEndTime() == 0)
        {
            return(true);
        }
        int now = ServerTimeKit.getSecondTime();

        return(now >= activeTime.getStartTime() && now <= activeTime.getDetailEndTime() && hasInfo());
    }
Esempio n. 24
0
    /// 获得指定时间指定公告类型Exchange的可领取次数
    /// </summary>
    /// <param name="now">时间</param>
    /// <param name="noticeType">获得类型</param>
    public int getCanReceiveExchangeByTime(int now, int noticeType, int entranceId)
    {
        List <Notice> array = getNoticeList();
        int           count = 0;

        if (array == null)
        {
            return(count);
        }
        Notice notice;

        for (int i = 0; i < array.Count; i++)
        {
            notice = array[i];
            if (notice == null)
            {
                continue;
            }
            int type = notice.getSample().type;
            if (type != noticeType)
            {
                continue;
            }
            NoticeSample sample = NoticeSampleManager.Instance.getNoticeSampleBySid(notice.sid);
            if (sample.entranceId != entranceId)
            {
                continue;
            }
            List <Exchange> temps = ExchangeManagerment.Instance.getValidExchangesByTime((sample.content as SidNoticeContent).sids, sample.type, now);
            //vip兑换特殊处理
            if (sample.sid == 4)
            {
                if (temps != null && temps.Count > 0 && PlayerPrefs.GetString(PlayerPrefsComm.VIP_EXCHANGE_TIP) == "ok")
                {
                    count++;
                }
                continue;
            }
            if (temps != null)
            {
                count += temps.Count;
            }
            return(count);
        }
        return(count);
    }
Esempio n. 25
0
 public void initContent(Notice notice, WindowBase win, MonoBase activityBase)
 {
     this.win          = win;
     this.notice       = notice;
     this.activityBase = activityBase;
     sample            = NoticeSampleManager.Instance.getNoticeSampleBySid(notice.sid);
     //rechargeList = NoticeActiveManagerment.Instance.getRechargeList ((sample.content as SidNoticeContent).sids);
     if (rechargeList == null)
     {
         rechargeList = new List <BackRecharge>();
     }
     rechargeList.Clear();
     foreach (KeyValuePair <int, BackRecharge> item in BackPrizeRechargeInfo.Instance.rechargeIitems)
     {
         item.Value.num = BackPrizeRechargeInfo.Instance.rechargeNum;
         rechargeList.Add(item.Value);
     }
 }
Esempio n. 26
0
 /// <summary>
 /// 初始化各个条目内容
 /// </summary>
 public void initItems()
 {
     this.sample      = NoticeSampleManager.Instance.getNoticeSampleBySid(this.notice.getSample().sid);
     allSids          = (sample.content as SidNoticeContent).sids;
     fireworksSamples = new List <FestivalFireworksSample>();
     for (int i = 0; i < allSids.Length; i++)
     {
         fireworksSamples.Add(FestivalFireworksSampleManager.Instance.getFestivalFireworksSampleBySid(allSids[i]));
     }
     if (fireworksSamples.Count < item.Length)
     {
         return;
     }
     for (int i = 0; i < item.Length; i++)
     {
         //当前只有三个条目,只会取配置的前三条数据
         item[i].initItemUI(fireworksSamples[i], win);
     }
 }
    public void updateItem(Recharge re, NoticeSample noticeSample, Notice notice)
    {
        recharge    = re;
        res         = re.getRechargeSample();
        this.notice = notice;
        this.sample = noticeSample;
        showTime();
        receiveButton.fatherWindow = fatherWindow.win;
        receiveButton.updateButton(re);
        receiveButton.content = fatherWindow;
        setItemText();
        if (awardButtons == null)
        {
            awardButtons = new GoodsView[4];
            for (int i = 0; i < awardButtons.Length; i++)
            {
                awardButtons [i] = NGUITools.AddChild(showAwardPos, goodsViewPre).GetComponent <GoodsView> ();
                awardButtons [i].transform.localPosition = new Vector3(i * 105f, 0, 0);
                awardButtons [i].transform.localScale    = new Vector3(0.9f, 0.9f, 0.9f);
                awardButtons [i].fatherWindow            = fatherWindow.win;
                awardButtons [i].gameObject.SetActive(false);
            }

            //显示充值奖励内容 位移差X=120
            for (int i = 0; i < res.prizes.Length && i < 4; i++)
            {
                awardButtons [i].gameObject.SetActive(true);
                awardButtons [i].init(res.prizes [i]);
            }
        }
        else
        {
            for (int i = 0; i < awardButtons.Length; i++)
            {
                awardButtons [i].gameObject.SetActive(false);
            }
            for (int i = 0; i < res.prizes.Length && i < 4; i++)
            {
                awardButtons [i].gameObject.SetActive(true);
                awardButtons [i].init(res.prizes [i]);
            }
        }
    }
    public void initContent(Notice notice, WindowBase win)
    {
        this.win    = win;
        this.notice = notice;
        this.sample = NoticeSampleManager.Instance.getNoticeSampleBySid(this.notice.getSample().sid);
        foreach (SpriteCardCtrl ctrl in ctrls)
        {
            ctrl.fatherWindow = win;
        }
        getBaseData(notice.sid);
        ButtonRestart.setFatherWindow(win);
        ButtonRestart.onClickEvent = pullSprite;
        ButtonHelp.setFatherWindow(win);
        ButtonHelp.onClickEvent = openHelpWindow;
        BeginPull.setFatherWindow(win);
        BeginPull.onClickEvent = beginPull;

        setNoticeSetting();
    }
Esempio n. 29
0
    /// <summary>
    ///检查相关仓库是否满
    /// </summary>
    private bool isStorageFulls(int index)
    {
        PrizeSample sample = null;

        if (psList != null)
        {
            sample = psList[index];
        }
        int num = 0;

        if (sample != null)
        {
            num = StringKit.toInt(sample.num);
        }
        if (sample.type == PrizeType.PRIZE_CARD && StorageManagerment.Instance.isRoleStorageFull(num))
        {
            MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("s0172"));
            return(true);
        }
        else if (sample.type == PrizeType.PRIZE_EQUIPMENT && StorageManagerment.Instance.isEquipStorageFull(num))
        {
            MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("storeFull_equip"));
            return(true);
        }
        else if (sample.type == PrizeType.PRIZE_MAGIC_WEAPON && StorageManagerment.Instance.isMagicWeaponStorageFull(num))
        {
            MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("storeDull_magicWeapon"));
            return(true);
        }
        else if (sample.type == PrizeType.PRIZE_STARSOUL && StorageManagerment.Instance.isStarSoulStorageFull(num))
        {
            MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("storeFull_starSoul"));
            return(true);
        }
        else if (StorageManagerment.Instance.isTempStorageFull(20))
        {
            MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("s0173"));
            return(true);
        }
        return(false);
    }
Esempio n. 30
0
 /** 是否为有效的抽奖条目 */
 public bool isValidLuckyDrawSample(LuckyDrawSample sample)
 {
     if (sample.noticeSid != 0)
     {
         NoticeSample tmp    = NoticeSampleManager.Instance.getNoticeSampleBySid(sample.noticeSid);
         Notice       notice = NoticeManagerment.Instance.getValidNoticeBySid(sample.noticeSid, tmp.entranceId);
         if (notice == null || !notice.isValid())
         {
             return(false);
         }
         if (notice is LuckyDrawNotice)               // 有效的活动抽奖条目,更新抽奖模板时间
         {
             LuckyDrawNotice ldn            = notice as LuckyDrawNotice;
             int             noticeOpenTime = ldn.activeTime.getDetailStartTime();
             int             remainTime     = noticeOpenTime - ServerTimeKit.getSecondTime();
             if (remainTime <= 0)
             {
                 int noticeCloseTime = ldn.activeTime.getDetailEndTime();
                 int remainCloseTime = noticeCloseTime - ServerTimeKit.getSecondTime();
                 if (remainCloseTime <= 0)
                 {
                     sample.startTime = 0;
                     sample.endTime   = 0;
                 }
                 else
                 {
                     sample.startTime = 0;
                     sample.endTime   = noticeCloseTime;
                 }
             }
             else
             {
                 sample.startTime = noticeOpenTime;
                 sample.endTime   = 0;
             }
         }
         return(true);
     }
     return(true);
 }