Web/Admin/empAdmin/empInfo.aspx.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
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.IO;
using System.Text;
public partial class Admin_empAdmin_empInfo :basePage
{
GetPowerPage power = new GetPowerPage();
Bll.empBll pow = new Bll.empBll();
Model.tab_emps tem = new Model.tab_emps();
Model.tab_roles roles = new Model.tab_roles();
Bll.RolesBll ro = new Bll.RolesBll();
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
//this.CheckUser();
this.DropDownList1.DataSource = ro.GetAll();
this.DropDownList1.DataTextField = "roleName";
this.DropDownList1.DataValueField = "roleID";
this.DropDownList1.DataBind();
this.DropDownList1.Items.Insert(0, new ListItem("------", "0"));
}
}
protected void Button1_Click(object sender, EventArgs e)
{
StringBuilder strsel = new StringBuilder();
strsel.Append("SELECT tab_roles.roleName, tab_emps.empID, tab_emps.empName FROM tab_emps INNER JOIN tab_roles ON tab_emps.roleID = tab_roles.roleID ");
strsel.AppendFormat(" and empName like '{0}'+'%' ", this.TextBox1.Text);
if (this.DropDownList1.SelectedIndex > 0)
strsel.AppendFormat(" and tab_roles.roleID={0}", this.DropDownList1.SelectedValue);
this.empDataSource.SelectCommand = strsel.ToString();
this.empDataSource.DataBind();
}
protected void Button4_Click(object sender, EventArgs e)
{
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=MyExcelFile.xls");
Response.ContentType = "application/excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
GridView gv = new GridView();
gv.DataSource = this.empDataSource;
gv.DataBind();
gv.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
后面还有 25 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
