/// <summary> /// Create the XML to be transformed with XSL and sets the "xmlListDocument" Global variable value /// </summary> /// <param name="dtListDetails">DataTable consists of records to be displayed</param> protected void GetListXml(DataTable dtListDetails) { string strCamlQuery = string.Empty; string strTerminated = string.Empty; try { if (dtListDetails != null && dtListDetails.Rows.Count > 0) { //if (!string.IsNullOrEmpty(strSiteURL) && !string.IsNullOrEmpty(AuditListName)) //{ // dtHistoryDetails = objCommonBLL.ReadList(strSiteURL, AuditListName, // "<OrderBy><FieldRef Name='Created' Ascending='False' /></OrderBy>"); //} /// Sets the properties of Records object SetRecordsDataObject(dtListDetails); objListViewer = new ListViewerXMLGeneratorBLL(); xmlListDocument = objListViewer.CreateListViewerXML(objRecords); } } catch { throw; } }
/// <summary> /// Gets the list XML. /// </summary> /// <returns></returns> protected DataTable GetListXml() { string strCamlQuery = string.Empty; string strTerminated = string.Empty; DataTable dtListDetails = null; StringBuilder strRecordID = new StringBuilder(); try { if (!ActiveStatus) strTerminated = STATUS_TERMINATED; else strTerminated = STATUS_ACTIVE; strCamlQuery = @"<Where><Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>" + strTerminated + "</Value></Eq></Where>"; strCamlQuery = GetsCAMLQuery(); objCommonBLL = new CommonBLL(); strSiteURL = SPContext.Current.Site.Url.ToString(); if (!string.IsNullOrEmpty(strCamlQuery)) { dtListDetails = objCommonBLL.ReadList(strSiteURL, ListName.ToString(), strCamlQuery); } if (dtListDetails != null && dtListDetails.Rows.Count > 0) { //dtHistoryDetails = objCommonBLL.ReadList(strSiteURL, AuditListName, // "<OrderBy><FieldRef Name='Created' Ascending='False' /></OrderBy>"); SetRecordsDataObject(dtListDetails); objListViewer = new ListViewerXMLGeneratorBLL(); xmlListDocument = objListViewer.CreateListViewerXML(objRecords); } } catch { throw; } finally { if (dtListDetails != null) { dtListDetails.Dispose(); } } return dtListDetails; }