public ContentResult AddContact() { var m = new AdvancedModel(); m.LoadScratchPad(); var cid = CmsData.Contact.AddContact(m.QueryId.Value); return Content("/Contact.aspx?id=" + cid); }
public ActionResult AddTasks() { var m = new AdvancedModel(); m.LoadScratchPad(); var c = new ContentResult(); c.Content = Task.AddTasks(m.QueryId.Value).ToString(); return c; }
public ActionResult CopyAsNew(int id) { var m = new AdvancedModel { SelectedId = id }; m.LoadScratchPad(); m.CopyAsNew(); var c = new ContentResult(); c.Content = m.QueryId.ToString(); return c; }
public ActionResult AddNewCondition(int id) { var m = new AdvancedModel { SelectedId = id }; m.LoadScratchPad(); m.EditCondition(); if (m.ConditionName == "Group") m.AddConditionToGroup(); else m.AddNewConditionAfterCurrent(id); return View("Conditions", m); }
public ContentResult UnTagAll() { var m = new AdvancedModel(); m.LoadScratchPad(); m.UnTagAll(); var c = new ContentResult(); c.Content = "Add"; return c; }
public ContentResult TagAll(string tagname, bool? cleartagfirst) { if (!tagname.HasValue()) return Content("error: no tag name"); var m = new AdvancedModel(); m.LoadScratchPad(); 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 ActionResult SelectCondition(int id, string conditionName) { var m = new AdvancedModel { SelectedId = id }; m.LoadScratchPad(); m.ConditionName = conditionName; m.SetVisibility(); m.TextValue = ""; m.IntegerValue = ""; m.DateValue = ""; m.CodeValue = ""; m.CodeValues = new string[0]; m.Days = ""; m.Age = ""; m.Program = 0; m.Quarters = ""; m.StartDate = ""; m.EndDate = ""; m.Comparison = "Equal"; m.UpdateCondition(); m.SelectedId = id; return View("Conditions", m); }
public ActionResult Export() { var m = new AdvancedModel(); m.LoadScratchPad(); return new QBExportResult(m.QueryId.Value); }
public ActionResult SaveCondition(AdvancedModel m) { m.LoadScratchPad(); if (m.Validate(ModelState)) { m.UpdateCondition(); DbUtil.Db.SubmitChanges(); } return View("Conditions", m); }
public ActionResult Results() { var cb = new SqlConnectionStringBuilder(Util.ConnectionString); cb.ApplicationName = "qb"; DbUtil.Db = new CMSDataContext(cb.ConnectionString); var m = new AdvancedModel(); try { UpdateModel(m); } catch (Exception ex) { return Content("Something went wrong<br><p>" + ex.Message + "</p>"); } m.LoadScratchPad(); var starttime = DateTime.Now; m.PopulateResults(); DbUtil.LogActivity("QB Results ({0:N1}, {1})".Fmt(DateTime.Now.Subtract(starttime).TotalSeconds, m.QueryId)); return View(m); }
public ActionResult RemoveCondition(int id) { var m = new AdvancedModel { SelectedId = id }; m.LoadScratchPad(); m.DeleteCondition(); m.SelectedId = null; return View("Conditions", m); }
public ActionResult Reload() { var m = new AdvancedModel(); m.LoadScratchPad(); return View("Conditions", m); }
public ActionResult Main(int? id, int? run) { if (!DbUtil.Db.UserPreference("newlook3", "false").ToBool() || !DbUtil.Db.UserPreference("advancedsearch", "false").ToBool()) return Redirect(Request.RawUrl.ToLower().Replace("search/advanced", "querybuilder")); ViewData["Title"] = "QueryBuilder"; ViewData["OnQueryBuilder"] = "true"; ViewData["TagAction"] = "/Search/Advanced/TagAll/"; ViewData["UnTagAction"] = "/Search/Advanced/UnTagAll/"; ViewData["AddContact"] = "/Search/Advanced/AddContact/"; ViewData["AddTasks"] = "/Search/Advanced/AddTasks/"; var m = new AdvancedModel { QueryId = id }; DbUtil.LogActivity("QueryBuilder"); if (run.HasValue) m.ShowResults = true; m.LoadScratchPad(); ViewData["queryid"] = m.QueryId; ViewBag.AutoRun = (bool?)(TempData["AutoRun"]) == true; var newsearchid = (int?)TempData["newsearch"]; if (newsearchid.HasValue) { ViewBag.NewSearch = true; m.SelectedId = newsearchid.Value; } return View(m); }
public ActionResult InsGroupAbove(int id) { var m = new AdvancedModel { SelectedId = id }; m.LoadScratchPad(); m.InsertGroupAbove(); var c = new ContentResult(); c.Content = m.QueryId.ToString(); return c; }
public ActionResult SaveQuery() { var m = new AdvancedModel(); UpdateModel(m); m.LoadScratchPad(); m.SaveQuery(); var c = new ContentResult(); c.Content = m.Description; return c; }
public ActionResult DuplicateCondition(int id) { var m = new AdvancedModel(); m.LoadScratchPad(); m.EditCondition(); m.CopyCurrentCondition(id); return View("Conditions", m); }
public ActionResult EditCondition(int id) { var m = new AdvancedModel { SelectedId = id }; m.LoadScratchPad(); m.EditCondition(); return View("Conditions", m); }