//按AchievementApplyID进行删除 protected void btnDelete_Click(object sender, EventArgs e) { try { List <int> selections = pm.GridCount(Grid_Achievementt, CBoxSelect); if (Convert.ToInt32(Session["SecrecyLevel"]) == 5) { for (int i = 0; i < selections.Count(); i++) { achieve.Delete(Convert.ToInt32(Grid_Achievementt.DataKeys[selections[i]][0])); } InitData(); btnSelect_All.Text = "全选"; Alert.ShowInTop("删除数据成功!"); } else { for (int i = 0; i < selections.Count(); i++) { achieve.UpdateIsPass(Convert.ToInt32(Grid_Achievementt.DataKeys[selections[i]][0]), false); //向操作日志表中插入 OperationLog operate = new OperationLog(); operate.LoginName = user.FindByLoginName(Session["LoginName"].ToString()).UserName; operate.LoginIP = ""; operate.OperationType = "删除"; operate.OperationContent = "ProjectImportantNode"; operate.OperationDataID = Convert.ToInt32(Grid_Achievementt.DataKeys[selections[i]][0]); operate.OperationTime = System.DateTime.Now; operate.Remark = ""; bllOperate.Insert(operate); } btnSelect_All.Text = "全选"; Alert.ShowInTop("您的操作已提交,请等待审核!"); InitData(); } } catch (Exception ex) { pm.SaveError(ex, this.Request); } }