private int ChekedGroupContent(int groupId, string ConttentParametr) { using (ContextGrabberGroupParametr db = new ContextGrabberGroupParametr()) { var tt = db.GrabberGroupParametrs.Where(p => p.Group_Id == groupId).Intersect(db.GrabberGroupParametrs.Where(p => p.ContentParametr == ConttentParametr)).ToList(); return(tt.Count()); } }
private void PhotoAlbomGroupContent(int groupId) { if (ChekedGroupContent(groupId, "PhotoAlbom") == 0) { using (ContextGrabberGroupParametr db = new ContextGrabberGroupParametr()) { GrabberGroupParametr GGP = new GrabberGroupParametr { Group_Id = groupId, ContentParametr = "PhotoAlbom" }; db.GrabberGroupParametrs.Add(GGP); db.SaveChanges(); } } }
private void CellAuditoryGroupContent(int groupId) { if (ChekedGroupContent(groupId, "CellAuditory") == 0) { using (ContextGrabberGroupParametr db = new ContextGrabberGroupParametr()) { GrabberGroupParametr GGP = new GrabberGroupParametr { Group_Id = groupId, ContentParametr = "CellAuditory" }; db.GrabberGroupParametrs.Add(GGP); db.SaveChanges(); } } }