Exemple #1
0
        private void AddUser()
        {
            LSRequest.qq("userName");
            string str     = LSRequest.qq("userPassword");
            string str2    = LSRequest.qq("userNicker");
            string str3    = LSRequest.qq("qx");
            string str4    = LSRequest.qq("unlock");
            string message = "";

            if (!base.ValidParamByUserEdit("child", ref message, null, null, null))
            {
                base.Response.Write(base.ShowDialogBox(message, null, 400));
                base.Response.End();
            }
            if (!string.IsNullOrEmpty(str.Trim()) && !Regexlib.IsValidPassword(str.Trim(), base.get_GetPasswordLU()))
            {
                if (base.get_GetPasswordLU().Equals("1"))
                {
                    base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!", null, 400));
                }
                else
                {
                    base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含字母、和数字!", null, 400));
                }
                base.Response.End();
            }
            cz_users_child _child = new cz_users_child();

            _child.set_u_id(this.u_id.ToString().ToUpper());
            _child.set_u_nicker(str2.Trim());
            if (!string.IsNullOrEmpty(str4) && (str4 == "1"))
            {
                _child.set_retry_times(0);
            }
            if (!string.IsNullOrEmpty(str))
            {
                string ramSalt = Utils.GetRamSalt(6);
                _child.set_u_psw(DESEncrypt.EncryptString(str, ramSalt));
                _child.set_salt(ramSalt);
            }
            _child.set_permissions_name(str3.Trim());
            cz_users_child userByUID = CallBLL.cz_users_child_bll.GetUserByUID(_child.get_u_id());

            if (CallBLL.cz_users_child_bll.UpdateUser(_child))
            {
                base.user_edit_children_log(userByUID, _child);
                base.Response.Write(base.ShowDialogBox("修改子帳號成功!", base.UserReturnBackUrl, 0));
                base.Response.End();
            }
            else
            {
                base.Response.Write(base.ShowDialogBox("修改子帳號失敗!", base.UserReturnBackUrl, 400));
                base.Response.End();
            }
        }
Exemple #2
0
        /// <summary>
        /// 返回列头
        /// </summary>
        /// <param name="template"></param>
        /// <returns></returns>
        public List <ExcelHeader> GetHeaderList(string template)
        {
            XmlTextReader reader = new XmlTextReader(template);
            XmlDocument   doc    = new XmlDocument();

            doc.Load(reader);
            List <ExcelHeader> headerList = new List <ExcelHeader>();

            foreach (XmlNode node in doc.DocumentElement.ChildNodes)
            {
                ExcelHeader header = new ExcelHeader();
                if (node.Attributes["HeaderText"] != null)
                {
                    header.HeaderText = node.Attributes["HeaderText"].Value;
                }
                if (node.Attributes["PropertyName"] != null)
                {
                    header.PropertyName = node.Attributes["PropertyName"].Value;
                }
                if (node.Attributes["DataType"] != null)
                {
                    header.DataType = node.Attributes["DataType"].Value;
                }
                if (node.Attributes["StringFormat"] != null)
                {
                    header.StringFormat = node.Attributes["StringFormat"].Value;
                }
                if (node.Attributes["MappingTo"] != null)
                {
                    header.MappingTo = node.Attributes["MappingTo"].Value;
                }
                if (node.Attributes["Width"] != null)
                {
                    string width = node.Attributes["Width"].Value;
                    if (Regexlib.MatchInt(width))
                    {
                        header.Width = int.Parse(width);
                    }
                }
                foreach (XmlNode subNode in node.ChildNodes)
                {
                    header.Mapping.Add(new Mapping
                    {
                        Original = subNode.Attributes["Original"].Value,
                        Target   = subNode.Attributes["Target"].Value
                    });
                }
                headerList.Add(header);
            }
            return(headerList);
        }
Exemple #3
0
        private void AddUser()
        {
            string str     = LSRequest.qq("userName").ToLower().Trim();
            string str2    = LSRequest.qq("userPassword");
            string str3    = LSRequest.qq("userNicker");
            string str4    = LSRequest.qq("qx");
            string message = "";

            if (!base.ValidParamByUserAdd("child", ref message, null, null, null))
            {
                base.Response.Write(base.ShowDialogBox(message, null, 400));
                base.Response.End();
            }
            if (!Regexlib.IsValidPassword(str2.Trim(), base.get_GetPasswordLU()))
            {
                if (base.get_GetPasswordLU().Equals("1"))
                {
                    base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!", null, 400));
                }
                else
                {
                    base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含字母、和数字!", null, 400));
                }
                base.Response.End();
            }
            cz_users_child model = new cz_users_child();

            model.set_u_id(Guid.NewGuid().ToString().ToUpper());
            model.set_u_name(str.Trim());
            model.set_u_nicker(str3.Trim());
            model.set_u_skin(base.GetUserSkin("agent"));
            string ramSalt = Utils.GetRamSalt(6);

            model.set_u_psw(DESEncrypt.EncryptString(str2, ramSalt));
            model.set_salt(ramSalt);
            model.set_parent_u_name(this.Session["user_name"].ToString());
            model.set_add_date(new DateTime?(DateTime.Now));
            model.set_status(0);
            model.set_permissions_name(str4.Trim());
            if (CallBLL.cz_users_child_bll.AddUser(model))
            {
                base.user_add_children_log(model);
                base.Response.Write(base.ShowDialogBox("添加子帳號成功!", base.UserReturnBackUrl, 0));
                base.Response.End();
            }
            else
            {
                base.Response.Write(base.ShowDialogBox("添加子帳號失敗!", base.UserReturnBackUrl, 400));
                base.Response.End();
            }
        }
Exemple #4
0
        private void AddUser()
        {
            LSRequest.qq("cloneName");
            string str     = LSRequest.qq("password");
            string str2    = LSRequest.qq("nicker");
            string str3    = LSRequest.qq("qx");
            string str4    = LSRequest.qq("isLocked");
            string message = "";

            if (!base.ValidParamByUserEditPhone("child", ref message, null, null, null))
            {
                base.noRightOptMsg(message);
            }
            if (!string.IsNullOrEmpty(str.Trim()) && !Regexlib.IsValidPassword(str.Trim(), base.get_GetPasswordLU()))
            {
                if (base.get_GetPasswordLU().Equals("1"))
                {
                    base.noRightOptMsg("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!");
                }
                else
                {
                    base.noRightOptMsg("密碼要8-20位,且必需包含字母、和数字!");
                }
            }
            cz_users_child _child = new cz_users_child();

            _child.set_u_id(this.u_id.ToString().ToUpper());
            _child.set_u_nicker(str2.Trim());
            if (!string.IsNullOrEmpty(str4) && (str4 == "1"))
            {
                _child.set_retry_times(0);
            }
            if (!string.IsNullOrEmpty(str))
            {
                string ramSalt = Utils.GetRamSalt(6);
                _child.set_u_psw(DESEncrypt.EncryptString(str, ramSalt));
                _child.set_salt(ramSalt);
            }
            _child.set_permissions_name(str3.Trim());
            cz_users_child userByUID = CallBLL.cz_users_child_bll.GetUserByUID(_child.get_u_id());

            if (CallBLL.cz_users_child_bll.UpdateUser(_child))
            {
                base.user_edit_children_log(userByUID, _child);
                base.successOptMsg("修改子帳號成功!");
            }
            else
            {
                base.noRightOptMsg("修改子帳號失敗!");
            }
        }
Exemple #5
0
        private void ck_phone(HttpContext context)
        {
            string phone = AppRequest.GetQueryString("phone", true);//电话号码

            if (!Regexlib.IsValidMobile(phone))
            {
                context.Response.Write(JsonHelper.ObjectToJSON(new { succeess = false, msg = "电话号码格式不正确" }));
                return;
            }
            try
            {
                if (LimitPhoneHelper.IsContains(phone))
                {
                    context.Response.Write(JsonHelper.ObjectToJSON(new { succeess = false, msg = "注册失败,网络错误" }));
                    return;
                }
                //string ckStatus = Utils.HttpGetUtf("http://monitor.qianniusoft.com/api/userBlacklist/ckUserBlackList?UserPhone=" + phone);
                //Dictionary<string, object> dicCK = JsonHelper.DataRowFromJSON(ckStatus);
                //if (dicCK.Count > 0)
                //{
                //    bool succuss = (bool)dicCK["succeess"];
                //    string msg = dicCK["msg"].ToString();
                //    if (!succuss)
                //    {
                //        context.Response.Write(JsonHelper.ObjectToJSON(new { succeess = false, msg = msg }));
                //        return;
                //    }
                //}
                //else
                //{
                //    context.Response.Write(JsonHelper.ObjectToJSON(new { succeess = false, msg = "注册失败,网络错误" }));
                //    return;
                //}
            }
            catch (Exception ex)
            {
            }
            context.Response.Write(JsonHelper.ObjectToJSON(new { succeess = true, msg = "该号码可以注册" }));
            return;
        }
Exemple #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string str  = LSRequest.qq("hdnsubmit");
            string str2 = LSRequest.qq("txtoldpwd");
            string str3 = LSRequest.qq("txtnewpwd");
            string str4 = LSRequest.qq("txtnewpwdcf");

            if (str.Equals("submit"))
            {
                if ((string.IsNullOrEmpty(str2) || string.IsNullOrEmpty(str3)) || string.IsNullOrEmpty(str4))
                {
                    base.Response.Write("<script>alert('請輸入完整的密碼!');</script>");
                    base.Response.End();
                }
                if (str3 == str2)
                {
                    base.Response.Write("<script>alert('新密碼和舊密碼不能相同!');</script>");
                    base.Response.End();
                }
                if (str3 != str4)
                {
                    base.Response.Write("<script>alert('新密碼和確認新密碼不一致!');</script>");
                    base.Response.End();
                }
                if (!Regexlib.IsValidPassword(str3.Trim(), base.get_GetPasswordLU()))
                {
                    if (base.get_GetPasswordLU().Equals("1"))
                    {
                        base.Response.Write("<script>alert('密碼要8-20位,且必需包含大寫字母、小寫字母和数字!');</script>");
                    }
                    else
                    {
                        base.Response.Write("<script>alert('密碼要8-20位,且必需包含字母、和数字!');</script>");
                    }
                    base.Response.End();
                }
                cz_users _users = CallBLL.cz_users_bll.UserLogin(this.Session["user_name"].ToString());
                if (_users != null)
                {
                    string str5 = _users.get_salt().Trim();
                    string str6 = DESEncrypt.EncryptString(str2, str5);
                    if (_users.get_u_psw() != str6)
                    {
                        base.Response.Write("<script>alert('您輸入原密碼不正確!');</script>");
                        base.Response.End();
                    }
                    else
                    {
                        string ramSalt = Utils.GetRamSalt(6);
                        string str8    = DESEncrypt.EncryptString(str3, ramSalt);
                        if (CallBLL.cz_users_bll.UpUserPwd(this.Session["user_name"].ToString(), str8, ramSalt) > 0)
                        {
                            if (CallBLL.cz_users_bll.UpdateUserPwdStutas(this.Session["user_name"].ToString()) > 0)
                            {
                                MemberPageBase.log_user_reset_password(this.Session["user_name"].ToString(), this.Session["modifypassword"]);
                                this.Session["modifypassword"] = null;
                                base.Response.Write("<script>alert('修改密碼成功!');location.href='Quit.aspx';</script>");
                                base.Response.End();
                            }
                            else
                            {
                                base.Response.Write("<script>alert('修改密碼不成功!');</script>");
                                base.Response.End();
                            }
                        }
                        else
                        {
                            base.Response.Write("<script>alert('修改密碼不成功!');</script>");
                            base.Response.End();
                        }
                    }
                }
            }
        }
