/// <summary> /// 修改用户类型 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Alter_Click(object sender, EventArgs e) { //int temp = 0; UA UAadmin = new UA(); UAController ChangeType = new UAController(); if (Session["UA_UserName"] != null) { UAadmin.UserName = Session["UA_UserName"].ToString(); if (Yes.Checked == true) { UAadmin.StaffType = '1'; } else { UAadmin.StaffType = '0'; } if (ChangeType.UpdateUserInfo(UAadmin) == true) { this.lblCheck.Text = "用户信息修改成功!"; //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "用户信息修改成功!" + "');</script> "); } else { this.lblCheck.Text = "信息修改失败!"; //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "信息修改失败!" + "');</script> "); } } }
protected void UserList_DeleteCommand(object source, DataListCommandEventArgs e) { UA mUA = new UA(); UAController mUACon = new UAController(); mUA.UserName = UserList.DataKeys[e.Item.ItemIndex].ToString(); if (mUACon.DeleteUser(mUA)) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "成功删除!" + "');</script> "); } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "删除失败!" + "');</script>"); } }
/// <summary> /// 查看用户信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Enter_Click(object sender, EventArgs e) { if (tbxUserName.Text != null) { Session["UA_UserName"] = tbxUserName.Text;//获取查询界面输入框的用户名 UA UAadmin = new UA(); UAController Badmin = new UAController(); UAadmin.UserName = tbxUserName.Text; if (Badmin.IsUserAlive(UAadmin) == true) { this.Response.Redirect("UA_UserInfo.aspx"); } else { // this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "该用户不存在!" + "');</script> "); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { UA UAadmin = new UA(); UAController GetInfo = new UAController(); if (Session["hUserName"] != null) { UAadmin.UserName = Session["hUserName"].ToString(); string[] temp = GetInfo.UAGetInfo(UAadmin); txtStaffID.Text = temp[0]; txtStaffName.Text = temp[1]; txtPassword.Text = temp[2]; switch (Convert.ToInt32(temp[6])) { case 1: txtAdministratorClass.Text = "高级管理员"; break; case 2: txtAdministratorClass.Text = "订单管理员"; break; case 3: txtAdministratorClass.Text = "评价管理员"; break; case 4: txtAdministratorClass.Text = "用户管理员"; break; case 5: txtAdministratorClass.Text = "商品管理员"; break; } txtName.Text = temp[1]; txtIDcardNO.Text = temp[11]; txtRegister.Text = temp[7]; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { UA UAadmin = new UA(); UAController GetUserInfo = new UAController(); UAController GetAddress = new UAController(); if (Session["UA_UserName"] != null) { UAadmin.UserName = Session["UA_UserName"].ToString(); string[] ltemp = GetUserInfo.UserGetInfo(UAadmin); // string[] tempAddress = GetAddress.UserAddress(UAadmin); tbxUserName.Text = ltemp[0]; tbxUserID.Text = ltemp[2]; switch (ltemp[3]) { case "0": No.Checked = true; break; case "1": Yes.Checked = true; break; } tbxTrueName.Text = ltemp[4]; tbxCreditCard.Text = ltemp[5]; tbxAge.Text = ltemp[6]; switch (ltemp[7]) { case "0": tbxSex.Text = "男"; break; case "1": tbxSex.Text = "女"; break; } tbxPhone.Text = ltemp[9]; tbxRegisterTime.Text = ltemp[10]; tbxQQ.Text = ltemp[11]; tbxTotalConsum.Text = ltemp[12]; //this.gvAddress.DataSource = GetAddress.UserAddress(UAadmin); //this.gvAddress.DataMember = "table1"; // this.gvAddress.DataSource = GetAddress.GetAddressList(UAadmin); //判断初始化时用户的类型 if (Yes.Checked) { RadioJudge = 1; } else { RadioJudge = 2; } if (tbxTotalConsum.Text == "" || tbxTotalConsum.Text == null) { Yes.Enabled = false; No.Enabled = false; } else { if (Convert.ToDouble(tbxTotalConsum.Text) > 10000.00) { Yes.Checked = true; } else { No.Checked = true; } Yes.Enabled = false; No.Enabled = false; } } } }
/// <summary> /// 修改用户管理员信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAlter_Click(object sender, EventArgs e) { UAController GetInfo = new UAController(); UA UAadmin = new UA(); UAController UpdateInfo = new UAController(); if (Session["hUserName"] != null) { UAadmin.UserName = Session["hUserName"].ToString(); UAadmin.TrueName = txtName.Text; //switch (txtAdministratorClass.Text) //{ // case "高级管理员": // UAadmin.StaffType = '1'; // break; // case "订单管理员": // UAadmin.StaffType = '2'; // break; // case "评价管理员": // UAadmin.StaffType = '3'; // break; // case "用户管理员": // UAadmin.StaffType = '4'; // break; // case "商品管理员": // UAadmin.StaffType = '5'; // break; //} UAadmin.IdCardNum = txtIDcardNO.Text; UAadmin.PassWord = txtPassword.Text; if (UpdateInfo.UAUpdateInfo(UAadmin) == true) { txtName.Text = GetInfo.UAGetInfo(UAadmin)[1]; //switch (Convert.ToInt32(GetInfo.UAGetInfo(UAadmin)[6])) //{ // case 1: // txtAdministratorClass.Text = "高级管理员"; // break; // case 2: // txtAdministratorClass.Text = "订单管理员"; // break; // case 3: // txtAdministratorClass.Text = "评价管理员"; // break; // case 4: // txtAdministratorClass.Text = "用户管理员"; // break; // case 5: // txtAdministratorClass.Text = "商品管理员"; // break; //} txtIDcardNO.Text = GetInfo.UAGetInfo(UAadmin)[11]; txtPassword.Text = GetInfo.UAGetInfo(UAadmin)[2]; this.lblCheck.Text = "信息修改成功!"; //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ggg", "<script language='javascript'>alert('" + "信息修改成功" + "');</script>"); } else { this.lblCheck.Text = "信息修改失败!请重新操作!"; //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ggg", "<script language='javascript'>alert('" + "信息修改失败" + "');</script>"); } } }