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"] = "******"; } } } } }
protected void Page_Load(object sender, EventArgs e) { base.Response.Expires = 0; base.IsUserLoginByMobile(); this.lotteryTable = base.GetLotteryList(); this.userName = HttpContext.Current.Session["user_name"].ToString(); cz_users _users = CallBLL.cz_users_bll.UserLogin(this.userName); this.kc_kind = _users.get_kc_kind().Trim(); this.kc_credit = Convert.ToDecimal(_users.get_kc_credit()); this.kc_usable_credit = Convert.ToDecimal(_users.get_kc_usable_credit()); this.kc_iscash = _users.get_kc_iscash().ToString(); this.six_kind = _users.get_six_kind().Trim(); this.six_credit = Convert.ToDecimal(_users.get_six_credit()); this.six_usable_credit = Convert.ToDecimal(_users.get_six_usable_credit()); this.six_iscash = _users.get_six_iscash().ToString(); if (base.IsOpenBigLottery(2)) { string str; if (base.IsOpenLottery(0)) { str = "86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,123,124,125,126,127,128,129,130,131,132,133,134,135,136"; this.kl10DataTable = CallBLL.cz_drawback_kl10_bll.GetDrawbackByPlayId(this.userName, str).Tables[0]; } if (base.IsOpenLottery(1)) { this.cqscDataTable = CallBLL.cz_drawback_cqsc_bll.GetDrawbackList(this.userName, "4,5,6,7,8,9,10,11,12,13,14,15").Tables[0]; } if (base.IsOpenLottery(2)) { this.pk10DataTable = CallBLL.cz_drawback_pk10_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } if (base.IsOpenLottery(3)) { this.xyncDataTable = CallBLL.cz_drawback_xync_bll.GetDrawbackList(this.userName, "86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,123,124,125,126,127,128,129,130,131,132,133,134,135,136").Tables[0]; } if (base.IsOpenLottery(4)) { this.jsk3DataTable = CallBLL.cz_drawback_jsk3_bll.GetDrawbackList(this.userName).Tables[0]; } if (base.IsOpenLottery(5)) { this.kl8DataTable = CallBLL.cz_drawback_kl8_bll.GetDrawbackList(this.userName).Tables[0]; } if (base.IsOpenLottery(6)) { this.k8scDataTable = CallBLL.cz_drawback_cqsc_bll.GetDrawbackList(this.userName, "4,5,6,7,8,9,10,11,12,13,14,15").Tables[0]; } if (base.IsOpenLottery(7)) { this.pcddDataTable = CallBLL.cz_drawback_pcdd_bll.GetDrawbackList(this.userName, "71009,71010,71011,71012").Tables[0]; } if (base.IsOpenLottery(9)) { this.xyft5DataTable = CallBLL.cz_drawback_xyft5_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } if (base.IsOpenLottery(8)) { this.pkbjlDataTable = CallBLL.cz_drawback_pkbjl_bll.GetDrawbackList(this.userName, "81001,81002,81003,81004").Tables[0]; } if (base.IsOpenLottery(10)) { this.jscarDataTable = CallBLL.cz_drawback_jscar_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } if (base.IsOpenLottery(11)) { this.speed5DataTable = CallBLL.cz_drawback_speed5_bll.GetDrawbackList(this.userName, "4,5,6,7,8,9,10,11,12,13,14,15").Tables[0]; } if (base.IsOpenLottery(12)) { this.jspk10DataTable = CallBLL.cz_drawback_jspk10_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } if (base.IsOpenLottery(13)) { this.jscqscDataTable = CallBLL.cz_drawback_jscqsc_bll.GetDrawbackList(this.userName, "4,5,6,7,8,9,10,11,12,13,14,15").Tables[0]; } if (base.IsOpenLottery(14)) { str = "86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,123,124,125,126,127,128,129,130,131,132,133,134,135,136"; this.jssfcDataTable = CallBLL.cz_drawback_jssfc_bll.GetDrawbackByPlayId(this.userName, str).Tables[0]; } if (base.IsOpenLottery(15)) { this.jsft2DataTable = CallBLL.cz_drawback_jsft2_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } if (base.IsOpenLottery(0x10)) { this.car168DataTable = CallBLL.cz_drawback_car168_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } if (base.IsOpenLottery(0x11)) { this.ssc168DataTable = CallBLL.cz_drawback_ssc168_bll.GetDrawbackList(this.userName, "4,5,6,7,8,9,10,11,12,13,14,15").Tables[0]; } if (base.IsOpenLottery(0x12)) { this.vrcarDataTable = CallBLL.cz_drawback_vrcar_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } if (base.IsOpenLottery(0x13)) { this.vrsscDataTable = CallBLL.cz_drawback_vrssc_bll.GetDrawbackList(this.userName, "4,5,6,7,8,9,10,11,12,13,14,15").Tables[0]; } if (base.IsOpenLottery(20)) { this.xyftoaDataTable = CallBLL.cz_drawback_xyftoa_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } if (base.IsOpenLottery(0x15)) { this.xyftsgDataTable = CallBLL.cz_drawback_xyftsg_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } if (base.IsOpenLottery(0x16)) { this.happycarDataTable = CallBLL.cz_drawback_happycar_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } } if (base.IsOpenBigLottery(1)) { if (!FileCacheHelper.get_IsShowLM_B()) { this.sixDataTable = CallBLL.cz_drawback_six_bll.User_GetDrawBackList(this.userName, "91060,91061,91062,91063,91064,91065").Tables[0]; } else { this.sixDataTable = CallBLL.cz_drawback_six_bll.GetDrawBackList(this.userName).Tables[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); }
private void AddUser() { string str = LSRequest.qq("userState"); string str2 = LSRequest.qq("password"); string str3 = LSRequest.qq("nicker"); string str4 = LSRequest.qq("isLocked"); string s = LSRequest.qq("userCreditSix"); if (this.d_six_iscash.Equals("1")) { s = this.d_six_credit; } string str6 = LSRequest.qq("userRateSix"); LSRequest.qq("userAllowSaleSix"); string str7 = LSRequest.qq("userKindSix"); string str8 = "0"; string str9 = "0"; string str10 = LSRequest.qq("userCreditKc"); if (this.d_kc_iscash.Equals("1")) { str10 = this.d_kc_credit; } string str11 = LSRequest.qq("userRateKc"); LSRequest.qq("userAllowSaleKc"); string str12 = LSRequest.qq("userKindKc"); string str13 = "0"; string str14 = "0"; string message = ""; if (!base.ValidParamByUserEditPhone("hy", ref message, null, this.lottrty_six, this.lottrty_kc)) { base.DeleteCreditLock(this.d_u_name); base.noRightOptMsg(message); } if (!string.IsNullOrEmpty(str2.Trim()) && !Regexlib.IsValidPassword(str2.Trim(), base.get_GetPasswordLU())) { if (base.get_GetPasswordLU().Equals("1")) { base.DeleteCreditLock(this.d_u_name); base.noRightOptMsg("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!"); } else { base.DeleteCreditLock(this.d_u_name); base.noRightOptMsg("密碼要8-20位,且必需包含字母、和数字!"); } } if ((!str.Equals("0") && !str.Equals("1")) && !str.Equals("2")) { base.DeleteCreditLock(this.d_u_name); base.Response.End(); } if ((!string.IsNullOrEmpty(this.lottrty_six) && !str7.ToUpper().Equals("A")) && (!str7.ToUpper().Equals("B") && !str7.ToUpper().Equals("C"))) { base.DeleteCreditLock(this.d_u_name); base.Response.End(); } if ((!string.IsNullOrEmpty(this.lottrty_kc) && !str12.ToUpper().Equals("A")) && (!str12.ToUpper().Equals("B") && !str12.ToUpper().Equals("C"))) { base.DeleteCreditLock(this.d_u_name); base.Response.End(); } cz_rate_kc rateKCByUserName = CallBLL.cz_rate_kc_bll.GetRateKCByUserName(this.d_u_name); base.En_User_Lock(rateKCByUserName.get_fgs_name()); double num = 0.0; if (!string.IsNullOrEmpty(this.lottrty_six)) { if ((double.Parse(s) - double.Parse(this.d_six_credit)) > double.Parse(this.d_up_six_usable_credit)) { base.DeleteCreditLock(this.d_u_name); base.Un_User_Lock(rateKCByUserName.get_fgs_name()); base.noRightOptMsg("⑥合彩: 設定增加‘信用額度’超過上级可以用餘額!"); } if (double.Parse(str6) > this.d_maxRate_six) { base.DeleteCreditLock(this.d_u_name); base.Un_User_Lock(rateKCByUserName.get_fgs_name()); base.noRightOptMsg("⑥合彩: 分公司占成 數不正确,请核实后重新输入!"); } num = double.Parse(s) - double.Parse(this.d_six_credit); if (double.Parse(s) < (double.Parse(this.d_six_credit) - Convert.ToDouble(this.d_six_usable_credit))) { base.DeleteCreditLock(this.d_u_name); base.Un_User_Lock(rateKCByUserName.get_fgs_name()); base.noRightOptMsg("⑥合彩: 設定減少‘信用額度’超過可‘回收’餘額!"); } if (str8.Equals("1")) { if (string.IsNullOrEmpty(str9)) { base.DeleteCreditLock(this.d_u_name); base.Un_User_Lock(rateKCByUserName.get_fgs_name()); base.noRightOptMsg("⑥合彩:‘占成上限’不可為空,請修改!"); } try { if (Convert.ToInt32(str9) > 100) { base.DeleteCreditLock(this.d_u_name); base.Un_User_Lock(rateKCByUserName.get_fgs_name()); base.noRightOptMsg("⑥合彩: ‘占成上限’不可高於 100%,請重新設定!"); } else if (Convert.ToInt32(str9) <= 0) { base.DeleteCreditLock(this.d_u_name); base.Un_User_Lock(rateKCByUserName.get_fgs_name()); base.noRightOptMsg("⑥合彩: ‘占成上限’不可低於等於 0%,請重新設定!"); } } catch { base.DeleteCreditLock(this.d_u_name); base.Un_User_Lock(rateKCByUserName.get_fgs_name()); base.noRightOptMsg("⑥合彩: ‘占成上限’只能為數字,請重新設定!"); } } } double num2 = 0.0; if (!string.IsNullOrEmpty(this.lottrty_kc)) { if ((double.Parse(str10) - double.Parse(this.d_kc_credit)) > double.Parse(this.d_up_kc_usable_credit)) { base.DeleteCreditLock(this.d_u_name); base.Un_User_Lock(rateKCByUserName.get_fgs_name()); base.noRightOptMsg("快彩: 設定增加‘信用額度’超過上级可以用餘額!"); } if (double.Parse(str11) > this.d_maxRate_kc) { base.DeleteCreditLock(this.d_u_name); base.Un_User_Lock(rateKCByUserName.get_fgs_name()); base.noRightOptMsg("快彩: 分公司占成 數不正确,请核实后重新输入!"); } num2 = double.Parse(str10) - double.Parse(this.d_kc_credit); if (double.Parse(str10) < (double.Parse(this.d_kc_credit) - Convert.ToDouble(this.d_kc_usable_credit))) { base.DeleteCreditLock(this.d_u_name); base.Un_User_Lock(rateKCByUserName.get_fgs_name()); base.noRightOptMsg("快彩: 設定減少‘信用額度’超過可‘回收’餘額!"); } if (str13.Equals("1")) { if (string.IsNullOrEmpty(str14)) { base.DeleteCreditLock(this.d_u_name); base.Un_User_Lock(rateKCByUserName.get_fgs_name()); base.noRightOptMsg("快彩:‘占成上限’不可為空,請修改!"); } try { if (Convert.ToInt32(str14) > 100) { base.DeleteCreditLock(this.d_u_name); base.Un_User_Lock(rateKCByUserName.get_fgs_name()); base.noRightOptMsg("快彩: ‘占成上限’不可高於 100%,請重新設定!"); } else if (Convert.ToInt32(str14) <= 0) { base.DeleteCreditLock(this.d_u_name); base.Un_User_Lock(rateKCByUserName.get_fgs_name()); base.noRightOptMsg("快彩: ‘占成上限’不可低於等於 0%,請重新設定!"); } } catch { base.DeleteCreditLock(this.d_u_name); base.Un_User_Lock(rateKCByUserName.get_fgs_name()); base.noRightOptMsg("快彩: ‘占成上限’只能為數字,請重新設定!"); } } } int num3 = 0; decimal num4 = 0M; decimal num5 = 0M; if (!string.IsNullOrEmpty(this.lottrty_six)) { num3 = Convert.ToInt32(str6); num4 = Convert.ToDecimal(num); num5 = Convert.ToDecimal(num); } int num6 = 0; decimal num7 = 0M; decimal num8 = 0M; if (!string.IsNullOrEmpty(this.lottrty_kc)) { num6 = Convert.ToInt32(str11); num7 = Convert.ToDecimal(num2); num8 = Convert.ToDecimal(num2); } cz_users _users = new cz_users(); _users.set_u_id(this.r_u_id.ToUpper()); _users.set_u_name(this.d_u_name); if (!string.IsNullOrEmpty(str4) && (str4 == "1")) { _users.set_retry_times(0); } if (!string.IsNullOrEmpty(str2)) { string ramSalt = Utils.GetRamSalt(6); _users.set_u_psw(DESEncrypt.EncryptString(str2, ramSalt)); _users.set_salt(ramSalt); } _users.set_u_nicker(str3); _users.set_a_state(new int?(Convert.ToInt32(str))); _users.set_u_type(this.d_u_type); _users.set_six_rate(new int?(num3)); _users.set_six_credit(new decimal?(num4)); _users.set_six_usable_credit(new decimal?(num5)); if (str8.Equals("1")) { _users.set_six_allow_maxrate(1); _users.set_six_low_maxrate(new int?(Convert.ToInt32(str9))); } else { _users.set_six_allow_maxrate(0); _users.set_six_low_maxrate(0); } _users.set_six_kind(str7.ToUpper()); if (!this.d_up_six_kind.Equals("0")) { _users.set_six_kind(this.d_up_six_kind.ToUpper()); } if (string.IsNullOrEmpty(this.lottrty_six)) { _users.set_six_kind(this.d_six_kind.ToUpper()); } _users.set_kc_rate(new int?(num6)); _users.set_kc_credit(new decimal?(num7)); _users.set_kc_usable_credit(new decimal?(num8)); if (str13.Equals("1")) { _users.set_kc_allow_maxrate(1); _users.set_kc_low_maxrate(new int?(Convert.ToInt32(str14))); } else { _users.set_kc_allow_maxrate(0); _users.set_kc_low_maxrate(0); } _users.set_kc_kind(str12.ToUpper()); if (!this.d_up_kc_kind.Equals("0")) { _users.set_kc_kind(this.d_up_kc_kind.ToUpper()); } if (string.IsNullOrEmpty(this.lottrty_kc)) { _users.set_kc_kind(this.d_kc_kind.ToUpper()); } bool flag2 = true; bool flag3 = true; if (this.d_six_ExistsBet && this.d_six_OpenPhase) { flag2 = false; _users.set_six_kind(this.d_six_kind.ToUpper()); } if (this.d_kc_ExistsBet && this.d_kc_OpenPhase) { flag3 = false; _users.set_kc_kind(this.d_kc_kind.ToUpper()); } DataTable userInfoTableByUID = CallBLL.cz_users_bll.GetUserInfoTableByUID(this.r_u_id); if (CallBLL.cz_users_bll.UpdateUserInfoHY(_users, flag2, flag3, this.d_up_u_type, this.d_up_u_name)) { base.user_edit_hy_log(userInfoTableByUID, CallBLL.cz_users_bll.GetUserInfoTableByUID(this.r_u_id), _users.get_u_name()); if (!this.d_kc_rate.Equals(_users.get_kc_rate().ToString())) { FileCacheHelper.UpdateRateFile_kc(); } if (!this.d_six_rate.Equals(_users.get_six_rate().ToString())) { FileCacheHelper.UpdateRateFile_six(); } if (!this.d_six_kind.ToUpper().Equals(_users.get_six_kind().ToUpper())) { FileCacheHelper.UpdateDrawbackFile(1, ""); } if (!this.d_kc_kind.ToUpper().Equals(_users.get_kc_kind().ToUpper())) { FileCacheHelper.UpdateDrawbackFile(2, ""); } FileCacheHelper.UpdateUserTxt(); base.DeleteCreditLock(this.d_u_name); base.Un_User_Lock(rateKCByUserName.get_fgs_name()); base.successOptMsg("修改會員成功!"); } else { base.DeleteCreditLock(this.d_u_name); base.Un_User_Lock(rateKCByUserName.get_fgs_name()); base.noRightOptMsg("修改會員失敗!"); } }
protected void Page_Load(object sender, EventArgs e) { string str; this.lotteryID = base.q("id"); this.userName = HttpContext.Current.Session["user_name"].ToString(); cz_users _users = CallBLL.cz_users_bll.UserLogin(this.userName); this.six_kind = _users.get_six_kind().Trim(); this.six_credit = Convert.ToDecimal(_users.get_six_credit()); this.six_usable_credit = Convert.ToDecimal(_users.get_six_usable_credit()); this.six_iscash = _users.get_six_iscash().ToString(); this.kc_kind = _users.get_kc_kind().Trim(); this.kc_credit = Convert.ToDecimal(_users.get_kc_credit()); this.kc_usable_credit = Convert.ToDecimal(_users.get_kc_usable_credit()); this.kc_iscash = _users.get_kc_iscash().ToString(); this.lotteryDT = base.GetLotteryList(); int num = 100; if (this.lotteryID == num.ToString()) { if (!FileCacheHelper.get_IsShowLM_B()) { this.sixDataTable = CallBLL.cz_drawback_six_bll.User_GetDrawBackList(HttpContext.Current.Session["user_name"].ToString(), "91060,91061,91062,91063,91064,91065").Tables[0]; } else { this.sixDataTable = CallBLL.cz_drawback_six_bll.GetDrawBackList(HttpContext.Current.Session["user_name"].ToString()).Tables[0]; } } num = 0; if (this.lotteryID == num.ToString()) { str = "86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,123,124,125,126,127,128,129,130,131,132,133,134,135,136"; this.kl10DataTable = CallBLL.cz_drawback_kl10_bll.GetDrawbackByPlayId(this.userName, str).Tables[0]; } num = 1; if (this.lotteryID == num.ToString()) { this.cqscDataTable = CallBLL.cz_drawback_cqsc_bll.GetDrawbackList(this.userName, "4,5,6,7,8,9,10,11,12,13,14,15").Tables[0]; } num = 2; if (this.lotteryID == num.ToString()) { this.pk10DataTable = CallBLL.cz_drawback_pk10_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } num = 3; if (this.lotteryID == num.ToString()) { this.xyncDataTable = CallBLL.cz_drawback_xync_bll.GetDrawbackList(this.userName, "86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,123,124,125,126,127,128,129,130,131,132,133,134,135,136").Tables[0]; } num = 4; if (this.lotteryID == num.ToString()) { this.jsk3DataTable = CallBLL.cz_drawback_jsk3_bll.GetDrawbackList(this.userName).Tables[0]; } num = 5; if (this.lotteryID == num.ToString()) { this.kl8DataTable = CallBLL.cz_drawback_kl8_bll.GetDrawbackList(this.userName).Tables[0]; } num = 6; if (this.lotteryID == num.ToString()) { this.k8scDataTable = CallBLL.cz_drawback_k8sc_bll.GetDrawbackList(this.userName, "4,5,6,7,8,9,10,11,12,13,14,15").Tables[0]; } num = 7; if (this.lotteryID == num.ToString()) { this.pcddDataTable = CallBLL.cz_drawback_pcdd_bll.GetDrawbackList(this.userName, "71009,71010,71011,71012").Tables[0]; } num = 9; if (this.lotteryID == num.ToString()) { this.xyft5DataTable = CallBLL.cz_drawback_xyft5_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } num = 8; if (this.lotteryID == num.ToString()) { this.pkbjlDataTable = CallBLL.cz_drawback_pkbjl_bll.GetDrawbackList(this.userName, "81001,81002,81003,81004").Tables[0]; } num = 10; if (this.lotteryID == num.ToString()) { this.jscarDataTable = CallBLL.cz_drawback_jscar_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } num = 11; if (this.lotteryID == num.ToString()) { this.speed5DataTable = CallBLL.cz_drawback_speed5_bll.GetDrawbackList(this.userName, "4,5,6,7,8,9,10,11,12,13,14,15").Tables[0]; } num = 13; if (this.lotteryID == num.ToString()) { this.jscqscDataTable = CallBLL.cz_drawback_jscqsc_bll.GetDrawbackList(this.userName, "4,5,6,7,8,9,10,11,12,13,14,15").Tables[0]; } num = 12; if (this.lotteryID == num.ToString()) { this.jspk10DataTable = CallBLL.cz_drawback_jspk10_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } num = 14; if (this.lotteryID == num.ToString()) { str = "86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,123,124,125,126,127,128,129,130,131,132,133,134,135,136"; this.jssfcDataTable = CallBLL.cz_drawback_jssfc_bll.GetDrawbackByPlayId(this.userName, str).Tables[0]; } num = 15; if (this.lotteryID == num.ToString()) { this.jsft2DataTable = CallBLL.cz_drawback_jsft2_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } num = 0x10; if (this.lotteryID == num.ToString()) { this.car168DataTable = CallBLL.cz_drawback_car168_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } num = 0x11; if (this.lotteryID == num.ToString()) { this.ssc168DataTable = CallBLL.cz_drawback_ssc168_bll.GetDrawbackList(this.userName, "4,5,6,7,8,9,10,11,12,13,14,15").Tables[0]; } num = 0x12; if (this.lotteryID == num.ToString()) { this.vrcarDataTable = CallBLL.cz_drawback_vrcar_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } num = 0x13; if (this.lotteryID == num.ToString()) { this.vrsscDataTable = CallBLL.cz_drawback_vrssc_bll.GetDrawbackList(this.userName, "4,5,6,7,8,9,10,11,12,13,14,15").Tables[0]; } num = 20; if (this.lotteryID == num.ToString()) { this.xyftoaDataTable = CallBLL.cz_drawback_xyftoa_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } num = 0x15; if (this.lotteryID == num.ToString()) { this.xyftsgDataTable = CallBLL.cz_drawback_xyftsg_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[0]; } num = 0x16; if (this.lotteryID == num.ToString()) { this.happycarDataTable = CallBLL.cz_drawback_happycar_bll.GetDrawbackList(this.userName, "1,2,3,4,36,37,38").Tables[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); } } } } } } }
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); } } } } } } }