ASP.NET Blank Page or Internet Explorer cannot display the webpage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lorie0114
    New Member
    • Jan 2008
    • 7

    ASP.NET Blank Page or Internet Explorer cannot display the webpage

    Hello,

    We have an issue that I do not know how to resolve. Our website has several hundred reports. There are a handful of them that are causing issues when there is no interaction for a couple of minutes between client and web server. We are using .NET 2005, Framework 2.0 with an Oracle 9i database.

    Our application has several hundred reports, but only several reports have this issue; the reports with the issues do not write anything to the error log file, they just produce a “blank screen” or a message “Internet Explorer cannot display the webpage”.

    The report when executed initially has no issues and if the user stays active by either paging through the data or on data maintenance screens clicking on objects that causes a postback it continues to work. If there is no interaction between the Client and the web server for a couple of minutes then we either get a “blank Screen” or “Internet Explorer cannot display the webpage”.

    These reports all had paging, and we removed paging from one of the reports and it still produces the same error.

    This error occurs on both the Production and Development server (which is accessed through the internet/firewalls), but does not happen on the developer’s local machine. The Production and Development server’s operating system is 2003, the developer’s operating system is XP Professional.

    An example of a size of a report is 833KB, when I remove the viewstate information it is 399KB.

    Any help or suggestions would be greatly appreciated.

    Sincerely,
    Lorie
  • nateraaaa
    Recognized Expert Contributor
    • May 2007
    • 664

    #2
    It sounds like your Session state is timing out causing you to lose access to the page. Fixing this depends on how you manage session. Are you using the oracle DB to manage your session state?

    Nathan

    Comment

    • Lorie0114
      New Member
      • Jan 2008
      • 7

      #3
      We are not using Oracle to manage our session. It sounds like a session problem since it only happens after a couple of minutes. But, when a user logs into the site we assign session variable based on security levels. In each report we check to see if the session is still valid, if not we log the user out.

      After a user experiences a "blank page' or “Internet Explorer cannot display the webpage”, the user is still able to execute this same report by either hitting the back button or coming in from the initial page. I set Trace=True and I can still see the session variables.

      Also, If I limited the data, it works correctly.

      Comment

      • nateraaaa
        Recognized Expert Contributor
        • May 2007
        • 664

        #4
        Could you post the code that displays the report?

        thanks
        Nathan

        Comment

        • Lorie0114
          New Member
          • Jan 2008
          • 7

          #5
          Nathan,

          Thank you for taking time to review this.

          I have included 2 different reports that are causing this issue. The SOBTCseAddCompl etion.aspx report allows users to associate a date with a student and indicate if a student has completed a course, when the btnSubmit is clicked all the records are inserted into the database using a stored procedure. This report had paging and allowed users to determine how many records they want to display on a screen at one time. I had removed the paging in an attempt to see if it solved the issue, but it didn't. If I limited the page during the ddlRate dropdown box, it works correctly. The size of a limited page that worked was 66kb the size of the page that didn't work was 809kb. I don't know if the size has anything to do with it.

          Another report that produces the same issue is a basic report RqmtsAviationTr ngRqmtManBillet s.aspx, it just displays data in a datagrid. This report does not insert/update information into the database.

          We have similar reports that do not produce this error when a postback is executed after a minute of idle time.

          Sorry that the code is not displaying.
          When I put around the code it give me an error. When I put [HTML][/HTML] around the code it does not display (see my post below). I will continue to look through the help.

          Comment

          • Lorie0114
            New Member
            • Jan 2008
            • 7

            #6
            [HTML]
            Code:
            <%@ Page Language="vb" AutoEventWireup="false"  Trace="true" CodeBehind="SOBTCseAddCompletion.aspx.vb" Inherits="Fleet.SOBTCseAddCompletion" %>
            <%@ Register TagPrefix="Fleet" TagName="FleetHeader" Src ="~/Controls/cntrlFleetHeader.ascx" %>
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            
            <html xmlns="http://www.w3.org/1999/xhtml" >
            <head runat="server">
                	<title>Fleet - Courses - Learning Event Completion Entry Form</title>
            		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR" />
            		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE" />
            		<meta content="JavaScript" name="vs_defaultClientScript" />
            		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema" />
            		<!-- #include virtual="/Fleet/Styles.htm" -->
            		<!-- #include virtual="/Fleet/include/SessionTimeout/timer.htm" -->
            </head>
            	<body >
            		<form id="frmCompl"  method="post" runat="server">
            			<table width="100%" border="0">
            				<tr>
            					<td colspan="4">
            						<Fleet:FleetHeader id="FleetHeader" runat="server"></Fleet:FleetHeader>
            					</td>
            				</tr>
            				<tr>
            					<td class="fieldName" colspan="1">
            						<asp:label id="lblUnAuth" Runat="server" Visible="false"></asp:label>
            						Select Course:
            					</td>
            					<td colspan="3" align="left">
            						<asp:dropdownlist id="ddlSelCin" runat="server" BackColor="LemonChiffon"  AutoPostBack="True" >
            						<asp:ListItem value="Select" Selected="true">Filtered By</asp:ListItem>
            						<asp:ListItem value="CourseNumber">Course Number</asp:ListItem>
            						<asp:ListItem Value="CourseTitle">Course Title</asp:ListItem>
            						<asp:ListItem Value="WarfareArea">Warfare Area</asp:ListItem>
            						</asp:dropdownlist>			
            					</td>
            				</tr>
            			<tr>
            				<td class="fieldName" colspan="1" style="width: 15%">
            					<asp:label id="lblCinTitle" Runat="server" Visible="false">
            						CIN/Course Title: 
            					</asp:label>
            				</td>
            				<td colspan="3" align="left">
            					<asp:label id="lblCIN" Runat="server" visible="True"></asp:label>
            			       &nbsp; <asp:label id="lblCseTitle" Runat="server" visible="True"></asp:label>
            		    	</td>
            			</tr>		
            		
            				<tr>
            					<td class="fieldName" id="tdComplDt" runat="server" style="width: 15%" >
            						Completion Date:
            					</td>
            					<td colspan="3">
            						<asp:textbox id="txtDate" Runat="server" BackColor="WhiteSmoke" Width="150"></asp:textbox>
            						&nbsp; 						
            						<a id="aCalendar" runat="server" 
            							href="javascript:calendar_window=window.open('/Fleet/calendar.aspx?formname=frmCompl.txtDate&amp;rptNm=NETC','calendar_window','width=275,height=225');calendar_window.focus()">
            							Calendar
            						</a>  
            						
            							
            						<asp:textbox id="lblWarn" Runat="server" Visible="False" Width="328px" ForeColor="Red" CssClass="TableData"
            							BorderStyle="None" BorderWidth="0px">
            							You must first select a completion date.
            						</asp:textbox>
            					</td>
            				</tr>
            				<tr>
            					<td class="fieldName" id="tdSearch" runat="server" >
            						Search by Name:
            					</td>
            					<td colspan="3">
            						<asp:TextBox Runat="server" ID="txtFilter" BorderStyle="Inset" BorderColor="white"  Width="150"></asp:TextBox>
            						&nbsp;&nbsp;&nbsp;
            						<asp:Button ID="btnFilter" Runat="server" Text="Filter" BackColor="SteelBlue" ForeColor="white"
            							Font-Bold="True"></asp:Button>
            						&nbsp;&nbsp;&nbsp;
            						<asp:label ID="lblFilterWarn" Runat="server" Visible="False" Width="328px" ForeColor="red"
            							CssClass="TableData" BorderStyle="None" BorderWidth="0px">
            							No records found for your criteria.
            						</asp:label>
            					</td>
            				</tr>
            				<tr>
            					<td class="fieldName" id="tdSSNSearch" runat="server" style="width: 15%">
            						Search by SSN:
            					</td>
            					<td>
            						<asp:TextBox Runat="server" ID="txtFilterSSN" BorderStyle="Inset" BorderColor="white" TextMode="Password"  Width="150"></asp:TextBox>
            						&nbsp;&nbsp;&nbsp;
            						<asp:Button ID="btnFilterSSN" Runat="server" Text="Filter" BackColor="SteelBlue" ForeColor="white"
            							Font-Bold="True"></asp:Button>
            						&nbsp;&nbsp;&nbsp;
            						<asp:label ID="lblFilterSSNWarn" Runat="server" Visible="False" Width="328px" ForeColor="red"
            							CssClass="TableData" BorderStyle="None" BorderWidth="0px">
            							No records found for your criteria.
            						</asp:label>
            					</td>
            				</tr>
            				<tr>
            					<td class="fieldName" id="td1" runat="server" style="width: 15%">
            						Search by Rate:
            					</td>
            					<td>
            							<asp:DropDownList ID="ddlRate" Runat="server" CssClass="entryScreenDropDown"  AutoPostBack="true" ></asp:DropDownList>
            						&nbsp;&nbsp;&nbsp;
            						<asp:label ID="lblFilterRateWarn" Runat="server" Visible="False" Width="328px" ForeColor="red"
            							CssClass="TableData" BorderStyle="None" BorderWidth="0px">
            							No records found for your criteria.
            						</asp:label>
            					</td>
            				</tr>
            				<tr>
            					<td colspan="4">
            						<asp:textbox id="lblSaveMsg" Runat="server" ForeColor="red" CssClass="FieldName" BorderStyle="None"
            							Width="100%" BorderWidth="0px"></asp:textbox>
            					</td>
            				</tr>
            				<tr>
            					<td colspan="4">
            						<asp:textbox id="lblWarnSelCse" Runat="server" Visible="False" Width="328px" ForeColor="Red"
            							CssClass="FieldName" BorderStyle="None" BorderWidth="0px">
            							You must first select a CIN/Course
            						</asp:textbox>
            					</td>
            				</tr>
            				<tr>
            					<td colspan="4"><asp:Label ID="lblWarnDupe" Runat="server" CssClass="warning"></asp:Label></td>
            				</tr>
            			</table>
            			<table  align="center">
            				<tr>
            					<td align="left" colspan="2">
            						<a id="aMarkAll" runat="server" name="Mark">Mark All As Completed </a>
            					</td>
            					<td align="right">
            			<asp:HyperLink ID="hlComplRpt" Runat="server" Target="_blank">View Course Completions</asp:HyperLink>
            					</td>
            
            				</tr>
            				<tr>
            					<td>
            						<asp:Label ID="lblWarnNoData" Runat="server" Visible="False" CssClass="warning">
            							No Records Found For Your Selection.
            						</asp:Label>
            					</td>
            				</tr>
            				<tr>
            					<td align="center" colspan="3">
            						<asp:datagrid id="dgComplList" Runat="server" CssClass="tableData"  AllowPaging="false"
            							HorizontalAlign="Center" OnSortCommand="SortGrid" AllowSorting="True" 
            							 AllowCustomPaging="False" 
            							AutoGenerateColumns="False" HeaderStyle-BackColor="steelblue" HeaderStyle-CssClass="FieldName"
            							HeaderStyle-ForeColor="white" HeaderStyle-HorizontalAlign="left" ItemStyle-VerticalAlign="Bottom" >
            							<Columns>
            								<asp:TemplateColumn HeaderText="Completed" ItemStyle-HorizontalAlign="Center" >
            									<ItemTemplate>
            										<asp:CheckBox  Runat="server" ID="cbCompl"></asp:CheckBox>
            									</ItemTemplate>
            								</asp:TemplateColumn>
            								<asp:HyperLinkColumn DataNavigateUrlFormatString="/Fleet/PersIDSRedirect.aspx?IDSSSN={0}&BUTTON=ETJTraining" DataNavigateUrlField="SSN_IND"
            									Target="_blank" DataTextField="NAME" HeaderText="Name" ItemStyle-HorizontalAlign="Left"  SortExpression="NAME DESC"></asp:HyperLinkColumn>
            								<asp:BoundColumn DataField="SSN" HeaderText="SSN" SortExpression="SSN DESC"></asp:BoundColumn>
            								<asp:BoundColumn DataField="UIC" HeaderText="UIC" SortExpression="UIC DESC" Visible="False"></asp:BoundColumn>
            								<asp:BoundColumn DataField="ENR_DT" HeaderText="Enroll Date" Visible="False"></asp:BoundColumn>
            								<asp:TemplateColumn HeaderText="Completion Date" SortExpression="COMPL_DT DESC" ItemStyle-HorizontalAlign="Left">
            									<ItemTemplate >
            										<asp:textbox id="txtComplDt" Runat="server" BackColor="WhiteSmoke"></asp:textbox>
            										<asp:HyperLink runat="server" id="hlCalendar">Change Date</asp:HyperLink>
            									</ItemTemplate>
            								</asp:TemplateColumn>
            								<asp:BoundColumn DataField="Score" HeaderText="Score" Visible="False" SortExpression="SCORE DESC"></asp:BoundColumn>
            								<asp:BoundColumn DataField="TRNG_DELIV_METH_DESCR" HeaderText="Training Delivery Method" Visible="False"></asp:BoundColumn>
            								<asp:BoundColumn DataField="CSE_LEN" HeaderText="Course Length" Visible="False"></asp:BoundColumn>
            								<asp:BoundColumn DataField="CSE_INTERVL" HeaderText="Interval" Visible="False"></asp:BoundColumn>
            								<asp:BoundColumn DataField="PERS_GRP_CD" HeaderText="Cell 10" Visible="False"></asp:BoundColumn>
            								<asp:TemplateColumn HeaderText="Personnel<br>Group">
            									<ItemTemplate>
            										<asp:Label Runat="server" ID="lblPersGrpCd"></asp:Label>
            									</ItemTemplate>
            								</asp:TemplateColumn>
            								<asp:BoundColumn DataField="COMPL_DT" Visible="False" HeaderText="Cell 12"></asp:BoundColumn>
            								<asp:TemplateColumn >
            									<HeaderStyle BackColor="" BorderStyle="None"  ></HeaderStyle>
            									<ItemStyle BackColor="" BorderStyle="None"></ItemStyle>
            									<ItemTemplate>
            										<asp:textbox Runat="server" ID="txtChangeInd" BorderStyle="None" Width="0" BorderColor="white" BorderWidth="0" ></asp:textbox>
            									</ItemTemplate>
            								</asp:TemplateColumn>
            								<asp:BoundColumn DataField="SSN_IND" Visible="False" HeaderText="Cell 14"></asp:BoundColumn>
            								<asp:BoundColumn DataField="NAME" Visible="False" HeaderText="Cell 15"></asp:BoundColumn>
            								<asp:BoundColumn DataField="RCRD_SRC" Visible="False" HeaderText="Cell 16"></asp:BoundColumn>
            								<asp:BoundColumn DataField="CSE_UIC" Visible="False" HeaderText="Cell 17"></asp:BoundColumn>
            								<asp:BoundColumn DataField="ENTRY_DT" Visible="False" HeaderText="Cell 18"></asp:BoundColumn>
            								<asp:BoundColumn DataField="CIN" Visible="False" HeaderText="Cell 19"></asp:BoundColumn>
            								<asp:BoundColumn DataField="CSE_LONG_TITLE" Visible="False" HeaderText="Cell 20"></asp:BoundColumn>
            								<asp:BoundColumn DataField="COMPL_IND" Visible="False" HeaderText="Cell 21"></asp:BoundColumn>
            							</Columns>
            						</asp:datagrid></td>
            				</tr>
            				
            				<tr>
            					<td colspan="3">
            						<asp:button id="btnSubmit" style="COLOR: white; BACKGROUND-COLOR: steelblue" 
            							Runat="server" BackColor="SteelBlue" ForeColor="white" Text="Save"></asp:button>
            						&nbsp;&nbsp;&nbsp; <input id="btnReset" type="reset" style="COLOR: white; BACKGROUND-COLOR: steelblue" value="Reset"
            							title="Reset Form Data" runat="server" name="btnReset" />
            					</td>
            				</tr>
            			</table>
            			<asp:label id="hdnSort" Runat="server" Visible="False"></asp:label>
            			<asp:label id="hdnCDP" Runat="server" Visible="False"></asp:label>
            			<asp:label id="hdnCseUIC" Runat="server" Visible="False"></asp:label>
            			<asp:label id="hdnRetire_Point" Runat="server" Visible="False"></asp:label>
            			<asp:label id="hdnCse_Len" Runat="server" Visible="False"></asp:label>
            			<asp:label id="hdnTrng_Deliv_Meth_Cd" Runat="server" Visible="False"></asp:label>
            			<asp:label id="hdnCse_Intervl" Runat="server" Visible="False"></asp:label>
            			<asp:label id="hdnSrchMd" Runat="server" Visible="False"></asp:label>
            			<asp:label id="hdnSrchFld" Runat="server" Visible="False"></asp:label>
            			<asp:textbox id="hdnSaveCnt" Runat="server" Width="0" Visible="false"></asp:textbox>
            			<asp:label id="hdnDelCnt" Runat="server" Visible="False"></asp:label>
            			<asp:label id="hdnUpdtCnt" Runat="server" Visible="False"></asp:label>
            			<asp:Literal ID="Literal1" runat="server" ></asp:Literal>
            		</form>
            	</body>
            </html>
            
            
            Imports Oracle.DataAccess.Client
            Imports Fleet.ConstClass
            Imports System.Text
            Imports System.Configuration.ConfigurationManager
            Partial Public Class SOBTCseAddCompletion
                Inherits System.Web.UI.Page
                Dim strScript As String
                Dim strScriptLink As String
               
                Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
                    Try
                        CheckSession()
                        If Session("svSOBTAccessLvl") = "S" Or Session("svSOBTAccessLvl") = "U" Then
                            lblSaveMsg.Text = ""
                            txtDate.Attributes.Add("ReadOnly", "ReadOnly")
                            txtDate.Attributes.Add("AutoPostBack", "True")
                            If Not Page.IsPostBack Then
                                getrate()
                                WebTracking(frmCompl, 1817, Now, Now, 1, 1, "LOAD")
                                FleetHeader.Header2 = "SOBT Course Completion Entry Form"
                                FleetHeader.AddSelection("UIC:", Request.QueryString("UIC") & " " & Request.QueryString("UICTitle"))
                                hlComplRpt.Visible = True
                                hlComplRpt.NavigateUrl = "/Fleet/SOBT/SOBTPersCseCompletions.aspx?POPUP=Y&FORM=COMPLETION&hdnDept=ALL DEPARTMENTS" & "&hdnUICClass=" & Request.QueryString("UICClass") & "&hdnUIC=" & Request.QueryString("UIC") & "&hdnSender=ByUIC&hdnCIN=" & Request.QueryString("SelCin")
                                If Len(Request.QueryString("SelCin") & "") = 0 Then
                                    dgComplList.Visible = False
                                    btnSubmit.Visible = False
                                    aMarkAll.Visible = False
                                    tdComplDt.Visible = False
                                    tdSearch.Visible = False
                                    tdSSNSearch.Visible = False
                                    aCalendar.Visible = False
                                    btnReset.Visible = False
                                    btnFilter.Visible = False
                                    btnFilterSSN.Visible = False
                                    txtFilter.Visible = False
                                    txtFilterSSN.Visible = False
                                    txtDate.Visible = False
                                    hlComplRpt.Visible = False
                                    lblCinTitle.Visible = False
                                    ddlRate.Visible = False
                                    td1.Visible = False
                                    hdnSrchMd.Text = "Ascending"
                                    hdnSrchFld.Text = "NM"
                                    hdnSaveCnt.Text = "0"
            
                                Else
                                    ddlSelCin.Visible = True
                                    btnSubmit.Visible = True
                                    dgComplList.Visible = True
                                    aMarkAll.Visible = True
                                    txtDate.Visible = True
                                    tdComplDt.Visible = True
                                    tdSearch.Visible = True
                                    tdSSNSearch.Visible = True
                                    aCalendar.Visible = True
                                    btnReset.Visible = True
                                    btnFilter.Visible = True
                                    btnFilterSSN.Visible = True
                                    txtFilter.Visible = True
                                    txtFilterSSN.Visible = True
                                    hlComplRpt.Visible = True
                                    lblCinTitle.Visible = True
                                    ddlRate.Visible = True
                                    td1.Visible = True
                                    lblCseTitle.Text = Request.QueryString("SelCseTitle")
                                    lblCIN.Text = Request.QueryString("SelCin")
                                    GetData()
                                End If
                            End If
                        Else
                            lblUnAuth.Visible = True
                            lblUnAuth.Text = "You are not authorized to view this page."
                            lblUnAuth.ForeColor = Color.Red
                            lblUnAuth.Style.Item("Font-Weight") = "Bold"
                        End If
                    Catch ex As Exception
                        ErrorCapture(frmCompl, ex)
                    End Try
                End Sub
                
                Private Sub GetData()
                    Try
                        CheckSession()
                        Dim objConn As New OracleConnection(Session("svOraProviderString"))
                        Dim DSStudents As New DataSet
                        Dim qryStudents As New StringBuilder
                        qryStudents.Append(" SELECT A.NM NAME, A.UIC_TRNG_UIC_RUC_UIC_CMD UIC, ")
                        qryStudents.Append(" A.PERS_GRP_CD PERS_GRP_CD, ")
                        'Check for full access to SSNs
                        If Session("svSSNAccess") = "F" Then
                            qryStudents.Append(" DECODE(A.SSN_IND,NULL,A.SSN_IND,FUNC_DECRYPTDES3(A.SSN_IND)) SSN, ")
                        Else
                            qryStudents.Append(" DECODE(A.SSN_IND,NULL,A.SSN_IND,'XXXXX'||SUBSTR(FUNC_DECRYPTDES3(A.SSN_IND),6,9)) SSN, ")
                        End If
                        qryStudents.Append(" A.SSN_IND SSN_IND, CIN, CDP, CSE_LONG_TITLE, '' SCORE, '' RETIRE_POINT, ")
                        qryStudents.Append(" '' CSE_LEN, '' TRNG_DELIV_METH_DESCR, RCRD_SRC, COMPL_IND, COMPL_DT, CSE_UIC, ENR_DT, ")
                        qryStudents.Append(" '' USER_UIC, CSE_INTERVL, SPON_SSN_IND, DEPN_TYPE_CD, ENTRY_SSN_IND, ENTRY_DT, ")
                        qryStudents.Append(" DT_SORT from	")
                        qryStudents.Append(" ( select distinct U.SSN_IND SSN_IND, U.CIN, U.CDP, U.CSE_LONG_TITLE, U.RCRD_SRC, ")
                        qryStudents.Append(" DECODE(TO_CHAR(MAX(U.ENTRY_DT),'mm/dd/yyyy'),TO_CHAR(SYSDATE,'mm/dd/yyyy'),1,0) AS COMPL_IND, ")
                        qryStudents.Append(" DECODE(TO_CHAR(MAX(U.ENTRY_DT),'mm/dd/yyyy'),TO_CHAR(SYSDATE,'mm/dd/yyyy'),MAX(COMPL_DT),NULL) AS COMPL_DT, ")
                        qryStudents.Append(" U.CSE_UIC CSE_UIC, max(U.ENR_DT) ENR_DT, U.CSE_INTERVL CSE_INTERVL, U.SPON_SSN_IND SPON_SSN_IND, ")
                        qryStudents.Append(" U.DEPN_TYPE_CD DEPN_TYPE_CD, MAX(U.ENTRY_SSN_IND) ENTRY_SSN_IND, MAX(U.ENTRY_DT) ENTRY_DT, ")
                        qryStudents.Append(" DECODE(MAX(U.ENTRY_DT), NULL, 1, 0) DT_SORT ")
                        qryStudents.Append(" FROM  USER_CSE_COMPL U ")
                        qryStudents.Append(" where (U.CIN(+) = :strCIN2) ")
                        qryStudents.Append(" GROUP BY U.SSN_IND, U.CIN, U.CDP, U.CSE_LONG_TITLE, RCRD_SRC, ")
                        qryStudents.Append(" U.CSE_UIC, U.CSE_INTERVL, U.SPON_SSN_IND, U.DEPN_TYPE_CD ) U, ALL_PERS_GRP A ")
                        qryStudents.Append(" where a.ssn_ind = u.ssn_ind(+) ")
                        If txtFilter.Text <> "" Then
                            qryStudents.Append("AND (A.NM LIKE :strNm ")
                            If txtFilterSSN.Text <> "" Then
                                qryStudents.Append("AND A.SSN_IND = func_encryptdes3(:strSSN)) ")
                            Else
                                qryStudents.Append(")")
                            End If
                        ElseIf txtFilterSSN.Text <> "" Then
                            qryStudents.Append("AND A.SSN_IND = func_encryptdes3(:strSSN) ")
                        End If
                        ' Removed Pending UIC      qryStudents.Append(" and (A.UIC_TRNG_UIC_RUC_UIC_CMD = :strUIC OR A.PENDING_UIC = :strUIC2) ")
                        qryStudents.Append(" and (A.UIC_TRNG_UIC_RUC_UIC_CMD = :strUIC) ")
                        qryStudents.Append(" AND (A.PERS_GRP_CD < 'USN_ENL_LOSS' OR A.PERS_GRP_CD > 'USN_ENL_LOSS') ")
                        qryStudents.Append(" AND (A.PERS_GRP_CD < 'USN_OFF_LOSS' OR A.PERS_GRP_CD > 'USN_OFF_LOSS') ")
                        qryStudents.Append(" AND (A.SSN_IND = U.SSN_IND(+)) ")
                        If ddlRate.SelectedItem.Value <> "NONE" Then
                            qryStudents.Append(" and ( A.desig_grade_rate IN (SELECT DISTINCT  NVL(DESIG_GRADE_RATE,DESIG_RATING) DESIG_GRADE_RATE from display_paygrade where DESIG_RATING = :strRate or DESIG_GRADE_RATE = :strRate ) ) ")
            
            
                        End If
                        If hdnSort.Text <> "" Then
                            qryStudents.Append(hdnSort.Text)
                        Else    
                            qryStudents.Append(" ORDER BY NAME")
                        End If
                        Dim cmdStudents As New OracleDataAdapter(qryStudents.ToString, objConn)
                        cmdStudents.SelectCommand.Parameters.Add("strCIN2", OracleDbType.Varchar2, 30).Value = lblCIN.Text
                        If txtFilter.Text <> "" Then
                            cmdStudents.SelectCommand.Parameters.Add("strNm", OracleDbType.Varchar2, 29).Value = "%" & UCase(txtFilter.Text) & "%"
                            If txtFilterSSN.Text <> "" Then
                                cmdStudents.SelectCommand.Parameters.Add("strSSN", OracleDbType.Varchar2, 32).Value = UCase(txtFilterSSN.Text)
                            End If
                        ElseIf txtFilterSSN.Text <> "" Then
                            cmdStudents.SelectCommand.Parameters.Add("strSSN", OracleDbType.Varchar2, 32).Value = UCase(txtFilterSSN.Text)
                        End If
                        cmdStudents.SelectCommand.Parameters.Add("strUIC", OracleDbType.Varchar2, 6).Value = Request.QueryString("UIC")
                        'cmdStudents.SelectCommand.Parameters.Add("strUIC2", OracleDbType.Varchar2, 6).Value = Request.QueryString("UIC")
            
            
                        If ddlRate.SelectedItem.Value <> "NONE" Then
                            cmdStudents.SelectCommand.Parameters.Add("strRate", OracleDbType.Varchar2, 6).Value = ddlRate.SelectedItem.Value
                        End If
                        Try
                            Dim BegDt As Date = Now
                            cmdStudents.Fill(DSStudents, "STUDENT_RECORDS")
                            Dim count As Int32 = 0
            
                            count = DSStudents.Tables(0).Rows.Count
            
                            If AppSettings("asWebTracking") = "TRUE" Then
                                WebTracking(frmCompl, 1817, BegDt, Now, DSStudents.Tables(0).Rows.Count, count, Request.QueryString("UIC"))
                            End If
                        Catch ex As Exception
                            ErrorCapture(frmCompl, ex)
                        Finally
                            objConn.Close()
                            objConn.Dispose()
                        End Try
                        dgComplList.DataSource = DSStudents
                        dgComplList.DataBind()
                        If DSStudents.Tables(0).Rows.Count = 0 Then
                            If txtFilter.Text <> "" Then
                                lblWarnNoData.Visible = True
                                lblFilterWarn.Visible = True
                                lblFilterSSNWarn.Visible = False
                            ElseIf txtFilterSSN.Text <> "" Then
                                lblWarnNoData.Visible = True
                                lblFilterWarn.Visible = False
                                lblFilterSSNWarn.Visible = True
                            Else
                                lblFilterWarn.Visible = True
                                lblFilterSSNWarn.Visible = False
                                lblWarnNoData.Visible = False
                            End If
                            dgComplList.Visible = False
                            btnSubmit.Visible = False
                            aMarkAll.Visible = False
                            btnReset.Visible = False
                            '   lnkbtnAddStudent.Visible = True
                        Else
                            lblFilterWarn.Visible = False
                            lblFilterSSNWarn.Visible = False
                            lblWarnNoData.Visible = False
                            dgComplList.Visible = True
                            btnSubmit.Visible = True
                            aMarkAll.Visible = True
                            btnReset.Visible = True
                        End If
            
                        Dim intSaveCnt As Int16 = 0
                        Dim intDelCnt As Int16 = 0
                        Dim intUpdtCnt As Int16 = 0
                        If hdnSaveCnt.Text = "" Then      
                            intSaveCnt = 0
                        Else
                            intSaveCnt = CInt(hdnSaveCnt.Text)
                        End If
                        If hdnDelCnt.Text = "" Then
                            intDelCnt = 0
                        Else
                            intDelCnt = CInt(hdnDelCnt.Text)
                        End If
                        If hdnUpdtCnt.Text = "" Then
                            intUpdtCnt = 0
                        Else
                            intUpdtCnt = CInt(hdnUpdtCnt.Text)
                        End If
                        If intSaveCnt + intDelCnt + intUpdtCnt > 0 Then
                            If intSaveCnt = 1 Then
                                lblSaveMsg.Text = "1 Record Added."
                            Else
                                If intSaveCnt > 0 Then
                                    lblSaveMsg.Text = hdnSaveCnt.Text & " Records Added."
                                End If
                            End If
                            If intSaveCnt > 0 And intDelCnt > 0 Then
                                lblSaveMsg.Text += " "
                            End If
                            If intDelCnt = 1 Then
                                lblSaveMsg.Text += "1 Record Deleted."
                            ElseIf intDelCnt > 0 Then
                                lblSaveMsg.Text += hdnDelCnt.Text & " Records Deleted."
                            End If
                            If (intSaveCnt > 0 Or intDelCnt > 0) And intUpdtCnt > 0 Then
                                lblSaveMsg.Text += " "
                            End If
                            If intUpdtCnt = 1 Then
                                lblSaveMsg.Text += "1 Record Updated."
                            ElseIf intUpdtCnt > 0 Then
                                lblSaveMsg.Text += hdnUpdtCnt.Text & " Records Updated."
                            End If
                            lblSaveMsg.Visible = True
                        Else
                            lblSaveMsg.Text = ""
                        End If
                        hdnSaveCnt.Text = ""
                        hdnDelCnt.Text = ""
                        hdnUpdtCnt.Text = ""
                        MarkAll_OnClick()
                    Catch ex As Exception
                        ErrorCapture(frmCompl, ex)
                    End Try
                End Sub
            
                Private Sub dgComplList_ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) Handles dgComplList.ItemDataBound
                    Try
                        CheckSession()
                        If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
                            'Display Completion Information
                            Dim txt As New TextBox
                            txt = e.Item.FindControl("txtComplDt")
                            txt.Attributes.Add("ReadOnly", "ReadOnly")
                            Dim hl As New HyperLink
                            hl = e.Item.FindControl("hlCalendar")
                            Dim txtChange As New TextBox
                            txtChange = e.Item.FindControl("txtChangeInd")
                            txtChange.Attributes.Add("ReadOnly", "ReadOnly")
                            Dim cbBox As New CheckBox
                            cbBox = e.Item.FindControl("cbCompl")
                            Dim lblPersGrp As New Label
                            lblPersGrp = e.Item.FindControl("lblPersGrpCd")
                            'Add link to calendar for datagrid dates  
                            If e.Item.Cells(16).Text = "SOBT" Or e.Item.Cells(16).Text = "&nbsp;" Then
                                hl.NavigateUrl = "javascript:if('" & ddlSelCin.SelectedItem.Value & "' == 'NONE' && '" & e.Item.Cells(12).Text & "' == '&nbsp;'){alert('Please select a CIN/Course Title')}else{calendar_window=window.open('/Fleet/calendar.aspx?formname=frmCompl." & txt.ClientID & "&rptNm=NETC_COMPL" & "&NETC_txtChange=frmCompl." & txtChange.ClientID & "&NETC_cbCompl=frmCompl." & cbBox.ClientID & "','calendar_window','width=275,height=225');calendar_window.focus()};"
                            Else
                                hl.Text = ""
                                cbBox.Enabled = False
                            End If
                            If e.Item.Cells(12).Text <> "&nbsp;" And e.Item.Cells(21).Text = "1" Then
                                cbBox.Checked = True
                                txt.Text = Format(CDate(e.Item.Cells(12).Text), "MM/dd/yyyy")
                            End If
                            Select Case e.Item.Cells(10).Text
                                Case "USN_ENL", "USN_OFF", "USNR_ACDU_ENL", "USNR_ACDU_OFF", "USMC_OFF", "USN/R_OFF_CAND", "USN/R_OFF_PROS_GAIN", "USNR_TAR_ENL", "USNR_TAR_OFF", "USMC_ENL" : lblPersGrp.Text = "ACTIVE"
                                Case "USNR_ENL", "USNR_OFF", "USNR_ACDU_ENL_DRILL", "USNR_ACDU_OFF_DRILL" : lblPersGrp.Text = "RESERVE"
                                Case "CIV_GOVT" : lblPersGrp.Text = "GOVT EMPLOYEE"
                                Case "CONTR_GOVT" : lblPersGrp.Text = "CONTRACTOR"
                                Case "CIV_IBFT" : lblPersGrp.Text = "CIVILIAN"
                                Case "DEPN" : lblPersGrp.Text = "DEPENDENT"
                                Case "USA_OFF", "USA_ENL" : lblPersGrp.Text = "USA"
                                Case "USAF_OFF", "USAF_ENL" : lblPersGrp.Text = "USAF"
                                Case "USCG_OFF", "USCG_ENL" : lblPersGrp.Text = "USCG"
                                Case "FORNAT_OFF", "FORNAT_ENL" : lblPersGrp.Text = "FOREIGN NATIONAL"
                                Case Else : e.Item.Cells(10).Controls.Remove(lblPersGrp)
                                    Dim ddl As New DropDownList
                                    ddl.Items.Add("Select Personnel Group")
                                    ddl.Items.Add("ACTIVE")
                                    ddl.Items.Add("RESERVE")
                                    ddl.Items.Add("CONTRACTOR")
                                    ddl.Items.Add("GOVT EMPLOYEE (CIV)")
                                    ddl.Items.Add("DEPENDENT")
                                    e.Item.Cells(10).Controls.Add(ddl)
                            End Select
                             Dim strCBClick As String = "if('" & e.Item.Cells(12).Text & "' == '&nbsp;'){if(" & cbBox.ClientID & ".checked==true){if(txtDate.value==''&&" & txtChange.ClientID & ".value==''){alert('Please select a completion date first.');" & cbBox.ClientID & ".checked=false;" & txt.ClientID & ".value='';}else{" & txt.ClientID & ".value=txtDate.value;" & txtChange.ClientID & ".value='1';};}else{" & txt.ClientID & ".value='';" & txtChange.ClientID & ".value='';};}else{if(" & cbBox.ClientID & ".checked==true){" & txt.ClientID & ".value='"
                            If e.Item.Cells(12).Text <> "&nbsp;" Then
                                strCBClick = strCBClick & Format(CDate(e.Item.Cells(12).Text), "MM/dd/yyyy") & "';" & txtChange.ClientID & ".value='';}else{" & txt.ClientID & ".value='';" & txtChange.ClientID & ".value='1';};};"
                            Else
                                strCBClick = strCBClick & e.Item.Cells(12).Text & "';" & txtChange.ClientID & ".value='1';}else{" & txt.ClientID & ".value='1'};};"
                            End If
                            Dim strTotCbClick As String = ""
                            strTotCbClick = "if('" & ddlSelCin.SelectedItem.Value & "' == 'NONE' && " & cbBox.ClientID & ".checked==true && " & txtChange.ClientID & ".value==''){alert('Please select a CIN/Course Title');" & cbBox.ClientID & ".checked=false;" & txt.ClientID & ".value='';}else{" & strCBClick & "};"
                            cbBox.Attributes.Add("onClick", strTotCbClick)
                            txt.Attributes.Add("onChange", txtChange.ClientID & ".value='1';" & cbBox.ClientID & ".checked=true;")
                        ElseIf e.Item.ItemType = ListItemType.Header Then
                            Dim x As Int16 = 0
                            For x = 1 To 5
                                Select Case x
                                    Case 1 : If hdnSrchFld.Text = "NM" Then
                                            e.Item.Cells(x).ToolTip = "Click to sort by Name " & hdnSrchMd.Text
                                        Else
                                            e.Item.Cells(x).ToolTip = "Click to sort by Name Ascending"
                                        End If
                                    Case 2 : If hdnSrchFld.Text = "SSN" Then
                                            e.Item.Cells(x).ToolTip = "Click to sort by SSN " & hdnSrchMd.Text
                                        Else
                                            e.Item.Cells(x).ToolTip = "Click to sort by SSN Ascending"
                                        End If
                                    Case 5 : If hdnSrchFld.Text = "COMPL_DT" Then
                                            e.Item.Cells(x).ToolTip = "Click to sort by Completion Date " & hdnSrchMd.Text
                                        Else
                                            e.Item.Cells(x).ToolTip = "Click to sort by Completion Date Ascending"
                                        End If
                                    Case Else : e.Item.Cells(x).ToolTip = ""
                                End Select
                            Next
                        End If
                    Catch ex As Exception
                        ErrorCapture(frmCompl, ex)
                    End Try
                End Sub
            
             
                Sub SortGrid(ByVal sender As Object, ByVal e As DataGridSortCommandEventArgs)
                    Try
                        CheckSession()
                        lblSaveMsg.Text = ""
                        Dim SortExprs() As String
                        Dim CurrentSearchMode As String = ""
                        Dim NewSearchMode As String = ""
                        Dim ColumnToSort As String = ""
                        Dim NewSortExpr As String = ""
                        '  Parse the sort expression - delimiter space
                        SortExprs = Split(e.SortExpression, " ")
                        ColumnToSort = SortExprs(0)
                        ' If a sort order is specified get it, else default is descending
                        If SortExprs.Length() > 1 Then
                            CurrentSearchMode = SortExprs(1).ToUpper()
                            If CurrentSearchMode = "ASC" Then
                                NewSearchMode = "DESC"
                                hdnSrchMd.Text = "Ascending"
                            Else
                                NewSearchMode = "ASC"
                                hdnSrchMd.Text = "Descending"
                            End If
                        Else   ' If no mode specified, Default is descending
                            NewSearchMode = "length0"
                        End If
                        '  Derive the new sort expression. 
                        NewSortExpr = ColumnToSort & " " & NewSearchMode
                        ' Figure out the column index 
                        Dim iIndex As Integer = 0
                        ' Figure out the column index 
                        Select Case ColumnToSort.ToUpper()
                            Case "NAME"
                                iIndex = 1
                                hdnSrchFld.Text = "NM"
                            Case "SSN"
                                iIndex = 2
                                hdnSrchFld.Text = "SSN"
                            Case "UIC"
                                iIndex = 3
                                hdnSrchFld.Text = "UIC"
                            Case "COMPL_DT"
                                iIndex = 5
                                hdnSrchFld.Text = "COMPL_DT"
                            Case "Score"
                                iIndex = 6
                                hdnSrchFld.Text = "SCORE"
                            Case ""
                        End Select
                        hdnSort.Text = " Order by " & NewSortExpr
                        dgComplList.Columns(iIndex).SortExpression = NewSortExpr
                        GetData()
                    Catch ex As Exception
                        ErrorCapture(frmCompl, ex)
                    End Try
                End Sub
            
                Protected Sub SubmitData()
                    Try
                        CheckSession()
                        Dim item As DataGridItem
                        Dim cbBox As New CheckBox
                        Dim lblPersGrp As New Label
                        Dim txt As New TextBox
                        Dim txtChange As New TextBox
                        Dim strComplDt As String = ""
                        Dim valid As Int16 = 1
                        Dim intSaveCnt As Int16 = 0
                        Dim intDelCnt As Int16 = 0
                        Dim intUpdtCnt As Int16 = 0
                        Dim connObj As New OracleConnection(Session("svOraProviderString"))
                        lblWarn.Visible = False
                        lblWarnDupe.Visible = False
                        lblWarnDupe.Text = ""
                        Dim x As Int16 = 0
                        Dim y As Int16 = 0
                        'Declare arrays to be used in Del/Ins Procedures
                        Dim strSSNDel As String() = Nothing
                        Dim strSSNIns As String() = Nothing
                        Dim strCIN As String() = Nothing
                        Dim strCDPDel As String() = Nothing
                        Dim strCDPIns As String() = Nothing
                        Dim dtComplDtDel As Date() = Nothing
                        Dim dtComplDtIns As Date() = Nothing
                        Dim strCseUIC As String() = Nothing
                        Dim strCseLongTitle As String() = Nothing
                        Dim strUIC As String() = Nothing
                        Dim strNmLast As String() = Nothing
                        Dim strNmFirst As String() = Nothing
                        Dim strNmMid As String() = Nothing
                        Dim intRetirePoint As Int16() = Nothing
                        Dim strTrngDelivMethCd As String() = Nothing
                        Dim intCseLen As Int16() = Nothing
                        Dim strCseIntervl As String() = Nothing
                        Dim strPersGrpCd As String() = Nothing
                        Dim strSponSSN As String() = Nothing
                        Dim strDepnTypeCd As String() = Nothing
                        Dim strRcrdSrc As String() = Nothing
                        Dim strEntrySSN As String() = Nothing
                        For Each item In dgComplList.Items
                            Dim dtCompl As Date
                            cbBox = item.FindControl("cbCompl")
                            lblPersGrp = item.FindControl("lblPersGrpCd")
                            txt = item.FindControl("txtComplDt")
                            txtChange = item.FindControl("txtChangeInd")
                            If (txtDate.Text = "&nbsp;" Or Len(txtDate.Text) = 0) Then
                                If (txt.Text = "&nbsp;" Or Len(txt.Text) = 0) And cbBox.Checked = True Then
                                    lblWarn.Visible = True
                                    valid = 0
                                Else
                                    If cbBox.Checked = True Then
                                        dtCompl = Format(CDate(txt.Text), "dd-MMM-yyyy")
                                    End If
                                End If
                            Else
                                If txt.Text <> "&nbsp;" And Len(txt.Text) > 0 Then
                                    dtCompl = Format(CDate(txt.Text), "dd-MMM-yyyy")
                                Else
                                    dtCompl = Format(CDate(txtDate.Text), "dd-MMM-yyyy")
                                End If
                            End If
                            If txtChange.Text = "1" And valid = 1 Then
                                ReDim Preserve strSSNDel(x)
                                ReDim Preserve strCDPDel(x)
                                ReDim Preserve dtComplDtDel(x)
                                dtComplDtDel(x) = dtCompl
                                If item.Cells(12).Text <> "&nbsp;" Then
                                    strSSNDel(x) = item.Cells(14).Text
                                    strCDPDel(x) = hdnCDP.Text
                                    dtComplDtDel(x) = Format(CDate(item.Cells(12).Text), "dd-MMM-yyyy")
                                    If cbBox.Checked = True Then
                                        intUpdtCnt += 1
                                    Else
                                        intDelCnt += 1
                                    End If
                                Else
                                    strSSNDel(x) = item.Cells(14).Text
                                    strCDPDel(x) = hdnCDP.Text
                                    dtComplDtDel(x) = Format(CDate(dtCompl), "dd-MMM-yyyy")
                                    If cbBox.Checked = True Then
                                        intUpdtCnt += 1
                                    Else
                                        intDelCnt += 1
                                    End If
                                End If
                                If cbBox.Checked = True Then
                                    ReDim Preserve strSSNIns(y)
                                    ReDim Preserve strCIN(y)
                                    ReDim Preserve strCDPIns(y)
                                    ReDim Preserve dtComplDtIns(y)
                                    ReDim Preserve strCseUIC(y)
                                    ReDim Preserve strCseLongTitle(y)
                                    ReDim Preserve strUIC(y)
                                    ReDim Preserve strNmLast(y)
                                    ReDim Preserve strNmFirst(y)
                                    ReDim Preserve strNmMid(y)
                                    ReDim Preserve intRetirePoint(y)
                                    ReDim Preserve strTrngDelivMethCd(y)
                                    ReDim Preserve intCseLen(y)
                                    ReDim Preserve strCseIntervl(y)
                                    ReDim Preserve strPersGrpCd(y)
                                    ReDim Preserve strSponSSN(y)
                                    ReDim Preserve strDepnTypeCd(y)
                                    ReDim Preserve strRcrdSrc(y)
                                    ReDim Preserve strEntrySSN(y)
                                    Dim strNm As String = ""
                                    Dim strNmLeft As String = ""
                                    Dim intIdx As Int16 = 0
                                    strNm = item.Cells(15).Text
                                    intIdx = InStr(strNm, " ")
                                    If intIdx > 0 Then
                                        strNmLast(y) = Left(strNm, intIdx - 1)
                                        strNmLeft = Trim(Mid(strNm, intIdx + 1))       'Remove extra white space
                                        intIdx = InStr(strNmLeft, " ")
                                        If intIdx > 0 Then
                                            strNmFirst(y) = Left(strNmLeft, intIdx - 1)
                                            strNmMid(y) = Trim(Mid(strNmLeft, intIdx + 1))          'Remove extra white space
                                        Else
                                            strNmFirst(y) = strNmLeft
                                        End If
                                    End If
                                    strCseUIC(y) = Request.QueryString("UIC")
                                    If (Not lblPersGrp Is Nothing) Then
                                        strPersGrpCd(y) = lblPersGrp.Text
                                    Else
                                        Dim ddl As New DropDownList
                                        ddl = item.FindControl("ddlPersGrpCd")
                                        If (Not ddl Is Nothing) Then
                                            strPersGrpCd(y) = ddl.SelectedItem.Value
                                        Else
                                            strPersGrpCd(y) = ""
                                        End If
                                    End If
                                    If Len(hdnRetire_Point.Text & "") > 0 Then
                                        intRetirePoint(y) = CInt(hdnRetire_Point.Text)
                                    End If
                                    If Len(hdnCse_Len.Text & "") > 0 Then
                                        intCseLen(y) = hdnCse_Len.Text
                                    End If
                                    dtComplDtIns(y) = dtCompl
                                    strSSNIns(y) = item.Cells(14).Text
                                    strCIN(y) = lblCIN.Text
                                    strCDPIns(y) = hdnCDP.Text
                                    strCseLongTitle(y) = lblCseTitle.Text
                                    strUIC(y) = item.Cells(3).Text
                                    strTrngDelivMethCd(y) = hdnTrng_Deliv_Meth_Cd.Text
                                    strCseIntervl(y) = ""
                                    strPersGrpCd(y) = item.Cells(10).Text
                                    strEntrySSN(y) = Session("svEncryptLoginSSN")
                                    strDepnTypeCd(y) = "-"
                                    strRcrdSrc(y) = "SOBT"
                                    If item.Cells(12).Text = "&nbsp;" Then
                                        intSaveCnt += 1
                                    End If
                                    y += 1
                                End If
                                x += 1
                            End If
                        Next
                        If x > 0 Then
                            'Delete records from arrays
                            CheckSession()
                            Dim objConn As New OracleConnection(Session("svOraProviderString"))
                            Dim myCmd As New OracleCommand
                            myCmd.Connection = objConn
                            myCmd.CommandType = CommandType.StoredProcedure
                            myCmd.CommandText = "SP_USERCSECOMPL_DEL"
                            myCmd.ArrayBindCount = x
                            Dim strSSNParam As OracleParameter = New OracleParameter("strSSN", OracleDbType.Varchar2)
                            strSSNParam.Direction = ParameterDirection.Input
                            strSSNParam.Value = strSSNDel
                            myCmd.Parameters.Add(strSSNParam)
                            Dim strCDPParam As OracleParameter = New OracleParameter("strCDP", OracleDbType.Varchar2)
                            strCDPParam.Direction = ParameterDirection.Input
                            strCDPParam.Value = strCDPDel
                            myCmd.Parameters.Add(strCDPParam)
                            Dim dtComplDtParam As OracleParameter = New OracleParameter("dtComplDt", OracleDbType.Date)
                            dtComplDtParam.Direction = ParameterDirection.Input
                            dtComplDtParam.Value = dtComplDtDel
                            myCmd.Parameters.Add(dtComplDtParam)
                            Try
                                objConn.Open()
                                myCmd.ExecuteNonQuery()
                            Catch ex As Exception
                                ErrorCapture(frmCompl, ex)
                            Finally
                                objConn.Close()
                                objConn.Dispose()
                            End Try
                        End If
                        If y > 0 Then
                            'Insert records from arrays
                            CheckSession()
                            Dim objConn2 As New OracleConnection(Session("svOraProviderString"))
                            Dim myCmd2 As New OracleCommand
                            myCmd2.Connection = objConn2
                            myCmd2.CommandType = CommandType.StoredProcedure
                            myCmd2.CommandText = "SP_USERCSECOMPL_INS"
                            myCmd2.ArrayBindCount = y
                            Dim strSSNParam2 As OracleParameter = New OracleParameter("strSSN", OracleDbType.Varchar2)
                            strSSNParam2.Direction = ParameterDirection.Input
                            strSSNParam2.Value = strSSNIns
                            myCmd2.Parameters.Add(strSSNParam2)
                            Dim strCINParam As OracleParameter = New OracleParameter("strCIN", OracleDbType.Varchar2)
                            strCINParam.Direction = ParameterDirection.Input
                            strCINParam.Value = strCIN
                            myCmd2.Parameters.Add(strCINParam)
                            Dim strCDPParam As OracleParameter = New OracleParameter("strCDP", OracleDbType.Varchar2)
                            strCDPParam.Direction = ParameterDirection.Input
                            strCDPParam.Value = strCDPIns
                            myCmd2.Parameters.Add(strCDPParam)
                            Dim dtComplDtParam As OracleParameter = New OracleParameter("dtComplDt", OracleDbType.Date)
                            dtComplDtParam.Direction = ParameterDirection.Input
                            dtComplDtParam.Value = dtComplDtIns
                            myCmd2.Parameters.Add(dtComplDtParam)
                            Dim strCseUICParam As OracleParameter = New OracleParameter("strCseUIC", OracleDbType.Varchar2)
                            strCseUICParam.Direction = ParameterDirection.Input
                            strCseUICParam.Value = strCseUIC
                            myCmd2.Parameters.Add(strCseUICParam)
                            Dim strCseLongTitleParam As OracleParameter = New OracleParameter("strCseLongTitle", OracleDbType.Varchar2)
                            strCseLongTitleParam.Direction = ParameterDirection.Input
                            strCseLongTitleParam.Value = strCseLongTitle
                            myCmd2.Parameters.Add(strCseLongTitleParam)
                            Dim strUICParam As OracleParameter = New OracleParameter("strUIC", OracleDbType.Varchar2)
                            strUICParam.Direction = ParameterDirection.Input
                            strUICParam.Value = strUIC
                            myCmd2.Parameters.Add(strUICParam)
                            Dim strNmLastParam As OracleParameter = New OracleParameter("strNmLast", OracleDbType.Varchar2)
                            strNmLastParam.Direction = ParameterDirection.Input
                            strNmLastParam.Value = strNmLast
                            myCmd2.Parameters.Add(strNmLastParam)
                            Dim strNmFirstParam As OracleParameter = New OracleParameter("strNmFirst", OracleDbType.Varchar2)
                            strNmFirstParam.Direction = ParameterDirection.Input
                            strNmFirstParam.Value = strNmFirst
                            myCmd2.Parameters.Add(strNmFirstParam)
                            Dim strNmMidParam As OracleParameter = New OracleParameter("strNmMid", OracleDbType.Varchar2)
                            strNmMidParam.Direction = ParameterDirection.Input
                            strNmMidParam.Value = strNmMid
                            myCmd2.Parameters.Add(strNmMidParam)
                            Dim intRetirePointParam As OracleParameter = New OracleParameter("intRetirePoint", OracleDbType.Int16)
                            intRetirePointParam.Direction = ParameterDirection.Input
                            intRetirePointParam.Value = intRetirePoint
                            myCmd2.Parameters.Add(intRetirePointParam)
                            Dim strTrngDelivMethCdParam As OracleParameter = New OracleParameter("strTrngDelivMethCd", OracleDbType.Varchar2)
                            strTrngDelivMethCdParam.Direction = ParameterDirection.Input
                            strTrngDelivMethCdParam.Value = strTrngDelivMethCd
                            myCmd2.Parameters.Add(strTrngDelivMethCdParam)
                            Dim intCseLenParam As OracleParameter = New OracleParameter("intCseLen", OracleDbType.Int16)
                            intCseLenParam.Direction = ParameterDirection.Input
                            intCseLenParam.Value = intCseLen
                            myCmd2.Parameters.Add(intCseLenParam)
                            Dim strCseIntervlParam As OracleParameter = New OracleParameter("strCseIntervl", OracleDbType.Varchar2)
                            strCseIntervlParam.Direction = ParameterDirection.Input
                            strCseIntervlParam.Value = strCseIntervl
                            myCmd2.Parameters.Add(strCseIntervlParam)
                            Dim strPersGrpCdParam As OracleParameter = New OracleParameter("strPersGrpCd", OracleDbType.Varchar2)
                            strPersGrpCdParam.Direction = ParameterDirection.Input
                            strPersGrpCdParam.Value = strPersGrpCd
                            myCmd2.Parameters.Add(strPersGrpCdParam)
                            Dim strDepnTypeCdParam As OracleParameter = New OracleParameter("strDepnTypeCd", OracleDbType.Varchar2)
                            strDepnTypeCdParam.Direction = ParameterDirection.Input
                            strDepnTypeCdParam.Value = strDepnTypeCd
                            myCmd2.Parameters.Add(strDepnTypeCdParam)
                            Dim strEntrySSNParam As OracleParameter = New OracleParameter("strEntrySSN", OracleDbType.Varchar2)
                            strEntrySSNParam.Direction = ParameterDirection.Input
                            strEntrySSNParam.Value = strEntrySSN
                            myCmd2.Parameters.Add(strEntrySSNParam)
                            Dim strRcrdSrcParam As OracleParameter = New OracleParameter("strRcrdSrc", OracleDbType.Varchar2)
                            strRcrdSrcParam.Direction = ParameterDirection.Input
                            strRcrdSrcParam.Value = strRcrdSrc
                            myCmd2.Parameters.Add(strRcrdSrcParam)
                            Try
                                objConn2.Open()
                                myCmd2.ExecuteNonQuery()
                            Catch ex As Exception
                                ErrorCapture(frmCompl, ex)
                            Finally
                                objConn2.Close()
                                objConn2.Dispose()
                            End Try
                        End If
                        'Count Records Changed
                        hdnSaveCnt.Text = intSaveCnt
                        hdnDelCnt.Text = intDelCnt
                        hdnUpdtCnt.Text = intUpdtCnt
                    Catch ex As Exception
                        ErrorCapture(frmCompl, ex)
                    End Try
                End Sub
            
                Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
                    Try
                        CheckSession()
                        lblSaveMsg.Text = ""
                        lblSaveMsg.Visible = True
                        GetCDP()
                        SubmitData()
                        GetData()
                    Catch ex As Exception
                        ErrorCapture(frmCompl, ex)
                    End Try
                End Sub
            
                Private Function DupeCheck(ByVal strSSN As String, ByVal strComplDt As String) As Boolean
                    Try
                        CheckSession()
                        Dim objConn As New OracleConnection(Session("svOraProviderString"))
                        Dim strDupe As New StringBuilder
                        strDupe.Append("SELECT COUNT(*) AS COMPL_COUNT FROM ALL_CSE_COMPL WHERE SSN_IND = :strSSN AND COMPL_DT = :dtCompl AND CIN = :strCIN ")
                        Dim cmdDupe As New OracleDataAdapter(strDupe.ToString, objConn)
                        cmdDupe.SelectCommand.Parameters.Add("strSSN", OracleDbType.Varchar2, 32).Value = strSSN
                        cmdDupe.SelectCommand.Parameters.Add("dtCompl", OracleDbType.Date).Value = Format(CDate(strComplDt), "dd-MMM-yyyy")
                        cmdDupe.SelectCommand.Parameters.Add("strCIN", OracleDbType.Varchar2, 30).Value = ddlSelCin.SelectedItem.Value
                        Dim DSDupe As New DataSet
                        Try
                            Dim dt As Date = Now
                            cmdDupe.Fill(DSDupe, "COMPL_COUNT")
                            If AppSettings("asWebTracking") = "TRUE" Then
                                WebTracking(frmCompl, 1817, dt, Now, 1, 1, "DupeCheck")
                            End If
                        Catch ex As Exception
                            ErrorCapture(frmCompl, ex)
                        Finally
                            objConn.Close()
                            objConn.Dispose()
                        End Try
                        If DSDupe.Tables(0).Rows.Count > 0 Then
                            If DSDupe.Tables(0).Rows(0)("COMPL_COUNT") > 0 Then
                                Return False
                            Else
                                Return True
                            End If
                        Else
                            Return True
                        End If
                    Catch ex As Exception
                        ErrorCapture(frmCompl, ex)
                    End Try
                End Function
            
                Private Sub btnFilter_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnFilter.Click
                    Try
                        CheckSession()
                        lblWarnDupe.Visible = False
                        lblWarnDupe.Text = ""
                        GetData()
                    Catch ex As Exception
                        ErrorCapture(frmCompl, ex)
                    End Try
                End Sub
            
                Private Sub MarkAll_OnClick()
                    Try
                        CheckSession()
                        Dim aMark As New HtmlAnchor
                        aMark = Page.FindControl("aMarkAll")
                        aMark.HRef = "javascript:void(0)"
                        Dim txt As New TextBox
                        txt = Page.FindControl("txtDate")
                        txt.Attributes.Add("ReadOnly", "ReadOnly")
                        Dim item As DataGridItem
                        Dim strMark As String
                        strMark = "if(" & txt.ClientID & ".value=='&nbsp;'||" & txt.ClientID & ".value==''){alert('You must first select a completion date.');}else{"
                        For Each item In dgComplList.Items
                            Dim txtChange As New TextBox
                            txtChange = item.FindControl("txtChangeInd")
                            Dim txtCompl As New TextBox
                            txtCompl = item.FindControl("txtComplDt")
                            txtCompl.Attributes.Add("ReadOnly", "ReadOnly")
                            Dim cbBox As New CheckBox
                            cbBox = item.FindControl("cbCompl")
                            strMark += "if(" & cbBox.ClientID & ".checked != true){" & cbBox.ClientID & ".checked=true;" & txtChange.ClientID & ".value='1';" & txtCompl.ClientID & ".value=" & txt.ClientID & ".value;};"
                        Next
                        strMark += "};"
                        aMark.Attributes.Add("onclick", strMark)
                    Catch ex As Exception
                        ErrorCapture(frmCompl, ex)
                    End Try
                End Sub
            
                Private Sub GetCDP()
                    Try
                        CheckSession()
                        'Need to get the CDP for the CIN that has been selected
                        hdnCDP.Text = ""
                        hdnCseUIC.Text = ""
                        hdnRetire_Point.Text = ""
                        hdnCse_Len.Text = ""
                        hdnTrng_Deliv_Meth_Cd.Text = ""
                        hdnCse_Intervl.Text = ""
                        Dim objConn As New OracleConnection(Session("svOraProviderString"))
                        Dim qryCDP As New StringBuilder
                        qryCDP.Append("  select DISTINCT sotc.CIN, sotc.CSE_TITLE, sotc.DEPT_WARFARE , succ.SUB_ONBD_TRNG_UIC_CLS, act.CDP, sotc.TRNG_DELIV_METH_CD ")
                        qryCDP.Append(" from sub_onbd_Trng_cse sotc, sub_onbd_trng_uic_cls_cin succ , all_cse_title act ")
                        qryCDP.Append("   where succ.cin = sotc.cin  ")
                        qryCDP.Append(" and succ.cin = act.cin ")
                        qryCDP.Append(" AND sotc.CIN =  :strCIN ")
               
                        CheckSession()
                        Dim cmdOracle As New OracleDataAdapter(qryCDP.ToString, objConn)
                        cmdOracle.SelectCommand.Parameters.Add("strCIN", OracleDbType.Varchar2, 30).Value = lblCIN.Text
                        Dim dsCDP As New DataSet
                        Try
                            Dim dt As Date = Now
                            cmdOracle.Fill(dsCDP, "CDPSEL")
                            If AppSettings("asWebTracking") = "TRUE" Then
                                WebTracking(frmCompl, 1817, dt, Now, dsCDP.Tables(0).Rows.Count, dsCDP.Tables(0).Rows.Count, "GetCDP, " & lblCIN.Text)
                            End If
                        Catch ex As Exception
                            ErrorCapture(frmCompl, ex)
                        Finally
                            objConn.Close()
                            objConn.Dispose()
                        End Try
                        If dsCDP.Tables(0).Rows.Count > 0 Then
                            'a row better be returned or there's a problem
                            hdnCDP.Text = dsCDP.Tables(0).Rows(0)("CDP")
                             hdnCseUIC.Text = Request.QueryString("UIC")
                            hdnRetire_Point.Text = ""
                            hdnCse_Len.Text = ""
                            If Len(dsCDP.Tables(0).Rows(0)("Trng_Deliv_Meth_Cd") & "") > 0 Then
                                hdnTrng_Deliv_Meth_Cd.Text = dsCDP.Tables(0).Rows(0)("Trng_Deliv_Meth_Cd")
                            End If
                            hdnCse_Intervl.Text = ""
                        End If
                    Catch ex As Exception
                        ErrorCapture(frmCompl, ex)
                    End Try
                End Sub
            
                Private Sub btnFilterSSN_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnFilterSSN.Click
                    Try
                        CheckSession()
                        lblWarnDupe.Visible = False
                        lblWarnDupe.Text = ""
                        GetData()
                    Catch ex As Exception
                        ErrorCapture(frmCompl, ex)
                    End Try
                End Sub
            
                Private Sub ddlSelCin_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlSelCin.SelectedIndexChanged
                    Try
                        CheckSession()
                        If ddlSelCin.SelectedIndex.ToString <> "Select" Then
                            Response.Write("<script language=""javascript"">void window.open('/Fleet/SOBT/SOBTCseSelect.aspx?POPUP=Y&hdnCseFilter=" & ddlSelCin.SelectedItem.Value & "&UIC=" & Request.QueryString("UIC") & "&UICTITLE=" & Request.QueryString("UICTITLE") & "&UICClass=" & Request.QueryString("UICClass") & "', 'add_student', 'screenx=150, screeny=250, top=50, left=50, height=600, width=600, resizeable=0, menubar=0, toolbar=0, location=0, directories=0, scrollbars=1, status=0;return false');</script>")
                        End If
                    Catch ex As Exception
                        ErrorCapture(frmCompl, ex)
                    End Try
                End Sub
            
            
                Public Sub getrate()
                    Try
                        CheckSession()
                        ddlRate.Items.Clear()
                        Dim qryRate As New StringBuilder
                        '  qryRate.Append("  select distinct DESIG_RATING DESIG_GRADE_RATE, DESIG_RATING || ' - ' || DESIG_RATING_DESCR DESIG_DESCR from display_paygrade ")
                        '  qryRate.Append("  where paygrade_sort <> 'Z' ")
                        '  qryRate.Append(" order by DESIG_GRADE_RATE ")
            
                        qryRate.Append("  	 select  distinct NVL(DESIG_RATING,apg.DESIG_GRADE_RATE) DESIG_GRADE_RATE,  NVL(DESIG_RATING,apg.DESIG_GRADE_RATE)  || ' - ' || DESIG_RATING_DESCR DESIG_DESCR from all_pers_grp apg, display_paygrade dgr   ")
                        qryRate.Append("  	 where ")
                        qryRate.Append("  	 apg.uic_trng_uic_ruc_uic_cmd = :strUIC  ")
                        qryRate.Append("  	 and apg.desig_grade_rate  =  dgr.desig_grade_rate   ")
                        qryRate.Append("  	 order by DESIG_GRADE_RATE  ")
            
                        CheckSession()
                        Dim objConn4 As New OracleConnection(Session("svOraProviderString"))
                        Dim MyCommand4 As New OracleDataAdapter(qryRate.ToString, objConn4)
                        MyCommand4.SelectCommand.Parameters.Add("strUIC", OracleDbType.Varchar2, 30).Value = Request.QueryString("UIC")
            
                        Dim DSRate As New DataSet
                        Try
                            MyCommand4.Fill(DSRate, "Rate")
                        Catch ex As Exception
                            ErrorCapture(frmCompl, ex)
                        Finally
                            objConn4.Close()
                            objConn4.Dispose()
                        End Try
                        Dim DVRate As DataView = DSRate.Tables(0).DefaultView
                        If DSRate.Tables(0).Rows.Count > 0 Then
                            ddlRate.DataSource = DVRate
                            ddlRate.DataTextField = "DESIG_DESCR"
                            ddlRate.DataValueField = "DESIG_GRADE_RATE"
                            ddlRate.DataBind()
                        End If
                        ddlRate.Items.Insert(0, "All Rates")
                        ddlRate.Items(0).Value = "NONE"
            
                    Catch ex As Exception
                        ErrorCapture(frmCompl, ex)
                    End Try
                End Sub
            
                Private Sub ddlRate_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlRate.SelectedIndexChanged
                    Try
                        CheckSession()
                        GetData()
                    Catch ex As Exception
                        ErrorCapture(frmCompl, ex)
                    End Try
            
                End Sub
            End Class
            
            <%@ Page Language="vb"  Trace="true" AutoEventWireup="false" Codebehind="RqmtsAviationTrngRqmtManBillets.aspx.vb" Inherits="Fleet.RqmtsAviationTrngRqmtManBillets"%>
            <%@ Register tagprefix="Fleet" tagname="Header" src="~/Controls/cntrlFleetHeader.ascx" %>
            <%@ Register tagprefix="Fleet" Tagname="UicList" src="~/Controls/cntrlUserUicList.ascx" %>
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
            <html xmlns="http://www.w3.org/1999/xhtml">
            	<head>
            		<title>Fleet Training Requirements by Authorized Manning Document Billets</title>
            		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR" />
            		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE" />
            		<meta content="JavaScript" name="vs_defaultClientScript" />
            		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema" />
            		<!-- #include virtual="/Fleet/Styles.htm" -->
            		<!-- #include virtual="/Fleet/include/SessionTimeout/timer.htm" -->
            	</head>
            	<body >
            		<form id="RqmtAviationTrngRqmtManBillets" method="post" runat="server">
            				<table cellspacing="1" cellpadding="1" width="100%"  align="center">
            					<tr>
            						<td colspan="3">
            							<Fleet:Header id="FleetHeader" runat="server"></Fleet:Header>					
            						</td>
            					</tr>					        
            					<tr>
            						<td colspan="3">
            							<Fleet:UicList id="cntrlUicList" runat="server" visible="false"></Fleet:UicList>							
            						</td>
            					</tr>
            					<tr>
            						<td colspan="3">
            							<asp:label ID="lblSelDispNum" runat="server" Visible="True" CssClass="FieldName">Number of Rows Displayed Per Screen:</asp:label>
            								<asp:DropDownList ID="ddlPageSize" Runat="server" autopostback="True" Visible="True" CssClass="TableData">
            									<asp:ListItem Value="100">100</asp:ListItem>
            									<asp:ListItem Value="250">250</asp:ListItem>
            									<asp:ListItem Value="500">500</asp:ListItem>					
            									<asp:ListItem Value="1000">1000</asp:ListItem>
            								</asp:DropDownList>	
            						</td>
            					</tr>		
            					<tr>
            						<td>
            							<asp:Label ID="lblAbvCin9" Runat="server" Visible="True" CssClass="FieldName" ForeColor="steelblue" >Course/CIN Deactivated When Blue</asp:Label>
            						</td>
            						<td colspan="2">
            							<asp:hyperlink id="hlAbvCin9" Visible="false" Runat="server" Target="_blank">Click Here To View Training Requirements Above CIN08</asp:hyperlink>
            						</td>
            					</tr>
            					<tr>
            						<td>
            							<asp:Label ID="lblInvBSC" Runat="server" Visible="True" CssClass="FieldName" ForeColor="tomato">Course/CIN Invalid When Red</asp:Label>
            						</td>
            						<td colspan="2">
            							<asp:hyperlink id="hlInvBsc" Visible="false" Runat="server" Target="_blank">Click Here To View All Reported BSCs with Invalid Billets Highlighted</asp:hyperlink>							
            						</td>						
            					</tr>								
            					<tr>
            						<td colspan="3">
            							<asp:datagrid id="dgManBsc" runat="server" AutoGenerateColumns="False" 
            								PagerStyle-HorizontalAlign="Center" PagerStyle-Pagebuttoncount="10" PagerStyle-Mode="NumericPages"  
            								AllowCustomPaging="False" AllowPaging="True" PagerStyle-Wrap="False" PageSize="100">
            								<HeaderStyle Font-Bold="True" ForeColor="White" BackColor="SteelBlue"></HeaderStyle>
            								<ItemStyle CssClass="tabledata"> </ItemStyle>
            								<Columns>
            									<asp:BoundColumn DataField="deptHeader" HeaderText="Dept Header" >
            										<HeaderStyle VerticalAlign="Bottom"></HeaderStyle>
            										<ItemStyle Width="2%" VerticalAlign="Bottom" Wrap="False"></ItemStyle>
            									</asp:BoundColumn>
            									<asp:BoundColumn DataField="divHeader" HeaderText="Div Header">
            										<HeaderStyle VerticalAlign="Bottom"></HeaderStyle>
            										<ItemStyle Width="2%" VerticalAlign="Bottom" Wrap="False"></ItemStyle>
            									</asp:BoundColumn>
            									<asp:BoundColumn DataField="bsc" HeaderText="BSC">
            										<HeaderStyle VerticalAlign="Bottom"></HeaderStyle>
            										<ItemStyle Width="2%" VerticalAlign="Bottom" Wrap="False"></ItemStyle>
            									</asp:BoundColumn>
            									<asp:BoundColumn DataField="billetTitle" HeaderText="Billet Title">
            										<HeaderStyle VerticalAlign="Bottom"></HeaderStyle>
            										<ItemStyle Width="14%" VerticalAlign="Bottom" Wrap="False"></ItemStyle>
            									</asp:BoundColumn>
            									<asp:BoundColumn DataField="oeCd" HeaderText="O/E">
            										<HeaderStyle HorizontalAlign="Center" VerticalAlign="Bottom"></HeaderStyle>
            										<ItemStyle HorizontalAlign="Center" Width="2%" VerticalAlign="Bottom" Wrap="False"></ItemStyle>
            									</asp:BoundColumn>
            									<asp:BoundColumn DataField="dgr" HeaderText="Desig&lt;br&gt;Grade&lt;br&gt;Rate">
            										<HeaderStyle HorizontalAlign="Center" VerticalAlign="Bottom"></HeaderStyle>
            										<ItemStyle HorizontalAlign="Center" Width="2%" VerticalAlign="Bottom" Wrap="False"></ItemStyle>
            									</asp:BoundColumn>
            									<asp:BoundColumn DataField="pNobc" HeaderText="PNEC/<br>PNOBC">
            										<HeaderStyle HorizontalAlign="Center" VerticalAlign="Bottom"></HeaderStyle>
            										<ItemStyle HorizontalAlign="Center" Width="3%" VerticalAlign="Bottom" Wrap="False"></ItemStyle>
            									</asp:BoundColumn>
            									<asp:BoundColumn DataField="sNobc" HeaderText="SNEC/<br>SNOBC">
            										<HeaderStyle HorizontalAlign="Center" VerticalAlign="Bottom"></HeaderStyle>
            										<ItemStyle HorizontalAlign="Center" Width="3%" VerticalAlign="Bottom" Wrap="False"></ItemStyle>
            									</asp:BoundColumn>
            									<asp:BoundColumn DataField="ibftJobDescr" HeaderText="Position Description">
            										<HeaderStyle VerticalAlign="Bottom"></HeaderStyle>
            										<ItemStyle VerticalAlign="Bottom" Wrap="False"></ItemStyle>
            									</asp:BoundColumn>																
            									<asp:BoundColumn DataField="cin1" HeaderText="CIN 01" HeaderStyle-VerticalAlign="Bottom" 
            										HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" ItemStyle-Width="8%" 
            										ItemStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False"></asp:BoundColumn>
            									<asp:BoundColumn DataField="cin2" HeaderText="CIN 02" HeaderStyle-VerticalAlign="Bottom" 
            										HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" ItemStyle-Width="8%" 
            										ItemStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False"></asp:BoundColumn>
            									<asp:BoundColumn DataField="cin3" HeaderText="CIN 03" HeaderStyle-VerticalAlign="Bottom" 
            										HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" ItemStyle-Width="8%" 
            										ItemStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False"></asp:BoundColumn>
            									<asp:BoundColumn DataField="cin4" HeaderText="CIN 04" HeaderStyle-VerticalAlign="Bottom" 
            										HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" ItemStyle-Width="8%" 
            										ItemStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False"></asp:BoundColumn>
            									<asp:BoundColumn DataField="cin5" HeaderText="CIN 05" HeaderStyle-VerticalAlign="Bottom" 
            										HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" ItemStyle-Width="8%" 
            										ItemStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False"></asp:BoundColumn>
            									<asp:BoundColumn DataField="cin6" HeaderText="CIN 06" HeaderStyle-VerticalAlign="Bottom"
            										HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" ItemStyle-Width="8%" 
            										ItemStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False"></asp:BoundColumn>
            									<asp:BoundColumn DataField="cin7" HeaderText="CIN 07" HeaderStyle-VerticalAlign="Bottom" 
            										HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" ItemStyle-Width="8%" 
            										ItemStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False"></asp:BoundColumn>
            									<asp:BoundColumn DataField="cin8" HeaderText="CIN 08" HeaderStyle-VerticalAlign="Bottom" 
            										HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" ItemStyle-Width="8%" 
            										ItemStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False"></asp:BoundColumn>
            								</Columns>
            							</asp:datagrid>
            						</td>
            					</tr>
            					<tr><td>&nbsp;</td></tr>
            					<tr><td><asp:hyperlink id="hlExcel" Runat="server" Target="_blank"></asp:hyperlink></td></tr>					
            				</table>
            				<asp:Label ID="hdnUIC" Runat="server" Visible="False"></asp:Label>
            				<asp:Label ID="hdnUICTitle" Runat="server" Visible="False"></asp:Label>
            				<asp:Label ID="hdnCmtyCd" Runat="server" Visible="False"></asp:Label>
            				<asp:label id="hdnRecRngCnt" runat="server" visible="False"></asp:label>
            	<asp:Literal ID="litAlert" runat="Server"></asp:Literal>
            		</form>
            	</body>
            </html>
            
            Imports Oracle.DataAccess.Client
            Imports Fleet.ConstClass
            Imports System.Text
            Imports System.Configuration.ConfigurationManager
            
            Public Class RqmtsAviationTrngRqmtManBillets
                Inherits System.Web.UI.Page
                Dim myCommand As OracleDataAdapter
                Protected WithEvents hlExcel As HyperLink
                Protected WithEvents dgManBsc As DataGrid
                Protected WithEvents hlAbvCin9 As HyperLink
                Protected WithEvents hlInvBsc As HyperLink
                Protected WithEvents RqmtAviationTrngRqmtManBillets As HtmlForm
                Protected WithEvents lblInvBSC As Label
                Protected WithEvents lblAbvCin9 As Label
                Protected WithEvents hdnUICTitle As Label
                Protected WithEvents hdnUIC As Label
                Protected WithEvents cntrlUicList As cntrlUserUicList
                Protected WithEvents FleetHeader As cntrlFleetHeader
                Protected WithEvents hdnCmtyCd As Label
                Protected WithEvents lblSelDispNum As Label
                Protected WithEvents ddlPageSize As DropDownList
                Protected WithEvents hdnRecRngCnt As Label
                Dim RecCnt As Integer
                Dim totRecCnt As String
            
            #Region " Web Form Designer Generated Code "
            
                'This call is required by the Web Form Designer.
                <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
            
                End Sub
            
                'NOTE: The following placeholder declaration is required by the Web Form Designer.
                'Do not delete or move it.
                Private designerPlaceholderDeclaration As System.Object
            
                Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
                    'CODEGEN: This method call is required by the Web Form Designer
                    'Do not modify it using the code editor.
                    InitializeComponent()
                End Sub
            
            #End Region
            
                Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
                    Try
                        CheckSession()
                        If Not Page.IsPostBack Then
                            WebTracking(RqmtAviationTrngRqmtManBillets, 1009, Now, Now, 1, 1, "LOAD")
                            Session("PgNum") = 0
                            Session("PgSize") = 100
                            hdnUIC.Text = Request.QueryString("UIC")
                            hdnUICTitle.Text = Request.QueryString("UICTITLE")
                            CreateHeader()
                            getRpt()
            
                        End If
                    Catch ex As Exception
                        ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
                    End Try
                End Sub
            
            
                Private Sub CreateHeader()
                    Try
                        CheckSession()
                        If hdnUIC.Text = "000000" Then
                            cntrlUicList.ActiveReserve = "A"
                            cntrlUicList.Visible = True
                            cntrlUicList.GetList()
                            hdnUIC.Text = cntrlUicList.SelectedUic
                            hdnUICTitle.Text = cntrlUicList.SelectedUicTitle
                        Else
                            FleetHeader.AddSelection("UIC: ", hdnUIC.Text & " " & hdnUICTitle.Text)
                        End If
                        FleetHeader.Header2 = "Training Requirements by Authorized Manning Document Billets"
                    Catch ex As Exception
                        ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
                    End Try
                End Sub
            
            
                Sub getRpt()
                    Try
                        CheckSession()
                        GetUicData()
                        hlAbvCin9.NavigateUrl = "RqmtsAviationTrngRqmtManBilletsAbv08.aspx?Uic=" & hdnUIC.Text & "&UicTitle=" & hdnUICTitle.Text
                        hlInvBsc.NavigateUrl = "RqmtsAviationTrngRqmtManBilletsInvBsc.aspx?Uic=" & hdnUIC.Text & "&UicTitle=" & hdnUICTitle.Text
                        hlExcel.NavigateUrl = "RqmtsAviationTrngRqmtManBilletsExcel.aspx?Uic=" & hdnUIC.Text & "&UicTitle=" & hdnUICTitle.Text & "&xlsRecRange=" & hdnRecRngCnt.Text & "&recCnt=" & totRecCnt
                        hlExcel.ImageUrl = "/Fleet/images/excelicon.gif"
                        hlExcel.ToolTip = "Click to View in Excel"
                        hlExcel.Height = Unit.Pixel(30)
                        hlExcel.Width = Unit.Pixel(30)
                    Catch ex As Exception
                        ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
                    End Try
                End Sub
            
                Sub GetUicData()
                    Try
                        CheckSession()
                        hlInvBsc.Visible = False
                        hlAbvCin9.Visible = False
                        Dim ds As DataSet
                        Dim strByUic As New StringBuilder
                        strByUic.Append(" select decode(deptNm40,null,cd_w_invalid,deptNm40) deptHeader,DivNm40 divHeader, ")
                        strByUic.Append(" bsc,billetTitle,oeCd,dgr,pNobc,sNobc,nvl(ibftJobDescr,billetTitle) ibftJobDescr, ")
                        strByUic.Append(" cin1,cin2,cin3,cin4,cin5,cin6,cin7,cin8, ")
                        strByUic.Append(" decode(DivNm5,null,'00000',DivNm5) divSort, ")
                        strByUic.Append(" decode(deptNm5,null,(decode(deptNm40,null,cd_w_invalid,deptNm5)),deptNm5) deptSort ,cin9 ")
                        strByUic.Append(" from (select T1.BSC bsc,T1.BILLET_TITLE billetTitle,T1.OE_CD oeCd,T1.DESIG_GRADE_RATE dgr, ")
                        strByUic.Append(" T1.PNEC_NOBC pNobc,T1.SNEC_NOBC sNobc,T1.IBFT_JOB_DESCR ibftJobDescr,T1.CIN01 cin1,T1.CIN02 cin2, ")
                        strByUic.Append(" T1.CIN03 cin3,T1.CIN04 cin4,T1.CIN05 cin5,T1.CIN06 cin6,T1.CIN07 cin7,T1.CIN08 cin8, ")
                        strByUic.Append(" decode((SUBSTR(T1.DEPT_NM,1 ,5)),null,decode((SUBSTR(T1.DEPT_NM,7 ,40)),null,decode((SUBSTR(T1.BSC,1,1)),'C','COLLATERAL DUTIES','W','WATCHES', ")
                        strByUic.Append("       decode(T1.BILLET_TITLE,null,'INVALID BILLETS REPORTED',null)),(SUBSTR(T1.DEPT_NM,7 ,40))),(SUBSTR(T1.DEPT_NM,1 ,5))) cd_w_invalid, ")
                        strByUic.Append(" SUBSTR(T1.DIV_NM,7 ,40) DivNm40,SUBSTR(T1.DIV_NM,1 ,5) DivNm5,SUBSTR(T1.DEPT_NM,7 ,40) deptNm40, ")
                        strByUic.Append(" SUBSTR(T1.DEPT_NM,1 ,5) deptNm5, T1.CIN09 cin9 ")
                        strByUic.Append(" from VW_BSC_TRNG_RQMT_HORIZ T1, UIC T2 where T1.UIC=:strUIC and T1.UIC=T2.UIC) ")
                        strByUic.Append(" order by deptSort,deptHeader,divSort,divHeader,bsc ")
                        CheckSession()
                        Dim objConn As New OracleConnection(Session("svOraProviderString"))
                        myCommand = New OracleDataAdapter(strByUic.ToString, objConn)
                        myCommand.SelectCommand.Parameters.Add("strUIC", OracleDbType.Varchar2, 6).Value = hdnUIC.Text
                        ds = New DataSet
                        Try
                            Dim dtBegDt As Date = Now
                            myCommand.Fill(ds, "BILLET_MATRIX")
                            If AppSettings("asWebTracking") = "TRUE" Then
                                WebTracking(RqmtAviationTrngRqmtManBillets, 1009, dtBegDt, Now, ds.Tables(0).Rows.Count, ds.Tables(0).Rows.Count, hdnUIC.Text)
                            End If
                        Catch ex As Exception
                            ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
                        Finally
                            objConn.Close()
                            objConn.Dispose()
                        End Try
                        Dim i As Integer = 0
                        Dim prevDept, curDept, curDiv, prevDiv, cin09 As String
                        curDept = ""
                        prevDept = ""
                        curDiv = ""
                        prevDiv = ""
                        cin09 = ""
                        Dim shRow As DataRow
                        If ds.Tables(0).Rows.Count > 0 Then
                            dgManBsc.Visible = True
                            Session("PgSize") = ddlPageSize.SelectedItem.Value
                            Session("PgNum") = dgManBsc.CurrentPageIndex
                            FleetHeader.Warning = False
                            If ds.Tables(0).Rows.Count > 100 Then
                                lblSelDispNum.Visible = True
                                ddlPageSize.Visible = True
                                dgManBsc.PagerStyle.Visible = True
                            Else
                                lblSelDispNum.Visible = False
                                ddlPageSize.Visible = False
                                dgManBsc.PagerStyle.Visible = False
                            End If
                            Do While (i <= ds.Tables(0).Rows.Count - 1)
                                If Not IsDBNull(ds.Tables(0).Rows(i)("deptHeader")) Then
                                    If Not IsDBNull(ds.Tables(0).Rows(i)("cin9")) Then
                                        hlAbvCin9.Visible = True
                                        lblAbvCin9.Visible = True
                                    End If
                                    If IsDBNull(ds.Tables(0).Rows(i)("billetTitle")) Then
                                        hlInvBsc.Visible = True
                                        lblInvBSC.Visible = True
                                    End If
                                    If ds.Tables(0).Rows(i)("deptHeader") <> "00000" Then
                                        curDept = ds.Tables(0).Rows(i).Item(0)
                                        If (curDept <> prevDept) Then
                                            prevDept = curDept
                                            shRow = ds.Tables(0).NewRow
                                            shRow("deptHeader") = ds.Tables(0).Rows(i)("deptHeader")
                                            shRow("divHeader") = "Dept"
                                            ds.Tables(0).Rows.InsertAt(shRow, i)
                                            i = i + 1
                                        End If
                                    End If
                                    If Not IsDBNull(ds.Tables(0).Rows(i)("divHeader")) Then
                                        curDiv = ds.Tables(0).Rows(i)("divHeader")
                                        If (curDiv <> prevDiv) Then
                                            prevDiv = curDiv
                                            shRow = ds.Tables(0).NewRow
                                            shRow("deptHeader") = "Div"
                                            shRow("divHeader") = ds.Tables(0).Rows(i)("divHeader")
                                            ds.Tables(0).Rows.InsertAt(shRow, i)
                                            i = i + 1
                                        End If
                                    End If
                                End If
                                i = i + 1
                            Loop
                            Dim dv As DataView
                            dv = ds.Tables(0).DefaultView
                            dgManBsc.DataSource = dv
                            dgManBsc.DataBind()
                            recRangeHead()
                        Else
                            dgManBsc.Visible = False
                            FleetHeader.Warning = True
                            hlExcel.Visible = False
                            hlAbvCin9.Visible = False
                            hlInvBsc.Visible = False
                            lblInvBSC.Visible = False
                            lblAbvCin9.Visible = False
                            lblSelDispNum.Visible = False
                            ddlPageSize.Visible = False
                            dgManBsc.PagerStyle.Visible = False
                        End If
                    Catch ex As Exception
                        ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
                    End Try
                End Sub
            
                Private Sub dgManBsc_ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) Handles dgManBsc.ItemDataBound
                    Try
                        CheckSession()
                        If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.Item Then
                            RecCnt += 1
                        End If
                        Dim cellDeptHeader As String = e.Item.Cells(0).Text
                        Dim cellDivHeader As String = e.Item.Cells(1).Text
                        Dim cellCIN1 As String
                        Dim cellCIN2 As String
                        Dim cellCIN3 As String
                        Dim cellCIN4 As String
                        Dim cellCIN5 As String
                        Dim cellCIN6 As String
                        Dim cellCIN7 As String
                        Dim cellCIN8 As String
                        cellCIN1 = e.Item.Cells(9).Text
                        cellCIN2 = e.Item.Cells(10).Text
                        cellCIN3 = e.Item.Cells(11).Text
                        cellCIN4 = e.Item.Cells(12).Text
                        cellCIN5 = e.Item.Cells(13).Text
                        cellCIN6 = e.Item.Cells(14).Text
                        cellCIN7 = e.Item.Cells(15).Text
                        cellCIN8 = e.Item.Cells(16).Text
                        If cellDivHeader = "Dept" Then
                            If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
                                e.Item.Cells(0).Attributes.Add("align", "Center")
                                e.Item.Cells(0).Font.Bold = True
                                e.Item.Cells(0).BackColor = Color.LemonChiffon
                                e.Item.Cells(0).ColumnSpan = e.Item.Cells.Count
                                Dim x As Int16 = 0
                                For x = 1 To e.Item.Cells.Count - 1
                                    e.Item.Cells(x).Visible = False
                                Next
                            End If
                        ElseIf cellDivHeader = "NoData" Then
                            If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
                                e.Item.Cells(0).Attributes.Add("align", "left")
                                e.Item.Cells(0).Font.Bold = True
                                e.Item.Cells(0).BackColor = Color.LemonChiffon
                                e.Item.Cells(0).ForeColor = Color.Crimson
                                e.Item.Cells(0).ColumnSpan = e.Item.Cells.Count
                                Dim x As Int16 = 0
                                For x = 1 To e.Item.Cells.Count - 1
                                    e.Item.Cells(x).Visible = False
                                Next
                            End If
                        ElseIf cellDeptHeader = "Div" Then
                            e.Item.Cells(0).Visible = False
                            If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
                                e.Item.Cells(1).Attributes.Add("align", "left")
                                e.Item.Cells(1).Font.Bold = True
                                e.Item.Cells(1).ColumnSpan = e.Item.Cells.Count
                                Dim x As Int16 = 0
                                For x = 2 To e.Item.Cells.Count - 1
                                    e.Item.Cells(x).Visible = False
                                Next
                            End If
                        Else
                            e.Item.Cells(0).Visible = False
                            e.Item.Cells(1).Visible = False
                            If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
                                If e.Item.ItemType = ListItemType.AlternatingItem Then
                                    e.Item.Cells(2).BackColor = Color.WhiteSmoke
                                    e.Item.Cells(3).BackColor = Color.WhiteSmoke
                                    e.Item.Cells(4).BackColor = Color.WhiteSmoke
                                    e.Item.Cells(5).BackColor = Color.WhiteSmoke
                                    e.Item.Cells(6).BackColor = Color.WhiteSmoke
                                    e.Item.Cells(7).BackColor = Color.WhiteSmoke
                                    e.Item.Cells(8).BackColor = Color.WhiteSmoke
                                End If
                                If cellCIN1.StartsWith("(DEACT)") Then
                                    e.Item.Cells(9).BackColor = Color.LightSteelBlue
                                ElseIf e.Item.Cells(9).Text.StartsWith("(") Then
                                    e.Item.Cells(9).BackColor = Color.LightCoral
                                Else
                                    If e.Item.ItemType = ListItemType.AlternatingItem Then
                                        e.Item.Cells(9).BackColor = Color.WhiteSmoke
                                    End If
                                End If
                                If cellCIN2.StartsWith("(DEACT)") Then
                                    e.Item.Cells(10).BackColor = Color.LightSteelBlue
                                ElseIf e.Item.Cells(10).Text.StartsWith("(") Then
                                    e.Item.Cells(10).BackColor = Color.LightCoral
                                Else
                                    If e.Item.ItemType = ListItemType.AlternatingItem Then
                                        e.Item.Cells(10).BackColor = Color.WhiteSmoke
                                    End If
                                End If
                                If cellCIN3.StartsWith("(DEACT)") Then
                                    e.Item.Cells(11).BackColor = Color.LightSteelBlue
                                ElseIf e.Item.Cells(11).Text.StartsWith("(") Then
                                    e.Item.Cells(11).BackColor = Color.LightCoral
                                Else
                                    If e.Item.ItemType = ListItemType.AlternatingItem Then
                                        e.Item.Cells(11).BackColor = Color.WhiteSmoke
                                    End If
                                End If
                                If cellCIN4.StartsWith("(DEACT)") Then
                                    e.Item.Cells(12).BackColor = Color.LightSteelBlue
                                ElseIf e.Item.Cells(12).Text.StartsWith("(") Then
                                    e.Item.Cells(12).BackColor = Color.LightCoral
                                Else
                                    If e.Item.ItemType = ListItemType.AlternatingItem Then
                                        e.Item.Cells(12).BackColor = Color.WhiteSmoke
                                    End If
                                End If
                                If cellCIN5.StartsWith("(DEACT)") Then
                                    e.Item.Cells(13).BackColor = Color.LightSteelBlue
                                ElseIf e.Item.Cells(13).Text.StartsWith("(") Then
                                    e.Item.Cells(13).BackColor = Color.LightCoral
                                Else
                                    If e.Item.ItemType = ListItemType.AlternatingItem Then
                                        e.Item.Cells(13).BackColor = Color.WhiteSmoke
                                    End If
                                End If
                                If cellCIN6.StartsWith("(DEACT)") Then
                                    e.Item.Cells(14).BackColor = Color.LightSteelBlue
                                ElseIf e.Item.Cells(14).Text.StartsWith("(") Then
                                    e.Item.Cells(14).BackColor = Color.LightCoral
                                Else
                                    If e.Item.ItemType = ListItemType.AlternatingItem Then
                                        e.Item.Cells(14).BackColor = Color.WhiteSmoke
                                    End If
                                End If
                                If cellCIN7.StartsWith("(DEACT)") Then
                                    e.Item.Cells(15).BackColor = Color.LightSteelBlue
                                ElseIf e.Item.Cells(15).Text.StartsWith("(") Then
                                    e.Item.Cells(15).BackColor = Color.LightCoral
                                Else
                                    If e.Item.ItemType = ListItemType.AlternatingItem Then
                                        e.Item.Cells(15).BackColor = Color.WhiteSmoke
                                    End If
                                End If
                                If cellCIN8.StartsWith("(DEACT)") Then
                                    e.Item.Cells(16).BackColor = Color.LightSteelBlue
                                ElseIf e.Item.Cells(16).Text.StartsWith("(") Then
                                    e.Item.Cells(16).BackColor = Color.LightCoral
                                Else
                                    If e.Item.ItemType = ListItemType.AlternatingItem Then
                                        e.Item.Cells(16).BackColor = Color.WhiteSmoke
                                    End If
                                End If
                            End If       ' Item Type
                        End If    ' Group Headers
                    Catch ex As Exception
                        ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
                    End Try
                End Sub
            
                Private Sub UicList_selectedIndexChange(ByVal sender As Object, ByVal e As System.EventArgs) Handles cntrlUicList.cntrlSelectedEventRaised
                    Try
                        CheckSession()
                        hdnUIC.Text = cntrlUicList.SelectedUic
                        hdnUICTitle.Text = cntrlUicList.SelectedUicTitle
                        Session("svSelActivity") = hdnUIC.Text
                        Session("svSelUnit") = hdnUICTitle.Text
                        dgManBsc.PageSize = 100
                        dgManBsc.CurrentPageIndex = 0
                        Session("PgNum") = 0
                        Session("PgSize") = 100
                        ddlPageSize.SelectedItem.Value = 100
                        ddlPageSize.SelectedIndex = 0
                        lblInvBSC.Visible = True
                        lblAbvCin9.Visible = True
                        getRpt()
                    Catch ex As Exception
                        ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
                    End Try
                End Sub
            
                Public Sub recRangeHead()
                    Try
                        CheckSession()
                        Dim min, max As String
                        If (dgManBsc.CurrentPageIndex + 1) = 1 And (dgManBsc.CurrentPageIndex + 1) = dgManBsc.PageCount Then
                            '----when only one page index
                            min = 1
                            max = ((dgManBsc.CurrentPageIndex) * Session("PgSize")) + RecCnt
                            hdnRecRngCnt.Text = "Rows: " & min & "-" & max
                        Else
                            Select Case True
                                Case (dgManBsc.CurrentPageIndex + 1) = 1
                                    min = 1
                                    max = ((dgManBsc.CurrentPageIndex + 1) * Session("PgSize"))
                                    hdnRecRngCnt.Text = "Rows: " & min & "-" & max
                                Case (dgManBsc.CurrentPageIndex + 1) = dgManBsc.PageCount '----when last index
                                    min = ((dgManBsc.CurrentPageIndex) * Session("PgSize")) + 1
                                    max = ((dgManBsc.CurrentPageIndex) * Session("PgSize") + RecCnt)
                                    hdnRecRngCnt.Text = "Rows: " & min & "-" & max
                                Case (dgManBsc.CurrentPageIndex + 1) > 1 '----for indexes in between
                                    min = ((dgManBsc.CurrentPageIndex) * Session("PgSize")) + 1
                                    max = ((dgManBsc.CurrentPageIndex + 1) * Session("PgSize"))
                                    hdnRecRngCnt.Text = "Rows: " & min & "-" & max
                            End Select
                        End If
                    Catch ex As Exception
                        ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
                    End Try
                End Sub
            
                Private Sub ddlPageSize_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlPageSize.SelectedIndexChanged
                    Try
                        CheckSession()
                        dgManBsc.PageSize = ddlPageSize.SelectedItem.Value
                        dgManBsc.CurrentPageIndex = 0
                        getRpt()
                    Catch ex As Exception
                        ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
                    End Try
                End Sub
            
                Private Sub dgManBsc_PageIndexChanged(ByVal source As Object, ByVal e As DataGridPageChangedEventArgs) Handles dgManBsc.PageIndexChanged
                    Try
                        CheckSession()
                        dgManBsc.CurrentPageIndex = e.NewPageIndex
                        Session("PgNum") = e.NewPageIndex
                        getRpt()
                    Catch ex As Exception
                        ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
                    End Try
                End Sub
            End Class
            [/HTML]

            Comment

            • Plater
              Recognized Expert Expert
              • Apr 2007
              • 7872

              #7
              EDIT: Releated to missing text in this forum thread:
              I cannot correct the post it seems.
              The error message it gives is not correct, but the problem is that you managed to post TOO much data for the forums.
              Perhaps you can attach the code as text files?


              If the dev puts the website into running-debug mode, the problem cannot be reproduced?

              Comment

              • Lorie0114
                New Member
                • Jan 2008
                • 7

                #8
                Below are my attachments. I tried to upload them as .TXT files and it did not work. I'm trying ZIP files now.
                Attached Files

                Comment

                • Lorie0114
                  New Member
                  • Jan 2008
                  • 7

                  #9
                  I found out what is causing the issue. After pulling apart two pages, I can consistently cause it to fail or work by removing some of the columns in the datagrid. Removing columns also makes the viewstate smaller. So it is either an issue with the datagrid being too large or the viewstate. I think it is a viewstate issue.

                  Comment

                  • Lorie0114
                    New Member
                    • Jan 2008
                    • 7

                    #10
                    I found this article. I'm going to try this for the reports that need large viewstates. http://aspalliance.com/72

                    Comment

                    • Frinavale
                      Recognized Expert Expert
                      • Oct 2006
                      • 9749

                      #11
                      Originally posted by Lorie0114
                      I found this article. I'm going to try this for the reports that need large viewstates. http://aspalliance.com/72
                      http://aspadvice.com/blogs/robertb/a.../16/13835.aspx
                      You have a lot of variables...
                      You should consider trying to reduce the number of variables that you use in your pages..consider using Web User Controls to aid with this task.

                      Sometimes I get blank pages showing up when one of my asp tags is malformed.


                      -Frinny

                      Comment

                      Working...