views:

58

answers:

0

Hi all,

We use Dynamic data website for editing a database. We have customized the edit functionality to use Stored procedure instead of default LINQ. This SP is returing a inetger value. How should we catch the return value from the SP in the edit page which is still using LINQdatasource?

 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DynamicValidator runat="server" ID="DetailsViewValidator" ControlToValidate="DetailsView1" Display="None" />

            <asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="DetailsDataSource" DefaultMode="Edit" AutoGenerateEditButton="True" 
            OnItemCommand="DetailsView1_ItemCommand" OnItemUpdated="DetailsView1_ItemUpdated" HeaderStyle-Font-Bold="true">
            </asp:DetailsView>

            <asp:LinqDataSource ID="DetailsDataSource" runat="server" EnableUpdate="true">
                <WhereParameters>
                    <asp:DynamicQueryStringParameter />
                </WhereParameters>
            </asp:LinqDataSource>
        </ContentTemplate>
    </asp:UpdatePanel>

context class

 private void Updatetbl_Tbl_Rate(tbl_Rate obj)
        {
            this.praInsertUpdate_tblRate(((System.Nullable<int>)(obj.in4Id_CPI_Rate)), obj.vcrCode_Cntry, ((System.Nullable<System.DateTime>)(obj.dtDate_Mth_End)), ((System.Nullable<decimal>)(obj.numNum_Index_CPI)), ((System.Nullable<decimal>)(obj.numNum_Rate_CPI)), ((System.Nullable<System.DateTime>)(obj.dtDate_Bus)), obj.vcrId_User, obj.vcrDesc_User_Comments);
        }

        [Function(Name = "dbo.praInsertUpdate_tblRate")]
        public int praInsertUpdate_tblRate(
            [Parameter(Name = "Id_CPI_Rate", DbType = "Int")] System.Nullable<int> id_CPI_Rate, 
            [Parameter(Name = "Code_Cntry", DbType = "VarChar(3)")] string code_Cntry, 
            [Parameter(Name = "Date_Mth_End", DbType = "Date")] System.Nullable<System.DateTime> date_Mth_End, 
            [Parameter(Name = "Index_CPI", DbType = "Decimal")] System.Nullable<decimal> index_CPI, 
            [Parameter(Name = "Rate_CPI", DbType = "Decimal")] System.Nullable<decimal> rate_CPI, 
            [Parameter(Name = "Bus_Date", DbType = "Date")] System.Nullable<System.DateTime> bus_Date, 
            [Parameter(Name = "Id_User", DbType = "VarChar(50)")] string id_User, 
            [Parameter(Name = "User_Comments", DbType = "VarChar(500)")] string user_Comments)
        {                

            IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), id_CPI_Rate, code_Cntry, date_Mth_End, index_CPI, rate_CPI, bus_Date, id_User, user_Comments);
            return ((int)(result.ReturnValue));
        }