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 btnCheckImage_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.CheckPhoto(entity)) { WebTools.Alert(this, "图片审核通过!"); } else { WebTools.Alert(this, "图片审核失败!"); } } }
protected void btnImgUpdate_Click(object sender, EventArgs e) { string sfzmhm = this.txtSfzmhm.Text.Trim(); int size = this.FileUpload1.PostedFile.ContentLength; byte[] buffer = new byte[size]; this.FileUpload1.PostedFile.InputStream.Read(buffer, 0, size); bool isOk = StudentApplyInfoOperator.UpdatePhoto(sfzmhm, buffer); if (isOk) { this.imgPhoto.ImageUrl = "ApplyInfoPhoto.aspx?idcard=" + sfzmhm; } else { WebTools.Alert("图片上传失败"); } }
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(); }
protected void Page_Load(object sender, EventArgs e) { if (Request.Params["idcard"] != null) { //string str=ImageHelper.ImageToBase64Str("c:\\123.jpg"); string idcard = Request.Params["idcard"].ToString(); byte[] img = StudentApplyInfoOperator.GetPhoto(idcard); //HttpContext.Current.Response.ClearContent(); HttpContext.Current.Response.ClearContent(); HttpContext.Current.Response.ContentType = "image/jpeg"; if (img != null && img.Length > 0) { HttpContext.Current.Response.BinaryWrite(img); } else { HttpContext.Current.Response.WriteFile(Server.MapPath("~/images/no_photo.jpg")); } //image.Dispose(); } }
protected void DataGrid1_ItemCommand1(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Delete") { int id = Convert.ToInt32(e.CommandArgument); StudentApplyInfo record = StudentApplyInfoOperator.Get(id); if (record != null && record.Checked == 1) { WebTools.Alert(this, "已审核过的数据无法删除!"); } else { StudentApplyInfoOperator.Delete(id); WebTools.Alert(this, "删除成功!"); this.ProcedurePager1.Changed = true; } } else if (e.CommandName == "Detail") { int id = Convert.ToInt32(e.CommandArgument); this.Pop(id); } }