private void AddIncompatibility(TypeOfAd type, HashSet <TvBreak> breaks) { Instance.TypeToBreakIncompatibilityMatrix[type.ID] = new Dictionary <int, byte>(); foreach (TvBreak tvBreak in breaks) { Instance.TypeToBreakIncompatibilityMatrix[type.ID][tvBreak.ID] = 1; } }
private void CombineAdGroup(IGrouping <string, TypeOfAd> group, Dictionary <int, TypeOfAd> newDict) { var groupList = group.ToList(); TypeOfAd firstType = groupList.First(); firstType.ID = Convert.ToInt32(group.Key); newDict[firstType.ID] = firstType; foreach (var adType in groupList.Skip(1)) { firstType.JoinType(adType); } }
public IActionResult CreateTypeOfAd(TypeOfAd x) { if (ModelState.IsValid) { TypeOfAd newSec = new TypeOfAd(); newSec.Name = x.Name; newSec.ZeroActive = false; _Context.TypeOfAd.Add(x); _Context.SaveChanges(); } return(View()); }