//仅处理数据行 if (row.RowType == DataControlRowType.DataRow) {
CheckBox chkItem =
(CheckBox)row.Cells[0].FindControl(\ if (chkItem != null && chkItem.Checked) {
//找到当前行的snum,并存入lstSelect中
lstSelect.Add(row.Cells[1].Text); } } }
if (lstSelect.Count <= 0) {
CommonFuncs.ShowMsg(this.Page, \请选择要删除的行!\ return; }
bool err = false; string photoPath = Server.MapPath(\ string photoFile = \
foreach (string id in lstSelect) {
if (BLL_Student.Delete(id)) {
// photoFile = photoPath + \\
File.Delete(photoFile);
photoFile = photoPath + \\
File.Delete(photoFile); } else
err = true; } if (err) {
删除可能有的照片
CommonFuncs.ShowMsg(this.Page, \操作失败!\\\\n\\\\n详细原因请管理员查看日志。\ } else {
CommonFuncs.ShowMsg(this.Page, \操作成功!\ }
GetDataSet(); //重新读取数据 BindStudents(); //重新绑定数据 }
登录用户密码修改:
代码如下:
public partial class admin_classDean_Student_Modify : System.Web.UI.Page {
protected Entity_Student insStu;
protected void Page_Load(object sender, EventArgs e) {
if (!IsPostBack) {
Entity_Classes insClass =
Session[\ //检查权限:只有班级管理员具有此权限 if (insClass == null) {
CommonFuncs.ShowMsgAndJump(this.Page, \请登录!\\ return; }
if (Request[\ {
CommonFuncs.ShowMsg(this.Page, \参数错误,请返刷新页面后回重新操作!\ return;
}
string snum = Request[\ insStu = BLL_Student.SelectOne(snum); if (insStu == null) {
CommonFuncs.ShowMsg(this.Page, \没有找到学生,请返刷新页面后回重新操作!\ return; }
lblMajorName.Text = insClass.majorName; lblClassName.Text = insClass.className;
lblSnum.Text =insStu.snum; txtPWD.Text =\
txtName.Text =insStu.name;
rblGender.SelectedIndex=(insStu.gender?0:1); txtBirthday.Text = insStu.birthday.ToShortDateString(); txtIDCard.Text =insStu.idCard; txtEnrolDate.Text=