public void SetContributeApprovedInProject(int projectid, int id) { var rel = Rels.FirstOrDefault(x => x.id == id && x.pageId == projectid && x.relTypeId == 4); rel.Approved = true; UnitOfWork.SaveChanges(); }
public Relationship RelToUserToPage(int pageID, string username) { Relationship _RelToUserToPage = new Relationship(); RelEntity entity = Rels.FirstOrDefault(r => r.username == username && r.pageId == pageID); if (entity != null && entity.pageId != 0) { _RelToUserToPage = FromEntity.ToRel(entity); } return(_RelToUserToPage); }
public bool RelToUserToPage(int pageID) { bool _RelToUserToPage = false; RelEntity entity = Rels.FirstOrDefault(p => p.username == pageID.ToString()); _RelToUserToPage = true; if (entity != null) { if (entity.pageId == pageID) { _RelToUserToPage = true; } } return(_RelToUserToPage); }
public Relationship GetRelById(int id) { RelEntity entity = Rels.FirstOrDefault(p => p.id == id); return(FromEntity.ToRel(entity)); }