Exemple #7
0
        private void AddUser()
        {
            cz_rate_kc rateKCByUserName = CallBLL.cz_rate_kc_bll.GetRateKCByUserName(this.d_u_name);

            base.En_User_Lock(rateKCByUserName.get_fgs_name());
            this.InitData();
            string str  = LSRequest.qq("userState");
            string str2 = LSRequest.qq("userPassword");
            string str3 = LSRequest.qq("userNicker");
            string str4 = LSRequest.qq("unlock");
            string s    = LSRequest.qq("userCredit_six");

            if (this.d_six_iscash.Equals("1"))
            {
                s = this.d_six_credit;
            }
            string str6  = LSRequest.qq("userRate_six");
            string str7  = LSRequest.qq("userAllowSale_six");
            string str8  = this.d_six_kind;
            string str9  = LSRequest.qq("allowmaxrate_six");
            string str10 = LSRequest.qq("lowmaxrate_six");
            string str11 = LSRequest.qq("userCredit_kc");

            if (this.d_kc_iscash.Equals("1"))
            {
                str11 = this.d_kc_credit;
            }
            string str12   = LSRequest.qq("userRate_kc");
            string str13   = LSRequest.qq("userAllowSale_kc");
            string str14   = this.d_kc_kind;
            string str15   = LSRequest.qq("allowmaxrate_kc");
            string str16   = LSRequest.qq("lowmaxrate_kc");
            string message = "";

            if (!base.ValidParamByUserEdit("dl", ref message, null, this.lottrty_six, this.lottrty_kc))
            {
                base.Response.Write(base.ShowDialogBox(message, null, 400));
                base.Response.End();
            }
            if (!string.IsNullOrEmpty(str2.Trim()) && !Regexlib.IsValidPassword(str2.Trim(), base.get_GetPasswordLU()))
            {
                if (base.get_GetPasswordLU().Equals("1"))
                {
                    base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!", null, 400));
                }
                else
                {
                    base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含字母、和数字!", null, 400));
                }
                base.Response.End();
            }
            int num = 0;

            if (LSRequest.qq("sltlimithy").ToString().Trim().Equals("0"))
            {
                num = 0;
            }
            else
            {
                string str19 = LSRequest.qq("txtlimithy") ?? "";
                if (!string.IsNullOrEmpty(str19))
                {
                    num = int.Parse(str19);
                }
                if (num < int.Parse(this.currentLimit))
                {
                    base.Response.Write(base.ShowDialogBox(string.Format("代理下線人數不能小於 {0} 人", this.currentLimit), null, 400));
                    base.Response.End();
                }
            }
            if ((!str.Equals("0") && !str.Equals("1")) && !str.Equals("2"))
            {
                base.Response.End();
            }
            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                if ((!str8.ToUpper().Equals("A") && !str8.ToUpper().Equals("B")) && (!str8.ToUpper().Equals("C") && !str8.ToUpper().Equals("0")))
                {
                    base.Response.End();
                }
                if (!str7.ToUpper().Equals("0") && !str7.ToUpper().Equals("1"))
                {
                    base.Response.Write("<script>alert(\"(⑥合彩)補貨功能选择错误!!\");</script>");
                    base.Response.End();
                }
                if ((this.d_up_six_allow_sale == "0") && (str7 == "1"))
                {
                    base.Response.Write("<script>alert(\"(⑥合彩)補貨功能选择错误!!\");</script>");
                    base.Response.End();
                }
            }
            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                if ((!str14.ToUpper().Equals("A") && !str14.ToUpper().Equals("B")) && (!str14.ToUpper().Equals("C") && !str14.ToUpper().Equals("0")))
                {
                    base.Response.End();
                }
                if (!str13.ToUpper().Equals("0") && !str13.ToUpper().Equals("1"))
                {
                    base.Response.Write("<script>alert(\"(快彩)補貨功能选择错误!!\");</script>");
                    base.Response.End();
                }
                if ((this.d_up_kc_allow_sale == "0") && (str13 == "1"))
                {
                    base.Response.Write("<script>alert(\"(快彩)補貨功能选择错误!!\");</script>");
                    base.Response.End();
                }
            }
            if ((double.Parse(s) - double.Parse(this.d_six_credit)) > double.Parse(this.d_up_six_usable_credit))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("⑥合彩: 設定增加‘信用額度’超過上级可以用餘額!", null, 400));
                base.Response.End();
            }
            if (double.Parse(str6) > this.d_maxRate_six)
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("⑥合彩: 分公司占成 數不正确,请核实后重新输入!", null, 400));
                base.Response.End();
            }
            double num2 = 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.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("⑥合彩: 設定減少‘信用額度’超過可‘回收’餘額!", null, 400));
                base.Response.End();
            }
            if (str9.Equals("1"))
            {
                if (string.IsNullOrEmpty(str10))
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox("⑥合彩:‘占成上限’不可為空,請修改!", null, 400));
                    base.Response.End();
                }
                try
                {
                    int.Parse(str10);
                }
                catch
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox("⑥合彩: ‘占成上限’只能為數字,請重新設定!", null, 400));
                    base.Response.End();
                }
                if (Convert.ToInt32(str10) > 100)
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox("⑥合彩: ‘占成上限’不可高於 100%,請重新設定!", null, 400));
                    base.Response.End();
                }
                else if (Convert.ToInt32(str10) < 0)
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox("⑥合彩: ‘占成上限’不可低於等於 0%,請重新設定!", null, 400));
                    base.Response.End();
                }
                if (double.Parse(str10) < this.d_downRate_six)
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox(string.Format("⑥合彩: ‘占成上限’不可低於 {0}%,請重新設定!", this.d_downRate_six), null, 400));
                    base.Response.End();
                }
            }
            else
            {
                str10 = "0";
            }
            if ((double.Parse(str11) - double.Parse(this.d_kc_credit)) > double.Parse(this.d_up_kc_usable_credit))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("快彩: 設定增加‘信用額度’超過上级可以用餘額!", null, 400));
                base.Response.End();
            }
            if (double.Parse(str12) > this.d_maxRate_kc)
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("快彩: 分公司占成 數不正确,请核实后重新输入!", null, 400));
                base.Response.End();
            }
            double num3 = double.Parse(str11) - double.Parse(this.d_kc_credit);

            if (double.Parse(str11) < (double.Parse(this.d_kc_credit) - Convert.ToDouble(this.d_kc_usable_credit)))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("快彩: 設定減少‘信用額度’超過可‘回收’餘額!", null, 400));
                base.Response.End();
            }
            if (str15.Equals("1"))
            {
                if (string.IsNullOrEmpty(str16))
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox("快彩:‘占成上限’不可為空,請修改!", null, 400));
                    base.Response.End();
                }
                try
                {
                    int.Parse(str16);
                }
                catch
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox("快彩: ‘占成上限’只能為數字,請重新設定!", null, 400));
                    base.Response.End();
                }
                if (Convert.ToInt32(str16) > 100)
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox("快彩: ‘占成上限’不可高於 100%,請重新設定!", null, 400));
                    base.Response.End();
                }
                else if (Convert.ToInt32(str16) < 0)
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox("快彩: ‘占成上限’不可低於等於 0%,請重新設定!", null, 400));
                    base.Response.End();
                }
                if (double.Parse(str16) < this.d_downRate_kc)
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox(string.Format("快彩: ‘占成上限’不可低於 {0}%,請重新設定!", this.d_downRate_kc), null, 400));
                    base.Response.End();
                }
            }
            else
            {
                str16 = "0";
            }
            int     num4 = 0;
            decimal num5 = 0M;
            decimal num6 = 0M;

            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                num4 = Convert.ToInt32(str6);
                num5 = Convert.ToDecimal(num2);
                num6 = Convert.ToDecimal(num2);
            }
            int     num7 = 0;
            decimal num8 = 0M;
            decimal num9 = 0M;

            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                num7 = Convert.ToInt32(str12);
                num8 = Convert.ToDecimal(num3);
                num9 = Convert.ToDecimal(num3);
            }
            cz_users _users = new cz_users();

            _users.set_u_id(this.r_u_id.ToUpper());
            _users.set_u_name(this.d_u_name);
            _users.set_limit_hy(new int?(num));
            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?(num4));
            _users.set_six_credit(new decimal?(num5));
            _users.set_six_usable_credit(new decimal?(num6));
            _users.set_allow_sale(new int?(Convert.ToInt32(str7)));
            if (str9.Equals("1"))
            {
                _users.set_six_allow_maxrate(1);
                _users.set_six_low_maxrate(new int?(Convert.ToInt32(str10)));
            }
            else
            {
                _users.set_six_allow_maxrate(0);
                _users.set_six_low_maxrate(0);
            }
            _users.set_kc_rate(new int?(num7));
            _users.set_kc_credit(new decimal?(num8));
            _users.set_kc_usable_credit(new decimal?(num9));
            _users.set_kc_allow_sale(new int?(Convert.ToInt32(str13)));
            if (str15.Equals("1"))
            {
                _users.set_kc_allow_maxrate(1);
                _users.set_kc_low_maxrate(new int?(Convert.ToInt32(str16)));
            }
            else
            {
                _users.set_kc_allow_maxrate(0);
                _users.set_kc_low_maxrate(0);
            }
            bool flag2 = true;
            bool flag3 = true;
            bool flag4 = false;
            bool flag5 = false;

            if (str7.Equals("0") && this.d_six_allow_sale.Equals("1"))
            {
                flag4 = true;
            }
            if (str13.Equals("0") && this.d_kc_allow_sale.Equals("1"))
            {
                flag5 = true;
            }
            if (this.d_six_ExistsBet && this.d_six_OpenPhase)
            {
                flag2 = false;
                _users.set_allow_sale(new int?(int.Parse(this.d_six_allow_sale)));
                flag4 = false;
            }
            if (this.d_kc_ExistsBet && this.d_kc_OpenPhase)
            {
                flag3 = false;
                _users.set_kc_allow_sale(new int?(int.Parse(this.d_kc_allow_sale)));
                flag5 = false;
            }
            if (string.IsNullOrEmpty(this.lottrty_six))
            {
                flag2 = false;
            }
            if (string.IsNullOrEmpty(this.lottrty_kc))
            {
                flag3 = false;
            }
            DataTable userInfoTableByUID = CallBLL.cz_users_bll.GetUserInfoTableByUID(this.r_u_id);

            if (CallBLL.cz_users_bll.UpdateUserInfo(_users, flag2, flag3, flag4, flag5, this.d_up_u_type, this.d_up_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();
                }
                base.user_edit_agent_log(userInfoTableByUID, CallBLL.cz_users_bll.GetUserInfoTableByUID(this.r_u_id), _users.get_u_name(), _users.get_u_type());
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("修改代理成功!", base.UserReturnBackUrl, 0));
                base.Response.End();
            }
            else
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("修改代理失敗!", base.UserReturnBackUrl, 400));
                base.Response.End();
            }
        }
Exemple #8
0
        public T Create <T>(List <ExcelHeader> list, Dictionary <string, object> mapping)
        {
            T model = default(T);

            model = Activator.CreateInstance <T>();//产生一个新的泛型对象
            foreach (ExcelHeader header in list)
            {
                string value = "";
                if (mapping.ContainsKey(header.PropertyName))
                {
                    value = mapping[header.PropertyName].ToString();
                }
                string property = header.PropertyName;

                if (header.Mapping.Count > 0)
                {
                    value    = header.Mapping.Find(s => s.Original == value).Target;
                    property = header.MappingTo;
                }
                PropertyInfo prop = model.GetType().GetProperty(property);
                try
                {
                    if (prop == null)
                    {
                        continue;
                    }

                    switch (header.DataType)
                    {
                    case "System.Decimal":
                        if (Regexlib.MatchDecimal(value))
                        {
                            prop.SetValue(model, Convert.ToDecimal(value), null);
                        }
                        break;

                    case "System.Int16":
                        if (Regexlib.MatchInt(value))
                        {
                            prop.SetValue(model, Convert.ToInt16(value), null);
                        }
                        break;

                    case "System.Int32":
                        if (Regexlib.MatchInt(value))
                        {
                            prop.SetValue(model, Convert.ToInt32(value), null);
                        }
                        break;

                    case "System.Boolean":
                        if (value != null && value.Length > 0)
                        {
                            prop.SetValue(model, Convert.ToBoolean(value), null);
                        }
                        break;

                    case "System.DateTime":
                        if (Regexlib.MatchDateTime(value))
                        {
                            prop.SetValue(model, Convert.ToDateTime(value), null);
                        }
                        break;

                    default:
                        prop.SetValue(model, value, null);
                        break;
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
            }
            return(model);
        }
Exemple #9
0
        private void userEditPwd(ref string strResult)
        {
            base.checkLoginByHandler(0);
            ReturnResult           result   = new ReturnResult();
            agent_userinfo_session _session = this.Session[this.Session["user_name"].ToString() + "lottery_session_user_info"] as agent_userinfo_session;
            string str  = LSRequest.qq("txtoldpwd");
            string str2 = LSRequest.qq("txtnewpwd");
            string str3 = LSRequest.qq("txtnewpwdcf");

            if ((string.IsNullOrEmpty(str) || string.IsNullOrEmpty(str2)) || string.IsNullOrEmpty(str3))
            {
                result.set_tipinfo("請輸入完整的密碼!");
                result.set_success(400);
                strResult = base.ObjectToJson(result);
            }
            else if (str2 == str)
            {
                result.set_tipinfo("新密碼和舊密碼不能相同!");
                result.set_success(400);
                strResult = base.ObjectToJson(result);
            }
            else if (str2 != str3)
            {
                result.set_tipinfo("新密碼和確認新密碼不一致!");
                result.set_success(400);
                strResult = base.ObjectToJson(result);
            }
            else if (!Regexlib.IsValidPassword(str2.Trim(), base.get_GetPasswordLU()))
            {
                if (base.get_GetPasswordLU().Equals("1"))
                {
                    result.set_tipinfo("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!");
                    result.set_success(400);
                    strResult = base.ObjectToJson(result);
                }
                else
                {
                    result.set_tipinfo("密碼要8-20位,且必需包含字母、和数字!");
                    result.set_success(400);
                    strResult = base.ObjectToJson(result);
                }
            }
            else if (_session.get_users_child_session() == null)
            {
                cz_users _users = CallBLL.cz_users_bll.AgentLogin(this.Session["user_name"].ToString());
                if (_users != null)
                {
                    string str4 = _users.get_salt().Trim();
                    string str5 = DESEncrypt.EncryptString(str, str4);
                    if (_users.get_u_psw() != str5)
                    {
                        result.set_tipinfo("您輸入原密碼不正確!");
                        result.set_success(400);
                        strResult = base.ObjectToJson(result);
                    }
                    else
                    {
                        string ramSalt = Utils.GetRamSalt(6);
                        if (CallBLL.cz_users_bll.UpUserPwd(this.Session["user_name"].ToString(), DESEncrypt.EncryptString(str2, ramSalt), ramSalt) > 0)
                        {
                            int num = CallBLL.cz_users_bll.UpdateUserPwdStutas(this.Session["user_name"].ToString());
                            base.log_user_reset_password(this.Session["user_name"].ToString(), this.Session["user_name"].ToString(), "", this.Session["modifypassword"]);
                            this.Session["modifypassword"] = null;
                            this.Session.Abandon();
                            result.set_tipinfo("修改密碼成功!");
                            result.set_success(210);
                            strResult = base.ObjectToJson(result);
                        }
                        else
                        {
                            result.set_tipinfo("修改密碼失敗!");
                            result.set_success(400);
                            strResult = base.ObjectToJson(result);
                        }
                    }
                }
            }
            else
            {
                cz_users_child _child = CallBLL.cz_users_child_bll.AgentLogin(this.Session["child_user_name"].ToString().ToLower());
                if (_child != null)
                {
                    string str7 = _child.get_salt().Trim();
                    string str8 = DESEncrypt.EncryptString(str, str7);
                    if (_child.get_u_psw() != str8)
                    {
                        result.set_tipinfo("您輸入原密碼不正確!");
                        result.set_success(400);
                        strResult = base.ObjectToJson(result);
                    }
                    else
                    {
                        string str9 = Utils.GetRamSalt(6);
                        if (CallBLL.cz_users_child_bll.UpUserPwd(this.Session["child_user_name"].ToString(), DESEncrypt.EncryptString(str2, str9), str9) > 0)
                        {
                            int num2 = CallBLL.cz_users_bll.UpdateUserPwdStutas(this.Session["child_user_name"].ToString().ToLower());
                            base.log_user_reset_password(this.Session["child_user_name"].ToString(), this.Session["child_user_name"].ToString(), "", this.Session["modifypassword"]);
                            this.Session["modifypassword"] = null;
                            this.Session.Abandon();
                            result.set_tipinfo("修改密碼成功!");
                            result.set_success(210);
                            strResult = base.ObjectToJson(result);
                        }
                        else
                        {
                            result.set_tipinfo("修改密碼失敗!");
                            result.set_success(400);
                            strResult = base.ObjectToJson(result);
                        }
                    }
                }
            }
        }
Exemple #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Response.Expires = 0;
        base.IsUserLoginByMobile();
        cz_userinfo_session getUserModelInfo = base.GetUserModelInfo;
        string str  = LSRequest.qq("hdnsubmit");
        string str2 = LSRequest.qq("VIP_PWD_old");
        string str3 = LSRequest.qq("VIP_PWD");
        string str4 = LSRequest.qq("VIP_PWD1");

        if (str.Equals("submit"))
        {
            if ((string.IsNullOrEmpty(str2) || string.IsNullOrEmpty(str3)) || string.IsNullOrEmpty(str4))
            {
                base.Response.Write("請輸入完整的密碼!");
                base.Response.End();
            }
            if (str3 == str2)
            {
                base.Response.Write("新密碼和舊密碼不能相同!");
                base.Response.End();
            }
            if (str3 != str4)
            {
                base.Response.Write("新密碼和確認新密碼不一致!");
                base.Response.End();
            }
            if (!Regexlib.IsValidPassword(str3.Trim(), base.get_GetPasswordLU()))
            {
                if (base.get_GetPasswordLU().Equals("1"))
                {
                    base.Response.Write("<script>alert('密碼要8-20位,且必需包含大寫字母、小寫字母和数字!');</script>");
                }
                else
                {
                    base.Response.Write("<script>alert('密碼要8-20位,且必需包含字母、和数字!');</script>");
                }
                base.Response.End();
            }
            cz_users _users = CallBLL.cz_users_bll.UserLogin(this.Session["user_name"].ToString());
            if (_users != null)
            {
                string str5 = _users.get_salt().Trim();
                string str6 = DESEncrypt.EncryptString(str2, str5);
                if (_users.get_u_psw() != str6)
                {
                    base.Response.Write("您輸入原密碼不正確!");
                    base.Response.End();
                }
                else
                {
                    string ramSalt = Utils.GetRamSalt(6);
                    string str8    = DESEncrypt.EncryptString(str3, ramSalt);
                    if (CallBLL.cz_users_bll.UpUserPwd(this.Session["user_name"].ToString(), str8, ramSalt) > 0)
                    {
                        if (CallBLL.cz_users_bll.UpdateUserPwdStutas(this.Session["user_name"].ToString()) > 0)
                        {
                            MemberPageBase.log_user_reset_password(this.Session["user_name"].ToString(), this.Session["modifypassword"]);
                            base.Response.Write("true");
                            base.Response.End();
                        }
                        else
                        {
                            base.Response.Write("修改密碼不成功!");
                            base.Response.End();
                        }
                    }
                    else
                    {
                        base.Response.Write("修改密碼不成功!");
                        base.Response.End();
                    }
                }
            }
        }
    }
Exemple #11
0
        private void AddUser()
        {
            string str     = LSRequest.qq("userName").ToLower().Trim();
            string str2    = "0";
            string str3    = LSRequest.qq("userPassword");
            string str4    = LSRequest.qq("userNicker");
            string str5    = LSRequest.qq("userReport");
            string str6    = LSRequest.qq("userCredit_six");
            string str7    = LSRequest.qq("userRate_six");
            string str8    = LSRequest.qq("userAllowSale_six");
            string str9    = LSRequest.qq("userRateOwner_six");
            string str10   = LSRequest.qq("userKind_six");
            string str11   = LSRequest.qq("op_six");
            string str12   = LSRequest.qq("userCredit_kc");
            string str13   = LSRequest.qq("userRate_kc");
            string str14   = LSRequest.qq("userAllowSale_kc");
            string str15   = LSRequest.qq("userRateOwner_kc");
            string str16   = LSRequest.qq("userKind_kc");
            string str17   = LSRequest.qq("isCash_kc");
            string str18   = LSRequest.qq("isCash_six");
            string str19   = LSRequest.qq("op_kc");
            string str20   = LSRequest.qq("isAutoBack_kc");
            string message = "";

            if (!base.ValidParamByUserAdd("fgs", ref message, null, this.lottrty_six, this.lottrty_kc))
            {
                base.noRightOptMsg(message);
            }
            if (!Regexlib.IsValidPassword(str3.Trim(), base.get_GetPasswordLU()))
            {
                if (base.get_GetPasswordLU().Equals("1"))
                {
                    base.noRightOptMsg("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!");
                }
                else
                {
                    base.noRightOptMsg("<script>alert('密碼要8-20位,且必需包含字母、和数字!');</script>");
                }
            }
            if (!str5.ToUpper().Equals("0") && !str5.ToUpper().Equals("1"))
            {
                base.Response.End();
            }
            if (!str17.ToUpper().Equals("0") && !str17.ToUpper().Equals("1"))
            {
                base.Response.End();
            }
            if (!str18.ToUpper().Equals("0") && !str18.ToUpper().Equals("1"))
            {
                base.Response.End();
            }
            if (!str11.ToUpper().Equals("0") && !str11.ToUpper().Equals("1"))
            {
                base.Response.End();
            }
            if (!str19.ToUpper().Equals("0") && !str19.ToUpper().Equals("1"))
            {
                base.Response.End();
            }
            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                if ((!str10.ToUpper().Equals("A") && !str10.ToUpper().Equals("B")) && (!str10.ToUpper().Equals("C") && !str10.ToUpper().Equals("0")))
                {
                    base.Response.End();
                }
                if (!str8.ToUpper().Equals("0") && !str8.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
                if (!str9.ToUpper().Equals("0") && !str9.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
            }
            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                if ((!str16.ToUpper().Equals("A") && !str16.ToUpper().Equals("B")) && (!str16.ToUpper().Equals("C") && !str16.ToUpper().Equals("0")))
                {
                    base.Response.End();
                }
                if (!str14.ToUpper().Equals("0") && !str14.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
                if (!str15.ToUpper().Equals("0") && !str15.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
            }
            int     num  = 100;
            decimal num2 = 0M;
            decimal num3 = 0M;

            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                num  = Convert.ToInt32(str7);
                num2 = Convert.ToDecimal(str6);
                num3 = Convert.ToDecimal(str6);
            }
            int     num4 = 100;
            decimal num5 = 0M;
            decimal num6 = 0M;

            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                num4 = Convert.ToInt32(str13);
                num5 = Convert.ToDecimal(str12);
                num6 = Convert.ToDecimal(str12);
            }
            cz_users model = new cz_users();

            model.set_u_id(Guid.NewGuid().ToString().ToUpper());
            model.set_u_name(str);
            string ramSalt = Utils.GetRamSalt(6);

            model.set_u_psw(DESEncrypt.EncryptString(str3, ramSalt));
            model.set_salt(ramSalt);
            model.set_u_nicker(str4);
            model.set_u_skin(base.GetUserSkin("agent"));
            model.set_sup_name(this.Session["user_name"].ToString());
            model.set_u_type("fgs");
            model.set_su_type("zj");
            model.set_add_date(new DateTime?(DateTime.Now));
            model.set_six_rate(new int?(num));
            model.set_six_credit(new decimal?(num2));
            model.set_six_usable_credit(new decimal?(num3));
            model.set_six_kind(str10);
            model.set_a_state(new int?(Convert.ToInt32(str2)));
            model.set_allow_sale(new int?(Convert.ToInt32(str8)));
            model.set_allow_view_report(new int?(Convert.ToInt32(str5)));
            model.set_six_allow_maxrate(0);
            model.set_six_low_maxrate(0);
            model.set_six_rate_owner(new int?(Convert.ToInt32(str9)));
            model.set_six_iscash(new int?(Convert.ToInt32(str18)));
            model.set_allow_opt(1);
            model.set_is_changed(0);
            model.set_kc_rate(new int?(num4));
            model.set_kc_credit(new decimal?(num5));
            model.set_kc_usable_credit(new decimal?(num6));
            model.set_kc_kind(str16);
            model.set_kc_allow_sale(new int?(Convert.ToInt32(str14)));
            model.set_kc_allow_maxrate(0);
            model.set_kc_low_maxrate(0);
            model.set_kc_rate_owner(new int?(Convert.ToInt32(str15)));
            model.set_kc_crash_payment(0);
            model.set_kc_iscash(new int?(Convert.ToInt32(str17)));
            model.set_six_op_odds(new int?(Convert.ToInt32(str11)));
            model.set_kc_op_odds(new int?(Convert.ToInt32(str19)));
            if (base.get_GetIsShowFgsWT().Equals("0"))
            {
                model.set_six_op_odds(0);
                model.set_kc_op_odds(0);
            }
            model.set_kc_isauto_back(new int?(Convert.ToInt32(str20)));
            cz_rate_kc _kc = new cz_rate_kc();

            _kc.set_u_name(str);
            _kc.set_u_type("fgs");
            _kc.set_dl_name("");
            _kc.set_zd_name("");
            _kc.set_gd_name("");
            _kc.set_fgs_name(str);
            _kc.set_dl_rate(0);
            _kc.set_zd_rate(0);
            _kc.set_gd_rate(0);
            _kc.set_fgs_rate(0);
            _kc.set_zj_rate(new decimal?(num4));
            cz_rate_six _six = new cz_rate_six();

            _six.set_u_name(str);
            _six.set_u_type("fgs");
            _six.set_dl_name("");
            _six.set_zd_name("");
            _six.set_gd_name("");
            _six.set_fgs_name(str);
            _six.set_dl_rate(0);
            _six.set_zd_rate(0);
            _six.set_gd_rate(0);
            _six.set_fgs_rate(0);
            _six.set_zj_rate(new decimal?(num));
            string str23 = "";
            Dictionary <string, string> data = new Dictionary <string, string>();

            if (CallBLL.cz_users_bll.AddUserInfoFGS(model, _kc, _six, ref str23))
            {
                int num7 = 2;
                if (this.lottrty_six == "")
                {
                    num7 = 1;
                }
                else if (this.lottrty_kc == "")
                {
                    num7 = 0;
                }
                else if ((this.lottrty_kc != "") && (this.lottrty_six != ""))
                {
                    num7 = 2;
                }
                base.user_add_fgs_log(model, num7);
                string text1 = "/Account/drawback.aspx?uid=" + str23 + "&isadd=1";
                data.Add("uname", model.get_u_name());
                data.Add("uid", model.get_u_id());
                base.successOptMsg("添加分公司成功!", data);
            }
            else
            {
                base.noRightOptMsg("添加分公司失敗!");
            }
        }
Exemple #12
0
        private void AddUser()
        {
            string str  = LSRequest.qq("userName").ToLower().Trim();
            string str2 = "0";
            string str3 = LSRequest.qq("userPassword");
            string str4 = LSRequest.qq("userNicker");

            this.upuname = this.u_name;
            string str5 = LSRequest.qq("userCredit_six");
            string str6 = LSRequest.qq("allowmaxrate_six");
            string str7 = LSRequest.qq("lowmaxrate_six");
            string str8 = LSRequest.qq("userAllowSale_six");
            string str9 = LSRequest.qq("userKind_six");

            if (!this.six_kind_d.Equals("0"))
            {
                str9 = this.six_kind_d;
            }
            if (string.IsNullOrEmpty(str5))
            {
                str5 = "0";
            }
            if (string.IsNullOrEmpty(str9))
            {
                str9 = "0";
            }
            string str10 = LSRequest.qq("userCredit_kc");
            string str11 = LSRequest.qq("allowmaxrate_kc");
            string str12 = LSRequest.qq("lowmaxrate_kc");
            string str13 = LSRequest.qq("userAllowSale_kc");
            string str14 = LSRequest.qq("userKind_kc");

            if (!this.kc_kind_d.Equals("0"))
            {
                str14 = this.kc_kind_d;
            }
            if (string.IsNullOrEmpty(str10))
            {
                str10 = "0";
            }
            if (string.IsNullOrEmpty(str14))
            {
                str14 = "0";
            }
            string message = "";

            if (!base.ValidParamByUserAdd("zd", ref message, null, this.lottrty_six, this.lottrty_kc))
            {
                base.Response.Write(base.ShowDialogBox(message, null, 400));
                base.Response.End();
            }
            if (!Regexlib.IsValidPassword(str3.Trim(), base.get_GetPasswordLU()))
            {
                if (base.get_GetPasswordLU().Equals("1"))
                {
                    base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!", null, 400));
                }
                else
                {
                    base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含字母、和数字!", null, 400));
                }
                base.Response.End();
            }
            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                if ((!str9.ToUpper().Equals("A") && !str9.ToUpper().Equals("B")) && (!str9.ToUpper().Equals("C") && !str9.ToUpper().Equals("0")))
                {
                    base.Response.End();
                }
                if (!str8.ToUpper().Equals("0") && !str8.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
                if ((this.six_allow_sale_d == "0") && (str8 == "1"))
                {
                    base.Response.Write("<script>alert(\"(⑥合彩)補貨功能选择错误!!\");</script>");
                    base.Response.End();
                }
            }
            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                if ((!str14.ToUpper().Equals("A") && !str14.ToUpper().Equals("B")) && (!str14.ToUpper().Equals("C") && !str14.ToUpper().Equals("0")))
                {
                    base.Response.End();
                }
                if (!str13.ToUpper().Equals("0") && !str13.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
                if ((this.kc_allow_sale_d == "0") && (str13 == "1"))
                {
                    base.Response.Write("<script>alert(\"(快彩)補貨功能选择错误!!\");</script>");
                    base.Response.End();
                }
            }
            cz_rate_kc rateKCByUserName = CallBLL.cz_rate_kc_bll.GetRateKCByUserName(this.upuname);

            base.En_User_Lock(rateKCByUserName.get_fgs_name());
            if (Convert.ToDouble(str5) > Convert.ToDouble(this.six_usable_credit_d))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("⑥合彩:‘信用額度’已超過‘上級可用餘額’,請修改!", null, 400));
                base.Response.End();
            }
            string str16 = LSRequest.qq("userRate_six");

            if (string.IsNullOrEmpty(str16))
            {
                str16 = "0";
            }
            if (Convert.ToDouble(str16) > Convert.ToDouble(this.six_rate_d))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("⑥合彩: 股東占成 不可高於" + this.six_rate_d + ",請修改!", null, 400));
                base.Response.End();
            }
            if (str6.Equals("1"))
            {
                if (string.IsNullOrEmpty(str7))
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox("⑥合彩:‘占成上限’不可為空,請修改!", null, 400));
                    base.Response.End();
                }
                try
                {
                    int.Parse(str7);
                }
                catch
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox("⑥合彩: ‘占成上限’只能為數字,請重新設定!", null, 400));
                    base.Response.End();
                }
                if (Convert.ToInt32(str7) > 100)
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox("⑥合彩: ‘占成上限’不可高於 100%,請重新設定!", null, 400));
                    base.Response.End();
                }
                else if (Convert.ToInt32(str7) < 0)
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox("⑥合彩: ‘占成上限’不可低於等於 0%,請重新設定!", null, 400));
                    base.Response.End();
                }
            }
            else
            {
                str7 = "0";
            }
            if (Convert.ToDouble(str10) > Convert.ToDouble(this.kc_usable_credit_d))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("快彩:‘信用額度’已超過‘上級可用餘額’,請修改!", null, 400));
                base.Response.End();
            }
            string str17 = LSRequest.qq("userRate_kc");

            if (string.IsNullOrEmpty(str17))
            {
                str17 = "0";
            }
            if (Convert.ToDouble(str17) > Convert.ToDouble(this.kc_rate_d))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("快彩: 股東占成 不可高於" + this.kc_rate_d + ",請修改!", null, 400));
                base.Response.End();
            }
            if (str11.Equals("1"))
            {
                if (string.IsNullOrEmpty(str12))
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox("快彩:‘占成上限’不可為空,請修改!", null, 400));
                    base.Response.End();
                }
                try
                {
                    int.Parse(str12);
                }
                catch
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox("快彩: ‘占成上限’只能為數字,請重新設定!", null, 400));
                    base.Response.End();
                }
                if (Convert.ToInt32(str12) > 100)
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox("快彩: ‘占成上限’不可高於 100%,請重新設定!", null, 400));
                    base.Response.End();
                }
                else if (Convert.ToInt32(str12) < 0)
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.Response.Write(base.ShowDialogBox("快彩: ‘占成上限’不可低於等於 0%,請重新設定!", null, 400));
                    base.Response.End();
                }
            }
            else
            {
                str12 = "0";
            }
            int     num  = 0;
            decimal num2 = 0M;
            decimal num3 = 0M;

            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                num  = Convert.ToInt32(str16);
                num2 = Convert.ToDecimal(str5);
                num3 = Convert.ToDecimal(str5);
            }
            int     num4 = 0;
            decimal num5 = 0M;
            decimal num6 = 0M;

            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                num4 = Convert.ToInt32(str17);
                num5 = Convert.ToDecimal(str10);
                num6 = Convert.ToDecimal(str10);
            }
            cz_users model = new cz_users();

            model.set_u_id(Guid.NewGuid().ToString().ToUpper());
            model.set_u_name(str);
            string ramSalt = Utils.GetRamSalt(6);

            model.set_u_psw(DESEncrypt.EncryptString(str3, ramSalt));
            model.set_salt(ramSalt);
            model.set_u_nicker(str4);
            model.set_u_skin(base.GetUserSkin("agent"));
            model.set_sup_name(this.upuname);
            model.set_u_type("zd");
            model.set_su_type("gd");
            model.set_add_date(new DateTime?(DateTime.Now));
            model.set_six_rate(new int?(num));
            model.set_six_credit(new decimal?(num2));
            model.set_six_usable_credit(new decimal?(num3));
            model.set_six_kind(str9);
            model.set_a_state(new int?(Convert.ToInt32(str2)));
            model.set_allow_sale(new int?(Convert.ToInt32(str8)));
            model.set_six_allow_maxrate(new int?(Convert.ToInt32(str6)));
            model.set_six_low_maxrate(new int?(Convert.ToInt32(str7)));
            model.set_allow_opt(1);
            model.set_is_changed(0);
            model.set_kc_rate(new int?(num4));
            model.set_kc_credit(new decimal?(num5));
            model.set_kc_usable_credit(new decimal?(num6));
            model.set_kc_kind(str14);
            model.set_kc_allow_sale(new int?(Convert.ToInt32(str13)));
            model.set_kc_allow_maxrate(new int?(Convert.ToInt32(str11)));
            model.set_kc_low_maxrate(new int?(Convert.ToInt32(str12)));
            model.set_kc_crash_payment(0);
            model.set_kc_iscash(new int?(Convert.ToInt32(this.kc_iscash)));
            model.set_six_iscash(new int?(Convert.ToInt32(this.six_iscash)));
            cz_rate_kc _kc2 = new cz_rate_kc();

            _kc2.set_u_name(str);
            _kc2.set_u_type("zd");
            _kc2.set_dl_name("");
            _kc2.set_zd_name(str);
            _kc2.set_gd_name(this.kc_gd_name);
            _kc2.set_fgs_name(this.kc_fgs_name);
            _kc2.set_dl_rate(0);
            _kc2.set_zd_rate(0);
            _kc2.set_gd_rate(new decimal?(num4));
            _kc2.set_fgs_rate(new decimal?(Convert.ToDecimal(this.kc_fgs_rate)));
            _kc2.set_zj_rate(new decimal?(Convert.ToDecimal(this.kc_zj_rate)));
            cz_rate_six _six = new cz_rate_six();

            _six.set_u_name(str);
            _six.set_u_type("zd");
            _six.set_dl_name("");
            _six.set_zd_name(str);
            _six.set_gd_name(this.six_gd_name);
            _six.set_fgs_name(this.six_fgs_name);
            _six.set_dl_rate(0);
            _six.set_zd_rate(0);
            _six.set_gd_rate(new decimal?(num));
            _six.set_fgs_rate(new decimal?(Convert.ToDecimal(this.six_fgs_rate)));
            _six.set_zj_rate(new decimal?(Convert.ToDecimal(this.six_zj_rate)));
            string str19 = "";

            if (CallBLL.cz_users_bll.AddUserInfo(model, _kc2, _six, ref str19))
            {
                int?nullable = model.get_six_iscash();
                int num8     = int.Parse("1");
                if ((nullable.GetValueOrDefault() == num8) && nullable.HasValue)
                {
                    cz_users _users2 = new cz_users();
                    _users2.set_u_name(model.get_u_name());
                    _users2.set_six_usable_credit(0);
                    cz_users _users3 = new cz_users();
                    _users3.set_u_name(model.get_sup_name());
                    _users3.set_six_usable_credit(new decimal?(decimal.Parse(this.six_usable_credit_d)));
                    int num9 = 1;
                    if (base.IsMasterLotteryExist(num9.ToString()))
                    {
                        base.UserRecharge_six(_users2, _users3, str5);
                    }
                }
                int?nullable2 = model.get_kc_iscash();
                int num10     = int.Parse("1");
                if ((nullable2.GetValueOrDefault() == num10) && nullable2.HasValue)
                {
                    cz_users _users4 = new cz_users();
                    _users4.set_u_name(model.get_u_name());
                    _users4.set_kc_usable_credit(0);
                    cz_users _users5 = new cz_users();
                    _users5.set_u_name(model.get_sup_name());
                    _users5.set_kc_usable_credit(new decimal?(decimal.Parse(this.kc_usable_credit_d)));
                    int num11 = 2;
                    if (base.IsMasterLotteryExist(num11.ToString()))
                    {
                        base.UserRecharge_kc(_users4, _users5, str10);
                    }
                }
                int num7 = 2;
                if (this.lottrty_six == "")
                {
                    num7 = 1;
                }
                else if (this.lottrty_kc == "")
                {
                    num7 = 0;
                }
                else if ((this.lottrty_kc != "") && (this.lottrty_six != ""))
                {
                    num7 = 2;
                }
                base.user_add_agent_log(model, num7);
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                string url = "/Account/drawback.aspx?uid=" + str19 + "&isadd=1";
                base.Response.Write(base.ShowDialogBox("添加總代理成功!", url, 0));
                base.Response.End();
            }
            else
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("添加總代理失敗!", base.UserReturnBackUrl, 400));
                base.Response.End();
            }
        }
Exemple #13
0
        private void AddUser()
        {
            string str  = LSRequest.qq("userState");
            string str2 = LSRequest.qq("password");
            string str3 = LSRequest.qq("nicker");
            string str4 = LSRequest.qq("userReport");
            string str5 = LSRequest.qq("isLocked");
            string s    = LSRequest.qq("userCreditSix");

            if (this.d_six_iscash.Equals("1"))
            {
                s = this.d_six_credit;
            }
            string str7  = LSRequest.qq("userRateSix");
            string str8  = LSRequest.qq("userAllowSaleSix");
            string str9  = LSRequest.qq("userRateOwnerSix");
            string str10 = LSRequest.qq("userKindSix");
            string str11 = LSRequest.qq("opSix");
            string str12 = "0";
            string str13 = LSRequest.qq("userCreditKc");

            if (this.d_kc_iscash.Equals("1"))
            {
                str13 = this.d_kc_credit;
            }
            string str14   = LSRequest.qq("userRateKc");
            string str15   = LSRequest.qq("userAllowSaleKc");
            string str16   = LSRequest.qq("userRateOwnerKc");
            string str17   = LSRequest.qq("userKindKc");
            string str18   = LSRequest.qq("opKc");
            string str19   = "0";
            string message = "";

            if (!base.ValidParamByUserEditPhone("fgs", ref message, null, this.lottrty_six, this.lottrty_kc))
            {
                base.noRightOptMsg(message);
            }
            if (!string.IsNullOrEmpty(str2.Trim()) && !Regexlib.IsValidPassword(str2.Trim(), base.get_GetPasswordLU()))
            {
                if (base.get_GetPasswordLU().Equals("1"))
                {
                    base.noRightOptMsg("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!");
                }
                else
                {
                    base.noRightOptMsg("密碼要8-20位,且必需包含字母、和数字!");
                }
                base.Response.End();
            }
            if ((!str.Equals("0") && !str.Equals("1")) && !str.Equals("2"))
            {
                base.Response.End();
            }
            if (!str4.ToUpper().Equals("0") && !str4.ToUpper().Equals("1"))
            {
                base.Response.End();
            }
            if (!str11.ToUpper().Equals("0") && !str11.ToUpper().Equals("1"))
            {
                base.Response.End();
            }
            if (!str18.ToUpper().Equals("0") && !str18.ToUpper().Equals("1"))
            {
                base.Response.End();
            }
            if (!str19.Equals("0") && !str19.Equals("1"))
            {
                base.Response.End();
            }
            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                if ((!str10.ToUpper().Equals("A") && !str10.ToUpper().Equals("B")) && (!str10.ToUpper().Equals("C") && !str10.ToUpper().Equals("0")))
                {
                    base.Response.End();
                }
                if (!str8.ToUpper().Equals("0") && !str8.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
                if (!str9.ToUpper().Equals("0") && !str9.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
            }
            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                if ((!str17.ToUpper().Equals("A") && !str17.ToUpper().Equals("B")) && (!str17.ToUpper().Equals("C") && !str17.ToUpper().Equals("0")))
                {
                    base.Response.End();
                }
                if (!str15.ToUpper().Equals("0") && !str15.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
                if (!str16.ToUpper().Equals("0") && !str16.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
            }
            base.En_User_Lock(this.d_u_name);
            double num = 0.0;

            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                if (!string.IsNullOrEmpty(this.lottrty_six) && (double.Parse(str7) < double.Parse(base.get_ZJMinRate_SIX())))
                {
                    base.Un_User_Lock(this.d_u_name);
                    base.noRightOptMsg("⑥合彩:總監占成不可低於 " + base.get_ZJMinRate_SIX() + "% ,請重新設定!");
                }
                if (double.Parse(str7) > this.d_maxRate_six)
                {
                    base.Un_User_Lock(this.d_u_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.Un_User_Lock(this.d_u_name);
                    base.noRightOptMsg("⑥合彩: 設定減少‘信用額度’超過可‘回收’餘額!!");
                }
            }
            double num2 = 0.0;

            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                if (!string.IsNullOrEmpty(this.lottrty_kc) && (double.Parse(str14) < double.Parse(base.get_ZJMinRate_KC())))
                {
                    base.Un_User_Lock(this.d_u_name);
                    base.noRightOptMsg("快彩:總監占成不可低於 " + base.get_ZJMinRate_KC() + "% ,請重新設定!");
                }
                if (double.Parse(str14) > this.d_maxRate_kc)
                {
                    base.Un_User_Lock(this.d_u_name);
                    base.noRightOptMsg("快彩:總監占成 數不正确,请核实后重新输入!");
                }
                num2 = double.Parse(str13) - double.Parse(this.d_kc_credit);
                if (double.Parse(str13) < (double.Parse(this.d_kc_credit) - Convert.ToDouble(this.d_kc_usable_credit)))
                {
                    base.Un_User_Lock(this.d_u_name);
                    base.noRightOptMsg("快彩: 設定減少‘信用額度’超過可‘回收’餘額!!");
                }
            }
            int     num3 = 0;
            decimal num4 = 0M;
            decimal num5 = 0M;

            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                num3 = Convert.ToInt32(str7);
                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(str14);
                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(str5) && (str5 == "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_allow_view_report(new int?(Convert.ToInt32(str4)));
            _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));
            _users.set_allow_sale(new int?(Convert.ToInt32(str8)));
            _users.set_six_rate_owner(new int?(Convert.ToInt32(str9)));
            _users.set_kc_rate(new int?(num6));
            _users.set_kc_credit(new decimal?(num7));
            _users.set_kc_usable_credit(new decimal?(num8));
            _users.set_kc_allow_sale(new int?(Convert.ToInt32(str15)));
            _users.set_kc_rate_owner(new int?(Convert.ToInt32(str16)));
            _users.set_six_op_odds(new int?(Convert.ToInt32(str11)));
            _users.set_kc_op_odds(new int?(Convert.ToInt32(str18)));
            if (base.get_GetIsShowFgsWT().Equals("0"))
            {
                _users.set_six_op_odds(0);
                _users.set_kc_op_odds(0);
            }
            _users.set_kc_isauto_back(new int?(Convert.ToInt32(str19)));
            _users.set_six_isauto_back(new int?(Convert.ToInt32(str12)));
            bool flag2 = true;
            bool flag3 = true;
            bool flag4 = false;
            bool flag5 = false;

            if (str8.Equals("0") && this.d_six_allow_sale.Equals("1"))
            {
                flag4 = true;
            }
            if (str15.Equals("0") && this.d_kc_allow_sale.Equals("1"))
            {
                flag5 = true;
            }
            if (this.d_six_ExistsBet && this.d_six_OpenPhase)
            {
                flag2 = false;
                _users.set_allow_sale(new int?(int.Parse(this.d_six_allow_sale)));
                flag4 = false;
            }
            if (this.d_kc_ExistsBet && this.d_kc_OpenPhase)
            {
                flag3 = false;
                _users.set_kc_allow_sale(new int?(int.Parse(this.d_kc_allow_sale)));
                flag5 = false;
            }
            DataTable userInfoTableByUID = CallBLL.cz_users_bll.GetUserInfoTableByUID(this.r_u_id);

            if (CallBLL.cz_users_bll.UpdateUserInfoFGS(_users, flag2, flag3, flag4, flag5))
            {
                if (!_users.get_six_op_odds().Equals(1))
                {
                    base.RestOddsWT(100, 1, _users.get_u_name());
                }
                if (!_users.get_kc_op_odds().Equals(1))
                {
                    base.RestOddsWT(null, 2, _users.get_u_name());
                }
                if (!_users.get_six_op_odds().Equals(int.Parse(this.d_six_op_odds)) || !_users.get_kc_op_odds().Equals(int.Parse(this.d_kc_op_odds)))
                {
                    if (FileCacheHelper.get_RedisStatOnline().Equals(1))
                    {
                        base.UpdateIsOutOpts(_users.get_u_name());
                    }
                    else if (FileCacheHelper.get_RedisStatOnline().Equals(2))
                    {
                        base.UpdateIsOutOptsStack(_users.get_u_name());
                    }
                    else
                    {
                        CallBLL.cz_stat_online_bll.UpdateIsOutByFgsName(_users.get_u_name());
                    }
                    FileCacheHelper.UpdateUserOutFile();
                    if (!_users.get_six_op_odds().Equals(int.Parse(this.d_six_op_odds)))
                    {
                        FileCacheHelper.UpdateFGSWTFile(1, "");
                    }
                    if (!_users.get_kc_op_odds().Equals(int.Parse(this.d_kc_op_odds)))
                    {
                        FileCacheHelper.UpdateFGSWTFile(2, "");
                    }
                }
                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();
                }
                base.user_edit_fgs_log(userInfoTableByUID, CallBLL.cz_users_bll.GetUserInfoTableByUID(this.r_u_id), _users.get_u_name());
                base.Un_User_Lock(this.d_u_name);
                base.successOptMsg("已經成功修改分公司!");
            }
            else
            {
                base.Un_User_Lock(this.d_u_name);
                base.noRightOptMsg("修改分公司失敗!");
            }
        }
