/// <summary> /// Returns the SPWeb object that is associated with the current context. /// </summary> /// <returns></returns> private SPWeb GetDocumentStoreWeb(out SPSite site) { if (SPHelper.IsElevated()) { if (m_elevatedDocumentStoreWeb == null) { lock (m_syncRoot) { if (m_elevatedDocumentStoreWeb == null) { m_elevatedDocumentStoreSite = new SPSite(DocumentStoreUrl, SPBaristaContext.Current.Site.UserToken); m_elevatedDocumentStoreWeb = m_elevatedDocumentStoreSite.OpenWeb(); } } } site = m_elevatedDocumentStoreSite; return(m_elevatedDocumentStoreWeb); } if (m_documentStoreWeb == null) { lock (m_syncRoot) { if (m_documentStoreWeb == null) { m_documentStoreSite = new SPSite(DocumentStoreUrl, SPBaristaContext.Current.Site.UserToken); m_documentStoreWeb = m_documentStoreSite.OpenWeb(); } } } site = m_documentStoreSite; return(m_documentStoreWeb); }
public static void Delete(int id) { SqlConnection connection = new SqlConnection(SPHelper.GetConnectionString()); try { connection.Open(); SqlTransaction trans = null; try { trans = connection.BeginTransaction(); Delete(trans, id); trans.Commit(); } catch (Exception) { if (trans != null) { trans.Rollback(); } throw; } } finally { connection.Close(); } }
public void RemoveGroup(object group) { if (group == Undefined.Value || group == Null.Value || group == null) { throw new JavaScriptException(this.Engine, "Error", "First argument contain either a group instance or a group name."); } SPGroup groupToRemove; if (group is SPGroupInstance) { var spGroup = group as SPGroupInstance; groupToRemove = spGroup.Group; } else { var groupName = TypeConverter.ToString(group); SPGroup spGroup; if (SPHelper.TryGetSPGroupFromGroupName(groupName, out spGroup) == false) { throw new JavaScriptException(this.Engine, "Error", "A group with the specified name does not exist."); } groupToRemove = spGroup; } RemovePrincipal(groupToRemove); }
public static List <DocumentComment> GetList(int documentId) { List <DocumentComment> comments = new List <DocumentComment>(); DataTable dcTable = SPHelper.ExecuteDataset(SpNames.List, documentId).Tables[0]; foreach (DataRow row in dcTable.Rows) { DocumentComment comment = new DocumentComment(); comment.ID = (int)row["DocumentCommentID"]; comment.DocumentID = (int)row["DocumentID"]; comment.WorkerID = (int)row["WorkerID"]; comment.BehalfWorkerID = (int)row["BehalfWorkerID"]; comment.Content = row["Content"].ToString(); comment.DocumentCommentTypeID = (int)row["DocumentCommentTypeID"]; comment.ControlCardID = row["ControlCardID"] == DBNull.Value ? null : (int?)row["ControlCardID"]; comment.ParentDocumentCommentID = row["ParentDocumentCommentID"] == DBNull.Value ? null : (int?)row["ParentDocumentCommentID"]; comment.CreateDate = (DateTime)row["CreateDate"]; comment.LastUpdateDate = (DateTime)row["LastUpdateDate"]; Worker worker = new Worker(); worker.ID = comment.WorkerID; worker.FirstName = row["WorkerFirstName"].ToString(); worker.LastName = row["WorkerLastName"].ToString(); worker.MiddleName = row["WorkerMiddleName"].ToString(); comment.Worker = worker; comments.Add(comment); } return(comments); }
public int Insert(SqlTransaction trans) { if (!CanInsert(UserName)) { throw new AccessException(UserName, "Insert"); } SqlParameter[] prms = new SqlParameter[2]; prms[0] = new SqlParameter("@QuestionTypeID", SqlDbType.Int); prms[0].Direction = ParameterDirection.Output; prms[1] = new SqlParameter("@Name", SqlDbType.NVarChar, 100); prms[1].Value = Name; if (trans == null) { SPHelper.ExecuteNonQuery(SpNames.Insert, prms); } else { SPHelper.ExecuteNonQuery(trans, SpNames.Insert, prms); } ID = (int)prms[0].Value; return(ID); }
public int Insert(SqlTransaction trans) { if (!CanInsert(UserName)) { throw new AccessException(UserName, "Insert"); } SqlParameter[] prms = new SqlParameter[3]; prms[0] = new SqlParameter("@SocialCategoryListID", SqlDbType.Int); prms[0].Direction = ParameterDirection.Output; prms[1] = new SqlParameter("@CitizenID", SqlDbType.Int); prms[1].Value = CitizenID; prms[2] = new SqlParameter("@SocialCategoryID", SqlDbType.Int); prms[2].Value = SocialCategoryID; if (trans == null) { SPHelper.ExecuteNonQuery(SpNames.Insert, prms); } else { SPHelper.ExecuteNonQuery(trans, SpNames.Insert, prms); } ID = (int)prms[0].Value; return(ID); }
private void Init(SqlTransaction trans, int socialCategoryListID) { if (!CanView(UserName)) { throw new AccessException(UserName, "Init"); } SqlParameter[] prms = new SqlParameter[3]; prms[0] = new SqlParameter("@SocialCategoryListID", SqlDbType.Int); prms[0].Value = socialCategoryListID; prms[1] = new SqlParameter("@CitizenID", SqlDbType.Int); prms[1].Direction = ParameterDirection.Output; prms[2] = new SqlParameter("@SocialCategoryID", SqlDbType.Int); prms[2].Direction = ParameterDirection.Output; if (trans == null) { SPHelper.ExecuteNonQuery(SpNames.Get, prms); } else { SPHelper.ExecuteNonQuery(trans, SpNames.Get, prms); } ID = socialCategoryListID; CitizenID = (int)prms[1].Value; SocialCategoryID = (int)prms[2].Value; }
public void Update(SqlTransaction trans) { if (!CanUpdate(UserName)) { throw new AccessException(UserName, "Update"); } SqlParameter[] prms = new SqlParameter[5]; prms[0] = new SqlParameter("@PostID", SqlDbType.Int); prms[0].Value = ID; prms[1] = new SqlParameter("@Name", SqlDbType.NVarChar, -1); prms[1].Value = Name; prms[2] = new SqlParameter("@DepartmentID", SqlDbType.Int); prms[2].Value = DepartmentID; prms[3] = new SqlParameter("@IsVacant", SqlDbType.Bit); prms[3].Value = IsVacant; prms[4] = new SqlParameter("@PostTypeID", SqlDbType.Int); prms[4].Value = PostTypeID; if (trans == null) { SPHelper.ExecuteNonQuery(StoredProcedures.UpdatePost, prms); } else { SPHelper.ExecuteNonQuery(trans, StoredProcedures.UpdatePost, prms); } }
public static IEnumerable <Post> GetPosts(Post postFilter) { IEnumerable <Post> posts; SqlConnection connection = new SqlConnection(SPHelper.GetConnectionString()); try { connection.Open(); SqlTransaction trans = null; try { trans = connection.BeginTransaction(); posts = GetPosts(trans, postFilter); trans.Commit(); } catch (Exception) { if (trans != null) { trans.Rollback(); } throw; } } finally { connection.Close(); } return(posts); }
public static DataTable GetPage(SqlTransaction trans, PageSettings pageSettings, string userName, int departmentID) { SqlParameter[] sps = new SqlParameter[5]; sps[0] = new SqlParameter("@DepartmentID", SqlDbType.Int); sps[0].Value = departmentID; sps[1] = new SqlParameter("@LastName", SqlDbType.NVarChar, 50); sps[1].Value = pageSettings.Where.HasRule("LastName") ? pageSettings.Where.GetRule("LastName").Data : String.Empty; sps[2] = new SqlParameter("@FirstName", SqlDbType.NVarChar, 50); sps[2].Value = pageSettings.Where.HasRule("FirstName") ? pageSettings.Where.GetRule("FirstName").Data : String.Empty; sps[3] = new SqlParameter("@MiddleName", SqlDbType.NVarChar, 50); sps[3].Value = pageSettings.Where.HasRule("MiddleName") ? pageSettings.Where.GetRule("MiddleName").Data : String.Empty; sps[4] = new SqlParameter("@PostName", SqlDbType.NVarChar, 256); sps[4].Value = pageSettings.Where.HasRule("PostName") ? pageSettings.Where.GetRule("PostName").Data : String.Empty; DataTable dt = SPHelper.ExecuteDataset(trans, "usp_Worker_List", sps).Tables[0]; pageSettings.TotalRecords = dt.Rows.Count; return(dt); }
public static int GetPostID(SqlTransaction trans, int workerId) { SqlParameter[] prms = new SqlParameter[6]; prms[0] = new SqlParameter("@WorkerID", SqlDbType.Int); prms[0].Value = workerId; prms[1] = new SqlParameter("@FirstName", SqlDbType.NVarChar, 50); prms[1].Direction = ParameterDirection.Output; prms[2] = new SqlParameter("@MiddleName", SqlDbType.NVarChar, 50); prms[2].Direction = ParameterDirection.Output; prms[3] = new SqlParameter("@LastName", SqlDbType.NVarChar, 50); prms[3].Direction = ParameterDirection.Output; prms[4] = new SqlParameter("@PostID", SqlDbType.Int); prms[4].Direction = ParameterDirection.Output; prms[5] = new SqlParameter("@IsDismissed", SqlDbType.Bit); prms[5].Direction = ParameterDirection.Output; if (trans == null) { SPHelper.ExecuteNonQuery(SpNames.Get, prms); } else { SPHelper.ExecuteNonQuery(trans, SpNames.Get, prms); } return((int)prms[4].Value); }
public override void Update(SqlTransaction trans) { base.Update(trans); SqlParameter[] prms = new SqlParameter[6]; prms[0] = new SqlParameter("@WorkerID", SqlDbType.Int); prms[0].Value = ID; prms[1] = new SqlParameter("@FirstName", SqlDbType.NVarChar, 50); prms[1].Value = FirstName; prms[2] = new SqlParameter("@MiddleName", SqlDbType.NVarChar, 50); prms[2].Value = MiddleName; prms[3] = new SqlParameter("@LastName", SqlDbType.NVarChar, 50); prms[3].Value = LastName; prms[4] = new SqlParameter("@PostID", SqlDbType.Int); prms[4].Value = PostID; prms[5] = new SqlParameter("@IsDismissed", SqlDbType.Bit); prms[5].Value = IsDismissed; if (trans == null) { SPHelper.ExecuteNonQuery(SpNames.Update, prms); } else { SPHelper.ExecuteNonQuery(trans, SpNames.Update, prms); } }
public async Task <ActionResult> ViewOutDoc(OutcomingMailboxViewModel model) { log.Info("- OutboxDocs - ViewOutDoc:"); try { var spContext = SharePointContextProvider.Current.GetSharePointContext(HttpContext); if (model.TempFile != null) { log.Info("Tiene archivo adjunto"); var prefix = model.DBModel.RequestStatus == "Generado" ? "DOC-" : "REC-"; var spHelper = new SPHelper(); if (model.DBModel.RequestStatus == "Generado") { model.DBModel.DocumentFilename = spHelper.UploadSPFile(spContext, model.TempFile, model.DBModel.DocumentFolder, model.DBModel.SiteUrl, prefix); log.Info(model.DBModel.DocumentFilename); } else { model.DBModel.ReceiptFilename = spHelper.UploadSPFile(spContext, model.TempFile, model.DBModel.DocumentFolder, model.DBModel.SiteUrl, prefix); log.Info(model.DBModel.ReceiptFilename); } } var tmpSave = await helper.PostOutMailbox(model.DBModel); model.ConfirmMessage = "Se ha guardado su información."; log.Info("Se ha guardado: " + tmpSave.ToString()); } catch (Exception ex) { model.ErrorMessage = "Ocurrió un error al guardar su información."; log.Error(ex.ToString()); } return(View(model)); }
public int Insert(SqlTransaction trans) { if (!CanInsert(this.UserName)) { throw new AccessException(this.UserName, "Insert"); } AccessObject aObject = new AccessObject(ConstantCode.CONNECTION_STRING); aObject.Id = Guid.NewGuid(); aObject.Name = this._name; aObject.ObjectTypeId = ObjectTypeID; aObject.ObjectStateId = StateIDAll; this._objectID = aObject.Insert(trans); string spName = "usp_CityObjects_Insert"; CityObjectsParamsHelper helper = new CityObjectsParamsHelper(this); helper.InitParamsForSP(spName); SqlParameter[] parameters = helper.ParamList.Params; SPHelper.ExecuteNonQuery(trans, spName, parameters); helper.SetPropValues(); return(this._id); }
public static List <Department> GetList(SqlTransaction trans, string userName) { /*if (!CanView(userName)) * { * throw new AccessException(userName, "Get list"); * }*/ List <Department> dl = new List <Department>(); DataTable dt; if (trans == null) { dt = SPHelper.ExecuteDataset("usp_Department_List").Tables[0]; } else { dt = SPHelper.ExecuteDataset(trans, "usp_Department_List").Tables[0]; } foreach (DataRow dr in dt.Rows) { Department department = new Department(userName); department.ID = (int)dr["DepartmentID"]; department.Name = (string)dr["Name"]; department.ShortName = (string)dr["ShortName"]; department.ObjectID = (Guid)dr["ObjectID"]; dl.Add(department); } return(dl); }
public static int GetDepartmentID(SqlTransaction trans, int postId) { SqlParameter[] prms = new SqlParameter[5]; prms[0] = new SqlParameter("@PostID", SqlDbType.Int); prms[0].Value = postId; prms[1] = new SqlParameter("@Name", SqlDbType.NVarChar, 256); prms[1].Direction = ParameterDirection.Output; prms[2] = new SqlParameter("@DepartmentID", SqlDbType.Int); prms[2].Direction = ParameterDirection.Output; prms[3] = new SqlParameter("@IsVacant", SqlDbType.Bit); prms[3].Direction = ParameterDirection.Output; prms[4] = new SqlParameter("@PostTypeID", SqlDbType.Int); prms[4].Direction = ParameterDirection.Output; if (trans == null) { SPHelper.ExecuteNonQuery(StoredProcedures.GetPost, prms); } else { SPHelper.ExecuteNonQuery(trans, StoredProcedures.GetPost, prms); } return((int)prms[2].Value); }
public static Guid GetObjectID(SqlTransaction trans, int departmentId) { SqlParameter[] prms = new SqlParameter[5]; prms[0] = new SqlParameter("@DepartmentID", SqlDbType.Int); prms[0].Value = departmentId; prms[1] = new SqlParameter("@Name", SqlDbType.NVarChar, 100); prms[1].Direction = ParameterDirection.Output; prms[2] = new SqlParameter("@ShortName", SqlDbType.NVarChar, 50); prms[2].Direction = ParameterDirection.Output; prms[3] = new SqlParameter("@ObjectID", SqlDbType.UniqueIdentifier); prms[3].Direction = ParameterDirection.Output; prms[4] = new SqlParameter("@ParrentDepartmentID", SqlDbType.Int); prms[4].Direction = ParameterDirection.Output; if (trans == null) { SPHelper.ExecuteNonQuery(SpNames.Get, prms); } else { SPHelper.ExecuteNonQuery(trans, SpNames.Get, prms); } return((Guid)prms[3].Value); }
public static SPList GetLookupList(this SPFieldLookup lookupField, SPWeb lookupWeb) { SPList lookupList = null; if (lookupField != null) { SPList currentList = lookupField.ParentList; if (currentList != null) { SPWeb currentWeb = lookupField.ParentList.ParentWeb; if (lookupWeb == null) { lookupWeb = currentWeb; } if (SPHelper.IsGuid(lookupField.LookupList)) { Guid lookupListId = new Guid(lookupField.LookupList); lookupList = (lookupWeb.ID == currentWeb.ID && lookupListId == currentList.ID) ? currentList : lookupWeb.Lists[lookupListId]; } else { string lookupListTitle = lookupField.LookupList; lookupList = (lookupWeb.ID == currentWeb.ID && lookupListTitle == currentList.Title) ? currentList : lookupWeb.Lists[lookupListTitle]; } } } return(lookupList); }
public void Update(SqlTransaction trans) { if (!CanUpdate(UserName)) { throw new AccessException(UserName, "Update"); } SqlParameter[] prms = new SqlParameter[3]; prms[0] = new SqlParameter("@SocialCategoryListID", SqlDbType.Int); prms[0].Value = ID; prms[1] = new SqlParameter("@CitizenID", SqlDbType.Int); prms[1].Value = CitizenID; prms[2] = new SqlParameter("@SocialCategoryID", SqlDbType.Int); prms[2].Value = SocialCategoryID; if (trans == null) { SPHelper.ExecuteNonQuery(SpNames.Update, prms); } else { SPHelper.ExecuteNonQuery(trans, SpNames.Update, prms); } }
public void Update(SqlTransaction trans) { if (!CanUpdate(UserName)) { throw new AccessException(UserName, "Update"); } SqlParameter[] prms = new SqlParameter[3]; prms[0] = new SqlParameter("@DocumentCodeID", SqlDbType.Int); prms[0].Value = ID; prms[1] = new SqlParameter("@Name", SqlDbType.NVarChar, 256); prms[1].Value = Name; prms[2] = new SqlParameter("@Code", SqlDbType.NVarChar, 50); prms[2].Value = Code; if (trans == null) { SPHelper.ExecuteNonQuery(SpNames.Update, prms); } else { SPHelper.ExecuteNonQuery(trans, SpNames.Update, prms); } }
public int Insert(SqlTransaction trans) { if (!CanInsert(UserName)) { throw new AccessException(UserName, "Insert"); } SqlParameter[] prms = new SqlParameter[13]; prms[0] = new SqlParameter("@CitizenID", SqlDbType.Int); prms[0].Direction = ParameterDirection.Output; prms[1] = new SqlParameter("@FirstName", SqlDbType.NVarChar, 50); prms[1].Value = FirstName; prms[2] = new SqlParameter("@MiddleName", SqlDbType.NVarChar, 50); prms[2].Value = MiddleName; prms[3] = new SqlParameter("@LastName", SqlDbType.NVarChar, 50); prms[3].Value = LastName; prms[4] = new SqlParameter("@Address", SqlDbType.NVarChar, 100); prms[4].Value = Address; prms[5] = new SqlParameter("@PhoneNumber", SqlDbType.NVarChar, 50); prms[5].Value = PhoneNumber; prms[6] = new SqlParameter("@CityObjectID", SqlDbType.Int); prms[6].Value = CityObjectID; prms[7] = new SqlParameter("@HouseNumber", SqlDbType.NVarChar, 50); prms[7].Value = HouseNumber; prms[8] = new SqlParameter("@Corps", SqlDbType.NVarChar, 50); prms[8].Value = Corps; prms[9] = new SqlParameter("@ApartmentNumber", SqlDbType.NVarChar, 50); prms[9].Value = ApartmentNumber; prms[10] = new SqlParameter("@Work", SqlDbType.NVarChar, 100); prms[10].Value = Work; prms[11] = new SqlParameter("@Sex", SqlDbType.Int); prms[11].Value = Sex; prms[12] = new SqlParameter("@SocialStatusID", SqlDbType.Int); prms[12].Value = SocialStatusID; if (trans == null) { SPHelper.ExecuteNonQuery(SpNames.Insert, prms); } else { SPHelper.ExecuteNonQuery(trans, SpNames.Insert, prms); } ID = (int)prms[0].Value; return(ID); }
public static DataSet SearchCode(SqlTransaction trans, string name, int departmentId, int templateId) { SqlParameter[] sps = new SqlParameter[3]; sps[0] = new SqlParameter("@Name", SqlDbType.NVarChar, 256); sps[0].Value = name; sps[1] = new SqlParameter("@DepartmentID", SqlDbType.Int); if (departmentId <= 0) { sps[1].Value = DBNull.Value; } else { sps[1].Value = departmentId; } sps[2] = new SqlParameter("@TemplateID", SqlDbType.Int); if (templateId <= 0) { sps[2].Value = DBNull.Value; } else { sps[2].Value = templateId; } return(SPHelper.ExecuteDataset(trans, SpNames.SearchCode, sps)); }
public void Update(SqlTransaction trans) { if (!CanUpdate(UserName)) { throw new AccessException(UserName, "Update"); } SqlParameter[] prms = new SqlParameter[6]; prms[0] = new SqlParameter("@CityObjectID", SqlDbType.Int); prms[0].Value = ID; prms[1] = new SqlParameter("@CityObjectTypeID", SqlDbType.SmallInt); prms[1].Value = TypeID; prms[2] = new SqlParameter("@CityObjectName", SqlDbType.NVarChar, 100); prms[2].Value = Name; prms[3] = new SqlParameter("@CityObjectOldName", SqlDbType.NVarChar, 100); prms[3].Value = OldName; prms[4] = new SqlParameter("@CityObjectSearchName", SqlDbType.NVarChar, 100); prms[4].Value = SearchName; prms[5] = new SqlParameter("@IsReal", SqlDbType.Bit); prms[5].Value = IsReal; if (trans == null) { SPHelper.ExecuteNonQuery(SpNames.Update, prms); } else { SPHelper.ExecuteNonQuery(trans, SpNames.Update, prms); } }
public void Update() { SqlConnection connection = new SqlConnection(SPHelper.GetConnectionString()); try { connection.Open(); SqlTransaction trans = null; try { trans = connection.BeginTransaction(); this.Update(trans); trans.Commit(); } catch (Exception e) { trans.Rollback(); throw (e); } } finally { connection.Close(); } }
public int Insert() { SqlConnection connection = new SqlConnection(SPHelper.GetConnectionString()); try { connection.Open(); SqlTransaction trans = null; try { trans = connection.BeginTransaction(); Insert(trans); trans.Commit(); } catch (Exception) { if (trans != null) { trans.Rollback(); } throw; } } finally { connection.Close(); } return(ID); }
private void Init(SqlTransaction trans, Guid objectID) { SqlParameter[] prms = new SqlParameter[5]; prms[0] = new SqlParameter("@DepartmentID", SqlDbType.Int); prms[0].Direction = ParameterDirection.Output; prms[1] = new SqlParameter("@Name", SqlDbType.NVarChar, 100); prms[1].Direction = ParameterDirection.Output; prms[2] = new SqlParameter("@ShortName", SqlDbType.NVarChar, 50); prms[2].Direction = ParameterDirection.Output; prms[3] = new SqlParameter("@ObjectID", SqlDbType.UniqueIdentifier); prms[3].Value = objectID; prms[4] = new SqlParameter("@ParrentDepartmentID", SqlDbType.Int); prms[4].Direction = ParameterDirection.Output; if (trans == null) { SPHelper.ExecuteNonQuery(SpNames.GetByObjectID, prms); } else { SPHelper.ExecuteNonQuery(trans, SpNames.GetByObjectID, prms); } ID = (int)prms[0].Value; Name = (string)prms[1].Value; ShortName = (string)prms[2].Value; ObjectID = objectID; ParrentDepartmentID = (int)prms[4].Value; }
private void Init(SqlTransaction trans, int questionTypeId) { if (!CanView(UserName)) { throw new AccessException(UserName, "Init"); } SqlParameter[] prms = new SqlParameter[2]; prms[0] = new SqlParameter("@QuestionTypeID", SqlDbType.Int); prms[0].Value = questionTypeId; prms[1] = new SqlParameter("@Name", SqlDbType.NVarChar, 100); prms[1].Direction = ParameterDirection.Output; if (trans == null) { SPHelper.ExecuteNonQuery(SpNames.Get, prms); } else { SPHelper.ExecuteNonQuery(trans, SpNames.Get, prms); } ID = questionTypeId; Name = (string)prms[1].Value; }
public void Update(SqlTransaction trans) { SqlParameter[] prms = new SqlParameter[5]; prms[0] = new SqlParameter("@DepartmentID", SqlDbType.Int); prms[0].Value = ID; prms[1] = new SqlParameter("@Name", SqlDbType.NVarChar, 100); prms[1].Value = Name; prms[2] = new SqlParameter("@ShortName", SqlDbType.NVarChar, 50); prms[2].Value = ShortName; prms[3] = new SqlParameter("@ObjectID", SqlDbType.UniqueIdentifier); prms[3].Value = ObjectID; prms[4] = new SqlParameter("@ParrentDepartmentID", SqlDbType.Int); prms[4].Value = ParrentDepartmentID; if (trans == null) { SPHelper.ExecuteNonQuery(SpNames.Update, prms); } else { SPHelper.ExecuteNonQuery(trans, SpNames.Update, prms); } }
public void RemoveUser(object user) { if (user == Undefined.Value || user == Null.Value || user == null) { throw new JavaScriptException(this.Engine, "Error", "First argument must be either a user instance or a login name."); } SPUser userToRemove; if (user is SPUserInstance) { var spUser = user as SPUserInstance; userToRemove = spUser.User; } else { var loginName = TypeConverter.ToString(user); SPUser spUser; if (SPHelper.TryGetSPUserFromLoginName(loginName, out spUser) == false) { throw new JavaScriptException(this.Engine, "Error", "A user with the specified login name does not exist."); } userToRemove = spUser; } RemovePrincipal(userToRemove); }
public static IEnumerable <TList> GetListsByContentType <TList>(this SPWeb web, string contentTypeName) where TList : SPList { SPContentType contentType = web.AvailableContentTypes[contentTypeName]; return(SPHelper.GetListsByContentType <TList>(web, contentType)); }