Esempio n. 1
0
    private void BindData()
    {
        DataTable dt = new DAL.Tables.T_UnionLinkScale().Open("ID,UnionID,SiteLinkPID,BonusScale", "UnionID=" + _User.ID, "SiteLinkPID");

        DataTable dtLink = new DAL.Tables.T_Users().Open("distinct [Memo]", "Memo<>'' and CpsID=" + _User.cps.ID, "[Memo]");
       
        double scale = _Site.SiteOptions["BonusScale"].ToDouble(0.02);
       
        for (int i = 0; i < dtLink.Rows.Count; i++)
        {
            string pid = dtLink.Rows[i][0].ToString();
            DataRow[] drList = dt.Select("SiteLinkPID='" + pid + "'");
            if (drList.Length == 0)
            {
                DataRow dr = dt.NewRow();
                dr["ID"] = 0;
                dr["UnionID"] = _User.cps.ID;
                dr["SiteLinkPID"] = pid;
                dr["BonusScale"] = scale;
                dt.Rows.Add(dr);
            }
        }

        DataTable dtTemp = GetNewDataTable(dt, "SiteLinkPID like '%" + tbPID.Text.Trim() + "%'");

        PF.DataGridBindData(g, dtTemp, gPager);
    }
 private void BindData()
 {
     DataTable table = new Tables.T_Users().Open("ID,SiteID ,Name ,RealityName, IDCardNumber ,Email ,QQ,Telephone , Mobile ,isCanLogin ,Reason", "SiteID = " + base._Site.ID.ToString() + "and isCanLogin= 0", "");
     if (table == null)
     {
         PF.GoError(4, "数据库繁忙,请重试", "Admin_Admin_UserLogOut");
     }
     else
     {
         DataRow[] rowArray;
         DataTable dt = table.Clone();
         if (this.rbUser.Checked)
         {
             rowArray = table.Select("Reason is not null");
         }
         else
         {
             rowArray = table.Select("Reason is null");
         }
         foreach (DataRow row in rowArray)
         {
             dt.Rows.Add(row.ItemArray);
         }
         PF.DataGridBindData(this.g, dt, this.gPager);
     }
 }
Esempio n. 3
0
 protected void btnDownload_Click(object sender, EventArgs e)
 {
     DataTable table = new Tables.T_Users().Open("", "", "[ID]");
     if (table == null)
     {
         PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
     }
     else
     {
         string str = "T_Users.xls";
         HttpResponse response = this.Page.Response;
         response.AppendHeader("Content-Disposition", "attachment;filename=" + str);
         base.Response.ContentType = "application/ms-excel";
         response.ContentEncoding = Encoding.GetEncoding("gb2312");
         foreach (DataColumn column in table.Columns)
         {
             response.Write(column.ColumnName + "\t");
         }
         response.Write("\n");
         foreach (DataRow row in table.Rows)
         {
             for (int i = 0; i < table.Columns.Count; i++)
             {
                 response.Write(row[i].ToString() + "\t");
             }
             response.Write("\n");
         }
         response.End();
     }
 }
Esempio n. 4
0
    private void BindData()
    {
        DataTable dt = new DAL.Tables.T_Users().Open("ID,SiteID ,Name ,RealityName, IDCardNumber ,Email ,QQ,Telephone , Mobile ,isCanLogin ,Reason", "SiteID = " + _Site.ID.ToString() + "and isCanLogin= 0", "");
        
        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_Admin_UserLogOut");

            return;
        }

        DataTable dtData = dt.Clone();
        DataRow[] drs;

        if (rbUser.Checked)
        {
            drs = dt.Select("Reason is not null");
        }
        else
        {
            drs = dt.Select("Reason is null");
        }

        foreach (DataRow dr in drs)
        {
            dtData.Rows.Add(dr.ItemArray);
        }

        PF.DataGridBindData(g, dtData, gPager);

    }
 private void BindData()
 {
     this.lbName.Text = base._User.Name;
     this.labName.Text = base._User.Name;
     DataTable table = new Tables.T_Users().Open("IsQQValided", "ID=" + base._User.ID.ToString(), "");
     if ((table != null) && (table.Rows.Count != 0))
     {
         if (_Convert.StrToBool(table.Rows[0]["IsQQValided"].ToString(), false))
         {
             this.labQQ.Text = (base._User.QQ.Length > 3) ? (base._User.QQ.Substring(0, 3) + "********") : base._User.QQ;
             this.lbStatus.Text = "您已经绑定";
         }
         else
         {
             this.labBindState.Text = "(未绑定)";
             this.lbStatus.Text = "您一旦绑定";
         }
         if (base._User.SecurityQuestion.StartsWith("自定义问题|"))
         {
             this.lbQuestion.Text = base._User.SecurityQuestion.Remove(0, 6);
         }
         else
         {
             this.lbQuestion.Text = base._User.SecurityQuestion;
         }
         if (this.lbQuestion.Text == "")
         {
             this.lbQuestionInfo.Text = "设置安全保护问题";
         }
         else
         {
             this.lbQuestionInfo.Text = "修改安全保护问题";
         }
     }
 }
 protected void btnGetPassword_Click(object sender, EventArgs e)
 {
     Thread.Sleep(500);
     string str = Utility.FilteSqlInfusion(this.tbFormUserName.Text.Trim());
     string email = Utility.FilteSqlInfusion(this.tbEmail.Text.Trim());
     this.tbFormCheckCode.Text.Trim();
     if (str == "")
     {
         JavaScript.Alert(this, "用户名不能为空。");
     }
     else if (email == "")
     {
         JavaScript.Alert(this, "邮箱地址不能为空。");
     }
     else if (!_String.Valid.isEmail(email))
     {
         JavaScript.Alert(this, "邮箱地址格式不正确。");
     }
     else if (base._Site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true) && !this.ShoveCheckCode1.Valid(this.tbFormCheckCode.Text.Trim()))
     {
         JavaScript.Alert(this, "验证码输入错误。");
     }
     else
     {
         DataTable table = new Tables.T_Users().Open("", "Name = '" + str + "' and Email = '" + email + "'", "");
         if ((table == null) || (table.Rows.Count < 1))
         {
             JavaScript.Alert(this, "用户名或邮箱不正确。");
         }
         else if (!_Convert.StrToBool(table.Rows[0]["isEmailValided"].ToString(), false))
         {
             JavaScript.Alert(this, "您的邮箱当前还没有激活,不能使用密码找回功能,请联系客服人员帮你找回密码,谢谢合作。");
         }
         else
         {
             string s = Encrypt.EncryptString(PF.GetCallCert(), table.Rows[0]["ID"].ToString() + "," + DateTime.Now.ToString());
             MD5CryptoServiceProvider provider = new MD5CryptoServiceProvider();
             string str4 = BitConverter.ToString(provider.ComputeHash(Encoding.UTF8.GetBytes(s))).Replace("-", "");
             s = str4.Substring(0, 0x10) + s + str4.Substring(0x10, 0x10);
             string str5 = Utility.GetUrl() + "/Home/Room/ResetPassword.aspx?key=" + s;
             StringBuilder builder = new StringBuilder();
             builder.Append("<div style='font-weight:bold;'>尊敬的" + base._Site.Name + "客户(").Append(str).Append("):</div>").Append("<div>您好!</div>").Append("<div>系统已收到您的密码找回申请,请点击链接<a href='").Append(str5).Append("' target='_top'>").Append(str5).Append("</a>重设您的密码。</div>").Append("<div>为了您的安全,该邮件通知地址将在 24 小时后失效,谢谢合作。</div>").Append("<div>此邮件由系统发出,请勿直接回复!</div>").Append("<div>上海福彩投诉电话:021-64175077</div>").Append("<div>意见收集与提交:[email protected] </div>").Append("<div>").Append(Utility.GetUrlWithoutHttp()).Append(" 版权所有(C) 2008-2009</div>");
             if (PF.SendEmail(base._Site, email, "密码找回通知信", builder.ToString()) < 0)
             {
                 new Log("System").Write(base.GetType().FullName + "发送邮件失败");
             }
             this.pSetp1.Visible = false;
             this.pStep2.Visible = true;
             this.script = "window.setInterval('DisplayTimer()', 1000);";
         }
     }
 }
Esempio n. 7
0
    protected bool CheckInput()
    {
        string name = tbUserName.Text;

        if (!PF.CheckUserName(name))
        {
            Shove._Web.JavaScript.Alert(this.Page, "对不起用户名中含有禁止使用的字符");

            return false;
        }

        if (Shove._String.GetLength(name) < 5 || Shove._String.GetLength(name) > 16)
        {
            Shove._Web.JavaScript.Alert(this.Page, "用户名长度在 5-16 个英文字符或数字、中文 3-8 之间。");

            return false;
        }

        if (tbPassword.Text != tbPwd.Text)
        {
            Shove._Web.JavaScript.Alert(this.Page, "两次密码输入不一致,请仔细检查。");

            return false;
        }

        if (tbPassword.Text.Length < 6 || tbPassword.Text.Length > 16)
        {
            Shove._Web.JavaScript.Alert(this.Page, "密码长度必须在 6-16 位之间。");

            return false;
        }

        DataTable dt = new DAL.Tables.T_Users().Open("ID", "Name='" + Shove._Web.Utility.FilteSqlInfusion(name) + "'", "");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName);

            return false;
        }

        if (dt.Rows.Count > 0)
        {
            Shove._Web.JavaScript.Alert(this.Page, "用户名已存在!");

            return false;
        }

        return true;
    }
 public int CheckUserName(string name)
 {
     if (!PF.CheckUserName(name))
     {
         return -1;
     }
     DataTable table = new Tables.T_Users().Open("ID", "Name = '" + Shove._Web.Utility.FilteSqlInfusion(name) + "'", "");
     if ((table != null) && (table.Rows.Count > 0))
     {
         return -2;
     }
     if ((_String.GetLength(name) >= 5) && (_String.GetLength(name) <= 0x10))
     {
         return 0;
     }
     return -3;
 }
Esempio n. 9
0
    private void BindData()
    {
        lbName.Text = _User.Name;
        labName.Text = _User.Name;
        //tbQQ.Text = _User.QQ;

        DataTable dt = new DAL.Tables.T_Users().Open("IsQQValided", "ID=" + _User.ID.ToString(), "");

        if (dt == null || dt.Rows.Count == 0)
        {
            return;
        }

        if (Shove._Convert.StrToBool(dt.Rows[0]["IsQQValided"].ToString(), false))
        {
            labQQ.Text = _User.QQ.Length > 3 ? (_User.QQ.Substring(0, 3) + "********") : _User.QQ;
            lbStatus.Text = "您已经绑定";
        }
        else
        {
            labBindState.Text = "(未绑定)";
            lbStatus.Text = "您一旦绑定";
        }

        if (_User.SecurityQuestion.StartsWith("自定义问题|"))
        {
            lbQuestion.Text = _User.SecurityQuestion.Remove(0, 6);
        }
        else
        {
            lbQuestion.Text = _User.SecurityQuestion;
        }

        if (lbQuestion.Text == "")
        {
            lbQuestionInfo.Text = "设置安全保护问题";
        }
        else
        {
            lbQuestionInfo.Text = "修改安全保护问题";
        }
    }
Esempio n. 10
0
    private void BindDataForUser()
    {
        DataTable dt = new DAL.Tables.T_Users().Open("[ID], [Name]", "SiteID = " + _Site.ID.ToString() + " and [ID] in (select distinct UserID from T_CompetencesOfUsers union all select distinct UserID from T_UserInGroups)", "[ID]");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_SchemeList");

            return;
        }

        ddlUser.Items.Add(new ListItem("全部操作员", "-1"));

        foreach (DataRow dr in dt.Rows)
        {
            ddlUser.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
        }

        ddlUser.SelectedIndex = 0;
    }
Esempio n. 11
0
    private void BindUsers()
    {
        string Key = "CPS_Default_BindUsers";

        DataTable dt = Shove._Web.Cache.GetCacheAsDataTable(Key);

        if (dt == null)
        {
            dt = new DAL.Tables.T_Users().Open("top 9 Name,Bonus", "Bonus > 0", "Bonus desc");

            if (dt == null)
            {
                return;
            }

            Shove._Web.Cache.SetCache(Key, 3600);
        }

        StringBuilder sb = new StringBuilder();

        sb.Append("<table width=\"96%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            sb.Append("<tr>")
                .Append("<td width=\"16%\" height=\"26\" align=\"center\">")
                .Append("<img src=\"images/num_" + (i + 1).ToString() + ".gif\" width=\"13\" height=\"13\" />")
                .Append("</td>")
                .Append("<td width=\"53%\" height=\"26\" class=\"hui\">")
                .Append(dt.Rows[i]["Name"].ToString())
                .Append("</td>")
                .Append("<td width=\"31%\" height=\"26\" class=\"hui\">")
                .Append(Shove._Convert.StrToDouble(dt.Rows[i]["Bonus"].ToString(), 0).ToString("N"))
                .Append("元</td>")
                .Append("</tr>");
        }

        sb.Append("</table>");

        tdUsers.InnerHtml = sb.ToString();
    }
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     string str = Utility.FilteSqlInfusion(this.tbName.Text.Trim());
     if (str == "")
     {
         JavaScript.Alert(this.Page, "请输入名人用户名!");
     }
     else
     {
         int num = _Convert.StrToInt(this.tbOrder.Text.Trim(), -1);
         if (num < 0)
         {
             JavaScript.Alert(this.Page, "顺序输入非法!");
         }
         else
         {
             DataTable table = new Tables.T_Users().Open("ID", "Name='" + str + "'", "");
             if ((table == null) || (table.Rows.Count == 0))
             {
                 JavaScript.Alert(this.Page, "不存在" + str + "用户!");
             }
             else
             {
                 table = new Tables.T_Personages().Open("ID", "UserName='******' and LotteryID=" + Utility.FilteSqlInfusion(this.ddlLotteries.SelectedValue) + " and ID<>" + Utility.FilteSqlInfusion(this.hidID.Value), "");
                 if ((table != null) && (table.Rows.Count > 0))
                 {
                     JavaScript.Alert(this.Page, str + "已经是" + this.ddlLotteries.SelectedItem.Text + "的名人了!");
                 }
                 else if (new Tables.T_Personages { Order = { Value = num }, UserName = { Value = str }, LotteryID = { Value = this.ddlLotteries.SelectedValue }, IsShow = { Value = this.cbisShow.Checked } }.Update("ID =" + Utility.FilteSqlInfusion(this.hidID.Value)) > 0L)
                 {
                     Shove._Web.Cache.ClearCache("Admin_Personages");
                     JavaScript.Alert(this, "修改成功", "Personages.aspx?LotteryID=" + this.ddlLotteries.SelectedValue);
                 }
                 else
                 {
                     JavaScript.Alert(this, "修改失败");
                 }
             }
         }
     }
 }
Esempio n. 13
0
    private void SendSystemMessage()
    {
        DataTable dt = new DAL.Tables.T_Users().Open("", "SiteID = " + _Site.ID.ToString() + " and Mobile <> ''", "");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_SendEmail");

            return;
        }

        int CountOK = 0, CountFail = 0;	//发送计数统计
        string SendResult = "";	//发送结果

        foreach (DataRow dr in dt.Rows)
        {
            if (PF.SendSMS(_Site, -1, dr["Mobile"].ToString(), tbContent.Text.Trim()) < 0)
            {
                CountFail++;
                SendResult += "用户 " + dr["Name"].ToString() + " 发送错误!<br />";
            }
            else
            {
                CountOK++;
                SendResult += "用户 " + dr["Name"].ToString() + " 发送成功。<br />";
            }
        }

        labSendResult.Text = "发送结果:成功 " + CountOK.ToString() + " 个,失败 " + CountFail.ToString() + " 个。<br />" + SendResult;

        if (CountFail == 0)
        {
            tbAim.Text = "";
            tbContent.Text = "";
            cbSystemMessage.Checked = false;
        }
    }
