Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string str = this.Session["user_name"].ToString();
            agent_userinfo_session model = this.Session[str + "lottery_session_user_info"] as agent_userinfo_session;

            if (!model.get_u_type().Trim().Equals("zj"))
            {
                base.Response.Redirect("../MessagePage.aspx?code=u100014&url=&issuccess=1&isback=0");
            }
            base.Permission_Aspx_ZJ(model, "po_3_1");
            if (base.IsChildSync())
            {
                base.Response.Redirect("../MessagePage.aspx?code=u100080&url=&issuccess=1&isback=0");
            }
            string       s          = LSRequest.qq("pid");
            string       str3       = "/LotteryPeriod/AwardPeriod.aspx?lid=100";
            cz_phase_six phaseModel = CallBLL.cz_phase_six_bll.GetPhaseModel(int.Parse(s));

            if (!phaseModel.get_is_closed().Equals(1))
            {
                base.Response.Redirect(string.Format("../MessagePage.aspx?code=u100070&url={0}&issuccess=1&isback=1", base.Server.UrlDecode(str3)));
            }
            if (!phaseModel.get_is_payment().Equals(1))
            {
                base.Response.Redirect(string.Format("../MessagePage.aspx?code=u100070&url={0}&issuccess=1&isback=1", base.Server.UrlDecode(str3)));
            }
            if (CallBLL.cz_phase_six_bll.OpenData(s))
            {
                string str4 = null;
                if (model.get_users_child_session() != null)
                {
                    str4 = model.get_users_child_session().get_u_name();
                }
                string             str5 = "";
                string             str6 = "";
                cz_lotteryopen_log _log = new cz_lotteryopen_log();
                _log.set_phase_id(phaseModel.get_p_id());
                _log.set_phase(phaseModel.get_phase());
                _log.set_u_name(model.get_u_name());
                _log.set_children_name(str4);
                _log.set_action("開放數據");
                _log.set_old_val(str5);
                _log.set_new_val(str6);
                _log.set_ip(LSRequest.GetIP());
                _log.set_add_time(DateTime.Now);
                _log.set_note(string.Format("【本期編號:{0}】開放數據", _log.get_phase()));
                _log.set_type_id(0);
                _log.set_lottery_id(100);
                CallBLL.cz_lotteryopen_log_bll.Insert(_log);
                base.Response.Write(base.ShowDialogBox("開放數據成功!", string.Format("LotteryPeriod/AwardPeriod.aspx?lid={0}", 100), 0));
            }
            else
            {
                base.Response.Redirect(string.Format("../MessagePage.aspx?code=u100070&url={0}&issuccess=1&isback=1", base.Server.UrlDecode(str3)));
            }
        }
Esempio n. 2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string userName = txtUserName.Text;
            string userPwd  = txtPassword.Text;

            if (Session[LSKeys.SESSION_LOGIN_SUM] == null)
            {
                Session[LSKeys.SESSION_LOGIN_SUM] = 1;
            }
            else
            {
                Session[LSKeys.SESSION_LOGIN_SUM] = Convert.ToInt32(Session[LSKeys.SESSION_LOGIN_SUM]) + 1;
            }
            if (Convert.ToInt32(Session[LSKeys.SESSION_LOGIN_SUM]) > 5)
            {
                msgtip.InnerText = "您登录失败已经超过五次,请关闭浏览器重试";
                return;
            }
            ls_user_bll userBLL = new ls_user_bll();
            ls_user     user    = userBLL.Login(userName, userPwd);

            if (user == null)
            {
                msgtip.InnerText = "用户名密码错误";
            }
            else
            {
                Session[LSKeys.SESSION_USER_INFO] = user;
                Response.Cookies[LSKeys.COOKIE_USER_NAME].Value = userName;
                Response.Cookies[LSKeys.COOKIE_PASSWORD].Value  = user.user_password;
                //登录成功记录登录日志
                if (sysConfig.log_status > 0)
                {
                    new ls_log_bll().SaveLog(new ls_log()
                    {
                        user_id     = user.id,
                        user_name   = user.nick_name,
                        action_type = LSEnums.ActionEnum.Login.ToString(),
                        add_time    = DateTime.Now,
                        user_ip     = LSRequest.GetIP()
                    });
                }
                Response.Redirect("index.aspx");
            }
        }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DateTime time;

        base.Response.Expires = 0;
        if (!base.IsUserLoginByMobileForAjax())
        {
            this.Session.Abandon();
            base.Response.Write("<script>top.location.href='/m'</script>");
            base.Response.End();
        }
        int num30 = 2;

        if (!base.IsLotteryExistByPhone(num30.ToString()))
        {
            this.Session.Abandon();
            base.Response.Write("<script>top.location.href='/m'</script>");
            base.Response.End();
        }
        string str  = this.Session["user_name"].ToString();
        string str2 = "";
        cz_userinfo_session getUserModelInfo = base.GetUserModelInfo;

        if (FileCacheHelper.get_RedisStatOnline().Equals(1))
        {
            base.CheckIsOut(getUserModelInfo.get_u_name());
            base.stat_online_redis(getUserModelInfo.get_u_name(), "hy");
        }
        else if (FileCacheHelper.get_RedisStatOnline().Equals(2))
        {
            base.CheckIsOutStack(getUserModelInfo.get_u_name());
            base.stat_online_redisStack(getUserModelInfo.get_u_name(), "hy");
        }
        else
        {
            MemberPageBase.stat_online_bet(getUserModelInfo.get_u_name(), "hy");
        }
        if (!base.BetCreditLock(str))
        {
            str2 = "系統繁忙,請稍後!";
            str2 = string.Format("<script>alert('{0}');</script>", str2);
            base.Response.Write(str2);
            base.Response.End();
        }
        user_kc_rate rate  = base.GetUserRate_kc(getUserModelInfo.get_zjname());
        DataTable    table = null;
        DataSet      set   = CallBLL.cz_users_bll.AccountIsDisabled(rate.get_fgsname(), rate.get_gdname(), rate.get_zdname(), rate.get_dlname(), getUserModelInfo.get_u_name());

        if (set != null)
        {
            table = set.Tables[0];
            if ((table != null) && (table.Rows.Count > 0))
            {
                if (table.Rows[0]["a_state"].ToString().Trim() == "1")
                {
                    base.DeleteCreditLock(str);
                    str2 = "會員或上級已經被凍結,請與上級聯系!";
                    str2 = string.Format("<script>alert('{0}');</script>", str2);
                    base.Response.Write(str2);
                    base.Response.End();
                }
                else
                {
                    base.DeleteCreditLock(str);
                    str2 = "會員或上級已經被停用,請與上級聯系!";
                    str2 = string.Format("<script>alert('{0}');</script>", str2);
                    base.Response.Write(str2);
                    base.Response.End();
                }
            }
        }
        else
        {
            base.DeleteCreditLock(str);
            base.Response.End();
        }
        string str4  = base.qq("caizhong");
        string str5  = base.qq("wanfa");
        string str6  = base.qq("jiangqi");
        string str7  = "PK10_" + str5 + ".aspx?lottery_type=" + str4 + "&player_type=" + str5;
        string str8  = "";
        string str9  = "";
        string str10 = "";
        string str11 = "";
        string str12 = "";

        str9  = base.qq("uPI_ID");
        str10 = base.qq("uPI_P");
        str11 = base.qq("uPI_M");
        string[] strArray = base.qq("i_index").Split(new char[] { ',' });
        str12 = base.qq("JeuValidate");
        str8  = base.qq("shortcut");
        if ((((string.IsNullOrEmpty(str4) || string.IsNullOrEmpty(str5)) || (string.IsNullOrEmpty(str6) || string.IsNullOrEmpty(str9))) || string.IsNullOrEmpty(str10)) || string.IsNullOrEmpty(str11))
        {
            base.DeleteCreditLock(str);
            base.Response.End();
        }
        string[] source = str9.Split(new char[] { ',' });
        if (source.Distinct <string>().ToList <string>().Count != source.Length)
        {
            base.DeleteCreditLock(str);
            base.Response.End();
        }
        if (source.Length > FileCacheHelper.get_GetPK10MaxGroup())
        {
            base.DeleteCreditLock(str);
            base.Response.End();
        }
        string str13 = str5;
        string s     = str6;
        int    num2  = 2;

        if ((this.Session["JeuValidate"].ToString().Trim() != str12) || (this.Session["JeuValidate"].ToString().Trim() == ""))
        {
            base.DeleteCreditLock(str);
            base.Response.Write("<script>alert('下注規則有誤,請重新下注,謝謝合作!');$('#JeuValidate').val('" + base.get_JeuValidate() + "');</script>");
            base.Response.End();
        }
        else
        {
            this.Session["JeuValidate"] = "";
        }
        int num3 = 1;

        if (getUserModelInfo.get_su_type().ToString().Trim() != "dl")
        {
            num3 = -1;
        }
        int index = 0;

        Label_05F3 :;
        if (index < str11.Split(new char[] { ',' }).Length)
        {
            if (!base.IsNumber(str11.Split(new char[] { ',' })[index]))
            {
                base.DeleteCreditLock(str);
                base.Response.Write("<script>alert($(\"#v_" + strArray[index] + "\").text()+' 下注金額有誤!');$('#m_" + strArray[index] + "').focus();$('#JeuValidate').val('" + base.get_JeuValidate() + "');</script>");
                base.Response.End();
                return;
            }
            index++;
            goto Label_05F3;
        }
        if (getUserModelInfo.get_begin_kc().Trim() != "yes")
        {
            getUserModelInfo = base.GetRateByUserObject(2, rate);
        }
        string str16 = "";
        string str17 = "";

        if (!Utils.IsInteger(s))
        {
            base.Response.End();
        }
        DataTable table2 = CallBLL.cz_phase_pk10_bll.GetIsClosedByTime(int.Parse(s)).Tables[0];

        if ((table2 != null) && (table2.Rows.Count > 0))
        {
            if (table2.Rows[0]["is_closed"].ToString().Trim() == "1")
            {
                base.DeleteCreditLock(str);
                base.Response.Write("<script>alert('該獎期已經截止下注!');window.location=\"" + str7 + "\";</script>");
                base.Response.End();
                return;
            }
            str16 = table2.Rows[0]["phase"].ToString();
            str17 = table2.Rows[0]["p_id"].ToString();
            time  = Convert.ToDateTime(table2.Rows[0]["stop_date"].ToString());
            num30 = 2;
            string str18 = base.BetReceiveEnd(num30.ToString());
            if (!string.IsNullOrEmpty(str18))
            {
                time = Convert.ToDateTime(table2.Rows[0]["play_open_date"].ToString()).AddSeconds((double)-int.Parse(str18));
            }
        }
        else
        {
            base.DeleteCreditLock(str);
            base.Response.Write("<script>alert('該獎期已經截止下注!');window.location=\"" + str7 + "\";</script>");
            base.Response.End();
            return;
        }
        string    str19  = "";
        string    str20  = "";
        double    num5   = 0.0;
        DataTable table3 = CallBLL.cz_users_bll.GetUserRate(str, 2).Tables[0];

        str19 = table3.Rows[0]["kc_kind"].ToString().Trim().ToUpper();
        str20 = table3.Rows[0]["su_type"].ToString().Trim();
        num5  = double.Parse(table3.Rows[0]["kc_usable_credit"].ToString().Trim());
        getUserModelInfo.set_kc_kind(str19.ToUpper());
        string str21 = "0";
        string str22 = "0";
        string str23 = "0";
        string str24 = "0";
        string str25 = "0";
        string str26 = "0";
        double num6  = 0.0;
        double num7  = 0.0;
        double num8  = 0.0;
        double num9  = 0.0;
        double num10 = 0.0;
        double num11 = 0.0;
        string str27 = "";
        string str28 = "";
        string str29 = "";
        string str30 = "";
        string str31 = "";

        string[]  strArray3 = str9.Split(new char[] { ',' });
        string[]  strArray4 = str10.Split(new char[] { ',' });
        string[]  strArray5 = str11.Split(new char[] { ',' });
        DataTable plDT      = CallBLL.cz_odds_pk10_bll.GetPlayOddsByID(str9).Tables[0];

        if (plDT.Rows.Count == 0)
        {
            base.DeleteCreditLock(str);
            base.Response.End();
        }
        else
        {
            DataTable table5 = CallBLL.cz_bet_kc_bll.GetSinglePhaseByBet(str16, str, num2.ToString(), str9, null).Tables[0];
            if ((plDT.Rows.Count == 0) || (plDT.Rows.Count != strArray3.Count <string>()))
            {
                base.DeleteCreditLock(str);
                base.Response.End();
            }
            else
            {
                double        num12 = 0.0;
                string        str32 = "";
                List <string> list  = new List <string>();
                List <string> list2 = new List <string>();
                int           num13 = 0;
                foreach (string str33 in strArray3)
                {
                    num6  = 0.0;
                    row   = plDT.Select(string.Format(" odds_id= {0} ", str33.Trim()))[0];
                    str32 = row["is_open"].ToString().Trim();
                    str28 = row["current_odds"].ToString().Trim();
                    str29 = row[str19 + "_diff"].ToString().Trim();
                    str27 = row["play_id"].ToString().Trim();
                    str30 = row["play_name"].ToString().Trim();
                    str31 = row["put_amount"].ToString().Trim();
                    num11 = double.Parse(row["allow_min_amount"].ToString().Trim());
                    num8  = double.Parse(row["allow_max_amount"].ToString().Trim());
                    num10 = double.Parse(row["allow_max_put_amount"].ToString().Trim());
                    if ((table5 != null) && (table5.Rows.Count > 0))
                    {
                        DataRow[] rowArray2 = table5.Select(string.Format(" odds_id = {0} ", str33.Trim()));
                        if (rowArray2.Count <DataRow>() > 0)
                        {
                            num6 = double.Parse(rowArray2[0]["sumbet"].ToString().Trim());
                        }
                    }
                    DataTable table6 = null;
                    if (FileCacheHelper.get_GetKCPutMoneyCache() == "1")
                    {
                        if (CacheHelper.GetCache("kc_drawback_FileCacheKey_pk10" + str27 + this.Session["user_name"].ToString()) == null)
                        {
                            table6 = CallBLL.cz_drawback_pk10_bll.GetDrawback(str27, str).Tables[0];
                        }
                        else
                        {
                            table6 = base.GetUserDrawback_pk10(rate, getUserModelInfo.get_kc_kind(), str27);
                        }
                    }
                    else if (CacheHelper.GetCache("kc_drawback_FileCacheKey_pk10" + this.Session["user_name"].ToString()) == null)
                    {
                        table6 = CallBLL.cz_drawback_pk10_bll.GetDrawback(str27, str).Tables[0];
                    }
                    else
                    {
                        table6 = base.GetUserDrawback_pk10(rate, getUserModelInfo.get_kc_kind());
                    }
                    DataRow[] rowArray3 = table6.Select(string.Format(" play_id={0} and u_name='{1}' ", str27, str));
                    num7 = double.Parse(rowArray3[0]["single_max_amount"].ToString().Trim());
                    double num14 = double.Parse(rowArray3[0]["single_min_amount"].ToString().Trim());
                    num9 = double.Parse(rowArray3[0]["single_phase_amount"].ToString().Trim());
                    if (num7 > num8)
                    {
                        num7 = num8;
                    }
                    if (num9 > num10)
                    {
                        num9 = num10;
                    }
                    if (num14 > num11)
                    {
                        num11 = num14;
                    }
                    if (str32 != "1")
                    {
                        base.DeleteCreditLock(str);
                        base.Response.Write("<script>alert('" + str30 + "【" + str31 + "】已經停止投注!!');$('#JeuValidate').val('" + base.get_JeuValidate() + "');</script>");
                        base.Response.End();
                    }
                    num12 = double.Parse(str28) + double.Parse(str29);
                    string pl = num12.ToString();
                    base.GetOdds_KC(2, str33, ref pl);
                    num12 = Convert.ToDouble(pl);
                    if (!(double.Parse(strArray4[num13]) == double.Parse(num12.ToString())))
                    {
                        list.Add(num13.ToString());
                        list2.Add(num12.ToString());
                    }
                    if (list.Count > 0)
                    {
                        base.DeleteCreditLock(str);
                        base.Response.Write("<script>alert('" + str30 + "【" + str31 + "】賠率已經由 " + strArray4[num13] + " 變為 " + num12.ToString() + " 請確認再投註!');$('#v_" + strArray[num13] + " ~ span.hong').text('" + num12.ToString() + "');$('#p_" + strArray[num13] + "').val('" + num12.ToString() + "');$('#JeuValidate').val('" + base.get_JeuValidate() + "');</script>");
                        base.Response.End();
                        return;
                    }
                    if (double.Parse(strArray5[num13]) > num7)
                    {
                        base.DeleteCreditLock(str);
                        base.Response.Write("<script>alert($(\"#v_" + strArray[num13] + "\").text()+' 下注金額超出單注最大金額!');$('#m_" + strArray[num13] + "').focus();$('#JeuValidate').val('" + base.get_JeuValidate() + "');</script>");
                        base.Response.End();
                        return;
                    }
                    if (double.Parse(strArray5[num13]) < num11)
                    {
                        base.DeleteCreditLock(str);
                        base.Response.Write("<script>alert($(\"#v_" + strArray[num13] + "\").text()+' 下注金額低過最低金額!');$('#m_" + strArray[num13] + "').focus();$('#JeuValidate').val('" + base.get_JeuValidate() + "');</script>");
                        base.Response.End();
                        return;
                    }
                    if (double.Parse(strArray5[num13]) > num5)
                    {
                        base.DeleteCreditLock(str);
                        base.Response.Write("<script>alert($(\"#v_" + strArray[num13] + "\").text()+' 下注金額超出可用金額!');$('#m_" + strArray[num13] + "').focus();$('#JeuValidate').val('" + base.get_JeuValidate() + "');</script>");
                        base.Response.End();
                        return;
                    }
                    if ((double.Parse(strArray5[num13]) + num6) > num9)
                    {
                        base.DeleteCreditLock(str);
                        base.Response.Write("<script>alert('" + str30 + "【" + str31 + "】下註單期金額超出單期最大金額!');</script>");
                        base.Response.End();
                        return;
                    }
                    num13++;
                }
                double num15 = 0.0;
                int    num16 = 0;
                foreach (string str35 in strArray3)
                {
                    num15 += double.Parse(strArray5[num16].ToString().Trim());
                    num16++;
                }
                if (num5 < num15)
                {
                    base.DeleteCreditLock(str);
                    base.Response.Write("<script>alert('可用餘額不足!');$('#JeuValidate').val('" + base.get_JeuValidate() + "');</script>");
                    base.Response.End();
                }
                else
                {
                    DataTable     dataTable      = null;
                    bool          flag2          = false;
                    List <string> successBetList = new List <string>();
                    DateTime?     nullable       = null;
                    num13 = 0;
                    foreach (string str33 in strArray3)
                    {
                        double num20;
                        if (FileCacheHelper.get_AddBetLockUType_KC().Equals("zj"))
                        {
                            num30 = 2;
                            base.Add_Bet_Lock(num30.ToString(), getUserModelInfo.get_zjname(), str33);
                        }
                        DataTable table8 = CallBLL.cz_odds_pk10_bll.GetOddsByID(str33).Tables[0];
                        int       num17  = int.Parse(table8.Rows[0]["play_id"].ToString());
                        string    str36  = table8.Rows[0]["play_name"].ToString();
                        string    str37  = table8.Rows[0]["put_amount"].ToString();
                        string    ratio  = table8.Rows[0]["ratio"].ToString();
                        if (FileCacheHelper.get_GetKCPutMoneyCache() == "1")
                        {
                            dataTable = base.GetUserDrawback_pk10(rate, getUserModelInfo.get_kc_kind(), num17.ToString());
                        }
                        else
                        {
                            dataTable = base.GetUserDrawback_pk10(rate, getUserModelInfo.get_kc_kind());
                        }
                        if (dataTable == null)
                        {
                            base.DeleteCreditLock(str);
                            if (FileCacheHelper.get_AddBetLockUType_KC().Equals("zj"))
                            {
                                num30 = 2;
                                base.Un_Bet_Lock(num30.ToString(), getUserModelInfo.get_zjname(), str33);
                            }
                            else
                            {
                                num30 = 2;
                                base.Un_Bet_Lock(num30.ToString(), rate.get_fgsname(), str33);
                            }
                            base.Response.Write("<script>alert('系統錯誤,請重試!');$('#JeuValidate').val('" + base.get_JeuValidate() + "');</script>");
                            base.Response.End();
                            return;
                        }
                        DataRow[] rowArray4 = dataTable.Select(string.Format(" play_id={0} ", num17));
                        foreach (DataRow row in rowArray4)
                        {
                            string str42 = row["u_type"].ToString().Trim();
                            if (str42 != null)
                            {
                                if (!(str42 == "zj"))
                                {
                                    if (str42 == "fgs")
                                    {
                                        goto Label_152D;
                                    }
                                    if (str42 == "gd")
                                    {
                                        goto Label_1551;
                                    }
                                    if (str42 == "zd")
                                    {
                                        goto Label_1575;
                                    }
                                    if (str42 == "dl")
                                    {
                                        goto Label_1599;
                                    }
                                    if (str42 == "hy")
                                    {
                                        goto Label_15BD;
                                    }
                                }
                                else
                                {
                                    str21 = row[str19 + "_drawback"].ToString().Trim();
                                }
                            }
                            continue;
Label_152D:
                            str22 = row[str19 + "_drawback"].ToString().Trim();
                            continue;
Label_1551:
                            str23 = row[str19 + "_drawback"].ToString().Trim();
                            continue;
Label_1575:
                            str24 = row[str19 + "_drawback"].ToString().Trim();
                            continue;
Label_1599:
                            str25 = row[str19 + "_drawback"].ToString().Trim();
                            continue;
Label_15BD:
                            if (getUserModelInfo.get_su_type() == "dl")
                            {
                                str26 = row[str19 + "_drawback"].ToString().Trim();
                            }
                            else if (getUserModelInfo.get_su_type() == "zd")
                            {
                                str25 = row[str19 + "_drawback"].ToString().Trim();
                                str26 = row[str19 + "_drawback"].ToString().Trim();
                            }
                            else if (getUserModelInfo.get_su_type() == "gd")
                            {
                                str24 = row[str19 + "_drawback"].ToString().Trim();
                                str26 = row[str19 + "_drawback"].ToString().Trim();
                            }
                            else if (getUserModelInfo.get_su_type() == "fgs")
                            {
                                str23 = row[str19 + "_drawback"].ToString().Trim();
                                str26 = row[str19 + "_drawback"].ToString().Trim();
                            }
                        }
                        double num18 = 0.0;
                        double num19 = 0.0;
                        if (rate.get_zcyg().Equals("1"))
                        {
                            num20 = (((100.0 - double.Parse(rate.get_fgszc())) - double.Parse(rate.get_gdzc())) - double.Parse(rate.get_zdzc())) - double.Parse(rate.get_dlzc());
                            num18 = num20;
                            num19 = double.Parse(rate.get_fgszc());
                        }
                        else
                        {
                            num20 = (((100.0 - double.Parse(rate.get_zjzc())) - double.Parse(rate.get_gdzc())) - double.Parse(rate.get_zdzc())) - double.Parse(rate.get_dlzc());
                            num19 = num20;
                            num18 = double.Parse(rate.get_zjzc());
                        }
                        if (DateTime.Now >= time.AddSeconds(0.0))
                        {
                            flag2 = true;
                            break;
                        }
                        if (!FileCacheHelper.get_AddBetLockUType_KC().Equals("zj"))
                        {
                            num30 = 2;
                            base.Add_Bet_Lock(num30.ToString(), rate.get_fgsname(), str33);
                        }
                        double num33 = double.Parse(table8.Rows[0]["current_odds"].ToString()) + Convert.ToDouble(table8.Rows[0][str19 + "_diff"].ToString().Trim());
                        string str39 = num33.ToString();
                        string str40 = str39.ToString();
                        base.GetOdds_KC(2, str33, ref str40);
                        double playDrawbackValue = base.GetPlayDrawbackValue(str22, ratio);
                        if ((playDrawbackValue != 0.0) && (double.Parse(str39) > playDrawbackValue))
                        {
                            base.DeleteCreditLock(str);
                            if (FileCacheHelper.get_AddBetLockUType_KC().Equals("zj"))
                            {
                                num30 = 2;
                                base.Un_Bet_Lock(num30.ToString(), getUserModelInfo.get_zjname(), str33);
                            }
                            else
                            {
                                num30 = 2;
                                base.Un_Bet_Lock(num30.ToString(), rate.get_fgsname(), str33);
                            }
                            base.Response.Write("<script>alert('賠率錯誤!');$('#JeuValidate').val('" + base.get_JeuValidate() + "');</script>");
                            base.Response.End();
                        }
                        if (!nullable.HasValue)
                        {
                            nullable = new DateTime?(DateTime.Now);
                        }
                        cz_bet_kc _kc = new cz_bet_kc();
                        _kc.set_order_num(Utils.GetOrderNumber());
                        _kc.set_checkcode(str12);
                        _kc.set_u_name(getUserModelInfo.get_u_name());
                        _kc.set_u_nicker(getUserModelInfo.get_u_nicker());
                        _kc.set_phase_id(new int?(int.Parse(str17)));
                        _kc.set_phase(str16);
                        _kc.set_bet_time(nullable);
                        _kc.set_odds_id(new int?(int.Parse(str33)));
                        _kc.set_category(table8.Rows[0]["category"].ToString());
                        _kc.set_play_id(new int?(int.Parse(table8.Rows[0]["play_id"].ToString())));
                        _kc.set_play_name(str36);
                        _kc.set_bet_val(str37);
                        _kc.set_odds(str40);
                        _kc.set_amount(new decimal?(decimal.Parse(strArray5[num13])));
                        _kc.set_profit(0);
                        _kc.set_hy_drawback(new decimal?(decimal.Parse(str26)));
                        _kc.set_dl_drawback(new decimal?(decimal.Parse(str25)));
                        _kc.set_zd_drawback(new decimal?(decimal.Parse(str24)));
                        _kc.set_gd_drawback(new decimal?(decimal.Parse(str23)));
                        _kc.set_fgs_drawback(new decimal?(decimal.Parse(str22)));
                        _kc.set_zj_drawback(new decimal?(decimal.Parse(str21)));
                        _kc.set_dl_rate((float)int.Parse(rate.get_dlzc()));
                        _kc.set_zd_rate((float)int.Parse(rate.get_zdzc()));
                        _kc.set_gd_rate((float)int.Parse(rate.get_gdzc()));
                        _kc.set_fgs_rate(float.Parse(num19.ToString()));
                        _kc.set_zj_rate(float.Parse(num18.ToString()));
                        _kc.set_dl_name(rate.get_dlname());
                        _kc.set_zd_name(rate.get_zdname());
                        _kc.set_gd_name(rate.get_gdname());
                        _kc.set_fgs_name(rate.get_fgsname());
                        _kc.set_is_payment(0);
                        _kc.set_m_type(new int?(num3));
                        _kc.set_kind(str19);
                        _kc.set_ip(LSRequest.GetIP());
                        _kc.set_lottery_type(new int?(num2));
                        _kc.set_lottery_name(base.GetGameNameByID(_kc.get_lottery_type().ToString()));
                        _kc.set_ordervalidcode(Utils.GetOrderValidCode(_kc.get_u_name(), _kc.get_order_num(), _kc.get_bet_val(), _kc.get_odds(), _kc.get_kind(), Convert.ToInt32(_kc.get_phase_id()), Convert.ToInt32(_kc.get_odds_id()), Convert.ToDouble(_kc.get_amount())));
                        _kc.set_odds_zj(str39);
                        _kc.set_isPhone(1);
                        int num22 = 0;
                        if (!CallBLL.cz_bet_kc_bll.AddBet(_kc, decimal.Parse(strArray5[num13]), str, ref num22) || (num22 <= 0))
                        {
                            base.DeleteCreditLock(str);
                            if (FileCacheHelper.get_AddBetLockUType_KC().Equals("zj"))
                            {
                                num30 = 2;
                                base.Un_Bet_Lock(num30.ToString(), getUserModelInfo.get_zjname(), str33);
                            }
                            else
                            {
                                num30 = 2;
                                base.Un_Bet_Lock(num30.ToString(), rate.get_fgsname(), str33);
                            }
                            base.Response.Write("<script>alert('系統錯誤,請重試!');$('#JeuValidate').val('" + base.get_JeuValidate() + "');</script>");
                            base.Response.End();
                            return;
                        }
                        successBetList.Add(string.Concat(new object[] { _kc.get_odds_id(), ",", _kc.get_order_num(), ",", _kc.get_play_name(), ",", _kc.get_bet_val(), ",", _kc.get_odds(), ",", _kc.get_amount() }));
                        double num23 = (double.Parse(strArray5[num13]) * num18) / 100.0;
                        CallBLL.cz_odds_pk10_bll.UpdateGrandTotal(Convert.ToDecimal(num23), int.Parse(str33));
                        double num24 = double.Parse(table8.Rows[0]["grand_total"].ToString()) + num23;
                        double num25 = double.Parse(table8.Rows[0]["downbase"].ToString());
                        double num26 = Math.Floor((double)(num24 / num25));
                        if ((num26 >= 1.0) && (num25 >= 1.0))
                        {
                            double        num27 = double.Parse(table8.Rows[0]["down_odds_rate"].ToString()) * num26;
                            int           num29 = CallBLL.cz_odds_pk10_bll.UpdateGrandTotalCurrentOdds(num27.ToString(), (num23 - (num25 * num26)).ToString(), str33);
                            cz_system_log _log  = new cz_system_log();
                            _log.set_user_name("系統");
                            _log.set_children_name("");
                            _log.set_category(table8.Rows[0]["category"].ToString());
                            _log.set_play_name(str36);
                            _log.set_put_amount(str37);
                            num30 = 2;
                            _log.set_l_name(base.GetGameNameByID(num30.ToString()));
                            _log.set_l_phase(str16);
                            _log.set_action("降賠率");
                            _log.set_odds_id(int.Parse(str33));
                            string str41 = table8.Rows[0]["current_odds"].ToString();
                            _log.set_old_val(str41);
                            num33 = double.Parse(str41) - num27;
                            _log.set_new_val(num33.ToString());
                            _log.set_ip(LSRequest.GetIP());
                            _log.set_add_time(DateTime.Now);
                            _log.set_note("系統自動降賠");
                            _log.set_type_id(Convert.ToInt32((LSEnums.LogTypeID) 0));
                            _log.set_lottery_type(2);
                            CallBLL.cz_system_log_bll.Add(_log);
                            cz_jp_odds _odds = new cz_jp_odds();
                            _odds.set_add_time(DateTime.Now);
                            _odds.set_odds_id(int.Parse(str33));
                            _odds.set_phase_id(int.Parse(str17));
                            _odds.set_play_name(str36);
                            _odds.set_put_amount(str37);
                            _odds.set_odds(num27.ToString());
                            _odds.set_lottery_type(2);
                            _odds.set_phase(str16);
                            _odds.set_old_odds(str41);
                            _odds.set_new_odds((double.Parse(str41) - num27).ToString());
                            CallBLL.cz_jp_odds_bll.Add(_odds);
                        }
                        DataTable fgsWTTable = null;
                        if (getUserModelInfo.get_kc_op_odds().Equals(1))
                        {
                            fgsWTTable = base.GetFgsWTTable(2);
                        }
                        CallBLL.cz_autosale_pk10_bll.DLAutoSale(_kc.get_order_num(), str12, getUserModelInfo.get_u_nicker(), getUserModelInfo.get_u_name(), str19, table8.Rows[0]["play_id"].ToString(), str33.Trim(), str21, str22, str23, str24, str25, str26, str17, str16, _kc.get_ip(), num2, _kc.get_lottery_name(), getUserModelInfo, rate, fgsWTTable);
                        if (getUserModelInfo.get_kc_op_odds().Equals(1))
                        {
                            fgsWTTable = base.GetFgsWTTable(2);
                        }
                        CallBLL.cz_autosale_pk10_bll.ZDAutoSale(_kc.get_order_num(), str12, getUserModelInfo.get_u_nicker(), getUserModelInfo.get_u_name(), str19, table8.Rows[0]["play_id"].ToString(), str33.Trim(), str21, str22, str23, str24, str25, str26, str17, str16, _kc.get_ip(), num2, _kc.get_lottery_name(), getUserModelInfo, rate, fgsWTTable);
                        if (getUserModelInfo.get_kc_op_odds().Equals(1))
                        {
                            fgsWTTable = base.GetFgsWTTable(2);
                        }
                        CallBLL.cz_autosale_pk10_bll.GDAutoSale(_kc.get_order_num(), str12, getUserModelInfo.get_u_nicker(), getUserModelInfo.get_u_name(), str19, table8.Rows[0]["play_id"].ToString(), str33.Trim(), str21, str22, str23, str24, str25, str26, str17, str16, _kc.get_ip(), num2, _kc.get_lottery_name(), getUserModelInfo, rate, fgsWTTable);
                        if (getUserModelInfo.get_kc_op_odds().Equals(1))
                        {
                            fgsWTTable = base.GetFgsWTTable(2);
                        }
                        CallBLL.cz_autosale_pk10_bll.FGSAutoSale(_kc.get_order_num(), str12, getUserModelInfo.get_u_nicker(), getUserModelInfo.get_u_name(), str19, table8.Rows[0]["play_id"].ToString(), str33.Trim(), str21, str22, str23, str24, str25, str26, str17, str16, _kc.get_ip(), num2, _kc.get_lottery_name(), getUserModelInfo, rate, fgsWTTable);
                        if (FileCacheHelper.get_AddBetLockUType_KC().Equals("zj"))
                        {
                            num30 = 2;
                            base.Un_Bet_Lock(num30.ToString(), getUserModelInfo.get_zjname(), str33);
                        }
                        else
                        {
                            base.Un_Bet_Lock(2.ToString(), rate.get_fgsname(), str33);
                        }
                        num13++;
                        if (FileCacheHelper.get_GetKCPutMoneyCache() == "1")
                        {
                            base.SetUserDrawback_pk10(dataTable, num17.ToString());
                        }
                    }
                    base.SetUserRate_kc(rate);
                    if (FileCacheHelper.get_GetKCPutMoneyCache() != "1")
                    {
                        base.SetUserDrawback_pk10(dataTable);
                    }
                    getUserModelInfo.set_begin_kc("yes");
                    base.UserPutBetByPhone(plDT, successBetList, strArray3, strArray4, strArray5);
                    base.DeleteCreditLock(str);
                    base.Response.Write(string.Format("<script>window.location=\"tj_ok.aspx?lottery_type={0}&player_type={1}\";</script>", str4, str5));
                    base.Response.End();
                }
            }
        }
    }
