/// <summary> /// This method Saves or Upadates the values into BatchImportXML /// </summary> private void SaveOrUpdateBatchImportXML() { objBatchImport = new Shell.SharePoint.DWB.Business.DataObjects.BatchImport(); objBatchImport.BookID = strBookID; objBatchImport.DefaultSharedPath = strSharedAreaPath; objBatchImport.UserName = GetUserName(); string strRowFilter; arlPageName = new ArrayList(); foreach (GridViewRow gdvRow in grdBatchImportConfiguration.Rows) { objPageName = new PageName(); objPageName.Name = HttpUtility.HtmlDecode(gdvRow.Cells[0].Text); DataTable dtResult = objWellBookBLL.GetTypeIIIPagesForBook(strParentSiteURL, strBookID, "No"); DataView dvResultTable; dvResultTable = dtResult.DefaultView; strRowFilter = "Page_Name = '" + objPageName.Name + "'"; dvResultTable.RowFilter = strRowFilter; dtResult = dvResultTable.ToTable(); objPageName.PageCount = dtResult.Rows.Count.ToString(); TextBox txtSharedAreaPath = (TextBox)gdvRow.FindControl("txtSharedAreaPath"); objSharedPath = new SharedPath(); objSharedPath.Path = txtSharedAreaPath.Text; objPageName.SharedPath = objSharedPath; DropDownList cboFileType = (DropDownList)gdvRow.FindControl("cboFileType"); objFileType = new FileType(); objFileType.Type = cboFileType.SelectedItem.Text; objPageName.FileType = objFileType; DropDownList cboNamingConvention = (DropDownList)gdvRow.FindControl("cboNamingConvention"); objFileFormat = new FileFormat(); objFileFormat.Format = cboNamingConvention.SelectedItem.Text; objFileFormat.ActualFormat = cboNamingConvention.SelectedItem.Value; objPageName.FileFormat = objFileFormat; arlPageName.Add(objPageName); } objBatchImport.PageName = arlPageName; objBatchImports = new BatchImports(); arlBatchImport = new ArrayList(); arlBatchImport.Add(objBatchImport); objBatchImports.BatchImport = arlBatchImport; BatchImportXmlGeneratotorBLL objBatchImportXmlGeneratotorBLL; objBatchImportXmlGeneratotorBLL = new BatchImportXmlGeneratotorBLL(); XmlDocument xmlDoc = objBatchImportXmlGeneratotorBLL.CreateBatchImportXML(objBatchImports); //GetXMLFileData(xmlDoc, strBookID); BatchImportBLL objBatchImportBLL; objBatchImportBLL = new BatchImportBLL(); objBatchImportBLL.UploadToDocumentLib(strBookID, xmlDoc); }
/// <summary> /// Creates the name of the page. /// </summary> /// <param name="arrayList">The array list.</param> /// <param name="BatchImportElement">The batch import element.</param> private void CreatePageName(PageName pageName, XmlElement BatchImportElement) { XmlElement PageNameElement = objXmlDocument.CreateElement(PAGENAME); BatchImportElement.AppendChild(PageNameElement); //Creating name attribute for PageName node. if (pageName.Name.ToString().Length > 0) { XmlAttribute Name = objXmlDocument.CreateAttribute(NAME); PageNameElement.Attributes.Append(Name); Name.Value = pageName.Name; } //Creating name attribute for PageName node. if (pageName.PageCount.ToString().Length > 0) { XmlAttribute PageCount = objXmlDocument.CreateAttribute(PAGECOUNT); PageNameElement.Attributes.Append(PageCount); PageCount.Value = pageName.PageCount; } //Creating Shared Path element for PageName node. if (pageName.SharedPath != null) { CreateSharedPath(pageName.SharedPath, PageNameElement); } //Creating Shared Path element for PageName node. if (pageName.FileFormat != null) { CreateFileFormat(pageName.FileFormat, PageNameElement); } //Creating Shared Path element for PageName node. if (pageName.FileType != null) { CreateFileType(pageName.FileType, PageNameElement); } }