Sorry, I was trying to post only relevant info and pasted wrong info. Here is the a better paste of the sub in question:
Imports System
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Imports WebBATSApp
Public Class CMSearchSardCtl
Inherits System.Web.UI.UserControl
Private ez As EZFormat_ASP.EZSQL Private BaCaseID, BaSardID As Int32
Private AddEdit As String
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load ez = New EZFormat_ASP.EZSQL(BaMod.BaConnectionString)
If Not Page.IsPostBack Then
Try
GetSard()
Me.txtGrossRcpts.Focus()
Catch ex As Exception
BaMod.LogAppError(ez, Now, "CMSearchSardCtl", "Page_Load", ex.ToString, BaMod.ErrSeverity.Low)
End Try
End If
End Sub
#Region "GetSard"
Private Sub GetSard()
BaCaseID = CInt(Session("CaseID"))
Dim BaSardID As Int32
Dim cmd As SqlCommand = Nothing
ez.ExecuteNonQuery("spFindBaSardByID", cmd, BaCaseID)
BaSardID = CInt(cmd.Parameters.Item(0).Value)
Dim ds As New DataSetDim db As New WebBATS.GetDataSet(ez)
Dim CancelChecks, ZeroBalance, DistributionProper, UnclaimedFunds, DividendsLess5, MaxComp As Int32
Dim GrossRcpts, TrusteeComp, TrusteeExpenses, TrustAttyFee, TrustAttyFeeHimself, SpecialCouncil, _
AccountantFee, AuctioneerFee, AppraiserFee, LiquidatorFee, RealtorFee, OthProfFee, OtherPay, _
DbPayments, SecuredClaims, PriorityClaims As Double
Dim SpecialCouncilHimself, UnsecuredClaimsTimely, UnsecuredClaimsLate, AllowableUnsecuredTimely, _
AllowableUnsecuredLate, InterestPaidOnClaim, ClosingCosts As Double
Dim AssetCategory, AssetDescription As String
Try
Dim p As New SqlParameter("@BaCaseID", SqlDbType.BigInt)
p.Value = BaCaseID
Dim Col As New Collection
Col.Add(p)
If BaSardID <> 0 Then
db.GetDsSardByID(BaCaseID)
db.da.Fill(ds, "BaSard")
If ds.Tables.Count > 0 Then
lblHeading.Text = "Edit SARD Data"
Dim Row1 As DataRow
For Each Row1 In ds.Tables("BaSard").Rows
Session("BaSardID") = CInt(Row1.Item("BaSardID"))
GrossRcpts = CDbl(IIf(IsDBNull(Row1("GrossRcpts")), 0.0, Row1("GrossRcpts")))
TrusteeComp = CDbl(IIf(IsDBNull(Row1("TrusteeComp")), 0.0, Row1("TrusteeComp")))
TrusteeExpenses = CDbl(IIf(IsDBNull(Row1("TrusteeExpenses")), 0.0, Row1("TrusteeExpenses")))
TrustAttyFee = CDbl(IIf(IsDBNull(Row1("TrustAttyFee")), 0.0, Row1("TrustAttyFee")))
TrustAttyFeeHimself = CDbl(IIf(IsDBNull(Row1("TrustAttyFeeHimself")), 0.0, Row1("TrustAttyFeeHimself")))
SpecialCouncil = CDbl(IIf(IsDBNull(Row1("SpecialCouncil")), 0.0, Row1("SpecialCouncil")))
SpecialCouncilHimself = CDbl(IIf(IsDBNull(Row1("SpecialCouncil")), 0.0, Row1("SpecialCouncil")))
AccountantFee = CDbl(IIf(IsDBNull(Row1("AccountantFee")), 0.0, Row1("AccountantFee")))
AppraiserFee = CDbl(IIf(IsDBNull(Row1("AppraiserFee")), 0.0, Row1("AppraiserFee")))
AuctioneerFee = CDbl(IIf(IsDBNull(Row1("AuctioneerFee")), 0.0, Row1("AuctioneerFee")))
LiquidatorFee = CDbl(IIf(IsDBNull(Row1("LiquidatorFee")), 0.0, Row1("LiquidatorFee")))
RealtorFee = CDbl(IIf(IsDBNull(Row1("RealtorFee")), 0.0, Row1("RealtorFee")))
OthProfFee = CDbl(IIf(IsDBNull(Row1("OthProfFee")), 0.0, Row1("OthProfFee")))
PriorityClaims = CDbl(IIf(IsDBNull(Row1("PriorityClaims")), 0.0, Row1("PriorityClaims")))
SecuredClaims = CDbl(IIf(IsDBNull(Row1("SecuredClaims")), 0.0, Row1("SecuredClaims")))
UnsecuredClaimsTimely = CDbl(IIf(IsDBNull(Row1("UnsecuredClaimsTimely")), 0.0, Row1("UnsecuredClaimsTimely")))
UnsecuredClaimsLate = CDbl(IIf(IsDBNull(Row1("UnsecuredClaimsLate")), 0.0, Row1("UnsecuredClaimsLate")))
AllowableUnsecuredTimely = CDbl(IIf(IsDBNull(Row1("AllowableUnsecuredTimely")), 0.0, Row1("AllowableUnsecuredTimely")))
AllowableUnsecuredLate = CDbl(IIf(IsDBNull(Row1("AllowableUnsecuredLate")), 0.0, Row1("AllowableUnsecuredLate")))
InterestPaidOnClaim = CDbl(IIf(IsDBNull(Row1("InterestPaidOnClaim")), 0.0, Row1("InterestPaidOnClaim")))
DbPayments = CDbl(IIf(IsDBNull(Row1("DbPayments")), 0.0, Row1("DbPayments")))
ClosingCosts = CDbl(IIf(IsDBNull(Row1("ClosingCosts")), 0.0, Row1("ClosingCosts")))
OtherPay = CDbl(IIf(IsDBNull(Row1("OtherPay")), 0.0, Row1("OtherPay")))
CancelChecks = CInt(IIf(IsDBNull(Row1("CancelChecks")), 0, Row1("CancelChecks")))
ZeroBalance = CInt(IIf(IsDBNull(Row1("ZeroBalance")), 0, Row1("ZeroBalance")))
DistributionProper = CInt(IIf(IsDBNull(Row1("DistributionProper")), 0.0, Row1("DistributionProper")))
UnclaimedFunds = CInt(IIf(IsDBNull(Row1("UnclaimedFunds")), 0, Row1("UnclaimedFunds")))
DividendsLess5 = CInt(IIf(IsDBNull(Row1("DividendsLess5")), 0, Row1("DividendsLess5")))
AssetCategory = CStr(IIf(IsDBNull(Row1("AssetCategory")), "", Row1("AssetCategory")))
AssetDescription = CStr(IIf(IsDBNull(Row1("AssetDescription")), "", Row1("AssetDescription")))
MaxComp = CInt(IIf(IsDBNull(Row1("MaxComp")), 0, Row1("MaxComp")))
Next
End If
Else
lblHeading.Text = "Add SARD Data"
GrossRcpts = 0.0
TrusteeComp = 0.0
TrusteeExpenses = 0.0
TrustAttyFee = 0.0
TrustAttyFeeHimself = 0.0
SpecialCouncil = 0.0
SpecialCouncilHimself = 0.0
AccountantFee = 0.0
AuctioneerFee = 0.0
AppraiserFee = 0.0
LiquidatorFee = 0.0
RealtorFee = 0.0
OthProfFee = 0.0
OtherPay = 0.0
DbPayments = 0.0
ClosingCosts = 0.0
SecuredClaims = 0.0
PriorityClaims = 0.0
UnsecuredClaimsTimely = 0.0
UnsecuredClaimsLate = 0.0
AllowableUnsecuredTimely = 0.0
AllowableUnsecuredLate = 0.0
InterestPaidOnClaim = 0.0
CancelChecks = 0
ZeroBalance = 0
DistributionProper = 0
UnclaimedFunds = 0
DividendsLess5 = 0
MaxComp = 0
End If
txtGrossRcpts.Text = GrossRcpts.ToString("C")
txtTrusteeComp.Text = TrusteeComp.ToString("C")
txtTrusteeExpenses.Text = TrusteeExpenses.ToString("C")
txtTrustAttyFee.Text = TrustAttyFee.ToString("C")
txtTrustAttyHimself.Text = TrustAttyFeeHimself.ToString("C")
txtSpecialCouncil.Text = SpecialCouncil.ToString("C")
txtSpecialCouncilHimself.Text = SpecialCouncilHimself.ToString("C")
txtAppraiserFee.Text = AppraiserFee.ToString("C")
txtAccountantFee.Text = AccountantFee.ToString("C")
txtAuctioneerFee.Text = AuctioneerFee.ToString("C")
txtLiquidatorFee.Text = LiquidatorFee.ToString("C")
txtRealtorFee.Text = RealtorFee.ToString("C")
txtOthProfFee.Text = OthProfFee.ToString("C")
txtPriorityClaims.Text = PriorityClaims.ToString("C")
txtSecuredClaims.Text = SecuredClaims.ToString("C")
txtUnsecuredClaimsTimely.Text = UnsecuredClaimsTimely.ToString("C")
txtUnsecuredClaimsLate.Text = UnsecuredClaimsLate.ToString("C")
txtAllowableUnsecuredTimely.Text = AllowableUnsecuredTimely.ToString("c")
txtAllowableUnsecuredLate.Text = AllowableUnsecuredLate.ToString("c")
txtInterestPaidOnClaim.Text = InterestPaidOnClaim.ToString("c")
txtdbpayments.Text = DbPayments.ToString("C")
txtClosingCosts.Text = ClosingCosts.ToString("C")
txtOtherPay.Text = OtherPay.ToString("C")
If MaxComp = 0 Then
Me.rbMaxCompNo.Checked = True
Else
Me.rbMaxCompYes.Checked = True
End If
If CancelChecks = 0 Then
rbCancelChecksNo.Checked = True
Else
rbCancelChecksYes.Checked = True
End If
If ZeroBalance = 0 Then
rbZeroBalanceNo.Checked = True
Else
rbZeroBalanceYes.Checked = True
End If
If DistributionProper = 0 Then
rbDistribProperNo.Checked = True
Else
rbDistribProperYes.Checked = True
End If
If UnclaimedFunds = 0 Then
rbUnclaimedFundsNo.Checked = True
Else
rbUnclaimedFundsYes.Checked = True
End If
If DividendsLess5 = 0 Then
rbDividendsLess5No.Checked = True
Else
rbDividendsLess5Yes.Checked = True
End If
Me.ddlAssetCategory.SelectedValue = AssetCategory
Me.AssetDescription.Text = AssetDescription
Catch ex As Exception BaMod.LogAppError(ez, Now, "CMSearchSardCtl", "GetSard", ex.ToString, BaMod.ErrSeverity.Low)
End Try
End Sub
#End Region
End Class