/// <summary> /// Handles the Click event of the cmdSubmit control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void BtnSubmit_Click(object sender, EventArgs e) { objController = objFactory.GetServiceManager("MossService"); objUtility = new CommonUtility(); try { bool blnIsSaved = false; string strUserId = objUtility.GetUserName(); string strMessage = string.Empty; //set the values selected by the user. if (rdoRating.SelectedIndex != -1) { objFeedback.Rating = rdoRating.SelectedItem.Text; } objFeedback.Reason = txtReasonForRating.Text.Trim(); objFeedback.AdditionalInformation = txtAdditionalInformation.Text.Trim(); objFeedback.PageName = ddlPageName.SelectedItem.Text; objFeedback.Comment = txtPageLevelComment.Text.Trim(); //check the type of feedback has selected. if (string.Compare(rdoFeedback.SelectedItem.Text, PAGELEVELFEEDBACK) == 0) { objFeedback.TypeofFeedback = PAGELEVELFEEDBACK; } else { objFeedback.TypeofFeedback = GENERALFEEDBACK; } ///Check if the Session object for the uploaded file is not null. if (Session["FileAttached"] != null) { objFeedback.FileAttached = (byte[])Session["FileAttached"]; objFeedback.FileName = hidFileName.Value; } //Enters the Feedback details into sharepoint list. blnIsSaved = ((MOSSServiceManager)objController).UpdateFeedback(strUserId, objFeedback); if (blnIsSaved) { lblMessage.Text = SUCCESSMESSEGE; objUtility.SendAlertMailforNewFeedback(strMessage); } else { lblMessage.Text = ERRORMESSEGE; } pnlConfirmFeedback.Visible = true; pnlFeedback.Visible = false; } catch (WebException webEx) { lblErrorMessage.Visible = true; lblErrorMessage.Text = webEx.Message; } catch (Exception ex) { CommonUtility.HandleException(HttpContext.Current.Request.Url.ToString(), ex); } }
/// <summary> /// Activates the List items /// </summary> /// <param name="siteURL">The site URL.</param> /// <param name="listName">Name of the list.</param> /// <param name="rowID">The row ID.</param> /// <param name="auditlistName">Name of the auditlist.</param> /// <param name="updatePageSequence">if set to <c>true</c> [update page sequence].</param> /// <param name="updateAuditHistory">if set to <c>true</c> [update audit history].</param> /// <returns>bool</returns> public bool ActivateListValues(string siteURL, string listName, int rowID, string auditlistName, bool updatePageSequence, bool updateAuditHistory) { objCommonDAL = new CommonDAL(); objCommonUtility = new CommonUtility(); objCommonDAL.ListStatusUpdate(siteURL, listName, rowID, NO, updatePageSequence); if (updateAuditHistory) { objCommonDAL.UpdateListAuditHistory(siteURL, auditlistName, rowID, objCommonUtility.GetUserName(), AUDIT_ACTION_ACTIVATE); } return true; }
/// <summary> /// Initializes the user preference. /// </summary> protected void InitializeUserPreference() { CommonUtility objCommonUtility = new CommonUtility(); AbstractController objMossController = null; ServiceProvider objFactory = new ServiceProvider(); string strCurrSiteUrl = SPContext.Current.Site.Url.ToString(); try { objUserPreferences = new UserPreferences(); string strUserId = objCommonUtility.GetUserName(); objMossController = objFactory.GetServiceManager("MossService"); //get the user prefrences. objUserPreferences = ((MOSSServiceManager)objMossController).GetUserPreferencesValue(strUserId, strCurrSiteUrl); CommonUtility.SetSessionVariable(Page, enumSessionVariable.UserPreferences.ToString(), objUserPreferences); } catch (Exception ex) { CommonUtility.HandleException(HttpContext.Current.Request.Url.ToString(), ex); } }
/// <summary> /// Updates the master page details. /// </summary> private void UpdateMasterPageDetails() { string strActionPerformed = AUDITACTIONCREATION; if (string.Compare(strMode,EDIT) == 0) { strActionPerformed = AUDITACTIONUPDATION; } objUtility = new CommonUtility(); string strUserName = objUtility.GetUserName(); switch (strListType) { case BOOKPAGES: objWellBook = new WellBookBLL(); objWellBook.UpdateBookPage(strParentSiteURL, objListEntry, CHAPTERPAGESMAPPINGLIST, CHAPTERPAGESMAPPINGAUDITLIST, strUserName, strActionPerformed); break; case CHAPTERPAGES: objWellBook = new WellBookBLL(); objWellBook.UpdateBookPage(strParentSiteURL, objListEntry, CHAPTERPAGESMAPPINGLIST, CHAPTERPAGESMAPPINGAUDITLIST, strUserName, strActionPerformed); break; case TEMPLATEMASTERPAGES: objTemplateBLL = new TemplateDetailBLL(); objTemplateBLL.UpdateMasterPageDetail(strParentSiteURL, TEMPLATEPAGESMAPPINGLIST, TEMPLATECONFIGURATIONAUDIT, objListEntry, strActionPerformed, strUserName); break; default: UpdateListEntry(objListEntry, MASTERPAGELIST, MASTERPAGEAUDITLIST, MASTERPAGE, strActionPerformed); break; } }
/// <summary> /// Saves the reorder XML to document library. /// </summary> /// <param name="chapterPreference">The chapter preference.</param> /// <param name="bookId">The book id.</param> /// <returns>XmlDocument</returns> public XmlDocument SaveReorderXml(string chapterPreference, string bookId) { XmlDocument userReorderXml = null; CommonUtility objCommonUtility = new CommonUtility(); AbstractController objMOSSController; ServiceProvider objFactory; objFactory = new ServiceProvider(); objMOSSController = objFactory.GetServiceManager(MOSSSERVICE); XmlDocument chapterPreferenceXml = new XmlDocument(); chapterPreferenceXml.LoadXml(chapterPreference); string strUserId = objCommonUtility.GetUserName(); /// If the file for the logged in user is available in doc lib, load to XmlDocument if (((MOSSServiceManager)objMOSSController).IsDocLibFileExist(CHAPTERPREFERENCEDOCLIB, strUserId)) { userReorderXml = ((MOSSServiceManager)objMOSSController).GetDocLibXMLFile(CHAPTERPREFERENCEDOCLIB, strUserId); } else { /// Else create new XmlDocument userReorderXml = new XmlDocument(); XmlElement rootElement = userReorderXml.CreateElement("Books"); userReorderXml.AppendChild(rootElement); } /// If the preference Xml is available in document read into XmlNode /// Else create a new node, add all details and add the node to XmlDocument. XmlNode bookNode = userReorderXml.SelectSingleNode("Books/BookInfo[@BookID='" + bookId + "']"); if (bookNode == null) { XmlNode ndSearchType = userReorderXml.CreateElement("BookInfo"); XmlAttribute atBookId = userReorderXml.CreateAttribute("BookID"); atBookId.Value = bookId; ndSearchType.Attributes.Append(atBookId); XmlAttribute atBookName = userReorderXml.CreateAttribute("BookName"); atBookName.Value = chapterPreferenceXml.SelectSingleNode("BookInfo").Attributes["BookName"].Value; ndSearchType.Attributes.Append(atBookName); userReorderXml.SelectSingleNode("Books").AppendChild(ndSearchType); ndSearchType.InnerXml = chapterPreferenceXml.SelectSingleNode("BookInfo").InnerXml; } else {/// If the preference Xml is available in document modify only the inner xml of the BookInfo node. bookNode.InnerXml = chapterPreferenceXml.SelectSingleNode("BookInfo").InnerXml; } ((MOSSServiceManager)objMOSSController).UploadToDocumentLib(CHAPTERPREFERENCEDOCLIB, strUserId, userReorderXml); return userReorderXml; }
/// <summary> /// Updates the Sign of Status /// </summary> /// <param name="siteUrl">Site URL.</param> /// <param name="listName">List Name.</param> /// <param name="signOffStatus">Yes/No.</param> /// <param name="pageId">Page ID.</param> /// <param name="actionperformed">ID of Audit Action.</param> public void UpdateWellBookPageSignOffStatus(string siteURL, string listName, string signOffStatus, int pageId, string actionPerformed) { objWellBookDAL = new WellBookDAL(); Dictionary<string, string> listItemCollection = new Dictionary<string, string>(); listItemCollection.Add("Sign_Off_Status", signOffStatus); string strCAMLQuery = "<Where><Eq><FieldRef Name='ID' /><Value Type='Counter'>" + pageId + "</Value></Eq></Where>"; WellBookDAL.UpdateListItemCollectionValues(siteURL, listName, strCAMLQuery, listItemCollection); objCommonDAL = new CommonDAL(); Shell.SharePoint.DREAM.Utilities.CommonUtility objCommonUtility = new Shell.SharePoint.DREAM.Utilities.CommonUtility(); string strUserName = objCommonUtility.GetUserName(); objCommonDAL.UpdateListAuditHistory(siteURL, CHAPTERPAGESMAPPINGAUDITLIST, pageId, strUserName, actionPerformed); }
/// <summary> /// Update Sign Off Status /// Added By: Praveena /// Date:11/09/2010 /// Reason: For module Simplify Sign Off /// </summary> /// <param name="siteURL"></param> /// <param name="listName"></param> /// <param name="signOffStatus"></param> /// <param name="pageIDs"></param> /// <param name="actionPerformed"></param> public void UpdateBulkSignOffStatus(string siteURL, string listName, string signOffStatus, string pageIDs, string actionPerformed) { objWellBookDAL = new WellBookDAL(); objCommonBLL = new CommonBLL(); string strCAMLQuery = objCommonBLL.CreateCAMLQuery(pageIDs, "ID", "Number"); WellBookDAL.UpdateBulkSignOffSatus(siteURL, listName, strCAMLQuery, signOffStatus); objCommonDAL = new CommonDAL(); Shell.SharePoint.DREAM.Utilities.CommonUtility objCommonUtility = new Shell.SharePoint.DREAM.Utilities.CommonUtility(); string strUserName = objCommonUtility.GetUserName(); objCommonDAL.UpdateBulkListAuditHistory(siteURL, CHAPTERPAGESMAPPINGAUDITLIST, pageIDs, strUserName, actionPerformed); }
/// <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> /// <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 UpdateListEntry(string siteURL, ListEntry listEntry, string listName, string auditListName, string userName, string actionPerformed) { SPList list; SPQuery query; SPListItem objListItem; SPFieldLookupValue lookupField; int intRowId = 0; SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite(siteURL)) { using (SPWeb web = site.OpenWeb()) { web.AllowUnsafeUpdates = true; list = web.Lists[listName]; query = new SPQuery(); objListItem = list.Items.Add(); if (string.Compare(actionPerformed, AUDIT_ACTION_BOOK_TITLE_UPDATED, true) == 0 || string.Compare(actionPerformed, AUDIT_ACTION_UPDATION, true) == 0) { objListItem = list.GetItemById(listEntry.WellBookDetails.RowId); } objListItem["Title"] = listEntry.WellBookDetails.Title; if (!string.IsNullOrEmpty(listEntry.WellBookDetails.TeamID)) { lookupField = new SPFieldLookupValue(listEntry.WellBookDetails. TeamID); objListItem["Team"] = lookupField; int.TryParse(listEntry.WellBookDetails.TeamID, out intRowId); objListItem["Team_ID"] = intRowId; } if (!string.IsNullOrEmpty(listEntry.WellBookDetails.BookOwnerID)) { lookupField = new SPFieldLookupValue(listEntry.WellBookDetails.BookOwnerID); objListItem["Owner"] = lookupField; } objListItem.Update(); listEntry.WellBookDetails.RowId = int.Parse(objListItem["ID"].ToString()); web.AllowUnsafeUpdates = false; objCommonDAL = new CommonDAL(); CommonUtility objCommonUtility = new CommonUtility(); userName = objCommonUtility.GetUserName(); objCommonDAL.UpdateListAuditHistory(siteURL, auditListName, listEntry.WellBookDetails.RowId, userName, actionPerformed); } } }); }
/// <summary> /// Gets the camlQuery based on the report type /// </summary> /// <returns></returns> private string GetsCAMLQuery() { string strTerminated = string.Empty; string strCamlQuery = string.Empty; string strMasterID = string.Empty; if (!ActiveStatus) strTerminated = STATUS_TERMINATED; else strTerminated = STATUS_ACTIVE; switch (ListReportName) { case "Audit Trail": { strMasterID = HttpContext.Current.Request.QueryString["auditID"]; strCamlQuery = @"<OrderBy><FieldRef Name='Created' Ascending='False' /></OrderBy><Where><Eq><FieldRef Name='Master_ID' /><Value Type='Number'>" + strMasterID + "</Value></Eq></Where>"; break; } case MASTERPAGEREPORT: { strCamlQuery = @"<OrderBy><FieldRef Name='Page_Sequence' /></OrderBy><Where><Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>" + strTerminated + "</Value></Eq></Where>"; break; } case CHAPTERPAGEMAPPINGREPORT: { strCamlQuery = GetCAMLQueryForWellBookPages(); if (strCamlQuery.Length == 0) { strCamlQuery = @"<Where><Eq><FieldRef Name='ID' /><Value Type='Counter'>-9999</Value></Eq></Where>"; } break; } case WELLBOOKPAGEVIEW: { strCamlQuery = GetCAMLQueryForWellBookSummaryPages(); if (strCamlQuery.Length == 0) { strCamlQuery = @"<Where><Eq><FieldRef Name='ID' /><Value Type='Counter'>-9999</Value></Eq></Where>"; } break; } case CHAPTERREPORT: { strCamlQuery = GetCAMLQueryForWellBookChapters(); if (strCamlQuery.Length == 0) { #region DREAM 4.0 - eWB2.0 - Deletion Module /// <Eq><FieldRef Name='ToBeDeleted' /><Value Type='Choice'>No</Value></Eq></And> is added. /// And condition added to the CAML query //strCamlQuery = @"<Where><Eq><FieldRef Name='ID' /><Value Type='Counter'>-9999</Value></Eq></Where>"; strCamlQuery = @"<Where><And><Eq><FieldRef Name='ID' /><Value Type='Counter'>-9999</Value></Eq> <Or> <IsNull> <FieldRef Name='ToBeDeleted' /> </IsNull><Eq> <FieldRef Name='ToBeDeleted' /> <Value Type='Choice'>No</Value> </Eq> </Or> </And></Where>"; #endregion } break; } case CHAPTERPAGEREPORT: { strCamlQuery = @"<OrderBy><FieldRef Name='Page_Sequence' /></OrderBy><Where><And><Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>" + strTerminated + "</Value></Eq><Eq><FieldRef Name='Chapter_ID'/><Value Type='Number'>" + HttpContext.Current.Request.QueryString["ChapterID"] + "</Value></Eq></And></Where>"; break; } case TEMPLATEREPORT: { /// Title column in DWB Templates list is renamed to "Template_Name". the Internal name remains as "Title"; strCamlQuery = @"<OrderBy><FieldRef Name='Title' /></OrderBy><Where><Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>" + strTerminated + "</Value></Eq></Where>"; break; } case TEMPLATEPAGESREPORT: { strCamlQuery = GetCAMLQueryForTemplatePages(); break; } case USERREGISTRATION: { strCamlQuery = @"<OrderBy><FieldRef Name='DWBUserName' /></OrderBy><Where><Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>" + strTerminated + "</Value></Eq></Where>"; break; } case TEAMREGISTRATION: { object objStoredPrivilege = CommonUtility.GetSessionVariable(Page, enumSessionVariable.UserPrivileges.ToString()); if (objStoredPrivilege != null) { Privileges objPrivileges = (Privileges)objStoredPrivilege; if (objPrivileges != null) { if (objPrivileges.SystemPrivileges != null) { if (objPrivileges.SystemPrivileges.AdminPrivilege) { /// Get all the teams from "DWB Team" strCamlQuery = @"<OrderBy><FieldRef Name='Title' /></OrderBy><Where><Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>" + strTerminated + "</Value></Eq></Where>"; } else if (objPrivileges.SystemPrivileges.BookOwner) { /// Get the teams where loggedin user is member objCommonBLL = new CommonBLL(); strCamlQuery = objCommonBLL.GetCAMLQueryForBOUsers(strSiteURL, "ID", "Counter", strTerminated,false); } } } } break; } case STAFFREGISTRATION: { strCamlQuery = @"<OrderBy><FieldRef Name='Discipline' /><FieldRef Name='User_Rank' /></OrderBy><Where><Eq><FieldRef Name='Team_ID' /><Value Type='Number'>" + HttpContext.Current.Request.QueryString[IDVALUEQUERYSTRING] + "</Value></Eq></Where>"; break; } case WELLBOOKREPORT: { strCamlQuery = string.Empty; object objStoredPrivilege = CommonUtility.GetSessionVariable(Page, enumSessionVariable.UserPrivileges.ToString()); if (objStoredPrivilege != null) { Privileges objPrivileges = (Privileges)objStoredPrivilege; if (objPrivileges != null && objPrivileges.SystemPrivileges != null) { if (objPrivileges.SystemPrivileges.AdminPrivilege) { /// <Eq><FieldRef Name='ToBeDeleted' /><Value Type='Choice'>No</Value></Eq></And> is added. /// And condition added to the CAML query // strCamlQuery = @"<OrderBy><FieldRef Name='Title' /></OrderBy><Where><Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>" + //strTerminated + "</Value></Eq></Where>"; #region DREAM 4.0 - eWB2.0 - Deletion Module strCamlQuery = @"<OrderBy><FieldRef Name='Title' /></OrderBy><Where><And><Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>" + strTerminated + "</Value></Eq><Or><IsNull><FieldRef Name='ToBeDeleted' /></IsNull><Eq><FieldRef Name='ToBeDeleted' /><Value Type='Choice'>No</Value></Eq></Or></And></Where>"; #endregion } else if (objPrivileges.SystemPrivileges.BookOwner) { /// Find the Team_IDs where user is member "DWB Team Staff" list /// and Get Only the Books where Team (DWB Books) == Team_Name(Title) in "DWB Team" list /// <TODO> /// Add the <Eq><FieldRef Name='ToBeDeleted' /><Value Type='Choice'>No</Value></Eq> at proper location /// </TODO> objCommonBLL = new CommonBLL(); strCamlQuery = objCommonBLL.GetCAMLQueryForBOUsers(strSiteURL, "Team_ID", "Number", strTerminated,true); } else if (objPrivileges.SystemPrivileges.PageOwner || objPrivileges.SystemPrivileges.DWBUser) { if (objPrivileges.FocalPoint != null && !string.IsNullOrEmpty(objPrivileges.FocalPoint.BookIDs)) { objCommonUtility = new CommonUtility(); /// Get only the Books where "Owner" = logged in user //strCamlQuery = @" <Where> <And><Eq><FieldRef Name='Owner' /><Value Type='Lookup'>" + objCommonUtility.GetUserName() + "</Value></Eq><Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>No</Value></Eq></And></Where>"; #region DREAM 4.0 - eWB2.0 - Deletion Module /// <Eq><FieldRef Name='ToBeDeleted' /><Value Type='Choice'>No</Value></Eq></And> is added. /// Another And condition added to the CAML query strCamlQuery = @" <Where><And> <Eq><FieldRef Name='Owner' /><Value Type='Lookup'>" + objCommonUtility.GetUserName() + "</Value></Eq><And><Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>No</Value></Eq> <Or><IsNull><FieldRef Name='ToBeDeleted' /></IsNull><Eq><FieldRef Name='ToBeDeleted' /><Value Type='Choice'>No</Value></Eq></Or></And></And></Where>"; #endregion } } } } break; } case DWBHOME: { objCommonBLL = new CommonBLL(); strCamlQuery = @"<Where><Eq><FieldRef Name='Windows_User_ID' /><Value Type='Text'>" + GetUserName() + "</Value></Eq></Where>"; DataTable dtListDetails = objCommonBLL.ReadList(strSiteURL, USERLIST, strCamlQuery); string strFavoriteBooksIds = string.Empty; if (dtListDetails.Rows.Count > 0) strFavoriteBooksIds = Convert.ToString(dtListDetails.Rows[0]["FavoriteBooks"]); ((HiddenField)FindControl("hdnUserFavorites")).Value = strFavoriteBooksIds; RadioButtonList rdblFavorites = (RadioButtonList)FindControl("rdoFavourites"); if (rdblFavorites != null) { if (rdblFavorites.SelectedIndex == 0) { /// Get all the Books /// strCamlQuery = @"<OrderBy><FieldRef Name='Title' /></OrderBy><Where><And><Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>No</Value></Eq><Gt><FieldRef Name='NoOfActiveChapters' /><Value Type='Number'>0</Value></Gt></And></Where>"; #region DREAM 4.0 - eWB2.0 - Deletion Module strCamlQuery = @"<OrderBy><FieldRef Name='Title' /></OrderBy><Where><And><And><Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>No</Value></Eq> <Or> <IsNull> <FieldRef Name='ToBeDeleted' /> </IsNull> <Eq> <FieldRef Name='ToBeDeleted' /> <Value Type='Choice'>No</Value> </Eq> </Or> </And><Gt><FieldRef Name='NoOfActiveChapters' /><Value Type='Number'>0</Value></Gt></And></Where>"; #endregion } else if (rdblFavorites.SelectedIndex == 1) { /// Get only Favourite Books string[] strBookIds = strFavoriteBooksIds.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); strCamlQuery = CreateCAMLQuery(strBookIds); } } if (dtListDetails != null) { dtListDetails.Dispose(); } break; } default: strCamlQuery = @"<OrderBy><FieldRef Name='Title' /></OrderBy><Where><Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>" + strTerminated + "</Value></Eq></Where>"; break; } return strCamlQuery; }
/// <summary> /// Handles the initialization event of the Page control. /// </summary> protected void Page_Init() { try { objEventServiceController = objFactory.GetServiceManager(EVENTSERVICE); objReportController = objFactory.GetServiceManager(REPORTSERVICE); if(!objUtility.IsPostBack(this.Page)) { objUtility = new CommonUtility(); objRequestInfo = new RequestInfo(); objRequestInfo = SetSearchRequestObject(EVENTGROUP); cblEventsGroup.Items.Clear(); cblEventsGroup.Items.Add(DEFAULTDROPDOWNTEXT); LoadSearch(objRequestInfo, EVENTGROUP, cblEventsGroup); objRequestInfo = SetSearchRequestObject(EVENTTYPE); cblEventsType.Items.Clear(); cblEventsType.Items.Add(DEFAULTDROPDOWNTEXT); LoadSearch(objRequestInfo, EVENTTYPE, cblEventsType); string strCurrUserName = objUtility.GetUserName(); txtCREATEDBY.Text = strCurrUserName; txtUPDATEDBY.Text = strCurrUserName; } //DREAM 4.0 CreateDDLAssets(tdDDLAssets); ddlAssets.CssClass = DDLCLASS; } catch(Exception ex) { CommonUtility.HandleException(HttpContext.Current.Request.Url.ToString(), ex); } }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_Load(object sender, EventArgs e) { try { trSiteMaintenance.Visible = false; if(!Page.IsPostBack) { /// Set Region Title SetRegionTitle(); objUtility = new CommonUtility(); txtUserAcc.Text = objUtility.GetUserName(); if(Request.QueryString["IsMaintenance"] != null) { if(Request.QueryString["IsMaintenance"].ToLowerInvariant().Equals("true")) { /// Display the Site Maintenace message trAccessApproval.Visible = false; trSiteMaintenance.Visible = true; lblSiteMaintenanceMessage.Text = PortalConfiguration.GetInstance().GetKey("SiteMaintenanceMessage"); this.Page.Title = lblRegionTitle.Text; } } else if(Request.QueryString["teamId"] != null) { lblTitle.Text = "Request Access for "; DataTable dtTeamDetail = new DataTable(); objMossController = objFactory.GetServiceManager("MossService"); dtTeamDetail = ((MOSSServiceManager)objMossController).ReadList( HttpContext.Current.Request.Url.ToString(), TEAMREGISTRATIONLIST, "<Where><Eq><FieldRef Name='ID'/><Value Type=\"Counter\">" + Request.QueryString["teamId"].ToString() + "</Value></Eq></Where>"); if(dtTeamDetail != null) { lblTeamName.Text = dtTeamDetail.Rows[0]["Title"].ToString(); hidTeamOwner.Value = dtTeamDetail.Rows[0]["TeamOwner"].ToString(); if(dtTeamDetail != null) dtTeamDetail.Dispose(); } } else { lblTitle.Text = "Access Approval Login"; lblTeamName.Visible = false; } txtRegion.Text = objUtility.GetUserDomain(); } } catch(WebException webEx) { //ExceptionPanel.Visible = true; //lblException.Visible = true; //lblException.Text = webEx.Message; } catch(Exception ex) { CommonUtility.HandleException(HttpContext.Current.Request.Url.ToString(), ex); } }
/// <summary> /// Gets the CAML query for BO users. /// </summary> /// <param name="strSiteURL">The STR site URL.</param> /// <param name="columName">Name of the column.</param> /// <param name="columnType">Type of the column.</param> /// <param name="terminated">The terminated status.</param> /// <returns>CAML query for BO users.</returns> public string GetCAMLQueryForBOUsers(string strSiteURL, string columName, string columnType, string terminated,bool maintainBooks) { string strCamlQuery = string.Empty; objCommonUtility = new CommonUtility(); string strUserId = objCommonUtility.GetUserName(); DataTable dtUser = null; strCamlQuery = "<Where><Eq> <FieldRef Name='Windows_User_ID' /> <Value Type='Text'>" + strUserId + " </Value></Eq></Where>"; string strViewFields = @"<FieldRef Name='Windows_User_ID' /><FieldRef Name='ID' />"; dtUser = ReadList(strSiteURL, USERLIST, strCamlQuery, strViewFields); /// Get all the Team_IDs where User_ID = log in user id and Privileges Contains "RS"/"SY" from "DWB Team Staff" list /// From all the Team_IDs get the Teams from "DWB Team" list strCamlQuery = string.Empty; strViewFields = string.Empty; if (dtUser != null && dtUser.Rows.Count > 0) { strCamlQuery = @"<OrderBy><FieldRef Name='Team_ID' /></OrderBy> <Where> <Eq> <FieldRef Name='User_ID' /> <Value Type='Number'>" + dtUser.Rows[0]["ID"].ToString() + "</Value>" + "</Eq>" + "</Where>"; strViewFields = @"<FieldRef Name='Team_ID' /><FieldRef Name='User_ID' /><FieldRef Name='ID' />"; dtUser.Dispose(); } DataTable dtTeams = ReadList(strSiteURL, TEAMSTAFFLIST, strCamlQuery, strViewFields); strCamlQuery = string.Empty; StringBuilder sbTeamId = new StringBuilder(); #region DREAM 4.0- eWB 2.0 if (maintainBooks) { strCamlQuery = @" <OrderBy><FieldRef Name='Title' /></OrderBy><Where><And><Eq><FieldRef Name='Terminate_Status' /> <Value Type='Choice'>"+terminated +"</Value></Eq><Or><IsNull><FieldRef Name='ToBeDeleted' /></IsNull><Eq><FieldRef Name='ToBeDeleted' /><Value Type='Choice'>No</Value></Eq></Or></And></Where>"; } else { strCamlQuery = @"<OrderBy><FieldRef Name='Title' /></OrderBy><Where><Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>"+ terminated+"</Value></Eq></Where>"; } #endregion if (dtTeams != null && dtTeams.Rows.Count > 0) { for (int intRowIndex = 0; intRowIndex < dtTeams.Rows.Count; intRowIndex++) { sbTeamId.Append(Convert.ToString(dtTeams.Rows[intRowIndex]["Team_ID"])); sbTeamId.Append(";"); } strCamlQuery = CreateCamlQueryWithoutWhere(sbTeamId.ToString(), columName, columnType); sbTeamId.Remove(0, sbTeamId.Length); sbTeamId.Append(strCamlQuery); #region DREAM 4.0- eWB 2.0 if (maintainBooks) { //sbTeamId.Append("<Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>" + terminated + "</Value></Eq></And></Where>"); sbTeamId.Append("<And><Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>"+ terminated+"</Value></Eq><Or><IsNull><FieldRef Name='ToBeDeleted' /> </IsNull><Eq><FieldRef Name='ToBeDeleted' /><Value Type='Choice'>No</Value></Eq></Or></And></And></Where>"); sbTeamId.Insert(0, "<Where><And>"); } else { sbTeamId.Append("<Eq><FieldRef Name='Terminate_Status' /><Value Type='Choice'>" + terminated + "</Value></Eq></And></Where>"); sbTeamId.Insert(0, "<Where><And>"); } #endregion strCamlQuery = sbTeamId.ToString(); dtTeams.Dispose(); } return strCamlQuery; }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_Load(object sender, EventArgs e) { try { AbstractController objMossController = null; UserPreferences objUserPreferences = new UserPreferences(); ////Some time user enter the values in between the textbox like row1 textbox and row 5 textbox, before populate the value to table, clean up the textbox value. drpWellbore.Attributes.Add("onChange", "javascript:ClearAllRows(this)"); #region if Wellbore dropdown value changed, need to populate Depthrefece value country value to Dropdown and Label control CommonUtility objCommonUtility = new CommonUtility(); ServiceProvider objFactory = new ServiceProvider(); objReportController = objFactory.GetServiceManager(ServiceName.ToString()); objMossController = objFactory.GetServiceManager(MOSSSERVICE); string strUserId = objCommonUtility.GetUserName(); //reads the user preferences. objUserPreferences = ((MOSSServiceManager)objMossController).GetUserPreferencesValue(strUserId, strCurrSiteUrl); CommonUtility.SetSessionVariable(Page, enumSessionVariable.UserPreferences.ToString(), objUserPreferences); object objSessionUserPreference = CommonUtility.GetSessionVariable(Page, enumSessionVariable.UserPreferences.ToString()); if (objSessionUserPreference != null) objUserPreferences = (UserPreferences)objSessionUserPreference; strDepthUnit = objUserPreferences.DepthUnits; if (rdoDepthUnitsFeet.Checked != true && rdoDepthUnitsMetres.Checked != true) { if (string.Equals(strDepthUnit, METRES)) { rdoDepthUnitsMetres.Checked = true; } else if (string.Equals(strDepthUnit, FEET)) { rdoDepthUnitsFeet.Checked = true; } } if (rdoDepthUnitsFeet.Checked) { strFeetMetre = "(ft)"; } if (rdoDepthUnitsMetres.Checked) { strFeetMetre = "(m)"; } //Used to display the selected value to drpdepthReference Dropdown. FillDepthrefSelectedValue(); if((objUtility.GetPostBackControl(this.Page) != null) && (string.Equals(objUtility.GetPostBackControl(this.Page).ID, "drpWellbore"))) { try { rdoDepthUnitsFeet.Checked = true; objRequestInfo = SetDataObject(Default); xmlDocSearchResultAHTVD = objReportController.GetSearchResults(objRequestInfo, intMaxRecord, strAHTVCALCULATOR, null, intSortOrder); FillCountryDetails(xmlDocSearchResultAHTVD); Session["xmlDocSearchResultAHTVD"] = null; Session["xmlDocSearchResultAHTVD"] = xmlDocSearchResultAHTVD.OuterXml; objRequestInfo = null; objRequestInfo = SetDataObject(Default); xmlDocSearchResultDepthRef = objReportController.GetSearchResults(objRequestInfo, intMaxRecord, strMECHANICALDATADEPTHREF, null, intSortOrder); Session["xmlDocSearchResultDepthRef"] = null; Session["xmlDocSearchResultDepthRef"] = xmlDocSearchResultDepthRef.OuterXml; FilldrpDepthReference(xmlDocSearchResultDepthRef); FillDepthrefSelectedValue(); } catch { pnlTable.Visible = false; pnlTableErrorMessage.Visible = true; lblTableErrorMessage.Visible = true; } } #endregion int intCount = tblConvertRows.Rows.Count - 2; // Thease session variables are used to display the values into First row first col, last row first column of the HTML tables in non-editable mode. if (Session["TopDepth"] != null && Session["BottomDepth"] != null) { //Assign always Topdepth values into First textbox, and Bottom values into last text box, thease values are coming webservice. TextBox txtAHDepth0 = (TextBox)tblConvertRows.Rows[0].Cells[0].FindControl("txtAHDepth0"); txtAHDepth0.Text = Convert.ToDouble(Session["TopDepth"].ToString()).ToString(("#0.00")); TextBox txtAHDepthMax = (TextBox)tblConvertRows.Rows[intCount].Cells[0].FindControl("txtAHDepth" + intCount); txtAHDepthMax.Text = Convert.ToDouble(Session["BottomDepth"].ToString()).ToString(("#0.00")); TextBox lblAHDepth0 = (TextBox)tblConvertRows.Rows[0].Cells[1].FindControl("lblAHDepth0"); Decimal decTxtAHDepth0 = Convert.ToDecimal(txtAHDepth0.Text.ToString()); Decimal decTxtAHDepthMax = Convert.ToDecimal(txtAHDepthMax.Text.ToString()); Decimal decHndDrpValue = Convert.ToDecimal(Session["hidDrpDepthRefValue"].ToString()); //*added by Dev decHndDrpValue = ConvertFeetMetre(decHndDrpValue, hidDepthRefDefaultUnit.Value); // used to display with 2 digit, eg : 52.00 //Bydefault need to display calculated values to 1 rows 2 columns and last row 2 columns. // (0.00 - Depth Reference (DF,BF,etc...) lblAHDepth0.Text = Convert.ToString(Math.Round(Convert.ToDecimal(Convert.ToDouble(decTxtAHDepth0) - Convert.ToDouble(decHndDrpValue)), 2).ToString("#0.00")).ToString(); TextBox lblAHDepthMax = (TextBox)tblConvertRows.Rows[intCount].Cells[1].FindControl("lblAHDepth" + intCount); lblAHDepthMax.Text = Convert.ToString(Math.Round(Convert.ToDecimal(Convert.ToDouble(decTxtAHDepthMax) - Convert.ToDouble(decHndDrpValue)), 2).ToString("#0.00")).ToString(); } } catch (SoapException soapEx) { if (!string.Equals(soapEx.Message, SOAPEXCEPTIONMESSAGE)) { CommonUtility.HandleException(strCurrSiteUrl, soapEx, 1); } RenderExceptionMessage(soapEx.Message); } catch (WebException webEx) { CommonUtility.HandleException(HttpContext.Current.Request.Url.ToString(), webEx, 1); RenderExceptionMessage(webEx.Message); } catch (Exception ex) { CommonUtility.HandleException(HttpContext.Current.Request.Url.ToString(), ex); } finally { objUtility.CloseBusyBox(this.Page); } }
/// <summary> /// Page_s the init. /// </summary> protected void Page_Init() { #region Page_init try { pnlSoapError.Visible = false; lblErrorMessage.Visible = false; pnlConverterContent.Visible = true; btn_goBack.Visible = false; pnlTable.Visible = true; pnlTableErrorMessage.Visible = false; lblTableErrorMessage.Visible = false; objUtility = new CommonUtility(); objUtility.RenderBusyBox(this.Page); if (HttpContext.Current.Request.Form["hidSelectedRows"] != null) { //This session values is assigned into AHDTVDPopup.ascx / TVDepthPopup.ascx Session.Remove("DepthValues"); Session.Remove("tblConvertsRowsCount"); Session.Remove("xmlDocSearchResultWellBore"); Session.Remove("TopDepth"); Session.Remove("BottomDepth"); Session.Remove("xmlDocSearchResultAHTVD"); Session.Remove("xmlDocSearchResultDepthRef"); Session.Remove("hidDrpDepthRefValue"); } tblConvertRows.EnableViewState = true; //**added of dev CommonUtility objCommonUtility = new CommonUtility(); ServiceProvider objFactory = new ServiceProvider(); objReportController = objFactory.GetServiceManager(ServiceName.ToString()); objMossController = objFactory.GetServiceManager(MOSSSERVICE); string strUserId = objCommonUtility.GetUserName(); //reads the user preferences. objUserPreferences = ((MOSSServiceManager)objMossController).GetUserPreferencesValue(strUserId, strCurrSiteUrl); CommonUtility.SetSessionVariable(Page, enumSessionVariable.UserPreferences.ToString(), objUserPreferences); object objSessionUserPreference = CommonUtility.GetSessionVariable(Page, enumSessionVariable.UserPreferences.ToString()); if (objSessionUserPreference != null) objUserPreferences = (UserPreferences)objSessionUserPreference; strDepthUnit = objUserPreferences.DepthUnits; if (rdoDepthUnitsFeet.Checked != true && rdoDepthUnitsMetres.Checked != true) { if (string.Equals(strDepthUnit, METRES)) { rdoDepthUnitsMetres.Checked = true; } else if (string.Equals(strDepthUnit, FEET)) { rdoDepthUnitsFeet.Checked = true; } } //**end //Used to set the tab index for AH and TV textbox only. if (hdnTabIndex != null) { if (string.IsNullOrEmpty(hdnTabIndex.Value.ToString())) { hdnTabIndex.Value = "1"; } } if (Session["tblConvertsRowsCount"] == null) { GenerateRows(intMinRowLength, intMaxRowlength, strtblWithHeaderRow); } else { GenerateRows(intMinRowLength, intMaxRowlength, strtblWithHeaderRow); GenerateRows(intMaxRowlength, Convert.ToInt32(Session["tblConvertsRowsCount"].ToString()), strtblWithOutHeaderRow); } objReportController = objFactory.GetServiceManager(ServiceName.ToString()); //Fill Wellbore name into Wellbore Dropdown #region populate wellbore name if (Session["xmlDocSearchResultWellBore"] == null) { objRequestInfo = SetDataObject(strUWBI); xmlDocSearchResultWellBore = objReportController.GetSearchResults(objRequestInfo, intMaxRecord, strWELLBORE, SORTCOLUMN, intSortOrder); FilldrpWellboreName(xmlDocSearchResultWellBore); Session["xmlDocSearchResultWellBore"] = xmlDocSearchResultWellBore.OuterXml; objRequestInfo = null; } else { XmlDocument xmlResponse = new XmlDocument(); xmlResponse.LoadXml((string)Session["xmlDocSearchResultWellBore"]); FilldrpWellboreName(xmlResponse); objRequestInfo = null; } #endregion //Fill Wellbore depth reference when Wellbore name is selected. #region Populate Wellbore Depth Reference. if (Session["xmlDocSearchResultDepthRef"] == null) { objRequestInfo = SetDataObject(Default); xmlDocSearchResultDepthRef = objReportController.GetSearchResults(objRequestInfo, intMaxRecord, strMECHANICALDATADEPTHREF, null, intSortOrder); hidDepthRefDefaultUnit.Value = GetMeasurementUnit(xmlDocSearchResultDepthRef.SelectNodes("response/report/record[1]/attribute[@name='depth_reference_elevation']")[0]); FilldrpDepthReference(xmlDocSearchResultDepthRef); Session["xmlDocSearchResultDepthRef"] = xmlDocSearchResultDepthRef.OuterXml; objRequestInfo = null; } else { XmlDocument xmlResponse = new XmlDocument(); xmlResponse.LoadXml((string)Session["xmlDocSearchResultDepthRef"]); hidDepthRefDefaultUnit.Value = GetMeasurementUnit(xmlResponse.SelectNodes("response/report/record[1]/attribute[@name='depth_reference_elevation']")[0]); FilldrpDepthReference(xmlResponse); } #endregion #region Display Country Details. if (Session["xmlDocSearchResultAHTVD"] == null) { objRequestInfo = SetDataObject(Default); xmlDocSearchResultAHTVD = objReportController.GetSearchResults(objRequestInfo, intMaxRecord, strAHTVCALCULATOR, null, intSortOrder); FillCountryDetails(xmlDocSearchResultAHTVD); Session["xmlDocSearchResultAHTVD"] = xmlDocSearchResultAHTVD.OuterXml; objRequestInfo = null; } else { XmlDocument xmlResponse = new XmlDocument(); xmlResponse.LoadXml((string)Session["xmlDocSearchResultAHTVD"]); FillCountryDetails(xmlResponse); } #endregion inttblCount = tblConvertRows.Rows.Count; //Populate Top & Bottom Depths value from Popup Window # region Top & Bottom Depths values to Table if (Session["DepthValues"] != null) { strDepthValues = Session["DepthValues"].ToString(); arrDepthval = strDepthValues.Split('|'); dblTopDepth = Convert.ToDouble(arrDepthval[0].ToString()); dblBottomDepth = Convert.ToDouble(arrDepthval[1].ToString()); intDepthInterval = Convert.ToInt32(arrDepthval[2].ToString()); strDepthname = arrDepthval[3].ToString(); //used to find the no of rows to be create in the HTML table. int index = Convert.ToInt32(Math.Ceiling(Math.Round(((dblBottomDepth - dblTopDepth) / intDepthInterval), 2))); index = index + 3; if (index < inttblCount) { //if index count is <=10, then no need to create extra rows, by default 10 rows will be there. FillDepthValues(dblTopDepth, dblBottomDepth, intDepthInterval, index, strDepthname, drpDepthReference.SelectedItem.Value); } else { // if index count is >=10, then need to add new rows into HTML table. GenerateRows(intMaxRowlength, index, strtblWithOutHeaderRow); FillDepthValues(dblTopDepth, dblBottomDepth, intDepthInterval, index, strDepthname, drpDepthReference.SelectedItem.Value); } } #endregion SetCSSforEditableAHTVdepth(); } catch (SoapException soapEx) { if (!string.Equals(soapEx.Message, SOAPEXCEPTIONMESSAGE)) { CommonUtility.HandleException(strCurrSiteUrl, soapEx, 1); } RenderExceptionMessage(soapEx.Message); } catch (WebException webEx) { CommonUtility.HandleException(HttpContext.Current.Request.Url.ToString(), webEx, 1); RenderExceptionMessage(webEx.Message); } catch (Exception ex) { CommonUtility.HandleException(HttpContext.Current.Request.Url.ToString(), ex); } #endregion }
/// <summary> /// Gets the user priviledges from the list. /// </summary> protected DWBDataObjects.Privileges GetUserPrivileges() { AdminBLL objAdminBLL = new AdminBLL(); DWBDataObjects.Privileges objPrivileges; CommonUtility objUtility = new CommonUtility(); string strUserId = objUtility.GetUserName(); DataTable dtSystemPrivileges = objAdminBLL.GetDWBPrivileges(strParentSiteURL, strUserId, USERSESSIONSYSTEMPRIVILEGES); if (dtSystemPrivileges != null) { objPrivileges = objAdminBLL.SetPrivilegesObjects(strParentSiteURL, dtSystemPrivileges); } else { objPrivileges = new DWBDataObjects.Privileges(); objPrivileges.IsNonDWBUser = true; } if (dtSystemPrivileges != null) { dtSystemPrivileges.Dispose(); } return objPrivileges; }
/// <summary> /// Gets the list of items based on the CAML query and the fields to view. /// </summary> /// <param name="strListName"></param> /// <param name="strCamlQuery"></param> /// <param name="strFieldsView"></param> /// <returns></returns> protected void UpdateListItemSequence(string strListName, DataView dvUpdatedListItem, string strAuditListName, string strActionPerformed, string pageType) { CommonUtility objCommonUtility; ; try { switch (pageType) { case MASTERPAGE: case CHAPTERPAGEMAPPING: objMasterBLL = new MasterPageBLL(); objMasterBLL.UpdatepageSequence(strParentSiteURL, strListName, strAuditListName, dvUpdatedListItem, strActionPerformed); break; case CHAPTER: objChapterBLL = new ChapterBLL(); objCommonUtility = new CommonUtility(); objChapterBLL.UpdateChapterSequence(strParentSiteURL, strListName, strAuditListName, dvUpdatedListItem, strActionPerformed, objCommonUtility.GetUserName()); break; case TEMPLATEPAGESSEQUENCE: { objTemplateBLL = new TemplateDetailBLL(); objCommonUtility = new CommonUtility(); objTemplateBLL.UpdatePageSequence(strParentSiteURL, strListName, strAuditListName, strActionPerformed, objCommonUtility.GetUserName(), dvUpdatedListItem); break; } } } catch { throw; } }
/// <summary> /// Gets the user priviledges from the list. /// </summary> private Privileges GetUserPrivileges() { AdminBLL objMOSSService = new AdminBLL(); Privileges objPrivileges = null; CommonUtility objUtility = new CommonUtility(); string userId = objUtility.GetUserName(); DataTable dtSystemPrivileges = objMOSSService.GetDWBPrivileges(strParentSiteURL, userId, SYSTEMPRIVILEGES); if (dtSystemPrivileges != null ) { objPrivileges = objMOSSService.SetPrivilegesObjects(strParentSiteURL, dtSystemPrivileges); } else { objPrivileges = new Privileges(); objPrivileges.IsNonDWBUser = true; } if (dtSystemPrivileges != null) { dtSystemPrivileges.Dispose(); } return objPrivileges; }
/// <summary> /// Loads the chapter preference. /// If the preference Xml for the logged in user and selected book is available in document library it loads from Doc List. /// Else create the fresh xml for the selected book and stores in Session. /// </summary> /// <param name="wellBookDetails">The well book details.</param> /// <param name="bookID">The book ID.</param> /// <returns>XmlDocument</returns> private XmlDocument LoadChapterPreference(XmlDocument wellBookDetails, string bookID) { XmlDocument chapterPreferenceXml=null; CommonUtility objCommonUtility = new CommonUtility(); AbstractController objMOSSController; ServiceProvider objFactory; objFactory = new ServiceProvider(); objMOSSController = objFactory.GetServiceManager(MOSSSERVICE); /// If any postback happens, the preference will be loaded from Session if (Page.IsPostBack && HttpContext.Current.Session[CHAPTERPREFERENCEXML] != null) { string strChapterXml = (string)HttpContext.Current.Session[CHAPTERPREFERENCEXML]; if (!string.IsNullOrEmpty(strChapterXml)) { chapterPreferenceXml = new XmlDocument(); chapterPreferenceXml.LoadXml(strChapterXml); } } else { /// Otherwise preferences will be loaded from Doc Lib or created newly if (((MOSSServiceManager)objMOSSController).IsDocLibFileExist(CHAPTERPREFERENCEDOCLIB, objCommonUtility.GetUserName())) { XmlDocument savedChapterPreferenceXml = ((MOSSServiceManager)objMOSSController).GetDocLibXMLFile(CHAPTERPREFERENCEDOCLIB, objCommonUtility.GetUserName()); string strXPath = "/Books/BookInfo[@BookID='" + HttpContext.Current.Request.QueryString[QUERYSTRING_BOOKID] +"']"; XmlNode bookInfoXml = savedChapterPreferenceXml.SelectSingleNode(strXPath); if (bookInfoXml != null && bookInfoXml.ChildNodes.Count > 0) { chapterPreferenceXml = new XmlDocument(); chapterPreferenceXml.LoadXml(bookInfoXml.OuterXml); /// Compare the User Preference with wellbookXML and add/remove the chapter nodes to the xml based on /// If a chapter node available in preference xml but not in wellbookxml means either the chapter is deleted/terminated/contains no page so, not visible in treeview, remove such chapters from preference xml and save it back to Doc Lib. /// If a chapter node not available in preference xml but available in wellbookxml means either the chapter is activated/added pages/newly added. Add such chapters with display=true to preference xml and the begining and save to Doc Lib. AddRemoveChapterNodes(wellBookDetails, chapterPreferenceXml); } else { chapterPreferenceXml = CreateChapterListXml(wellBookDetails); } } else { chapterPreferenceXml = CreateChapterListXml(wellBookDetails); } if (chapterPreferenceXml != null) { HttpContext.Current.Session.Remove(CHAPTERPREFERENCEXML); HttpContext.Current.Session[CHAPTERPREFERENCEXML] = chapterPreferenceXml.OuterXml; } } return chapterPreferenceXml; }
/// Updating the Discipline column is added. /// discipline parameter is added for the same. /// <summary> /// Updates the Page Owner details. /// </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 UpdatePageOwner(string siteURL, ListEntry listEntry, string listName, string auditListName, string userName, string actionPerformed,string discipline) { SPList list; SPQuery query; SPListItem objListItem; SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite(siteURL)) { using (SPWeb web = site.OpenWeb()) { web.AllowUnsafeUpdates = true; list = web.Lists[listName]; query = new SPQuery(); for (int intIndex = 0; intIndex < listEntry.ChapterPagesMapping.Count; intIndex++) { objListItem = list.GetItemById(listEntry.ChapterPagesMapping[intIndex].RowId); objListItem["Owner"] = userName; #region DREAM 4.0 - eWB 2.0 - Change discipline when page owner changed objListItem["Discipline"] = discipline; #endregion objListItem.Update(); } web.AllowUnsafeUpdates = false; objCommonDAL = new CommonDAL(); for (int intIndex = 0; intIndex < listEntry.ChapterPagesMapping.Count; intIndex++) { /// userName contains the value of new page owner selected. /// Instead of new page owner, current login user name should be used for audit history. /// Fix is applied. userName = string.Empty; CommonUtility objCommonUtility = new CommonUtility(); userName = objCommonUtility.GetUserName(); objCommonDAL.UpdateListAuditHistory(siteURL, auditListName, listEntry.ChapterPagesMapping[intIndex].RowId, userName, actionPerformed); } } } }); }
/// <summary> /// Called by the ASP.NET page framework to notify server controls /// that use composition-based implementation to create any child controls they contain /// in preparation for posting back or rendering. /// </summary> protected override void CreateChildControls() { base.CreateChildControls(); try { objCommonUtility = new CommonUtility(); objMOSSController = objFactory.GetServiceManager("MossService"); strUserName = objCommonUtility.GetUserName(); Permission = objCommonUtility.GetTeamPermission(HttpContext.Current.Request.Url.ToString()); CreateViewerControls(); } catch (Exception ex) { CommonUtility.HandleException(HttpContext.Current.Request.Url.ToString(), ex); } }
/// <summary> /// Signs the off page. /// </summary> /// <param name="siteURL">The site URL.</param> /// <param name="listName">Name of the list.</param> /// <param name="id">The id.</param> /// <param name="auditListName">Name of the audit list.</param> /// <param name="signOffStatus">if set to <c>true</c> [sign off status].</param> public void SignOffPage(string siteURL, string listName, string rowId, string auditListName, bool signOffStatus) { objCommonDAL = new CommonDAL(); objCommonUtility = new CommonUtility(); if (signOffStatus) objCommonDAL.SignOffStatusUpdate(siteURL, listName, Convert.ToInt32(rowId), YES, auditListName, objCommonUtility.GetUserName(), AUDIT_ACTION_SIGNEDOFF); else objCommonDAL.SignOffStatusUpdate(siteURL, listName, Convert.ToInt32(rowId), NO, auditListName, objCommonUtility.GetUserName(), AUDIT_ACTION_UNSIGNEDOFF); }
/// <summary> /// To get logged in User Name /// </summary> /// <returns></returns> private string GetUserName() { Shell.SharePoint.DREAM.Utilities.CommonUtility objCommonUtility = new Shell.SharePoint.DREAM.Utilities.CommonUtility(); string strUserName = objCommonUtility.GetUserName(); return strUserName; }
/// <summary> /// Activates the List items /// </summary> /// <param name="siteUrl">The site URL.</param> /// <param name="listName">Name of the list.</param> /// <param name="rowID">The row ID.</param> /// <param name="auditlistName">Name of the auditlist.</param> /// <param name="actionPeformed">The action peformed.</param> /// <param name="itemStatus">The item status.</param> /// <param name="sequenceField">The sequence field.</param> public void UpdateListItemStatus(string siteUrl, string listName, int rowID, string auditlistName, string actionPeformed, string itemStatus, string sequenceField) { objCommonDAL = new CommonDAL(); objCommonUtility = new CommonUtility(); objCommonDAL.ListItemStatusUpdate(siteUrl, listName, rowID, itemStatus, auditlistName, objCommonUtility.GetUserName(), actionPeformed, sequenceField); }
/// <summary> /// Gets the name of the user. /// </summary> /// <returns></returns> public string GetUserName() { string strUserName = string.Empty; objCommonUtility = new CommonUtility(); strUserName = objCommonUtility.GetUserName(); return strUserName; }
/// <summary> /// To Update Batch Import Audit History /// </summary> /// <param name="siteURL"></param> /// <param name="bookID"></param> /// <param name="actionPerformed"></param> public void UpdateBatchImportAuditHistory(string siteURL, string bookID, string actionPerformed) { objCommonDAL = new CommonDAL(); Shell.SharePoint.DREAM.Utilities.CommonUtility objCommonUtility = new Shell.SharePoint.DREAM.Utilities.CommonUtility(); string strUserName = objCommonUtility.GetUserName(); objCommonDAL.UpdateBatchImportAuditHistory(siteURL, DWBWELLBOOKAUDITLIST, bookID, strUserName, actionPerformed); }