Last change
on this file since 6076 was
6076,
checked in by msammer, 13 years ago
|
#1446 Changed RunCollectionTable for using it in the MVC-pluginhost. Changes for using real Run-objects in the table
|
File size:
1.9 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Web;
|
---|
5 | using System.Web.UI;
|
---|
6 | using System.Web.UI.WebControls;
|
---|
7 |
|
---|
8 | using System.Reflection;
|
---|
9 |
|
---|
10 | using HLWebOKBQueryPlugin.Helpers;
|
---|
11 |
|
---|
12 | namespace HLWebOKBQueryPlugin.Views.Query {
|
---|
13 | public partial class RunCollectionDetail : System.Web.UI.UserControl {
|
---|
14 | private object currentObject = null;
|
---|
15 | public object detailObject {
|
---|
16 | get { return currentObject; }
|
---|
17 | set {
|
---|
18 | currentObject = value;
|
---|
19 | FillDetails();
|
---|
20 | }
|
---|
21 | }
|
---|
22 |
|
---|
23 | protected void Page_Load(object sender, EventArgs e) {
|
---|
24 | currentObject = getTest();
|
---|
25 |
|
---|
26 | FillDetails();
|
---|
27 | }
|
---|
28 |
|
---|
29 | protected void FillDetails() {
|
---|
30 | if (currentObject != null) {
|
---|
31 | Type rcd = currentObject.GetType();
|
---|
32 |
|
---|
33 | foreach (PropertyInfo pi in rcd.GetProperties()) {
|
---|
34 | TableRow tr = new TableRow();
|
---|
35 | TableCell tc = new TableCell();
|
---|
36 | tc.Text = pi.Name;
|
---|
37 | tr.Cells.Add(tc);
|
---|
38 | tc = new TableCell();
|
---|
39 | try {
|
---|
40 | tc.Text = pi.GetValue(currentObject, null).ToString();
|
---|
41 | } catch (Exception ex) {
|
---|
42 | tc.Text = ex.Message;
|
---|
43 | }
|
---|
44 | tr.Cells.Add(tc);
|
---|
45 | TableRunDetail.Rows.Add(tr);
|
---|
46 | }
|
---|
47 | }
|
---|
48 | }
|
---|
49 |
|
---|
50 | private RunCollectionData getTest() {
|
---|
51 | OKBQueryService.Run testrun = new OKBQueryService.Run();
|
---|
52 |
|
---|
53 | testrun.Id = 34;
|
---|
54 | testrun.Algorithm = new OKBQueryService.Algorithm();
|
---|
55 | testrun.Algorithm.Name = "TestAlgo";
|
---|
56 | testrun.Algorithm.AlgorithmClass = "TestAlgoClass";
|
---|
57 |
|
---|
58 | RunCollectionData run = new RunCollectionData(testrun);
|
---|
59 |
|
---|
60 | return run;
|
---|
61 | }
|
---|
62 | }
|
---|
63 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.