Free cookie consent management tool by TermsFeed Policy Generator

source: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Query/RunCollectionTable.ascx.cs @ 5977

Last change on this file since 5977 was 5977, checked in by msammer, 13 years ago

#1446 added user-controls RunCollectionDetail, RunCollectionTable and class RunCollectionData for showing the run-results

File size: 2.1 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Web;
5using System.Web.UI;
6using System.Web.UI.WebControls;
7
8using HLWebOKBQueryPlugin.OKBQueryService;
9
10namespace HLWebOKBQueryPlugin.Views.Query {
11    public partial class RunCollectionTable : System.Web.UI.UserControl {
12        public IList<Run> DataRuns { get; set; }
13
14        protected void Page_Load(object sender, EventArgs e) {
15            DataRuns = getTestData();
16
17            IList<RunCollectionData> runsList = new List<RunCollectionData>();
18            foreach (Run r in DataRuns)
19                runsList.Add(new RunCollectionData(r));
20
21            GridRunCollection.DataSource = runsList;
22            GridRunCollection.DataBind();
23
24        }
25
26        private IList<Run> getTestData() {
27            IList<Run> runs = new List<Run>();
28
29            Run run = new Run();
30            run.Id = 34;
31            run.Algorithm = new OKBQueryService.Algorithm();
32            run.Algorithm.Name = "TestAlgo";
33            run.Algorithm.AlgorithmClass = "TestAlgoClass";
34            runs.Add(run);
35
36            run = new Run();
37            run.Id = 35;
38            run.Algorithm = new OKBQueryService.Algorithm();
39            run.Algorithm.Name = "TestAlgo2";
40            run.Algorithm.AlgorithmClass = "TestAlgoClass2";
41            runs.Add(run);
42
43            run = new Run();
44            run.Id = 36;
45            run.Algorithm = new OKBQueryService.Algorithm();
46            run.Algorithm.Name = "TestAlgo3";
47            run.Algorithm.AlgorithmClass = "TestAlgoClass3";
48            runs.Add(run);
49
50            return runs;
51        }
52
53        protected void GridRunCollection_RowCommand(Object sender, GridViewCommandEventArgs e) {
54            txtTest.Text = e.CommandName;
55            if (e.CommandName == "Select") {
56                // TODO gererate Details
57                txtTest.Text = e.CommandName;
58            }
59        }
60
61        protected void GridRunCollection_SelectedIndexChanged(Object sender, EventArgs e) {
62            txtTest2.Text = GridRunCollection.SelectedIndex.ToString();
63        }
64    }
65
66}
Note: See TracBrowser for help on using the repository browser.