Iron Speed Technical Forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
Asires

Registered:
Posts: 10
Reply with quote  #1 
Hi All,

I have a problem, I would like get old value of record from business layer. I found a way but it couses new problems.

I add new function as shown below.
  Public Function OldRecord() As OrdersRecord
            Return OrdersTable.GetRecord("OrderID=" & Me.OrderID)
        End Function

then while updating function I call oldrecord. everyting is okey but if while deleting function processing it call itself twice becouse of general function. I want to find differance between old value and new value. or situations etc.

I would like know good way compare old value and new value.

  Private Sub Audit_Updating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.UpdatingRecord
            Try
                BaseClasses.Utils.DbUtils.StartTransaction()
                                 If IsValueChanged(OrdersTable.Quantity)  Then
                        Dim Quantity As Decimal = Me.Quantity- OldRecord.Quantity
.....

ejs

Registered:
Posts: 31
Reply with quote  #2 
Have you thought of placing the "old value" in a invisible literal, not updating the database and then comparing?
miles

Avatar / Picture

MVP Consultant
Registered:
Posts: 1,723
Reply with quote  #3 
Save your record object in a session variable
__________________
Miles Gibson, MScIS
Iron Speed MVP
Senior Consultant, Principal
Milestone Software Inc.

http://www.ironspeedmvp.com\localizer 
Email: miles@milestone.ca
Milestone Localizer: Full Localization for your Iron Speed applications!
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.

Download Iron Speed Designer

Terms of Service Privacy Statement