Exemplo n.º 1
0
 /// <summary>
 /// Signs Off book or Cancel Signs off the book.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnSignOff_Click(object sender, EventArgs e)
 {
     objWellBookBLL = new WellBookBLL();
     try
     {
         if (HttpContext.Current.Session[SESSIONWEBPARTPROPERTIES] != null &&
            ((TreeNodeSelection)HttpContext.Current.Session[SESSIONWEBPARTPROPERTIES]).IsBookSelected)
         {
             objTreeNodeSelection = (TreeNodeSelection)HttpContext.Current.Session[SESSIONWEBPARTPROPERTIES];
             strWellBookId = objTreeNodeSelection.BookID;
         }
         string strCamlQuery = @"<Where><Eq><FieldRef Name='Book_ID'/><Value Type='Counter'>" + strWellBookId + "</Value></Eq></Where>";
         /// Get the Book Details for the selected Book Id and populate the controls with data
         objListEntry = GetDetailsForSelectedID(strWellBookId, DWBBOOKLIST, WELLBOOK);
         if (objListEntry != null && objListEntry.WellBookDetails != null)
         {
             #region DREAM 4.0 - eWB 2.0 - Customise Chapters
             strWellBookName = objListEntry.WellBookDetails.Title;
             #endregion
             if (objListEntry.WellBookDetails.SignOffStatus.ToLowerInvariant().CompareTo(STATUSSIGNEDOFF) == 0)
             {
                 objWellBookBLL.ChangeSignOffStatus(strParentSiteURL, STATUSACTIVE, DWBBOOKLIST, GetUserName(), strWellBookId, AUDITACTIONUNSIGNEDOFF);
             }
             else
             {
                 objWellBookBLL.ChangeSignOffStatus(strParentSiteURL, STATUSTERMINATED, DWBBOOKLIST, GetUserName(), strWellBookId, AUDITACTIONSIGNEDOFF);
             }
         }
     }
     catch (WebException webEx)
     {
         lblException.Text = webEx.Message;
         lblException.Visible = true;
         ExceptionBlock.Visible = true;
     }
     catch (Exception ex)
     {
         CommonUtility.HandleException(strParentSiteURL, ex);
     }
     finally
     {
         this.Page.ClientScript.RegisterStartupScript(this.GetType(), HIDETABJSKEY, HIDETABJSPAGE);
     }
 }