Autor Beitrag
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Do 03.07.08 11:04 
Hallo,
ich check irgendwie nicht, wie ich meine Daten ins ObjectDataSource und dann ins GridView bekomme...
folgendes:
ausblenden volle Höhe C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
public class ResultRow
    {
        public String firstname;
        public String lastname;
        public String shortcut;
        public String company;
        public String phone;
        public String fax;
        public String fax2;
        public String mobile;
        public String mail;
        public String bui_room;
        public String department;
        public String cost_center;
        public String post;
        public String phone_repr;
        public String note;
    }

    public class ResultList : List<ResultRow>{};

    [DataObject(true)]
    public class ListGUIAdapter
    {
        private ResultList results
        {
            get{
                if (HttpContext.Current.Session["results"] == nullreturn new ResultList();
                else return (ResultList)HttpContext.Current.Session["results"];
            }
            set{ HttpContext.Current.Session["results"] = value; }
        }

        [DataObjectMethod(DataObjectMethodType.Select, true)]
        public ResultList LoadToGrid()
        {
            return results;
        }

        [DataObjectMethod(DataObjectMethodType.Delete, true)]
        public void DeleteResult(ResultRow toDelete)
        {
            ResultList buffer = results;
            buffer.Remove(toDelete);
            results = buffer;
        }

        [DataObjectMethod(DataObjectMethodType.Update, true)]
        public void UpdateResult(ResultRow toUpdate)
        {
            ResultList buffer = results;
            buffer.Remove(toUpdate);
            buffer.Add(toUpdate);
            results = buffer;
        }

        [DataObjectMethod(DataObjectMethodType.Insert, true)]
        public void InsertResult(ResultRow newResult)
        {
            ResultList buffer = results;
            buffer.Add(newResult);
            results = buffer;
        }
    }


Die Funktionen hab ich im ObjectDataSource entsprechend angegeben, die Klasse auch...
Nur weiß ich jetzt nicht, wie ich die Daten in die Source reinbekomme...
Und dann wieder raus, ins GridView...

Kann mir da jemand helfen?

Wolle

_________________
1405006117752879898543142606244511569936384000000000.
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Do 03.07.08 13:39 
Hey!

Ich bin mir nicht sicher, aber kann man die Objekte nicht wie in Delphi verknüpfen und muss sich dann nicht darum kümmern?

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Do 03.07.08 13:43 
wie meinste jetzt?
Hab in delphi noch nie objekte miteinander verknüpft... zumindest nicht bewusst^^

_________________
1405006117752879898543142606244511569936384000000000.
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Do 03.07.08 13:57 
Naja..schaut mir so aus..

Also verknüpfen mein ich das: www.delphi-forum.de/viewtopic.php?t=84651 -> 6. Beitrag..

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Do 03.07.08 14:15 
nicht das was ich suche...
Die Daten, die ins ObjectDataSource sollen, kann ich ja schon auslesen, nur check ich das nicht, wie das dann im source geregelt ist...

_________________
1405006117752879898543142606244511569936384000000000.
Kha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3803
Erhaltene Danke: 176

Arch Linux
Python, C, C++ (vim)
BeitragVerfasst: Do 03.07.08 14:35 
user profile iconWolle92 hat folgendes geschrieben:
Die Funktionen hab ich im ObjectDataSource entsprechend angegeben, die Klasse auch...
Bist du dann nicht schon fertig :nixweiss: ? Das Grid holt sich die Daten aus der DataSource und diese ruft die angegebene SelectMethod auf.
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Do 03.07.08 14:45 
aber es müssen ja erstmal daten in die ODS rein...
Und das kommt ja dynamisch... und wie das da reinkommt, weiß ich net...

_________________
1405006117752879898543142606244511569936384000000000.
Kha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3803
Erhaltene Danke: 176

Arch Linux
Python, C, C++ (vim)
BeitragVerfasst: Do 03.07.08 14:51 
Wenn das Grid Daten braucht, erstellt die Source ein Objekt der angegebenen Klasse (TypeName) und ruft die angegebene Methode auf (SelectMethod). Da musst du überhaupt nichts selber machen.
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Do 03.07.08 15:28 
doch, die daten erstmal ins ODS bekommen... da is ja noch nix drin, die klasse hat ja noch nix, die klasse ist ne liste, und in die liste müssen erstmal elemente rein, damit die dann ins grid view können...

_________________
1405006117752879898543142606244511569936384000000000.
Kha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3803
Erhaltene Danke: 176

Arch Linux
Python, C, C++ (vim)
BeitragVerfasst: Do 03.07.08 17:41 
Aha, es geht also darum, wie du die Session-Variable füllen kannst? Dann solltest du vielleicht erst einmal erwähnen, woher die Daten denn letztendlich kommen sollen (DB?).
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Fr 04.07.08 08:15 
die kommen aus nem Active Directory, das krieg ich aber schon hin...

ich hab dann ne temporäre variable sozusagen für jeden eintrag ausm AD vom Typ ResultRow, und schreibe da dann die Daten rein...
Die ObjectDataList hat die Klasse ListGUIAdapter bekommen, die ja auf eine Liste vom Typ ResultList "verweist"

_________________
1405006117752879898543142606244511569936384000000000.