Esempio n. 4
0
        private void user_login(HttpContext context, ref string strResult)
        {
            string       str    = "";
            string       str2   = "";
            string       str3   = "";
            string       str4   = "";
            ReturnResult result = new ReturnResult();
            Dictionary <string, object> dictionary = new Dictionary <string, object> {
                {
                    "type",
                    "user_login"
                }
            };
            string loginName    = LSRequest.qq("loginName").Trim().ToLower();
            string loginPwd     = LSRequest.qq("loginPwd").Trim();
            string ValidateCode = LSRequest.qq("ValidateCode").Trim();

            if (PageBase.is_ip_locked())
            {
                context.Session["lottery_session_img_code"] = null;
                result.set_success(400);
                result.set_tipinfo("由於輸入錯誤次數過多,您已被禁用,請稍後再試!");
                strResult = JsonHandle.ObjectToJson(result);
            }
            else if (string.IsNullOrEmpty(loginName) || string.IsNullOrEmpty(loginPwd))
            {
                context.Response.End();
            }
            else
            {
                DateTime time = new DateTime();
                string   retry_times;
                string   str10;
                string   str11;
                string   str14;
                DateTime?nullable;
                int      num2;
                DateTime?nullable3;
                DateTime time2;
                if (int.Parse(FileCacheHelper.get_GetLockedPasswordCount()) == 0)
                {
                    context.Session["lottery_session_img_code_display"] = 1;
                }
                if (context.Session["lottery_session_img_code_display"] == null)
                {
                    if (CallBLL.cz_user_psw_err_log_bll.IsExistUser(loginName))
                    {
//                        TODO 登录超时
//                        if (PageBase.IsErrTimesAbove(ref time, str5))
//                        {
//                            if (!PageBase.IsErrTimeout(time))
//                            {
//                                context.Session["lottery_session_img_code"] = null;
//                                result.set_success(400);
//                                result.set_tipinfo("");
//                                dictionary.Add("is_display_code", "1");
//                                result.set_data(dictionary);
//                                strResult = JsonHandle.ObjectToJson(result);
//                                context.Session["lottery_session_img_code_display"] = 1;
//                                return;
//                            }
//                            CallBLL.cz_user_psw_err_log_bll.ZeroErrTimes(str5);
//                            context.Session["lottery_session_img_code"] = null;
//                            context.Session["lottery_session_img_code_display"] = 0;
//                        }
//                        else
//                        {
//                            context.Session["lottery_session_img_code"] = null;
//                            context.Session["lottery_session_img_code_display"] = 0;
//                        }
                    }
                    else
                    {
                        context.Session["lottery_session_img_code"]         = null;
                        context.Session["lottery_session_img_code_display"] = 0;
                    }
                }
                if (context.Session["lottery_session_img_code_display"].ToString() == "0")
                {
                    if (string.IsNullOrEmpty(loginName) || string.IsNullOrEmpty(loginPwd))
                    {
                        context.Response.End();
                        return;
                    }
                }
                else
                {
                    if (string.IsNullOrEmpty(loginName) || string.IsNullOrEmpty(loginPwd))
                    {
                        context.Response.End();
                        return;
                    }
                    if (string.IsNullOrEmpty(ValidateCode))
                    {
                        context.Session["lottery_session_img_code"] = null;
                        result.set_success(400);
                        result.set_tipinfo("");
                        dictionary.Add("is_display_code", "1");
                        result.set_data(dictionary);
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session["lottery_session_img_code_display"] = 1;
                        return;
                    }
                    if (context.Session["lottery_session_img_code"] == null)
                    {
                        context.Response.End();
                        return;
                    }
                    if (context.Session["lottery_session_img_code"].ToString().ToLower() != ValidateCode.ToLower())
                    {
                        context.Session["lottery_session_img_code"] = null;
                        result.set_success(400);
                        result.set_tipinfo(PageBase.GetMessageByCache("u100001", "MessageHint"));
                        strResult = JsonHandle.ObjectToJson(result);
                        return;
                    }
                }
                cz_users       _users = CallBLL.cz_users_bll.AgentLogin(loginName.ToLower());
                cz_users_child _child = null;
                if (_users == null)
                {
                    _child = CallBLL.cz_users_child_bll.AgentLogin(loginName.ToLower());
                    if (_child != null)
                    {
                        retry_times = _child.get_retry_times().ToString();
                        if (!string.IsNullOrEmpty(retry_times) && (int.Parse(retry_times) > int.Parse(FileCacheHelper.get_GetLockedUserCount())))
                        {
                            if (!PageBase.IsLockedTimeout(loginName, "child"))
                            {
                                context.Session["lottery_session_img_code"] = null;
                                result.set_success(560);
                                result.set_tipinfo("您的帳號因密碼多次輸入錯誤被鎖死,請與管理員聯系!");
                                strResult = JsonHandle.ObjectToJson(result);
                                return;
                            }
                            PageBase.zero_retry_times_children(loginName);
                        }
                        str10 = _child.get_salt().Trim();
                        str11 = DESEncrypt.EncryptString(loginPwd, str10);
                        if (_child.get_u_psw() != str11)
                        {
                            context.Session["lottery_session_img_code"] = null;
                            PageBase.inc_retry_times_children(loginName);
                            PageBase.login_error_ip();
                            result.set_success(400);
                            result.set_tipinfo(PageBase.GetMessageByCache("u100003", "MessageHint"));
                            strResult = JsonHandle.ObjectToJson(result);
                            if (context.Session["lottery_session_img_code_display"].ToString() == "0")
                            {
                                if (CallBLL.cz_user_psw_err_log_bll.IsExistUser(loginName))
                                {
                                    CallBLL.cz_user_psw_err_log_bll.UpdateErrTimes(loginName);
                                }
                                else
                                {
                                    CallBLL.cz_user_psw_err_log_bll.AddUser(loginName);
                                }
                                if (PageBase.IsErrTimesAbove(ref time, loginName))
                                {
                                    context.Session["lottery_session_img_code"] = null;
                                    result.set_success(400);
                                    result.set_tipinfo(PageBase.GetMessageByCache("u100003", "MessageHint"));
                                    dictionary.Add("is_display_code", "1");
                                    result.set_data(dictionary);
                                    strResult = JsonHandle.ObjectToJson(result);
                                    context.Session["lottery_session_img_code_display"] = 1;
                                }
                            }
                            return;
                        }
                        str2   = _child.get_status().ToString();
                        str3   = PageBase.upper_user_status(_child.get_parent_u_name());
                        _users = CallBLL.cz_users_bll.AgentLogin(_child.get_parent_u_name());
                    }
                    else
                    {
                        context.Session["lottery_session_img_code"] = null;
                        PageBase.login_error_ip();
                        result.set_success(400);
                        result.set_tipinfo(PageBase.GetMessageByCache("u100002", "MessageHint"));
                        dictionary.Add("fs_name", "loginName");
                        strResult = JsonHandle.ObjectToJson(result);
                        return;
                    }
                    PageBase.zero_retry_times_children(loginName);
                }
                else
                {
                    retry_times = _users.get_retry_times().ToString();
                    if (!string.IsNullOrEmpty(retry_times) && (int.Parse(retry_times) > int.Parse(FileCacheHelper.get_GetLockedUserCount())))
                    {
                        if (!PageBase.IsLockedTimeout(loginName, "master"))
                        {
                            context.Session["lottery_session_img_code"] = null;
                            result.set_success(560);
                            result.set_tipinfo("您的帳號因密碼多次輸入錯誤被鎖死,請與管理員聯系!");
                            strResult = JsonHandle.ObjectToJson(result);
                            return;
                        }
                        PageBase.zero_retry_times(loginName);
                    }
                    str = _users.get_a_state().ToString();
                    string str12 = _users.get_a_state().ToString();
                    str4 = PageBase.upper_user_status(_users.get_u_name());
                    if (str12.Equals("2"))
                    {
                        context.Session["lottery_session_img_code"] = null;
                        result.set_success(400);
                        result.set_tipinfo(PageBase.GetMessageByCache("u100005", "MessageHint"));
                        dictionary.Add("fs_name", "loginName");
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session.Abandon();
                        return;
                    }
                    if (str4 == "2")
                    {
                        context.Session["lottery_session_img_code"] = null;
                        result.set_success(400);
                        result.set_tipinfo("您的上級帳號已被停用,请与管理员联系!");
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session.Abandon();
                        return;
                    }
                    str   = (str12 == null) ? "0" : str;
                    str10 = _users.get_salt().Trim();
                    str11 = DESEncrypt.EncryptString(loginPwd, str10);
                    if (_users.get_u_psw() != str11)
                    {
                        context.Session["lottery_session_img_code"] = null;
                        PageBase.inc_retry_times(loginName);
                        PageBase.login_error_ip();
                        result.set_success(400);
                        result.set_tipinfo(PageBase.GetMessageByCache("u100003", "MessageHint"));
                        strResult = JsonHandle.ObjectToJson(result);
                        if (context.Session["lottery_session_img_code_display"].ToString() == "0")
                        {
                            if (CallBLL.cz_user_psw_err_log_bll.IsExistUser(loginName))
                            {
                                CallBLL.cz_user_psw_err_log_bll.UpdateErrTimes(loginName);
                            }
                            else
                            {
                                CallBLL.cz_user_psw_err_log_bll.AddUser(loginName);
                            }
                            if (PageBase.IsErrTimesAbove(ref time, loginName))
                            {
                                context.Session["lottery_session_img_code"] = null;
                                result.set_success(400);
                                result.set_tipinfo(PageBase.GetMessageByCache("u100003", "MessageHint"));
                                dictionary.Add("is_display_code", "1");
                                result.set_data(dictionary);
                                strResult = JsonHandle.ObjectToJson(result);
                                context.Session["lottery_session_img_code_display"] = 1;
                            }
                        }
                        return;
                    }
                    PageBase.zero_retry_times(loginName);
                }
                if (!string.IsNullOrEmpty(str2))
                {
                    context.Session["user_name"]       = _users.get_u_name().Trim();
                    context.Session["user_type"]       = _users.get_u_type().Trim();
                    context.Session["child_user_name"] = _child.get_u_name().Trim();
                    context.Session["user_state"]      = str2.Trim();
                    if (str2.Equals("2"))
                    {
                        context.Session["lottery_session_img_code"] = null;
                        result.set_success(400);
                        result.set_tipinfo("您的帳號已被停用,请与管理员联系!");
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session.Abandon();
                        return;
                    }
                    if (_users.get_a_state() == 2)
                    {
                        context.Session["lottery_session_img_code"] = null;
                        result.set_success(400);
                        result.set_tipinfo("您的主帳號已被停用,请与管理员联系!");
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session.Abandon();
                        return;
                    }
                    if (str3 == "2")
                    {
                        context.Session["lottery_session_img_code"] = null;
                        result.set_success(400);
                        result.set_tipinfo("您的上級帳號已被停用,请与管理员联系!");
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session.Abandon();
                        return;
                    }
                    if (str2 == "1")
                    {
                        result.set_success(200);
                        result.set_tipinfo(PageBase.GetMessageByCache("u100004", "MessageHint"));
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session["user_state"] = str2;
                    }
                    else if (_users.get_a_state() == 1)
                    {
                        result.set_success(200);
                        result.set_tipinfo("您的主帳號已被凍結,请与管理员联系!");
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session["user_state"] = _users.get_a_state().ToString();
                    }
                    else if (str3 == "1")
                    {
                        result.set_success(200);
                        result.set_tipinfo(PageBase.GetMessageByCache("u100006", "MessageHint"));
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session["user_state"] = str3;
                    }
                    else
                    {
                        context.Session["user_state"] = "0";
                        result.set_success(200);
                        strResult = JsonHandle.ObjectToJson(result);
                    }
                }
                else
                {
                    context.Session["user_name"]  = _users.get_u_name().Trim();
                    context.Session["user_type"]  = _users.get_u_type().Trim();
                    context.Session["user_state"] = str.Trim();
                    if (str.Equals("1"))
                    {
                        result.set_success(200);
                        result.set_tipinfo(PageBase.GetMessageByCache("u100004", "MessageHint"));
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session["user_state"] = str;
                    }
                    else if (str4 == "1")
                    {
                        result.set_success(200);
                        result.set_tipinfo(PageBase.GetMessageByCache("u100006", "MessageHint"));
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session["user_state"] = str4;
                    }
                    else
                    {
                        context.Session["user_state"] = "0";
                        result.set_success(200);
                        strResult = JsonHandle.ObjectToJson(result);
                    }
                }
                agent_userinfo_session _session = new agent_userinfo_session();
                _session.set_u_id(_users.get_u_id());
                _session.set_u_name(_users.get_u_name().Trim());
                _session.set_u_psw(_users.get_u_psw().Trim());
                _session.set_u_nicker(_users.get_u_nicker().Trim());
                _session.set_u_skin(_users.get_u_skin().Trim());
                if (_child != null)
                {
                    if (string.IsNullOrEmpty(_child.get_u_skin()))
                    {
                        _session.set_u_skin("");
                    }
                    else
                    {
                        _session.set_u_skin(_child.get_u_skin());
                    }
                }
                _session.set_sup_name(_users.get_sup_name().Trim());
                _session.set_u_type(_users.get_u_type().Trim());
                _session.set_su_type(_users.get_su_type().Trim());
                _session.set_a_state(_users.get_a_state());
                _session.set_six_kind(_users.get_six_kind());
                _session.set_kc_kind(_users.get_kc_kind());
                _session.set_allow_sale(_users.get_allow_sale());
                _session.set_kc_allow_sale(_users.get_kc_allow_sale());
                _session.set_negative_sale(_users.get_negative_sale());
                if (!_users.get_allow_view_report().HasValue)
                {
                    _session.set_allow_view_report(0);
                }
                else
                {
                    _session.set_allow_view_report(_users.get_allow_view_report());
                }
                DataRow item = CallBLL.cz_admin_sysconfig_bll.GetItem();
                if (item == null)
                {
                    _session.set_u_skin("Blue");
                }
                else
                {
                    string str13 = item["agent_skin"].ToString();
                    if (string.IsNullOrEmpty(_session.get_u_skin()) || (str13.IndexOf(_session.get_u_skin()) < 0))
                    {
                        _session.set_u_skin(str13.Split(new char[] { '|' })[0]);
                    }
                }
                if (_child != null)
                {
                    _child.set_salt("");
                }
                _session.set_users_child_session(_child);
                DataTable zJInfo = CallBLL.cz_users_bll.GetZJInfo();
                if (zJInfo != null)
                {
                    _session.set_zjname(zJInfo.Rows[0]["u_name"].ToString().Trim());
                }
                if (!_session.get_u_type().ToLower().Equals("zj"))
                {
                    cz_rate_kc rateKCByUserName = CallBLL.cz_rate_kc_bll.GetRateKCByUserName(_session.get_u_name());
                    _session.set_fgs_name(rateKCByUserName.get_fgs_name());
                    _session.set_gd_name(rateKCByUserName.get_gd_name());
                    _session.set_zd_name(rateKCByUserName.get_zd_name());
                    _session.set_dl_name(rateKCByUserName.get_dl_name());
                    DataTable userOpOdds = CallBLL.cz_rate_kc_bll.GetUserOpOdds(_session.get_u_name());
                    if (userOpOdds != null)
                    {
                        if ((userOpOdds.Rows[0]["six_op_odds"] != null) && (userOpOdds.Rows[0]["six_op_odds"].ToString() != ""))
                        {
                            _session.set_six_op_odds(new int?(int.Parse(userOpOdds.Rows[0]["six_op_odds"].ToString())));
                        }
                        if ((userOpOdds.Rows[0]["kc_op_odds"] != null) && (userOpOdds.Rows[0]["kc_op_odds"].ToString() != ""))
                        {
                            _session.set_kc_op_odds(new int?(int.Parse(userOpOdds.Rows[0]["kc_op_odds"].ToString())));
                        }
                    }
                }
                context.Session["child_user_name"] = null;
                if (_child != null)
                {
                    context.Session["child_user_name"] = _child.get_u_name();
                }
                context.Session["user_name"] = _users.get_u_name();
                context.Session[_users.get_u_name() + "lottery_session_user_info"] = _session;
                PageBase.SetAppcationFlag(loginName);
                if (FileCacheHelper.get_RedisStatOnline().Equals(1) || FileCacheHelper.get_RedisStatOnline().Equals(2))
                {
                    bool flag4 = false;
                    if ((_session.get_users_child_session() != null) && _session.get_users_child_session().get_is_admin().Equals(1))
                    {
                        flag4 = true;
                    }
                    if (!flag4)
                    {
//                        if (FileCacheHelper.get_RedisStatOnline().Equals(1))
//                        {
//                            new PageBase_Redis().InitUserOnlineTopToRedis(str5, _session.get_u_type());
//                        }
//                        if (FileCacheHelper.get_RedisStatOnline().Equals(2))
//                        {
//                            new PageBase_Redis().InitUserOnlineTopToRedisStack(str5, _session.get_u_type());
//                        }
                    }
                }
                else
                {
                    MemberPageBase.stat_top_online(loginName);
                    MemberPageBase.stat_online(loginName, _session.get_u_type());
                }
                if (FileCacheHelper.get_RedisStatOnline() == 0)
                {
                    PageBase.ZeroIsOutFlag(loginName);
                }
                CallBLL.cz_user_psw_err_log_bll.ZeroErrTimes(loginName);
                cz_login_log _log = new cz_login_log();
                _log.set_ip(LSRequest.GetIP());
                _log.set_login_time(new DateTime?(DateTime.Now));
                _log.set_u_name(loginName);
                PageBase base2 = new PageBase();
//                _log.set_browser_type(Utils.GetBrowserInfo(HttpContext.Current));
                bool flag5 = CallBLL.cz_login_log_bll.Add(_log);
                if (_child == null)
                {
                    str14 = _users.get_is_changed().ToString();
                    if (string.IsNullOrEmpty(str14))
                    {
                        result.set_success(550);
                        result.set_tipinfo("新密碼首次登錄,需重置密碼!");
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session["modifypassword"] = "******";
                    }
                    else if (str14 == "0")
                    {
                        result.set_success(550);
                        result.set_tipinfo("新密碼首次登錄,需重置密碼!");
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session["modifypassword"] = "******";
                    }
                    else
                    {
                        nullable  = _users.get_last_changedate();
                        num2      = PageBase.PasswordExpire();
                        nullable3 = nullable;
                        time2     = DateTime.Now.AddDays((double)-num2);
                        if (nullable3.HasValue ? (nullable3.GetValueOrDefault() < time2) : false)
                        {
                            result.set_success(550);
                            result.set_tipinfo("密碼過期,需重置密碼!");
                            strResult = JsonHandle.ObjectToJson(result);
                            context.Session["modifypassword"] = "******";
                        }
                    }
                }
                else
                {
                    str14 = _child.get_is_changed().ToString();
                    if (string.IsNullOrEmpty(str14))
                    {
                        result.set_success(550);
                        result.set_tipinfo("新密碼首次登錄,需重置密碼!");
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session["modifypassword"] = "******";
                    }
                    else if (str14 == "0")
                    {
                        result.set_success(550);
                        result.set_tipinfo("新密碼首次登錄,需重置密碼!");
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session["modifypassword"] = "******";
                    }
                    else
                    {
                        nullable = _child.get_last_changedate();
                        num2     = PageBase.PasswordExpire();
                        if (nullable.HasValue && ((nullable3 = nullable).HasValue ? (nullable3.GetValueOrDefault() < (time2 = DateTime.Now.AddDays((double)-num2))) : false))
                        {
                            result.set_success(550);
                            result.set_tipinfo("密碼過期,需重置密碼!");
                            strResult = JsonHandle.ObjectToJson(result);
                            context.Session["modifypassword"] = "******";
                        }
                    }
                }
            }
        }