Exemple #14
0
        private void AddUser()
        {
            cz_rate_kc rateKCByUserName = CallBLL.cz_rate_kc_bll.GetRateKCByUserName(this.d_u_name);

            base.En_User_Lock(rateKCByUserName.get_fgs_name());
            this.InitData();
            string str  = LSRequest.qq("userState");
            string str2 = LSRequest.qq("userPassword");
            string str3 = LSRequest.qq("userNicker");
            string str4 = LSRequest.qq("unlock");
            string s    = LSRequest.qq("userCredit_six");

            if (this.d_six_iscash.Equals("1"))
            {
                s = this.d_six_credit;
            }
            string str6 = LSRequest.qq("userRate_six");

            LSRequest.qq("userAllowSale_six");
            string str7  = LSRequest.qq("userKind_six");
            string str8  = "0";
            string str9  = "0";
            string str10 = LSRequest.qq("userCredit_kc");

            if (this.d_kc_iscash.Equals("1"))
            {
                str10 = this.d_kc_credit;
            }
            string str11 = LSRequest.qq("userRate_kc");

            LSRequest.qq("userAllowSale_kc");
            string str12   = LSRequest.qq("userKind_kc");
            string str13   = "0";
            string str14   = "0";
            string message = "";

            if (!base.ValidParamByUserEdit("hy", ref message, null, this.lottrty_six, this.lottrty_kc))
            {
                base.DeleteCreditLock(this.d_u_name);
                base.Response.Write(base.ShowDialogBox(message, null, 400));
                base.Response.End();
            }
            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.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!", null, 400));
                }
                else
                {
                    base.DeleteCreditLock(this.d_u_name);
                    base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含字母、和数字!", null, 400));
                }
                base.Response.End();
            }
            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();
            }
            if ((double.Parse(s) - double.Parse(this.d_six_credit)) > double.Parse(this.d_up_six_usable_credit))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.DeleteCreditLock(this.d_u_name);
                base.Response.Write(base.ShowDialogBox("⑥合彩: 設定增加‘信用額度’超過上级可以用餘額!", null, 400));
                base.Response.End();
            }
            if (double.Parse(str6) > this.d_maxRate_six)
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.DeleteCreditLock(this.d_u_name);
                base.Response.Write(base.ShowDialogBox("⑥合彩: 分公司占成 數不正确,请核实后重新输入!", null, 400));
                base.Response.End();
            }
            double 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.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.DeleteCreditLock(this.d_u_name);
                base.Response.Write(base.ShowDialogBox("⑥合彩: 設定減少‘信用額度’超過可‘回收’餘額!", null, 400));
                base.Response.End();
            }
            if (str8.Equals("1"))
            {
                if (string.IsNullOrEmpty(str9))
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.DeleteCreditLock(this.d_u_name);
                    base.Response.Write(base.ShowDialogBox("⑥合彩:‘占成上限’不可為空,請修改!", null, 400));
                    base.Response.End();
                }
                try
                {
                    if (Convert.ToInt32(str9) > 100)
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.DeleteCreditLock(this.d_u_name);
                        base.Response.Write(base.ShowDialogBox("⑥合彩: ‘占成上限’不可高於 100%,請重新設定!", null, 400));
                        base.Response.End();
                    }
                    else if (Convert.ToInt32(str9) <= 0)
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.DeleteCreditLock(this.d_u_name);
                        base.Response.Write(base.ShowDialogBox("⑥合彩: ‘占成上限’不可低於等於 0%,請重新設定!", null, 400));
                        base.Response.End();
                    }
                }
                catch
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.DeleteCreditLock(this.d_u_name);
                    base.Response.Write(base.ShowDialogBox("⑥合彩: ‘占成上限’只能為數字,請重新設定!", null, 400));
                    base.Response.End();
                }
            }
            if ((double.Parse(str10) - double.Parse(this.d_kc_credit)) > double.Parse(this.d_up_kc_usable_credit))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.DeleteCreditLock(this.d_u_name);
                base.Response.Write(base.ShowDialogBox("快彩: 設定增加‘信用額度’超過上级可以用餘額!", null, 400));
                base.Response.End();
            }
            if (double.Parse(str11) > this.d_maxRate_kc)
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.DeleteCreditLock(this.d_u_name);
                base.Response.Write(base.ShowDialogBox("快彩: 分公司占成 數不正确,请核实后重新输入!", null, 400));
                base.Response.End();
            }
            double 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.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.DeleteCreditLock(this.d_u_name);
                base.Response.Write(base.ShowDialogBox("快彩: 設定減少‘信用額度’超過可‘回收’餘額!", null, 400));
                base.Response.End();
            }
            if (str13.Equals("1"))
            {
                if (string.IsNullOrEmpty(str14))
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.DeleteCreditLock(this.d_u_name);
                    base.Response.Write(base.ShowDialogBox("快彩:‘占成上限’不可為空,請修改!", null, 400));
                    base.Response.End();
                }
                try
                {
                    if (Convert.ToInt32(str14) > 100)
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.DeleteCreditLock(this.d_u_name);
                        base.Response.Write(base.ShowDialogBox("快彩: ‘占成上限’不可高於 100%,請重新設定!", null, 400));
                        base.Response.End();
                    }
                    else if (Convert.ToInt32(str14) <= 0)
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.DeleteCreditLock(this.d_u_name);
                        base.Response.Write(base.ShowDialogBox("快彩: ‘占成上限’不可低於等於 0%,請重新設定!", null, 400));
                        base.Response.End();
                    }
                }
                catch
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.DeleteCreditLock(this.d_u_name);
                    base.Response.Write(base.ShowDialogBox("快彩: ‘占成上限’只能為數字,請重新設定!", null, 400));
                    base.Response.End();
                }
            }
            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());
            }
            _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());
            }
            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());
            }
            if (string.IsNullOrEmpty(this.lottrty_six))
            {
                flag2 = false;
            }
            if (string.IsNullOrEmpty(this.lottrty_kc))
            {
                flag3 = false;
            }
            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.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.DeleteCreditLock(this.d_u_name);
                base.Response.Write(base.ShowDialogBox("修改會員成功!", base.UserReturnBackUrl, 0));
                base.Response.End();
            }
            else
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.DeleteCreditLock(this.d_u_name);
                base.Response.Write(base.ShowDialogBox("修改會員失敗!", base.UserReturnBackUrl, 400));
                base.Response.End();
            }
        }
Exemple #15
0
        private void AddUser()
        {
            string str  = LSRequest.qq("userName").ToLower().Trim();
            string str2 = "0";

            LSRequest.qq("userState");
            string str3 = LSRequest.qq("userPassword");
            string str4 = LSRequest.qq("userNicker");

            this.upuname = this.u_name;
            string   str5          = LSRequest.qq("sltupuser");
            cz_users userInfoByUID = CallBLL.cz_users_bll.GetUserInfoByUID(str5);

            this.upuname = userInfoByUID.get_u_name();
            if (!userInfoByUID.get_u_type().ToLower().Equals(this.checkredio.ToLower()))
            {
                base.Response.End();
            }
            if (userInfoByUID.get_u_type().ToLower().Equals("dl") || userInfoByUID.get_u_type().ToLower().Equals("zj"))
            {
                base.Response.End();
            }
            if (!string.IsNullOrEmpty(this.upuname) && !base.IsUpperLowerLevels(this.upuname, this.userModel.get_u_type(), this.userModel.get_u_name()))
            {
                base.Response.End();
            }
            this.GetRateInfo(userInfoByUID.get_u_id(), this.checkredio);
            string str6 = LSRequest.qq("userCredit_six");
            string str7 = LSRequest.qq("userKind_six");

            if (!this.six_kind_d.Equals("0"))
            {
                str7 = this.six_kind_d;
            }
            else if (string.IsNullOrEmpty(str7) || str7.Equals("0"))
            {
                str7 = "A";
            }
            string str8 = LSRequest.qq("sltDrawback_six");

            if (string.IsNullOrEmpty(str6))
            {
                str6 = "0";
            }
            if (string.IsNullOrEmpty(str8))
            {
                str8 = "0";
            }
            switch (str8)
            {
            case "0":
                str8 = "0";
                break;

            case "1":
                str8 = "0.1";
                break;

            case "2":
                str8 = "0.2";
                break;

            case "3":
                str8 = "0.3";
                break;

            case "4":
                str8 = "0.4";
                break;

            case "5":
                str8 = "NO";
                break;

            case "auto":
                break;

            default:
                base.Response.End();
                break;
            }
            if (str8.Equals("auto"))
            {
                string s = LSRequest.qq("sltDrawbackAuto_six");
                try
                {
                    if (double.Parse(s) < 0.0)
                    {
                        base.noRightOptMsg("⑥合彩: 退水設定 不能小於0!");
                    }
                }
                catch
                {
                    base.noRightOptMsg("⑥合彩: 退水設定 輸入錯誤!");
                }
                str8 = s;
            }
            string str10 = LSRequest.qq("userCredit_kc");
            string str11 = LSRequest.qq("userKind_kc");

            if (!this.kc_kind_d.Equals("0"))
            {
                str11 = this.kc_kind_d;
            }
            else if (string.IsNullOrEmpty(str11) || str11.Equals("0"))
            {
                str11 = "A";
            }
            string str12 = LSRequest.qq("sltDrawback_kc");

            if (string.IsNullOrEmpty(str10))
            {
                str10 = "0";
            }
            if (string.IsNullOrEmpty(str12))
            {
                str12 = "0";
            }
            switch (str12)
            {
            case "0":
                str12 = "0";
                break;

            case "1":
                str12 = "0.1";
                break;

            case "2":
                str12 = "0.2";
                break;

            case "3":
                str12 = "0.3";
                break;

            case "4":
                str12 = "0.4";
                break;

            case "5":
                str12 = "NO";
                break;

            case "auto":
                break;

            default:
                base.Response.End();
                break;
            }
            if (str12.Equals("auto"))
            {
                string str13 = LSRequest.qq("sltDrawbackAuto_kc");
                try
                {
                    if (double.Parse(str13) < 0.0)
                    {
                        base.noRightOptMsg("快彩: 退水設定 不能小於0!");
                    }
                }
                catch
                {
                    base.noRightOptMsg("快彩: 退水設定 輸入錯誤!");
                }
                str12 = str13;
            }
            string message = "";

            if (!base.ValidParamByUserAdd("hydu", ref message, null, this.lottrty_six, this.lottrty_kc))
            {
                base.noRightOptMsg(message);
            }
            if (!Regexlib.IsValidPassword(str3.Trim(), base.get_GetPasswordLU()))
            {
                if (base.get_GetPasswordLU().Equals("1"))
                {
                    base.noRightOptMsg("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!");
                }
                else
                {
                    base.noRightOptMsg("密碼要8-20位,且必需包含字母、和数字!");
                }
                base.Response.End();
            }
            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                if ((!str7.ToUpper().Equals("A") && !str7.ToUpper().Equals("B")) && !str7.ToUpper().Equals("C"))
                {
                    base.Response.End();
                }
                if (string.IsNullOrEmpty(str8))
                {
                    base.Response.End();
                }
            }
            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                if ((!str11.ToUpper().Equals("A") && !str11.ToUpper().Equals("B")) && !str11.ToUpper().Equals("C"))
                {
                    base.Response.End();
                }
                if (string.IsNullOrEmpty(str12))
                {
                    base.Response.End();
                }
            }
            cz_rate_kc rateKCByUserName = CallBLL.cz_rate_kc_bll.GetRateKCByUserName(this.upuname);

            base.En_User_Lock(rateKCByUserName.get_fgs_name());
            if (Convert.ToDouble(str6) > Convert.ToDouble(this.six_usable_credit_d))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.noRightOptMsg("⑥合彩:‘信用額度’已超過‘上級可用餘額’,請修改!");
            }
            string str15 = LSRequest.qq("userRate_six");

            if (string.IsNullOrEmpty(str15))
            {
                str15 = "0";
            }
            if (Convert.ToDouble(str15) > Convert.ToDouble(this.six_rate_d))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.noRightOptMsg("⑥合彩: " + this.utypeTxt + "占成 不可高於" + this.six_rate_d + ",請修改!");
            }
            if (Convert.ToDouble(str10) > Convert.ToDouble(this.kc_usable_credit_d))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.noRightOptMsg("快彩:‘信用額度’已超過‘上級可用餘額’,請修改!");
            }
            string str16 = LSRequest.qq("userRate_kc");

            if (string.IsNullOrEmpty(str16))
            {
                str16 = "0";
            }
            if (Convert.ToDouble(str16) > Convert.ToDouble(this.kc_rate_d))
            {
                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(str15);
                num4 = Convert.ToDecimal(str6);
                num5 = Convert.ToDecimal(str6);
            }
            int     num6 = 0;
            decimal num7 = 0M;
            decimal num8 = 0M;

            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                num6 = Convert.ToInt32(str16);
                num7 = Convert.ToDecimal(str10);
                num8 = Convert.ToDecimal(str10);
            }
            cz_users model = new cz_users();

            model.set_u_id(Guid.NewGuid().ToString().ToUpper());
            model.set_u_name(str);
            string ramSalt = Utils.GetRamSalt(6);

            model.set_u_psw(DESEncrypt.EncryptString(str3, ramSalt));
            model.set_salt(ramSalt);
            model.set_u_nicker(str4);
            model.set_u_skin(base.GetUserSkin("hy"));
            model.set_sup_name(this.upuname);
            model.set_u_type("hy");
            model.set_su_type(this.checkredio);
            model.set_add_date(new DateTime?(DateTime.Now));
            model.set_six_rate(new int?(num3));
            model.set_six_credit(new decimal?(num4));
            model.set_six_usable_credit(new decimal?(num5));
            model.set_six_kind(str7);
            model.set_kc_rate(new int?(num6));
            model.set_kc_credit(new decimal?(num7));
            model.set_kc_usable_credit(new decimal?(num8));
            model.set_kc_kind(str11);
            model.set_kc_crash_payment(0);
            model.set_a_state(new int?(Convert.ToInt32(str2)));
            model.set_allow_opt(1);
            model.set_is_changed(0);
            if (!string.IsNullOrEmpty(this.kc_iscash ?? ""))
            {
                model.set_kc_iscash(new int?(int.Parse(this.kc_iscash)));
            }
            if (!string.IsNullOrEmpty(this.six_iscash ?? ""))
            {
                model.set_six_iscash(new int?(int.Parse(this.six_iscash)));
            }
            cz_rate_kc _kc2 = new cz_rate_kc();

            _kc2.set_u_name(str);
            _kc2.set_u_type("hy");
            string checkredio = this.checkredio;

            if (checkredio != null)
            {
                if (!(checkredio == "fgs"))
                {
                    if (checkredio == "gd")
                    {
                        _kc2.set_dl_name("");
                        _kc2.set_zd_name(str);
                        _kc2.set_gd_name(this.kc_gd_name);
                        _kc2.set_fgs_name(this.kc_fgs_name);
                        _kc2.set_dl_rate(0);
                        _kc2.set_zd_rate(0);
                        _kc2.set_gd_rate(new decimal?(num6));
                        _kc2.set_fgs_rate(new decimal?(Convert.ToDecimal(this.kc_fgs_rate)));
                        _kc2.set_zj_rate(new decimal?(Convert.ToDecimal(this.kc_zj_rate)));
                    }
                    else if (checkredio == "zd")
                    {
                        _kc2.set_dl_name(str);
                        _kc2.set_zd_name(this.kc_zd_name);
                        _kc2.set_gd_name(this.kc_gd_name);
                        _kc2.set_fgs_name(this.kc_fgs_name);
                        _kc2.set_dl_rate(0);
                        _kc2.set_zd_rate(new decimal?(num6));
                        _kc2.set_gd_rate(new decimal?(Convert.ToDecimal(this.kc_gd_rate)));
                        _kc2.set_fgs_rate(new decimal?(Convert.ToDecimal(this.kc_fgs_rate)));
                        _kc2.set_zj_rate(new decimal?(Convert.ToDecimal(this.kc_zj_rate)));
                    }
                }
                else
                {
                    _kc2.set_dl_name("");
                    _kc2.set_zd_name("");
                    _kc2.set_gd_name(str);
                    _kc2.set_fgs_name(this.kc_fgs_name);
                    _kc2.set_dl_rate(0);
                    _kc2.set_zd_rate(0);
                    _kc2.set_gd_rate(0);
                    _kc2.set_fgs_rate(new decimal?(Convert.ToDecimal(num6)));
                    _kc2.set_zj_rate(new decimal?(Convert.ToDecimal(this.kc_zj_rate)));
                }
            }
            cz_rate_six _six = new cz_rate_six();

            _six.set_u_name(str);
            _six.set_u_type("hy");
            string str22 = this.checkredio;

            if (str22 != null)
            {
                if (!(str22 == "fgs"))
                {
                    if (str22 == "gd")
                    {
                        _six.set_dl_name("");
                        _six.set_zd_name(str);
                        _six.set_gd_name(this.six_gd_name);
                        _six.set_fgs_name(this.six_fgs_name);
                        _six.set_dl_rate(0);
                        _six.set_zd_rate(0);
                        _six.set_gd_rate(new decimal?(num3));
                        _six.set_fgs_rate(new decimal?(Convert.ToDecimal(this.six_fgs_rate)));
                        _six.set_zj_rate(new decimal?(Convert.ToDecimal(this.six_zj_rate)));
                    }
                    else if (str22 == "zd")
                    {
                        _six.set_dl_name(str);
                        _six.set_zd_name(this.six_zd_name);
                        _six.set_gd_name(this.six_gd_name);
                        _six.set_fgs_name(this.six_fgs_name);
                        _six.set_dl_rate(0);
                        _six.set_zd_rate(new decimal?(num3));
                        _six.set_gd_rate(new decimal?(Convert.ToDecimal(this.six_gd_rate)));
                        _six.set_fgs_rate(new decimal?(Convert.ToDecimal(this.six_fgs_rate)));
                        _six.set_zj_rate(new decimal?(Convert.ToDecimal(this.six_zj_rate)));
                    }
                }
                else
                {
                    _six.set_dl_name("");
                    _six.set_zd_name("");
                    _six.set_gd_name(str);
                    _six.set_fgs_name(this.six_fgs_name);
                    _six.set_dl_rate(0);
                    _six.set_zd_rate(0);
                    _six.set_gd_rate(0);
                    _six.set_fgs_rate(new decimal?(Convert.ToDecimal(num3)));
                    _six.set_zj_rate(new decimal?(Convert.ToDecimal(this.six_zj_rate)));
                }
            }
            string str18 = "";
            Dictionary <string, string> data = new Dictionary <string, string>();

            if (CallBLL.cz_users_bll.AddUserInfoHY(model, _kc2, _six, ref str18, str8.ToUpper(), str12.ToUpper()))
            {
                int num9 = 2;
                if (this.lottrty_six == "")
                {
                    num9 = 1;
                }
                else if (this.lottrty_kc == "")
                {
                    num9 = 0;
                }
                else if ((this.lottrty_kc != "") && (this.lottrty_six != ""))
                {
                    num9 = 2;
                }
                base.user_add_hy_log(model, true, num9, str8, str12);
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                string text1 = "/Account/drawback.aspx?uid=" + str18 + "&isadd=1";
                data.Add("uname", model.get_u_name());
                data.Add("uid", model.get_u_id());
                base.successOptMsg("添加直屬會員成功!", data);
            }
            else
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.noRightOptMsg("添加直屬會員失敗!");
            }
        }
