Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Mona Mehta   on Nov 29 In Asp.net Category.

  
Question Answered By: Anna Hill   on Nov 29


Sub Page_Load(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MyBase.Load
iStdFeeTot = 0
iInsureVarTot = 0
Dim ConnectString As String
MyConnect = New SqlConnection()
ConnectString =
ConfigurationSettings.AppSettings("ConnectStr")
MyConnect.ConnectionString = ConnectString
'Lbl_Biller.Text =
Convert.ToString(Session("UserCode"))
If Not IsPostBack Then
BindGrid()
Collections()
'InsurDropDown()
'PatientDropDown()
'CoPayDropDown()
Else

End If
End Sub

Protected Sub BindGrid()
Dim strSQL As String = "Select top 5 * From
vCollectionQForms" & _
" Where DOS is not
null" & _
" or Priority is not
null" & _
" or Status is not null
Order by Priority asc"
Dim MyCommand As SqlDataAdapter = New
SqlDataAdapter(strSQL, MyConnect)
Dim CollectionQDS As DataSet = New DataSet()
MyCommand.Fill(CollectionQDS, "CollectionQ")
CollectionQDataGrid.DataSource = CollectionQDS
CollectionQDataGrid.DataBind()
Dim Row1 As DataRow =
CollectionQDS.Tables("CollectionQ").Rows(0)
Lbl_PatientID.Text =
Row1("PatientID").ToString()
Lbl_DOS.Text = Format(Row1("DOS"),
"d").ToString()
Lbl_PatientName.Text =
Row1("PatientName").ToString()
Lbl_Priority.Text =
Row1("Priority").ToString()
Lbl_TodayStatus.Text =
Row1("Status").ToString()
Lbl_PatientAge.Text = Row1("Age").ToString()
Lbl_ResponsParty.Text =
Row1("Subscriber").ToString()
Lbl_PrimaryInsure.Text =
Row1("CarrierNam").ToString()
End Sub


Sub Collections()
Dim strSQL As String = "Select *,
QTY1*CHARGES1 As StdFee," & _
"AllowableAmt - insurancepaid As InsureVar
" & _
"from tCollectionQ " & _
"where PatientID = " & _
Lbl_PatientID.Text & "and DOS='" &
Lbl_DOS.Text & "'"
Dim objAdapter As SqlDataAdapter = New
SqlDataAdapter(strSQL, MyConnect)
Dim CollectionQDS As DataSet = New DataSet()
objAdapter.Fill(CollectionQDS,
"CollectionQinfo")
Dim dRow As DataRow =
CollectionQDS.Tables("CollectionQinfo").Rows(0)
For Each dRow In
CollectionQDS.Tables("CollectionQinfo").Rows
iStdFeeTot = iStdFeeTot +
CType(dRow("StdFee"), Double)
iInsureVarTot = iInsureVarTot +
CType(dRow("InsureVar"), Double)
Next

CollectionsTable.DataSource = CollectionQDS
CollectionsTable.DataBind()
Dim SQLCommand As New SqlCommand(strSQL,
MyConnect)
MyConnect.Open()
oReader =
SQLCommand.ExecuteReader(CommandBehavior.CloseConnection)
CollectionsTable.DataSource = oReader
CollectionsTable.DataBind()
MyConnect.Close()
End Sub

Sub AttachFooter(ByVal S As Object, ByVal ea As
RepeaterItemEventArgs)
If ea.Item.ItemType = ListItemType.Footer Then
' Add Totals for Columns

CType(ea.Item.FindControl("Lbl_StdFee_Total"),
Label).Text = Format(iStdFeeTot, "c")
'Populate Insurance Drop down
Dim DD_InsurPayAction As DropDownList =
CType(ea.Item.FindControl("DD_InsurPayAction"),
DropDownList)
Dim AddInsurChoice As ListItem
Dim InsurCommand = New SqlCommand("Select
* From tCollectionQAction where Type = 1 or Type = 0",
MyConnect)
MyConnect.Open()
oReader =
InsurCommand.ExecuteReader(CommandBehavior.CloseConnection)
DD_InsurPayAction.DataSource = oReader
DD_InsurPayAction.DataBind()
MyConnect.Close()
AddInsurChoice = New ListItem("Select
Insurance Payment Action", "0")
AddInsurChoice.Selected = True
If Not
DD_InsurPayAction.Items.Contains(AddInsurChoice) Then
DD_InsurPayAction.Items.Insert(0,
AddInsurChoice)
End If

'Populate Patient Drop down
Dim DD_PatPayAction As DropDownList =
CType(ea.Item.FindControl("DD_PatPayAction"),
DropDownList)
Dim AddPatChoice As ListItem
Dim PatCommand = New SqlCommand("Select *
From tCollectionQAction where Type = 2 or Type = 0",
MyConnect)
MyConnect.Open()
oReader =
PatCommand.ExecuteReader(CommandBehavior.CloseConnection)
DD_PatPayAction.DataSource = oReader
DD_PatPayAction.DataBind()
MyConnect.Close()
AddPatChoice = New ListItem("Select
Patient Payment Action", "0")
AddPatChoice.Selected = True
If Not
DD_PatPayAction.Items.Contains(AddPatChoice) Then
DD_PatPayAction.Items.Insert(0,
AddPatChoice)
End If

'Populate Co-Pay DropDown
Dim DD_CoPayAction As DropDownList =
CType(ea.Item.FindControl("DD_CoPayAction"),
DropDownList)
Dim AddCoPayChoice As ListItem
Dim CoPayCommand = New SqlCommand("Select
* From tCollectionQAction where Type = 3 or Type = 0",
MyConnect)
MyConnect.Open()
oReader =
CoPayCommand.ExecuteReader(CommandBehavior.CloseConnection)
DD_CoPayAction.DataSource = oReader
DD_CoPayAction.DataBind()
MyConnect.Close()
AddCoPayChoice = New ListItem("Select
Co-Payment Action", "0")
AddCoPayChoice.Selected = True
If Not
DD_CoPayAction.Items.Contains(AddCoPayChoice) Then
DD_CoPayAction.Items.Insert(0,
AddCoPayChoice)
End If
'Collection Totals
'Dim Lbl_StdFee_Total As Label =
CType(ea.Item.FindControl("Lbl_StdFee_Total"),
Label).Text = iStdFeeTot
End If
End Sub

Protected Sub ItemCommand(ByVal Sender As Object,
ByVal e As RepeaterCommandEventArgs)
If e.CommandName = "Btn_Save" Then
Dim Adapter As SqlDataAdapter = New
SqlDataAdapter()
Dim EditCB As SqlCommandBuilder
Dim EditDS As DataSet = New DataSet()
Dim Row As DataRow
'ConnectString =
ConfigurationSettings.AppSettings("ConnectStr")
'MyConnect.ConnectionString =
ConnectString
'MyConnect.Open()
Adapter.SelectCommand = New
SqlCommand("Select * from tCollectionQCurrent where
PatientID = " & _
Lbl_PatientID.Text & "
and DOS = '" & Lbl_DOS.Text & "'", MyConnect)
EditCB = New SqlCommandBuilder(Adapter)
Adapter.Fill(EditDS, "CurrentCollection")

Row =
EditDS.Tables("CurrentCollection").Rows(0)

Row.Item("PatientID") = Lbl_PatientID.Text
Row.Item("DOS") = Lbl_DOS.Text
Row.Item("Status") = "2"
Row.Item("Priority") = "B"
'Row.Item("InsuranceStatus") =
CInt(DD_InsurePayAction.selecteditem.value)
Trace.Warn("Update typename",
TypeName(FindControl("DD_InsurPayAction")))
Row.Item("InsuranceStatus") =
CType(CollectionsTable.FindControl("DD_InsurPayAction"),
DropDownList).SelectedItem.Value
'Row.Item("InsuranceStatus") =
DD_InsurPayAction.SelectedItem.Value
Row.Item("PatientPmtStatus") =
DD_PatPayAction.SelectedItem.Value
Row.Item("CoPayStatus") =
DD_CoPayAction.SelectedItem.Value
Adapter.Update(EditDS,
"CurrentCollection")

If EditDS.HasErrors Then
Lbl_Message.Text = "There was an error
Updating Current History Information, Please try
again." & _

EditDS.Tables("GetUser").Rows(0).RowError
Else
BindGrid()
Collections()
WriteCollectionHistory()
End If
End If
End Sub

Sub WriteCollectionHistory()
Dim CollectionHistoryDS As DataSet = New
DataSet()
Dim CollectionHistoryCB As SqlCommandBuilder
'Dim ConnectString As String
'Dim Connect As SqlConnection = New
SqlConnection()
Dim Adapter As SqlDataAdapter = New
SqlDataAdapter()
Dim Row As DataRow
'ConnectString =
ConfigurationSettings.AppSettings("ConnectStr")
'Connect.ConnectionString = ConnectString
Adapter.SelectCommand = New SqlCommand("Select
* from tCollectionQHistory", MyConnect)
CollectionHistoryCB = New
SqlCommandBuilder(Adapter)
Adapter.Fill(CollectionHistoryDS,
"CollectionHistory")
Row =
CollectionHistoryDS.Tables("CollectionHistory").NewRow
Row.Item("PatientID") = Lbl_PatientID.Text
Row.Item("DOS") = Lbl_DOS.Text
Row.Item("TranDate") = Now()
Row.Item("UserID") =
Convert.ToString(Session("UserCode"))
Row.Item("Status") = "2"
Row.Item("Priority") = "B"
Row.Item("InsuranceDD") =
CType(FindControl("DD_InsurPayAction"),
DropDownList).SelectedItem.Value
Row.Item("PatientDD") =
DD_PatPayAction.SelectedItem.Value
Row.Item("CoPayDD") =
DD_CoPayAction.SelectedItem.Value

CollectionHistoryDS.Tables("CollectionHistory").Rows.Add(Row)
Adapter.Update(CollectionHistoryDS,
"CollectionHistory")
If CollectionHistoryDS.HasErrors Then
Lbl_Message.Text = "There was an error
inserting Collection History Record." & _

CollectionHistoryDS.Tables("CollectionHistory").Rows(0).RowError
End If
End Sub
-----------------------------------------------------
vb code:
<asp:repeater id="CollectionsTable" Runat="server"
OnItemCommand="ItemCommand"
OnItemDataBound="AttachFooter">
<HeaderTemplate>
<table width="100%" border="0" align="center">
<tr bgcolor="#660099">
<td align="middle" nowrap colspan="4"><font
color="#cc9900" size="-1"> <b>Fee
Information</b> </font></td>
<td align="middle" nowrap colspan="3"><font
color="#cc9900" size="-1"> <b>Insurance
Company</b> </font></td>
<td align="middle" nowrap colspan="3"><font
color="#cc9900" size="-1"> <b>Patient
Payment Respons.</b> </font></td>
<td align="middle" nowrap colspan="3"><font
color="#cc9900" size="-1"> <b>Patient
Co-Payment</b> </font></td>
</tr>
<tr bgcolor="#660099">
<td align="middle" nowrap><font color="#cc9900"
size="-1"> <b>CPT Code</b> </font></td>
<td align="middle" nowrap><font color="#cc9900"
size="-1"> <b>Description</b> </font></td>
<td align="middle" nowrap><font color="#cc9900"
size="-1"> <b>Std Fee</b> </font></td>
<td align="middle" nowrap><font color="#cc9900"
size="-1"> <b>Tot Allowed</b> </font></td>
<td align="middle" nowrap><font color="#cc9900"
size="-1"> <b>Est</b> </font></td>
<td align="middle" nowrap><font color="#cc9900"
size="-1"> <b>Actual Pd</b> </font></td>
<td align="middle" nowrap><font color="#cc9900"
size="-1"> <b>Variance</b> </font></td>
<td align="middle" nowrap><font color="#cc9900"
size="-1"> <b>Est</b> </font></td>
<td align="middle" nowrap><font color="#cc9900"
size="-1"> <b>Pd to Date</b> </font></td>
<td align="middle" nowrap><font color="#cc9900"
size="-1"> <b>Still Owed</b> </font></td>
<td align="middle" nowrap><font color="#cc9900"
size="-1"> <b>Est</b> </font></td>
<td align="middle" nowrap><font color="#cc9900"
size="-1"> <b>Pd to Date</b> </font></td>
<td align="middle" nowrap><font color="#cc9900"
size="-1"> <b>Still Owed</b> </font></td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td align="middle" nowrap> <Font
size="-2"><%#
Container.DataItem("CODE1")%></Font> </td>
<td align="middle" nowrap> <Font
size="-2"><%#
Container.DataItem("codedescription")%></Font> </td>
<td align="middle" nowrap> <%#
format(Container.DataItem("StdFee"),"c")%> </td>
<td align="middle" nowrap> <%#
Format(Container.DataItem("AllowableAmt"),"c")%> </td>
<td align="middle" nowrap> <%#
Format(Container.DataItem("AllowableAmt"),"c")%> </td>
<td align="middle" nowrap> <%#
Format(Container.DataItem("insurancepaid"),"c")%> </td>
<td align="middle" nowrap> <%#
Format(Container.DataItem("InsureVar"),"c")%> </td>
<td align="middle" nowrap> 0 </td>
<td align="middle" nowrap> <%#
Format(Container.DataItem("patientpaid"),"c")%> </td>
<td align="middle" nowrap> 0 </td>
<td align="middle" nowrap> 0 </td>
<td align="middle" nowrap> 0 </td>
<td align="middle" nowrap> 0 </td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr bgcolor="#e5e5e5">
<td align="middle" nowrap> <font
size="-2"><%#
Container.DataItem("CODE1")%></font> </td>
<td align="left" nowrap> <font
size="-2"><%#
Container.DataItem("codedescription")%></font> </td>
<td align="middle" nowrap><%#
format(Container.DataItem("StdFee"),"c")%></td>
<td align="middle" nowrap><%#
Format(Container.DataItem("AllowableAmt"),"c")%></td>
<td align="middle" nowrap><%#
Format(Container.DataItem("AllowableAmt"),"c")%></td>
<td align="middle" nowrap><%#
Format(Container.DataItem("insurancepaid"),"c")%></td>
<td align="middle" nowrap><%#
Format(Container.DataItem("InsureVar"),"c")%></td>
<td align="middle" nowrap>0</td>
<td align="middle" nowrap><%#
Format(Container.DataItem("patientpaid"),"c")%></td>
<td align="middle" nowrap>0</td>
<td align="middle" nowrap>0</td>
<td align="middle" nowrap>0</td>
<td align="middle" nowrap>0</td>
</tr>
</AlternatingItemTemplate>
<FooterTemplate>
<tr bgcolor="#e5e5e5">
<td align="right" colspan="2">Totals:</td>
<td align="middle" nowrap>
<asp:Label ID="Lbl_StdFee_Total"
Runat="server"></asp:Label>
</td>
<td align="middle" nowrap> 0 </td>
<td align="middle" nowrap> 0 </td>
<td align="middle" nowrap> 0 </td>
<td align="middle" nowrap> 0 </td>
<td align="middle" nowrap> 0 </td>
<td align="middle" nowrap> 0 </td>
<td align="middle" nowrap> 0 </td>
<td align="middle" nowrap> 0 </td>
<td align="middle" nowrap> 0 </td>
<td align="middle" nowrap> 0 </td>
</tr>
<tr>
<td align="right" colspan="4">
<asp:button CommandName="Btn_Save"
Runat="server" Text="Save"></asp:button></td>
<td colspan="3" align="middle"
bgcolor="#660099">
<asp:dropdownlist ID="DD_InsurPayAction"
Font-Size="8" DataValueField="BillingActionID"
DataTextField="BillingActionDescription"
runat="server" /></td>
<td colspan="3" align="middle"
bgcolor="#660099">
<asp:dropdownlist ID="DD_PatPayAction"
Font-Size="8" DataValueField="BillingActionID"
DataTextField="BillingActionDescription"
runat="server" /></td>
<td colspan="3" align="middle"
bgcolor="#660099">
<asp:dropdownlist ID="DD_CoPayAction"
Font-Size="8" DataValueField="BillingActionID"
DataTextField="BillingActionDescription"
runat="server" /></td>
</tr>
</table>
</FooterTemplate>
</asp:repeater>

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Dropdown nested in repeater Or get search suggestion and latest updates.


Tagged: