Example #1
0
 /// <summary>
 /// Updates the list entry for Add/Edit template.
 /// </summary>
 /// <param name="siteURL">The site URL.</param>
 /// <param name="listEntry">The list entry.</param>
 /// <param name="listName">Name of the list.</param>
 /// <param name="auditListName">Audit List Name.</param>
 /// <param name="userName">User Name.</param>
 /// <param name="actionPerformed">Audit Action.</param>
 /// <exception cref="">Handled in calling class.</exception>
 public void UpdateListEntry(string siteURL, ListEntry listEntry, string auditListName, string listName,
     string userName, string actionPerformed)
 {
     objTemplateDAL = new TemplateDAL();
     objTemplateDAL.UpdateListEntry(siteURL, listEntry, listName, auditListName, userName,
         actionPerformed);
 }
Example #2
0
        /// <summary>
        /// Updates the list entry.
        /// </summary>
        /// <param name="siteURL">The site URL.</param>
        /// <param name="listEntry">The list entry.</param>
        /// <param name="listName">Name of the list.</param>
        /// <returns>string</returns>
        internal string AddTemplateMasterPageMapping(string siteURL, ListEntry listEntry, string listName)
        {
            SPList list;
            SPListItem objListItem;
            string[] strTemplateIds = null;
            StringBuilder strTemplatePageMappingRowId = new StringBuilder();

            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                using (SPSite site = new SPSite(siteURL))
                {
                    using (SPWeb web = site.OpenWeb())
                    {
                        web.AllowUnsafeUpdates = true;
                        list = web.Lists[listName];

                        if (!string.IsNullOrEmpty(listEntry.MasterPage.Templates))
                        {
                            strTemplateIds = listEntry.MasterPage.Templates.Split(';');
                        }
                        if (strTemplateIds != null)
                        {
                            for (int i = 0; i < strTemplateIds.Length - 1; i++)
                            {
                                objListItem = list.Items.Add();
                                objListItem["Master_Page_ID"] = listEntry.MasterPage.RowId;
                                objListItem["Template_ID"] = int.Parse(strTemplateIds[i]);
                                objListItem["Page_Sequence"] = listEntry.MasterPage.PageSequence;
                                objListItem["Master_Page_Name"] = listEntry.MasterPage.Name;
                                objListItem["Page_Title_Template"] = listEntry.MasterPage.TemplateTitle;
                                objListItem["Asset_Type"] = listEntry.MasterPage.AssetTypeText;
                                objListItem["Discipline"] = listEntry.MasterPage.SignOffDisciplineText;
                                objListItem["Standard_Operating_Procedure"] = listEntry.MasterPage.SOP;
                                objListItem["Connection_Type"] = listEntry.MasterPage.ConnectionTypeText;
                                if (!string.IsNullOrEmpty(listEntry.MasterPage.PageURL))
                                {
                                    objListItem["Page_URL"] = listEntry.MasterPage.PageURL;
                                }
                                objListItem["Page_Owner"] = listEntry.MasterPage.PageOwner;
                                objListItem.Update();
                                /// Update the DWB Template list - Has_MasterPage column
                                TemplateDAL objTemplateDAL = new TemplateDAL();
                                objTemplateDAL.UpdateHasMasterPageColumn(siteURL, TEMPLATELIST, strTemplateIds[i], 1);
                                strTemplatePageMappingRowId.Append(objListItem["ID"].ToString() + ";");
                            }
                        }
                        web.AllowUnsafeUpdates = false;
                    }

                }
            });

            return strTemplatePageMappingRowId.ToString();
        }
Example #3
0
 /// <summary>
 /// Gets the details of the selected Template
 /// </summary>
 /// <param name="siteUrl">Site URL.</param>
 /// <param name="listName">List Name.</param>
 /// <param name="queryString">CAML Query.</param>
 /// <returns>List Entry object with TemplateDetails property values set.</returns>
 public ListEntry GetTemplateDetail(string siteURL, string listName, string CAMLQuery)
 {
     objTemplateDAL = new TemplateDAL();
     return (objTemplateDAL.GetTemplateDetail(siteURL, listName, CAMLQuery));
 }
Example #4
0
 /// <summary>
 /// Gets the Master Pages for the selected Template
 /// </summary>
 /// <param name="siteUrl">Site URL.</param>
 /// <param name="listName">List Name.</param>
 /// <param name="queryString">CAML Query.</param>
 /// <param name="viewFields">View Fields.</param>
 /// <returns>List Entry object with TemplateConfiguration values assigned.</returns>
 /// <exception cref="">Handled in calling method.</exception>
 public ListEntry GetMasterPageDetails(string siteURL, string listName, string CAMLQuery, string viewFields)
 {
     objTemplateDAL = new TemplateDAL();
     return objTemplateDAL.GetMasterPageDetail(siteURL, listName, CAMLQuery, viewFields);
 }
Example #5
0
 /// <summary>
 /// Updates the Mapping between master page and template in DWB Template Pages Mapping list
 /// </summary>
 /// <param name="siteURL">URL of the Site where list available</param>
 /// <param name="listEntry">ListEntry object</param>
 /// <param name="listName">DWB Template Pages Mapping</param>
 /// <param name="auditListName">DWB Template Pages Mapping Audit Trial</param>
 /// <param name="userName">User Name</param>
 /// <param name="actionPerformed">Audit Action</param>
 /// <param name="selectedTemplateID">TemplateID</param>
 /// <exception cref="">Handled in calling class.</exception>
 public void UpdateTemplatePageMapping(string siteURL, ListEntry listEntry, string listName, string auditListName, string userName, string actionPerformed, string selectedTemplateID)
 {
     objTemplateDAL = new TemplateDAL();
     objTemplateDAL.UpdateTemplatePageMapping(siteURL, listEntry, listName, auditListName, userName, actionPerformed, selectedTemplateID);
 }
Example #6
0
 /// <summary>
 /// Updates the details of the Master Page whiled edited
 /// Called from MasterPage.ascx
 /// </summary>
 /// <param name="siteUrl">Site URL</param>
 /// <param name="listName">List Name</param>
 /// <param name="auditListName">Audit List Name</param>
 /// <param name="objListEntry">List Entry object</param>
 /// <param name="actionPerformed">Audit Action</param>
 /// <param name="userName">User Name</param>
 /// <returns>returns the TemplateID associated with the master page</returns>
 public int UpdateMasterPageDetail(string siteUrl, string listName, string auditListName, ListEntry objListEntry, string actionPerformed, string userName)
 {
     objTemplateDAL = new TemplateDAL();
     return objTemplateDAL.UpdateMasterPageDetail(siteUrl, listName, auditListName, objListEntry, actionPerformed, userName);
 }