SetPopedom.aspx.cs
资源名称:yjal.rar [点击查看]
上传用户:shjujing
上传日期:2022-07-28
资源大小:11244k
文件大小:2k
源码类别:
Email客户端
开发平台:
Visual C++
- 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;
- using System.Data.SqlClient;
- public partial class Module_Admin_SysInfo_SetPopedom : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- SqlData da = new SqlData();
- SqlDataAdapter sqldata = new SqlDataAdapter();
- SqlCommand Com = new SqlCommand("select * from tb_User", da.ExceCon());
- SqlDataReader dr = Com.ExecuteReader();
- while (dr.Read())
- {
- this.dropName.Items.Add(dr["UserName"].ToString());
- }
- dr.Close();
- SqlCommand Com1 = new SqlCommand("select * from tb_User where Popedom='0'", da.ExceCon());
- SqlDataReader dr1 = Com1.ExecuteReader();
- while (dr1.Read())
- {
- this.lstboxName.Items.Add(dr1["UserName"].ToString());
- }
- dr1.Close();
- }
- }
- protected void btnOK_Click(object sender, EventArgs e)
- {
- string SqlStr = "Update tb_User set Popedom="+this.RadioButtonList1.SelectedIndex+" where UserName='"+this.dropName.SelectedValue+"'";
- SqlData da = new SqlData();
- bool update = da.ExceSQL(SqlStr);
- if (update)
- {
- Response.Write(CommonClass.MessageBox("操作成功!"));
- Response.Redirect("SetPopedom.aspx");
- }
- else
- {
- Response.Write(CommonClass.MessageBox("操作失败!"));
- }
- }
- protected void btnDelete_Click(object sender, EventArgs e)
- {
- string SqlStr = "update tb_User set Popedom='1' where UserName='"+this.lstboxName.SelectedValue+"'";
- SqlData da = new SqlData();
- bool update = da.ExceSQL(SqlStr);
- if (update)
- {
- Response.Write(CommonClass.MessageBox("操作成功!"));
- Response.Redirect("SetPopedom.aspx");
- }
- else
- {
- Response.Write(CommonClass.MessageBox("操作失败!"));
- }
- }
- }