protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e) { //allowcheck int id = Convert.ToInt32(e.CommandArgument); StudentApplyInfoChecked infoCheck = SimpleOrmOperator.Query<StudentApplyInfoChecked>(id); if (e.CommandName == "Delete") { if (infoCheck != null && infoCheck.Checked == 1) { WebTools.Alert(this, "已审核过的数据无法删除!"); } else { SimpleOrmOperator.Delete(infoCheck); WebTools.Alert(this, "删除成功!"); this.ProcedurePager1.Changed = true; } } else if (e.CommandName == "Detail") { //int id = Convert.ToInt32(e.CommandArgument); //this.Pop(id); StudentApplyInfo sai = SimpleOrmOperator.Query<StudentApplyInfo>(id); if (sai == null) return ; if (StudentApplyInfoOperator.CheckInfo(sai, this.Operator.OperatorName)) { WebTools.Alert(string.Format("{0}:{1} 审核成功", sai.Xm, sai.Sfzmhm)); } else { WebTools.Alert(string.Format("{0}:{1} 审核失败", sai.Xm, sai.Sfzmhm)); } } }
protected void btnCheck_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.Params["id"])) { StudentApplyInfo entity = SimpleOrmOperator.Query <StudentApplyInfo>(Convert.ToInt32(Request.Params["id"])); entity.CheckDate = DateTime.Now.ToString("yyyy-MM-dd"); entity.CheckOperator = this.Operator.OperatorName; if (StudentApplyInfoOperator.CheckInfo(entity, this.Operator.OperatorName)) { WebTools.Alert(this, "资料审核通过!"); } else { WebTools.Alert(this, "资料审核失败!"); } } }
protected void btnCheck_Click(object sender, EventArgs e) { IList<int> ids = new List<int>(); int checkNum = 0; int reNum = 0; foreach (DataGridItem item in DataGrid1.Items) { CheckBox cb = (CheckBox)item.FindControl("CheckBox1"); if (cb.Checked) { try{ ids.Add(Convert.ToInt32( item.Cells[1].Text)); checkNum++; }catch(Exception){} } } if (checkNum == 0) { WebTools.Alert("没有记录被选中"); return; } foreach (int id in ids) { StudentApplyInfo sai = SimpleOrmOperator.Query<StudentApplyInfo>(id); if (sai == null) continue; if (StudentApplyInfoOperator.CheckInfo(sai, this.Operator.OperatorName)) { reNum++; } } WebTools.Alert(string.Format("审核结果:选中{0}条记录,{1}条成功通过审核", checkNum, reNum)); this.ProcedurePager1.Changed = true; //txtQueryValue.Text = ""; //txtQueryValue.Focus(); }