Esempio n. 14
0
 private void SendSystemMessage()
 {
     DataTable table = new Tables.T_Users().Open("", "SiteID = " + base._Site.ID.ToString() + " and Mobile <> ''", "");
     if (table == null)
     {
         PF.GoError(4, "数据库繁忙,请重试", "Admin_SendEmail");
     }
     else
     {
         int num = 0;
         int num2 = 0;
         string str = "";
         foreach (DataRow row in table.Rows)
         {
             if (PF.SendSMS(base._Site, -1L, row["Mobile"].ToString(), this.tbContent.Text.Trim()) < 0)
             {
                 num2++;
                 str = str + "用户 " + row["Name"].ToString() + " 发送错误!<br />";
             }
             else
             {
                 num++;
                 str = str + "用户 " + row["Name"].ToString() + " 发送成功。<br />";
             }
         }
         this.labSendResult.Text = "发送结果:成功 " + num.ToString() + " 个,失败 " + num2.ToString() + " 个。<br />" + str;
         if (num2 == 0)
         {
             this.tbAim.Text = "";
             this.tbContent.Text = "";
             this.cbSystemMessage.Checked = false;
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     AjaxPro.Utility.RegisterTypeForAjax(typeof(Home_Room_TencentReceive), this.Page);
     if (base.Request.Form.AllKeys.Length < 1)
     {
         JavaScript.Alert(this.Page, "接口调用失败,请重新登录。", "../../UserLogin.aspx");
     }
     else
     {
         new StringBuilder();
         string str = (base.Request.Form["charset"] == null) ? "" : base.Request.Form["charset"].ToString().Trim();
         string str2 = (base.Request.Form["tmstamp"] == null) ? "" : base.Request.Form["tmstamp"].ToString().Trim();
         string str3 = (base.Request.Form["sign"] == null) ? "" : base.Request.Form["sign"].ToString().Trim();
         string key = this.so["MemberSharing_Tencent_MD5"].ToString("").Trim();
         string str5 = (base.Request.Form["id"] == null) ? "" : base.Request.Form["id"].ToString().Trim();
         string str6 = "";
         if ((str5.IndexOf("@") > 0) && (str5.IndexOf(".") > 0))
         {
             str6 = str5;
         }
         else
         {
             str6 = str5 + "@qq.com";
         }
         if (!base.IsPostBack)
         {
             if ((_Convert.StrToLong(this.GetTmstamp(), 0L) - _Convert.StrToLong(str2, 0L)) > 120L)
             {
                 JavaScript.Alert(this.Page, "登陆超时,请重新登录。", "../../UserLogin.aspx");
                 return;
             }
             string[] allKeys = base.Request.Form.AllKeys;
             if (this.GetSign(key, str, allKeys) != str3)
             {
                 JavaScript.Alert(this.Page, "您不是有效的腾讯用户不能登录本站,请您注册成为本站会员,再登录,谢谢!(-1001)。", "../../UserLogin.aspx");
                 return;
             }
             if (string.IsNullOrEmpty(str5))
             {
                 JavaScript.Alert(this.Page, "您不是有效的腾讯用户不能登录本站,请您注册成为本站会员,再登录,谢谢!(-1002)。", "../../UserLogin.aspx");
                 return;
             }
         }
         bool flag = base._Site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true);
         this.CheckCode.Visible = flag;
         new Login().SetCheckCode(base._Site, this.ShoveCheckCode1);
         Sites sites = new Sites()[Shove._Web.Utility.GetUrlWithoutHttp()];
         if (sites == null)
         {
             JavaScript.Alert(this.Page, "站点信息不存在。", "../../UserLogin.aspx");
         }
         else
         {
             if ((base._User != null) && (Shove._Web.Cache.GetCache("UserQQBind_" + base._User.ID.ToString()) != null))
             {
                 if (_Convert.StrToLong(str5, 0L) < 1L)
                 {
                     JavaScript.Alert(this.Page, "您输入的 QQ 号码不合法!", "TencentLogin.aspx");
                     return;
                 }
                 Shove._Web.Cache.ClearCache("UserQQBind_" + base._User.ID.ToString());
                 Thread.Sleep(500);
                 string returnDescription = "";
                 base._User.QQ = str5;
                 base._User.isQQValided = true;
                 if (base._User.EditByID(ref returnDescription) < 0)
                 {
                     JavaScript.Alert(this.Page, returnDescription);
                     return;
                 }
                 JavaScript.Alert(this.Page, "QQ号码绑定成功!", "UserQQBind.aspx");
             }
             DataTable dt = new Tables.T_Users().Open("[ID], [Name]", "SiteID = " + sites.ID.ToString() + " and QQ = '" + Shove._Web.Utility.FilteSqlInfusion(str5) + "' and IsQQValided = 1", "[ID]");
             if (dt == null)
             {
                 JavaScript.Alert(this.Page, "数据库繁忙,请重试。", "../../UserLogin.aspx");
             }
             else if (!base.IsPostBack)
             {
                 this.labAccount.Text = str5;
                 this.labAccount2.Text = str5;
                 if (dt.Rows.Count < 1)
                 {
                     this.tbQQID.Text = str5;
                     this.tbName.Text = str5;
                     this.tbEmail.Text = str6;
                     this.btnSelect.Enabled = false;
                     this.tableSelect.Visible = false;
                     this.Script = "btn_CheckUserName('" + str5 + "')";
                 }
                 else if (dt.Rows.Count == 1)
                 {
                     long num4 = _Convert.StrToLong(dt.Rows[0]["ID"].ToString(), -1L);
                     if (num4 < 0L)
                     {
                         JavaScript.Alert(this.Page, "用户信息读取错误。", "../../UserLogin.aspx");
                     }
                     else
                     {
                         Users user = new Users(sites.ID)[sites.ID, num4];
                         if (user == null)
                         {
                             JavaScript.Alert(this.Page, "用户信息不存在。", "../../UserLogin.aspx");
                         }
                         else
                         {
                             string str9 = "";
                             if (user.LoginDirect(ref str9) < 0)
                             {
                                 PF.GoError(1, str9, base.GetType().FullName);
                             }
                             else
                             {
                                 this.ResponseToDistination(user, str5);
                             }
                         }
                     }
                 }
                 else
                 {
                     this.tableRegister.Visible = false;
                     this.btnOK.Enabled = false;
                     this.tableSelect.Visible = true;
                     this.btnSelect.Enabled = true;
                     ControlExt.FillDropDownList(this.ddlName, dt, "Name", "ID");
                     this.ddlName.SelectedIndex = 0;
                 }
             }
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     AjaxPro.Utility.RegisterTypeForAjax(typeof(Home_Room_BindBankCard), this.Page);
     if (!base.IsPostBack)
     {
         if (base.User != null)
         {
             DataTable table = new Tables.T_Users().Open("SecurityQuestion ,SecurityAnswer", "SiteID = " + base._Site.ID.ToString() + " and  ID=" + base._User.ID.ToString(), "");
             if ((table == null) || string.IsNullOrEmpty(table.Rows[0]["SecurityQuestion"].ToString()))
             {
                 this.tbNewQF.Visible = true;
                 this.divAnswer.Visible = false;
             }
             else
             {
                 this.tbNewQF.Visible = false;
                 this.divAnswer.Visible = true;
             }
         }
         this.BindData();
         this.ddlQuestion.DataSource = DataCache.SecurityQuestions;
         this.ddlQuestion.DataBind();
     }
 }
 private void GetUserName(string uid)
 {
     DataTable dtUser = new DAL.Tables.T_Users().Open("ID,Name", "[ID] = " + uid, "");
     if (dtUser == null)
     {
         this.lbUserName.Text = "无法获取用户信息";
         return;
     }
     else
     {
         this.lbUserName.Text = dtUser.Rows[0][1] + "";
         this.userId.Value = dtUser.Rows[0][0].ToString();
     }
 }
Esempio n. 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AjaxPro.Utility.RegisterTypeForAjax(typeof(Home_Room_TencentReceive), this.Page);


        if (this.Request.Form.AllKeys.Length < 1)
        {
            Shove._Web.JavaScript.Alert(this.Page, "接口调用失败,请重新登录。", "../../UserLogin.aspx");

            return;
        }
        StringBuilder sb = new StringBuilder();

        string input_charset = Request.Form["charset"] == null ? "" : Request.Form["charset"].ToString().Trim();
        string tmstamp = Request.Form["tmstamp"] == null ? "" : Request.Form["tmstamp"].ToString().Trim();
        string sign = Request.Form["sign"] == null ? "" : Request.Form["sign"].ToString().Trim();
        string key =so["MemberSharing_Tencent_MD5"].ToString("").Trim();

        string id = Request.Form["id"] == null ? "" : Request.Form["id"].ToString().Trim();
        string email = "" ;
        if (id.IndexOf("@") > 0 && id.IndexOf(".") > 0)
        {
            email = id;
        }
        else
        {
            email = id + "@qq.com";
        }

        if (!IsPostBack)
        {
            if (Shove._Convert.StrToLong(GetTmstamp(), 0) - Shove._Convert.StrToLong(tmstamp, 0) > 60 * 2)
            {
                Shove._Web.JavaScript.Alert(this.Page, "登陆超时,请重新登录。", "../../UserLogin.aspx");

                return;
            }
            string[] allKeys = Request.Form.AllKeys;
            string TencentSign = GetSign(key, input_charset, allKeys);
            if (TencentSign != sign)
            {
                Shove._Web.JavaScript.Alert(this.Page, "您不是有效的腾讯用户不能登录本站,请您注册成为本站会员,再登录,谢谢!(-1001)。", "../../UserLogin.aspx");

                return;
            }
            if (String.IsNullOrEmpty(id))
            {
                Shove._Web.JavaScript.Alert(this.Page, "您不是有效的腾讯用户不能登录本站,请您注册成为本站会员,再登录,谢谢!(-1002)。", "../../UserLogin.aspx");

                return;
            }

        }

        bool isUseCheckCode = _Site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true);
        CheckCode.Visible = isUseCheckCode;

        new Login().SetCheckCode(_Site, ShoveCheckCode1);

        Sites site = new Sites()[Shove._Web.Utility.GetUrlWithoutHttp()];

        if (site == null)
        {
            Shove._Web.JavaScript.Alert(this.Page, "站点信息不存在。", "../../UserLogin.aspx");

            return;
        }

        if (_User != null && Shove._Web.Cache.GetCache("UserQQBind_" + _User.ID.ToString()) != null)
        {
            
            if (Shove._Convert.StrToLong(id, 0) < 1)
            {
                Shove._Web.JavaScript.Alert(this.Page, "您输入的 QQ 号码不合法!", "TencentLogin.aspx");

                return;
            }
            Shove._Web.Cache.ClearCache("UserQQBind_" + _User.ID.ToString());
            System.Threading.Thread.Sleep(500);

            int ReturnValue = -1;
            string ReturnDescription = "";

            _User.QQ = id;
            _User.isQQValided = true;
            ReturnValue = _User.EditByID(ref ReturnDescription);

            if (ReturnValue < 0)
            {
                Shove._Web.JavaScript.Alert(this.Page, ReturnDescription);

                return;
            }

            Shove._Web.JavaScript.Alert(this.Page, "QQ号码绑定成功!","UserQQBind.aspx");
        }
      
        DAL.Tables.T_Users t_users = new DAL.Tables.T_Users();
        DataTable dt = t_users.Open("[ID], [Name]", "SiteID = " + site.ID.ToString() + " and QQ = '" + Shove._Web.Utility.FilteSqlInfusion(id) + "' and IsQQValided = 1", "[ID]");

        if (dt == null)
        {
            Shove._Web.JavaScript.Alert(this.Page, "数据库繁忙,请重试。", "../../UserLogin.aspx");

            return;
        }

        if (!IsPostBack)
        {
            labAccount.Text = id;
            labAccount2.Text = id;

            if (dt.Rows.Count < 1)
            {
                // 不存在,注册为新会员
                tbQQID.Text = id;
                tbName.Text = id;
                tbEmail.Text = email;

                btnSelect.Enabled = false;
                tableSelect.Visible = false;
                Script = "btn_CheckUserName('" + id + "')";
                return;
            }
            else if (dt.Rows.Count == 1)
            {
                long UserID = Shove._Convert.StrToLong(dt.Rows[0]["ID"].ToString(), -1);

                if (UserID < 0)
                {
                    Shove._Web.JavaScript.Alert(this.Page, "用户信息读取错误。", "../../UserLogin.aspx");

                    return;
                }

                Users user = new Users(site.ID)[site.ID, UserID];

                if (user == null)
                {
                    Shove._Web.JavaScript.Alert(this.Page, "用户信息不存在。", "../../UserLogin.aspx");

                    return;
                }

                string ReturnDescription = "";

                if (user.LoginDirect(ref ReturnDescription) < 0)
                {
                    PF.GoError(ErrorNumber.Unknow, ReturnDescription, this.GetType().FullName);

                    return;
                }

                ResponseToDistination(user, id);

                return;
            }

            // 绑定了多个用户
            tableRegister.Visible = false;
            btnOK.Enabled = false;
            tableSelect.Visible = true;
            btnSelect.Enabled = true;

            Shove.ControlExt.FillDropDownList(ddlName, dt, "Name", "ID");
            ddlName.SelectedIndex = 0;
        }
    }
Esempio n. 19
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        string UserName = tbName.Text.Trim();

        if (UserName == "")
        {
            Shove._Web.JavaScript.Alert(this.Page, "请输入名人用户名!");

            return;
        }

        int order = Shove._Convert.StrToInt(tbOrder.Text.Trim(), -1);

        if (order < 0)
        {
            Shove._Web.JavaScript.Alert(this.Page, "顺序输入非法!");

            return;
        }

        DataTable dt = new DAL.Tables.T_Users().Open("ID", "Name='" + UserName + "'", "");

        if (dt == null || dt.Rows.Count == 0)
        {
            Shove._Web.JavaScript.Alert(this.Page, "不存在"+UserName+"用户!");

            return;
        }

        int UserID = 0;
        // 获取用户ID        
        try
        {
            UserID = Shove._Convert.StrToInt(dt.Rows[0]["ID"].ToString(), 0);
        }
        catch { UserID = 0; }


        dt = new DAL.Tables.T_Personages().Open("ID", "UserName='******' and LotteryID=" + Shove._Web.Utility.FilteSqlInfusion(ddlLotteries.SelectedValue) + "", "");

        if (dt != null && dt.Rows.Count > 0)
        {
            Shove._Web.JavaScript.Alert(this.Page,UserName+"已经是"+ddlLotteries.SelectedItem.Text+"的名人了!");

            return;
        }

        DAL.Tables.T_Personages p = new DAL.Tables.T_Personages();

        p.UserID.Value = UserID;
        p.Order.Value = order;
        p.UserName.Value = UserName;
        p.LotteryID.Value = ddlLotteries.SelectedValue;
        p.IsShow.Value = cbisShow.Checked;
        p.IsRecommend.Value = cbIsRecommend.Checked;

        if (cbIsRecommend.Checked)
        {
            Shove.Database.MSSQL.ExecuteNonQuery("update T_Personages set IsRecommend = 0");
            // 清楚缓存
            Shove._Web.Cache.ClearCache("DataCache_CelebrityHall_Recommends");
        }

        long l = p.Insert();

        if (l >= 0)
        {
            Shove._Web.Cache.ClearCache("Admin_Personages");
            Shove._Web.Cache.ClearCache("DataCache_CelebrityHall_Collects");
            Shove._Web.Cache.ClearCache("DataCache_CelebrityHall_Star");
            Shove._Web.Cache.ClearCache("DataCache_CelebrityHall_Recommends");

            Shove._Web.JavaScript.Alert(this, "添加成功", "Personages.aspx?LotteryID=" + ddlLotteries.SelectedValue);
        }
        else
        {
            Shove._Web.JavaScript.Alert(this, "添加失败");
        }
    }
