📄 commentchuanyue.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 Common_commentChuanyue : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bind();
}
}
public void bind()
{
FileManage myFile = new FileManage();
DataSet ds1 = new DataSet();
ds1 = myFile.GetAllDepart();
DropDownList1.DataSource = ds1;
DropDownList1.DataValueField = "DepartName";
DropDownList1.DataBind();
DropDownList1.Items[0].Selected = true;
DataSet ds2 = new DataSet();
ds2 = myFile.GetAllShenheFile();
GridView1.DataSource = ds2;
GridView1.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
FileManage myFile = new FileManage();
int userID = int.Parse(Session["Userid"].ToString());
int departId = myFile.GetDepartID(DropDownList1.SelectedItem.Text);
for (int i = 0; i < GridView1.Rows.Count; i++)
{
CheckBox cbox = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1");
if (cbox.Checked == true)
{
int fileID = int.Parse(GridView1.DataKeys[i].Value.ToString());
myFile.AddHouQinChuanye(userID, departId, fileID, 0);
}
}
lbmessage.Text = "申请成功!";
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
this.GridView1.PageIndex = e.NewPageIndex;
this.GridView1.DataBind();
}
protected void cbAll_CheckedChanged(object sender, EventArgs e)
{
for (int i = 0; i < GridView1.Rows.Count; i++)
{
CheckBox cbox = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1");
if (cbAll.Checked)
{
cbox.Checked = true;
}
else
{
cbox.Checked = false;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -