コード例 #1
0
        public ActionResult ReportToday()
        {
            ViewBag.UserName = CurrentUser.UserName;
            ViewBag.LogName  = CurrentUser.LoginName;
            var model = LotteryOrderBusiness.GetUserWinDay(CurrentUser.UserID);

            ViewBag.TotalPayMent = model.TotalPayMent == -1 ? 0 : model.TotalPayMent;
            ViewBag.TotalWin     = model.TotalWin == -1 ? 0 : model.TotalWin;
            return(View());
        }
コード例 #2
0
        public JsonResult GetIssueNumFee(string cpcode, string issuenum = "", string type = "")
        {
            var result = LotteryOrderBusiness.GetIssueNumFee(cpcode, issuenum.Trim(), type);

            JsonDictionary.Add("PayFee", result);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
コード例 #3
0
ファイル: LotteryController.cs プロジェクト: nuet/CP
        public JsonResult GetUserLottery(string cpcode)
        {
            int total     = 0;
            int pageTotal = 0;
            var items     = LotteryOrderBusiness.GetLotteryOrder("", cpcode, CurrentUser.UserID, "", "", "", -1, -1, 20, 1, ref total,
                                                                 ref pageTotal, 0, DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00", DateTime.Now.ToString("yyyy-MM-dd"));

            JsonDictionary.Add("items", items);
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
コード例 #4
0
ファイル: LotteryController.cs プロジェクト: nuet/CP
        public JsonResult AddLotteryBett(string list, int isStart = 0)
        {
            JavaScriptSerializer   serializer = new JavaScriptSerializer();
            List <LotteryBettAuto> models     = serializer.Deserialize <List <LotteryBettAuto> >(list);
            string msg    = "";
            var    result = LotteryOrderBusiness.CreateBettOrderList(models, CurrentUser, OperateIP, isStart, ref msg);

            JsonDictionary.Add("result", result);
            JsonDictionary.Add("ErrMsg", msg);
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
コード例 #5
0
ファイル: LotteryController.cs プロジェクト: nuet/CP
        public JsonResult GetBettAutoRecord(string cpcode, int status, string lcode, string issuenum, string type, int selfrange, int winType, string btime, string etime, int pageIndex)
        {
            int total     = 0;
            int pageTotal = 0;
            var items     = LotteryOrderBusiness.GetBettAutoRecord("", cpcode, CurrentUser.UserID, lcode, issuenum, type, status, winType, PageSize, pageIndex, ref total,
                                                                   ref pageTotal, selfrange, btime, etime);

            JsonDictionary.Add("items", items);
            JsonDictionary.Add("totalCount", total);
            JsonDictionary.Add("pageCount", pageTotal);
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
コード例 #6
0
        public JsonResult GetTodyRopert(string cpcode = "cqssc", string issuenum = "")
        {
            var msg          = "网络延迟,请稍后再试";
            int totalCount   = 0;
            var bibett       = LotteryOrderBusiness.GetIssueNumFee(cpcode, issuenum.Trim(), "");
            var fee          = M_UsersBusiness.GetUserAccount(CurrentUser.UserID);
            var totalpayment = CommonBusiness.Select("AccountOperateRecord", "isnull(SUM(isnull(AccountChange,0)),0)", "PlayType in(4,5) and CreateTime>'" + DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00'");
            var userwin      = CommonBusiness.Select("AccountOperateRecord", "isnull(SUM(isnull(AccountChange,0)),0)", "PlayType =8 and CreateTime>'" + DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00'");

            JsonDictionary.Add("totalpayment", totalpayment);
            JsonDictionary.Add("totalwin", userwin);
            JsonDictionary.Add("yl", Convert.ToDecimal(userwin) - Convert.ToDecimal(totalpayment));
            JsonDictionary.Add("bettfee", bibett);
            JsonDictionary.Add("fee", fee);
            JsonDictionary.Add("Errmsg", msg);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
コード例 #7
0
        public JsonResult MessageInfo(string message, string cpcode, string issuenum)
        {
            string mes    = "";
            var    result = -1;

            message = message.Replace("毒", "万千百十个");
            var strs = message.Trim().Split(' ');

            if (strs.Length == 2)
            {
                message = "万个 " + message.Trim();
                strs    = message.Trim().Split(' ');
            }
            if (strs.Length == 3)
            {
                List <Plays>  plays   = CommonBusiness.LottertPlays.Where(x => x.CPCode == cpcode && !string.IsNullOrEmpty(x.OutName)).ToList();
                Lottery       lottery = CommonBusiness.LottertList.Where(x => x.CPCode == cpcode.ToUpper()).FirstOrDefault();
                List <string> list1   = new List <string>();
                List <string> list2   = new List <string>();
                List <string> list3   = new List <string>();
                var           chars   = strs[1].Trim().ToCharArray();
                if (strs[1].Trim().IndexOf("龙") > -1 || strs[1].Trim().IndexOf("虎") > -1 || strs[1].Trim().IndexOf("和") > -1)
                {
                    foreach (char c in chars)
                    {
                        string s = c.ToString();
                        if ("龙虎和".IndexOf(s) > -1)
                        {
                            list2.Add(s);
                        }
                    }
                    chars = strs[0].Trim().ToCharArray();
                    string mv = "";
                    foreach (char c in chars)
                    {
                        string s = c.ToString();
                        if (cpcode.ToLower() == "bjsc")
                        {
                        }
                        else
                        {
                            if ("万千百十个".IndexOf(s) > -1)
                            {
                                mv = mv + s;
                                if (mv.Length == 2)
                                {
                                    list1.Add(mv);
                                    mv = "";
                                }
                            }
                        }
                    }
                }
                else
                {
                    chars = strs[0].Trim().ToCharArray();
                    foreach (char c in chars)
                    {
                        string s = c.ToString();
                        if (cpcode.ToLower() == "bjsc")
                        {
                        }
                        else
                        {
                            if ("万千百十个".IndexOf(s) > -1)
                            {
                                list1.Add(s);
                            }
                        }
                    }
                    chars = strs[1].Trim().ToCharArray();
                    foreach (char c in chars)
                    {
                        string s = c.ToString();
                        if ("龙虎和大小单双1234567890".IndexOf(s) > -1)
                        {
                            list2.Add(s);
                        }
                    }
                }


                list3.Add(System.Text.RegularExpressions.Regex.Replace(strs[2], @"[^0-9]+", ""));
                if (list1.Count > 0 && list2.Count > 0 && list3.Count > 0)
                {
                    List <LotteryOrder>         orders = new List <LotteryOrder>();
                    Dictionary <string, string> tplays = new Dictionary <string, string>();
                    foreach (string s in list1)
                    {
                        foreach (string t in list2)
                        {
                            string key = s + t;
                            string pid = plays.Where(x => x.OutName.IndexOf(key) > -1).FirstOrDefault().PIDS;
                            if (!tplays.ContainsKey(s + t) && !string.IsNullOrWhiteSpace(pid))
                            {
                                LotteryOrder order = new LotteryOrder();
                                order.CPCode    = cpcode.ToUpper();
                                order.CPName    = lottery.CPName;
                                order.Status    = 0;
                                order.TypeName  = key;
                                order.Type      = pid;
                                order.Num       = 1;
                                order.PMuch     = 1;
                                order.RPoint    = 0;
                                order.MType     = 0;
                                order.ModelName = "0/0%";
                                order.PayFee    = Convert.ToDecimal(Convert.ToInt32(list3[list3.Count - 1]));
                                order.Content   = t;
                                order.UserID    = CurrentUser.UserID;
                                order.IssueNum  = issuenum;
                                orders.Add(order);
                                tplays.Add(s + t, pid);
                            }
                        }
                    }
                    if (list2.Count > 1 && orders.Count > 1)
                    {
                        decimal payfee = Convert.ToDecimal(Convert.ToInt32(Convert.ToInt32(list3[list3.Count - 1]) / orders.Count));
                        if (payfee > 10)
                        {
                            orders.ForEach(x => x.PayFee = payfee);
                            result = LotteryOrderBusiness.CreateUserOrderList(orders, CurrentUser, OperateIP, 0, 4, ref mes);
                        }
                        else
                        {
                            mes = "单注金额必须大于10元";
                        }
                    }
                    else if (orders.Count > 0)
                    {
                        if (Convert.ToDecimal(Convert.ToInt32(list3[list3.Count - 1])) > 10)
                        {
                            result = LotteryOrderBusiness.CreateUserOrderList(orders, CurrentUser, OperateIP, 0, 4, ref mes);
                        }
                        else
                        {
                            mes = "单注金额必须大于10元";
                        }
                    }
                    else
                    {
                        mes = "输入格式不正确";
                    }
                }
                else
                {
                    mes = "输入格式不正确";
                }
            }
            JsonDictionary.Add("result", result > 0?"投注成功":mes);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }