Exemplo n.º 1
0
        /// <summary>
        /// Add page to the chapter
        /// </summary>
        /// <param name="siteURL">The site URL.</param>
        /// <param name="objListentry">ListEntry object.</param>
        /// <param name="listName">Name of the list.</param>
        /// <param name="auditListName">Name of the audit list.</param>
        /// <param name="username">Windows User ID.</param>
        /// <param name="actionPerformed">Audit Action ID</param>
        public void AddPageToChapters(string siteURL, ListEntry objListentry, string listName, string auditListName, string username, string actionPerformed)
        {
            objWellBookChapterDAL = new WellBookChapterDAL();
            string strPageID = objWellBookChapterDAL.AddPageToChapter(siteURL, objListentry, listName, auditListName, username, actionPerformed);

            if (!string.IsNullOrEmpty(strPageID) && objListentry != null && objListentry.ChapterPagesMapping != null)
            {
                StoryBoard objStoryBoard = new StoryBoard();
                objStoryBoard.PageId = Int32.Parse(strPageID);
                objStoryBoard.PageOwner = objListentry.ChapterPagesMapping[0].PageOwner;
                objStoryBoard.PageType = objListentry.ChapterPagesMapping[0].AssetType;
                objStoryBoard.SOP = objListentry.ChapterPagesMapping[0].StandardOperatingProc;
                objStoryBoard.PageTitle = objListentry.ChapterPagesMapping[0].PageName;
                objStoryBoard.Discipline = objListentry.ChapterPagesMapping[0].Discipline;
                objStoryBoard.ConnectionType = objListentry.ChapterPagesMapping[0].ConnectionType;
                objStoryBoard.MasterPageName = objListentry.ChapterPagesMapping[0].PageActualName;
                objStoryBoard.CreatedBy = objListentry.ChapterPagesMapping[0].Created_By;
                objStoryBoard.CreationDate = objListentry.ChapterPagesMapping[0].Created_Date;

                string strCAMLQuery = @"<Where><Eq><FieldRef Name='Page_ID' /><Value Type='Number'>" + strPageID + "</Value></Eq></Where>";
                objWellBookChapterDAL.UpdateStoryBoard(siteURL, DWBSTORYBOARD, CHAPTERPAGESMAPPINGAUDITLIST, strCAMLQuery, strPageID, objStoryBoard, actionPerformed, username);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Updates the Story Board
 /// </summary>
 /// <param name="parentSiteURL">Site URL.</param>
 /// <param name="listName">List Name.</param>
 /// <param name="auditListName">Audit List Name.</param>
 /// <param name="camlQuery">CAML Query.</param>
 /// <param name="pageID">Page ID.</param>
 /// <param name="pageStoryBoard">StoryBoard object.</param>
 /// <param name="userName">Windows User ID.</param>
 /// <param name="actionPerformed">Audit Action ID.</param>
 public void UpdateStoryBoard(string parentSiteURL, string listName, string auditListName, string camlQuery, string pageID, StoryBoard pageStoryBoard, string userName, string actionPerformed)
 {
     objWellBookChapterDAL = new WellBookChapterDAL();
     objWellBookChapterDAL.UpdateStoryBoard(parentSiteURL, listName, auditListName, camlQuery, pageID, pageStoryBoard, actionPerformed, userName);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Updates the list entry.
        /// </summary>
        /// <param name="siteURL">The site URL.</param>
        /// <param name="listEntry">The list entry.</param>
        /// <param name="auditListName">Name of the audit list.</param>
        /// <param name="listName">Name of the list.</param>
        /// <param name="userName">Name of the user.</param>
        /// <param name="actionPerformed">The action performed.</param>
        public void UpdateListEntry(string siteURL, ListEntry listEntry, string auditListName, string listName, string userName, string actionPerformed)
        {
            objWellBookChapterDAL = new WellBookChapterDAL();
            objCommonDAL = new CommonDAL();

            string strChapterID = objWellBookChapterDAL.UpdateListEntry(siteURL, listEntry, listName, auditListName, userName, actionPerformed);
            if (listEntry != null && listEntry.ChapterPagesMapping != null)
            {
                if (listEntry.ChapterPagesMapping.Count > 0 && actionPerformed.Contains(AUDIT_ACTION_CREATION))
                {
                    objWellBookChapterDAL.AddChapterMasterPageMapping(siteURL, listEntry, CHAPTERPAGESMAPPINGLIST, CHAPTERPAGESMAPPINGAUDITLIST, userName, actionPerformed);

                     string strCAMLQuery = string.Empty;
                     DataTable dtChapterPages = null;
                     DataTable dtMasterPage = null;
                     DataTable dtTemplate = null;
                     string strViewFields = string.Empty;
                     int intMasterPageID;
                     if (!string.IsNullOrEmpty(strChapterID))
                     {
                         strCAMLQuery = @"<Where><Eq><FieldRef Name='Chapter_ID'/><Value Type='Number'>" + strChapterID + "</Value></Eq></Where>";
                         dtChapterPages = objCommonDAL.ReadList(siteURL, CHAPTERPAGESMAPPINGLIST, strCAMLQuery);
                     }
                    if (dtChapterPages != null && dtChapterPages.Rows.Count > 0)
                     {
                         foreach (DataRow dtRow in dtChapterPages.Rows)
                         {
                             StoryBoard objStoryBoard = new StoryBoard();
                             objStoryBoard.PageId = Int32.Parse(dtRow["ID"].ToString());
                             objStoryBoard.PageOwner = dtRow["Owner"].ToString();
                             objStoryBoard.PageType = dtRow["Asset_Type"].ToString();
                             objStoryBoard.SOP = dtRow["Standard_Operating_Procedure"].ToString();
                             objStoryBoard.PageTitle = dtRow["Page_Actual_Name"].ToString();
                             objStoryBoard.Discipline = dtRow["Discipline"].ToString();
                             objStoryBoard.ConnectionType = dtRow["Connection_Type"].ToString();

                             intMasterPageID = Int32.Parse(dtRow["Master_Page_ID"].ToString());
                             strCAMLQuery = string.Empty;

                             strCAMLQuery = @"<Where><Eq><FieldRef Name='ID' /><Value Type='Counter'>" + intMasterPageID.ToString() + "</Value></Eq></Where>";
                             strViewFields = @"<FieldRef Name='ID'/><FieldRef Name='Master_Page_ID'/>";
                             dtTemplate = objCommonDAL.ReadList(siteURL, DWBTEMPLATEPAGESLIST, strCAMLQuery, strViewFields);
                             if (dtTemplate != null && dtTemplate.Rows.Count > 0)
                             {
                                 intMasterPageID = Int32.Parse(dtTemplate.Rows[0]["Master_Page_ID"].ToString());
                             }

                             strCAMLQuery = @"<Where><Eq><FieldRef Name='ID' /><Value Type='Counter'>" + intMasterPageID.ToString() + "</Value></Eq></Where>";
                             strViewFields = @"<FieldRef Name='ID'/><FieldRef Name='Page_Owner'/><FieldRef Name='Created'/><FieldRef Name='Title'/>";
                             dtMasterPage = objCommonDAL.ReadList(siteURL, DWBMASTERPAGESLIST, strCAMLQuery, strViewFields);

                             if (dtMasterPage != null && dtMasterPage.Rows.Count > 0)
                             {
                                 objStoryBoard.MasterPageName = dtMasterPage.Rows[0]["Title"].ToString();
                                 objStoryBoard.CreatedBy = dtMasterPage.Rows[0]["Page_Owner"].ToString();
                                 objStoryBoard.CreationDate = dtMasterPage.Rows[0]["Created"].ToString();
                             }
                             strCAMLQuery = string.Empty;
                             strCAMLQuery = @"<Where><Eq><FieldRef Name='Page_ID' /><Value Type='Number'>" + objStoryBoard.PageId.ToString() + "</Value></Eq></Where>";
                             objWellBookChapterDAL.UpdateStoryBoard(siteURL, DWBSTORYBOARD, CHAPTERPAGESMAPPINGAUDITLIST, strCAMLQuery, objStoryBoard.PageId.ToString(), objStoryBoard, actionPerformed, userName);
                         }
                     }
                     if (dtChapterPages != null)
                     {
                         dtChapterPages.Dispose();
                     }
                     if (dtMasterPage != null)
                     {
                         dtMasterPage.Dispose();
                     }
                }
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Updates the Narrative field
 /// </summary>
 /// <param name="parentSiteURL">SiteURL.</param>
 /// <param name="listName">List Name.</param>
 /// <param name="auditListName">Audit List Name.</param>
 /// <param name="camlQuery">CAML Query.</param>
 /// <param name="pageID">Page ID.</param>
 /// <param name="narrative">Narrative.</param>
 /// <param name="userName">Windows User ID.</param>
 public void UpdateNarrative(string parentSiteURL, string listName, string auditListName, string camlQuery, string pageID, string narrative, string userName)
 {
     objWellBookChapterDAL = new WellBookChapterDAL();
     objWellBookChapterDAL.UpdateNarrative(parentSiteURL, listName, auditListName, camlQuery, pageID, narrative, userName);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Set ChapterDetails.
 /// </summary>
 /// <param name="siteURL">Site URL.</param>
 /// <param name="listName">List Name.</param>
 /// <param name="queryString">CAML Query.</param>
 /// <returns>ListEntry object.</returns>
 public ListEntry SetChapterDetail(string siteURL, string listName, string CAMLQuery)
 {
     objWellBookChapterDAL = new WellBookChapterDAL();
     return (objWellBookChapterDAL.GetChapterDetails(siteURL, listName, CAMLQuery));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Get the Chapter Pages
 /// </summary>
 /// <param name="siteUrl">The site URL.</param>
 /// <param name="listName">List Name.</param>
 /// <param name="CAMLQuery">The CAML query.</param>
 /// <returns>ListEntry object.</returns>
 public ListEntry GetChapterPages(string siteUrl, string listName, string CAMLQuery)
 {
     objWellBookChapterDAL = new WellBookChapterDAL();
     return objWellBookChapterDAL.SetChapterPage(siteUrl, listName, CAMLQuery);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Get Pages for the Selected Book
 /// </summary>
 /// <param name="strParentSiteUrl">Site URL.</param>
 /// <param name="listName">List Name.</param>
 /// <param name="strCamlQuery">CAML Query.</param>     
 /// <returns>ListEntry object</returns>
 public ListEntry GetBookPages(string siteURL, string listName, string CAMLQuery)
 {
     ListEntry objListEntry = null;
     DataTable dtResultTable = null;
     objWellBookChapterDAL = new WellBookChapterDAL();
     objCommonDAL = new CommonDAL();
     string strcamlQuery = string.Empty;
     int intRowId = 0;
     objListEntry = objWellBookChapterDAL.SetChapterPage(siteURL, listName, CAMLQuery);
     strcamlQuery = @"<Where><Eq><FieldRef Name='ID' />
          <Value Type='Counter'>" + Convert.ToString(objListEntry.ChapterDetails.RowID) + "</Value></Eq></Where>";
     dtResultTable = objCommonDAL.ReadList(siteURL, DWBCHAPTERLIST,
        strcamlQuery);
     if (dtResultTable != null && dtResultTable.Rows.Count > 0)
     {
         int.TryParse(Convert.ToString(dtResultTable.Rows[0]["Book_ID"]), out intRowId);
         objListEntry.ChapterDetails.BookID = intRowId;
         objListEntry.ChapterDetails.ChapterTitle = Convert.ToString(dtResultTable.Rows[0][TITLECOLUMN]);
     }
     if (dtResultTable != null)
     {
         dtResultTable.Dispose();
     }
     return objListEntry;
 }
Exemplo n.º 8
0
 /// <summary>
 /// Updates the Comments for the Selected Page
 /// </summary>
 /// <param name="siteUrl">Site URL.</param>
 /// <param name="listName">List Name.</param>                
 /// <param name="auditListName">Name of Audit List.</param>
 /// <param name="listEntry">ListEntry object.</param>
 /// <param name="actionPerformed">ID of the Audit Action</param>
 /// <returns>bool</returns>
 public bool UpdatePageComments(string siteURL, string listName, string auditListName, ListEntry listEntry, string actionPerformed)
 {
     objWellBookChapterDAL = new WellBookChapterDAL();
     return objWellBookChapterDAL.UpdateComments(siteURL, listName, auditListName, listEntry, actionPerformed);
 }
Exemplo n.º 9
0
        /// <summary>
        /// Updates the Pages details in a Well Book.
        /// </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 method.</exception>
        internal void UpdateBookPage(string siteURL, ListEntry listEntry, string listName, string auditListName, string userName, string actionPerformed)
        {
            SPList list;
            SPListItem objListItem;
            DataTable dtlistItem = null;
            int intId = 0;
            int intRowId = 0;
            int intPageSequence = 0;
            DataView dvResultView;
            SPQuery query = null;
            string strCAMLQuery = string.Empty;
            try
            {
                SPSecurity.RunWithElevatedPrivileges(delegate()
                {
                    using (SPSite site = new SPSite(siteURL))
                    {
                        using (SPWeb web = site.OpenWeb())
                        {
                            web.AllowUnsafeUpdates = true;
                            list = web.Lists[listName];
                            objListItem = list.Items.Add();
                            if (string.Equals(actionPerformed, AUDIT_ACTION_UPDATION))
                            {
                                objListItem = list.GetItemById(listEntry.MasterPage.RowId);
                            }
                            objListItem["Page_Name"] = listEntry.MasterPage.Name;
                            objListItem["Page_Actual_Name"] = listEntry.MasterPage.TemplateTitle;
                            objListItem["Page_Sequence"] = listEntry.MasterPage.PageSequence;
                            objListItem["Standard_Operating_Procedure"] = listEntry.MasterPage.SOP;
                            objListItem["Discipline"] = listEntry.MasterPage.SignOffDiscipline;
                            objListItem.Update();
                            int.TryParse((objListItem["ID"].ToString()), out intId);
                            listEntry.MasterPage.RowId = intId;
                            /// start
                            query = new SPQuery();
                            query.Query = @"<Where><And><Eq><FieldRef Name='Terminate_Status' />
              <Value Type='Choice'>No</Value></Eq><Eq><FieldRef Name='Chapter_ID' />
              <Value Type='Number'>" + Convert.ToString(objListItem["Chapter_ID"]) + "</Value></Eq></And></Where>";
                            dtlistItem = list.GetItems(query).GetDataTable();
                            if (dtlistItem != null && dtlistItem.Rows.Count > 0)
                            {
                                dvResultView = dtlistItem.DefaultView;
                                dvResultView.Sort = "Page_Sequence asc";
                                for (int intIndex = 0; intIndex < dvResultView.Count; intIndex++)
                                {
                                    intPageSequence = intPageSequence + 10;
                                    intRowId = (int)dvResultView[intIndex]["ID"];
                                    objListItem = list.GetItemById(intRowId);
                                    objListItem["Page_Sequence"] = intPageSequence;

                                    objListItem.Update();
                                }
                            }
                            /// end
                            web.AllowUnsafeUpdates = false;
                            objCommonDAL = new CommonDAL();
                            objCommonDAL.UpdateListAuditHistory(siteURL, auditListName, listEntry.MasterPage.RowId, userName, actionPerformed);
                            /// Update the values to StoryBoard list
                            WellBookChapterDAL objWellBookChapterDAL = new WellBookChapterDAL();
                            StoryBoard objStoryBoard = new StoryBoard();
                            objListItem = list.GetItemById(listEntry.MasterPage.RowId);

                            if (objListItem != null)
                            {
                                objStoryBoard.PageId = Int32.Parse(Convert.ToString(objListItem["ID"]));
                                objStoryBoard.SOP = Convert.ToString(objListItem["Standard_Operating_Procedure"]);
                                objStoryBoard.PageTitle = Convert.ToString(objListItem["Page_Actual_Name"]);
                                objStoryBoard.Discipline = Convert.ToString(objListItem["Discipline"]);

                                strCAMLQuery = string.Empty;
                                strCAMLQuery = @"<Where><Eq><FieldRef Name='Page_ID' /><Value Type='Number'>" + objStoryBoard.PageId.ToString() + "</Value></Eq></Where>";
                                objWellBookChapterDAL.UpdateStoryBoard(siteURL, DWBSTORYBOARD, CHAPTERPAGESMAPPINGAUDITLIST, strCAMLQuery, objStoryBoard.PageId.ToString(), objStoryBoard, actionPerformed, userName);
                            }
                        }
                    }
                });
            }
            finally
            {
                if (dtlistItem != null) dtlistItem.Dispose();
            }
        }