protected void AttachItemDataBind() { if (!string.IsNullOrEmpty(Request.QueryString["ID"])) { int ID = 0; if (int.TryParse(Request.QueryString["ID"], out ID)) { LabMS.BLL.OpentProject OpenProject = new LabMS.BLL.OpentProject(); LabMS.Model.OpentProject openprojectmodel = new LabMS.Model.OpentProject(); LabMS.BLL.AttachmentItem AttachItem = new LabMS.BLL.AttachmentItem(); List<LabMS.Model.AttachmentItem> ls = new List<LabMS.Model.AttachmentItem>(); openprojectmodel = OpenProject.GetModel(ID); if (openprojectmodel != null) { if (openprojectmodel.Attachment != null) { int Attach_ID = openprojectmodel.Attachment.Value; if (Attach_ID != 0) { ls = AttachItem.GetModelList("Attach_ID=" + Attach_ID); if (ls.Count != 0) { string strHTML = "<table>"; for (int i = 0; i < ls.Count; i++) { strHTML += "<tr>"; strHTML += "<td style='display:none;'>"; strHTML += ls[i].ID; strHTML += "</td>"; strHTML += "<td>"; strHTML += "<a>"; strHTML += "删除"; strHTML += "</a>"; strHTML += "</td>"; strHTML += "<td>"; strHTML += ls[i].Item_Name; strHTML += "</td>"; strHTML += "</tr>"; } strHTML += "</table>"; itemlist.Value = strHTML; } } } } } } }
protected void Gv_File_DataBind() { if (!string.IsNullOrEmpty(Request.QueryString["ID"])) { if (IsNumber(Request.QueryString["ID"].Trim())) { int num=0; if (int.TryParse(Request.QueryString["ID"].Trim(), out num)) { LabMS.BLL.AttachmentItem AttachmentItem = new LabMS.BLL.AttachmentItem(); List<LabMS.Model.AttachmentItem> ls = new List<LabMS.Model.AttachmentItem>(); LabMS.Model.OpentProject openprojectmodel = new LabMS.Model.OpentProject(); LabMS.BLL.OpentProject OpenProject = new LabMS.BLL.OpentProject(); openprojectmodel= OpenProject.GetModel(num); if (openprojectmodel != null) { if (openprojectmodel.Attachment != null) { ls = AttachmentItem.GetModelList("Attach_ID=" + openprojectmodel.Attachment); } } Gv_File.DataSource = ls; Gv_File.DataBind(); } } } }