Esempio n. 5
0
        private void AddPhase(cz_phase_six phaseModel)
        {
            DataSet playByOddsSet = CallBLL.cz_play_six_bll.GetPlayByOddsSet("91025,91026,91027,91028,91029");

            if (((playByOddsSet != null) && (playByOddsSet.Tables.Count > 0)) && (playByOddsSet.Tables[0].Rows.Count > 0))
            {
                DataTable table = playByOddsSet.Tables[0];
                foreach (DataRow row in table.Rows)
                {
                    int         num;
                    cz_play_six _six = new cz_play_six();
                    string      str  = row["play_id"].ToString();
                    string      str2 = row["default_odds"].ToString();
                    string      str3 = row["max_odds"].ToString();
                    string      str4 = row["min_odds"].ToString();
                    row["a_diff"].ToString();
                    string str5 = row["b_diff"].ToString();
                    string str6 = row["c_diff"].ToString();
                    _six.set_play_id(Convert.ToInt32(str));
                    _six.set_default_odds(str2);
                    _six.set_max_odds(str3);
                    _six.set_min_odds(str4);
                    _six.set_b_diff(str5);
                    _six.set_c_diff(str6);
                    if (CallBLL.cz_bet_six_bll.GetIspayment() > 0)
                    {
                        num = 1;
                    }
                    else
                    {
                        num = 0;
                    }
                    try
                    {
                        if (_six.get_play_id().Equals(0x16385))
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_SB(_six, num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x16382))
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_ZT(_six, "91010,91025,91026,91027,91028,91029", num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x1637e))
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_TMSX(_six, base.get_YearLian(), num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x1637f))
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_TMSB(_six, num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x1638d))
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_SXWS(_six, "sx", base.get_YearLian(), num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x1638e))
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_SXWS(_six, "ws", "0", num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x163ae))
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_SXWS(_six, "sx", base.get_YearLian(), num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x163af))
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_SXWS(_six, "ws", "0", num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x16380))
                        {
                            string[]    strArray  = _six.get_default_odds().Split(new char[] { '|' });
                            string[]    strArray2 = _six.get_max_odds().Split(new char[] { '|' });
                            string[]    strArray3 = _six.get_min_odds().Split(new char[] { '|' });
                            string[]    strArray4 = _six.get_b_diff().Split(new char[] { '|' });
                            string[]    strArray5 = _six.get_c_diff().Split(new char[] { '|' });
                            cz_odds_six _six2     = new cz_odds_six();
                            _six2.set_play_id(new int?(_six.get_play_id()));
                            _six2.set_play_name("半波【單雙】");
                            _six2.set_put_amount("紅波單");
                            _six2.set_current_odds(strArray[0]);
                            _six2.set_max_odds(strArray2[0]);
                            _six2.set_min_odds(strArray3[0]);
                            _six2.set_b_diff(strArray4[0]);
                            _six2.set_c_diff(strArray5[0]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six2, num.ToString());
                            cz_odds_six _six3 = new cz_odds_six();
                            _six3.set_play_id(new int?(_six.get_play_id()));
                            _six3.set_play_name("半波【單雙】");
                            _six3.set_put_amount("紅波雙");
                            _six3.set_current_odds(strArray[1]);
                            _six3.set_max_odds(strArray2[1]);
                            _six3.set_min_odds(strArray3[1]);
                            _six3.set_b_diff(strArray4[1]);
                            _six3.set_c_diff(strArray5[1]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six3, num.ToString());
                            cz_odds_six _six4 = new cz_odds_six();
                            _six4.set_play_id(new int?(_six.get_play_id()));
                            _six4.set_play_name("半波【單雙】");
                            _six4.set_put_amount("藍波單");
                            _six4.set_current_odds(strArray[2]);
                            _six4.set_max_odds(strArray2[2]);
                            _six4.set_min_odds(strArray3[2]);
                            _six4.set_b_diff(strArray4[2]);
                            _six4.set_c_diff(strArray5[2]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six4, num.ToString());
                            cz_odds_six _six5 = new cz_odds_six();
                            _six5.set_play_id(new int?(_six.get_play_id()));
                            _six5.set_play_name("半波【單雙】");
                            _six5.set_put_amount("藍波雙");
                            _six5.set_current_odds(strArray[3]);
                            _six5.set_max_odds(strArray2[3]);
                            _six5.set_min_odds(strArray3[3]);
                            _six5.set_b_diff(strArray4[3]);
                            _six5.set_c_diff(strArray5[3]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six5, num.ToString());
                            cz_odds_six _six6 = new cz_odds_six();
                            _six6.set_play_id(new int?(_six.get_play_id()));
                            _six6.set_play_name("半波【單雙】");
                            _six6.set_put_amount("綠波單");
                            _six6.set_current_odds(strArray[4]);
                            _six6.set_max_odds(strArray2[4]);
                            _six6.set_min_odds(strArray3[4]);
                            _six6.set_b_diff(strArray4[4]);
                            _six6.set_c_diff(strArray5[4]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six6, num.ToString());
                            cz_odds_six _six7 = new cz_odds_six();
                            _six7.set_play_id(new int?(_six.get_play_id()));
                            _six7.set_play_name("半波【單雙】");
                            _six7.set_put_amount("綠波雙");
                            _six7.set_current_odds(strArray[5]);
                            _six7.set_max_odds(strArray2[5]);
                            _six7.set_min_odds(strArray3[5]);
                            _six7.set_b_diff(strArray4[5]);
                            _six7.set_c_diff(strArray5[5]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six7, num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x163b1))
                        {
                            string[]    strArray6  = _six.get_default_odds().Split(new char[] { '|' });
                            string[]    strArray7  = _six.get_max_odds().Split(new char[] { '|' });
                            string[]    strArray8  = _six.get_min_odds().Split(new char[] { '|' });
                            string[]    strArray9  = _six.get_b_diff().Split(new char[] { '|' });
                            string[]    strArray10 = _six.get_c_diff().Split(new char[] { '|' });
                            cz_odds_six _six8      = new cz_odds_six();
                            _six8.set_play_id(new int?(_six.get_play_id()));
                            _six8.set_play_name("半波【大小】");
                            _six8.set_put_amount("紅波大");
                            _six8.set_current_odds(strArray6[0]);
                            _six8.set_max_odds(strArray7[0]);
                            _six8.set_min_odds(strArray8[0]);
                            _six8.set_b_diff(strArray9[0]);
                            _six8.set_c_diff(strArray10[0]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six8, num.ToString());
                            cz_odds_six _six9 = new cz_odds_six();
                            _six9.set_play_id(new int?(_six.get_play_id()));
                            _six9.set_play_name("半波【大小】");
                            _six9.set_put_amount("紅波小");
                            _six9.set_current_odds(strArray6[1]);
                            _six9.set_max_odds(strArray7[1]);
                            _six9.set_min_odds(strArray8[1]);
                            _six9.set_b_diff(strArray9[1]);
                            _six9.set_c_diff(strArray10[1]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six9, num.ToString());
                            cz_odds_six _six10 = new cz_odds_six();
                            _six10.set_play_id(new int?(_six.get_play_id()));
                            _six10.set_play_name("半波【大小】");
                            _six10.set_put_amount("藍波大");
                            _six10.set_current_odds(strArray6[2]);
                            _six10.set_max_odds(strArray7[2]);
                            _six10.set_min_odds(strArray8[2]);
                            _six10.set_b_diff(strArray9[2]);
                            _six10.set_c_diff(strArray10[2]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six10, num.ToString());
                            cz_odds_six _six11 = new cz_odds_six();
                            _six11.set_play_id(new int?(_six.get_play_id()));
                            _six11.set_play_name("半波【大小】");
                            _six11.set_put_amount("藍波小");
                            _six11.set_current_odds(strArray6[3]);
                            _six11.set_max_odds(strArray7[3]);
                            _six11.set_min_odds(strArray8[3]);
                            _six11.set_b_diff(strArray9[3]);
                            _six11.set_c_diff(strArray10[3]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six11, num.ToString());
                            cz_odds_six _six12 = new cz_odds_six();
                            _six12.set_play_id(new int?(_six.get_play_id()));
                            _six12.set_play_name("半波【大小】");
                            _six12.set_put_amount("綠波大");
                            _six12.set_current_odds(strArray6[4]);
                            _six12.set_max_odds(strArray7[4]);
                            _six12.set_min_odds(strArray8[4]);
                            _six12.set_b_diff(strArray9[4]);
                            _six12.set_c_diff(strArray10[4]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six12, num.ToString());
                            cz_odds_six _six13 = new cz_odds_six();
                            _six13.set_play_id(new int?(_six.get_play_id()));
                            _six13.set_play_name("半波【大小】");
                            _six13.set_put_amount("綠波小");
                            _six13.set_current_odds(strArray6[5]);
                            _six13.set_max_odds(strArray7[5]);
                            _six13.set_min_odds(strArray8[5]);
                            _six13.set_b_diff(strArray9[5]);
                            _six13.set_c_diff(strArray10[5]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_BB(_six13, num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x163ac))
                        {
                            string[]    strArray11 = _six.get_default_odds().Split(new char[] { '|' });
                            string[]    strArray12 = _six.get_max_odds().Split(new char[] { '|' });
                            string[]    strArray13 = _six.get_min_odds().Split(new char[] { '|' });
                            string[]    strArray14 = _six.get_b_diff().Split(new char[] { '|' });
                            string[]    strArray15 = _six.get_c_diff().Split(new char[] { '|' });
                            cz_odds_six _six14     = new cz_odds_six();
                            _six14.set_play_id(new int?(_six.get_play_id()));
                            _six14.set_play_name("七碼單雙");
                            _six14.set_put_amount("單0、雙7");
                            _six14.set_current_odds(strArray11[0]);
                            _six14.set_max_odds(strArray12[0]);
                            _six14.set_min_odds(strArray13[0]);
                            _six14.set_b_diff(strArray14[0]);
                            _six14.set_c_diff(strArray15[0]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six14, num.ToString());
                            _six14.set_play_id(new int?(_six.get_play_id()));
                            _six14.set_play_name("七碼單雙");
                            _six14.set_put_amount("單1、雙6");
                            _six14.set_current_odds(strArray11[1]);
                            _six14.set_max_odds(strArray12[1]);
                            _six14.set_min_odds(strArray13[1]);
                            _six14.set_b_diff(strArray14[1]);
                            _six14.set_c_diff(strArray15[1]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six14, num.ToString());
                            _six14.set_play_id(new int?(_six.get_play_id()));
                            _six14.set_play_name("七碼單雙");
                            _six14.set_put_amount("單2、雙5");
                            _six14.set_current_odds(strArray11[2]);
                            _six14.set_max_odds(strArray12[2]);
                            _six14.set_min_odds(strArray13[2]);
                            _six14.set_b_diff(strArray14[2]);
                            _six14.set_c_diff(strArray15[2]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six14, num.ToString());
                            _six14.set_play_id(new int?(_six.get_play_id()));
                            _six14.set_play_name("七碼單雙");
                            _six14.set_put_amount("單3、雙4");
                            _six14.set_current_odds(strArray11[3]);
                            _six14.set_max_odds(strArray12[3]);
                            _six14.set_min_odds(strArray13[3]);
                            _six14.set_b_diff(strArray14[3]);
                            _six14.set_c_diff(strArray15[3]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six14, num.ToString());
                            _six14.set_play_id(new int?(_six.get_play_id()));
                            _six14.set_play_name("七碼單雙");
                            _six14.set_put_amount("單4、雙3");
                            _six14.set_current_odds(strArray11[4]);
                            _six14.set_max_odds(strArray12[4]);
                            _six14.set_min_odds(strArray13[4]);
                            _six14.set_b_diff(strArray14[4]);
                            _six14.set_c_diff(strArray15[4]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six14, num.ToString());
                            _six14.set_play_id(new int?(_six.get_play_id()));
                            _six14.set_play_name("七碼單雙");
                            _six14.set_put_amount("單5、雙2");
                            _six14.set_current_odds(strArray11[5]);
                            _six14.set_max_odds(strArray12[5]);
                            _six14.set_min_odds(strArray13[5]);
                            _six14.set_b_diff(strArray14[5]);
                            _six14.set_c_diff(strArray15[5]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six14, num.ToString());
                            _six14.set_play_id(new int?(_six.get_play_id()));
                            _six14.set_play_name("七碼單雙");
                            _six14.set_put_amount("單6、雙1");
                            _six14.set_current_odds(strArray11[6]);
                            _six14.set_max_odds(strArray12[6]);
                            _six14.set_min_odds(strArray13[6]);
                            _six14.set_b_diff(strArray14[6]);
                            _six14.set_c_diff(strArray15[6]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six14, num.ToString());
                            _six14.set_play_id(new int?(_six.get_play_id()));
                            _six14.set_play_name("七碼單雙");
                            _six14.set_put_amount("單7、雙0");
                            _six14.set_current_odds(strArray11[7]);
                            _six14.set_max_odds(strArray12[7]);
                            _six14.set_min_odds(strArray13[7]);
                            _six14.set_b_diff(strArray14[7]);
                            _six14.set_c_diff(strArray15[7]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six14, num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x163b0))
                        {
                            string[]    strArray16 = _six.get_default_odds().Split(new char[] { '|' });
                            string[]    strArray17 = _six.get_max_odds().Split(new char[] { '|' });
                            string[]    strArray18 = _six.get_min_odds().Split(new char[] { '|' });
                            string[]    strArray19 = _six.get_b_diff().Split(new char[] { '|' });
                            string[]    strArray20 = _six.get_c_diff().Split(new char[] { '|' });
                            cz_odds_six _six15     = new cz_odds_six();
                            _six15.set_play_id(new int?(_six.get_play_id()));
                            _six15.set_play_name("七碼大小");
                            _six15.set_put_amount("大0、小7");
                            _six15.set_current_odds(strArray16[0]);
                            _six15.set_max_odds(strArray17[0]);
                            _six15.set_min_odds(strArray18[0]);
                            _six15.set_b_diff(strArray19[0]);
                            _six15.set_c_diff(strArray20[0]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six15, num.ToString());
                            _six15.set_play_id(new int?(_six.get_play_id()));
                            _six15.set_play_name("七碼大小");
                            _six15.set_put_amount("大1、小6");
                            _six15.set_current_odds(strArray16[1]);
                            _six15.set_max_odds(strArray17[1]);
                            _six15.set_min_odds(strArray18[1]);
                            _six15.set_b_diff(strArray19[1]);
                            _six15.set_c_diff(strArray20[1]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six15, num.ToString());
                            _six15.set_play_id(new int?(_six.get_play_id()));
                            _six15.set_play_name("七碼大小");
                            _six15.set_put_amount("大2、小5");
                            _six15.set_current_odds(strArray16[2]);
                            _six15.set_max_odds(strArray17[2]);
                            _six15.set_min_odds(strArray18[2]);
                            _six15.set_b_diff(strArray19[2]);
                            _six15.set_c_diff(strArray20[2]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six15, num.ToString());
                            _six15.set_play_id(new int?(_six.get_play_id()));
                            _six15.set_play_name("七碼大小");
                            _six15.set_put_amount("大3、小4");
                            _six15.set_current_odds(strArray16[3]);
                            _six15.set_max_odds(strArray17[3]);
                            _six15.set_min_odds(strArray18[3]);
                            _six15.set_b_diff(strArray19[3]);
                            _six15.set_c_diff(strArray20[3]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six15, num.ToString());
                            _six15.set_play_id(new int?(_six.get_play_id()));
                            _six15.set_play_name("七碼大小");
                            _six15.set_put_amount("大4、小3");
                            _six15.set_current_odds(strArray16[4]);
                            _six15.set_max_odds(strArray17[4]);
                            _six15.set_min_odds(strArray18[4]);
                            _six15.set_b_diff(strArray19[4]);
                            _six15.set_c_diff(strArray20[4]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six15, num.ToString());
                            _six15.set_play_id(new int?(_six.get_play_id()));
                            _six15.set_play_name("七碼大小");
                            _six15.set_put_amount("大5、小2");
                            _six15.set_current_odds(strArray16[5]);
                            _six15.set_max_odds(strArray17[5]);
                            _six15.set_min_odds(strArray18[5]);
                            _six15.set_b_diff(strArray19[5]);
                            _six15.set_c_diff(strArray20[5]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six15, num.ToString());
                            _six15.set_play_id(new int?(_six.get_play_id()));
                            _six15.set_play_name("七碼大小");
                            _six15.set_put_amount("大6、小1");
                            _six15.set_current_odds(strArray16[6]);
                            _six15.set_max_odds(strArray17[6]);
                            _six15.set_min_odds(strArray18[6]);
                            _six15.set_b_diff(strArray19[6]);
                            _six15.set_c_diff(strArray20[6]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six15, num.ToString());
                            _six15.set_play_id(new int?(_six.get_play_id()));
                            _six15.set_play_name("七碼大小");
                            _six15.set_put_amount("大7、小0");
                            _six15.set_current_odds(strArray16[7]);
                            _six15.set_max_odds(strArray17[7]);
                            _six15.set_min_odds(strArray18[7]);
                            _six15.set_b_diff(strArray19[7]);
                            _six15.set_c_diff(strArray20[7]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_QM(_six15, num.ToString());
                        }
                        else if (_six.get_play_id().Equals(0x163ad))
                        {
                            string[]    strArray21 = _six.get_default_odds().Split(new char[] { '|' });
                            string[]    strArray22 = _six.get_max_odds().Split(new char[] { '|' });
                            string[]    strArray23 = _six.get_min_odds().Split(new char[] { '|' });
                            string[]    strArray24 = _six.get_b_diff().Split(new char[] { '|' });
                            string[]    strArray25 = _six.get_c_diff().Split(new char[] { '|' });
                            cz_odds_six _six16     = new cz_odds_six();
                            _six16.set_play_id(new int?(_six.get_play_id()));
                            _six16.set_play_name("五行");
                            _six16.set_put_amount("金");
                            _six16.set_current_odds(strArray21[0]);
                            _six16.set_max_odds(strArray22[0]);
                            _six16.set_min_odds(strArray23[0]);
                            _six16.set_b_diff(strArray24[0]);
                            _six16.set_c_diff(strArray25[0]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_WX(_six16, num.ToString());
                            _six16.set_play_id(new int?(_six.get_play_id()));
                            _six16.set_play_name("五行");
                            _six16.set_put_amount("木");
                            _six16.set_current_odds(strArray21[1]);
                            _six16.set_max_odds(strArray22[1]);
                            _six16.set_min_odds(strArray23[1]);
                            _six16.set_b_diff(strArray24[1]);
                            _six16.set_c_diff(strArray25[1]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_WX(_six16, num.ToString());
                            _six16.set_play_id(new int?(_six.get_play_id()));
                            _six16.set_play_name("五行");
                            _six16.set_put_amount("水");
                            _six16.set_current_odds(strArray21[2]);
                            _six16.set_max_odds(strArray22[2]);
                            _six16.set_min_odds(strArray23[2]);
                            _six16.set_b_diff(strArray24[2]);
                            _six16.set_c_diff(strArray25[2]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_WX(_six16, num.ToString());
                            _six16.set_play_id(new int?(_six.get_play_id()));
                            _six16.set_play_name("五行");
                            _six16.set_put_amount("火");
                            _six16.set_current_odds(strArray21[3]);
                            _six16.set_max_odds(strArray22[3]);
                            _six16.set_min_odds(strArray23[3]);
                            _six16.set_b_diff(strArray24[3]);
                            _six16.set_c_diff(strArray25[3]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_WX(_six16, num.ToString());
                            _six16.set_play_id(new int?(_six.get_play_id()));
                            _six16.set_play_name("五行");
                            _six16.set_put_amount("土");
                            _six16.set_current_odds(strArray21[4]);
                            _six16.set_max_odds(strArray22[4]);
                            _six16.set_min_odds(strArray23[4]);
                            _six16.set_b_diff(strArray24[4]);
                            _six16.set_c_diff(strArray25[4]);
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet_WX(_six16, num.ToString());
                        }
                        else
                        {
                            CallBLL.cz_odds_six_bll.SetOddsByOddsSet(_six, num.ToString());
                        }
                    }
                    catch (Exception)
                    {
                        base.Response.Write(base.ShowDialogBox("添加獎期錯誤!", "", 2));
                        base.Response.End();
                    }
                }
                if (CallBLL.cz_phase_six_bll.AddPhase(phaseModel) > 0)
                {
                    cz_lotteryopen_log _log = new cz_lotteryopen_log();
                    string             str7 = null;
                    if (this.userModel.get_users_child_session() != null)
                    {
                        str7 = this.userModel.get_users_child_session().get_u_name();
                    }
                    string str8 = "";
                    string str9 = ((("本期編號: " + phaseModel.get_phase()) + "<br />開獎時間: " + Convert.ToDateTime(phaseModel.get_open_date()).ToString("yyyy-MM-dd HH:mm:ss")) + "<br />截止投注時間: " + Convert.ToDateTime(phaseModel.get_stop_date()).ToString("yyyy-MM-dd HH:mm:ss")) + "<br />特碼投注截止: " + Convert.ToDateTime(phaseModel.get_sn_stop_date()).ToString("yyyy-MM-dd HH:mm:ss");
                    _log.set_phase_id(CallBLL.cz_phase_six_bll.GetModelByPhase(phaseModel.get_phase()).get_p_id());
                    _log.set_phase(phaseModel.get_phase());
                    _log.set_u_name(this.userModel.get_u_name());
                    _log.set_children_name(str7);
                    _log.set_action("新增獎期");
                    _log.set_old_val(str8);
                    _log.set_new_val(str9);
                    _log.set_ip(LSRequest.GetIP());
                    _log.set_add_time(DateTime.Now);
                    _log.set_note(string.Format("【本期編號:{0}】新增獎期", _log.get_phase()));
                    _log.set_type_id(0);
                    _log.set_lottery_id(100);
                    CallBLL.cz_lotteryopen_log_bll.Insert(_log);
                    CallBLL.cz_lm_number_amount_six_bll.ClearNumberAmount();
                    if (CallBLL.cz_system_set_six_bll.GetSystemSet(100).get_single_number_isdown().Equals(1))
                    {
                        CallBLL.cz_lm_number_amount_six_bll.SetWtValueAmount();
                    }
                    string url = "/LotteryPeriod/AwardPeriod.aspx?lid=" + 100;
                    FileCacheHelper.UpdateAudoJPFile();
                    base.Response.Write(base.ShowDialogBox("添加獎期成功!", url, 0));
                    base.Response.End();
                }
                else
                {
                    base.Response.Write(base.ShowDialogBox("添加獎期錯誤!", "", 400));
                    base.Response.End();
                }
            }
        }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string str = this.Session["user_name"].ToString();

            this.userModel = this.Session[str + "lottery_session_user_info"] as agent_userinfo_session;
            this.lotteryDT = base.GetLotteryList();
            if (base.GetLotteryMasterID(this.lotteryDT).Split(new char[] { ',' }).Length > 1)
            {
                this.bol_masterid = true;
            }
            if (!base.GetMasterLotteryIsOpen(this.lotteryDT, 1))
            {
                base.Response.End();
            }
            this.uid        = LSRequest.qq("uid");
            this.mlid       = LSRequest.qq("mlid");
            this.ispc       = LSRequest.qq("isPc");
            this.mlid       = 1.ToString();
            this.edit_model = CallBLL.cz_users_bll.GetUserInfoByUID(this.uid);
            if (!this.edit_model.get_six_iscash().Equals(int.Parse("1")))
            {
                base.Response.End();
            }
            base.Permission_Aspx_ZJ(this.userModel, "po_2_1");
            base.Permission_Aspx_DL(this.userModel, "po_6_1");
            if (this.edit_model.get_u_name().Equals(this.userModel.get_u_name()))
            {
                base.Response.Redirect("/MessagePage.aspx?code=u100057&url=&issuccess=1&isback=0&isopen=0");
                base.Response.End();
            }
            if (!base.IsUpperLowerLevels(this.edit_model.get_u_name(), this.userModel.get_u_type(), this.userModel.get_u_name()))
            {
                if (this.ispc.Equals("1"))
                {
                    base.Response.Redirect("/MessagePage.aspx?code=u100057&url=&issuccess=1&isback=0&isopen=1");
                    base.Response.End();
                }
                else
                {
                    base.Response.Redirect("/MessagePage.aspx?code=u100057&url=&issuccess=1&isback=0&isopen=0");
                    base.Response.End();
                }
            }
            this.up_edit_model = CallBLL.cz_users_bll.GetUserInfoByUName(this.edit_model.get_sup_name());
            string str3 = LSRequest.qq("hdn_recharge");
            string s    = LSRequest.qq("txt_recharge");

            if (str3.Equals("rhrg"))
            {
                this.Hy_SubmitCreditLock();
                cz_rate_kc rateKCByUserName = CallBLL.cz_rate_kc_bll.GetRateKCByUserName(this.edit_model.get_u_name());
                base.En_User_Lock(rateKCByUserName.get_fgs_name());
                this.up_edit_model = CallBLL.cz_users_bll.GetUserInfoByUName(this.edit_model.get_sup_name());
                if (!Utils.IsDouble(s))
                {
                    if (this.ispc.Equals("1"))
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        this.Hy_DeleteCreditLock();
                        base.Response.Write(base.ShowDialogBox("(⑥)充值格式不正確!", "", 400));
                        base.Response.End();
                    }
                    else
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        this.Hy_DeleteCreditLock();
                        base.Response.Write(string.Format("<script>alert('{0}');</script>", "(⑥)充值格式不正確!"));
                        base.Response.End();
                    }
                }
                if (double.Parse(s) < 1.0)
                {
                    if (this.ispc.Equals("1"))
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        this.Hy_DeleteCreditLock();
                        base.Response.Write(base.ShowDialogBox("(⑥)充值金額不能小於1!", "", 400));
                        base.Response.End();
                    }
                    else
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        this.Hy_DeleteCreditLock();
                        base.Response.Write(string.Format("<script>alert('{0}');</script>", "(⑥)充值金額不能小於1!"));
                        base.Response.End();
                    }
                }
                if (!this.up_edit_model.get_u_type().Equals("zj"))
                {
                    decimal num3 = decimal.Parse(s);
                    if (num3 > this.up_edit_model.get_six_usable_credit())
                    {
                        if (this.ispc.Equals("1"))
                        {
                            base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                            this.Hy_DeleteCreditLock();
                            base.Response.Write(base.ShowDialogBox("(⑥)充值金額不能大於 “上級可用餘額” !", "", 400));
                            base.Response.End();
                        }
                        else
                        {
                            base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                            this.Hy_DeleteCreditLock();
                            base.Response.Write(string.Format("<script>alert('{0}');</script>", "(⑥)充值金額不能大於 “上級可用餘額” !"));
                            base.Response.End();
                        }
                    }
                }
                string         random = Utils.GetRandom();
                cz_credit_flow _flow  = new cz_credit_flow();
                _flow.set_master_id(new int?(int.Parse(this.mlid)));
                _flow.set_credit_old(this.edit_model.get_six_usable_credit());
                decimal?nullable3 = this.edit_model.get_six_usable_credit();
                decimal num4      = decimal.Parse(s);
                _flow.set_credit_new(nullable3.HasValue ? new decimal?(nullable3.GetValueOrDefault() + num4) : null);
                _flow.set_credit_change(new decimal?(decimal.Parse(s)));
                _flow.set_u_name(this.edit_model.get_u_name());
                _flow.set_iscash(new int?(int.Parse("1")));
                _flow.set_operator_name(this.userModel.get_u_name());
                if (this.userModel.get_users_child_session() != null)
                {
                    _flow.set_operator_child_name(this.userModel.get_users_child_session().get_u_name());
                }
                _flow.set_operator_time(DateTime.Now);
                _flow.set_flag(0);
                _flow.set_checkcode(random);
                _flow.set_isphone(0);
                _flow.set_ip(LSRequest.GetIP());
                cz_credit_flow _flow2 = new cz_credit_flow();
                _flow2.set_master_id(new int?(int.Parse(this.mlid)));
                _flow2.set_credit_old(this.up_edit_model.get_six_usable_credit());
                decimal?nullable5 = this.up_edit_model.get_six_usable_credit();
                decimal num5      = decimal.Parse(s);
                _flow2.set_credit_new(nullable5.HasValue ? new decimal?(nullable5.GetValueOrDefault() - num5) : null);
                _flow2.set_credit_change(new decimal?(-decimal.Parse(s)));
                _flow2.set_u_name(this.up_edit_model.get_u_name());
                _flow2.set_iscash(new int?(int.Parse("1")));
                _flow2.set_operator_name(this.userModel.get_u_name());
                if (this.userModel.get_users_child_session() != null)
                {
                    _flow2.set_operator_child_name(this.userModel.get_users_child_session().get_u_name());
                }
                _flow2.set_operator_time(DateTime.Now);
                _flow2.set_flag(1);
                _flow2.set_checkcode(random);
                _flow2.set_note(this.edit_model.get_u_name());
                _flow2.set_isphone(0);
                _flow2.set_ip(LSRequest.GetIP());
                if (CallBLL.cz_users_bll.UserRecharge(this.up_edit_model.get_u_type(), this.up_edit_model.get_u_id(), this.edit_model.get_u_id(), double.Parse(s), _flow, _flow2) > 0)
                {
                    if (this.ispc.Equals("1"))
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        this.Hy_DeleteCreditLock();
                        base.Response.Write(base.ShowDialogBox("(⑥)充值成功!", base.UserReturnBackUrl, 3));
                        base.Response.End();
                    }
                    else
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        this.Hy_DeleteCreditLock();
                        base.Response.Write(string.Format("<script>alert('{0}');location.href='{1}';</script>", "(⑥)充值成功!", base.UserReturnBackUrl));
                        base.Response.End();
                    }
                }
                else if (this.ispc.Equals("1"))
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    this.Hy_DeleteCreditLock();
                    base.Response.Write(base.ShowDialogBox("(⑥)充值失敗!", "", 400));
                    base.Response.End();
                }
                else
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    this.Hy_DeleteCreditLock();
                    base.Response.Write(string.Format("<script>alert('{0}');</script>", "(⑥)充值失敗!"));
                    base.Response.End();
                }
            }
        }
Esempio n. 7
0
        private void userLogin(HttpContext context, ref string strResult)
        {
            DateTime?    nullable12;
            DateTime     time4;
            string       str    = "";
            string       str2   = "";
            string       str3   = "";
            string       str4   = "";
            ReturnResult result = new ReturnResult();
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("type", "user_login");
            string str5 = LSRequest.qq("loginName").Trim().ToLower();
            string str6 = LSRequest.qq("loginPwd").Trim();
            string str7 = LSRequest.qq("ValidateCode").Trim();

            if (PageBase.is_ip_locked())
            {
                context.Session["lottery_session_img_code"] = null;
                result.set_success(400);
                result.set_tipinfo("由於輸入錯誤次數過多,您已被禁用,請稍後再試!");
                strResult = JsonHandle.ObjectToJson(result);
                return;
            }
            if (string.IsNullOrEmpty(str5) || string.IsNullOrEmpty(str6))
            {
                context.Response.End();
                return;
            }
            if (int.Parse(FileCacheHelper.get_GetLockedPasswordCount()) == 0)
            {
                context.Session["lottery_session_img_code_display"] = 1;
            }
            if (context.Session["lottery_session_img_code_display"] == null)
            {
                if (CallBLL.cz_user_psw_err_log_bll.IsExistUser(str5))
                {
                    DateTime time;
                    if (PageBase.IsErrTimesAbove(ref time, str5))
                    {
                        if (!PageBase.IsErrTimeout(time))
                        {
                            context.Session["lottery_session_img_code"] = null;
                            result.set_success(400);
                            result.set_tipinfo("");
                            dictionary.Add("isDisplayCode", 1);
                            result.set_data(dictionary);
                            strResult = JsonHandle.ObjectToJson(result);
                            context.Session["lottery_session_img_code_display"] = 1;
                            return;
                        }
                        CallBLL.cz_user_psw_err_log_bll.ZeroErrTimes(str5);
                        context.Session["lottery_session_img_code"]         = null;
                        context.Session["lottery_session_img_code_display"] = 0;
                    }
                    else
                    {
                        context.Session["lottery_session_img_code"]         = null;
                        context.Session["lottery_session_img_code_display"] = 0;
                    }
                }
                else
                {
                    context.Session["lottery_session_img_code"]         = null;
                    context.Session["lottery_session_img_code_display"] = 0;
                }
            }
            if (context.Session["lottery_session_img_code_display"].ToString() == "0")
            {
                if (string.IsNullOrEmpty(str5) || string.IsNullOrEmpty(str6))
                {
                    context.Response.End();
                    return;
                }
            }
            else
            {
                if (string.IsNullOrEmpty(str5) || string.IsNullOrEmpty(str6))
                {
                    context.Response.End();
                    return;
                }
                if (string.IsNullOrEmpty(str7))
                {
                    context.Session["lottery_session_img_code"] = null;
                    result.set_success(410);
                    result.set_tipinfo(PageBase.GetMessageByCache("u100001", "MessageHint"));
                    dictionary.Add("isDisplayCode", 1);
                    result.set_data(dictionary);
                    strResult = JsonHandle.ObjectToJson(result);
                    context.Session["lottery_session_img_code_display"] = 1;
                    return;
                }
                if (context.Session["lottery_session_img_code"] == null)
                {
                    result.set_success(410);
                    result.set_tipinfo(PageBase.GetMessageByCache("u100001", "MessageHint"));
                    strResult = JsonHandle.ObjectToJson(result);
                    return;
                }
                if (context.Session["lottery_session_img_code"].ToString().ToLower() != str7.ToLower())
                {
                    context.Session["lottery_session_img_code"] = null;
                    result.set_success(410);
                    result.set_tipinfo(PageBase.GetMessageByCache("u100001", "MessageHint"));
                    strResult = JsonHandle.ObjectToJson(result);
                    return;
                }
            }
            cz_users       _users = CallBLL.cz_users_bll.AgentLogin(str5.ToLower());
            cz_users_child _child = null;

            if (_users == null)
            {
                _child = CallBLL.cz_users_child_bll.AgentLogin(str5.ToLower());
                if (_child != null)
                {
                    string str9 = _child.get_retry_times().ToString();
                    if (!string.IsNullOrEmpty(str9) && (int.Parse(str9) > int.Parse(FileCacheHelper.get_GetLockedUserCount())))
                    {
                        if (!PageBase.IsLockedTimeout(str5, "child"))
                        {
                            context.Session["lottery_session_img_code"] = null;
                            result.set_success(560);
                            result.set_tipinfo("您的帳號因密碼多次輸入錯誤被鎖死,請與管理員聯系!");
                            strResult = JsonHandle.ObjectToJson(result);
                            return;
                        }
                        PageBase.zero_retry_times_children(str5);
                    }
                    string str10 = _child.get_salt().Trim();
                    string str11 = DESEncrypt.EncryptString(str6, str10);
                    if (_child.get_u_psw() != str11)
                    {
                        context.Session["lottery_session_img_code"] = null;
                        PageBase.inc_retry_times_children(str5);
                        PageBase.login_error_ip();
                        result.set_success(400);
                        result.set_tipinfo(PageBase.GetMessageByCache("u100003", "MessageHint"));
                        strResult = JsonHandle.ObjectToJson(result);
                        if (context.Session["lottery_session_img_code_display"].ToString() == "0")
                        {
                            DateTime time2;
                            if (CallBLL.cz_user_psw_err_log_bll.IsExistUser(str5))
                            {
                                CallBLL.cz_user_psw_err_log_bll.UpdateErrTimes(str5);
                            }
                            else
                            {
                                CallBLL.cz_user_psw_err_log_bll.AddUser(str5);
                            }
                            if (PageBase.IsErrTimesAbove(ref time2, str5))
                            {
                                context.Session["lottery_session_img_code"] = null;
                                result.set_success(400);
                                result.set_tipinfo(PageBase.GetMessageByCache("u100003", "MessageHint"));
                                dictionary.Add("isDisplayCode", 1);
                                result.set_data(dictionary);
                                strResult = JsonHandle.ObjectToJson(result);
                                context.Session["lottery_session_img_code_display"] = 1;
                            }
                        }
                        return;
                    }
                    str2   = _child.get_status().ToString();
                    str3   = PageBase.upper_user_status(_child.get_parent_u_name());
                    _users = CallBLL.cz_users_bll.AgentLogin(_child.get_parent_u_name());
                }
                else
                {
                    context.Session["lottery_session_img_code"] = null;
                    PageBase.login_error_ip();
                    result.set_success(400);
                    result.set_tipinfo(PageBase.GetMessageByCache("u100002", "MessageHint"));
                    dictionary.Add("fs_name", "loginName");
                    strResult = JsonHandle.ObjectToJson(result);
                    return;
                }
                PageBase.zero_retry_times_children(str5);
            }
            else
            {
                string str12 = _users.get_retry_times().ToString();
                if (!string.IsNullOrEmpty(str12) && (int.Parse(str12) > int.Parse(FileCacheHelper.get_GetLockedUserCount())))
                {
                    if (!PageBase.IsLockedTimeout(str5, "master"))
                    {
                        context.Session["lottery_session_img_code"] = null;
                        result.set_success(400);
                        result.set_tipinfo("您的帳號因密碼多次輸入錯誤被鎖死,請與管理員聯系!");
                        strResult = JsonHandle.ObjectToJson(result);
                        return;
                    }
                    PageBase.zero_retry_times(str5);
                }
                str = _users.get_a_state().ToString();
                string str13 = _users.get_a_state().ToString();
                str4 = PageBase.upper_user_status(_users.get_u_name());
                if (str13.Equals("2"))
                {
                    context.Session["lottery_session_img_code"] = null;
                    result.set_success(400);
                    result.set_tipinfo(PageBase.GetMessageByCache("u100005", "MessageHint"));
                    dictionary.Add("fs_name", "loginName");
                    strResult = JsonHandle.ObjectToJson(result);
                    context.Session.Abandon();
                    return;
                }
                if (str4 == "2")
                {
                    context.Session["lottery_session_img_code"] = null;
                    result.set_success(400);
                    result.set_tipinfo("您的上級帳號已被停用,请与管理员联系!");
                    strResult = JsonHandle.ObjectToJson(result);
                    context.Session.Abandon();
                    return;
                }
                str = (str13 == null) ? "0" : str;
                string str14 = _users.get_salt().Trim();
                string str15 = DESEncrypt.EncryptString(str6, str14);
                if (_users.get_u_psw() != str15)
                {
                    context.Session["lottery_session_img_code"] = null;
                    PageBase.inc_retry_times(str5);
                    PageBase.login_error_ip();
                    result.set_success(400);
                    result.set_tipinfo(PageBase.GetMessageByCache("u100003", "MessageHint"));
                    strResult = JsonHandle.ObjectToJson(result);
                    if (context.Session["lottery_session_img_code_display"].ToString() == "0")
                    {
                        DateTime time3;
                        if (CallBLL.cz_user_psw_err_log_bll.IsExistUser(str5))
                        {
                            CallBLL.cz_user_psw_err_log_bll.UpdateErrTimes(str5);
                        }
                        else
                        {
                            CallBLL.cz_user_psw_err_log_bll.AddUser(str5);
                        }
                        if (PageBase.IsErrTimesAbove(ref time3, str5))
                        {
                            context.Session["lottery_session_img_code"] = null;
                            result.set_success(400);
                            result.set_tipinfo(PageBase.GetMessageByCache("u100003", "MessageHint"));
                            dictionary.Add("isDisplayCode", 1);
                            result.set_data(dictionary);
                            strResult = JsonHandle.ObjectToJson(result);
                            context.Session["lottery_session_img_code_display"] = 1;
                        }
                    }
                    return;
                }
                PageBase.zero_retry_times(str5);
            }
            if (!string.IsNullOrEmpty(str2))
            {
                context.Session["user_name"]       = _users.get_u_name().Trim();
                context.Session["user_type"]       = _users.get_u_type().Trim();
                context.Session["child_user_name"] = _child.get_u_name().Trim();
                context.Session["user_state"]      = str2.Trim();
                if (str2.Equals("2"))
                {
                    context.Session["lottery_session_img_code"] = null;
                    result.set_success(400);
                    result.set_tipinfo("您的帳號已被停用,请与管理员联系!");
                    strResult = JsonHandle.ObjectToJson(result);
                    context.Session.Abandon();
                    return;
                }
                if (_users.get_a_state() == 2)
                {
                    context.Session["lottery_session_img_code"] = null;
                    result.set_success(400);
                    result.set_tipinfo("您的主帳號已被停用,请与管理员联系!");
                    strResult = JsonHandle.ObjectToJson(result);
                    context.Session.Abandon();
                    return;
                }
                if (str3 == "2")
                {
                    context.Session["lottery_session_img_code"] = null;
                    result.set_success(400);
                    result.set_tipinfo("您的上級帳號已被停用,请与管理员联系!");
                    strResult = JsonHandle.ObjectToJson(result);
                    context.Session.Abandon();
                    return;
                }
                if (str2 == "1")
                {
                    result.set_success(200);
                    result.set_tipinfo(PageBase.GetMessageByCache("u100004", "MessageHint"));
                    strResult = JsonHandle.ObjectToJson(result);
                    context.Session["user_state"] = str2;
                }
                else if (_users.get_a_state() == 1)
                {
                    result.set_success(200);
                    result.set_tipinfo("您的主帳號已被凍結,请与管理员联系!");
                    strResult = JsonHandle.ObjectToJson(result);
                    context.Session["user_state"] = _users.get_a_state().ToString();
                }
                else if (str3 == "1")
                {
                    result.set_success(200);
                    result.set_tipinfo(PageBase.GetMessageByCache("u100006", "MessageHint"));
                    strResult = JsonHandle.ObjectToJson(result);
                    context.Session["user_state"] = str3;
                }
                else
                {
                    context.Session["user_state"] = "0";
                    result.set_success(200);
                    strResult = JsonHandle.ObjectToJson(result);
                }
            }
            else
            {
                context.Session["user_name"]  = _users.get_u_name().Trim();
                context.Session["user_type"]  = _users.get_u_type().Trim();
                context.Session["user_state"] = str.Trim();
                if (str.Equals("1"))
                {
                    result.set_success(200);
                    result.set_tipinfo(PageBase.GetMessageByCache("u100004", "MessageHint"));
                    strResult = JsonHandle.ObjectToJson(result);
                    context.Session["user_state"] = str;
                }
                else if (str4 == "1")
                {
                    result.set_success(200);
                    result.set_tipinfo(PageBase.GetMessageByCache("u100006", "MessageHint"));
                    strResult = JsonHandle.ObjectToJson(result);
                    context.Session["user_state"] = str4;
                }
                else
                {
                    context.Session["user_state"] = "0";
                    result.set_success(200);
                    strResult = JsonHandle.ObjectToJson(result);
                }
            }
            agent_userinfo_session _session = new agent_userinfo_session();

            _session.set_u_id(_users.get_u_id());
            _session.set_u_name(_users.get_u_name().Trim());
            _session.set_u_psw(_users.get_u_psw().Trim());
            _session.set_u_nicker(_users.get_u_nicker().Trim());
            _session.set_u_skin(_users.get_u_skin().Trim());
            if (_child != null)
            {
                if (string.IsNullOrEmpty(_child.get_u_skin()))
                {
                    _session.set_u_skin("");
                }
                else
                {
                    _session.set_u_skin(_child.get_u_skin());
                }
            }
            _session.set_sup_name(_users.get_sup_name().Trim());
            _session.set_u_type(_users.get_u_type().Trim());
            _session.set_su_type(_users.get_su_type().Trim());
            _session.set_a_state(_users.get_a_state());
            _session.set_six_kind(_users.get_six_kind());
            _session.set_kc_kind(_users.get_kc_kind());
            _session.set_allow_sale(_users.get_allow_sale());
            _session.set_kc_allow_sale(_users.get_kc_allow_sale());
            _session.set_negative_sale(_users.get_negative_sale());
            if (!_users.get_allow_view_report().HasValue)
            {
                _session.set_allow_view_report(0);
            }
            else
            {
                _session.set_allow_view_report(_users.get_allow_view_report());
            }
            DataRow item = CallBLL.cz_admin_sysconfig_bll.GetItem();

            if (item == null)
            {
                _session.set_u_skin("Blue");
            }
            else
            {
                string str16 = item["agent_skin"].ToString();
                if (string.IsNullOrEmpty(_session.get_u_skin()) || (str16.IndexOf(_session.get_u_skin()) < 0))
                {
                    _session.set_u_skin(str16.Split(new char[] { '|' })[0]);
                }
            }
            if (_child != null)
            {
                _child.set_salt("");
            }
            _session.set_users_child_session(_child);
            DataTable zJInfo = CallBLL.cz_users_bll.GetZJInfo();

            if (zJInfo != null)
            {
                _session.set_zjname(zJInfo.Rows[0]["u_name"].ToString().Trim());
            }
            if (!_session.get_u_type().ToLower().Equals("zj"))
            {
                cz_rate_kc rateKCByUserName = CallBLL.cz_rate_kc_bll.GetRateKCByUserName(_session.get_u_name());
                _session.set_fgs_name(rateKCByUserName.get_fgs_name());
                _session.set_gd_name(rateKCByUserName.get_gd_name());
                _session.set_zd_name(rateKCByUserName.get_zd_name());
                _session.set_dl_name(rateKCByUserName.get_dl_name());
                DataTable userOpOdds = CallBLL.cz_rate_kc_bll.GetUserOpOdds(_session.get_u_name());
                if (userOpOdds != null)
                {
                    if ((userOpOdds.Rows[0]["six_op_odds"] != null) && (userOpOdds.Rows[0]["six_op_odds"].ToString() != ""))
                    {
                        _session.set_six_op_odds(new int?(int.Parse(userOpOdds.Rows[0]["six_op_odds"].ToString())));
                    }
                    if ((userOpOdds.Rows[0]["kc_op_odds"] != null) && (userOpOdds.Rows[0]["kc_op_odds"].ToString() != ""))
                    {
                        _session.set_kc_op_odds(new int?(int.Parse(userOpOdds.Rows[0]["kc_op_odds"].ToString())));
                    }
                }
            }
            context.Session["child_user_name"] = null;
            if (_child != null)
            {
                context.Session["child_user_name"] = _child.get_u_name();
            }
            context.Session["user_name"] = _users.get_u_name();
            context.Session[_users.get_u_name() + "lottery_session_user_info"] = _session;
            PageBase.SetAppcationFlag(str5);
            if (FileCacheHelper.get_RedisStatOnline().Equals(1) || FileCacheHelper.get_RedisStatOnline().Equals(2))
            {
                bool flag6 = false;
                if ((_session.get_users_child_session() != null) && _session.get_users_child_session().get_is_admin().Equals(1))
                {
                    flag6 = true;
                }
                if (!flag6)
                {
                    if (FileCacheHelper.get_RedisStatOnline().Equals(1))
                    {
                        new PageBase_Redis().InitUserOnlineTopToRedis(str5, _session.get_u_type());
                    }
                    else if (FileCacheHelper.get_RedisStatOnline().Equals(2))
                    {
                        new PageBase_Redis().InitUserOnlineTopToRedisStack(str5, _session.get_u_type());
                    }
                }
            }
            else
            {
                MemberPageBase.stat_top_online(str5);
                MemberPageBase.stat_online(str5, _session.get_u_type());
            }
            if (FileCacheHelper.get_RedisStatOnline().Equals(0))
            {
                PageBase.ZeroIsOutFlag(str5);
            }
            CallBLL.cz_user_psw_err_log_bll.ZeroErrTimes(str5);
            cz_login_log _log = new cz_login_log();

            _log.set_ip(LSRequest.GetIP());
            _log.set_login_time(new DateTime?(DateTime.Now));
            _log.set_u_name(str5);
            new PageBase();
            _log.set_browser_type(Utils.GetBrowserInfo(HttpContext.Current));
            CallBLL.cz_login_log_bll.Add(_log);
            if (_child == null)
            {
                string str17 = _users.get_is_changed().ToString();
                if (string.IsNullOrEmpty(str17) || (str17 == "0"))
                {
                    result.set_success(550);
                    result.set_tipinfo("新密碼首次登錄,需重置密碼!");
                    strResult = JsonHandle.ObjectToJson(result);
                    return;
                }
                DateTime?nullable = _users.get_last_changedate();
                int      num2     = PageBase.PasswordExpire();
                if (nullable.HasValue)
                {
                    nullable12 = nullable;
                    time4      = DateTime.Now.AddDays((double)-num2);
                    if (!(nullable12.HasValue ? (nullable12.GetValueOrDefault() < time4) : false))
                    {
                        goto Label_131D;
                    }
                }
                result.set_success(550);
                result.set_tipinfo("密碼過期,需重置密碼!");
                strResult = JsonHandle.ObjectToJson(result);
                return;
            }
            string str18 = _child.get_is_changed().ToString();

            if (string.IsNullOrEmpty(str18) || (str18 == "0"))
            {
                result.set_success(550);
                result.set_tipinfo("新密碼首次登錄,需重置密碼!");
                strResult = JsonHandle.ObjectToJson(result);
                return;
            }
            DateTime?nullable2 = _child.get_last_changedate();
            int      num3      = PageBase.PasswordExpire();

            if (nullable2.HasValue)
            {
                nullable12 = nullable2;
                time4      = DateTime.Now.AddDays((double)-num3);
                if (!(nullable12.HasValue ? (nullable12.GetValueOrDefault() < time4) : false))
                {
                    goto Label_131D;
                }
            }
            result.set_success(550);
            result.set_tipinfo("密碼過期,需重置密碼!");
            strResult = JsonHandle.ObjectToJson(result);
            return;

Label_131D:
            dictionary.Add("uid", _session.get_u_id());
            DataTable lotteryList = base.GetLotteryList();

            string[] source = base.GetLotteryMasterID(lotteryList).Split(new char[] { ',' });
            int      num4   = 1;

            if (source.Contains <string>(num4.ToString()))
            {
                dictionary.Add("hasSix", 1);
            }
            else
            {
                dictionary.Add("hasSix", 0);
            }
            num4 = 2;
            if (source.Contains <string>(num4.ToString()))
            {
                dictionary.Add("hasKc", 1);
            }
            else
            {
                dictionary.Add("hasKc", 0);
            }
            dictionary.Add("utype", _session.get_u_type().ToLower());
            List <object> list = new List <object>();

            foreach (DataRow row2 in lotteryList.Rows)
            {
                string str20 = row2["lottery_name"].ToString();
                string s     = row2["id"].ToString();
                Dictionary <string, object> dictionary2 = new Dictionary <string, object>();
                dictionary2.Add("name", str20);
                dictionary2.Add("id", int.Parse(s));
                list.Add(dictionary2);
            }
            dictionary.Add("lotteryCfg", list);
            dictionary.Add("PasswordLU", ConfigurationManager.AppSettings["PasswordLU"]);
            dictionary.Add("roleCfg", MemberPageBase_Mobile.roleCfg);
            result.set_data(dictionary);
            strResult = JsonHandle.ObjectToJson(result);
        }
