public DocumentSetToCheck RegisterDocumentSetToCheck(User user, string sts, string vu, string name) { DocumentSetToCheck doc; //find user in dbContext var userInContext = GetUserById(user.Id); if (GetDocumentSetToCheck(userInContext, sts) == null) { doc = new DocumentSetToCheck { User = userInContext, Sts = sts, Vu = vu, Name = name, ScheduleCheck = true }; userInContext.DocumentSetsTocheck.Add(doc); _autoBotContext.SaveChanges(); return(doc); } return(null); // new Exception("Подписка для этого пользователя с данным"); }
public void ToggleDocumentSetForSubscription(DocumentSetToCheck documentSetToCheck, bool SubscriptionToggle) { var docSetInDb = _autoBotContext.DocumentSetsTocheck.Find(documentSetToCheck.Id); if (docSetInDb != null) { docSetInDb.ScheduleCheck = SubscriptionToggle; } _autoBotContext.SaveChanges(); }
public UsersShtrafiWithDocSet(User user, DocumentSetToCheck documentSetToCheck, Dictionary <string, Pay> shtrafs) { User = user; DocumentSetToCheck = documentSetToCheck; Shtrafs = shtrafs; }