Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/26/11 23:53:57 (14 years ago)
Author:
mjesner
Message:

#1499 result page, styling, functionality (add/remove) for post actions

Location:
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/ChartController.cs

    r6242 r6303  
    3131
    3232      // Later, we will get the runs from the session ...
    33       QueryServiceClient client = Query.GetClientFactory("okbtester", "okbtester");
    34 
    35       long[] runIds = new long[104];
    36       for (int i = 0; i < 104; i++) {
    37         runIds[i] = i;
    38       }
    39       Run[] runs = client.GetRuns(runIds, false);
    40       //cm.Runs = runs;
     33      QueryServiceClient client = Query.GetClientFactory();
     34
     35      //long[] runIds = new long[104];
     36      //for (int i = 0; i < 104; i++) {
     37      //  runIds[i] = i;
     38      //}
     39      long[] runIds = client.GetRunIds((CombinedFilter)Session["Content"]);
     40        Run[] runs = client.GetRuns(runIds,false);
     41      //  Run[] runs = Session[""];
     42      cm.Runs = runs;
    4143      cm.UpdateRunCollection(runs);
    4244      cm.UpdateBubbleChart(selectedAxisY, selectedAxisX, selectedBubbleSize);
  • branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/FilterController.cs

    r6247 r6303  
    88using HLWebOKBQueryPlugin.OKBQueryService;
    99using System.Web.Routing;
     10using HLWebOKBQueryPlugin.Models;
    1011
    1112namespace HLWebOKBQueryPlugin.Controllers
     
    2021        /// </summary>
    2122        /// <returns></returns>
    22         public void GetRuns()
    23         {
    24             FilterModel qm = new FilterModel();
    25             qm.Content = (CombinedFilter)Session["Content"];
    26 
    27             QueryServiceClient client = Query.GetClientFactory("okbtester", "okbtester");
    28 
    29 
    30             long[] ids = client.GetRunIds(qm.Content);
     23        public ActionResult GetRuns()
     24        {
     25            Session["SelectedSubMenu"] = "Filter";
     26
     27            FilterModel fm = new FilterModel();
     28            fm.Content = (CombinedFilter)Session["Content"];
     29
     30            QueryServiceClient client = Query.GetClientFactory();
     31
     32
     33            long[] ids = client.GetRunIds(fm.Content);
    3134
    3235            Response.Write("Found <" + ids.Count() + "> Runs.");
    33 
    34           //  return View("Index", qm); // name of usercontrol
     36            QueryModel qm = new QueryModel();
     37            qm.Runs = ids;
     38            return View("Results", qm); // name of usercontrol
    3539        }
    3640
     
    5155        /// <param name="collection"></param>
    5256        /// <returns></returns>
    53         public ActionResult AddFilterAnd(string submitButton, FormCollection collection)
     57        public ActionResult AddFilter(FormCollection collection)
    5458        {
    5559            FilterModel fm = new FilterModel((CombinedFilter)Session["Content"]);
    56 
    57             Response.Write("Submit:" + submitButton);
     60            string submitAction = collection.Get("action");
     61            Response.Write("Submit:" + submitAction);
    5862           
    5963            //update model with form data
    6064            UpdateModel(collection, fm);
    6165
    62             if (submitButton.StartsWith("+"))
    63             {
    64                 string stringid = submitButton.Substring(2);
     66            if ("add".Equals(submitAction))
     67            {
     68               // string stringid = submitButton.Substring(2);
     69                string stringid = collection.Get("selectedFilter");
    6570                AddNewFilter(collection, fm, stringid);
    6671            }
    67             else if (submitButton.StartsWith("-"))
    68             {
    69                 string stringid = submitButton.Substring(2);
     72            else if ("delete".Equals(submitAction))
     73            {
     74               string stringid= collection.Get("selectedFilter");
     75               // string stringid = submitButton.Substring(2);
    7076                DeleteFilter(new Guid(stringid));
    7177            }
    72             else if (submitButton.Equals("runs"))
    73             {
    74                 GetRuns();
    75             }
    76             else if (submitButton.Equals("or"))
     78            else if ("runs".Equals(submitAction))
     79            {
     80                return GetRuns();
     81            }
     82            else if ("or".Equals(submitAction))
    7783            {
    7884                AddFilterOr( fm);
  • branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/QueryController.cs

    r6253 r6303  
    1111using System.Reflection;
    1212using System.Text;
    13 using HLWebPluginHost.Models;
     13using HLWebOKBQueryPlugin.Models;
    1414using HLWebOKBQueryPlugin.OKBQueryService;
    1515using HLWebOKBQueryPlugin.Helpers;
     
    4343
    4444        public ActionResult RunCollectionTable() {
     45
     46            // Get runs from filter
     47           
     48
     49            QueryServiceClient client = Query.GetClientFactory();
     50
     51
     52            long[] ids = client.GetRunIds((CombinedFilter)Session["Content"]);
     53
    4554            QueryModel qm = new QueryModel();
    46             Session["QueryRuns"] = qm.getTestRuns();
     55            qm.Runs = ids;
     56            Session["QueryRuns"] = qm.RunCollection;
    4757            return View(qm);
    4858        }
Note: See TracChangeset for help on using the changeset viewer.