public ActionResult Create(InformationCollection.Models.SourceRegexView sourceregex) { if (ModelState.IsValid) { var sourceRegexGroup = db.SourceRegexGroups.Where(p => p.Name == sourceregex.SourceRegexGroup).FirstOrDefault(); if (sourceRegexGroup == null) { sourceRegexGroup = new SourceRegexGroup() { Name = sourceregex.SourceRegexGroup }; db.SourceRegexGroups.Add(sourceRegexGroup); db.SaveChanges(); } sourceRegexGroup.SourceRegexes.Add(new SourceRegex { IsMatched = sourceregex.IsMatched, RegexType = sourceregex.RegexType, Name = sourceregex.Name, Regex = sourceregex.Regex }); db.SaveChanges(); return RedirectToAction("Index", new { id = sourceRegexGroup.SourceRegexGroupId }); } return View(sourceregex); }
public InformationBar() { _designMode = ControlUtil.GetIsInDesignMode(this); SetStyle(ControlStyles.DoubleBuffer | ControlStyles.ResizeRedraw, true); Items = new InformationCollection(this); TabStop = false; UpdateFont(); }
public static Maintenance Create(Node node) { InformationCollection infos = node.Informations; List <Information> l = infos["tag"]; string name = string.Empty; foreach (Information info in l) { if (info.Contains("name")) { name = info["name"]; } } Maintenance m = new Maintenance(node.Id, node.Latitude, node.Longitude, name); return(m); }
public static Toilet Create(Node node) { InformationCollection infos = node.Informations; List <Information> l = infos["tag"]; string name = string.Empty; foreach (Information info in l) { if (info.Contains("name")) { name = info["name"]; } } Toilet t = new Toilet(node.Id, node.Latitude, node.Longitude, name); return(t); }
public static Atm Create(Node node) { InformationCollection infos = node.Informations; string name = string.Empty; List <Information> l = infos["tag"]; foreach (Information info in l) { if (info.Contains("name")) { name = info["name"]; } if (info.Contains("operator")) { name = info["operator"]; } } Atm a = new Atm(node.Id, node.Latitude, node.Longitude, name); return(a); }