Exemple #16
0
        private void AddUser()
        {
            string str  = LSRequest.qq("userName").ToLower().Trim();
            string str2 = "0";
            string str3 = LSRequest.qq("userPassword");
            string str4 = LSRequest.qq("userNicker");

            this.upuname = this.u_name;
            string str5 = LSRequest.qq("userCredit_six");
            string str6 = LSRequest.qq("userKind_six");

            if (!this.six_kind_d.Equals("0"))
            {
                str6 = this.six_kind_d;
            }
            else if (string.IsNullOrEmpty(str6) || str6.Equals("0"))
            {
                str6 = "A";
            }
            string str7 = LSRequest.qq("sltDrawback_six");

            if (string.IsNullOrEmpty(str5))
            {
                str5 = "0";
            }
            if (string.IsNullOrEmpty(str7))
            {
                str7 = "0";
            }
            switch (str7)
            {
            case "0":
                str7 = "0";
                break;

            case "1":
                str7 = "0.1";
                break;

            case "2":
                str7 = "0.2";
                break;

            case "3":
                str7 = "0.3";
                break;

            case "4":
                str7 = "0.4";
                break;

            case "5":
                str7 = "NO";
                break;

            case "auto":
                break;

            default:
                base.Response.End();
                break;
            }
            if (str7.Equals("auto"))
            {
                string s = LSRequest.qq("sltDrawbackAuto_six");
                try
                {
                    if (double.Parse(s) < 0.0)
                    {
                        base.Response.Write(base.ShowDialogBox("⑥合彩: 退水設定 不能小於0!", null, 400));
                        base.Response.End();
                    }
                }
                catch
                {
                    base.Response.Write(base.ShowDialogBox("⑥合彩: 退水設定 輸入錯誤!", null, 400));
                    base.Response.End();
                }
                str7 = s;
            }
            string str9  = LSRequest.qq("userCredit_kc");
            string str10 = LSRequest.qq("userKind_kc");

            if (!this.kc_kind_d.Equals("0"))
            {
                str10 = this.kc_kind_d;
            }
            else if (string.IsNullOrEmpty(str10) || str10.Equals("0"))
            {
                str10 = "A";
            }
            string str11 = LSRequest.qq("sltDrawback_kc");

            if (string.IsNullOrEmpty(str9))
            {
                str9 = "0";
            }
            if (string.IsNullOrEmpty(str11))
            {
                str11 = "0";
            }
            switch (str11)
            {
            case "0":
                str11 = "0";
                break;

            case "1":
                str11 = "0.1";
                break;

            case "2":
                str11 = "0.2";
                break;

            case "3":
                str11 = "0.3";
                break;

            case "4":
                str11 = "0.4";
                break;

            case "5":
                str11 = "NO";
                break;

            case "auto":
                break;

            default:
                base.Response.End();
                break;
            }
            if (str11.Equals("auto"))
            {
                string str12 = LSRequest.qq("sltDrawbackAuto_kc");
                try
                {
                    if (double.Parse(str12) < 0.0)
                    {
                        base.Response.Write(base.ShowDialogBox("快彩: 退水設定 不能小於0!", null, 400));
                        base.Response.End();
                    }
                }
                catch
                {
                    base.Response.Write(base.ShowDialogBox("快彩: 退水設定 輸入錯誤!", null, 400));
                    base.Response.End();
                }
                str11 = str12;
            }
            string message = "";

            if (!base.ValidParamByUserAdd("hy", ref message, null, this.lottrty_six, this.lottrty_kc))
            {
                base.Response.Write(base.GetAlert(message));
                base.Response.End();
            }
            if (!Regexlib.IsValidPassword(str3.Trim(), base.get_GetPasswordLU()))
            {
                if (base.get_GetPasswordLU().Equals("1"))
                {
                    base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!", null, 400));
                }
                else
                {
                    base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含字母、和数字!", null, 400));
                }
                base.Response.End();
            }
            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                if ((!str6.ToUpper().Equals("A") && !str6.ToUpper().Equals("B")) && !str6.ToUpper().Equals("C"))
                {
                    base.Response.End();
                }
                if (string.IsNullOrEmpty(str7))
                {
                    base.Response.End();
                }
            }
            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                if ((!str10.ToUpper().Equals("A") && !str10.ToUpper().Equals("B")) && !str10.ToUpper().Equals("C"))
                {
                    base.Response.End();
                }
                if (string.IsNullOrEmpty(str11))
                {
                    base.Response.End();
                }
            }
            cz_rate_kc rateKCByUserName = CallBLL.cz_rate_kc_bll.GetRateKCByUserName(this.upuname);

            base.En_User_Lock(rateKCByUserName.get_fgs_name());
            if (CallBLL.cz_users_bll.GetLimitHy_DL(this.upuname).Equals(-1))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                if (this.userModel.get_u_type().Equals("dl"))
                {
                    base.Response.Write(base.ShowDialogBox("下綫人數限製已經滿員,請聯繫上級!", null, 400));
                }
                else
                {
                    base.Response.Write(base.ShowDialogBox("代理【" + this.upuname + "】下綫人數限製已經滿員!", null, 400));
                }
                base.Response.End();
            }
            if (Convert.ToDouble(str5) > Convert.ToDouble(this.six_usable_credit_d))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("⑥合彩:‘信用額度’已超過‘上級可用餘額’,請修改!", null, 400));
                base.Response.End();
            }
            string str14 = LSRequest.qq("userRate_six");

            if (string.IsNullOrEmpty(str14))
            {
                str14 = "0";
            }
            if (Convert.ToDouble(str14) > Convert.ToDouble(this.six_rate_d))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("⑥合彩: 代理占成 不可高於" + this.six_rate_d + ",請修改!", null, 400));
                base.Response.End();
            }
            if (Convert.ToDouble(str9) > Convert.ToDouble(this.kc_usable_credit_d))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("快彩:‘信用額度’已超過‘上級可用餘額’,請修改!", null, 400));
                base.Response.End();
            }
            string str15 = LSRequest.qq("userRate_kc");

            if (string.IsNullOrEmpty(str15))
            {
                str15 = "0";
            }
            if (Convert.ToDouble(str15) > Convert.ToDouble(this.kc_rate_d))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("快彩: 總代占成 不可高於" + this.kc_rate_d + ",請修改!", null, 400));
                base.Response.End();
            }
            int     num4 = 0;
            decimal num5 = 0M;
            decimal num6 = 0M;

            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                num4 = Convert.ToInt32(str14);
                num5 = Convert.ToDecimal(str5);
                num6 = Convert.ToDecimal(str5);
            }
            int     num7 = 0;
            decimal num8 = 0M;
            decimal num9 = 0M;

            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                num7 = Convert.ToInt32(str15);
                num8 = Convert.ToDecimal(str9);
                num9 = Convert.ToDecimal(str9);
            }
            cz_users model = new cz_users();

            model.set_u_id(Guid.NewGuid().ToString().ToUpper());
            model.set_u_name(str);
            string ramSalt = Utils.GetRamSalt(6);

            model.set_u_psw(DESEncrypt.EncryptString(str3, ramSalt));
            model.set_salt(ramSalt);
            model.set_u_nicker(str4);
            model.set_u_skin(base.GetUserSkin("hy"));
            model.set_sup_name(this.upuname);
            model.set_u_type("hy");
            model.set_su_type("dl");
            model.set_add_date(new DateTime?(DateTime.Now));
            model.set_six_rate(new int?(num4));
            model.set_six_credit(new decimal?(num5));
            model.set_six_usable_credit(new decimal?(num6));
            model.set_six_kind(str6);
            model.set_a_state(new int?(Convert.ToInt32(str2)));
            model.set_allow_opt(1);
            model.set_is_changed(0);
            model.set_kc_rate(new int?(num7));
            model.set_kc_credit(new decimal?(num8));
            model.set_kc_usable_credit(new decimal?(num9));
            model.set_kc_kind(str10);
            model.set_kc_crash_payment(0);
            if (!string.IsNullOrEmpty(this.kc_iscash ?? ""))
            {
                model.set_kc_iscash(new int?(int.Parse(this.kc_iscash)));
            }
            if (!string.IsNullOrEmpty(this.six_iscash ?? ""))
            {
                model.set_six_iscash(new int?(int.Parse(this.six_iscash)));
            }
            cz_rate_kc _kc2 = new cz_rate_kc();

            _kc2.set_u_name(str);
            _kc2.set_u_type("hy");
            _kc2.set_dl_name(this.kc_dl_name);
            _kc2.set_zd_name(this.kc_zd_name);
            _kc2.set_gd_name(this.kc_gd_name);
            _kc2.set_fgs_name(this.kc_fgs_name);
            _kc2.set_dl_rate(new decimal?(num7));
            _kc2.set_zd_rate(new decimal?(Convert.ToDecimal(this.kc_zd_rate)));
            _kc2.set_gd_rate(new decimal?(Convert.ToDecimal(this.kc_gd_rate)));
            _kc2.set_fgs_rate(new decimal?(Convert.ToDecimal(this.kc_fgs_rate)));
            _kc2.set_zj_rate(new decimal?(Convert.ToDecimal(this.kc_zj_rate)));
            cz_rate_six _six = new cz_rate_six();

            _six.set_u_name(str);
            _six.set_u_type("hy");
            _six.set_dl_name(this.six_dl_name);
            _six.set_zd_name(this.six_zd_name);
            _six.set_gd_name(this.six_gd_name);
            _six.set_fgs_name(this.six_fgs_name);
            _six.set_dl_rate(new decimal?(num4));
            _six.set_zd_rate(new decimal?(Convert.ToDecimal(this.six_zd_rate)));
            _six.set_gd_rate(new decimal?(Convert.ToDecimal(this.six_gd_rate)));
            _six.set_fgs_rate(new decimal?(Convert.ToDecimal(this.six_fgs_rate)));
            _six.set_zj_rate(new decimal?(Convert.ToDecimal(this.six_zj_rate)));
            string str17 = "";

            if (CallBLL.cz_users_bll.AddUserInfoHY(model, _kc2, _six, ref str17, str7.ToUpper(), str11.ToUpper()))
            {
                int?nullable = model.get_six_iscash();
                int num13    = int.Parse("1");
                if ((nullable.GetValueOrDefault() == num13) && nullable.HasValue)
                {
                    cz_users _users2 = new cz_users();
                    _users2.set_u_name(model.get_u_name());
                    _users2.set_six_usable_credit(0);
                    cz_users _users3 = new cz_users();
                    _users3.set_u_name(model.get_sup_name());
                    _users3.set_six_usable_credit(new decimal?(decimal.Parse(this.six_usable_credit_d)));
                    int num14 = 1;
                    if (base.IsMasterLotteryExist(num14.ToString()))
                    {
                        base.UserRecharge_six(_users2, _users3, str5);
                    }
                }
                int?nullable2 = model.get_kc_iscash();
                int num15     = int.Parse("1");
                if ((nullable2.GetValueOrDefault() == num15) && nullable2.HasValue)
                {
                    cz_users _users4 = new cz_users();
                    _users4.set_u_name(model.get_u_name());
                    _users4.set_kc_usable_credit(0);
                    cz_users _users5 = new cz_users();
                    _users5.set_u_name(model.get_sup_name());
                    _users5.set_kc_usable_credit(new decimal?(decimal.Parse(this.kc_usable_credit_d)));
                    int num16 = 2;
                    if (base.IsMasterLotteryExist(num16.ToString()))
                    {
                        base.UserRecharge_kc(_users4, _users5, str9);
                    }
                }
                int num10 = 2;
                if (this.lottrty_six == "")
                {
                    num10 = 1;
                }
                else if (this.lottrty_kc == "")
                {
                    num10 = 0;
                }
                else if ((this.lottrty_kc != "") && (this.lottrty_six != ""))
                {
                    num10 = 2;
                }
                base.user_add_hy_log(model, false, num10, str7, str11);
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                string url = "/Account/drawback.aspx?uid=" + str17 + "&isadd=1";
                base.Response.Write(base.ShowDialogBox("添加會員成功!", url, 0));
                base.Response.End();
            }
            else
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.Response.Write(base.ShowDialogBox("添加會員失敗!", base.UserReturnBackUrl, 400));
                base.Response.End();
            }
        }
Exemple #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            agent_userinfo_session _session = this.Session[this.Session["user_name"].ToString() + "lottery_session_user_info"] as agent_userinfo_session;

            this.skin = _session.get_u_skin();
            string str  = LSRequest.qq("hdnsubmit");
            string str2 = LSRequest.qq("txtoldpwd");
            string str3 = LSRequest.qq("txtnewpwd");
            string str4 = LSRequest.qq("txtnewpwdcf");

            if (str.Equals("submit"))
            {
                if ((string.IsNullOrEmpty(str2) || string.IsNullOrEmpty(str3)) || string.IsNullOrEmpty(str4))
                {
                    base.Response.Write(base.ShowDialogBox("請輸入完整的密碼!", "", 400));
                    base.Response.End();
                }
                if (str3 == str2)
                {
                    base.Response.Write(base.ShowDialogBox("新密碼和舊密碼不能相同!", "", 400));
                    base.Response.End();
                }
                if (str3 != str4)
                {
                    base.Response.Write(base.ShowDialogBox("新密碼和確認新密碼不一致!", "", 400));
                    base.Response.End();
                }
                if (!Regexlib.IsValidPassword(str3.Trim(), base.get_GetPasswordLU()))
                {
                    if (base.get_GetPasswordLU().Equals("1"))
                    {
                        base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!", "", 400));
                        base.Response.End();
                    }
                    else
                    {
                        base.Response.Write(base.ShowDialogBox("密碼要8-20位,且必需包含字母、和数字!", "", 400));
                        base.Response.End();
                    }
                    base.Response.End();
                }
                if (_session.get_users_child_session() == null)
                {
                    cz_users _users = CallBLL.cz_users_bll.AgentLogin(this.Session["user_name"].ToString());
                    if (_users != null)
                    {
                        string str5 = _users.get_salt().Trim();
                        string str6 = DESEncrypt.EncryptString(str2, str5);
                        if (_users.get_u_psw() != str6)
                        {
                            base.Response.Write(base.ShowDialogBox("您輸入原密碼不正確!", "", 400));
                            base.Response.End();
                        }
                        else
                        {
                            string ramSalt = Utils.GetRamSalt(6);
                            if (CallBLL.cz_users_bll.UpUserPwd(this.Session["user_name"].ToString(), DESEncrypt.EncryptString(str3, ramSalt), ramSalt) > 0)
                            {
                                int num = CallBLL.cz_users_bll.UpdateUserPwdStutas(this.Session["user_name"].ToString());
                                base.log_user_reset_password(this.Session["user_name"].ToString(), this.Session["user_name"].ToString(), "", this.Session["modifypassword"]);
                                this.Session["modifypassword"] = null;
                                string url = "Quit.aspx";
                                base.Response.Write(base.ShowDialogBox("修改密碼成功!", url, 0));
                                base.Response.End();
                            }
                            else
                            {
                                base.Response.Write(base.ShowDialogBox("修改密碼不成功!", "", 400));
                                base.Response.End();
                            }
                        }
                    }
                }
                else
                {
                    cz_users_child _child = CallBLL.cz_users_child_bll.AgentLogin(this.Session["child_user_name"].ToString().ToLower());
                    if (_child != null)
                    {
                        string str9  = _child.get_salt().Trim();
                        string str10 = DESEncrypt.EncryptString(str2, str9);
                        if (_child.get_u_psw() != str10)
                        {
                            base.Response.Write(base.ShowDialogBox("您輸入原密碼不正確!", "", 400));
                            base.Response.End();
                        }
                        else
                        {
                            string str11 = Utils.GetRamSalt(6);
                            if (CallBLL.cz_users_child_bll.UpUserPwd(this.Session["child_user_name"].ToString(), DESEncrypt.EncryptString(str3, str11), str11) > 0)
                            {
                                int num2 = CallBLL.cz_users_bll.UpdateUserPwdStutas(this.Session["child_user_name"].ToString().ToLower());
                                base.log_user_reset_password(this.Session["child_user_name"].ToString(), this.Session["child_user_name"].ToString(), "", this.Session["modifypassword"]);
                                this.Session["modifypassword"] = null;
                                string str12 = "Quit.aspx";
                                base.Response.Write(base.ShowDialogBox("修改密碼成功!", str12, 0));
                                base.Response.End();
                            }
                            else
                            {
                                base.Response.Write(base.ShowDialogBox("修改密碼不成功!", "", 400));
                                base.Response.End();
                            }
                        }
                    }
                }
            }
        }
Exemple #18
0
        private void AddUser()
        {
            string str  = LSRequest.qq("userName").ToLower().Trim();
            string str2 = "0";
            string str3 = LSRequest.qq("userPassword");
            string str4 = LSRequest.qq("userNicker");

            this.upuname = this.u_name;
            string str5 = LSRequest.qq("userCredit_six");
            string str6 = LSRequest.qq("allowmaxrate_six");
            string str7 = LSRequest.qq("lowmaxrate_six");
            string str8 = LSRequest.qq("userAllowSale_six");
            string str9 = LSRequest.qq("userKind_six");

            if (!this.six_kind_d.Equals("0"))
            {
                str9 = this.six_kind_d;
            }
            if (string.IsNullOrEmpty(str5))
            {
                str5 = "0";
            }
            if (string.IsNullOrEmpty(str9))
            {
                str9 = "0";
            }
            string str10 = LSRequest.qq("userCredit_kc");
            string str11 = LSRequest.qq("allowmaxrate_kc");
            string str12 = LSRequest.qq("lowmaxrate_kc");
            string str13 = LSRequest.qq("userAllowSale_kc");
            string str14 = LSRequest.qq("userKind_kc");

            if (!this.kc_kind_d.Equals("0"))
            {
                str14 = this.kc_kind_d;
            }
            if (string.IsNullOrEmpty(str10))
            {
                str10 = "0";
            }
            if (string.IsNullOrEmpty(str14))
            {
                str14 = "0";
            }
            string message = "";

            if (!base.ValidParamByUserAdd("dl", ref message, null, this.lottrty_six, this.lottrty_kc))
            {
                base.noRightOptMsg(message);
            }
            if (!Regexlib.IsValidPassword(str3.Trim(), base.get_GetPasswordLU()))
            {
                if (base.get_GetPasswordLU().Equals("1"))
                {
                    base.noRightOptMsg("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!");
                }
                else
                {
                    base.noRightOptMsg("密碼要8-20位,且必需包含字母、和数字!");
                }
                base.Response.End();
            }
            int num = 0;

            if (LSRequest.qq("sltlimithy").ToString().Trim().Equals("0"))
            {
                num = 0;
            }
            else
            {
                string str17 = LSRequest.qq("txtlimithy") ?? "";
                if (!string.IsNullOrEmpty(str17))
                {
                    num = int.Parse(str17);
                }
            }
            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                if ((!str9.ToUpper().Equals("A") && !str9.ToUpper().Equals("B")) && (!str9.ToUpper().Equals("C") && !str9.ToUpper().Equals("0")))
                {
                    base.Response.End();
                }
                if (!str8.ToUpper().Equals("0") && !str8.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
            }
            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                if ((!str14.ToUpper().Equals("A") && !str14.ToUpper().Equals("B")) && (!str14.ToUpper().Equals("C") && !str14.ToUpper().Equals("0")))
                {
                    base.Response.End();
                }
                if (!str13.ToUpper().Equals("0") && !str13.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
            }
            cz_rate_kc rateKCByUserName = CallBLL.cz_rate_kc_bll.GetRateKCByUserName(this.upuname);

            base.En_User_Lock(rateKCByUserName.get_fgs_name());
            if (Convert.ToDouble(str5) > Convert.ToDouble(this.six_usable_credit_d))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.noRightOptMsg("⑥合彩:‘信用額度’已超過‘上級可用餘額’,請修改!");
            }
            string str18 = LSRequest.qq("userRate_six");

            if (string.IsNullOrEmpty(str18))
            {
                str18 = "0";
            }
            if (Convert.ToDouble(str18) > Convert.ToDouble(this.six_rate_d))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.noRightOptMsg("⑥合彩: 總代占成 不可高於" + this.six_rate_d + ",請修改!");
            }
            if (str6.Equals("1"))
            {
                if (string.IsNullOrEmpty(str7))
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("⑥合彩: ‘占成上限’ 不可為空,請修改!");
                }
                try
                {
                    int.Parse(str7);
                }
                catch
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("⑥合彩: ‘占成上限’只能為數字,請重新設定!");
                }
                if (Convert.ToInt32(str7) > 100)
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("⑥合彩: ‘占成上限’不可高於 100%,請重新設定!");
                }
                else if (Convert.ToInt32(str7) < 0)
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("⑥合彩: ‘占成上限’不可低於等於 0%,請重新設定!");
                }
            }
            else
            {
                str7 = "0";
            }
            if (Convert.ToDouble(str10) > Convert.ToDouble(this.kc_usable_credit_d))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.noRightOptMsg("快彩:‘信用額度’已超過‘上級可用餘額’,請修改!");
            }
            string str19 = LSRequest.qq("userRate_kc");

            if (string.IsNullOrEmpty(str19))
            {
                str19 = "0";
            }
            if (Convert.ToDouble(str19) > Convert.ToDouble(this.kc_rate_d))
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.noRightOptMsg("快彩: 總代占成 不可高於" + this.kc_rate_d + ",請修改!");
            }
            if (str11.Equals("1"))
            {
                if (string.IsNullOrEmpty(str12))
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("快彩: ‘占成上限’ 不可為空,請修改!");
                }
                try
                {
                    int.Parse(str12);
                }
                catch
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("快彩: ‘占成上限’只能為數字,請重新設定!");
                }
                if (Convert.ToInt32(str12) > 100)
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("快彩: ‘占成上限’不可高於 100%,請重新設定!");
                }
                else if (Convert.ToInt32(str12) < 0)
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("");
                }
            }
            else
            {
                str12 = "0";
            }
            int     num2 = 0;
            decimal num3 = 0M;
            decimal num4 = 0M;

            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                num2 = Convert.ToInt32(str18);
                num3 = Convert.ToDecimal(str5);
                num4 = Convert.ToDecimal(str5);
            }
            int     num5 = 0;
            decimal num6 = 0M;
            decimal num7 = 0M;

            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                num5 = Convert.ToInt32(str19);
                num6 = Convert.ToDecimal(str10);
                num7 = Convert.ToDecimal(str10);
            }
            cz_users model = new cz_users();

            model.set_u_id(Guid.NewGuid().ToString().ToUpper());
            model.set_u_name(str);
            string ramSalt = Utils.GetRamSalt(6);

            model.set_u_psw(DESEncrypt.EncryptString(str3, ramSalt));
            model.set_salt(ramSalt);
            model.set_u_nicker(str4);
            model.set_u_skin(base.GetUserSkin("agent"));
            model.set_sup_name(this.upuname);
            model.set_u_type("dl");
            model.set_su_type("zd");
            model.set_limit_hy(new int?(num));
            model.set_add_date(new DateTime?(DateTime.Now));
            model.set_six_rate(new int?(num2));
            model.set_six_credit(new decimal?(num3));
            model.set_six_usable_credit(new decimal?(num4));
            model.set_six_kind(str9);
            model.set_a_state(new int?(Convert.ToInt32(str2)));
            model.set_allow_sale(new int?(Convert.ToInt32(str8)));
            model.set_six_allow_maxrate(new int?(Convert.ToInt32(str6)));
            model.set_six_low_maxrate(new int?(Convert.ToInt32(str7)));
            model.set_allow_opt(1);
            model.set_is_changed(0);
            model.set_kc_rate(new int?(num5));
            model.set_kc_credit(new decimal?(num6));
            model.set_kc_usable_credit(new decimal?(num7));
            model.set_kc_kind(str14);
            model.set_kc_allow_sale(new int?(Convert.ToInt32(str13)));
            model.set_kc_allow_maxrate(new int?(Convert.ToInt32(str11)));
            model.set_kc_low_maxrate(new int?(Convert.ToInt32(str12)));
            model.set_kc_crash_payment(0);
            model.set_kc_iscash(new int?(Convert.ToInt32(this.kc_iscash)));
            model.set_six_iscash(new int?(Convert.ToInt32(this.six_iscash)));
            cz_rate_kc _kc2 = new cz_rate_kc();

            _kc2.set_u_name(str);
            _kc2.set_u_type("dl");
            _kc2.set_dl_name(str);
            _kc2.set_zd_name(this.kc_zd_name);
            _kc2.set_gd_name(this.kc_gd_name);
            _kc2.set_fgs_name(this.kc_fgs_name);
            _kc2.set_dl_rate(0);
            _kc2.set_zd_rate(new decimal?(num5));
            _kc2.set_gd_rate(new decimal?(Convert.ToDecimal(this.kc_gd_rate)));
            _kc2.set_fgs_rate(new decimal?(Convert.ToDecimal(this.kc_fgs_rate)));
            _kc2.set_zj_rate(new decimal?(Convert.ToDecimal(this.kc_zj_rate)));
            cz_rate_six _six = new cz_rate_six();

            _six.set_u_name(str);
            _six.set_u_type("dl");
            _six.set_dl_name(str);
            _six.set_zd_name(this.six_zd_name);
            _six.set_gd_name(this.six_gd_name);
            _six.set_fgs_name(this.six_fgs_name);
            _six.set_dl_rate(0);
            _six.set_zd_rate(new decimal?(num2));
            _six.set_gd_rate(new decimal?(Convert.ToDecimal(this.six_gd_rate)));
            _six.set_fgs_rate(new decimal?(Convert.ToDecimal(this.six_fgs_rate)));
            _six.set_zj_rate(new decimal?(Convert.ToDecimal(this.six_zj_rate)));
            string str21 = "";
            Dictionary <string, string> data = new Dictionary <string, string>();

            if (CallBLL.cz_users_bll.AddUserInfo(model, _kc2, _six, ref str21))
            {
                int num8 = 2;
                if (this.lottrty_six == "")
                {
                    num8 = 1;
                }
                else if (this.lottrty_kc == "")
                {
                    num8 = 0;
                }
                else if ((this.lottrty_kc != "") && (this.lottrty_six != ""))
                {
                    num8 = 2;
                }
                base.user_add_agent_log(model, num8);
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                string text1 = "/Account/drawback.aspx?uid=" + str21 + "&isadd=1";
                data.Add("uname", model.get_u_name());
                data.Add("uid", model.get_u_id());
                base.successOptMsg("添加代理成功!", data);
            }
            else
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.noRightOptMsg("添加代理失敗!");
            }
        }