Esempio n. 8
0
        private void addRecharge(ref string strResult)
        {
            bool flag;
            bool flag2;

            base.checkLoginByHandler(0);
            new ReturnResult();
            new Dictionary <string, object>();
            new List <object>();
            string str = this.Session["user_name"].ToString();

            this.userModel = this.Session[str + "lottery_session_user_info"] as agent_userinfo_session;
            if ((!this.userModel.get_u_type().Trim().Equals("zj") && !this.userModel.get_u_type().Trim().Equals("fgs")) && (!this.userModel.get_u_type().Trim().Equals("gd") && !this.userModel.get_u_type().Trim().Equals("zd")))
            {
                base.Response.End();
            }
            base.checkCloneRight();
            this.lotteryDT = base.GetLotteryList();
            base.Permission_Aspx_ZJ_Ajax(this.userModel, "po_2_1");
            base.Permission_Aspx_DL_Ajax(this.userModel, "po_6_1");
            string   s               = LSRequest.qq("masterid");
            string   str3            = LSRequest.qq("uid");
            string   str4            = LSRequest.qq("czje");
            cz_users userInfoByUID   = null;
            cz_users userInfoByUName = null;

            userInfoByUID = CallBLL.cz_users_bll.GetUserInfoByUID(str3);
            this.Hy_SubmitCreditLock(userInfoByUID.get_u_name(), userInfoByUID.get_u_type());
            if (!base.IsUpperLowerLevels(userInfoByUID.get_u_name(), this.userModel.get_u_type(), this.userModel.get_u_name()))
            {
                this.Hy_DeleteCreditLock(userInfoByUID.get_u_name(), userInfoByUID.get_u_type());
                base.Response.End();
            }
            cz_rate_kc rateKCByUserName = CallBLL.cz_rate_kc_bll.GetRateKCByUserName(userInfoByUID.get_u_name());

            base.En_User_Lock(rateKCByUserName.get_fgs_name());
            userInfoByUName = CallBLL.cz_users_bll.GetUserInfoByUName(userInfoByUID.get_sup_name());
            base.OpenLotteryMaster(out flag, out flag2);
            if (flag && userInfoByUID.get_six_iscash().Equals(int.Parse("1")))
            {
                int num3 = 1;
                if (s.Equals(num3.ToString()))
                {
                    if (!userInfoByUID.get_six_iscash().Equals(int.Parse("1")))
                    {
                        base.Response.End();
                    }
                    if (!Utils.IsDouble(str4))
                    {
                        this.Hy_DeleteCreditLock(userInfoByUID.get_u_name(), userInfoByUID.get_u_type());
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg("(⑥)充值格式不正確!");
                        base.Response.End();
                    }
                    if (double.Parse(str4) < 1.0)
                    {
                        this.Hy_DeleteCreditLock(userInfoByUID.get_u_name(), userInfoByUID.get_u_type());
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg("(⑥)充值金額不能小於1!");
                        base.Response.End();
                    }
                    if (!userInfoByUName.get_u_type().Equals("zj"))
                    {
                        decimal num4 = decimal.Parse(str4);
                        if (num4 > userInfoByUName.get_six_usable_credit())
                        {
                            this.Hy_DeleteCreditLock(userInfoByUID.get_u_name(), userInfoByUID.get_u_type());
                            base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                            base.noRightOptMsg("(⑥)充值金額不能大於 “上級可用餘額” !!");
                            base.Response.End();
                        }
                    }
                    string         random = Utils.GetRandom();
                    cz_credit_flow _flow  = new cz_credit_flow();
                    _flow.set_master_id(new int?(int.Parse(s)));
                    _flow.set_credit_old(userInfoByUID.get_six_usable_credit());
                    decimal?nullable4 = userInfoByUID.get_six_usable_credit();
                    decimal num5      = decimal.Parse(str4);
                    _flow.set_credit_new(nullable4.HasValue ? new decimal?(nullable4.GetValueOrDefault() + num5) : null);
                    _flow.set_credit_change(new decimal?(decimal.Parse(str4)));
                    _flow.set_u_name(userInfoByUID.get_u_name());
                    _flow.set_iscash(new int?(int.Parse("1")));
                    _flow.set_operator_name(this.userModel.get_u_name());
                    if (this.userModel.get_users_child_session() != null)
                    {
                        _flow.set_operator_child_name(this.userModel.get_users_child_session().get_u_name());
                    }
                    _flow.set_operator_time(DateTime.Now);
                    _flow.set_flag(0);
                    _flow.set_checkcode(random);
                    _flow.set_isphone(1);
                    _flow.set_ip(LSRequest.GetIP());
                    cz_credit_flow _flow2 = new cz_credit_flow();
                    _flow2.set_master_id(new int?(int.Parse(s)));
                    _flow2.set_credit_old(userInfoByUName.get_six_usable_credit());
                    decimal?nullable6 = userInfoByUName.get_six_usable_credit();
                    decimal num6      = decimal.Parse(str4);
                    _flow2.set_credit_new(nullable6.HasValue ? new decimal?(nullable6.GetValueOrDefault() - num6) : null);
                    _flow2.set_credit_change(new decimal?(-decimal.Parse(str4)));
                    _flow2.set_u_name(userInfoByUName.get_u_name());
                    _flow2.set_iscash(new int?(int.Parse("1")));
                    _flow2.set_operator_name(this.userModel.get_u_name());
                    if (this.userModel.get_users_child_session() != null)
                    {
                        _flow2.set_operator_child_name(this.userModel.get_users_child_session().get_u_name());
                    }
                    _flow2.set_operator_time(DateTime.Now);
                    _flow2.set_flag(1);
                    _flow2.set_checkcode(random);
                    _flow2.set_note(userInfoByUID.get_u_name());
                    _flow2.set_isphone(1);
                    _flow2.set_ip(LSRequest.GetIP());
                    if (CallBLL.cz_users_bll.UserRecharge(userInfoByUName.get_u_type(), userInfoByUName.get_u_id(), userInfoByUID.get_u_id(), double.Parse(str4), _flow, _flow2) > 0)
                    {
                        this.Hy_DeleteCreditLock(userInfoByUID.get_u_name(), userInfoByUID.get_u_type());
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.successOptMsg("(⑥)充值成功!");
                        base.Response.End();
                        return;
                    }
                    this.Hy_DeleteCreditLock(userInfoByUID.get_u_name(), userInfoByUID.get_u_type());
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("(⑥)充值失敗!");
                    base.Response.End();
                    return;
                }
            }
            if (flag2 && userInfoByUID.get_kc_iscash().Equals(int.Parse("1")))
            {
                int num7 = 2;
                if (s.Equals(num7.ToString()))
                {
                    if (!userInfoByUID.get_kc_iscash().Equals(int.Parse("1")))
                    {
                        base.Response.End();
                    }
                    if (!Utils.IsDouble(str4))
                    {
                        this.Hy_DeleteCreditLock(userInfoByUID.get_u_name(), userInfoByUID.get_u_type());
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg("(⑥)充值格式不正確!");
                        base.Response.End();
                    }
                    if (double.Parse(str4) < 1.0)
                    {
                        this.Hy_DeleteCreditLock(userInfoByUID.get_u_name(), userInfoByUID.get_u_type());
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg("(快)充值金額不能小於!");
                        base.Response.End();
                    }
                    if (!userInfoByUName.get_u_type().Equals("zj"))
                    {
                        decimal num8 = decimal.Parse(str4);
                        if (num8 > userInfoByUName.get_kc_usable_credit())
                        {
                            this.Hy_DeleteCreditLock(userInfoByUID.get_u_name(), userInfoByUID.get_u_type());
                            base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                            base.noRightOptMsg("(快)充值金額不能大於 “上級可用餘額” !");
                            base.Response.End();
                        }
                    }
                    string         str6   = Utils.GetRandom();
                    cz_credit_flow _flow3 = new cz_credit_flow();
                    _flow3.set_master_id(new int?(int.Parse(s)));
                    _flow3.set_credit_old(userInfoByUID.get_kc_usable_credit());
                    decimal?nullable11 = userInfoByUID.get_kc_usable_credit();
                    decimal num9       = decimal.Parse(str4);
                    _flow3.set_credit_new(nullable11.HasValue ? new decimal?(nullable11.GetValueOrDefault() + num9) : null);
                    _flow3.set_credit_change(new decimal?(decimal.Parse(str4)));
                    _flow3.set_u_name(userInfoByUID.get_u_name());
                    _flow3.set_iscash(new int?(int.Parse("1")));
                    _flow3.set_operator_name(this.userModel.get_u_name());
                    if (this.userModel.get_users_child_session() != null)
                    {
                        _flow3.set_operator_child_name(this.userModel.get_users_child_session().get_u_name());
                    }
                    _flow3.set_operator_time(DateTime.Now);
                    _flow3.set_flag(0);
                    _flow3.set_checkcode(str6);
                    _flow3.set_isphone(1);
                    _flow3.set_ip(LSRequest.GetIP());
                    cz_credit_flow _flow4 = new cz_credit_flow();
                    _flow4.set_master_id(new int?(int.Parse(s)));
                    _flow4.set_credit_old(userInfoByUName.get_kc_usable_credit());
                    decimal?nullable13 = userInfoByUName.get_kc_usable_credit();
                    decimal num10      = decimal.Parse(str4);
                    _flow4.set_credit_new(nullable13.HasValue ? new decimal?(nullable13.GetValueOrDefault() - num10) : null);
                    _flow4.set_credit_change(new decimal?(-decimal.Parse(str4)));
                    _flow4.set_u_name(userInfoByUName.get_u_name());
                    _flow4.set_iscash(new int?(int.Parse("1")));
                    _flow4.set_operator_name(this.userModel.get_u_name());
                    if (this.userModel.get_users_child_session() != null)
                    {
                        _flow4.set_operator_child_name(this.userModel.get_users_child_session().get_u_name());
                    }
                    _flow4.set_operator_time(DateTime.Now);
                    _flow4.set_flag(1);
                    _flow4.set_checkcode(str6);
                    _flow4.set_note(userInfoByUID.get_u_name());
                    _flow4.set_isphone(1);
                    _flow4.set_ip(LSRequest.GetIP());
                    if (CallBLL.cz_users_bll.UserRecharge(userInfoByUName.get_u_type(), userInfoByUName.get_u_id(), userInfoByUID.get_u_id(), double.Parse(str4), _flow3, _flow4) > 0)
                    {
                        this.Hy_DeleteCreditLock(userInfoByUID.get_u_name(), userInfoByUID.get_u_type());
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.successOptMsg("(快)充值成功!");
                        base.Response.End();
                        return;
                    }
                    this.Hy_DeleteCreditLock(userInfoByUID.get_u_name(), userInfoByUID.get_u_type());
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("(快)充值失敗!");
                    base.Response.End();
                    return;
                }
            }
            this.Hy_DeleteCreditLock(userInfoByUID.get_u_name(), userInfoByUID.get_u_type());
            base.Un_User_Lock(rateKCByUserName.get_fgs_name());
            base.noRightOptMsg("參數錯誤!");
            base.Response.End();
        }
