/// <summary> /// Updates the page owners /// </summary> /// <param name="siteURL">Site URL.</param> /// <param name="listEntry">ListEntry object.</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 UpdatePageOwner(string siteURL, ListEntry listEntry, string auditListName, string listName, string userName, string actionPerformed) { StringBuilder strPageId = new StringBuilder(); objWellBookDAL = new WellBookDAL(); objCommonBLL = new CommonBLL(); objCommonDAL = new CommonDAL(); string strCAMLQuery = string.Empty; #region DREAM 4.0 - eWB2.0 - Change discipline when page owner is changed strCAMLQuery = string.Format(@"<Where><Eq><FieldRef Name='Windows_User_ID' /><Value Type='Text'>{0}</Value></Eq></Where>", userName); string strViewFields = @"<FieldRef Name='Windows_User_ID' /><FieldRef Name='ID' /><FieldRef Name='Discipline' /><FieldRef Name='Privileges' /><FieldRef Name='DWBUserName' />"; DataTable dtUserDetails = null; string strDiscipline = string.Empty; dtUserDetails = objCommonDAL.ReadList(siteURL, DWBUSER, strCAMLQuery, strViewFields); if (dtUserDetails != null && dtUserDetails.Rows.Count > 0) { strDiscipline = Convert.ToString(dtUserDetails.Rows[0][DISCIPLINECOLUMN]); } #endregion objWellBookDAL.UpdatePageOwner(siteURL, listEntry, listName, auditListName, userName, actionPerformed,strDiscipline); for (int intRowIndex = 0; intRowIndex < listEntry.ChapterPagesMapping.Count; intRowIndex++) { strPageId.Append(listEntry.ChapterPagesMapping[intRowIndex].RowId); strPageId.Append(";"); } strCAMLQuery = objCommonBLL.CreateCAMLQuery(strPageId.ToString(), "Page_ID", "Number"); objWellBookDAL.UpdatePageOwner(siteURL, strCAMLQuery, DWBSTORYBOARD, userName); #region DREAM 4.0 - eWB2.0 - Change discipline when page owner is changed /// Update the "Disciplie" column for selected Page_IDs in DWB Story Board list strViewFields = @"<FieldRef Name='ID' /><FieldRef Name='Discipline' /><FieldRef Name='Page_ID' />"; objCommonDAL.UpdateListItem(siteURL, DWBSTORYBOARD,DISCIPLINECOLUMN, Microsoft.SharePoint.SPFieldType.Text, strDiscipline, strCAMLQuery, strViewFields); /// Update the "Disciplie" column for selected Page_IDs in DWB Comments list objCommonDAL.UpdateListItem(siteURL, DWBCOMMENT, DISCIPLINECOLUMN, Microsoft.SharePoint.SPFieldType.Text, strDiscipline, strCAMLQuery, strViewFields); #endregion }
public void UpdateListItem(string siteURL, string listName, string fieldName, Microsoft.SharePoint.SPFieldType fieldType, string fieldValue, string camlQuery, string viewFields) { objCommonDAL = new CommonDAL(); objCommonDAL.UpdateListItem(siteURL, listName, fieldName, fieldType, fieldValue, camlQuery, viewFields); }