/// <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 type of the file. /// </summary> /// <param name="fileType">Type of the file.</param> /// <param name="PageNameElement">The page name element.</param> private void CreateFileType(FileType fileType, XmlElement PageNameElement) { XmlElement FileTypeElement = objXmlDocument.CreateElement(FILETYPE); PageNameElement.AppendChild(FileTypeElement); //Creating type attribute for filetype node. if (fileType.Type.ToString().Length > 0) { XmlAttribute Type = objXmlDocument.CreateAttribute(TYPE); FileTypeElement.Attributes.Append(Type); Type.Value = fileType.Type; } }