Exemplo n.º 1
0
        private JumboECMS.Entity.Normal_CategoryTree getTree(DbOperHandler _doh, string _categoryid, bool _includechild)
        {
            JumboECMS.Entity.Normal_CategoryTree _tree     = new JumboECMS.Entity.Normal_CategoryTree();
            JumboECMS.Entity.Normal_Category     _category = new JumboECMS.DAL.Normal_CategoryDAL().GetEntity(_categoryid, "");
            _tree.Id       = Str2Int(_categoryid);
            _tree.Name     = _category.Title;
            _tree.Link     = Go2Category(_categoryid, 1);
            _tree.HasChild = HasChild(_categoryid);
            List <JumboECMS.Entity.Normal_CategoryTree> subtree = new List <JumboECMS.Entity.Normal_CategoryTree>();

            if (_includechild)
            {
                _doh.Reset();
                _doh.SqlCmd = "SELECT Id FROM [" + base.CategoryTable + "] WHERE [ParentId]=" + _categoryid + " order by code";
                DataTable dtCategory = _doh.GetDataTable();
                for (int i = 0; i < dtCategory.Rows.Count; i++)
                {
                    string _subcategoryid = dtCategory.Rows[i]["Id"].ToString();
                    subtree.Add(getTree(_doh, _subcategoryid, _includechild));
                }
                dtCategory.Clear();
                dtCategory.Dispose();
            }
            _tree.SubChild = subtree;
            return(_tree);
        }
