Beispiel #1
0
        /// <summary>
        /// 查询领取红包
        /// </summary>
        public ActionResult AuthenticityQuery()
        {
            string msg = "";

            List <LotteryRecord> Lmodel = LotteryRecord.GetEntitysbytg("and LotteryRecord.UserName='******' and (LotteryRecord.ActivityID='3' or LotteryRecord.ActivityID='1' )");

            if (Lmodel.Count > 0)
            {
                msg = "您已经参与过此活动!";
            }
            RedPackLottery code = RedPackLottery.GetEntityByUserName2(CurrentUser.UserName);

            if (code != null)
            {
                msg = "您已经参与过此活动";
            }
            ViewData["ip"] = System.Web.HttpContext.Current.Request.ServerVariables.Get("Remote_Addr").ToString();
            LotteryActivitys act = LotteryActivitys.GetEntityByID(1);

            ViewData["act"]  = act;
            ViewData["IsWx"] = Request.UserAgent.ToLower().Contains("micromessenger");
            ViewData["user"] = CurrentUser;

            ViewData["msg"] = msg;
            return(View());
        }
Beispiel #2
0
        //
        // GET: /LotteryActivitysAreaRedPack/
        public ActionResult Index(int activityID)
        {
            LotteryActivitys activity = LotteryActivitys.GetEntityByID(activityID);

            ViewData["activity"] = activity;
            List <SYSIntegralCodeArea> areas = SYSIntegralCodeArea.GetEntitysAll();

            foreach (var item in areas)
            {
                LotteryActivitysAreaRedPack old = LotteryActivitysAreaRedPack.GetEntityActArea(activity.ID, item.ID);
                if (old == null)
                {
                    LotteryActivitysAreaRedPack newmodel = new LotteryActivitysAreaRedPack();
                    newmodel.ActivityID = activity.ID;
                    newmodel.AreaID     = item.ID;
                    newmodel.InsertAndReturnIdentity();
                }
            }
            List <LotteryActivitysAreaRedPack> LAARPs = LotteryActivitysAreaRedPack.GetEntitysByActivityID(activity.ID);

            foreach (var item in LAARPs)
            {
                if (areas.Count(m => m.ID == item.AreaID) <= 0)
                {
                    LotteryActivitysAreaRedPack.DeleteByID(item.ID);
                }
            }
            LAARPs             = LAARPs.FindAll(m => areas.Count(n => n.ID == m.AreaID) > 0);
            ViewData["LAARPs"] = LAARPs;
            ViewData["areas"]  = areas;

            return(View());
        }
Beispiel #3
0
        public ActionResult Edit(int id)
        {
            LotteryActivitys     para   = LotteryActivitys.GetEntityByID(id);
            List <LotteryPrizes> prizes = LotteryPrizes.GetPrizesByActivityID(id);

            ViewData["prizes"] = prizes;
            return(View(para));
        }
Beispiel #4
0
        //[B_MenuRightsTag("奖项设置", "Index")]
        public ActionResult PrizesConfig(int id)
        {
            LotteryActivitys activity = LotteryActivitys.GetEntityByID(id);

            ViewData["activity"] = activity;

            List <LotteryPrizes> Prizes = LotteryPrizes.GetEntitysByActivityID(id);

            ViewData["Prizes"] = Prizes;
            return(View());
        }
Beispiel #5
0
        public ActionResult PrizeSettings()
        {
            LotteryActivitys activity = LotteryActivitys.GetEntityByID(2);

            ViewData["activity"] = activity;
            ViewData["IsNot"]    = LotteryPrizes.IsNotCanActive();

            List <LotteryPrizes> Prizes = LotteryPrizes.GetEntitysByActivityID(2);

            ViewData["Prizes"] = Prizes;
            MainShow UserScale = Scale.GetScaleCount();

            ViewData["BarCodeQty"] = UserScale.CanLotteryCount;
            return(View());
        }
Beispiel #6
0
        /// <summary>
        /// 裂变分享红包
        /// </summary>
        /// <param name="Code"></param>
        /// <returns></returns>
        public ActionResult ShareRedPack(string id)
        {
            try
            {
                LotteryActivitys act = LotteryActivitys.GetEntityByID(1);
                ViewData["act"]  = act;
                ViewData["id"]   = 1;
                ViewData["IsWx"] = Request.UserAgent.ToLower().Contains("micromessenger");
                ViewData["user"] = CurrentUser;
            }
            catch (Exception e)
            {
                DAL.Log.Instance.Write(e.Message, "红包获取");
            }

            return(View());
        }
Beispiel #7
0
        /// <summary>
        /// 普通红包
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult NormalRedPack(string Code)
        {
            RedPackShare redmodel = RedPackShare.GetEntityByCode(Code);
            string       msg      = "";
            int          sl       = 0;

            if (redmodel == null)
            {
                msg = "非法请求!";
            }
            else
            {
                if (redmodel.ReceiveCnt >= redmodel.RedCnt)
                {
                    msg = "您来晚了,红包派完了!";
                }
                sl = redmodel.RedCnt - redmodel.ReceiveCnt;
            }
            if (CurrentUser.Mobile.Length > 0)
            {
                msg = "您已经参与过此活动!";
            }

            RedPackLottery code = RedPackLottery.GetEntityByUserName(CurrentUser.UserName);

            if (code != null)
            {
                msg = "您已经参与过此活动";
            }

            ViewData["msg"] = msg;
            ViewData["ip"]  = System.Web.HttpContext.Current.Request.ServerVariables.Get("Remote_Addr").ToString();
            LotteryActivitys act = LotteryActivitys.GetEntityByID(3);

            ViewData["act"]  = act;
            ViewData["user"] = CurrentUser;
            ViewData["Code"] = Code;
            ViewData["sl"]   = sl;



            return(View());
        }