Esempio n. 20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AjaxPro.Utility.RegisterTypeForAjax(typeof(Home_Room_Receive), this.Page);
     if (base.Request.QueryString.Count < 1)
     {
         JavaScript.Alert(this.Page, "接口调用失败,请重新登录。", "../../Default.aspx");
     }
     else
     {
         string str = "http://notify.alipay.com/trade/notify_query.do?";
         string str2 = this.so["MemberSharing_Alipay_UserNumber"].ToString("");
         str = str + "partner=" + str2 + "&notify_id=" + base.Request.QueryString["notify_id"];
         if (this.Get_Http(str, 0x1d4c0) == "false")
         {
             JavaScript.Alert(this.Page, "接口调用失败,请重新登录。", "../../Default.aspx");
         }
         else
         {
             bool flag = base._Site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true);
             this.CheckCode.Visible = flag;
             new Login().SetCheckCode(base._Site, this.ShoveCheckCode1);
             if (WebConfig.GetAppSettingsBool("DebugUserControl", false))
             {
                 this.tbName.Text = "为了设计页面而进入调试状态,本控件的功能并不运行";
             }
             else
             {
                 string str4 = this.so["MemberSharing_Alipay_MD5"].ToString("");
                 string charset = "utf-8";
                 string[] strArray3 = Shove.Alipay.Alipay.BubbleSort(base.Request.QueryString.AllKeys);
                 StringBuilder builder = new StringBuilder();
                 for (int i = 0; i < strArray3.Length; i++)
                 {
                     if (((!string.IsNullOrEmpty(strArray3[i]) && (base.Request.QueryString[strArray3[i]] != "")) && ((strArray3[i] != "sign") && (strArray3[i] != "sign_type"))) && (strArray3[i].ToLower() != "pn"))
                     {
                         if (i == (strArray3.Length - 1))
                         {
                             builder.Append(strArray3[i] + "=" + base.Request.QueryString[strArray3[i]]);
                         }
                         else
                         {
                             builder.Append(strArray3[i] + "=" + base.Request.QueryString[strArray3[i]] + "&");
                         }
                     }
                 }
                 builder.Append(str4);
                 string str6 = Shove.Alipay.Alipay.GetMD5(builder.ToString(), charset);
                 string str7 = (base.Request.QueryString["sign"] == null) ? "" : base.Request.QueryString["sign"].ToString();
                 string str8 = (base.Request.QueryString["is_success"] == null) ? "" : base.Request.QueryString["is_success"].ToString().ToUpper();
                 string str9 = (base.Request.QueryString["user_id"] == null) ? "" : base.Request.QueryString["user_id"].ToString();
                 string str10 = (base.Request.QueryString["email"] == null) ? "" : base.Request.QueryString["email"].ToString();
                 if (base.Request.QueryString["user_type"] != null)
                 {
                     base.Request.QueryString["user_type"].ToString();
                 }
                 if (base.Request.QueryString["user_status"] != null)
                 {
                     base.Request.QueryString["user_status"].ToString();
                 }
                 if (base.Request.QueryString["firm_name"] != null)
                 {
                     base.Request.QueryString["firm_name"].ToString();
                 }
                 string str11 = (base.Request.QueryString["real_name"] == null) ? "" : base.Request.QueryString["real_name"].ToString();
                 if (base.Request.QueryString["cert_no"] != null)
                 {
                     base.Request.QueryString["cert_no"].ToString();
                 }
                 if (base.Request.QueryString["cert_type"] != null)
                 {
                     base.Request.QueryString["cert_type"].ToString();
                 }
                 if (base.Request.QueryString["gender"] != null)
                 {
                     base.Request.QueryString["gender"].ToString();
                 }
                 if (base.Request.QueryString["province"] != null)
                 {
                     base.Request.QueryString["province"].ToString();
                 }
                 if (base.Request.QueryString["city"] != null)
                 {
                     base.Request.QueryString["city"].ToString();
                 }
                 if (base.Request.QueryString["address"] != null)
                 {
                     base.Request.QueryString["address"].ToString();
                 }
                 if (base.Request.QueryString["zip"] != null)
                 {
                     base.Request.QueryString["zip"].ToString();
                 }
                 if (base.Request.QueryString["phone"] != null)
                 {
                     base.Request.QueryString["phone"].ToString();
                 }
                 if (base.Request.QueryString["mobile"] != null)
                 {
                     base.Request.QueryString["mobile"].ToString();
                 }
                 if (base.Request.QueryString["is_bank_auth"] != null)
                 {
                     base.Request.QueryString["is_bank_auth"].ToString();
                 }
                 if (base.Request.QueryString["is_mobile_auth"] != null)
                 {
                     base.Request.QueryString["is_mobile_auth"].ToString();
                 }
                 if (base.Request.QueryString["is_id_auth"] != null)
                 {
                     base.Request.QueryString["is_id_auth"].ToString();
                 }
                 if ((str6 != str7) || (str10 == ""))
                 {
                     PF.GoError(1, "您不是有效的支付宝会员不能登录本站,请您注册成为本站会员,再登录,谢谢!(-1001)", base.GetType().FullName);
                 }
                 else if (str8 != "T")
                 {
                     PF.GoError(1, "您不是有效的支付宝会员不能登录本站,请您注册成为本站会员,再登录,谢谢!(-1002)", base.GetType().FullName);
                 }
                 else if (string.IsNullOrEmpty(str9))
                 {
                     PF.GoError(1, "您不是有效的支付宝会员不能登录本站,请您注册成为本站会员,再登录,谢谢!(-1003)", base.GetType().FullName);
                 }
                 else if (string.IsNullOrEmpty(str10))
                 {
                     PF.GoError(1, "您不是有效的支付宝会员不能登录本站,请您注册成为本站会员,再登录,谢谢!(-1004)", base.GetType().FullName);
                 }
                 else
                 {
                     Sites sites = new Sites()[Shove._Web.Utility.GetUrlWithoutHttp()];
                     if (sites == null)
                     {
                         PF.GoError(1, "会员数据校验错误。", base.GetType().FullName);
                     }
                     else
                     {
                         if ((base._User != null) && (Shove._Web.Cache.GetCache("BindAlipay_" + base._User.ID.ToString()) != null))
                         {
                             string realityName = "";
                             long num3 = new Member().Query(str10, ref realityName);
                             if (num3 < 0L)
                             {
                                 JavaScript.Alert(this.Page, "输入的账号在支付宝网站验证失败(不存在账号或者网络通讯故障," + num3.ToString() + "),请重新填写一个账号名称。");
                                 return;
                             }
                             if (((str11 != base._User.RealityName) && (realityName != base._User.RealityName)) && (base._User.RealityName != ""))
                             {
                                 JavaScript.Alert(this.Page, "您输入的支付宝账号的真实姓名与您在本站注册时提供的真实姓名不一致,请更换新的支付宝帐号进行绑定,谢谢!", "Login.aspx");
                                 return;
                             }
                             Shove._Web.Cache.ClearCache("BindAlipay_" + base._User.ID.ToString());
                             Thread.Sleep(500);
                             Users user = new Users(base._Site.ID);
                             base._User.Clone(user);
                             base._User.AlipayID = num3.ToString();
                             base._User.AlipayName = str10;
                             base._User.RealityName = realityName;
                             base._User.isAlipayNameValided = true;
                             string returnDescription = "";
                             if (base._User.EditByID(ref returnDescription) < 0)
                             {
                                 user.Clone(base._User);
                                 JavaScript.Alert(this.Page, returnDescription);
                                 return;
                             }
                             JavaScript.Alert(this.Page, "支付宝绑定成功!", "BindAlipay.aspx");
                         }
                         DataTable dt = new Tables.T_Users().Open("[ID], [Name]", "SiteID = " + sites.ID.ToString() + " and AlipayID = '" + Shove._Web.Utility.FilteSqlInfusion(str9) + "'", "[ID]");
                         if (dt == null)
                         {
                             PF.GoError(4, "数据库繁忙,请重试", base.GetType().FullName);
                         }
                         else if (!base.IsPostBack)
                         {
                             this.labAccount.Text = str10;
                             this.labAccount2.Text = str10;
                             if (dt.Rows.Count < 1)
                             {
                                 this.tbAlipayID.Text = str9;
                                 this.tbName.Text = str10.Split(new char[] { '@' })[0];
                                 this.Script = "btn_CheckUserName('" + this.tbName.Text + "')";
                                 this.btnSelect.Enabled = false;
                                 this.tableSelect.Visible = false;
                             }
                             else if (dt.Rows.Count == 1)
                             {
                                 long num5 = _Convert.StrToLong(dt.Rows[0]["ID"].ToString(), -1L);
                                 if (num5 < 0L)
                                 {
                                     PF.GoError(1, "会员数据校验错误。", base.GetType().FullName);
                                 }
                                 else
                                 {
                                     Users users3 = new Users(sites.ID)[sites.ID, num5];
                                     if (users3 == null)
                                     {
                                         PF.GoError(1, "会员数据校验错误。", base.GetType().FullName);
                                     }
                                     else
                                     {
                                         string str14 = "";
                                         if (users3.LoginDirect(ref str14) < 0)
                                         {
                                             PF.GoError(1, str14, base.GetType().FullName);
                                         }
                                         else
                                         {
                                             long buyID = -1L;
                                             if ((base.Request.Url.AbsoluteUri.IndexOf("?BuyID") > 0) && (base.Request.Url.AbsoluteUri.IndexOf("&") > 0))
                                             {
                                                 buyID = _Convert.StrToLong(HttpUtility.UrlDecode(base.Request.Url.AbsoluteUri).Split(new char[] { '?' })[1].Split(new char[] { '&' })[0].Replace("BuyID=", ""), -1L);
                                             }
                                             if (buyID > 0L)
                                             {
                                                 this.GoBuy(buyID);
                                             }
                                             else
                                             {
                                                 base.Response.Redirect("../../Default.aspx", true);
                                             }
                                         }
                                     }
                                 }
                             }
                             else
                             {
                                 this.tableRegister.Visible = false;
                                 this.btnOK.Enabled = false;
                                 this.tableSelect.Visible = true;
                                 this.btnSelect.Enabled = true;
                                 ControlExt.FillDropDownList(this.ddlName, dt, "Name", "ID");
                                 this.ddlName.SelectedIndex = 0;
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Esempio n. 21
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        string Question = ddlQuestion.SelectedValue;
        if (trOldQue.Visible == true)
        {
            if (tbOAnswer.Text.Trim() != _User.SecurityAnswer)
            {
                Shove._Web.JavaScript.Alert(this.Page, "原安全问题回答错误");

                return;
            }
        }
        

        if (Question == "自定义问题")
        {
            Question = Shove._Web.Utility.FilteSqlInfusion(tbMyQuestion.Text.Trim());

            if (Question == "")
            {
                Shove._Web.JavaScript.Alert(this.Page, "请输入安全问题");

                return;
            }

            Question = "自定义问题|" + Question;
        }
        else
        {
            Question = ddlQuestion.SelectedValue;
        }

        string Answer = Shove._Web.Utility.FilteSqlInfusion(tbAnswer.Text.Trim());

        if (Answer == "")
        {
            Shove._Web.JavaScript.Alert(this.Page, "请输入答案");

            return;
        }

        DAL.Tables.T_Users user = new DAL.Tables.T_Users();

        user.SecurityQuestion.Value = Question;
        user.SecurityAnswer.Value = Answer;

        long Result = user.Update("ID=" + _User.ID.ToString());

        if (Result < 0)
        {
            Shove._Web.JavaScript.Alert(this.Page, "设置安全问题失败");

            return;
        }
        //修改验证状态
        DAL.Tables.T_UserEditQuestionAnswer T_QF = new DAL.Tables.T_UserEditQuestionAnswer();
        string ReturnDescription = "";
        T_QF.QuestionAnswerState.Value = 1;

        Result = T_QF.Update("UserID=" + _User.ID);
        if (Result < 0)
        {
            PF.GoError(-1, ReturnDescription, this.GetType().FullName);

            return;
        }

        Response.Write("<script type='text/javascript'>alert('设置安全问题成功。请注意安全保护问题是最重要的安全凭证,为了您的安全,请牢牢记住您的安全保护问题。');window.location='" + this.hdFromUrl.Value + "'</script>");
        Response.End();

    }
Esempio n. 22
0
    protected void btnSafeSetNext_Click(object sender, EventArgs e)
    {
        string Question = ddlQuestion.SelectedValue;

        if (tbOAnswer.Text.Trim() != _User.SecurityAnswer)
        {
            Shove._Web.JavaScript.Alert(this.Page, "原安全问题回答错误");

            return;
        }

        if (Question == "自定义问题")
        {
            Question = Shove._Web.Utility.FilteSqlInfusion(tbMyQuestion.Text.Trim());

            if (Question == "")
            {
                Shove._Web.JavaScript.Alert(this.Page, "请输入安全问题");

                return;
            }

            Question = "自定义问题|" + Question;
        }
        else
        {
            Question = ddlQuestion.SelectedValue;
        }

        string Answer = Shove._Web.Utility.FilteSqlInfusion(tbAnswer.Text.Trim());

        if (Answer == "")
        {
            Shove._Web.JavaScript.Alert(this.Page, "请输入答案");

            return;
        }

        DAL.Tables.T_Users user = new DAL.Tables.T_Users();

        user.SecurityQuestion.Value = Question;
        user.SecurityAnswer.Value = Answer;

        long Result = user.Update("ID=" + _User.ID.ToString());

        if (Result < 0)
        {
            Shove._Web.JavaScript.Alert(this.Page, "设置安全问题失败");

            return;
        }
        Response.Write("<script type='text/javascript'>alert('设置安全问题成功。请注意安全保护问题是最重要的安全凭证,为了您的安全,请牢牢记住您的安全保护问题。');</script>");
        ShowOrHiddenPanel(2);
    }
Esempio n. 23
0
    protected void EmptyQuestn_Click(object sender, EventArgs e)
    {
        long SiteID = Shove._Convert.StrToLong(tbSiteID.Text, -1);
        long UserID = Shove._Convert.StrToLong(tbUserID.Text, -1);

        if ((SiteID < 1) || (UserID < 1))
        {
            PF.GoError(ErrorNumber.Unknow, "参数错误", "Admin_UserDetail");

            return;
        }

        Users tu = new Users(SiteID)[SiteID, UserID];

        if (tu.ID < 1)
        {
            PF.GoError(ErrorNumber.Unknow, "用户不存在", "Admin_UserDetail");

            return;
        }

        DAL.Tables.T_Users user = new DAL.Tables.T_Users();

        user.SecurityQuestion.Value = "";
        user.SecurityAnswer.Value = "";

        long Result = user.Update("ID=" + UserID);

        if (Result < 0)
        {
            Shove._Web.JavaScript.Alert(this.Page, "清空安全问题失败");

            return;
        }
        Shove._Web.JavaScript.Alert(this.Page, "清空安全问题成功");
    }
Esempio n. 24
0
 private void BindData()
 {
     this.lbUserName.Text = "*".PadLeft(base._User.Name.Length - 1, '*') + base._User.Name.Substring(base._User.Name.Length - 1);
     if (base._User.RealityName != "")
     {
         this.tbRealityName.Visible = false;
         this.lbRealityName.Visible = true;
         this.lbRealityName.Text = "*".PadLeft(base._User.RealityName.Length - 1, '*') + base._User.RealityName.Substring(base._User.RealityName.Length - 1);
         this.lbIsRealityNameValided.Text = "已绑定";
     }
     else
     {
         this.tbRealityName.Visible = true;
         this.lbRealityName.Visible = false;
         this.tbRealityName.Text = "***";
         this.lbIsRealityNameValided.Text = "未绑定";
     }
     this.ddlCity.City_id = base._User.CityID;
     this.rbSexM.Checked = base._User.Sex == "男";
     this.rbSexW.Checked = base._User.Sex != "男";
     this.tbBirthday.Text = base._User.BirthDay.ToShortDateString();
     this.tbAddress.Text = base._User.Address;
     this.tbEmail.Text = base._User.Email;
     try
     {
         if (base._User.isMobileValided)
         {
             this.lbMobile.Text = base._User.Mobile.Substring(0, 3) + "*****" + base._User.Mobile.Substring(8, 3);
         }
     }
     catch
     {
     }
     DataTable table = new Tables.T_Users().Open("IsQQValided", "ID=" + base._User.ID.ToString(), "");
     if ((table != null) && (table.Rows.Count != 0))
     {
         bool flag = _Convert.StrToBool(table.Rows[0]["IsQQValided"].ToString(), false);
         if (flag)
         {
             this.lbQQ.Text = (base._User.QQ.Length > 3) ? (base._User.QQ.Substring(0, 3) + "********") : base._User.QQ;
         }
         this.lbIsEmailValided.Text = (base._User.isEmailValided ? "<font color='red'>已激活</font>" : "未激活") + "&nbsp;&nbsp;<a href='UserEmailBind.aspx'>申请激活或修改激活</a>";
         this.labIsMobileVailded.Text = (base._User.isMobileValided ? "<font color='red'>已绑定</font>" : "未绑定") + "&nbsp;&nbsp;<a href='UserMobileBind.aspx'>申请绑定或修改绑定</a>";
         this.lbQQValided.Text = (flag ? "<font color='red'>已绑定</font>" : "未绑定") + "&nbsp;&nbsp;<a href='UserQQBind.aspx'>申请绑定或修改绑定</a>";
         table = new Tables.T_Banks().Open("", "", "[Order]");
         if (base._User.SecurityQuestion.StartsWith("自定义问题|"))
         {
             this.lbQuestion.Text = base._User.SecurityQuestion.Remove(0, 6);
         }
         else
         {
             this.lbQuestion.Text = base._User.SecurityQuestion;
         }
         if (this.lbQuestion.Text == "")
         {
             this.lbQuestionInfo.Text = "设置安全保护问题";
         }
         else
         {
             this.lbQuestionInfo.Text = "修改安全保护问题";
         }
         try
         {
             if (base._User.IDCardNumber.Length == 15)
             {
                 this.lbIdCardNumber.Visible = true;
                 this.tbIdIDCardNumber.Visible = false;
                 this.lbIdCardNumber.Text = base._User.IDCardNumber.Substring(0, 6) + "*****" + base._User.IDCardNumber.Substring(10, 4);
                 this.lbIsIdCardNumberValided.Text = "已绑定";
             }
             else
             {
                 this.lbIdCardNumber.Visible = true;
                 this.tbIdIDCardNumber.Visible = false;
                 this.lbIdCardNumber.Text = base._User.IDCardNumber.Substring(0, 6) + "********" + base._User.IDCardNumber.Substring(14, 4);
                 this.lbIsIdCardNumberValided.Text = "已绑定";
             }
         }
         catch
         {
             this.lbIdCardNumber.Visible = false;
             this.tbIdIDCardNumber.Visible = true;
             this.lbIdCardNumber.Text = "";
             this.lbIsIdCardNumberValided.Text = "未绑定";
         }
         this.hdIDCardNumber.Value = this.lbIdCardNumber.Text;
     }
 }
Esempio n. 25
0
 /// <summary>
 /// 获得用户名
 /// </summary>
 /// <param name="_userId">用户ID</param>
 /// <returns>用户名</returns>
 protected string GetUserName(object _userId)
 {
     string userId = _userId.ToString();
     DataTable dt = new DAL.Tables.T_Users().Open("Name", "id = " + userId, "");
     return dt.Rows[0][0].ToString();
 }
Esempio n. 26
0
    protected void btnDownload_Click(object sender, EventArgs e)
    {
        DataTable dt = new DAL.Tables.T_Users().Open("", "", "[ID]");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);

            return;
        }

        string FileName = "T_Users.xls";

        HttpResponse response = Page.Response;

        response.AppendHeader("Content-Disposition", "attachment;filename=" + FileName);
        Response.ContentType = "application/ms-excel";
        response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");

        foreach (DataColumn dc in dt.Columns)
        {
            response.Write(dc.ColumnName + "\t");
        }

        response.Write("\n");

        foreach (DataRow dr in dt.Rows)
        {
            for (int i = 0; i < dt.Columns.Count; i++)
            {
                response.Write(dr[i].ToString() + "\t");
            }

            response.Write("\n");
        }

        response.End();
    }
Esempio n. 27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AjaxPro.Utility.RegisterTypeForAjax(typeof(Home_Room_Receive), this.Page);

        if (this.Request.QueryString.Count < 1)
        {
            Shove._Web.JavaScript.Alert(this.Page, "接口调用失败,请重新登录。", "../../Default.aspx");

            return;
        }

        string alipayNotifyURL = "http://notify.alipay.com/trade/notify_query.do?";
        string partner = so["MemberSharing_Alipay_UserNumber"].ToString("");  //卖家商户号

        alipayNotifyURL = alipayNotifyURL + "partner=" + partner + "&notify_id=" + Request.QueryString["notify_id"];

        //获取支付宝ATN返回结果,true是正确的订单信息,false 是无效的
        string responseTxt = Get_Http(alipayNotifyURL, 120000);

        if (responseTxt == "false")
        {
            Shove._Web.JavaScript.Alert(this.Page, "接口调用失败,请重新登录。", "../../Default.aspx");

            return;
        }

        bool isUseCheckCode = _Site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true);
        CheckCode.Visible = isUseCheckCode;

        new Login().SetCheckCode(_Site, ShoveCheckCode1);

        string key = so["MemberSharing_Alipay_MD5"].ToString(""); //partner 的对应交易安全校验码(必须填写)和alipay.cs文件中值是一样的
        string _input_charset = "utf-8";

        int i;
        String[] requestarr = Request.QueryString.AllKeys;

        //进行排序;
        string[] Sortedstr = Shove.Alipay.Alipay.BubbleSort(requestarr);

        //构造待md5摘要字符串 ;
        StringBuilder prestr = new StringBuilder();

        for (i = 0; i < Sortedstr.Length; i++)
        {
            if (String.IsNullOrEmpty(Sortedstr[i]))
            {
                continue;
            }

            if (Request.QueryString[Sortedstr[i]] != "" && Sortedstr[i] != "sign" && Sortedstr[i] != "sign_type" && Sortedstr[i].ToLower() != "pn")
            {
                if (i == Sortedstr.Length - 1)
                {
                    prestr.Append(Sortedstr[i] + "=" + Request.QueryString[Sortedstr[i]]);

                }
                else
                {
                    prestr.Append(Sortedstr[i] + "=" + Request.QueryString[Sortedstr[i]] + "&");
                }
            }
        }

        prestr.Append(key);

        //生成Md5摘要;
        string mysign = Shove.Alipay.Alipay.GetMD5(prestr.ToString(), _input_charset);

        string sign = (Request.QueryString["sign"] == null ? "" : Request.QueryString["sign"].ToString());
        string Success = (Request.QueryString["is_success"] == null ? "" : Request.QueryString["is_success"].ToString().ToUpper());
        string User_id = (Request.QueryString["user_id"] == null ? "" : Request.QueryString["user_id"].ToString());
        string RealName = (Request.QueryString["real_name"] == null ? "" : Request.QueryString["real_name"].ToString());
        string Email = (Request.QueryString["email"] == null ? "" : Request.QueryString["email"].ToString()); 

        //******************************************************************************
        if (mysign != sign)   //验证支付发过来的消息,签名是否正确(防止有伪造消息)
        {
            //WriteLog
            PF.GoError(ErrorNumber.Unknow, "您不是有效的支付宝会员不能登录本站,请您注册成为本站会员,再登录,谢谢!(-1001)", this.GetType().FullName);

            return;
        }

        if (Success != "T")
        {
            PF.GoError(ErrorNumber.Unknow, "您不是有效的支付宝会员不能登录本站,请您注册成为本站会员,再登录,谢谢!(-1002)", this.GetType().FullName);

            return;
        }

        labAccount.Text = Email;

        //处理数据

        if (String.IsNullOrEmpty(User_id))
        {
            PF.GoError(ErrorNumber.Unknow, "您不是有效的支付宝会员不能登录本站,请您注册成为本站会员,再登录,谢谢!(-1003)", this.GetType().FullName);

            return;
        }

        Sites site = new Sites()[Shove._Web.Utility.GetUrlWithoutHttp()];

        if (site == null)
        {
            PF.GoError(ErrorNumber.Unknow, "会员数据校验错误。", this.GetType().FullName);

            return;
        }

        if (_User != null && Shove._Web.Cache.GetCache("BindAlipay_" + _User.ID.ToString()) != null)
        {
            Shove._Web.Cache.ClearCache("BindAlipay_" + _User.ID.ToString());

            System.Threading.Thread.Sleep(500);

            Users tu = new Users(_Site.ID);
            _User.Clone(tu);

            _User.AlipayID = User_id;
            _User.isAlipayNameValided = true;
            _User.AlipayName = Email;

            string ReturnDescription = "";

            if (_User.EditByID(ref ReturnDescription) < 0)
            {
                tu.Clone(_User);
                Shove._Web.JavaScript.Alert(this.Page, ReturnDescription);

                return;
            }

            Shove._Web.JavaScript.Alert(this.Page, "支付宝绑定成功!", "BindAlipay.aspx");
        }

        DAL.Tables.T_Users t_users = new DAL.Tables.T_Users();
        DataTable dt = t_users.Open("[ID], [Name]", "SiteID = " + site.ID.ToString() + " and AlipayID = '" + User_id + "' and isAlipayNameValided = 1", "[ID]");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().FullName);

            return;
        }

        if (!IsPostBack)
        {
            tbRealityName.Text = RealName;
            hidUserID.Value = User_id;

            if (dt.Rows.Count < 1)
            {
                // 不存在,注册为新会员
                tbAlipayID.Text = User_id;
                Script = "btn_CheckUserName('" + tbName.Text + "')";
                btnSelect.Enabled = false;
                tableSelect.Visible = false;

                return;
            }
            else if (dt.Rows.Count == 1)
            {
                long UserID = Shove._Convert.StrToLong(dt.Rows[0]["ID"].ToString(), -1);

                if (UserID < 0)
                {
                    PF.GoError(ErrorNumber.Unknow, "会员数据校验错误。", this.GetType().FullName);

                    return;
                }

                Users user = new Users(site.ID)[site.ID, UserID];

                if (user == null)
                {
                    PF.GoError(ErrorNumber.Unknow, "会员数据校验错误。", this.GetType().FullName);

                    return;
                }

                string ReturnDescription = "";

                if (user.LoginDirect(ref ReturnDescription) < 0)
                {
                    PF.GoError(ErrorNumber.Unknow, ReturnDescription, this.GetType().FullName);

                    return;
                }

                Response.Redirect("../../Default.aspx", true);

                return;
            }

            // 绑定了多个用户
            tableRegister.Visible = false;
            btnOK.Enabled = false;
            tableSelect.Visible = true;
            btnSelect.Enabled = true;

            Shove.ControlExt.FillDropDownList(ddlName, dt, "Name", "ID");
            ddlName.SelectedIndex = 0;
        }
    }
Esempio n. 28
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        if (tbName.Text.Trim() == "")
        {
            Shove._Web.JavaScript.Alert(this.Page, "请输入用户名。");

            return;
        }

        if (string.IsNullOrEmpty(tbRealityName.Text.Trim()))
        {
            Shove._Web.JavaScript.Alert(this.Page, "请输入真实姓名。");

            return;
        }

        if (CheckCode.Visible)
        {
            if (tbCheckCode.Text.Trim() == "")
            {
                Shove._Web.JavaScript.Alert(this.Page, "请输入验证码!");

                return;
            }
            else
            {
                if (!ShoveCheckCode1.Valid(tbCheckCode.Text.Trim()))
                {
                    Shove._Web.JavaScript.Alert(this.Page, "验证码输入有误!");

                    return;
                }
            }

        }

        System.Threading.Thread.Sleep(500);

        Sites site = new Sites()[Shove._Web.Utility.GetUrlWithoutHttp()];

        if (site == null)
        {
            return;
        }

        long CpsID = -1;
        string URL = new FirstUrl().Get();
        if (!URL.StartsWith("http://"))
        {
            URL = "http://" + URL;
            URL = URL.Split('?'.ToString().ToCharArray())[0];
        }
        DataTable dt = new DAL.Tables.T_Cps().Open("id, [ON], [Name]", "SiteID = " + _Site.ID.ToString() + " and DomainName = '" + URL + "' or DomainName='" + Shove._Web.Utility.GetUrl() + "'", "");

        if ((dt != null) && (dt.Rows.Count > 0))
        {
            if (Shove._Convert.StrToBool(dt.Rows[0]["ON"].ToString(), false))
            {
                CpsID = Shove._Convert.StrToLong(dt.Rows[0]["ID"].ToString(), -1);
            }
        }

        string Password = GetRandPassword();

        Users user = new Users(site.ID);

        user.Name = tbName.Text.Trim();
        user.RealityName = tbRealityName.Text.Trim();
        user.Password = Password;
        user.PasswordAdv = Password;
        user.CityID = 1;
        user.Email = labAccount.Text.Trim();
        user.ComeFrom = 4;
        user.UserType = 2;
        user.CpsID = CpsID;
        user.CommenderID = -1;

        string ReturnDescription = "";

        if (user.Add(ref ReturnDescription) < 0)
        {
            Shove._Web.JavaScript.Alert(this.Page, ReturnDescription + "用户添加失败");

            return;
        }

        DAL.Tables.T_Users T_Users = new DAL.Tables.T_Users();
        T_Users.AlipayName.Value = labAccount.Text;
        T_Users.AlipayID.Value = hidUserID.Value;
        T_Users.isAlipayNameValided.Value = true;
        T_Users.Update("[ID] = " + user.ID.ToString());

        user.LoginDirect(ref ReturnDescription);

        this.Response.Redirect("UserRegSuccess.aspx", true);
    }
Esempio n. 29
0
    public int CheckUserNameAjax(string name)
    {
        if (!PF.CheckUserName(name))
        {
            return -1;
        }

        DataTable dt = new DAL.Tables.T_Users().Open("ID", "Name = '" + Shove._Web.Utility.FilteSqlInfusion(name) + "'", "");

        if (dt != null && dt.Rows.Count > 0)
        {
            return -2;
        }

        if (Shove._String.GetLength(name) < 5 || Shove._String.GetLength(name) > 16)
        {
            return -3;
        }

        return 0;
    }
 private void BindDataForUser()
 {
     DataTable table = new Tables.T_Users().Open("[ID], [Name]", "SiteID = " + base._Site.ID.ToString() + " and [ID] in (select distinct UserID from T_CompetencesOfUsers union all select distinct UserID from T_UserInGroups)", "[ID]");
     if (table == null)
     {
         PF.GoError(4, "数据库繁忙,请重试", "Admin_SchemeList");
     }
     else
     {
         this.ddlUser.Items.Add(new ListItem("全部操作员", "-1"));
         foreach (DataRow row in table.Rows)
         {
             this.ddlUser.Items.Add(new ListItem(row["Name"].ToString(), row["ID"].ToString()));
         }
         this.ddlUser.SelectedIndex = 0;
     }
 }