public ActionResult EditCondition(Guid queryid, Guid selectedid) { var m = new QueryModel2 { QueryId = queryid, SelectedId = selectedid }; m.EditCondition(); var j = JsonConvert.SerializeObject(m, Formatting.Indented); return Content(j); }
public ActionResult Conditions() { var m = new QueryModel2(); return View(m); }
public ActionResult AddToGroup(QueryModel2 m) { if (m.Validate()) m.AddConditionToGroup(); return PartialView("TryConditions", m); }
public ActionResult Add(QueryModel2 m) { if (m.Validate()) m.AddConditionAfterCurrent(); return PartialView("TryConditions", m); }
public ActionResult Update(QueryModel2 m) { if (m.Validate()) m.UpdateCondition(); return PartialView("TryConditions", m); }
public ContentResult UnTagAll(Guid id) { var m = new QueryModel2() { QueryId = id }; m.UnTagAll(); return Content("Add"); }
public ContentResult TagAll(Guid id, string tagname, bool? cleartagfirst) { if (!tagname.HasValue()) return Content("error: no tag name"); var m = new QueryModel2() { QueryId = id }; if (Util2.CurrentTagName == tagname && !(cleartagfirst ?? false)) { m.TagAll(); return Content("Remove"); } var tag = DbUtil.Db.FetchOrCreateTag(tagname, Util.UserPeopleId, DbUtil.TagTypeId_Personal); if (cleartagfirst ?? false) DbUtil.Db.ClearTag(tag); m.TagAll(tag); Util2.CurrentTag = tagname; DbUtil.Db.TagCurrent(); return Content("Manage"); }
public JsonResult GetOrganizations(int id) { var m = new QueryModel2(); return Json(m.Organizations(id)); }
public ActionResult SaveQuery(string SavedQueryDesc, bool IsPublic) { var m = new QueryModel2() { SavedQueryDesc = SavedQueryDesc, IsPublic = IsPublic }; var ret = m.SaveQuery(); if (ret.HasValue()) return Content(ret); return Content(m.Description); }
public JsonResult SavedQueries() { var m = new QueryModel2(); return Json(m.SavedQueries()); ; }
public ActionResult Results(QueryModel2 m) { var cb = new SqlConnectionStringBuilder(Util.ConnectionString); cb.ApplicationName = "qb"; var starttime = DateTime.Now; #if DEBUG m.PopulateResults(); #else try { m.PopulateResults(); } catch (Exception ex) { var errorLog = ErrorLog.GetDefault(null); errorLog.Log(new Error(ex)); return Content("Something went wrong<br><p>" + ex.Message + "</p>"); } #endif DbUtil.LogActivity("QB Results ({0:N1}, {1})".Fmt(DateTime.Now.Subtract(starttime).TotalSeconds, m.QueryId)); return View(m); }
public ActionResult Remove(QueryModel2 m) { m.DeleteCondition(); return Content(JsonConvert.SerializeObject(m)); }
public ActionResult Main(Guid? id, int? run) { if (ViewExtensions2.UseNewLook()) return Redirect("/Query"); var newsearchid = (Guid?)TempData["newsearch"]; var m = new QueryModel2 { QueryId = id }; id = m.TopClause.Id; m.SelectedId = id; if (m.TopClause.NewMatchAnyId.HasValue) newsearchid = m.TopClause.NewMatchAnyId; if (newsearchid.HasValue) ViewBag.NewSearchId = newsearchid.Value; DbUtil.LogActivity("QueryBuilder"); if (run.HasValue) m.ShowResults = true; ViewBag.queryid = id; ViewBag.Title = "QueryBuilder"; ViewBag.OnQueryBuilder = "true"; ViewBag.TagAction = "/QueryBuilder2/TagAll/" + id; ViewBag.UnTagAction = "/QueryBuilder2/UnTagAll/" + id; ViewBag.AddContact = "/QueryBuilder2/AddContact/" + id; ViewBag.AddTasks = "/QueryBuilder2/AddTasks/" + id; ViewBag.AutoRun = (bool?)(TempData["AutoRun"]) == true; return View(m); }
public ActionResult InsGroupAbove(Guid id) { var m = new QueryModel2 { SelectedId = id }; m.InsertGroupAbove(); return Content(m.QueryId.ToString()); }
public ActionResult SelectCondition(Guid queryid, Guid selectedid, string conditionName) { var m = new QueryModel2 { QueryId = queryid, SelectedId = selectedid, ConditionName = conditionName, CodeValue = "", CodeValues = new string[0], Program = 0, Comparison = "Equal" }; m.SetVisibility(); var j = JsonConvert.SerializeObject(m, Formatting.Indented); return Content(j); }
public ActionResult GetCodes(Guid queryid, Guid selectedid, string Comparison, string ConditionName) { var m = new QueryModel2 { QueryId = queryid, SelectedId = selectedid, Comparison = Comparison, ConditionName = ConditionName }; m.SetVisibility(); var j = new { m.CodesVisible, m.CodeVisible, m.CodeData, m.SelectMultiple }; return Content(JsonConvert.SerializeObject(j, Formatting.Indented)); }
public JsonResult GetDivisions(int id) { var m = new QueryModel2(); return Json(new { Divisions = m.Divisions(id), Organizations = m.Organizations(0) }); }