protected void BindAvailableDocuments() { BPDocuments bpu = new BPDocuments(); DSDocuments = new BEDocuments(); if (FilterID != -1) { DSDocuments.Merge(bpu.SelectAllByDocumentCategoryID(FilterID)); } else { DSDocuments.Merge(bpu.SelectAllWithDocumentCategories()); } int DocumentCategoryID = -1; Boolean blnNew = true; StringBuilder returnDocuments = new StringBuilder(10000); returnDocuments.Append("none,No Document|"); foreach(DataRow dr in DSDocuments.tbl_Documents.Rows) { if ((int) dr["DocumentCategoryID"] != DocumentCategoryID) { DocumentCategoryID = (int) dr["DocumentCategoryID"]; blnNew = true; } if (blnNew) { returnDocuments.Append(",-- " + dr["DocumentCategoryName"] + " --|"); blnNew = false; } returnDocuments.Append(dr["DocumentID"].ToString() + "," + HttpUtility.HtmlDecode(" ") + dr["DocumentAlias"].ToString() + "|"); } lblScript.Text = "<script Language=\"Javascript\">window.parent.handleResponse('" + returnDocuments + "', 'Document')</script>"; }
private void BindAttachments() { if(CompanyID > 0 && InventoryID > 0) { BPDocuments bp = new BPDocuments(); BEDocuments ds = bp.SelectActiveAttachmentsByCompanyIDAndInventoryID(CompanyID, InventoryID); totalItems = ds.tbl_Documents.Count; if(totalItems > 0) { ds.tbl_Documents.DefaultView.Sort = "DocumentAlias"; rptAttachments.DataSource = ds.tbl_Documents.DefaultView; rptAttachments.DataBind(); btnShowInspectionReports.Visible = true; } } }