//删除 protected void Delete_Click(object sender, EventArgs e) { try { int id = Convert.ToInt32(Request.QueryString["id"].ToString()); int attachId = un.FindAttachmentID(id); string srcPath = at.FindPath(attachId); if (attachId == 0 || srcPath == "") { Alert.Show("该考察信息不存在相关文档"); } else { pm.DeleteFile(attachId, srcPath); Common.Entities.UnitInspect uni = un.FindInspectInfo(id, true); uni.AccessoryID = null; un.Update(uni); //Alert.Show("删除成功!"); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideReference() + Alert.GetShowInTopReference("删除成功!")); } } catch (Exception ex) { pm.SaveError(ex, this.Request); } }
//初始化 public void InitData() { try { int id = Convert.ToInt32(Request.QueryString["id"].ToString()); Common.Entities.UnitInspect uni = un.FindInspectInfo(id, true); name.Text = uni.InspectName; unit.Text = uni.WorkPlace; agency.Text = agen.FindAgenName(uni.AgencyID); } catch (Exception ex) { pm.SaveError(ex, this.Request); } }