R
RenatoGuarilha
Hi,
I interested in use of ObjectDataSource to bind my POCO classes with
web controls.
But, I have been creating an interface framework in order to decrease
our development time. In this framework there is a generic execution
method responsible to instantiate any protected method in my
Transactional Classes. It is done by reflection.
This is it´s signature :
public Object exec(string pMethName, params Object[] p_prms)
I´ve been doing tests with a method in my ancestral service class
(Trasactional classes), who are able to retrieve all objects as a
collection. In this case it works very well, and I were able to
integrate with GridView without any problem.
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
SelectMethod="exec"
TypeName="com.cmsolucoes.service.ServiceConsultaHospede">
<SelectParameters>
<asparameter DefaultValue="getAll" Name="pMethName"
Type="String" />
<asparameter DefaultValue="" Name="p_prms"
Type="Object" />
</SelectParameters>
</asp:ObjectDataSource>
Otherwise, If I try to do the same with another method, wich have a
parameter, It raises an exception.
{"Object of type 'System.Decimal' cannot be converted to type
'System.Object[]'."}
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server"
SelectMethod="exec"
TypeName="com.cmsolucoes.service.ServiceConsultaHospede">
<SelectParameters>
<asparameter DefaultValue="findByPrimaryKey"
Name="pMethName" Type="String" />
<asp:ControlParameter ControlID="txtId" DefaultValue=""
Name="p_prms" PropertyName="Text"
Type="Decimal" />
</SelectParameters>
</asp:ObjectDataSource>
Method Signature:
protected virtual System.Object findByPrimaryKey(Object pk)
Has anyone some idea about this ?
Tks in advance,
Renato Guarilha
I interested in use of ObjectDataSource to bind my POCO classes with
web controls.
But, I have been creating an interface framework in order to decrease
our development time. In this framework there is a generic execution
method responsible to instantiate any protected method in my
Transactional Classes. It is done by reflection.
This is it´s signature :
public Object exec(string pMethName, params Object[] p_prms)
I´ve been doing tests with a method in my ancestral service class
(Trasactional classes), who are able to retrieve all objects as a
collection. In this case it works very well, and I were able to
integrate with GridView without any problem.
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
SelectMethod="exec"
TypeName="com.cmsolucoes.service.ServiceConsultaHospede">
<SelectParameters>
<asparameter DefaultValue="getAll" Name="pMethName"
Type="String" />
<asparameter DefaultValue="" Name="p_prms"
Type="Object" />
</SelectParameters>
</asp:ObjectDataSource>
Otherwise, If I try to do the same with another method, wich have a
parameter, It raises an exception.
{"Object of type 'System.Decimal' cannot be converted to type
'System.Object[]'."}
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server"
SelectMethod="exec"
TypeName="com.cmsolucoes.service.ServiceConsultaHospede">
<SelectParameters>
<asparameter DefaultValue="findByPrimaryKey"
Name="pMethName" Type="String" />
<asp:ControlParameter ControlID="txtId" DefaultValue=""
Name="p_prms" PropertyName="Text"
Type="Decimal" />
</SelectParameters>
</asp:ObjectDataSource>
Method Signature:
protected virtual System.Object findByPrimaryKey(Object pk)
Has anyone some idea about this ?
Tks in advance,
Renato Guarilha