Esempio n. 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string str = this.Session["user_name"].ToString();
            agent_userinfo_session model = this.Session[str + "lottery_session_user_info"] as agent_userinfo_session;

            if (!model.get_u_type().Trim().Equals("zj"))
            {
                base.Response.Redirect("../MessagePage.aspx?code=u100014&url=&issuccess=1&isback=0");
            }
            base.Permission_Aspx_ZJ(model, "po_3_1");
            if (base.IsChildSync())
            {
                base.Response.Redirect("../MessagePage.aspx?code=u100080&url=&issuccess=1&isback=0");
            }
            if (base.En_Balance_Lock(false).Equals("300"))
            {
                base.Response.Redirect("/MessagePage.aspx?code=u100082&url=&issuccess=1&isback=0&isopen=0");
                base.Response.End();
            }
            DataTable maxPhase = CallBLL.cz_phase_six_bll.GetMaxPhase();

            if (maxPhase == null)
            {
                base.Response.Write(base.ShowDialogBox("獎期錯誤!", "", 400));
                base.Response.End();
            }
            this.lid   = LSRequest.qq("lid");
            this.pid   = LSRequest.qq("pid");
            this.again = maxPhase.Rows[0]["is_opendata"].ToString();
            if (LSRequest.qq("hdnadd").Equals("add"))
            {
                this.pid = LSRequest.qq("hdnpid");
                this.lid = LSRequest.qq("hdnlid");
                string message = "";
                if (!this.ValidParam(ref message))
                {
                    base.Response.Write(base.ShowDialogBox(message, "", 400));
                    base.Response.End();
                }
                else
                {
                    if (maxPhase.Rows[0]["p_id"].ToString() != this.pid)
                    {
                        base.Response.Write(base.ShowDialogBox("獎期錯誤!", "", 400));
                        base.Response.End();
                    }
                    cz_phase_six _six = new cz_phase_six();
                    _six.set_p_id(Convert.ToInt32(this.pid));
                    _six.set_n1((this.CoverString(LSRequest.qq("zm1")).Equals("00") || this.CoverString(LSRequest.qq("zm1")).Equals("0")) ? "" : this.CoverString(LSRequest.qq("zm1")));
                    _six.set_n2((this.CoverString(LSRequest.qq("zm2")).Equals("00") || this.CoverString(LSRequest.qq("zm2")).Equals("0")) ? "" : this.CoverString(LSRequest.qq("zm2")));
                    _six.set_n3((this.CoverString(LSRequest.qq("zm3")).Equals("00") || this.CoverString(LSRequest.qq("zm3")).Equals("0")) ? "" : this.CoverString(LSRequest.qq("zm3")));
                    _six.set_n4((this.CoverString(LSRequest.qq("zm4")).Equals("00") || this.CoverString(LSRequest.qq("zm4")).Equals("0")) ? "" : this.CoverString(LSRequest.qq("zm4")));
                    _six.set_n5((this.CoverString(LSRequest.qq("zm5")).Equals("00") || this.CoverString(LSRequest.qq("zm5")).Equals("0")) ? "" : this.CoverString(LSRequest.qq("zm5")));
                    _six.set_n6((this.CoverString(LSRequest.qq("zm6")).Equals("00") || this.CoverString(LSRequest.qq("zm6")).Equals("0")) ? "" : this.CoverString(LSRequest.qq("zm6")));
                    _six.set_sn((this.CoverString(LSRequest.qq("tm")).Equals("00") || this.CoverString(LSRequest.qq("tm")).Equals("0")) ? "" : this.CoverString(LSRequest.qq("tm")));
                    if (!string.IsNullOrEmpty(_six.get_sn()))
                    {
                        _six.set_zodiac_sn(this.GetZodiacNameString(_six.get_sn()));
                    }
                    if (!string.IsNullOrEmpty(_six.get_n1()))
                    {
                        _six.set_zodiac_n1(this.GetZodiacNameString(_six.get_n1()));
                    }
                    if (!string.IsNullOrEmpty(_six.get_n2()))
                    {
                        _six.set_zodiac_n2(this.GetZodiacNameString(_six.get_n2()));
                    }
                    if (!string.IsNullOrEmpty(_six.get_n3()))
                    {
                        _six.set_zodiac_n3(this.GetZodiacNameString(_six.get_n3()));
                    }
                    if (!string.IsNullOrEmpty(_six.get_n4()))
                    {
                        _six.set_zodiac_n4(this.GetZodiacNameString(_six.get_n4()));
                    }
                    if (!string.IsNullOrEmpty(_six.get_n5()))
                    {
                        _six.set_zodiac_n5(this.GetZodiacNameString(_six.get_n5()));
                    }
                    if (!string.IsNullOrEmpty(_six.get_n6()))
                    {
                        _six.set_zodiac_n6(this.GetZodiacNameString(_six.get_n6()));
                    }
                    if (!CallBLL.cz_phase_six_bll.UpdatePhaseCode(_six))
                    {
                        base.Response.Write(base.ShowDialogBox("更新開獎碼時錯誤", "", 400));
                        base.Response.End();
                    }
                    else
                    {
                        string str5 = null;
                        if (model.get_users_child_session() != null)
                        {
                            str5 = model.get_users_child_session().get_u_name();
                        }
                        string             str6 = string.Concat(new object[] { maxPhase.Rows[0]["n1"], " , ", maxPhase.Rows[0]["n2"], " , ", maxPhase.Rows[0]["n3"], " , ", maxPhase.Rows[0]["n4"], " , ", maxPhase.Rows[0]["n5"], " , ", maxPhase.Rows[0]["n6"], " + ", maxPhase.Rows[0]["sn"] });
                        string             str7 = _six.get_n1() + " , " + _six.get_n2() + " , " + _six.get_n3() + " , " + _six.get_n4() + " , " + _six.get_n5() + " , " + _six.get_n6() + " + " + _six.get_sn();
                        cz_lotteryopen_log _log = new cz_lotteryopen_log();
                        _log.set_phase_id(int.Parse(this.pid));
                        _log.set_phase(maxPhase.Rows[0]["phase"].ToString());
                        _log.set_u_name(str);
                        _log.set_children_name(str5);
                        _log.set_action("送出號碼");
                        _log.set_old_val(str6);
                        _log.set_new_val(str7);
                        _log.set_ip(LSRequest.GetIP());
                        _log.set_add_time(DateTime.Now);
                        if (maxPhase.Rows[0]["is_opendata"].ToString().Equals("1"))
                        {
                            _log.set_note(string.Format("【本期編號:{0}】重新開獎", _log.get_phase()));
                        }
                        else
                        {
                            _log.set_note(string.Format("【本期編號:{0}】開獎", _log.get_phase()));
                        }
                        _log.set_type_id(0);
                        _log.set_lottery_id(100);
                        CallBLL.cz_lotteryopen_log_bll.Insert(_log);
                        base.Response.Write(string.Format("<script>location.href='Lottery_Open.aspx?pid={0}&lid={1}';</script>", this.pid, this.lid));
                        base.Response.End();
                    }
                }
            }
            this.phaseModel = CallBLL.cz_phase_six_bll.GetPhaseModel(Convert.ToInt32(this.pid));
            if (this.phaseModel == null)
            {
                base.Response.Redirect("../MessagePage.aspx?code=u100008&url=&issuccess=1&isback=0");
            }
        }