Exemple #19
0
        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");
            string str7  = LSRequest.qq("userAllowSaleSix");
            string str8  = LSRequest.qq("userKindSix");
            string str9  = LSRequest.qq("allowMaxRateSix");
            string str10 = LSRequest.qq("downRateSix");
            string str11 = LSRequest.qq("userCreditKc");

            if (this.d_kc_iscash.Equals("1"))
            {
                str11 = this.d_kc_credit;
            }
            string str12   = LSRequest.qq("userRateKc");
            string str13   = LSRequest.qq("userAllowSaleKc");
            string str14   = LSRequest.qq("userKindKc");
            string str15   = LSRequest.qq("allowMaxRateKc");
            string str16   = LSRequest.qq("downRateKc");
            string message = "";

            if (!base.ValidParamByUserEditPhone("zd", ref message, null, this.lottrty_six, this.lottrty_kc))
            {
                base.noRightOptMsg(message);
            }
            if (!string.IsNullOrEmpty(str2.Trim()) && !Regexlib.IsValidPassword(str2.Trim(), base.get_GetPasswordLU()))
            {
                if (base.get_GetPasswordLU().Equals("1"))
                {
                    base.noRightOptMsg("密碼要8-20位,且必需包含大寫字母、小寫字母和数字!");
                }
                else
                {
                    base.noRightOptMsg("密碼要8-20位,且必需包含字母、和数字!");
                }
                base.Response.End();
            }
            if ((!str.Equals("0") && !str.Equals("1")) && !str.Equals("2"))
            {
                base.Response.End();
            }
            if (!string.IsNullOrEmpty(this.lottrty_six))
            {
                if ((!str8.ToUpper().Equals("A") && !str8.ToUpper().Equals("B")) && (!str8.ToUpper().Equals("C") && !str8.ToUpper().Equals("0")))
                {
                    base.Response.End();
                }
                if (!str7.ToUpper().Equals("0") && !str7.ToUpper().Equals("1"))
                {
                    base.Response.End();
                }
            }
            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                if ((!str14.ToUpper().Equals("A") && !str14.ToUpper().Equals("B")) && (!str14.ToUpper().Equals("C") && !str14.ToUpper().Equals("0")))
                {
                    base.Response.End();
                }
                if (!str13.ToUpper().Equals("0") && !str13.ToUpper().Equals("1"))
                {
                    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.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("⑥合彩: 設定增加‘信用額度’超過上级可以用餘額!");
                }
                if (double.Parse(str6) > this.d_maxRate_six)
                {
                    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.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("⑥合彩: 設定減少‘信用額度’超過可‘回收’餘額!");
                }
                if (str9.Equals("1"))
                {
                    if (string.IsNullOrEmpty(str10))
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg("⑥合彩:‘占成上限’不可為空,請修改!");
                    }
                    try
                    {
                        int.Parse(str10);
                    }
                    catch
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg("⑥合彩: ‘占成上限’只能為數字,請重新設定!");
                    }
                    if (Convert.ToInt32(str10) > 100)
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg("⑥合彩: ‘占成上限’不可高於 100%,請重新設定!");
                    }
                    else if (Convert.ToInt32(str10) < 0)
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg("⑥合彩: ‘占成上限’不可低於等於 0%,請重新設定!");
                    }
                    if (double.Parse(str10) < this.d_downRate_six)
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg(string.Format("⑥合彩: ‘占成上限’不可低於 {0}%,請重新設定!", this.d_downRate_six));
                    }
                }
                else
                {
                    str10 = "0";
                }
            }
            double num2 = 0.0;

            if (!string.IsNullOrEmpty(this.lottrty_kc))
            {
                if ((double.Parse(str11) - double.Parse(this.d_kc_credit)) > double.Parse(this.d_up_kc_usable_credit))
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("快彩: 設定增加‘信用額度’超過上级可以用餘額!");
                }
                if (double.Parse(str12) > this.d_maxRate_kc)
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("快彩: 分公司占成 數不正确,请核实后重新输入!");
                }
                num2 = double.Parse(str11) - double.Parse(this.d_kc_credit);
                if (double.Parse(str11) < (double.Parse(this.d_kc_credit) - Convert.ToDouble(this.d_kc_usable_credit)))
                {
                    base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                    base.noRightOptMsg("快彩: 設定減少‘信用額度’超過可‘回收’餘額!");
                }
                if (str15.Equals("1"))
                {
                    if (string.IsNullOrEmpty(str16))
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg("快彩:‘占成上限’不可為空,請修改!");
                    }
                    try
                    {
                        int.Parse(str16);
                    }
                    catch
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg("快彩: ‘占成上限’只能為數字,請重新設定!");
                    }
                    if (Convert.ToInt32(str16) > 100)
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg("快彩: ‘占成上限’不可高於 100%,請重新設定!");
                    }
                    else if (Convert.ToInt32(str16) < 0)
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg("快彩: ‘占成上限’不可低於等於 0%,請重新設定!");
                    }
                    if (double.Parse(str16) < this.d_downRate_kc)
                    {
                        base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                        base.noRightOptMsg(string.Format("快彩: ‘占成上限’不可低於 {0}%,請重新設定!", this.d_downRate_kc));
                    }
                }
                else
                {
                    str16 = "0";
                }
            }
            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(str12);
                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));
            _users.set_allow_sale(new int?(Convert.ToInt32(str7)));
            if (str9.Equals("1"))
            {
                _users.set_six_allow_maxrate(1);
                _users.set_six_low_maxrate(new int?(Convert.ToInt32(str10)));
            }
            else
            {
                _users.set_six_allow_maxrate(0);
                _users.set_six_low_maxrate(0);
            }
            _users.set_kc_rate(new int?(num6));
            _users.set_kc_credit(new decimal?(num7));
            _users.set_kc_usable_credit(new decimal?(num8));
            _users.set_kc_allow_sale(new int?(Convert.ToInt32(str13)));
            if (str15.Equals("1"))
            {
                _users.set_kc_allow_maxrate(1);
                _users.set_kc_low_maxrate(new int?(Convert.ToInt32(str16)));
            }
            else
            {
                _users.set_kc_allow_maxrate(0);
                _users.set_kc_low_maxrate(0);
            }
            bool flag2 = true;
            bool flag3 = true;
            bool flag4 = false;
            bool flag5 = false;

            if (str7.Equals("0") && this.d_six_allow_sale.Equals("1"))
            {
                flag4 = true;
            }
            if (str13.Equals("0") && this.d_kc_allow_sale.Equals("1"))
            {
                flag5 = true;
            }
            if (this.d_six_ExistsBet && this.d_six_OpenPhase)
            {
                flag2 = false;
                _users.set_allow_sale(new int?(int.Parse(this.d_six_allow_sale)));
                flag4 = false;
            }
            if (this.d_kc_ExistsBet && this.d_kc_OpenPhase)
            {
                flag3 = false;
                _users.set_kc_allow_sale(new int?(int.Parse(this.d_kc_allow_sale)));
                flag5 = false;
            }
            DataTable userInfoTableByUID = CallBLL.cz_users_bll.GetUserInfoTableByUID(this.r_u_id);

            if (CallBLL.cz_users_bll.UpdateUserInfo(_users, flag2, flag3, flag4, flag5, this.d_up_u_type, this.d_up_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();
                }
                base.user_edit_agent_log(userInfoTableByUID, CallBLL.cz_users_bll.GetUserInfoTableByUID(this.r_u_id), _users.get_u_name(), _users.get_u_type());
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.successOptMsg("已經成功修改總代!");
            }
            else
            {
                base.Un_User_Lock(rateKCByUserName.get_fgs_name());
                base.noRightOptMsg("修改總代失敗!");
            }
        }
Exemple #20
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";
            int    aid     = MyCommFun.RequestInt("aid");
            int    wid     = MyCommFun.RequestWid();
            string openid  = MyCommFun.RequestOpenid();
            string _action = MXRequest.GetQueryString("mycat");

            BLL.wx_qp_base  actBll  = new wx_qp_base();
            BLL.wx_qp_users userBll = new BLL.wx_qp_users();
            //验证码
            if (_action == "sendCardCheckCode")
            {
                Model.wx_qp_base actModel  = actBll.GetModel(aid);
                string           actName   = actModel.bName;
                smsMgr           smgr      = null;
                string           Number    = string.Empty;
                string           smsStatus = string.Empty;
                string           telephone = MXRequest.GetQueryString("telephone");
                #region 验证码
                Dictionary <string, string> jsonDict = new Dictionary <string, string>();
                IList <Model.wx_qp_users>   userList = userBll.GetModelList(string.Format(" (openid='{0}'and bId={2}) or (uTel='{1}' and bId={2})", openid, telephone, aid));
                try
                {
                    if (Regexlib.IsValidMobile(telephone))
                    {
                        //判断是否超过活动最大人数
                        if (actModel.cyPersonNum >= actModel.maxPersonNum)
                        {
                            jsonDict.Add("errno", "sys");
                            jsonDict.Add("content", "活动人数已满!");
                            context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                            return;
                        }

                        if (userList.Count > 0)//已参加过本次活动,不发送验证码
                        {
                            jsonDict.Add("errno", "sys");
                            jsonDict.Add("content", "你已参加过本次活动!");
                            context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                            return;
                        }
                        smgr      = new smsMgr(wid);
                        Number    = Utils.Number(6, true);
                        smsStatus = smgr.SendSMS(telephone, Number + "(动态验证码),您于" + DateTime.Now.ToString("yyyy年MM月dd日 hh点mm分") + "参与\"" + actName + "\"抢票活动,请在10分钟内输入该验证码!", Number, actName, aid);
                        if (smsStatus == "成功")
                        {
                            //获取验证码
                            jsonDict.Add("errno", "0");
                            jsonDict.Add("content", "获取验证码成功");
                            context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                            return;
                        }
                        else
                        {
                            jsonDict.Add("errno", "sys");
                            jsonDict.Add("content", "发送验证码失败!");
                            context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                            return;
                        }
                    }
                    else
                    {
                        jsonDict.Add("errno", "sys");
                        jsonDict.Add("content", "手机格式错误!");
                        context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                        return;
                    }
                }
                catch (Exception ex)
                {
                    jsonDict.Add("errno", "sys");
                    jsonDict.Add("content", "发送验证码失败!");
                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                    return;
                }

                #endregion
            }

            //index页面抢票时判断是否已参加过活动
            if (_action == "qp_ckJoined")
            {
                Dictionary <string, string> jsonDict = new Dictionary <string, string>();
                //判断此人是否已参与过活动
                bool joined = userBll.GetModelList(string.Format(" bId={0} and openid='{1}'", aid, openid)).Count > 0;
                if (joined)//已参与,跳转结果显示页面
                {
                    string goUrl = string.Format("order_Result.aspx?wid={0}&aid={1}&openid={2}&join=false", wid, aid, openid);
                    jsonDict.Add("errno", "0");
                    jsonDict.Add("content", goUrl);
                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                    return;
                }
                else//还未参与,跳转订单页面
                {
                    string goUrl = string.Format("order.aspx?wid={0}&aid={1}&openid={2}", wid, aid, openid);
                    jsonDict.Add("errno", "0");
                    jsonDict.Add("content", goUrl);
                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                    return;
                }
            }

            //抢票得到订单
            if (_action == "qp_ckOrder")
            {
                string                      identCode = MyCommFun.QueryString("identCode");
                string                      telephone = MyCommFun.QueryString("telephone");
                BLL.wx_sms_info             smsBll    = new BLL.wx_sms_info();
                Dictionary <string, string> jsonDict  = new Dictionary <string, string>();
                string                      goUrl     = "";
                //判断用户是否已经参与过活动
                IList <Model.wx_qp_users> userList = userBll.GetModelList(string.Format(" (openid='{0}'and bId={2}) or (uTel='{1}' and bId={2}) ", openid, telephone, aid));
                //判断验证码
                bool ckIdentcode = smsBll.ExistsYzm(telephone, identCode);

                Model.wx_qp_base actModel = actBll.GetModel(aid);

                //判断是否超过活动最大人数
                if (actModel.cyPersonNum >= actModel.maxPersonNum)
                {
                    jsonDict.Add("errno", "sys");
                    jsonDict.Add("content", "活动人数已满!");
                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                    return;
                }
                if (userList.Count > 0)
                {
                    jsonDict.Add("errno", "sys");
                    jsonDict.Add("content", "你已参加过活动,每人只能参加一次!");
                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                    return;
                }
                if (!Regexlib.IsValidMobile(telephone))
                {
                    jsonDict.Add("errno", "sys");
                    jsonDict.Add("content", "手机格式错误!");
                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                    return;
                }
                if (!ckIdentcode)
                {
                    jsonDict.Add("errno", "sys");
                    jsonDict.Add("content", "验证码错误!");
                    context.Response.Write(MyCommFun.getJsonStr(jsonDict));
                    return;
                }



                Model.wx_qp_users model = new Model.wx_qp_users();
                model.bId        = aid;
                model.openid     = openid;
                model.uTel       = telephone;
                model.createDate = DateTime.Now;
                model.sn         = "sn_" + Utils.Number(6, true);
                //添加参与活动用户并给递加活动人数
                int res = userBll.Add(model);
                actModel.cyPersonNum  = actModel.cyPersonNum + 1;
                actModel.yingyuanlist = null;
                actBll.Update(actModel);

                //判断该活动是否发送SN码通知用户
                if (actModel.isSnSendsms && res > 0)//发送
                {
                    smsMgr smgr      = new smsMgr(wid);
                    string smsStatus = smgr.SendSMS("您于" + DateTime.Now.ToString("yyyy年MM月dd日 hh点mm分") + "参与\"" + actModel.bName + "\"抢票活动!恭喜你,抢票成功!(SN码)" + telephone, model.sn, model.sn, actModel.bName, aid);
                }
                goUrl = string.Format("order_Result.aspx?wid={0}&aid={1}&openid={2}&join=true", wid, aid, openid);
                jsonDict.Add("errno", "0");
                jsonDict.Add("content", goUrl);
                context.Response.Write(MyCommFun.getJsonStr(jsonDict));
            }
        }