Exemplo n.º 2
0
 protected void getEditDropDownList(ref DropDownList ddlClassId, decimal point, int ClassDepth)
 {
     if (!this.Page.IsPostBack)
     {
         this.doh.Reset();
         this.doh.SqlCmd = string.Concat(new object[]
         {
             "SELECT [Id],[Point],[Title],[Bonus],[Score],[Times],[Sort] FROM [N_UserLevel] where point>=",
             point,
             " and point<",
             this.AdminPoint
         });
         DbOperHandler expr_61 = this.doh;
         expr_61.SqlCmd += " ORDER BY Bonus";
         DataTable dataTable = this.doh.GetDataTable();
         if (dataTable.Rows.Count == 0)
         {
             this.doh.Reset();
             this.doh.SqlCmd = "SELECT [Id],[Point],[Title],[Bonus],[Score],[Times],[Sort] FROM [N_UserLevel] where point=" + this.AdminPoint;
             DbOperHandler expr_BE = this.doh;
             expr_BE.SqlCmd += " ORDER BY Bonus";
             DataTable dataTable2 = this.doh.GetDataTable();
             for (int i = 0; i < dataTable2.Rows.Count; i++)
             {
                 ddlClassId.Items.Add(new ListItem(dataTable2.Rows[i]["Bonus"].ToString() + "_" + Convert.ToDecimal(Convert.ToDecimal(dataTable2.Rows[i]["Point"]) / 10m).ToString("0.00") + "%", dataTable2.Rows[i]["Point"].ToString()));
             }
         }
         for (int j = 0; j < dataTable.Rows.Count; j++)
         {
             ddlClassId.Items.Add(new ListItem(dataTable.Rows[j]["Bonus"].ToString() + "_" + Convert.ToDecimal(Convert.ToDecimal(dataTable.Rows[j]["Point"]) / 10m).ToString("0.00") + "%", dataTable.Rows[j]["Point"].ToString()));
         }
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Exemplo n.º 3
0
        protected string leftMenuJson()
        {
            this.AdminId = base.Str2Str(Cookie.GetValue(this.site.CookiePrev + "admin", "id"));
            this.doh.Reset();
            this.doh.SqlCmd = "SELECT top 1 * FROM [Sys_Admin] a left join [Sys_Role] b on a.RoleId=b.Id where a.Id=" + this.AdminId;
            DataTable dataTable = this.doh.GetDataTable();

            if (dataTable.Rows.Count > 0)
            {
                this.AdminIsSuper = "1".Equals(dataTable.Rows[0]["IsSuper"].ToString().Trim());
                this.AdminSetting = dataTable.Rows[0]["Setting"].ToString();
            }
            else
            {
                this.AdminIsSuper = false;
                this.AdminSetting = "";
            }
            if (this.AdminSetting.Length > 2)
            {
                this.AdminSetting = this.AdminSetting.Substring(1, this.AdminSetting.Length - 2);
            }
            string str = "";

            this.doh.Reset();
            this.doh.SqlCmd = "SELECT * FROM Sys_Menu WHERE IsUsed=0";
            if (!this.AdminIsSuper)
            {
                if (this.AdminSetting.Length > 2)
                {
                    DbOperHandler expr_13A = this.doh;
                    expr_13A.SqlCmd = expr_13A.SqlCmd + " and Id in (" + this.AdminSetting + ")";
                    str             = " and Id in (" + this.AdminSetting + ")";
                }
                else
                {
                    DbOperHandler expr_178 = this.doh;
                    expr_178.SqlCmd += " and Id in (0)";
                    str              = " and Id in (0)";
                }
            }
            DbOperHandler expr_199 = this.doh;

            expr_199.SqlCmd += " ORDER BY Sort asc";
            DataTable dataTable2 = this.doh.GetDataTable();

            this.doh.Reset();
            this.doh.SqlCmd = "SELECT * FROM Sys_Menu WHERE IsUsed=0 and pId=0";
            if (!this.AdminIsSuper && dataTable2.Rows.Count > 0)
            {
                DbOperHandler expr_1F1 = this.doh;
                expr_1F1.SqlCmd = expr_1F1.SqlCmd + " and Id in (SELECT Pid FROM Sys_Menu WHERE IsUsed=0 " + str + " group by Pid)";
            }
            DbOperHandler expr_212 = this.doh;

            expr_212.SqlCmd += " ORDER BY Sort asc";
            DataTable dataTable3 = this.doh.GetDataTable();

            return(dtHelp.DT2JSONAdminLeft(dataTable3, dataTable2));
        }
Exemplo n.º 4
0
 public void GetChargeSetJSON(ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.SqlCmd = "SELECT * from Sys_ChargeSet where IsUsed=0 and Id<>1020";
         DbOperHandler expr_17 = dbOperHandler;
         expr_17.SqlCmd += " ORDER BY Sort asc";
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\"," + dtHelp.DT2JSON(dataTable) + "}";
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Exemplo n.º 5
0
 public void GetIphoneChargeSetJSON(string Id, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.SqlCmd = "SELECT * from Sys_ChargeSet where Id in (" + Id + ")";
         DbOperHandler expr_22 = dbOperHandler;
         expr_22.SqlCmd += " ORDER BY Id asc";
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\"," + dtHelp.DT2JSON(dataTable) + "}";
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Exemplo n.º 6
0
 public void getChargeSetByIdJson(string Id, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.SqlCmd = "SELECT * from Sys_ChargeSet where Id=" + Id;
         DbOperHandler expr_1D = dbOperHandler;
         expr_1D.SqlCmd += " ORDER BY Id asc";
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = base.ConverTableToJSON(dataTable);
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Exemplo n.º 7
0
 public void getChargeSetJson(string Type, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.SqlCmd = "SELECT Id,MerName from Sys_ChargeSet where IsUsed=0";
         DbOperHandler expr_17 = dbOperHandler;
         expr_17.SqlCmd += " ORDER BY sort asc";
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = base.ConverTableToJSON(dataTable);
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Exemplo n.º 8
0
 public void getChargeSysBankJson(ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.SqlCmd = "SELECT Id,Bank from Sys_Bank where IsCharge=0 and IsUsed=0";
         DbOperHandler expr_17 = dbOperHandler;
         expr_17.SqlCmd += " ORDER BY id asc";
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = base.ConverTableToJSON(dataTable);
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Exemplo n.º 9
0
        private void ConnectDb()
        {
            if (this.doh != null)
            {
                return;
            }

            try
            {
                this.doh = (DbOperHandler) new SqlDbOperHandler(new SqlConnection(Const.ConnectionString));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 10
0
 public void getUserPointListJson(string UserId, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = "id=@id";
         dbOperHandler.AddConditionParameter("@id", UserId);
         object field = dbOperHandler.GetField("N_User", "Point");
         dbOperHandler.SqlCmd = "SELECT point,Convert(varchar(10),cast(round([Point]/10.0,2) as numeric(5,2)))+'%' as title FROM [N_UserLevel] where point>=100 and point<" + field;
         DbOperHandler expr_4B = dbOperHandler;
         expr_4B.SqlCmd += " ORDER BY Bonus desc";
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = base.ConverTableToJSON(dataTable);
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Exemplo n.º 11
0
 public void GetIphoneBankInfoJSON(string UserId, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = "UserId=" + UserId;
         dbOperHandler.Count("N_UserBank");
         dbOperHandler.Reset();
         dbOperHandler.SqlCmd = "select top 3 * from V_UserBankInfo where UserId=" + UserId;
         DbOperHandler expr_46 = dbOperHandler;
         expr_46.SqlCmd += "order by Id desc";
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = "{\"result\" :\"1\",\"returnval\" :\"操作成功\"," + dtHelp.DT2JSON(dataTable) + "}";
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Exemplo n.º 12
0
 /// <summary>
 /// 实时判断会员是不是客服
 /// </summary>
 /// <param name="_id"></param>
 /// <param name="doh"></param>
 /// <param name="_servicename"></param>
 /// <returns></returns>
 public bool Service(string _id, DbOperHandler doh, ref string _servicename)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         _doh.Reset();
         _doh.SqlCmd = "SELECT [ServiceName] FROM [jcms_normal_user] WHERE ServiceId>0 AND [Id]=" + _id;
         DataTable dt = _doh.GetDataTable();
         //_doh.Dispose();
         if (dt.Rows.Count > 0)
         {
             _servicename = dt.Rows[0]["ServiceName"].ToString();
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Exemplo n.º 13
0
 public void getSysBankBinByIdJson(string BankId, string BankBin, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.SqlCmd = string.Concat(new string[]
         {
             "SELECT top 1 * from Sys_BankBinInfo where BankId=",
             BankId,
             " and BankBin='",
             BankBin,
             "'"
         });
         DbOperHandler expr_3F = dbOperHandler;
         expr_3F.SqlCmd += " ORDER BY Id asc";
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = base.ConverTableToJSON(dataTable);
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Exemplo n.º 14
0
 protected void getActiveEditDropDownList(ref DropDownList ddlClassId, int ClassDepth)
 {
     if (!this.Page.IsPostBack)
     {
         this.doh.Reset();
         this.doh.SqlCmd = "SELECT [Code],[Name] FROM [Act_ActiveSet] where Isuse=1";
         DbOperHandler expr_31 = this.doh;
         expr_31.SqlCmd += " ORDER BY Id";
         DataTable dataTable = this.doh.GetDataTable();
         if (dataTable.Rows.Count == 0)
         {
             return;
         }
         for (int i = 0; i < dataTable.Rows.Count; i++)
         {
             ddlClassId.Items.Add(new ListItem(dataTable.Rows[i]["Name"].ToString(), dataTable.Rows[i]["Code"].ToString()));
         }
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Exemplo n.º 15
0
 protected void getRoleDropDownList(ref DropDownList ddlClassId, int ClassDepth)
 {
     if (!this.Page.IsPostBack)
     {
         this.doh.Reset();
         this.doh.SqlCmd = "SELECT [Id],[Name] FROM [Sys_Role] where IsUsed=0";
         DbOperHandler expr_31 = this.doh;
         expr_31.SqlCmd += " ORDER BY Sort";
         DataTable dataTable = this.doh.GetDataTable();
         if (dataTable.Rows.Count == 0)
         {
             return;
         }
         for (int i = 0; i < dataTable.Rows.Count; i++)
         {
             ddlClassId.Items.Add(new ListItem(dataTable.Rows[i]["Name"].ToString(), dataTable.Rows[i]["Id"].ToString()));
         }
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Exemplo n.º 16
0
 protected void getEditDropDownList(ref DropDownList ddlClassId, int ClassDepth)
 {
     if (!this.Page.IsPostBack)
     {
         this.doh.Reset();
         this.doh.SqlCmd = "SELECT [Id],[Point],[Title],[Bonus],[Score],[Times],[Sort] FROM [N_UserLevel]";
         DbOperHandler expr_31 = this.doh;
         expr_31.SqlCmd += " ORDER BY Bonus desc";
         DataTable dataTable = this.doh.GetDataTable();
         if (dataTable.Rows.Count == 0)
         {
             return;
         }
         for (int i = 0; i < dataTable.Rows.Count; i++)
         {
             ddlClassId.Items.Add(new ListItem(dataTable.Rows[i]["Bonus"].ToString() + "_" + Convert.ToDecimal(Convert.ToDecimal(dataTable.Rows[i]["Point"]) / 10m).ToString("0.00") + "%", dataTable.Rows[i]["Point"].ToString()));
         }
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Exemplo n.º 17
0
        private SiteGroupCms.Entity.Normal_ClassTree getTree(DbOperHandler _doh, string _channelid, string _classid, bool _includechild)
        {
            SiteGroupCms.Entity.Normal_ClassTree _tree    = new SiteGroupCms.Entity.Normal_ClassTree();
            SiteGroupCms.Entity.Normal_Channel   _channel = new SiteGroupCms.Dal.Normal_ChannelDAL().GetEntity(_channelid);
            bool _channelishtml = true;

            if (_classid == "0")//表示从根节点开始
            {
                _tree.Id     = _channel.ID.ToString();
                _tree.Name   = _channel.Title;
                _tree.Link   = Go2Channel(_channelid, 0);
                _tree.RssUrl = "";
            }
            else
            {
                SiteGroupCms.Entity.Normal_Class _class = new SiteGroupCms.Dal.Normal_ClassDAL().GetEntity(_classid);
                _tree.Id   = _classid;
                _tree.Name = _class.Title;
                _tree.Link = Go2Class(1, _channelishtml, _channelid, _classid, false);
                //  _tree.RssUrl = Go2Rss(1, false, _channelid, _classid);
            }
            _tree.HasChild = HasChild(_channelid, _classid);
            List <SiteGroupCms.Entity.Normal_ClassTree> subtree = new List <SiteGroupCms.Entity.Normal_ClassTree>();

            if (_includechild)
            {
                _doh.Reset();
                _doh.SqlCmd = "SELECT Id FROM [jcms_normal_class] WHERE [ChannelId]=" + _channelid + " AND [ParentId]=" + _classid + " order by code";
                DataTable dtClass = _doh.GetDataTable();
                for (int i = 0; i < dtClass.Rows.Count; i++)
                {
                    string _subclassid = dtClass.Rows[i]["Id"].ToString();
                    subtree.Add(getTree(_doh, _channelid, _subclassid, _includechild));
                }
                dtClass.Clear();
                dtClass.Dispose();
            }
            _tree.SubChild = subtree;
            return(_tree);
        }
Exemplo n.º 18
0
 /// <summary>
 /// 插入GUID
 /// </summary>
 /// <param name="_id"></param>
 public string InsertGUID(string _id, DbOperHandler doh)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         string _guid = "";
         _doh.Reset();
         _doh.SqlCmd = "SELECT [GUID] FROM [jcms_normal_user] WHERE [Id]=" + _id;
         DataTable dt = _doh.GetDataTable();
         if (dt.Rows.Count > 0)
         {
             _guid = dt.Rows[0][0].ToString();
         }
         if (_guid.Length != 36)
         {
             _guid = Guid.NewGuid().ToString();
             _doh.ConditionExpress = "id=" + _id;
             _doh.AddFieldItem("guid", _guid);
             _doh.Update("jcms_normal_user");
         }
         return(_guid);
     }
 }
Exemplo n.º 19
0
        private void OptionsInfo()
        {
            string str   = base.q("t");
            string text  = base.q("w");
            string text2 = base.q("n");

            if (string.IsNullOrEmpty(text2))
            {
                text2 = "name";
            }
            this.doh.Reset();
            this.doh.SqlCmd = "select id," + text2 + " as name from " + str;
            if (!string.IsNullOrEmpty(text))
            {
                DbOperHandler expr_75 = this.doh;
                expr_75.SqlCmd = expr_75.SqlCmd + " where " + text;
            }
            DataTable dataTable = this.doh.GetDataTable();

            this._response = "{\"result\" :\"1\",\"returnval\" :\"操作成功\"," + dtHelp.DT2JSON(dataTable) + "}";
            dataTable.Clear();
            dataTable.Dispose();
        }
Exemplo n.º 20
0
 public void getUserUpPointListJson(string UserId, string MinPoint, ref string _jsonstr)
 {
     using (DbOperHandler dbOperHandler = new ComData().Doh())
     {
         dbOperHandler.Reset();
         dbOperHandler.ConditionExpress = "id=@id";
         dbOperHandler.AddConditionParameter("@id", UserId);
         object field = dbOperHandler.GetField("N_User", "Point");
         dbOperHandler.SqlCmd = string.Concat(new object[]
         {
             "SELECT point,Convert(varchar(10),cast(round([Point]/10.0,2) as numeric(5,2)))+'%' as title FROM [N_UserLevel] where point<",
             field,
             " and point>=",
             Convert.ToDouble(MinPoint.Replace("%", "")) * 10.0
         });
         DbOperHandler expr_88 = dbOperHandler;
         expr_88.SqlCmd += " ORDER BY Bonus asc";
         DataTable dataTable = dbOperHandler.GetDataTable();
         _jsonstr = base.ConverTableToJSON(dataTable);
         dataTable.Clear();
         dataTable.Dispose();
     }
 }
Exemplo n.º 21
0
        private void OptionsInfo()
        {
            string str1 = this.q("t");
            string str2 = this.q("w");
            string str3 = this.q("n");

            if (string.IsNullOrEmpty(str3))
            {
                str3 = "name";
            }
            this.doh.Reset();
            this.doh.SqlCmd = "select id," + str3 + " as name from " + str1;
            if (!string.IsNullOrEmpty(str2))
            {
                DbOperHandler doh = this.doh;
                doh.SqlCmd = doh.SqlCmd + " where " + str2;
            }
            DataTable dataTable = this.doh.GetDataTable();

            this._response = "{\"result\" :\"1\",\"returnval\" :\"操作成功\"," + dtHelp.DT2JSON(dataTable) + "}";
            dataTable.Clear();
            dataTable.Dispose();
        }
Exemplo n.º 22
0
        private void ajaxBetting2()
        {
            if (this.AdminId == "")
            {
                this._response = this.JsonResult(0, "投注失败,请重新登录后再进行投注!");
            }
            else if (this.site.BetIsOpen == 1)
            {
                this._response = this.JsonResult(0, "系统正在维护,不能投注!");
            }
            else
            {
                HttpContext.Current.Response.ContentType = "application/json";
                List <ajaxBetting.RequestDataJSON> requestDataJsonList = ajaxBetting.JSONToObject <List <ajaxBetting.RequestDataJSON> >(HttpUtility.UrlDecode(new StreamReader(HttpContext.Current.Request.InputStream).ReadToEnd()));
                ajaxBetting.RequestDataJSON        requestDataJson1    = new ajaxBetting.RequestDataJSON();
                int lotteryId1 = requestDataJsonList[0].lotteryId;   //投注信息
                int int32_1    = Convert.ToInt32(this.AdminId);      //会员Id

                LotteryDAL         lotDal  = new LotteryDAL();
                FlexDAL.UserBetDAL betDal  = new FlexDAL.UserBetDAL();
                SysLotteryModel    lottery = lotDal.GetSysLotteryById(lotteryId1);

                if (betDal.CheckBetTime(lotteryId1) == false)
                {
                    this._response = this.JsonResult(0, string.Format("凌晨1点55分到上午10点, [{0}]暂停开奖", lottery.Title));
                    return;
                }


                Decimal num1 = new Decimal(0);
                try
                {
                    //获取当前一期时间和期号
                    string[] issueTimeAndSn = betDal.GetIssueTimeAndSN(lotteryId1);
                    string   str1           = issueTimeAndSn[0];                     //期号
                    DateTime dateTime       = Convert.ToDateTime(issueTimeAndSn[1]); //开奖时间
                    DateTime serverTime     = FlexDAL.PublicDAL.GetServerTime();     //系统时间
                    for (int index = 0; index < requestDataJsonList.Count; ++index)
                    {
                        ajaxBetting.RequestDataJSON requestDataJson2 = requestDataJsonList[index];
                        num1 += requestDataJson2.price * (Decimal)requestDataJson2.Num * requestDataJson2.times;
                    }
                    string str2 = betDal.CheckBet(int32_1, lotteryId1, Convert.ToDecimal(num1), dateTime);
                    if (!string.IsNullOrEmpty(str2))
                    {
                        this._response = this.JsonResult(0, str2);
                    }
                    else
                    {
                        int num2 = 0;
                        for (int index = 0; index < requestDataJsonList.Count; ++index)
                        {
                            ajaxBetting.RequestDataJSON requestDataJson2 = requestDataJsonList[index];
                            this.doh.Reset();
                            this.doh.ConditionExpress = "Id=@Id";
                            DbOperHandler doh            = this.doh;
                            string        _conditionName = "@Id";
                            int           playId1        = requestDataJson2.playId;
                            string        str3           = playId1.ToString();
                            doh.AddConditionParameter(_conditionName, (object)str3);
                            string  str4        = string.Concat(this.doh.GetField("Sys_PlaySmallType", "Title2"));
                            Decimal singelBouns = new Decimal(0);
                            if (lotteryId1 != 5001)
                            {
                                if (Convert.ToDecimal(requestDataJson2.price) < new Decimal(0) || Convert.ToDecimal(requestDataJson2.Num) < new Decimal(1) || Convert.ToDecimal(requestDataJson2.times) < new Decimal(1))
                                {
                                    this._response = this.JsonResult(0, "投注错误!请重新投注!");
                                    return;
                                }
                                int    userId     = int32_1;
                                int    lotteryId2 = lotteryId1;
                                string balls      = requestDataJson2.balls;
                                playId1 = requestDataJson2.playId;
                                string  playId2 = playId1.ToString();
                                string  strPos  = requestDataJson2.strPos;
                                int     int32_2 = Convert.ToInt32(requestDataJson2.Num);
                                Decimal Point   = Convert.ToDecimal(requestDataJson2.Point);
                                string  str5    = Calculate.BetNumerice(userId, lotteryId2, balls, playId2, strPos, int32_2, Point, ref singelBouns);
                                if (!string.IsNullOrEmpty(str5))
                                {
                                    this._response = str5.Replace("[", "").Replace("]", "");
                                    return;
                                }
                                if (singelBouns <= new Decimal(0))
                                {
                                    this._response = this.JsonResult(0, "投注失败,返点错误,请重新投注!");
                                    return;
                                }
                            }
                            UserBetModel model = new UserBetModel();
                            model.UserId      = int32_1;
                            model.UserMoney   = new Decimal(0);
                            model.LotteryId   = lotteryId1;
                            model.PlayId      = Convert.ToInt32(requestDataJson2.playId);
                            model.PlayCode    = str4;
                            model.IssueNum    = str1;
                            model.SingleMoney = Convert.ToDecimal(requestDataJson2.price);
                            model.Num         = Convert.ToInt32(requestDataJson2.Num);
                            model.Detail      = requestDataJson2.balls;
                            model.Point       = Convert.ToDecimal(requestDataJson2.Point);
                            model.Bonus       = singelBouns;
                            model.Pos         = requestDataJson2.strPos;
                            model.STime       = dateTime;
                            model.STime2      = serverTime;
                            model.IsDelay     = 0;
                            model.Times       = Convert.ToDecimal(requestDataJson2.times);
                            model.ZHID        = 0;
                            num2 = !model.Pos.Equals("") ?
                                   betDal.InsertBetPos(model, "手机端") :
                                   (!model.PlayCode.Equals("P_5ZH") && !model.PlayCode.Equals("P_4ZH_L") && (!model.PlayCode.Equals("P_4ZH_R") && !model.PlayCode.Equals("P_3ZH_L")) && !model.PlayCode.Equals("P_3ZH_C") && !model.PlayCode.Equals("P_3ZH_R") ?
                                    betDal.InsertBet(model, "手机端") :
                                    betDal.InsertBetZH(model, "手机端"));
                        }
                        if (num2 > 0)
                        {
                            this._response = this.JsonResult(1, "第" + str1 + "期投注成功,请期待开奖!");
                        }
                        else
                        {
                            this._response = this.JsonResult(0, "对不起,投注失败!");
                        }

                        //this._response = this.JsonResult(1, "第" + str1 + "期投注成功,请期待开奖!");
                    }
                }
                catch (Exception ex)
                {
                    this._response = this.JsonResult(0, "对不起,投注失败!");
                }
            }
        }
Exemplo n.º 23
0
        private void ajaxZHBetting()
        {
            if (this.AdminId == "")
            {
                this._response = this.JsonResult(0, "投注失败,请重新登录后再进行投注!");
            }
            else
            {
                HttpContext.Current.Response.ContentType = "application/json";
                List <ajaxBetting.RequestDataJSONZH> requestDataJsonzhList = ajaxBetting.JSONToObject <List <ajaxBetting.RequestDataJSONZH> >("[" + new StreamReader(HttpContext.Current.Request.InputStream).ReadToEnd() + "]");
                ajaxBetting.RequestDataJSONZH        requestDataJsonzh1    = new ajaxBetting.RequestDataJSONZH();
                int     int32_1 = Convert.ToInt32(this.AdminId);
                int     int32_2 = Convert.ToInt32(requestDataJsonzhList[0].lotteryId);
                int     int32_3 = Convert.ToInt32(requestDataJsonzhList[0].IsStop);
                int     int32_4 = Convert.ToInt32(requestDataJsonzhList[0].ZHNums);
                Decimal num     = Convert.ToDecimal(requestDataJsonzhList[0].ZHSums);

                LotteryDAL         lotDal  = new LotteryDAL();
                FlexDAL.UserBetDAL betDal  = new FlexDAL.UserBetDAL();
                SysLotteryModel    lottery = lotDal.GetSysLotteryById(int32_2);

                if (betDal.CheckBetTime(int32_2) == false)
                {
                    this._response = this.JsonResult(0, string.Format("凌晨1点55分到上午10点, [{0}]暂停开奖", lottery.Title));
                    return;
                }

                try
                {
                    string[] issueTimeAndSn = betDal.GetIssueTimeAndSN(int32_2);
                    string   str1           = issueTimeAndSn[0];
                    DateTime dateTime       = Convert.ToDateTime(issueTimeAndSn[1]);
                    DateTime serverTime     = FlexDAL.PublicDAL.GetServerTime();
                    string   str2           = betDal.CheckBet(int32_1, int32_2, Convert.ToDecimal(num), dateTime);
                    if (!string.IsNullOrEmpty(str2))
                    {
                        this._response = this.JsonResult(0, str2);
                    }
                    else
                    {
                        Decimal        money   = new Decimal(0);
                        UserZhBetModel zhmodel = new UserZhBetModel();
                        zhmodel.UserId        = int32_1;
                        zhmodel.LotteryId     = int32_2;
                        zhmodel.PlayId        = 0;
                        zhmodel.StartIssueNum = str1;
                        zhmodel.TotalNums     = int32_4;
                        zhmodel.IsStop        = int32_3;
                        zhmodel.STime         = DateTime.Now;
                        List <UserBetModel>      userBetModelList = new List <UserBetModel>();
                        List <UserZhDetailModel> listZh           = new List <UserZhDetailModel>();
                        for (int index1 = 0; index1 < requestDataJsonzhList.Count; ++index1)
                        {
                            ajaxBetting.RequestDataJSONZH requestDataJsonzh2 = requestDataJsonzhList[index1];
                            this.doh.Reset();
                            this.doh.ConditionExpress = "Id=@Id";
                            DbOperHandler doh            = this.doh;
                            string        _conditionName = "@Id";
                            int           playId1        = requestDataJsonzh2.playId;
                            string        str3           = playId1.ToString();
                            doh.AddConditionParameter(_conditionName, (object)str3);
                            string str4 = string.Concat(this.doh.GetField("Sys_PlaySmallType", "Title2"));
                            if (Convert.ToDecimal(requestDataJsonzh2.price) < new Decimal(0) || Convert.ToDecimal(requestDataJsonzh2.Num) < new Decimal(1) || Convert.ToDecimal(requestDataJsonzh2.times) < new Decimal(1))
                            {
                                this._response = this.JsonResult(0, "投注错误!请重新投注!");
                                return;
                            }
                            Decimal singelBouns = new Decimal(0);
                            int     userId      = int32_1;
                            int     lotteryId   = int32_2;
                            string  balls       = requestDataJsonzh2.balls;
                            playId1 = requestDataJsonzh2.playId;
                            string  playId2 = playId1.ToString();
                            string  strPos  = requestDataJsonzh2.strPos;
                            int     int32_5 = Convert.ToInt32(requestDataJsonzh2.Num);
                            Decimal Point   = Convert.ToDecimal(requestDataJsonzh2.Point);
                            string  str5    = Calculate.BetNumerice(userId, lotteryId, balls, playId2, strPos, int32_5, Point, ref singelBouns);
                            if (!string.IsNullOrEmpty(str5))
                            {
                                this._response = str5;
                                return;
                            }
                            if (singelBouns <= new Decimal(0))
                            {
                                this._response = this.JsonResult(0, "投注失败,返点错误,请重新投注!");
                                return;
                            }
                            UserBetModel userBetModel = new UserBetModel();
                            userBetModel.UserId      = int32_1;
                            userBetModel.UserMoney   = new Decimal(0);
                            userBetModel.LotteryId   = int32_2;
                            userBetModel.PlayId      = Convert.ToInt32(requestDataJsonzh2.playId);
                            userBetModel.PlayCode    = str4;
                            userBetModel.SingleMoney = Convert.ToDecimal(requestDataJsonzh2.price);
                            userBetModel.Num         = Convert.ToInt32(requestDataJsonzh2.Num);
                            userBetModel.Detail      = requestDataJsonzh2.balls;
                            userBetModel.Point       = Convert.ToDecimal(requestDataJsonzh2.Point);
                            userBetModel.Bonus       = singelBouns;
                            userBetModel.Pos         = requestDataJsonzh2.strPos;
                            userBetModel.STime2      = serverTime;
                            userBetModel.IsDelay     = 0;
                            userBetModel.ZHID        = 0;
                            for (int index2 = 0; index2 < requestDataJsonzh2.table2.Count; ++index2)
                            {
                                ajaxBetting.RequestDataJSONZH2 requestDataJsonzH2 = requestDataJsonzh2.table2[index2];
                                if (Convert.ToInt32(requestDataJsonzH2.ZHTimes) > 0 && Convert.ToDecimal(requestDataJsonzH2.ZHIssueNum.Replace("-", "")) >= Convert.ToDecimal(str1.Replace("-", "")))
                                {
                                    UserZhDetailModel userZhDetailModel = new UserZhDetailModel();
                                    userZhDetailModel.IssueNum = requestDataJsonzH2.ZHIssueNum;
                                    userZhDetailModel.Times    = Convert.ToInt32(requestDataJsonzH2.ZHTimes);
                                    userZhDetailModel.STime    = Convert.ToDateTime(requestDataJsonzH2.ZHSTime);
                                    userZhDetailModel.Lists.Add(userBetModel);
                                    money += userBetModel.SingleMoney * (Decimal)userBetModel.Num * (Decimal)userZhDetailModel.Times;
                                    listZh.Add(userZhDetailModel);
                                }
                            }
                        }
                        zhmodel.TotalSums = money;
                        if (listZh.Count > 0)
                        {
                            if (betDal.InsertZhBet(zhmodel, listZh, money, "手机追号") > 0)
                            {
                                this._response = this.JsonResult(1, "追号成功!请等待开奖!");
                            }
                            else
                            {
                                this._response = this.JsonResult(0, "对不起,投注失败!");
                            }
                        }
                        else
                        {
                            this._response = this.JsonResult(0, "对不起,投注失败!");
                        }
                    }
                }
                catch (Exception ex)
                {
                    this._response = this.JsonResult(0, "对不起,投注失败!");
                }
            }
        }