Esempio n. 10
0
        public void MemberPageBase_Load(object sender, EventArgs e)
        {
            DateTime       now;
            cz_stat_online _online;
            cz_stat_online _online2;

            if (HttpContext.Current.Session["user_name"] == null)
            {
                HttpContext.Current.Response.Write("<script>top.location.href='/'</script>");
                HttpContext.Current.Response.End();
            }
            string str = this.get_children_name();

            if (FileCacheHelper.get_RedisStatOnline().Equals(1))
            {
                if (HttpContext.Current.Request.Path.ToLower().IndexOf("resetpasswd.aspx") > 0)
                {
                    now     = DateTime.Now;
                    _online = new cz_stat_online();
                    _online.set_u_name((str == "") ? HttpContext.Current.Session["user_name"].ToString() : str);
                    _online.set_is_out(0);
                    _online.set_u_type(HttpContext.Current.Session["user_type"].ToString());
                    _online.set_ip(LSRequest.GetIP());
                    _online.set_first_time(new DateTime?(now));
                    _online.set_last_time(new DateTime?(now));
//                    CallBLL.redisHelper.HashGet<cz_stat_online>("useronline:list", (str == "") ? HttpContext.Current.Session["user_name"].ToString() : str, _online);
                }
//                if (CallBLL.redisHelper.HashExists("useronline:list", (str == "") ? HttpContext.Current.Session["user_name"].ToString() : str))
//                {
//                    _online2 = CallBLL.redisHelper.HashGet<cz_stat_online>("useronline:list", (str == "") ? HttpContext.Current.Session["user_name"].ToString() : str);
//                    if ((_online2 != null) && _online2.get_is_out().Equals(1))
//                    {
//                        HttpContext.Current.Session.Abandon();
//                        HttpContext.Current.Response.Write("<script>top.location.href='/'</script>");
//                        HttpContext.Current.Response.End();
//                    }
//                }
                if (PageBase.IsNeedPopBrower((str == "") ? HttpContext.Current.Session["user_name"].ToString() : str))
                {
                    HttpContext.Current.Session.Abandon();
                    HttpContext.Current.Response.Write("<script>top.location.href='/'</script>");
                    HttpContext.Current.Response.End();
                }
            }
            else if (FileCacheHelper.get_RedisStatOnline().Equals(2))
            {
                RedisClient client;
                if (HttpContext.Current.Request.Path.ToLower().IndexOf("resetpasswd.aspx") > 0)
                {
                    now     = DateTime.Now;
                    _online = new cz_stat_online();
                    _online.set_u_name((str == "") ? HttpContext.Current.Session["user_name"].ToString() : str);
                    _online.set_is_out(0);
                    _online.set_u_type(HttpContext.Current.Session["user_type"].ToString());
                    _online.set_ip(LSRequest.GetIP());
                    _online.set_first_time(new DateTime?(now));
                    _online.set_last_time(new DateTime?(now));
                    using (client = new RedisClient(RedisConnectSplit.get_RedisIP(), RedisConnectSplit.get_RedisPort(), RedisConnectSplit.get_RedisPassword(), (long)FileCacheHelper.get_GetRedisDBIndex()))
                    {
                        client.ConnectTimeout = int.Parse(RedisConnectSplit.get_RedisConnectTimeout());
                        client.SetEntryInHash("useronline:list", (str == "") ? HttpContext.Current.Session["user_name"].ToString() : str, JsonHandle.ObjectToJson(_online));
                    }
                }
                using (client = new RedisClient(RedisConnectSplit.get_RedisIP(), RedisConnectSplit.get_RedisPort(), RedisConnectSplit.get_RedisPassword(), (long)FileCacheHelper.get_GetRedisDBIndex()))
                {
                    client.ConnectTimeout = int.Parse(RedisConnectSplit.get_RedisConnectTimeout());
                    if (client.HashContainsEntry("useronline:list", (str == "") ? HttpContext.Current.Session["user_name"].ToString() : str))
                    {
                        _online2 = JsonHandle.JsonToObject <cz_stat_online>(client.GetValueFromHash("useronline:list", (str == "") ? HttpContext.Current.Session["user_name"].ToString() : str)) as cz_stat_online;
                        if ((_online2 != null) && _online2.get_is_out().Equals(1))
                        {
                            HttpContext.Current.Session.Abandon();
                            HttpContext.Current.Response.Write("<script>top.location.href='/'</script>");
                            HttpContext.Current.Response.End();
                        }
                    }
                }
                if (PageBase.IsNeedPopBrower((str == "") ? HttpContext.Current.Session["user_name"].ToString() : str))
                {
                    HttpContext.Current.Session.Abandon();
                    HttpContext.Current.Response.Write("<script>top.location.href='/'</script>");
                    HttpContext.Current.Response.End();
                }
            }
            else if (base.IsUserOut((str == "") ? HttpContext.Current.Session["user_name"].ToString() : str) || PageBase.IsNeedPopBrower((str == "") ? HttpContext.Current.Session["user_name"].ToString() : str))
            {
                HttpContext.Current.Session.Abandon();
                HttpContext.Current.Response.Write("<script>top.location.href='/'</script>");
                HttpContext.Current.Response.End();
            }
            string str3 = HttpContext.Current.Session["user_name"].ToString();

            this.UserCurrentSkin = (HttpContext.Current.Session[str3 + "lottery_session_user_info"] as agent_userinfo_session).get_u_skin();
            this.ForcedModifyPassword();
            this.AgentCurrentLottery();
            this.RedirectReport();
            this.IsOpenLottery();
            if (((((HttpContext.Current.Request.Path.ToLower().IndexOf("fgs_list") > -1) || (HttpContext.Current.Request.Path.ToLower().IndexOf("gd_list") > -1)) || ((HttpContext.Current.Request.Path.ToLower().IndexOf("zd_list") > -1) || (HttpContext.Current.Request.Path.ToLower().IndexOf("dl_list") > -1))) || ((HttpContext.Current.Request.Path.ToLower().IndexOf("hy_list") > -1) || (HttpContext.Current.Request.Path.ToLower().IndexOf("child_list") > -1))) || (HttpContext.Current.Request.Path.ToLower().IndexOf("filluser_list") > -1))
            {
                CookieHelper.SetCookie("userreturnbackurl", HttpContext.Current.Request.ServerVariables["Path_Info"] + "?" + HttpContext.Current.Request.ServerVariables["Query_String"]);
            }
        }
Esempio n. 11
0
        public static void stat_online(string user, string user_type)
        {
            ConcurrentDictionary <string, object> dictionary;
            string   str  = "Online_Stat";
            string   str2 = "Online_Stat_CheckTime";
            string   str3 = "online_User_Key";
            string   iP   = LSRequest.GetIP();
            DateTime now  = DateTime.Now;

            if (HttpContext.Current.Application[str2] == null)
            {
                HttpContext.Current.Application.Lock();
                HttpContext.Current.Application[str2] = now;
                HttpContext.Current.Application.UnLock();
            }
            if (HttpContext.Current.Application[str] == null)
            {
                dictionary = new ConcurrentDictionary <string, object>();
                ArrayList list = new ArrayList {
                    iP,
                    now
                };
                dictionary.GetOrAdd(user, list);
                HttpContext.Current.Application.Lock();
                HttpContext.Current.Application[str] = dictionary;
                HttpContext.Current.Application.UnLock();
                insert_online(iP, user, user_type, now, now);
            }
            else
            {
                dictionary = HttpContext.Current.Application[str] as ConcurrentDictionary <string, object>;
                if (dictionary.ContainsKey(user))
                {
                    if (HttpContext.Current.Application[str3] == null)
                    {
                        ConcurrentDictionary <string, object> dictionary2 = new ConcurrentDictionary <string, object>();
                        HttpContext.Current.Application[str3] = dictionary2;
                    }
                    ConcurrentDictionary <string, object> dictionary3 = HttpContext.Current.Application[str3] as ConcurrentDictionary <string, object>;
                    ArrayList infoList = new ArrayList {
                        iP,
                        DateTime.Now
                    };
                    dictionary3.AddOrUpdate(user, infoList, (key, oldValue) => infoList);
                    dictionary.AddOrUpdate(user, infoList, (key, oldValue) => infoList);
                }
                else
                {
                    ArrayList list2 = new ArrayList {
                        iP,
                        now
                    };
                    dictionary.GetOrAdd(user, list2);
                    insert_online(iP, user, user_type, now, now);
                }
                if (DateTime.Compare(Convert.ToDateTime(HttpContext.Current.Application[str2].ToString()).AddMinutes(1.0), DateTime.Now) < 0)
                {
                    HttpContext.Current.Application.Lock();
                    HttpContext.Current.Application[str2] = DateTime.Now;
                    HttpContext.Current.Application.UnLock();
                    update_online();
                }
            }
        }
Esempio n. 12
0
        private void user_login(HttpContext context, ref string strResult)
        {
            cz_login_log login_log;
            ReturnResult result = new ReturnResult();
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("type", "user_login");
            string userName = LSRequest.qq("loginName").Trim().ToLower();
            string str      = LSRequest.qq("loginPwd").Trim();
            string str2     = LSRequest.qq("ValidateCode").Trim();

            if (PageBase.is_ip_locked())
            {
                context.Session["lottery_session_img_code"] = null;
                result.set_success(400);
                result.set_tipinfo("由於輸入錯誤次數過多,您已被禁用,請稍後再試!");
                strResult = JsonHandle.ObjectToJson(result);
            }
            else if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(str))
            {
                context.Response.End();
            }
            else
            {
                DateTime time;
                if (int.Parse(FileCacheHelper.get_GetLockedPasswordCount()) == 0)
                {
                    context.Session["lottery_session_img_code_display"] = 1;
                }
                if (context.Session["lottery_session_img_code_display"] == null)
                {
                    if (CallBLL.cz_user_psw_err_log_bll.IsExistUser(userName))
                    {
                        if (PageBase.IsErrTimesAbove(ref time, userName))
                        {
                            if (!PageBase.IsErrTimeout(time))
                            {
                                context.Session["lottery_session_img_code"] = null;
                                result.set_success(400);
                                result.set_tipinfo("");
                                dictionary.Add("is_display_code", "1");
                                result.set_data(dictionary);
                                strResult = JsonHandle.ObjectToJson(result);
                                context.Session["lottery_session_img_code_display"] = 1;
                                return;
                            }
                            CallBLL.cz_user_psw_err_log_bll.ZeroErrTimes(userName);
                            context.Session["lottery_session_img_code"]         = null;
                            context.Session["lottery_session_img_code_display"] = 0;
                        }
                        else
                        {
                            context.Session["lottery_session_img_code"]         = null;
                            context.Session["lottery_session_img_code_display"] = 0;
                        }
                    }
                    else
                    {
                        context.Session["lottery_session_img_code"]         = null;
                        context.Session["lottery_session_img_code_display"] = 0;
                    }
                }
                if (context.Session["lottery_session_img_code_display"].ToString() == "0")
                {
                    if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(str))
                    {
                        context.Response.End();
                        return;
                    }
                }
                else
                {
                    if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(str))
                    {
                        context.Response.End();
                        return;
                    }
                    if (string.IsNullOrEmpty(str2))
                    {
                        context.Session["lottery_session_img_code"] = null;
                        result.set_success(400);
                        result.set_tipinfo("");
                        dictionary.Add("is_display_code", "1");
                        result.set_data(dictionary);
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session["lottery_session_img_code_display"] = 1;
                        return;
                    }
                    if (context.Session["lottery_session_img_code"] == null)
                    {
                        context.Response.End();
                        return;
                    }
                    if (context.Session["lottery_session_img_code"].ToString().ToLower() != str2.ToLower())
                    {
                        context.Session["lottery_session_img_code"] = null;
                        result.set_success(400);
                        result.set_tipinfo(PageBase.GetMessageByCache("u100004", "MessageHint"));
                        dictionary.Add("fs_name", "ValidateCode");
                        strResult = JsonHandle.ObjectToJson(result);
                        return;
                    }
                }
                cz_users _users = CallBLL.cz_users_bll.UserLogin(userName.ToLower());
                if (_users == null)
                {
                    context.Session["lottery_session_img_code"] = null;
                    PageBase.login_error_ip();
                    result.set_success(400);
                    result.set_tipinfo(PageBase.GetMessageByCache("u100005", "MessageHint"));
                    dictionary.Add("fs_name", "loginName");
                    strResult = JsonHandle.ObjectToJson(result);
                }
                else
                {
                    string str4 = _users.get_retry_times().ToString();
                    if (!string.IsNullOrEmpty(str4) && (int.Parse(str4) > int.Parse(FileCacheHelper.get_GetLockedUserCount())))
                    {
                        if (!PageBase.IsLockedTimeout(userName, "master"))
                        {
                            context.Session["lottery_session_img_code"] = null;
                            result.set_success(560);
                            result.set_tipinfo("您的帳號因密碼多次輸入錯誤被鎖死,請與管理員聯系!");
                            strResult = JsonHandle.ObjectToJson(result);
                            return;
                        }
                        PageBase.zero_retry_times(userName);
                    }
                    string str5 = _users.get_a_state().ToString();
                    string str6 = PageBase.upper_user_status(_users.get_u_name().ToLower());
                    if (str5 == "2")
                    {
                        context.Session["lottery_session_img_code"] = null;
                        result.set_success(400);
                        result.set_tipinfo(PageBase.GetMessageByCache("u100008", "MessageHint"));
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session.Abandon();
                    }
                    else if (str6 == "2")
                    {
                        context.Session["lottery_session_img_code"] = null;
                        result.set_success(400);
                        result.set_tipinfo("您的上級帳號已被停用,请与管理员联系!");
                        strResult = JsonHandle.ObjectToJson(result);
                        context.Session.Abandon();
                    }
                    else
                    {
                        if (str5 == "1")
                        {
                            result.set_success(200);
                            result.set_tipinfo(PageBase.GetMessageByCache("u100007", "MessageHint"));
                            strResult = JsonHandle.ObjectToJson(result);
                            context.Session["user_state"] = str5;
                        }
                        else if (str6 == "1")
                        {
                            result.set_success(200);
                            result.set_tipinfo(PageBase.GetMessageByCache("u100010", "MessageHint"));
                            strResult = JsonHandle.ObjectToJson(result);
                            context.Session["user_state"] = str6;
                        }
                        else
                        {
                            context.Session["user_state"] = "0";
                            result.set_success(200);
                            strResult = JsonHandle.ObjectToJson(result);
                        }
                        string str7 = _users.get_salt().Trim();
                        string str8 = DESEncrypt.EncryptString(str, str7);
                        if (_users.get_u_psw() != str8)
                        {
                            context.Session["lottery_session_img_code"] = null;
                            PageBase.inc_retry_times(userName);
                            PageBase.login_error_ip();
                            result.set_success(400);
                            result.set_tipinfo(PageBase.GetMessageByCache("u100006", "MessageHint"));
                            strResult = JsonHandle.ObjectToJson(result);
                            if (context.Session["lottery_session_img_code_display"].ToString() == "0")
                            {
                                if (CallBLL.cz_user_psw_err_log_bll.IsExistUser(userName))
                                {
                                    CallBLL.cz_user_psw_err_log_bll.UpdateErrTimes(userName);
                                }
                                else
                                {
                                    CallBLL.cz_user_psw_err_log_bll.AddUser(userName);
                                }
                                if (PageBase.IsErrTimesAbove(ref time, userName))
                                {
                                    context.Session["lottery_session_img_code"] = null;
                                    result.set_success(400);
                                    result.set_tipinfo(PageBase.GetMessageByCache("u100006", "MessageHint"));
                                    dictionary.Add("is_display_code", "1");
                                    result.set_data(dictionary);
                                    strResult = JsonHandle.ObjectToJson(result);
                                    context.Session["lottery_session_img_code_display"] = 1;
                                }
                            }
                        }
                        else
                        {
                            cz_userinfo_session _session = new cz_userinfo_session();
                            _session.set_u_id(_users.get_u_id());
                            _session.set_u_name(_users.get_u_name());
                            _session.set_u_nicker(_users.get_u_nicker());
                            _session.set_u_skin(_users.get_u_skin());
                            _session.set_u_type(_users.get_u_type());
                            _session.set_su_type(_users.get_su_type());
                            _session.set_kc_kind(_users.get_kc_kind().Trim());
                            _session.set_six_kind(_users.get_six_kind().Trim());
                            _session.set_u_psw(_users.get_u_psw().Trim());
                            _session.set_kc_rate_owner(_users.get_kc_rate_owner());
                            _session.set_six_rate_owner(_users.get_six_rate_owner());
                            _session.set_a_state(new int?(int.Parse(context.Session["user_state"].ToString())));
                            DataTable zJInfo = CallBLL.cz_users_bll.GetZJInfo();
                            if (zJInfo != null)
                            {
                                _session.set_zjname(zJInfo.Rows[0]["u_name"].ToString().Trim());
                            }
                            DataRow item = CallBLL.cz_admin_sysconfig_bll.GetItem();
                            if (item == null)
                            {
                                _session.set_u_skin("Blue");
                            }
                            else
                            {
                                string str9 = item["hy_skin"].ToString();
                                if (string.IsNullOrEmpty(_session.get_u_skin()) || (str9.IndexOf(_session.get_u_skin()) < 0))
                                {
                                    _session.set_u_skin(str9.Split(new char[] { '|' })[0]);
                                }
                            }
                            DataTable table2 = CallBLL.cz_rate_six_bll.GetRateByAccount(userName.ToLower()).Tables[0];
                            _session.get_six_session().set_fgsname(table2.Rows[0]["fgs_name"].ToString().Trim());
                            _session.get_six_session().set_gdname(table2.Rows[0]["gd_name"].ToString().Trim());
                            _session.get_six_session().set_zdname(table2.Rows[0]["zd_name"].ToString().Trim());
                            _session.get_six_session().set_dlname(table2.Rows[0]["dl_name"].ToString().Trim());
                            DataTable table3 = CallBLL.cz_rate_kc_bll.GetRateByAccount(userName.ToLower()).Tables[0];
                            _session.get_kc_session().set_fgsname(table3.Rows[0]["fgs_name"].ToString().Trim());
                            _session.get_kc_session().set_gdname(table3.Rows[0]["gd_name"].ToString().Trim());
                            _session.get_kc_session().set_zdname(table3.Rows[0]["zd_name"].ToString().Trim());
                            _session.get_kc_session().set_dlname(table3.Rows[0]["dl_name"].ToString().Trim());
                            _session.set_kc_rate_owner(new int?(Convert.ToInt32(table3.Rows[0]["kc_rate_owner"])));
                            _session.set_six_rate_owner(new int?(Convert.ToInt32(table2.Rows[0]["six_rate_owner"])));
                            DataTable userOpOdds = CallBLL.cz_rate_kc_bll.GetUserOpOdds(userName.ToLower());
                            if (userOpOdds != null)
                            {
                                if ((userOpOdds.Rows[0]["six_op_odds"] != null) && (userOpOdds.Rows[0]["six_op_odds"].ToString() != ""))
                                {
                                    _session.set_six_op_odds(new int?(int.Parse(userOpOdds.Rows[0]["six_op_odds"].ToString())));
                                }
                                if ((userOpOdds.Rows[0]["kc_op_odds"] != null) && (userOpOdds.Rows[0]["kc_op_odds"].ToString() != ""))
                                {
                                    _session.set_kc_op_odds(new int?(int.Parse(userOpOdds.Rows[0]["kc_op_odds"].ToString())));
                                }
                            }
                            context.Session["user_name"] = userName.ToLower();
                            context.Session[userName + "lottery_session_user_info"] = _session;
                            PageBase.SetAppcationFlag(userName);
                            if (FileCacheHelper.get_RedisStatOnline().Equals(1))
                            {
                                new PageBase_Redis().InitUserOnlineTopToRedis(userName, _session.get_u_type());
                            }
                            else if (FileCacheHelper.get_RedisStatOnline().Equals(2))
                            {
                                new PageBase_Redis().InitUserOnlineTopToRedisStack(userName, _session.get_u_type());
                            }
                            else
                            {
                                MemberPageBase.stat_top_online(userName);
                                MemberPageBase.stat_online(userName, _session.get_u_type());
                            }
                            if (FileCacheHelper.get_RedisStatOnline().Equals(0))
                            {
                                PageBase.ZeroIsOutFlag(userName);
                            }
                            login_log = new cz_login_log();
                            login_log.set_ip(LSRequest.GetIP());
                            login_log.set_login_time(new DateTime?(DateTime.Now));
                            login_log.set_u_name(userName);
                            login_log.set_browser_type(Utils.GetBrowserInfo(HttpContext.Current));
                            Task.Factory.StartNew(delegate {
                                PageBase.zero_retry_times(userName);
                                CallBLL.cz_user_psw_err_log_bll.ZeroErrTimes(userName);
                                CallBLL.cz_login_log_bll.Add(login_log);
                            }).ContinueWith(delegate(Task t) {
                                string str = string.Format("Task Exception: {0}", t.Exception.InnerException.Message);
                                MessageQueueConfig.TaskQueue.Enqueue(new TaskModel(0, str));
                            }, TaskContinuationOptions.OnlyOnFaulted);
                            if (FileCacheHelper.get_GetWebModelView().Equals(0))
                            {
                                HttpContext.Current.Session["Session_LoginSystem_Flag"] = "LoginSystem_OldWeb";
                                _session.set_u_skin("Yellow");
                            }
                            else
                            {
                                HttpContext.Current.Session["Session_LoginSystem_Flag"] = "LoginSystem_NewWeb";
                            }
                            string str10 = _users.get_is_changed().ToString();
                            if (string.IsNullOrEmpty(str10))
                            {
                                result.set_success(550);
                                result.set_tipinfo("新密碼首次登錄,需重置密碼!");
                                strResult = JsonHandle.ObjectToJson(result);
                                context.Session["modifypassword"] = "******";
                            }
                            else if (str10 == "0")
                            {
                                result.set_success(550);
                                result.set_tipinfo("新密碼首次登錄,需重置密碼!");
                                strResult = JsonHandle.ObjectToJson(result);
                                context.Session["modifypassword"] = "******";
                            }
                            else
                            {
                                DateTime?nullable3;
                                DateTime?nullable = _users.get_last_changedate();
                                int      num2     = PageBase.PasswordExpire();
                                if (nullable.HasValue && ((nullable3 = nullable).HasValue ? (nullable3.GetValueOrDefault() < DateTime.Now.AddDays((double)-num2)) : false))
                                {
                                    result.set_success(550);
                                    result.set_tipinfo("密碼過期,需重置密碼!");
                                    strResult = JsonHandle.ObjectToJson(result);
                                    context.Session["modifypassword"] = "******";
                                }
                                else
                                {
                                    CallBLL.cz_credit_lock_bll.Delete(_users.get_u_name());
                                    result.set_data(dictionary);
                                    strResult = JsonHandle.ObjectToJson(result);
                                }
                            }
                        }
                    }
                }
            }
        }
Esempio n. 13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     string strResult = "";
     ReturnResult_Mobile mobile = new ReturnResult_Mobile();
     Dictionary<string, object> dictionary = new Dictionary<string, object>();
     dictionary.Add("type", "user_login");
     string str2 = LSRequest.qq("loginName").Trim();
     string str3 = LSRequest.qq("loginPwd").Trim();
     string str4 = LSRequest.qq("ValidateCode").Trim();
     if (PageBase.is_ip_locked())
     {
         this.Session["lottery_session_img_code"] = null;
         mobile.set_status(2);
         mobile.set_msg("由於輸入錯誤次數過多,您已被禁用,請稍後再試!");
         strResult = JsonHandle.ObjectToJson(mobile);
         base.OutJson(strResult);
     }
     else if (string.IsNullOrEmpty(str2) || string.IsNullOrEmpty(str3))
     {
         base.Response.End();
     }
     else
     {
         DateTime time;
         if (int.Parse(FileCacheHelper.get_GetLockedPasswordCount()) == 0)
         {
             this.Session["lottery_session_img_code_display"] = 1;
         }
         if (this.Session["lottery_session_img_code_display"] == null)
         {
             if (CallBLL.cz_user_psw_err_log_bll.IsExistUser(str2))
             {
                 if (PageBase.IsErrTimesAbove(ref time, str2))
                 {
                     if (!PageBase.IsErrTimeout(time))
                     {
                         this.Session["lottery_session_img_code"] = null;
                         mobile.set_status(2);
                         mobile.set_msg("");
                         dictionary.Add("is_display_code", "1");
                         mobile.set_data(dictionary);
                         strResult = JsonHandle.ObjectToJson(mobile);
                         this.Session["lottery_session_img_code_display"] = 1;
                         base.OutJson(strResult);
                         return;
                     }
                     CallBLL.cz_user_psw_err_log_bll.ZeroErrTimes(str2);
                     this.Session["lottery_session_img_code"] = null;
                     this.Session["lottery_session_img_code_display"] = 0;
                 }
                 else
                 {
                     this.Session["lottery_session_img_code"] = null;
                     this.Session["lottery_session_img_code_display"] = 0;
                 }
             }
             else
             {
                 this.Session["lottery_session_img_code"] = null;
                 this.Session["lottery_session_img_code_display"] = 0;
             }
         }
         if (this.Session["lottery_session_img_code_display"].ToString() == "0")
         {
             if (string.IsNullOrEmpty(str2) || string.IsNullOrEmpty(str3))
             {
                 base.Response.End();
                 return;
             }
         }
         else
         {
             if (string.IsNullOrEmpty(str2) || string.IsNullOrEmpty(str3))
             {
                 base.Response.End();
                 return;
             }
             if (string.IsNullOrEmpty(str4))
             {
                 this.Session["lottery_session_img_code"] = null;
                 mobile.set_status(2);
                 mobile.set_msg("");
                 dictionary.Add("is_display_code", "1");
                 mobile.set_data(dictionary);
                 strResult = JsonHandle.ObjectToJson(mobile);
                 this.Session["lottery_session_img_code_display"] = 1;
                 base.OutJson(strResult);
                 return;
             }
             if (this.Session["lottery_session_img_code"] == null)
             {
                 base.Response.End();
                 return;
             }
             if (this.Session["lottery_session_img_code"].ToString().ToLower() != str4.ToLower())
             {
                 this.Session["lottery_session_img_code"] = null;
                 mobile.set_status(2);
                 mobile.set_msg(PageBase.GetMessageByCache("u100004", "MessageHint"));
                 strResult = JsonHandle.ObjectToJson(mobile);
                 base.OutJson(strResult);
                 return;
             }
         }
         this.Session["lottery_session_img_code"] = null;
         cz_users _users = CallBLL.cz_users_bll.UserLogin(str2.ToLower());
         if (_users == null)
         {
             this.Session["lottery_session_img_code"] = null;
             PageBase.login_error_ip();
             mobile.set_status(2);
             mobile.set_msg(PageBase.GetMessageByCache("u100005", "MessageHint"));
             strResult = JsonHandle.ObjectToJson(mobile);
             base.OutJson(strResult);
         }
         else
         {
             string str6 = _users.get_retry_times().ToString();
             if (!string.IsNullOrEmpty(str6) && (int.Parse(str6) > int.Parse(FileCacheHelper.get_GetLockedUserCount())))
             {
                 if (!PageBase.IsLockedTimeout(str2, "master"))
                 {
                     this.Session["lottery_session_img_code"] = null;
                     mobile.set_status(2);
                     mobile.set_msg("您的帳號因密碼多次輸入錯誤被鎖死,請與管理員聯系!");
                     strResult = JsonHandle.ObjectToJson(mobile);
                     base.OutJson(strResult);
                     return;
                 }
                 PageBase.zero_retry_times(str2);
             }
             string str7 = _users.get_a_state().ToString();
             string str8 = PageBase.upper_user_status(_users.get_u_name().ToLower());
             if (str7 == "2")
             {
                 this.Session["lottery_session_img_code"] = null;
                 mobile.set_status(2);
                 mobile.set_msg(PageBase.GetMessageByCache("u100008", "MessageHint"));
                 strResult = JsonHandle.ObjectToJson(mobile);
                 base.OutJson(strResult);
             }
             else if (str8 == "2")
             {
                 this.Session["lottery_session_img_code"] = null;
                 mobile.set_status(2);
                 mobile.set_msg("您的上級帳號已被停用,请与管理员联系!");
                 strResult = JsonHandle.ObjectToJson(mobile);
                 base.OutJson(strResult);
             }
             else
             {
                 if (str7 == "1")
                 {
                     mobile.set_status(1);
                     mobile.set_msg(PageBase.GetMessageByCache("u100007", "MessageHint"));
                     strResult = JsonHandle.ObjectToJson(mobile);
                     this.Session["user_state"] = str7;
                 }
                 else if (str8 == "1")
                 {
                     mobile.set_status(1);
                     mobile.set_msg(PageBase.GetMessageByCache("u100010", "MessageHint"));
                     strResult = JsonHandle.ObjectToJson(mobile);
                     this.Session["user_state"] = str8;
                 }
                 else
                 {
                     this.Session["user_state"] = "0";
                     mobile.set_status(0);
                     strResult = JsonHandle.ObjectToJson(mobile);
                 }
                 string str9 = _users.get_salt().Trim();
                 string str10 = DESEncrypt.EncryptString(str3, str9);
                 if (_users.get_u_psw() != str10)
                 {
                     this.Session["lottery_session_img_code"] = null;
                     PageBase.inc_retry_times(str2);
                     PageBase.login_error_ip();
                     mobile.set_status(2);
                     mobile.set_msg(PageBase.GetMessageByCache("u100006", "MessageHint"));
                     strResult = JsonHandle.ObjectToJson(mobile);
                     if (this.Session["lottery_session_img_code_display"].ToString() == "0")
                     {
                         if (CallBLL.cz_user_psw_err_log_bll.IsExistUser(str2))
                         {
                             CallBLL.cz_user_psw_err_log_bll.UpdateErrTimes(str2);
                         }
                         else
                         {
                             CallBLL.cz_user_psw_err_log_bll.AddUser(str2);
                         }
                         if (PageBase.IsErrTimesAbove(ref time, str2))
                         {
                             this.Session["lottery_session_img_code"] = null;
                             mobile.set_status(2);
                             mobile.set_msg(PageBase.GetMessageByCache("u100006", "MessageHint"));
                             dictionary.Add("is_display_code", "1");
                             mobile.set_data(dictionary);
                             strResult = JsonHandle.ObjectToJson(mobile);
                             this.Session["lottery_session_img_code_display"] = 1;
                             base.OutJson(strResult);
                             return;
                         }
                     }
                     base.OutJson(strResult);
                 }
                 else
                 {
                     cz_userinfo_session _session = new cz_userinfo_session();
                     _session.set_u_id(_users.get_u_id());
                     _session.set_u_name(_users.get_u_name());
                     _session.set_u_nicker(_users.get_u_nicker());
                     _session.set_u_skin(_users.get_u_skin());
                     _session.set_u_type(_users.get_u_type());
                     _session.set_su_type(_users.get_su_type());
                     _session.set_kc_kind(_users.get_kc_kind().Trim());
                     _session.set_six_kind(_users.get_six_kind().Trim());
                     _session.set_u_psw(_users.get_u_psw().Trim());
                     _session.set_kc_rate_owner(_users.get_kc_rate_owner());
                     _session.set_six_rate_owner(_users.get_six_rate_owner());
                     DataTable zJInfo = CallBLL.cz_users_bll.GetZJInfo();
                     if (zJInfo != null)
                     {
                         _session.set_zjname(zJInfo.Rows[0]["u_name"].ToString().Trim());
                     }
                     DataTable table2 = CallBLL.cz_rate_six_bll.GetRateByAccount(str2.ToLower()).Tables[0];
                     _session.get_six_session().set_fgsname(table2.Rows[0]["fgs_name"].ToString().Trim());
                     _session.get_six_session().set_gdname(table2.Rows[0]["gd_name"].ToString().Trim());
                     _session.get_six_session().set_zdname(table2.Rows[0]["zd_name"].ToString().Trim());
                     _session.get_six_session().set_dlname(table2.Rows[0]["dl_name"].ToString().Trim());
                     DataTable table3 = CallBLL.cz_rate_kc_bll.GetRateByAccount(str2.ToLower()).Tables[0];
                     _session.get_kc_session().set_fgsname(table3.Rows[0]["fgs_name"].ToString().Trim());
                     _session.get_kc_session().set_gdname(table3.Rows[0]["gd_name"].ToString().Trim());
                     _session.get_kc_session().set_zdname(table3.Rows[0]["zd_name"].ToString().Trim());
                     _session.get_kc_session().set_dlname(table3.Rows[0]["dl_name"].ToString().Trim());
                     _session.set_kc_rate_owner(new int?(Convert.ToInt32(table3.Rows[0]["kc_rate_owner"])));
                     _session.set_six_rate_owner(new int?(Convert.ToInt32(table2.Rows[0]["six_rate_owner"])));
                     DataTable userOpOdds = CallBLL.cz_rate_kc_bll.GetUserOpOdds(str2.ToLower());
                     if (userOpOdds != null)
                     {
                         if ((userOpOdds.Rows[0]["six_op_odds"] != null) && (userOpOdds.Rows[0]["six_op_odds"].ToString() != ""))
                         {
                             _session.set_six_op_odds(new int?(int.Parse(userOpOdds.Rows[0]["six_op_odds"].ToString())));
                         }
                         if ((userOpOdds.Rows[0]["kc_op_odds"] != null) && (userOpOdds.Rows[0]["kc_op_odds"].ToString() != ""))
                         {
                             _session.set_kc_op_odds(new int?(int.Parse(userOpOdds.Rows[0]["kc_op_odds"].ToString())));
                         }
                     }
                     _session.set_isPhone(1);
                     this.Session["user_name"] = str2.ToLower();
                     this.Session[str2 + "lottery_session_user_info"] = _session;
                     PageBase.SetAppcationFlag(str2);
                     if (FileCacheHelper.get_RedisStatOnline().Equals(1))
                     {
                         new PageBase_Redis().InitUserOnlineTopToRedis(str2, _session.get_u_type());
                     }
                     else if (FileCacheHelper.get_RedisStatOnline().Equals(2))
                     {
                         new PageBase_Redis().InitUserOnlineTopToRedisStack(str2, _session.get_u_type());
                     }
                     else
                     {
                         MemberPageBase.stat_top_online(str2);
                         MemberPageBase.stat_online(str2, _session.get_u_type());
                     }
                     if (FileCacheHelper.get_RedisStatOnline().Equals(0))
                     {
                         PageBase.ZeroIsOutFlag(str2);
                     }
                     PageBase.zero_retry_times(str2);
                     CallBLL.cz_user_psw_err_log_bll.ZeroErrTimes(str2);
                     cz_login_log _log = new cz_login_log();
                     _log.set_ip(LSRequest.GetIP());
                     _log.set_login_time(new DateTime?(DateTime.Now));
                     _log.set_u_name(str2);
                     _log.set_browser_type(Utils.GetBrowserInfo(HttpContext.Current));
                     CallBLL.cz_login_log_bll.Add(_log);
                     this.Session["Session_LoginSystem_Flag"] = "LoginSystem_PhoneWeb";
                     string str11 = _users.get_is_changed().ToString();
                     if (string.IsNullOrEmpty(str11))
                     {
                         this.Session["lottery_session_img_code"] = null;
                         mobile.set_status(550);
                         mobile.set_msg("新密碼首次登錄,需重置密碼!");
                         strResult = JsonHandle.ObjectToJson(mobile);
                         this.Session["modifypassword"] = "******";
                         base.OutJson(strResult);
                     }
                     else if (str11 == "0")
                     {
                         this.Session["lottery_session_img_code"] = null;
                         mobile.set_status(550);
                         mobile.set_msg("新密碼首次登錄,需重置密碼!");
                         strResult = JsonHandle.ObjectToJson(mobile);
                         this.Session["modifypassword"] = "******";
                         base.OutJson(strResult);
                     }
                     else
                     {
                         DateTime? nullable3;
                         DateTime? nullable = _users.get_last_changedate();
                         int num2 = PageBase.PasswordExpire();
                         if (nullable.HasValue && ((nullable3 = nullable).HasValue ? (nullable3.GetValueOrDefault() < DateTime.Now.AddDays((double) -num2)) : false))
                         {
                             this.Session["lottery_session_img_code"] = null;
                             mobile.set_status(550);
                             mobile.set_msg("密碼過期,需重置密碼!");
                             strResult = JsonHandle.ObjectToJson(mobile);
                             this.Session["modifypassword"] = "******";
                             base.OutJson(strResult);
                         }
                         else
                         {
                             CallBLL.cz_credit_lock_bll.Delete(_users.get_u_name());
                             mobile.set_status(0);
                             strResult = JsonHandle.ObjectToJson(mobile);
                             base.OutJson(strResult);
                         }
                     }
                 }
             }
         }
     }
 }