Exemplo n.º 1
0
        public JsonResult SaveLottery(string entity)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            Lottery model  = serializer.Deserialize <Lottery>(entity);
            string  errmsg = "";

            if (model.AutoID < 1)
            {
                model.AutoID = WebSetBusiness.CreateLottery(model.CPName, model.CPCode, model.IconType, model.ResultUrl, CurrentUser.UserID, model.OpenTimes, model.CloseTime, model.OnSaleTime, model.SealTimes, model.PeriodsNum, ref errmsg);
            }
            else
            {
                bool bl = WebSetBusiness.UpdateLottery(model.CPName, model.CPCode, model.IconType, model.ResultUrl, model.OpenTimes, model.CloseTime, model.OnSaleTime, model.SealTimes, model.PeriodsNum, model.AutoID);
                if (!bl)
                {
                    model.AutoID = 0;
                }
            }
            JsonDictionary.Add("model", model);
            JsonDictionary.Add("ErrMsg", errmsg);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 2
0
        public JsonResult GetNavsList(string cpcode)
        {
            List <Plays> model = WebSetBusiness.GetLotteryPlaysesByCode(cpcode);

            model.ForEach(x =>
            {
                if (x.Layer == 2)
                {
                    List <Plays> templay = model.Where(y => y.PIDS == (x.PIDS + "_" + y.PCode) && y.Layer == 3).ToList();
                    x.ChildPlays         = templay;
                }
            });
            model.ForEach(x =>
            {
                if (x.Layer == 1)
                {
                    List <Plays> templay = model.Where(y => y.PIDS == (x.PIDS + "_" + y.PCode) && y.Layer == 2).ToList();
                    x.ChildPlays         = templay;
                }
            });
            JsonDictionary.Add("items", model.Where(x => x.Layer == 1).ToList());
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 3
0
 public JsonResult GetAdvertList()
 {
     JsonDictionary.Add("items", WebSetBusiness.GetAdvertSetList());
     return(new JsonResult
     {
         Data = JsonDictionary,
         JsonRequestBehavior = JsonRequestBehavior.AllowGet
     });
 }
Exemplo n.º 4
0
 public JsonResult DeleteActive(int autoid)
 {
     JsonDictionary.Add("result", WebSetBusiness.DeleteActive(autoid));
     return(new JsonResult
     {
         Data = JsonDictionary,
         JsonRequestBehavior = JsonRequestBehavior.AllowGet
     });
 }
Exemplo n.º 5
0
 public JsonResult GetMemberLevel(int type = 0)
 {
     JsonDictionary.Add("items", WebSetBusiness.GetMemberLevel(type));
     return(new JsonResult
     {
         Data = JsonDictionary,
         JsonRequestBehavior = JsonRequestBehavior.AllowGet
     });
 }
Exemplo n.º 6
0
        public JsonResult SaveMemberLevel(string memberlevel)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            List <MemberLevel>   modelList  = serializer.Deserialize <List <MemberLevel> >(memberlevel);
            var tempList = WebSetBusiness.GetMemberLevel(modelList[0].Type);

            modelList.ForEach(x =>
            {
                x.CreateUserID = CurrentUser.UserID;
                x.Status       = 1;
                var temp       = tempList.Where(y => y.Origin == x.Origin && y.Type == x.Type).FirstOrDefault();
                if (temp != null)
                {
                    x.LevelID = temp.LevelID;
                }
            });
            var    delList = tempList.Where(x => !modelList.Exists(y => y.Origin == x.Origin && y.Type == x.Type)).OrderByDescending(x => x.Origin).ToList();
            var    addList = modelList.Where(x => string.IsNullOrEmpty(x.LevelID)).ToList();
            var    updList = modelList.Where(x => !string.IsNullOrEmpty(x.LevelID)).ToList();
            string result  = "";

            if (delList.Any())
            {
                delList.ForEach(x =>
                {
                    string tempresult = WebSetBusiness.DeleteMemberLevel(x.LevelID);
                    if (result.IndexOf(tempresult) == -1)
                    {
                        result += tempresult + ",";
                    }
                });
            }
            updList.ForEach(x =>
            {
                result += WebSetBusiness.UpdateMemberLevel(x.Golds, x.LevelID,
                                                           x.Name, x.DiscountFee, x.IntegFeeMore, x.ImgUrl);
            });
            if (addList.Any())
            {
                addList.ForEach(x =>
                {
                    string mes = WebSetBusiness.CreateMemberLevel(Guid.NewGuid().ToString(),
                                                                  x.Name.Trim(), x.Golds, x.CreateUserID, x.DiscountFee,
                                                                  x.IntegFeeMore, x.Status, x.ImgUrl, x.Origin, x.Type);
                    result += string.IsNullOrEmpty(mes) ? result : mes;
                });
            }
            JsonDictionary.Add("result", result);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 7
0
        public JsonResult GetActiveByID(string id)
        {
            var item = WebSetBusiness.GetActiveByID(id);

            JsonDictionary.Add("Item", item);
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 8
0
        public JsonResult DeleteMemberLevel(string levelid)
        {
            string result = WebSetBusiness.DeleteMemberLevel(levelid);

            JsonDictionary.Add("result", result);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 9
0
        public JsonResult GetActive(int type = 0, int tops = 9)
        {
            var list = WebSetBusiness.GetActiveList(type, tops);

            JsonDictionary.Add("Items", list);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 10
0
        public JsonResult GetLotteryByID(int autoid)
        {
            var model = WebSetBusiness.GetLotteryDetailByID(autoid);

            JsonDictionary.Add("model", model);
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 11
0
        public JsonResult DeleteLottery(int autoid, int status)
        {
            bool bl = WebSetBusiness.UpdateUserLottery(status, autoid);

            JsonDictionary.Add("status", bl);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 12
0
        public JsonResult UpdateChargeStatus(int autoid, int status)
        {
            var result = false;

            result = WebSetBusiness.UpdateChargeSetStatus(autoid, status);
            JsonDictionary.Add("result", result);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 13
0
        public JsonResult GetAdvertList(string view, string imgtype)
        {
            var list = WebSetBusiness.GetAdvertSetList(imgtype, view.ToLower());

            JsonDictionary.Add("BaseUrl", PCDDTools.Common.GetKeyValue("Url"));
            JsonDictionary.Add("items", list);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 14
0
        public JsonResult CanalOrder(string cpcode, string issuenum)
        {
            string mes    = "撤单失败";
            var    result = WebSetBusiness.ReturnLotteryResult(cpcode, issuenum, CurrentUser.UserID, ref mes);

            JsonDictionary.Add("result", mes);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 15
0
        public ActionResult LotteryPlays(string cpCode, string cpName)
        {
            ViewBag.Model = WebSetBusiness.GetLotteryPlaysesByCode(cpCode);
            var plays = WebSetBusiness.GetPlays();

            ViewBag.CPName = cpName;
            ViewBag.CPCode = cpCode;
            ViewBag.Menus  = plays.Where(x => x.Layer == 1).ToList();
            ViewBag.CMenus = plays.Where(x => x.Layer == 2).ToList();
            ViewBag.TMenus = plays.Where(x => x.Layer == 3).ToList();
            return(View());
        }
Exemplo n.º 16
0
        public JsonResult PayMoney(int type, string levelid, string payway)
        {
            var    model     = WebSetBusiness.GetMemberLevelByID(levelid);
            string msg       = "";
            string ordercode = CurrentUser.AutoID + DateTime.Now.ToString("yyyMMddHHmmssfff");

            JsonDictionary.Add("result", UserOrdersBusiness.CreateUserOrder(levelid, payway == "zfbpay" ? 0 : 1, ordercode, CurrentUser.UserID, ref msg));
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 17
0
        public JsonResult SaveLotteryPlays(string lotterid, string permissions)
        {
            //if (permissions.Length > 0)
            //{
            //    permissions = permissions.Substring(0, permissions.Length - 1);
            //}
            bool bl = WebSetBusiness.UpdateLotteryPlays(lotterid, permissions, CurrentUser.UserID, OperateIP);

            JsonDictionary.Add("status", bl);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 18
0
        public bool checkGolds(string route)
        {
            var model = WebSetBusiness.GetChargeSetDetail(route.ToLower());

            if (model == null)
            {
                return(true);
            }
            if (model.Golds == 0 || model.Status == 0)
            {
                return(true);
            }
            return(CommonBusiness.UpdateUserAccount(model.Golds, CurrentUser.UserID, 1,
                                                    string.IsNullOrEmpty(model.Remark) ? "查看信息扣除" : model.Remark));;
        }
Exemplo n.º 19
0
        public JsonResult GetChargeList(int status, string keywords, string userID, string beginTime,
                                        string endTime, int pageIndex, int pageSize)
        {
            int totalCount = 0;
            int pageCount  = 0;
            var result     = WebSetBusiness.GetChargeSet(keywords, userID, status, pageSize, pageIndex, ref totalCount, ref pageCount, beginTime, endTime);

            JsonDictionary.Add("totalCount", totalCount);
            JsonDictionary.Add("pageCount", pageCount);
            JsonDictionary.Add("items", result);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 20
0
        public JsonResult GetActiveList(string keywords, int pageIndex, int pageSize, string btime = "",
                                        string etime = "", int type = -1)
        {
            int totalCount = 0, pageCount = 0;

            JsonDictionary.Add("items",
                               WebSetBusiness.GetActiveList(keywords, pageIndex, pageSize, ref totalCount, ref pageCount, btime, etime,
                                                            type));
            JsonDictionary.Add("TotalCount", totalCount);
            JsonDictionary.Add("PageCount", pageCount);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 21
0
        //
        // GET: /Lottery/

        public ActionResult Index(string id)
        {
            ViewBag.CPCode = id;
            ViewBag.Model  = WebSetBusiness.GetLotteryDetail(id);
            if (id == "TJSSC" || id == "XJSSC" || id == "HLJSSC")
            {
                return(RedirectToAction("HighLottery", "Lottery", new { id = id }));
            }
            else if (id == "SHSSL" || id == "FC3D")
            {
                return(RedirectToAction("SSC3D", "Lottery", new { id = id }));
            }
            else if (id == "CQSSC")
            {
                return(RedirectToAction("CQLottery", "Lottery", new { id = id }));
            }
            return(View());
        }
Exemplo n.º 22
0
        public JsonResult PayOtherMoney(decimal gold, string payway)
        {
            var    grule     = Convert.ToDecimal(CommonBusiness.getSysSetting(EnumSettingKey.GoldScale, "DValue"));
            var    totalFee  = grule * gold;
            string ordercode = CurrentUser.AutoID + DateTime.Now.ToString("yyyMMddHHmmssfff");
            var    model     = WebSetBusiness.GetMemberLevel(1).Where(x => x.IntegFeeMore <= totalFee).OrderByDescending(x => x.Origin).FirstOrDefault();
            string content   = "购买金币";

            if (model != null)
            {
                content = model.Golds > 0 ? ("满足优惠活动,赠送金币:" + model.Golds) : "";
                gold   += model.Golds;
            }
            JsonDictionary.Add("result", UserOrdersBusiness.CreateUserOrder(ordercode, payway == "zfbpay" ? 0 : 1, "金币", "", content, totalFee, "", 1, gold, CurrentUser.UserID));
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 23
0
        public JsonResult SaveCharge(string entity)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            ChargeSet            model      = serializer.Deserialize <ChargeSet>(entity);
            var result = false;

            if (model.AutoID == -1)
            {
                model.UserID = CurrentUser.UserID;
                result       = WebSetBusiness.InsertChargeSet(model);
            }
            else
            {
                result = WebSetBusiness.UpdateChargeSet(model);
            }
            JsonDictionary.Add("result", result);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Exemplo n.º 24
0
 public ActionResult ActiveDetail(string id = "")
 {
     ViewBag.Model = WebSetBusiness.GetActiveByID(id);
     return(View());
 }
Exemplo n.º 25
0
 public ActionResult CQLottery(string id)
 {
     ViewBag.CPCode = id;
     ViewBag.Model  = WebSetBusiness.GetLotteryDetail(id);
     return(View());
 }