📄 addmyfriend.aspx.cs
字号:
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 AddMyFriend : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
btnmanagetype.Attributes.Add("onclick", "return confirm('页面需要跳转,确定已保存了添加的联系信息!')");
if (!IsPostBack)
{
bandtype();
}
}
private void bandtype()
{
friend f=new friend();
this.droptype.DataSource = f.Select_FriendType(Convert.ToInt32(Session["uname"]));
this.droptype.DataTextField = "t_name";
this.droptype.DataValueField = "t_id";
this.droptype.DataBind();
}
protected void btnlikeout_Click(object sender, EventArgs e)
{
string type = Convert.ToString(tabtype.Visible);
if (type == "False")
{
this.ttype.Text = "";
tabtype.Visible = true;
}
else
{
tabtype.Visible = false;
}
}
protected void btnimage_Click(object sender, ImageClickEventArgs e)
{
tabtype.Visible = false;
}
protected void btnmanagetype_Click(object sender, EventArgs e)
{
Server.Transfer("Edit_FriendType.aspx");
}
protected void btnaddtype_Click(object sender, EventArgs e)
{
if (ttype.Text.Trim().ToString() != "")
{
string typename = ttype.Text.Trim().ToString();
friend f = new friend();
f.AddFriendType(Convert.ToInt32(Session["uname"]), typename);
bandtype();
tabtype.Visible = false;
Response.Write("<script>alert('添加成功!')</script>");
}
else
{
Response.Write("<script>alert('分类名称不能为空!')</script>");
}
}
protected void btn_add_Click(object sender, EventArgs e)
{
ArrayList arrfriend = new ArrayList();
arrfriend.Add(Convert.ToInt32(Session["uname"]));
arrfriend.Add(droptype.SelectedItem.Text.Trim().ToString());
arrfriend.Add(this.droptype.SelectedValue.ToString());
arrfriend.Add(this.tname.Text.Trim().ToString());
arrfriend.Add(this.tmobile.Text.Trim().ToString());
arrfriend.Add(this.tcomplayphone.Text.Trim().ToString());
arrfriend.Add(this.thomephone.Text.Trim().ToString());
arrfriend.Add(this.tmail.Text.Trim().ToString());
arrfriend.Add(this.thomeaddress.Text.Trim().ToString());
arrfriend.Add(this.tcomplayaddress.Text.Trim().ToString());
arrfriend.Add(this.tnumber.Text.Trim().ToString());
arrfriend.Add(this.tmessage.Text.Trim().ToString());
friend f = new friend();
f.Addfriend(arrfriend);
Response.Write("<script>alert('添加成功!')</script>");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -