⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 requestinformationresult.aspx.cs

📁 最好用的站点内容管理系统 全部源代码都有
💻 CS
字号:
//======================================================
//==     (c)2008 aspxcms inc by NeTCMS v1.0              ==
//==          Forum:bbs.aspxcms.com                   ==
//==         Website:www.aspxcms.com                  ==
//======================================================
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class user_RequestinformationResult : NetCMS.Web.UI.UserPage
{
    NetCMS.Content.Friend fir = new NetCMS.Content.Friend();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            
            Response.Expires = 0;
            Response.CacheControl = "no-cache";
        }
        DataTable Q_dfriend = fir.sel_friendInfo(NetCMS.Global.Current.UserNum,0);
        this.infomationDownList.DataTextField = "FriendName";
        this.infomationDownList.DataValueField = "HailFellow";
        this.infomationDownList.DataSource = Q_dfriend;
        this.infomationDownList.DataBind();
    }

    /// <summary>
    /// 提交动作
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Button1_Click(object sender, EventArgs e)
    {
        string _ID = Request.QueryString["id"];
        if (_ID != null && _ID != string.Empty)
        {
            if (this.isCheck.Checked)
            {
                fir.del_userInfo(NetCMS.Global.Current.UserName, int.Parse(_ID.ToString()));
                Response.Write("<script>alert('拒绝用户添加您为好友成功。');window.opener.location.reload();window.close();</script>");
            }
            else
            {
                string u_menume = NetCMS.Global.Current.UserName;
                string qUsername = fir.sel_userInfo(u_menume,1);
                string qUserNum = fir.sel_friendInfo(qUsername,1).Rows[0]["UserNum"].ToString();
                string u_meNume = NetCMS.Global.Current.UserName;
                string bUserName = fir.sel_userInfo(u_meNume,1);
                string bdUserName = fir.sel_friendInfo(bUserName,1).Rows[0]["UserNum"].ToString();
                string Hail_Fellow = this.infomationDownList.SelectedValue;
                string FriendUserNum = NetCMS.Common.Rand.Number(12);
                DateTime CreatTime = DateTime.Now;
                int se = this.infomationDownList.SelectedIndex;
                if (se == 0)
                {
                    fir.add_userFriend(FriendUserNum, NetCMS.Global.Current.UserNum, bUserName, bdUserName, Hail_Fellow, CreatTime);
                    fir.update_Information(u_meNume, qUsername,0);
                    fir.update_Information(NetCMS.Global.Current.UserNum, qUserNum,1);
                }
                else
                {
                    fir.del_userInfo(NetCMS.Global.Current.UserName, int.Parse(_ID.ToString()));
                }
                Response.Write("<script>alert('同意用户成为好友操作成功。');window.opener.location.reload();window.close();</script>");
            }
        }
        else
        {
            Response.Write("<script>alert('错误的参数。');window.opener.location.reload();window.close();</script>");
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -