Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Grabbing foreign key value from control to populate detailsview

Posted on 2009-02-10
2
Medium Priority
?
611 Views
Last Modified: 2013-11-26
Hello,

I have a page with a couple of views that provide different glimpses of a user's information that is located in different tables. In the first view I pull in data from a querystring and present it in a detailsview and this seems to work without a problem. If a person clicks on the second view I want to pull up a table of information presented in another detailsview that is based on a foreign key located in the table that is provided in the first view. I can't seem to get this to work.

How can I grab the foreign key value from the detailsview that I have placed in the first view and use it for my query? I'm assuming that I can grab it from the control in some manner, but haven't had any luck.

Below is a snippet of the MultiView code. Currently when I run it all of the views work except for the Profile view which pulls up a blank page.

Thanks in advance...
<asp:Menu
        id="Menu1"
        Orientation="Horizontal"
        StaticMenuItemStyle-CssClass="tab"
        StaticSelectedStyle-CssClass="selectedTab"
        CssClass="tabs"
        OnMenuItemClick="Menu1_MenuItemClick"
        Runat="server" BackColor="#F7F6F3" DynamicHorizontalOffset="2" 
        Font-Names="Verdana" Font-Size="0.8em" ForeColor="#7C6F57" 
        StaticSubMenuIndent="10px">
        <Items>
        <asp:MenuItem Text="Care Plan" Value="0" Selected="True" />
        <asp:MenuItem Text="Encounter Notes" Value="1" />
        <asp:MenuItem Text="Goals" Value="2" />
        <asp:MenuItem Text="Profile" Value="3" />
        </Items>    
        <StaticSelectedStyle CssClass="selectedTab" BackColor="#5D7B9D" 
            ForeColor="White" />
        <StaticMenuItemStyle CssClass="tab" HorizontalPadding="5px" VerticalPadding="2px" />
        <DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" />
        <DynamicMenuStyle BackColor="#F7F6F3" />
        <DynamicSelectedStyle BackColor="#5D7B9D" />
        <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
        <StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
    </asp:Menu>
    
    <div class="tabContents">
    <asp:MultiView
        id="MultiView1"
        ActiveViewIndex="0"
        Runat="server">
        <asp:View ID="View1" runat="server">
    <p>
        <asp:DetailsView ID="CarePlanDetailsView" runat="server" AutoGenerateRows="False"
            CellPadding="5" DataKeyNames="carePlanID" DataSourceID="CarePlanDataSource" ForeColor="#333333"
            GridLines="None" Height="50px" Width="75%" CellSpacing="5">
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" VerticalAlign="Top" Width="20%" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <Fields>
                <asp:BoundField DataField="carePlanID" HeaderText="Care Plan ID" InsertVisible="False"
                    ReadOnly="True" SortExpression="carePlanID" />
                <asp:TemplateField HeaderText="Patient ID" SortExpression="patientID">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Enabled="False" Text='<%# Bind("patientID") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("patientID") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("patientID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Assigned Staff" SortExpression="staffID">
                    <EditItemTemplate>
                        <asp:DropDownList ID="StaffDropDownList" runat="server" DataSourceID="StaffDataSource" DataTextField="stfLastName" DataValueField="staffID" SelectedValue='<%# Bind("staffID") %>' Enabled="false" AppendDataBoundItems="true" ToolTip="This value can only be changed in the patient profile."><asp:ListItem>(None)</asp:ListItem></asp:DropDownList>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="StaffDropDownList" runat="server" DataSourceID="StaffDataSource" DataTextField="stfLastName" DataValueField="staffID" SelectedValue='<%# Bind("staffID") %>' AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem></asp:DropDownList>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:DropDownList ID="StaffDropDownList" runat="server" DataSourceID="StaffDataSource" DataTextField="stfLastName" DataValueField="staffID" SelectedValue='<%# Bind("staffID") %>' Enabled="false" AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem></asp:DropDownList>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Care Plan Date" SortExpression="date">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("date","{0:MM/dd/yyyy}") %>'></asp:TextBox><asp:CompareValidator
                            ID="CarePlanDateCompareValidator" runat="server" ErrorMessage="** Please use the mm/dd/yyyy date format." ControlToValidate="TextBox3" Display="Dynamic" ForeColor="White" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("date","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("date","{0:MM/dd/yyyy}") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Contact Frequency" SortExpression="contactFrequencyID">
                    <EditItemTemplate>
                        <asp:DropDownList ID="ContactFreqDropDown" runat="server" DataSourceID="ContactFrequencyDataSource" DataTextField="contactFrequency" DataValueField="contactFrequencyID" SelectedValue='<%# Bind("contactFrequencyID") %>' AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem>
                </asp:DropDownList>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("contactFrequencyID") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:DropDownList ID="ContactFreqDropDown" runat="server" DataSourceID="ContactFrequencyDataSource" DataTextField="contactFrequency" DataValueField="contactFrequencyID" SelectedValue='<%# Bind("contactFrequencyID") %>' Enabled="false" AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem>
                </asp:DropDownList>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="cellPhone" HeaderText="Cell Phone" ReadOnly="True" SortExpression="cellPhone" />
                <asp:TemplateField HeaderText="Long Term Goal" SortExpression="longTermGoal">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Height="100px" Text='<%# Bind("longTermGoal") %>'
                            TextMode="MultiLine" ToolTip="Enter the patient's long term goal in this field."
                            Width="75%"></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("longTermGoal") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("longTermGoal") %>'></asp:Label>
                    </ItemTemplate>
                    <ControlStyle Height="100px" Width="75%" />
                    <ItemStyle Height="100px" Width="75%" />
                </asp:TemplateField>
                <asp:CheckBoxField DataField="patientSignature" HeaderText="Patient Signature" SortExpression="patientSignature" />
                <asp:TemplateField HeaderText="Date Signed" SortExpression="patientSigDate">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("patientSigDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                        <asp:CompareValidator
                            ID="patientSigDateCompareValidator" runat="server" ErrorMessage="** Please use the mm/dd/yyyy date format." ControlToValidate="TextBox4" Display="Dynamic" ForeColor="White" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("patientSigDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("patientSigDate","{0:MM/dd/yyyy}") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CheckBoxField DataField="chsSignature" HeaderText="Care Manager Signature" SortExpression="chsSignature" />
                <asp:TemplateField HeaderText="Date Signed" SortExpression="chsSigDate">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("chsSigDate","{0:MM/dd/yyyy}") %>'></asp:TextBox><asp:CompareValidator
                            ID="chsSigDateCompareValidator" runat="server" ErrorMessage="** Please use the mm/dd/yyyy date format." ControlToValidate="TextBox5" Display="Dynamic" ForeColor="White" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("chsSigDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("chsSigDate","{0:MM/dd/yyyy}") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ShowEditButton="True" EditText="Update Care Plan" ButtonType="Button" />
            </Fields>
            <HeaderTemplate>Care Plan: <%# Eval("firstName") %> <%#Eval("lastName") %></HeaderTemplate>
            <HeaderStyle BackColor="LightSlateGray" Font-Bold="False" ForeColor="White" Font-Size="Large" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:DetailsView>
        <asp:SqlDataSource ID="CarePlanDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString1 %>"
            DeleteCommand="DELETE FROM [nav_CarePlans_tbl] WHERE [carePlanID] = @carePlanID"
            InsertCommand="INSERT INTO [nav_CarePlans_tbl] ([patientID], [date], [contactFrequencyID], [patientSignature], [patientSigDate], [chsSignature], [chsSigDate], [longTermGoal]) VALUES (@patientID, @date, @contactFrequencyID, @patientSignature, @patientSigDate, @chsSignature, @chsSigDate, @longTermGoal)"
            SelectCommand="SELECT nav_CarePlans_tbl.carePlanID, nav_CarePlans_tbl.patientID, nav_CarePlans_tbl.date, nav_CarePlans_tbl.contactFrequencyID, nav_CarePlans_tbl.patientSignature, nav_CarePlans_tbl.patientSigDate, nav_CarePlans_tbl.chsSignature, nav_CarePlans_tbl.chsSigDate, nav_CarePlans_tbl.longTermGoal, nav_Patients_tbl.lastName, nav_Patients_tbl.middleName, nav_Patients_tbl.firstName, nav_Patients_tbl.enrollmentDate, nav_Employee_tbl.staffID, nav_Patients_tbl.cellPhone FROM nav_CarePlans_tbl INNER JOIN nav_Patients_tbl ON nav_CarePlans_tbl.patientID = nav_Patients_tbl.patientID INNER JOIN nav_Employee_tbl ON nav_Patients_tbl.staffID = nav_Employee_tbl.staffID WHERE (nav_CarePlans_tbl.carePlanID = @carePlanID)"
            UpdateCommand="UPDATE [nav_CarePlans_tbl] SET [patientID] = @patientID, [date] = @date, [contactFrequencyID] = @contactFrequencyID, [patientSignature] = @patientSignature, [patientSigDate] = @patientSigDate, [chsSignature] = @chsSignature, [chsSigDate] = @chsSigDate, [longTermGoal] = @longTermGoal WHERE [carePlanID] = @carePlanID">
            <SelectParameters>
                <asp:QueryStringParameter Name="carePlanID" QueryStringField="carePlanID" Type="Int32" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="carePlanID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="patientID" Type="Int32" />
                <asp:Parameter Name="date" Type="DateTime" />
                <asp:Parameter Name="contactFrequencyID" Type="Int32" />
                <asp:Parameter Name="patientSignature" Type="Boolean" />
                <asp:Parameter Name="patientSigDate" Type="DateTime" />
                <asp:Parameter Name="chsSignature" Type="Boolean" />
                <asp:Parameter Name="chsSigDate" Type="DateTime" />
                <asp:Parameter Name="longTermGoal" Type="String" />
                <asp:Parameter Name="carePlanID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="patientID" Type="Int32" />
                <asp:Parameter Name="date" Type="DateTime" />
                <asp:Parameter Name="contactFrequencyID" Type="Int32" />
                <asp:Parameter Name="patientSignature" Type="Boolean" />
                <asp:Parameter Name="patientSigDate" Type="DateTime" />
                <asp:Parameter Name="chsSignature" Type="Boolean" />
                <asp:Parameter Name="chsSigDate" Type="DateTime" />
                <asp:Parameter Name="longTermGoal" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="ContactFrequencyDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString1 %>"
            SelectCommand="SELECT [contactFrequencyID], [contactFrequency] FROM [nav_contactFrequency_tbl] ORDER BY [contactFrequencyID]">
        </asp:SqlDataSource>
    </p>
        </asp:View>        
        <asp:View ID="View2" runat="server">
    <p>
        <asp:DetailsView ID="EncounterDetailsView" runat="server" AllowPaging="True" AutoGenerateRows="False"
            DataKeyNames="encounterID,carePlanID" DataSourceID="EncounterNotesDataSource" Height="50px" Width="75%" CellPadding="5" ForeColor="#333333" GridLines="None" BorderStyle="Solid" CellSpacing="5" OnItemInserting="EncounterDetailsView_ItemInsert">
            <Fields>
                <asp:BoundField DataField="encounterID" HeaderText="Encounter ID" InsertVisible="False"
                    ReadOnly="True" SortExpression="encounterID" Visible="False" />
                <asp:TemplateField HeaderText="carePlanID" SortExpression="carePlanID" Visible="False">
                    <EditItemTemplate>
                        <asp:TextBox ID="carePlanID" runat="server" Text='<%# Bind("carePlanID") %>' Enabled="false" Visible="false"></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="carePlanID" runat="server" Text='<%# Bind("carePlanID") %>' Visible="false"></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("carePlanID") %>' Visible="false"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Encounter Date" SortExpression="encounterDate">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("encounterDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                        <asp:CompareValidator
                            ID="encounterDateCompareValidator" runat="server" ErrorMessage="** Please use the mm/dd/yyyy date format." ControlToValidate="TextBox4" Display="Dynamic" ForeColor="White" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("encounterDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                        <asp:CompareValidator
                            ID="encounterDateCompareValidator" runat="server" ErrorMessage="** Please use the mm/dd/yyyy date format." ControlToValidate="TextBox4" Display="Dynamic" ForeColor="White" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("encounterDate","{0:MM/dd/yyyy}") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="encounterDuration" HeaderText="Encounter Duration (min)"
                    SortExpression="encounterDuration" />
                <asp:TemplateField HeaderText="Staff Reporting" SortExpression="staffID">
                    <EditItemTemplate>
                        <asp:DropDownList ID="StaffDropDownList" runat="server" DataSourceID="StaffDataSource" DataTextField="stfLastName" DataValueField="staffID" SelectedValue='<%# Bind("staffID") %>' AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem></asp:DropDownList>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="StaffDropDownList" runat="server" DataSourceID="StaffDataSource" DataTextField="stfLastName" DataValueField="staffID" SelectedValue='<%# Bind("staffID") %>' AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem></asp:DropDownList>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:DropDownList ID="StaffDropDownList" runat="server" DataSourceID="StaffDataSource" DataTextField="stfLastName" DataValueField="staffID" SelectedValue='<%# Bind("staffID") %>' Enabled="false" AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem></asp:DropDownList>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Interaction Type" SortExpression="interactionTypeID">
                    <EditItemTemplate>
                        <asp:DropDownList ID="InteractionTypeDropDown" runat="server" DataSourceID="InteractionTypeDataSource"
            DataTextField="interactionType" DataValueField="interactionTypeID" SelectedValue='<%# Bind("interactionTypeID") %>' AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem>
        </asp:DropDownList>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="InteractionTypeDropDown" runat="server" DataSourceID="InteractionTypeDataSource"
            DataTextField="interactionType" DataValueField="interactionTypeID" SelectedValue='<%# Bind("interactionTypeID") %>' AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem>
        </asp:DropDownList>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:DropDownList ID="InteractionTypeDropDown" runat="server" DataSourceID="InteractionTypeDataSource"
            DataTextField="interactionType" DataValueField="interactionTypeID" SelectedValue='<%# Bind("interactionTypeID") %>' Enabled="false" AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem>
        </asp:DropDownList>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Interaction Reason" SortExpression="interactionReasonID">
                    <EditItemTemplate>
                        <asp:DropDownList ID="InteractionReasonDropDown" runat="server" DataSourceID="InteractionReasonDataSource"
            DataTextField="interactionReason" DataValueField="interactionReasonID" SelectedValue='<%# Bind("interactionReasonID") %>' AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem>
        </asp:DropDownList>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="InteractionReasonDropDown" runat="server" DataSourceID="InteractionReasonDataSource"
            DataTextField="interactionReason" DataValueField="interactionReasonID" SelectedValue='<%# Bind("interactionReasonID") %>' AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem>
        </asp:DropDownList>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:DropDownList ID="InteractionReasonDropDown" runat="server" DataSourceID="InteractionReasonDataSource"
            DataTextField="interactionReason" DataValueField="interactionReasonID" SelectedValue='<%# Bind("interactionReasonID") %>' Enabled="false" AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem>
        </asp:DropDownList>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="encounterCatOther" HeaderText="Other" SortExpression="encounterCatOther" >
                    <ControlStyle Width="300px" />
                    <ItemStyle Width="300px" />
                </asp:BoundField>
                <asp:CheckBoxField DataField="appointmentScheduled" HeaderText="Appointment Scheduled?"
                    SortExpression="appointmentScheduled" />
                <asp:TemplateField HeaderText="Appointment Date/Time" SortExpression="appointmentDateTime">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("appointmentDateTime","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                        <asp:CompareValidator
                            ID="AppointmentDateCompareValidator" runat="server" ErrorMessage="** Please use the mm/dd/yyyy date format." ControlToValidate="TextBox5" Display="Dynamic" ForeColor="White" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("appointmentDateTime","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                        <asp:CompareValidator
                            ID="AppointmentDateCompareValidator" runat="server" ErrorMessage="** Please use the mm/dd/yyyy date format." ControlToValidate="TextBox5" Display="Dynamic" ForeColor="White" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("appointmentDateTime","{0:MM/dd/yyyy}") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Data" SortExpression="encounterData">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("encounterData") %>' Height="100px" TextMode="MultiLine" ToolTip="Enter encounter note data here." Width="75%"></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Height="100px" Text='<%# Bind("encounterData") %>'
                            TextMode="MultiLine" Width="75%"></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("encounterData") %>'
                            Width="75%"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Assessment" SortExpression="encounterAssessment">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("encounterAssessment") %>' Height="100px" TextMode="MultiLine" ToolTip="Enter encounter note Assessment data here." Width="75%"></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Height="100px" Text='<%# Bind("encounterAssessment") %>'
                            TextMode="MultiLine" Width="75%"></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("encounterAssessment") %>'
                            Width="75%"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Plan" SortExpression="encounterPlan">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("encounterPlan") %>' Height="100px" TextMode="MultiLine" ToolTip="Enter encounter notes Plan data here." Width="75%"></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Height="100px" Text='<%# Bind("encounterPlan") %>'
                            TextMode="MultiLine" Width="75%"></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("encounterPlan") %>'
                            Width="75%"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Follow-up Date" SortExpression="followupDate">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("followupDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                        <asp:CompareValidator
                            ID="FollowupDateCompareValidator" runat="server" ErrorMessage="** Please use the mm/dd/yyyy date format." ControlToValidate="TextBox6" Display="Dynamic" ForeColor="White" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("followupDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                        <asp:CompareValidator
                            ID="FollowupDateCompareValidator" runat="server" ErrorMessage="** Please use the mm/dd/yyyy date format." ControlToValidate="TextBox6" Display="Dynamic" ForeColor="White" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label7" runat="server" Text='<%# Bind("followupDate","{0:MM/dd/yyyy}") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ShowInsertButton="True" ShowEditButton="True" ButtonType="Button" NewText="New Encounter" />
            </Fields>
            <HeaderTemplate>Encounter Notes: <%# Eval("firstName") %> <%#Eval("lastName") %></HeaderTemplate>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" Width="25%" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <HeaderStyle BackColor="LightSlateGray" Font-Bold="False" ForeColor="White" Font-Size="Large" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    
        </asp:DetailsView>
        <asp:SqlDataSource ID="EncounterNotesDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString1 %>"
            DeleteCommand="DELETE FROM nav_EncounterNotes_tbl WHERE (encounterID = @encounterID)"
            InsertCommand="INSERT INTO nav_EncounterNotes_tbl(carePlanID, encounterDate, staffID, interactionTypeID, interactionReasonID, encounterCatOther, encounterData, encounterAssessment, encounterPlan, encounterDuration, followupDate, appointmentDateTime, appointmentScheduled) VALUES (@carePlanID, @encounterDate, @staffID, @interactionTypeID, @interactionReasonID, @encounterCatOther, @encounterData, @encounterAssessment, @encounterPlan, @encounterDuration, @followupDate, @appointmentDateTime, @appointmentScheduled)"
            SelectCommand="SELECT nav_EncounterNotes_tbl.encounterID, nav_EncounterNotes_tbl.carePlanID, nav_EncounterNotes_tbl.encounterDate, nav_EncounterNotes_tbl.staffID, nav_EncounterNotes_tbl.interactionTypeID, nav_EncounterNotes_tbl.interactionReasonID, nav_EncounterNotes_tbl.encounterCatOther, nav_EncounterNotes_tbl.encounterData, nav_EncounterNotes_tbl.encounterAssessment, nav_EncounterNotes_tbl.encounterPlan, nav_Patients_tbl.lastName, nav_Patients_tbl.firstName, nav_EncounterNotes_tbl.encounterDuration, nav_EncounterNotes_tbl.followupDate, nav_EncounterNotes_tbl.appointmentDateTime, nav_EncounterNotes_tbl.appointmentScheduled FROM nav_EncounterNotes_tbl INNER JOIN nav_CarePlans_tbl ON nav_EncounterNotes_tbl.carePlanID = nav_CarePlans_tbl.carePlanID INNER JOIN nav_Patients_tbl ON nav_CarePlans_tbl.patientID = nav_Patients_tbl.patientID WHERE (nav_EncounterNotes_tbl.carePlanID = @carePlanID) ORDER BY nav_EncounterNotes_tbl.encounterDate DESC"
            UpdateCommand="UPDATE nav_EncounterNotes_tbl SET carePlanID = @carePlanID, encounterDate = @encounterDate, staffID = @staffID, interactionTypeID = @interactionTypeID, interactionReasonID = @interactionReasonID, encounterCatOther = @encounterCatOther, encounterData = @encounterData, encounterAssessment = @encounterAssessment, encounterPlan = @encounterPlan, encounterDuration = @encounterDuration, followupDate = @followupDate, appointmentDateTime = @appointmentDateTime, appointmentScheduled = @appointmentScheduled WHERE (encounterID = @encounterID)">
            <SelectParameters>
                <asp:QueryStringParameter Name="carePlanID" QueryStringField="carePlanID" Type="Int32" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="encounterID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="carePlanID" Type="Int32" />
                <asp:Parameter Name="encounterDate" Type="DateTime" />
                <asp:Parameter Name="staffID" Type="Int32" />
                <asp:Parameter Name="interactionTypeID" Type="Int32" />
                <asp:Parameter Name="interactionReasonID" Type="Int32" />
                <asp:Parameter Name="encounterCatOther" Type="String" />
                <asp:Parameter Name="encounterData" Type="String" />
                <asp:Parameter Name="encounterAssessment" Type="String" />
                <asp:Parameter Name="encounterPlan" Type="String" />
                <asp:Parameter Name="encounterDuration" />
                <asp:Parameter Name="followupDate" />
                <asp:Parameter Name="appointmentDateTime" />
                <asp:Parameter Name="appointmentScheduled" />
                <asp:Parameter Name="encounterID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="carePlanID" Type="Int32" />
                <asp:Parameter Name="encounterDate" Type="DateTime" />
                <asp:Parameter Name="staffID" Type="Int32" />
                <asp:Parameter Name="interactionTypeID" Type="Int32" />
                <asp:Parameter Name="interactionReasonID" Type="Int32" />
                <asp:Parameter Name="encounterCatOther" Type="String" />
                <asp:Parameter Name="encounterData" Type="String" />
                <asp:Parameter Name="encounterAssessment" Type="String" />
                <asp:Parameter Name="encounterPlan" Type="String" />
                <asp:Parameter Name="encounterDuration" />
                <asp:Parameter Name="followupDate" />
                <asp:Parameter Name="appointmentDateTime" />
                <asp:Parameter Name="appointmentScheduled" />
            </InsertParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        <asp:SqlDataSource ID="StaffDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString1 %>"
            SelectCommand="SELECT * FROM [nav_Employee_tbl] ORDER BY [stfLastName]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="InteractionTypeDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString1 %>"
            SelectCommand="SELECT * FROM [nav_InteractionType_tbl]"></asp:SqlDataSource>
        &nbsp;&nbsp;<asp:SqlDataSource ID="InteractionReasonDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString1 %>"
            SelectCommand="SELECT * FROM [nav_InteractionReason_tbl]"></asp:SqlDataSource>
    </p>
    <p>
        &nbsp;</p>
        </asp:View>        
        <asp:View ID="View3" runat="server">
            <p>
            <asp:DetailsView ID="StepsDetailsView" runat="server" AllowPaging="True" AutoGenerateRows="False"
                DataKeyNames="careplanStepsID,encounterID" DataSourceID="StepsDataSource" Height="50px" Width="75%" CellPadding="5" ForeColor="#333333" GridLines="None" BorderStyle="Solid" HeaderText="Care Plan Steps" CellSpacing="5" OnItemInserting="StepsDetailsView_ItemInsert">
                <Fields>
                    <asp:TemplateField HeaderText="Step Type" SortExpression="stepTypeID">
                        <EditItemTemplate>
                        <asp:DropDownList ID="StepTypeDropDown" runat="server" DataSourceID="StepTypeDataSource"
            DataTextField="stepType" DataValueField="stepTypeID" SelectedValue='<%# Bind("stepTypeID") %>' AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem>
        </asp:DropDownList>     
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="StepTypeDropDown" runat="server" DataSourceID="StepTypeDataSource"
            DataTextField="stepType" DataValueField="stepTypeID" SelectedValue='<%# Bind("stepTypeID") %>' AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem>
        </asp:DropDownList>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:DropDownList ID="StepTypeDropDown" runat="server" DataSourceID="StepTypeDataSource"
            DataTextField="stepType" DataValueField="stepTypeID" SelectedValue='<%# Bind("stepTypeID") %>' Enabled="false" AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem>
        </asp:DropDownList>
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Category" SortExpression="careplanCatID">
                        <EditItemTemplate>
                        <asp:DropDownList ID="CarePlanCatDropDownList" runat="server" DataSourceID="CarePlanCategoryDataSource"
            DataTextField="careplanCategory" DataValueField="careplanCatID" SelectedValue='<%# Bind("careplanCatID") %>' AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem>
        </asp:DropDownList>     
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="CarePlanCatDropDownList" runat="server" DataSourceID="CarePlanCategoryDataSource"
            DataTextField="careplanCategory" DataValueField="careplanCatID" SelectedValue='<%# Bind("careplanCatID") %>' AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem>
        </asp:DropDownList>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:DropDownList ID="CarePlanCatDropDownList" runat="server" DataSourceID="CarePlanCategoryDataSource"
            DataTextField="careplanCategory" DataValueField="careplanCatID" SelectedValue='<%# Bind("careplanCatID") %>' Enabled="false" AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem>
        </asp:DropDownList>
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="careplanStepsID" HeaderText="careplanStepsID" InsertVisible="False"
                        ReadOnly="True" SortExpression="careplanStepsID" Visible="False" />
                    <asp:BoundField DataField="encounterID" HeaderText="encounterID" SortExpression="encounterID" InsertVisible="False" Visible="False" />
                    <asp:BoundField DataField="step" HeaderText="Step Description" SortExpression="step" NullDisplayText="No steps assigned. Click the Edit button to add first step." >
                        <ControlStyle Width="300px" />
                        <ItemStyle Width="300px" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Creation Date" SortExpression="stepCreationDate">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("stepCreationDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                            <asp:CompareValidator
                            ID="stepCreationDateCompareValidator" runat="server" ErrorMessage="** Please use the mm/dd/yyyy date format." ControlToValidate="TextBox1" Display="Dynamic" ForeColor="White" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("stepCreationDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                            <asp:CompareValidator
                            ID="stepCreationDateCompareValidator" runat="server" ErrorMessage="** Please use the mm/dd/yyyy date format." ControlToValidate="TextBox1" Display="Dynamic" ForeColor="White" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("stepCreationDate","{0:MM/dd/yyyy}") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Status" SortExpression="stepStatusID">
                        <EditItemTemplate>
                        <asp:DropDownList ID="StepStatusDropDownList" runat="server" DataSourceID="StepStatusDataSource" DataTextField="status" DataValueField="stepStatusID" SelectedValue='<%# Bind("stepStatusID") %>' AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem></asp:DropDownList>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="StepStatusDropDownList" runat="server" DataSourceID="StepStatusDataSource" DataTextField="status" DataValueField="stepStatusID" SelectedValue='<%# Bind("stepStatusID") %>' AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem></asp:DropDownList>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:DropDownList ID="StepStatusDropDownList" runat="server" DataSourceID="StepStatusDataSource" DataTextField="status" DataValueField="stepStatusID" SelectedValue='<%# Bind("stepStatusID") %>' Enabled="false" AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem></asp:DropDownList>
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="responsibility" HeaderText="Responsibility" SortExpression="responsibility" />
                    <asp:TemplateField HeaderText="Target Date" SortExpression="targetDate">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("targetDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                            <asp:CompareValidator
                            ID="targetDateCompareValidator" runat="server" ErrorMessage="** Please use the mm/dd/yyyy date format." ControlToValidate="TextBox2" Display="Dynamic" ForeColor="White" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("targetDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                            <asp:CompareValidator
                            ID="targetDateCompareValidator" runat="server" ErrorMessage="** Please use the mm/dd/yyyy date format." ControlToValidate="TextBox2" Display="Dynamic" ForeColor="White" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("targetDate","{0:MM/dd/yyyy}") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="comments" HeaderText="Comments" SortExpression="comments" NullDisplayText="Use this section to provide details about the progress step." >
                        <ControlStyle Height="75px" Width="75%" />
                        <ItemStyle Height="75px" Width="75%" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Staff Reporting" SortExpression="staffID">
                    <EditItemTemplate>
                        <asp:DropDownList ID="StaffDropDownList" runat="server" DataSourceID="StaffDataSource" DataTextField="stfLastName" DataValueField="staffID" SelectedValue='<%# Bind("staffID") %>' AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem></asp:DropDownList>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="StaffDropDownList" runat="server" DataSourceID="StaffDataSource" DataTextField="stfLastName" DataValueField="staffID" SelectedValue='<%# Bind("staffID") %>' AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem></asp:DropDownList>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:DropDownList ID="StaffDropDownList" runat="server" DataSourceID="StaffDataSource" DataTextField="stfLastName" DataValueField="staffID" SelectedValue='<%# Bind("staffID") %>' Enabled="false" AppendDataBoundItems="true"><asp:ListItem Value="">(None)</asp:ListItem></asp:DropDownList>
                    </ItemTemplate>
                </asp:TemplateField>
                    <asp:TemplateField HeaderText="Completion Date" SortExpression="stepCompletionDate">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("stepCompletionDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                            <asp:CompareValidator
                            ID="stepCompletionDateCompareValidator" runat="server" ErrorMessage="** Please use the mm/dd/yyyy date format." ControlToValidate="TextBox3" Display="Dynamic" ForeColor="White" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("stepCompletionDate","{0:MM/dd/yyyy}") %>'></asp:TextBox>
                            <asp:CompareValidator
                            ID="stepCompletionDateCompareValidator" runat="server" ErrorMessage="** Please use the mm/dd/yyyy date format." ControlToValidate="TextBox3" Display="Dynamic" ForeColor="White" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("stepCompletionDate","{0:MM/dd/yyyy}") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:CheckBoxField DataField="hideStep" HeaderText="hideStep" SortExpression="hideStep" InsertVisible="False" Visible="False" />
                    <asp:CommandField ShowEditButton="True" ShowInsertButton="True" ButtonType="Button" NewText="Add New Step" />
                </Fields>
                <HeaderTemplate>Progress Steps: <%# Eval("firstName") %> <%# Eval("lastName") %></HeaderTemplate>
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" Width="15%" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <HeaderStyle BackColor="LightSlateGray" Font-Bold="False" ForeColor="White" Font-Size="Large" />
                <EditRowStyle BackColor="#999999" />
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            </asp:DetailsView>
            <asp:SqlDataSource ID="StepsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString1 %>"
                DeleteCommand="DELETE FROM [nav_carePlanSteps_tbl] WHERE [careplanStepsID] = @careplanStepsID"
                InsertCommand="INSERT INTO nav_carePlanSteps_tbl(encounterID, stepCreationDate, step, stepStatusID, responsibility, targetDate, comments, staffID, stepCompletionDate, hideStep, stepTypeID, careplanCatID) VALUES (@encounterID, @stepCreationDate, @step, @stepStatusID, @responsibility, @targetDate, @comments, @staffID, @stepCompletionDate, @hideStep, @stepTypeID, @careplanCatID)"
                SelectCommand="SELECT nav_carePlanSteps_tbl.careplanStepsID, nav_carePlanSteps_tbl.encounterID, nav_carePlanSteps_tbl.stepCreationDate, nav_carePlanSteps_tbl.step, nav_carePlanSteps_tbl.stepStatusID, nav_carePlanSteps_tbl.responsibility, nav_carePlanSteps_tbl.targetDate, nav_carePlanSteps_tbl.comments, nav_carePlanSteps_tbl.staffID, nav_carePlanSteps_tbl.stepCompletionDate, nav_carePlanSteps_tbl.hideStep, nav_Patients_tbl.lastName, nav_Patients_tbl.middleName, nav_Patients_tbl.firstName, nav_carePlanSteps_tbl.stepTypeID, nav_carePlanSteps_tbl.careplanCatID FROM nav_carePlanSteps_tbl INNER JOIN nav_EncounterNotes_tbl ON nav_carePlanSteps_tbl.encounterID = nav_EncounterNotes_tbl.encounterID INNER JOIN nav_CarePlans_tbl ON nav_EncounterNotes_tbl.carePlanID = nav_CarePlans_tbl.carePlanID INNER JOIN nav_Patients_tbl ON nav_CarePlans_tbl.patientID = nav_Patients_tbl.patientID WHERE (nav_carePlanSteps_tbl.encounterID = @encounterID) ORDER BY nav_carePlanSteps_tbl.stepCreationDate DESC"
                UpdateCommand="UPDATE nav_carePlanSteps_tbl SET encounterID = @encounterID, stepCreationDate = @stepCreationDate, step = @step, stepStatusID = @stepStatusID, responsibility = @responsibility, targetDate = @targetDate, comments = @comments, staffID = @staffID, stepCompletionDate = @stepCompletionDate, hideStep = @hideStep, stepTypeID = @stepTypeID, careplanCatID = @careplanCatID WHERE (careplanStepsID = @careplanStepsID)">
                <SelectParameters>
                    <asp:ControlParameter ControlID="EncounterDetailsView" Name="encounterID" PropertyName="SelectedValue"
                        Type="Int32" />
                </SelectParameters>
                <DeleteParameters>
                    <asp:Parameter Name="careplanStepsID" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="encounterID" Type="Int32" />
                    <asp:Parameter Name="stepCreationDate" Type="DateTime" />
                    <asp:Parameter Name="step" Type="String" />
                    <asp:Parameter Name="stepStatusID" Type="Int32" />
                    <asp:Parameter Name="responsibility" Type="String" />
                    <asp:Parameter Name="targetDate" Type="DateTime" />
                    <asp:Parameter Name="comments" Type="String" />
                    <asp:Parameter Name="staffID" Type="Int32" />
                    <asp:Parameter Name="stepCompletionDate" Type="DateTime" />
                    <asp:Parameter Name="hideStep" Type="Boolean" />
                    <asp:Parameter Name="stepTypeID" />
                    <asp:Parameter Name="careplanCatID" />
                    <asp:Parameter Name="careplanStepsID" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="encounterID" Type="Int32" />
                    <asp:Parameter Name="stepCreationDate" Type="DateTime" />
                    <asp:Parameter Name="step" Type="String" />
                    <asp:Parameter Name="stepStatusID" Type="Int32" />
                    <asp:Parameter Name="responsibility" Type="String" />
                    <asp:Parameter Name="targetDate" Type="DateTime" />
                    <asp:Parameter Name="comments" Type="String" />
                    <asp:Parameter Name="staffID" Type="Int32" />
                    <asp:Parameter Name="stepCompletionDate" Type="DateTime" />
                    <asp:Parameter Name="hideStep" Type="Boolean" />
                    <asp:Parameter Name="stepTypeID" />
                    <asp:Parameter Name="careplanCatID" />
                </InsertParameters>
            </asp:SqlDataSource>
        <asp:SqlDataSource ID="CarePlanCategoryDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString1 %>"
            SelectCommand="SELECT * FROM [nav_carePlanCategories_tbl] ORDER BY [careplanCategory]">
        </asp:SqlDataSource>
                <asp:SqlDataSource ID="StepTypeDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString1 %>"
                    SelectCommand="SELECT * FROM [nav_CarePlanStepsType_tbl]"></asp:SqlDataSource>
                <asp:SqlDataSource ID="StepStatusDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString1 %>"
                    SelectCommand="SELECT * FROM [nav_careplanStepStatus_tbl]"></asp:SqlDataSource>
           </p>
        </asp:View>   
        <asp:View ID="View4" runat="server">
            <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                DataSourceID="SqlDataSource1" Height="50px" Width="125px">
            </asp:DetailsView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ApplicationConnectionString1 %>" 
                SelectCommand="SELECT nav_CarePlans_tbl.patientID AS Expr1, nav_Patients_tbl.* FROM nav_Patients_tbl INNER JOIN nav_CarePlans_tbl ON nav_Patients_tbl.patientID = nav_CarePlans_tbl.patientID WHERE (nav_Patients_tbl.patientID = @patientID)">
                <SelectParameters>
                    <asp:ControlParameter ControlID="CarePlanDetailsView" Name="patientID" 
                        PropertyName="SelectedValue" />
                </SelectParameters>
            </asp:SqlDataSource>
        </asp:View>     
    </asp:MultiView>

Open in new window

0
Comment
Question by:nbotts
  • 2
2 Comments
 

Author Comment

by:nbotts
ID: 23614209
Part of my thinking in regards to the control is that the patientID value that I am trying to grab from the "CarePlanDetailsView" is not the "SelectedValue" and so the SelectParameters statement is returning nothing...

Not sure if that makes sense.
0
 

Accepted Solution

by:
nbotts earned 0 total points
ID: 23618378
Well instead of trying to get it from the control I ended up passing the value in the querystring and ended up grabbing it from there. This worked, but I'm a bit perplexed to the degree that I was able to grab the value from the controls for the other views.

As mentioned before I wonder whether it has something to do with SelectedValue and maybe at that state of the application the value I am requesting is not the "SelectedValue" at that time.

Still have a lot to learn...
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question