コード例 #1
0
 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);
 }
コード例 #2
0
 public ActionResult Conditions()
 {
     var m = new QueryModel2();
     return View(m);
 }
コード例 #3
0
 public ActionResult AddToGroup(QueryModel2 m)
 {
     if (m.Validate())
         m.AddConditionToGroup();
     return PartialView("TryConditions", m);
 }
コード例 #4
0
 public ActionResult Add(QueryModel2 m)
 {
     if (m.Validate())
         m.AddConditionAfterCurrent();
     return PartialView("TryConditions", m);
 }
コード例 #5
0
 public ActionResult Update(QueryModel2 m)
 {
     if (m.Validate())
         m.UpdateCondition();
     return PartialView("TryConditions", m);
 }
コード例 #6
0
 public ContentResult UnTagAll(Guid id)
 {
     var m = new QueryModel2() { QueryId = id };
     m.UnTagAll();
     return Content("Add");
 }
コード例 #7
0
 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");
 }
コード例 #8
0
 public JsonResult GetOrganizations(int id)
 {
     var m = new QueryModel2();
     return Json(m.Organizations(id));
 }
コード例 #9
0
 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);
 }
コード例 #10
0
 public JsonResult SavedQueries()
 {
     var m = new QueryModel2();
     return Json(m.SavedQueries()); ;
 }
コード例 #11
0
 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);
 }
コード例 #12
0
 public ActionResult Remove(QueryModel2 m)
 {
     m.DeleteCondition();
     return Content(JsonConvert.SerializeObject(m));
 }
コード例 #13
0
        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);
        }
コード例 #14
0
 public ActionResult InsGroupAbove(Guid id)
 {
     var m = new QueryModel2 { SelectedId = id };
     m.InsertGroupAbove();
     return Content(m.QueryId.ToString());
 }
コード例 #15
0
        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);
        }
コード例 #16
0
 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));
 }
コード例 #17
0
 public JsonResult GetDivisions(int id)
 {
     var m = new QueryModel2();
     return Json(new { Divisions = m.Divisions(id), Organizations = m.Organizations(0) });
 }