?? updatemember.aspx.cs
字號(hào):
?using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model.Members;
namespace 金利來分銷管理系統(tǒng).Members
{
public partial class UpdateMember : System.Web.UI.Page
{
BLL.Employee.EmployeeBll employeebllshow;
public UpdateMember()
{
employeebllshow = new BLL.Employee.EmployeeBll();
}
protected void Page_Load(object sender, EventArgs e)
{//接收查詢頁面gridview里的數(shù)據(jù)
if (!this.IsPostBack)
{
//用戶權(quán)限
if (Session["employee_id"] == null)
{
Response.Write("<script>alert('請(qǐng)您登陸系統(tǒng)');location.href='../Enter.aspx'</script>");
}
else
{
if (employeebllshow.UserRole(Session["role_id"].ToString(), "36") == true)
{
string id = Session["Member_ID"].ToString();
txtlblupdate.Text = id;
if (id.Substring(0,2)=="KH")
{
txtnamehou.Text = Session["Member_name"].ToString();
txtupdatemobilehou.Text = Session["HYMember_Mobile"].ToString();
txttext.Text = Session["HYMember_Text"].ToString();
txtlblupdate.Enabled = false;
lblleveld.Visible = false;
txtleveld.Visible = false;
lblleveldhou.Visible = false;
ddlleveldhou.Visible = false;
lblname.Visible = false;
txtupdatename.Visible = false;
revname.Visible = false;
lblupdatesex.Visible = false;
txtupdatesex.Visible = false;
lblupdatesexhou.Visible = false;
ddlupdatesexhou.Visible = false;
lblupdatemobile.Visible = false;
txtupdatemobile.Visible = false;
revDianHua.Visible = false;
lblupdatebirthday.Visible = false;
txtupdatebirthday.Visible = false;
revshengri.Visible = false;
btnupdate.Visible = false;
lblupdatemobil.Visible = false;
lblupdatebirthda.Visible = false;
}
else
{
txtleveld.Text = Session["Member_level_id"].ToString();
txtupdatename.Text = Session["Member_name"].ToString();
txtupdatesex.Text = Session["HYMember_Sex"].ToString();
txtupdatemobile.Text = Session["HYMember_Mobile"].ToString();
txtupdatebirthday.Text = Session["HYMember_Birthday"].ToString();
txttext.Text = Session["HYMember_Text"].ToString();
lblleveld.Visible = true;
txtleveld.Visible = true;
lblleveldhou.Visible = true;
ddlleveldhou.Visible = true;
lblname.Visible = true;
txtupdatename.Visible = true;
revname.Visible = true;
lblupdatesex.Visible = true;
txtupdatesex.Visible = true;
lblupdatesexhou.Visible = true;
ddlupdatesexhou.Visible = true;
lblupdatemobile.Visible = true;
txtupdatemobile.Visible = true;
revDianHua.Visible = true;
lblupdatebirthday.Visible = true;
txtupdatebirthday.Visible = true;
revshengri.Visible = true;
txtleveld.Enabled = false;
txtupdatesex.Enabled = false;
txtlblupdate.Enabled = false;
lblnamehou.Visible = false;
txtnamehou.Visible = false;
revnamehou.Visible = false;
lblupdatemobilehou.Visible = false;
txtupdatemobilehou.Visible = false;
revDianHuahou.Visible = false;
btnupda.Visible = false;
lblupdatemobileho.Visible = false;
}
}
else
{
Response.Write("<script>alert('你無權(quán)查看此功能,請(qǐng)與管理員聯(lián)系');location.href='../Aboutus.aspx'</script>");
}
}
}
}
//修改會(huì)員信息
protected void btnupdate_Click(object sender, EventArgs e)
{
if (ddlleveldhou.Text == "請(qǐng)選擇")
{
Response.Write("<script>alert('會(huì)員等級(jí)不能為空.請(qǐng)重新選擇!')</script>");
}
else if (txtupdatename.Text.Length == 0 )
{
Response.Write("<script>alert('會(huì)員姓名不能為空.請(qǐng)重新填寫!')</script>");
}
else if ( ddlupdatesexhou.Text == "請(qǐng)選擇" )
{
Response.Write("<script>alert('會(huì)員性別不能為空.請(qǐng)重新選擇!')</script>");
}
else if ( txtupdatemobile.Text.Length == 0 )
{
Response.Write("<script>alert('會(huì)員手機(jī)號(hào)碼不能為空.請(qǐng)重新填寫!')</script>");
}
else
{
BLL.Members.MemberBll bll = new BLL.Members.MemberBll();
Memberb Menberupdate = new Memberb();
Menberupdate.Member_ID = txtlblupdate.Text;
Menberupdate.Member_level_ID = int.Parse(ddlleveldhou.Text);
Menberupdate.Member_name = txtupdatename.Text;
Menberupdate.Member_Sex = ddlupdatesexhou.Text;
Menberupdate.HYMember_Mobile = txtupdatemobile.Text;
Menberupdate.HYMember_Birthday = txtupdatebirthday.Text;
Menberupdate.HYMember_Text = txttext.Text;
bll.update(Menberupdate);
Response.Write("<script>alert('會(huì)員信息修改成功!')</script>");
}
}
//返回查詢頁面
protected void btnclose_Click(object sender, EventArgs e)
{
Response.Redirect("SelectMembers.aspx");
}
//客戶信息修改
protected void btnupda_Click(object sender, EventArgs e)
{
if (txtnamehou.Text.Length == 0)
{
Response.Write("<script>alert('客戶姓名不能為空.請(qǐng)重新填寫!')</script>");
}
else if (txtupdatemobilehou.Text.Length==0)
{
Response.Write("<script>alert('客戶聯(lián)系電話不能為空.請(qǐng)重新填寫!')</script>");
}
else
{
BLL.Members.MemberBll bll = new BLL.Members.MemberBll();
Memberb Menberupdate = new Memberb();
Menberupdate.Member_ID = txtlblupdate.Text;
Menberupdate.Member_name = txtnamehou.Text;
Menberupdate.HYMember_Mobile = txtupdatemobilehou.Text;
Menberupdate.HYMember_Text = txttext.Text;
bll.KHupdate(Menberupdate);
Response.Write("<script>alert('客戶信息修改成功!')</script>");
}
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -