By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

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

P: 7
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
Jan 29 '08 #1
Share this Question
Share on Google+
10 Replies


nateraaaa
Expert 100+
P: 663
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
Jan 29 '08 #2

P: 7
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.
Jan 29 '08 #3

nateraaaa
Expert 100+
P: 663
Could you post the code that displays the report?

thanks
Nathan
Jan 30 '08 #4

P: 7
Nathan,

Thank you for taking time to review this.

I have included 2 different reports that are causing this issue. The SOBTCseAddCompletion.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 RqmtsAviationTrngRqmtManBillets.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.
Jan 30 '08 #5

P: 7
[HTML]
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="vb" AutoEventWireup="false"  Trace="true" CodeBehind="SOBTCseAddCompletion.aspx.vb" Inherits="Fleet.SOBTCseAddCompletion" %>
  2. <%@ Register TagPrefix="Fleet" TagName="FleetHeader" Src ="~/Controls/cntrlFleetHeader.ascx" %>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml" >
  6. <head runat="server">
  7.         <title>Fleet - Courses - Learning Event Completion Entry Form</title>
  8.         <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR" />
  9.         <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE" />
  10.         <meta content="JavaScript" name="vs_defaultClientScript" />
  11.         <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema" />
  12.         <!-- #include virtual="/Fleet/Styles.htm" -->
  13.         <!-- #include virtual="/Fleet/include/SessionTimeout/timer.htm" -->
  14. </head>
  15.     <body >
  16.         <form id="frmCompl"  method="post" runat="server">
  17.             <table width="100%" border="0">
  18.                 <tr>
  19.                     <td colspan="4">
  20.                         <Fleet:FleetHeader id="FleetHeader" runat="server"></Fleet:FleetHeader>
  21.                     </td>
  22.                 </tr>
  23.                 <tr>
  24.                     <td class="fieldName" colspan="1">
  25.                         <asp:label id="lblUnAuth" Runat="server" Visible="false"></asp:label>
  26.                         Select Course:
  27.                     </td>
  28.                     <td colspan="3" align="left">
  29.                         <asp:dropdownlist id="ddlSelCin" runat="server" BackColor="LemonChiffon"  AutoPostBack="True" >
  30.                         <asp:ListItem value="Select" Selected="true">Filtered By</asp:ListItem>
  31.                         <asp:ListItem value="CourseNumber">Course Number</asp:ListItem>
  32.                         <asp:ListItem Value="CourseTitle">Course Title</asp:ListItem>
  33.                         <asp:ListItem Value="WarfareArea">Warfare Area</asp:ListItem>
  34.                         </asp:dropdownlist>            
  35.                     </td>
  36.                 </tr>
  37.             <tr>
  38.                 <td class="fieldName" colspan="1" style="width: 15%">
  39.                     <asp:label id="lblCinTitle" Runat="server" Visible="false">
  40.                         CIN/Course Title: 
  41.                     </asp:label>
  42.                 </td>
  43.                 <td colspan="3" align="left">
  44.                     <asp:label id="lblCIN" Runat="server" visible="True"></asp:label>
  45.                    &nbsp; <asp:label id="lblCseTitle" Runat="server" visible="True"></asp:label>
  46.                 </td>
  47.             </tr>        
  48.  
  49.                 <tr>
  50.                     <td class="fieldName" id="tdComplDt" runat="server" style="width: 15%" >
  51.                         Completion Date:
  52.                     </td>
  53.                     <td colspan="3">
  54.                         <asp:textbox id="txtDate" Runat="server" BackColor="WhiteSmoke" Width="150"></asp:textbox>
  55.                         &nbsp;                         
  56.                         <a id="aCalendar" runat="server" 
  57.                             href="javascript:calendar_window=window.open('/Fleet/calendar.aspx?formname=frmCompl.txtDate&amp;rptNm=NETC','calendar_window','width=275,height=225');calendar_window.focus()">
  58.                             Calendar
  59.                         </a>  
  60.  
  61.  
  62.                         <asp:textbox id="lblWarn" Runat="server" Visible="False" Width="328px" ForeColor="Red" CssClass="TableData"
  63.                             BorderStyle="None" BorderWidth="0px">
  64.                             You must first select a completion date.
  65.                         </asp:textbox>
  66.                     </td>
  67.                 </tr>
  68.                 <tr>
  69.                     <td class="fieldName" id="tdSearch" runat="server" >
  70.                         Search by Name:
  71.                     </td>
  72.                     <td colspan="3">
  73.                         <asp:TextBox Runat="server" ID="txtFilter" BorderStyle="Inset" BorderColor="white"  Width="150"></asp:TextBox>
  74.                         &nbsp;&nbsp;&nbsp;
  75.                         <asp:Button ID="btnFilter" Runat="server" Text="Filter" BackColor="SteelBlue" ForeColor="white"
  76.                             Font-Bold="True"></asp:Button>
  77.                         &nbsp;&nbsp;&nbsp;
  78.                         <asp:label ID="lblFilterWarn" Runat="server" Visible="False" Width="328px" ForeColor="red"
  79.                             CssClass="TableData" BorderStyle="None" BorderWidth="0px">
  80.                             No records found for your criteria.
  81.                         </asp:label>
  82.                     </td>
  83.                 </tr>
  84.                 <tr>
  85.                     <td class="fieldName" id="tdSSNSearch" runat="server" style="width: 15%">
  86.                         Search by SSN:
  87.                     </td>
  88.                     <td>
  89.                         <asp:TextBox Runat="server" ID="txtFilterSSN" BorderStyle="Inset" BorderColor="white" TextMode="Password"  Width="150"></asp:TextBox>
  90.                         &nbsp;&nbsp;&nbsp;
  91.                         <asp:Button ID="btnFilterSSN" Runat="server" Text="Filter" BackColor="SteelBlue" ForeColor="white"
  92.                             Font-Bold="True"></asp:Button>
  93.                         &nbsp;&nbsp;&nbsp;
  94.                         <asp:label ID="lblFilterSSNWarn" Runat="server" Visible="False" Width="328px" ForeColor="red"
  95.                             CssClass="TableData" BorderStyle="None" BorderWidth="0px">
  96.                             No records found for your criteria.
  97.                         </asp:label>
  98.                     </td>
  99.                 </tr>
  100.                 <tr>
  101.                     <td class="fieldName" id="td1" runat="server" style="width: 15%">
  102.                         Search by Rate:
  103.                     </td>
  104.                     <td>
  105.                             <asp:DropDownList ID="ddlRate" Runat="server" CssClass="entryScreenDropDown"  AutoPostBack="true" ></asp:DropDownList>
  106.                         &nbsp;&nbsp;&nbsp;
  107.                         <asp:label ID="lblFilterRateWarn" Runat="server" Visible="False" Width="328px" ForeColor="red"
  108.                             CssClass="TableData" BorderStyle="None" BorderWidth="0px">
  109.                             No records found for your criteria.
  110.                         </asp:label>
  111.                     </td>
  112.                 </tr>
  113.                 <tr>
  114.                     <td colspan="4">
  115.                         <asp:textbox id="lblSaveMsg" Runat="server" ForeColor="red" CssClass="FieldName" BorderStyle="None"
  116.                             Width="100%" BorderWidth="0px"></asp:textbox>
  117.                     </td>
  118.                 </tr>
  119.                 <tr>
  120.                     <td colspan="4">
  121.                         <asp:textbox id="lblWarnSelCse" Runat="server" Visible="False" Width="328px" ForeColor="Red"
  122.                             CssClass="FieldName" BorderStyle="None" BorderWidth="0px">
  123.                             You must first select a CIN/Course
  124.                         </asp:textbox>
  125.                     </td>
  126.                 </tr>
  127.                 <tr>
  128.                     <td colspan="4"><asp:Label ID="lblWarnDupe" Runat="server" CssClass="warning"></asp:Label></td>
  129.                 </tr>
  130.             </table>
  131.             <table  align="center">
  132.                 <tr>
  133.                     <td align="left" colspan="2">
  134.                         <a id="aMarkAll" runat="server" name="Mark">Mark All As Completed </a>
  135.                     </td>
  136.                     <td align="right">
  137.             <asp:HyperLink ID="hlComplRpt" Runat="server" Target="_blank">View Course Completions</asp:HyperLink>
  138.                     </td>
  139.  
  140.                 </tr>
  141.                 <tr>
  142.                     <td>
  143.                         <asp:Label ID="lblWarnNoData" Runat="server" Visible="False" CssClass="warning">
  144.                             No Records Found For Your Selection.
  145.                         </asp:Label>
  146.                     </td>
  147.                 </tr>
  148.                 <tr>
  149.                     <td align="center" colspan="3">
  150.                         <asp:datagrid id="dgComplList" Runat="server" CssClass="tableData"  AllowPaging="false"
  151.                             HorizontalAlign="Center" OnSortCommand="SortGrid" AllowSorting="True" 
  152.                              AllowCustomPaging="False" 
  153.                             AutoGenerateColumns="False" HeaderStyle-BackColor="steelblue" HeaderStyle-CssClass="FieldName"
  154.                             HeaderStyle-ForeColor="white" HeaderStyle-HorizontalAlign="left" ItemStyle-VerticalAlign="Bottom" >
  155.                             <Columns>
  156.                                 <asp:TemplateColumn HeaderText="Completed" ItemStyle-HorizontalAlign="Center" >
  157.                                     <ItemTemplate>
  158.                                         <asp:CheckBox  Runat="server" ID="cbCompl"></asp:CheckBox>
  159.                                     </ItemTemplate>
  160.                                 </asp:TemplateColumn>
  161.                                 <asp:HyperLinkColumn DataNavigateUrlFormatString="/Fleet/PersIDSRedirect.aspx?IDSSSN={0}&BUTTON=ETJTraining" DataNavigateUrlField="SSN_IND"
  162.                                     Target="_blank" DataTextField="NAME" HeaderText="Name" ItemStyle-HorizontalAlign="Left"  SortExpression="NAME DESC"></asp:HyperLinkColumn>
  163.                                 <asp:BoundColumn DataField="SSN" HeaderText="SSN" SortExpression="SSN DESC"></asp:BoundColumn>
  164.                                 <asp:BoundColumn DataField="UIC" HeaderText="UIC" SortExpression="UIC DESC" Visible="False"></asp:BoundColumn>
  165.                                 <asp:BoundColumn DataField="ENR_DT" HeaderText="Enroll Date" Visible="False"></asp:BoundColumn>
  166.                                 <asp:TemplateColumn HeaderText="Completion Date" SortExpression="COMPL_DT DESC" ItemStyle-HorizontalAlign="Left">
  167.                                     <ItemTemplate >
  168.                                         <asp:textbox id="txtComplDt" Runat="server" BackColor="WhiteSmoke"></asp:textbox>
  169.                                         <asp:HyperLink runat="server" id="hlCalendar">Change Date</asp:HyperLink>
  170.                                     </ItemTemplate>
  171.                                 </asp:TemplateColumn>
  172.                                 <asp:BoundColumn DataField="Score" HeaderText="Score" Visible="False" SortExpression="SCORE DESC"></asp:BoundColumn>
  173.                                 <asp:BoundColumn DataField="TRNG_DELIV_METH_DESCR" HeaderText="Training Delivery Method" Visible="False"></asp:BoundColumn>
  174.                                 <asp:BoundColumn DataField="CSE_LEN" HeaderText="Course Length" Visible="False"></asp:BoundColumn>
  175.                                 <asp:BoundColumn DataField="CSE_INTERVL" HeaderText="Interval" Visible="False"></asp:BoundColumn>
  176.                                 <asp:BoundColumn DataField="PERS_GRP_CD" HeaderText="Cell 10" Visible="False"></asp:BoundColumn>
  177.                                 <asp:TemplateColumn HeaderText="Personnel<br>Group">
  178.                                     <ItemTemplate>
  179.                                         <asp:Label Runat="server" ID="lblPersGrpCd"></asp:Label>
  180.                                     </ItemTemplate>
  181.                                 </asp:TemplateColumn>
  182.                                 <asp:BoundColumn DataField="COMPL_DT" Visible="False" HeaderText="Cell 12"></asp:BoundColumn>
  183.                                 <asp:TemplateColumn >
  184.                                     <HeaderStyle BackColor="" BorderStyle="None"  ></HeaderStyle>
  185.                                     <ItemStyle BackColor="" BorderStyle="None"></ItemStyle>
  186.                                     <ItemTemplate>
  187.                                         <asp:textbox Runat="server" ID="txtChangeInd" BorderStyle="None" Width="0" BorderColor="white" BorderWidth="0" ></asp:textbox>
  188.                                     </ItemTemplate>
  189.                                 </asp:TemplateColumn>
  190.                                 <asp:BoundColumn DataField="SSN_IND" Visible="False" HeaderText="Cell 14"></asp:BoundColumn>
  191.                                 <asp:BoundColumn DataField="NAME" Visible="False" HeaderText="Cell 15"></asp:BoundColumn>
  192.                                 <asp:BoundColumn DataField="RCRD_SRC" Visible="False" HeaderText="Cell 16"></asp:BoundColumn>
  193.                                 <asp:BoundColumn DataField="CSE_UIC" Visible="False" HeaderText="Cell 17"></asp:BoundColumn>
  194.                                 <asp:BoundColumn DataField="ENTRY_DT" Visible="False" HeaderText="Cell 18"></asp:BoundColumn>
  195.                                 <asp:BoundColumn DataField="CIN" Visible="False" HeaderText="Cell 19"></asp:BoundColumn>
  196.                                 <asp:BoundColumn DataField="CSE_LONG_TITLE" Visible="False" HeaderText="Cell 20"></asp:BoundColumn>
  197.                                 <asp:BoundColumn DataField="COMPL_IND" Visible="False" HeaderText="Cell 21"></asp:BoundColumn>
  198.                             </Columns>
  199.                         </asp:datagrid></td>
  200.                 </tr>
  201.  
  202.                 <tr>
  203.                     <td colspan="3">
  204.                         <asp:button id="btnSubmit" style="COLOR: white; BACKGROUND-COLOR: steelblue" 
  205.                             Runat="server" BackColor="SteelBlue" ForeColor="white" Text="Save"></asp:button>
  206.                         &nbsp;&nbsp;&nbsp; <input id="btnReset" type="reset" style="COLOR: white; BACKGROUND-COLOR: steelblue" value="Reset"
  207.                             title="Reset Form Data" runat="server" name="btnReset" />
  208.                     </td>
  209.                 </tr>
  210.             </table>
  211.             <asp:label id="hdnSort" Runat="server" Visible="False"></asp:label>
  212.             <asp:label id="hdnCDP" Runat="server" Visible="False"></asp:label>
  213.             <asp:label id="hdnCseUIC" Runat="server" Visible="False"></asp:label>
  214.             <asp:label id="hdnRetire_Point" Runat="server" Visible="False"></asp:label>
  215.             <asp:label id="hdnCse_Len" Runat="server" Visible="False"></asp:label>
  216.             <asp:label id="hdnTrng_Deliv_Meth_Cd" Runat="server" Visible="False"></asp:label>
  217.             <asp:label id="hdnCse_Intervl" Runat="server" Visible="False"></asp:label>
  218.             <asp:label id="hdnSrchMd" Runat="server" Visible="False"></asp:label>
  219.             <asp:label id="hdnSrchFld" Runat="server" Visible="False"></asp:label>
  220.             <asp:textbox id="hdnSaveCnt" Runat="server" Width="0" Visible="false"></asp:textbox>
  221.             <asp:label id="hdnDelCnt" Runat="server" Visible="False"></asp:label>
  222.             <asp:label id="hdnUpdtCnt" Runat="server" Visible="False"></asp:label>
  223.             <asp:Literal ID="Literal1" runat="server" ></asp:Literal>
  224.         </form>
  225.     </body>
  226. </html>
  227.  
  228.  
  229. Imports Oracle.DataAccess.Client
  230. Imports Fleet.ConstClass
  231. Imports System.Text
  232. Imports System.Configuration.ConfigurationManager
  233. Partial Public Class SOBTCseAddCompletion
  234.     Inherits System.Web.UI.Page
  235.     Dim strScript As String
  236.     Dim strScriptLink As String
  237.  
  238.     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  239.         Try
  240.             CheckSession()
  241.             If Session("svSOBTAccessLvl") = "S" Or Session("svSOBTAccessLvl") = "U" Then
  242.                 lblSaveMsg.Text = ""
  243.                 txtDate.Attributes.Add("ReadOnly", "ReadOnly")
  244.                 txtDate.Attributes.Add("AutoPostBack", "True")
  245.                 If Not Page.IsPostBack Then
  246.                     getrate()
  247.                     WebTracking(frmCompl, 1817, Now, Now, 1, 1, "LOAD")
  248.                     FleetHeader.Header2 = "SOBT Course Completion Entry Form"
  249.                     FleetHeader.AddSelection("UIC:", Request.QueryString("UIC") & " " & Request.QueryString("UICTitle"))
  250.                     hlComplRpt.Visible = True
  251.                     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")
  252.                     If Len(Request.QueryString("SelCin") & "") = 0 Then
  253.                         dgComplList.Visible = False
  254.                         btnSubmit.Visible = False
  255.                         aMarkAll.Visible = False
  256.                         tdComplDt.Visible = False
  257.                         tdSearch.Visible = False
  258.                         tdSSNSearch.Visible = False
  259.                         aCalendar.Visible = False
  260.                         btnReset.Visible = False
  261.                         btnFilter.Visible = False
  262.                         btnFilterSSN.Visible = False
  263.                         txtFilter.Visible = False
  264.                         txtFilterSSN.Visible = False
  265.                         txtDate.Visible = False
  266.                         hlComplRpt.Visible = False
  267.                         lblCinTitle.Visible = False
  268.                         ddlRate.Visible = False
  269.                         td1.Visible = False
  270.                         hdnSrchMd.Text = "Ascending"
  271.                         hdnSrchFld.Text = "NM"
  272.                         hdnSaveCnt.Text = "0"
  273.  
  274.                     Else
  275.                         ddlSelCin.Visible = True
  276.                         btnSubmit.Visible = True
  277.                         dgComplList.Visible = True
  278.                         aMarkAll.Visible = True
  279.                         txtDate.Visible = True
  280.                         tdComplDt.Visible = True
  281.                         tdSearch.Visible = True
  282.                         tdSSNSearch.Visible = True
  283.                         aCalendar.Visible = True
  284.                         btnReset.Visible = True
  285.                         btnFilter.Visible = True
  286.                         btnFilterSSN.Visible = True
  287.                         txtFilter.Visible = True
  288.                         txtFilterSSN.Visible = True
  289.                         hlComplRpt.Visible = True
  290.                         lblCinTitle.Visible = True
  291.                         ddlRate.Visible = True
  292.                         td1.Visible = True
  293.                         lblCseTitle.Text = Request.QueryString("SelCseTitle")
  294.                         lblCIN.Text = Request.QueryString("SelCin")
  295.                         GetData()
  296.                     End If
  297.                 End If
  298.             Else
  299.                 lblUnAuth.Visible = True
  300.                 lblUnAuth.Text = "You are not authorized to view this page."
  301.                 lblUnAuth.ForeColor = Color.Red
  302.                 lblUnAuth.Style.Item("Font-Weight") = "Bold"
  303.             End If
  304.         Catch ex As Exception
  305.             ErrorCapture(frmCompl, ex)
  306.         End Try
  307.     End Sub
  308.  
  309.     Private Sub GetData()
  310.         Try
  311.             CheckSession()
  312.             Dim objConn As New OracleConnection(Session("svOraProviderString"))
  313.             Dim DSStudents As New DataSet
  314.             Dim qryStudents As New StringBuilder
  315.             qryStudents.Append(" SELECT A.NM NAME, A.UIC_TRNG_UIC_RUC_UIC_CMD UIC, ")
  316.             qryStudents.Append(" A.PERS_GRP_CD PERS_GRP_CD, ")
  317.             'Check for full access to SSNs
  318.             If Session("svSSNAccess") = "F" Then
  319.                 qryStudents.Append(" DECODE(A.SSN_IND,NULL,A.SSN_IND,FUNC_DECRYPTDES3(A.SSN_IND)) SSN, ")
  320.             Else
  321.                 qryStudents.Append(" DECODE(A.SSN_IND,NULL,A.SSN_IND,'XXXXX'||SUBSTR(FUNC_DECRYPTDES3(A.SSN_IND),6,9)) SSN, ")
  322.             End If
  323.             qryStudents.Append(" A.SSN_IND SSN_IND, CIN, CDP, CSE_LONG_TITLE, '' SCORE, '' RETIRE_POINT, ")
  324.             qryStudents.Append(" '' CSE_LEN, '' TRNG_DELIV_METH_DESCR, RCRD_SRC, COMPL_IND, COMPL_DT, CSE_UIC, ENR_DT, ")
  325.             qryStudents.Append(" '' USER_UIC, CSE_INTERVL, SPON_SSN_IND, DEPN_TYPE_CD, ENTRY_SSN_IND, ENTRY_DT, ")
  326.             qryStudents.Append(" DT_SORT from    ")
  327.             qryStudents.Append(" ( select distinct U.SSN_IND SSN_IND, U.CIN, U.CDP, U.CSE_LONG_TITLE, U.RCRD_SRC, ")
  328.             qryStudents.Append(" DECODE(TO_CHAR(MAX(U.ENTRY_DT),'mm/dd/yyyy'),TO_CHAR(SYSDATE,'mm/dd/yyyy'),1,0) AS COMPL_IND, ")
  329.             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, ")
  330.             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, ")
  331.             qryStudents.Append(" U.DEPN_TYPE_CD DEPN_TYPE_CD, MAX(U.ENTRY_SSN_IND) ENTRY_SSN_IND, MAX(U.ENTRY_DT) ENTRY_DT, ")
  332.             qryStudents.Append(" DECODE(MAX(U.ENTRY_DT), NULL, 1, 0) DT_SORT ")
  333.             qryStudents.Append(" FROM  USER_CSE_COMPL U ")
  334.             qryStudents.Append(" where (U.CIN(+) = :strCIN2) ")
  335.             qryStudents.Append(" GROUP BY U.SSN_IND, U.CIN, U.CDP, U.CSE_LONG_TITLE, RCRD_SRC, ")
  336.             qryStudents.Append(" U.CSE_UIC, U.CSE_INTERVL, U.SPON_SSN_IND, U.DEPN_TYPE_CD ) U, ALL_PERS_GRP A ")
  337.             qryStudents.Append(" where a.ssn_ind = u.ssn_ind(+) ")
  338.             If txtFilter.Text <> "" Then
  339.                 qryStudents.Append("AND (A.NM LIKE :strNm ")
  340.                 If txtFilterSSN.Text <> "" Then
  341.                     qryStudents.Append("AND A.SSN_IND = func_encryptdes3(:strSSN)) ")
  342.                 Else
  343.                     qryStudents.Append(")")
  344.                 End If
  345.             ElseIf txtFilterSSN.Text <> "" Then
  346.                 qryStudents.Append("AND A.SSN_IND = func_encryptdes3(:strSSN) ")
  347.             End If
  348.             ' Removed Pending UIC      qryStudents.Append(" and (A.UIC_TRNG_UIC_RUC_UIC_CMD = :strUIC OR A.PENDING_UIC = :strUIC2) ")
  349.             qryStudents.Append(" and (A.UIC_TRNG_UIC_RUC_UIC_CMD = :strUIC) ")
  350.             qryStudents.Append(" AND (A.PERS_GRP_CD < 'USN_ENL_LOSS' OR A.PERS_GRP_CD > 'USN_ENL_LOSS') ")
  351.             qryStudents.Append(" AND (A.PERS_GRP_CD < 'USN_OFF_LOSS' OR A.PERS_GRP_CD > 'USN_OFF_LOSS') ")
  352.             qryStudents.Append(" AND (A.SSN_IND = U.SSN_IND(+)) ")
  353.             If ddlRate.SelectedItem.Value <> "NONE" Then
  354.                 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 ) ) ")
  355.  
  356.  
  357.             End If
  358.             If hdnSort.Text <> "" Then
  359.                 qryStudents.Append(hdnSort.Text)
  360.             Else    
  361.                 qryStudents.Append(" ORDER BY NAME")
  362.             End If
  363.             Dim cmdStudents As New OracleDataAdapter(qryStudents.ToString, objConn)
  364.             cmdStudents.SelectCommand.Parameters.Add("strCIN2", OracleDbType.Varchar2, 30).Value = lblCIN.Text
  365.             If txtFilter.Text <> "" Then
  366.                 cmdStudents.SelectCommand.Parameters.Add("strNm", OracleDbType.Varchar2, 29).Value = "%" & UCase(txtFilter.Text) & "%"
  367.                 If txtFilterSSN.Text <> "" Then
  368.                     cmdStudents.SelectCommand.Parameters.Add("strSSN", OracleDbType.Varchar2, 32).Value = UCase(txtFilterSSN.Text)
  369.                 End If
  370.             ElseIf txtFilterSSN.Text <> "" Then
  371.                 cmdStudents.SelectCommand.Parameters.Add("strSSN", OracleDbType.Varchar2, 32).Value = UCase(txtFilterSSN.Text)
  372.             End If
  373.             cmdStudents.SelectCommand.Parameters.Add("strUIC", OracleDbType.Varchar2, 6).Value = Request.QueryString("UIC")
  374.             'cmdStudents.SelectCommand.Parameters.Add("strUIC2", OracleDbType.Varchar2, 6).Value = Request.QueryString("UIC")
  375.  
  376.  
  377.             If ddlRate.SelectedItem.Value <> "NONE" Then
  378.                 cmdStudents.SelectCommand.Parameters.Add("strRate", OracleDbType.Varchar2, 6).Value = ddlRate.SelectedItem.Value
  379.             End If
  380.             Try
  381.                 Dim BegDt As Date = Now
  382.                 cmdStudents.Fill(DSStudents, "STUDENT_RECORDS")
  383.                 Dim count As Int32 = 0
  384.  
  385.                 count = DSStudents.Tables(0).Rows.Count
  386.  
  387.                 If AppSettings("asWebTracking") = "TRUE" Then
  388.                     WebTracking(frmCompl, 1817, BegDt, Now, DSStudents.Tables(0).Rows.Count, count, Request.QueryString("UIC"))
  389.                 End If
  390.             Catch ex As Exception
  391.                 ErrorCapture(frmCompl, ex)
  392.             Finally
  393.                 objConn.Close()
  394.                 objConn.Dispose()
  395.             End Try
  396.             dgComplList.DataSource = DSStudents
  397.             dgComplList.DataBind()
  398.             If DSStudents.Tables(0).Rows.Count = 0 Then
  399.                 If txtFilter.Text <> "" Then
  400.                     lblWarnNoData.Visible = True
  401.                     lblFilterWarn.Visible = True
  402.                     lblFilterSSNWarn.Visible = False
  403.                 ElseIf txtFilterSSN.Text <> "" Then
  404.                     lblWarnNoData.Visible = True
  405.                     lblFilterWarn.Visible = False
  406.                     lblFilterSSNWarn.Visible = True
  407.                 Else
  408.                     lblFilterWarn.Visible = True
  409.                     lblFilterSSNWarn.Visible = False
  410.                     lblWarnNoData.Visible = False
  411.                 End If
  412.                 dgComplList.Visible = False
  413.                 btnSubmit.Visible = False
  414.                 aMarkAll.Visible = False
  415.                 btnReset.Visible = False
  416.                 '   lnkbtnAddStudent.Visible = True
  417.             Else
  418.                 lblFilterWarn.Visible = False
  419.                 lblFilterSSNWarn.Visible = False
  420.                 lblWarnNoData.Visible = False
  421.                 dgComplList.Visible = True
  422.                 btnSubmit.Visible = True
  423.                 aMarkAll.Visible = True
  424.                 btnReset.Visible = True
  425.             End If
  426.  
  427.             Dim intSaveCnt As Int16 = 0
  428.             Dim intDelCnt As Int16 = 0
  429.             Dim intUpdtCnt As Int16 = 0
  430.             If hdnSaveCnt.Text = "" Then      
  431.                 intSaveCnt = 0
  432.             Else
  433.                 intSaveCnt = CInt(hdnSaveCnt.Text)
  434.             End If
  435.             If hdnDelCnt.Text = "" Then
  436.                 intDelCnt = 0
  437.             Else
  438.                 intDelCnt = CInt(hdnDelCnt.Text)
  439.             End If
  440.             If hdnUpdtCnt.Text = "" Then
  441.                 intUpdtCnt = 0
  442.             Else
  443.                 intUpdtCnt = CInt(hdnUpdtCnt.Text)
  444.             End If
  445.             If intSaveCnt + intDelCnt + intUpdtCnt > 0 Then
  446.                 If intSaveCnt = 1 Then
  447.                     lblSaveMsg.Text = "1 Record Added."
  448.                 Else
  449.                     If intSaveCnt > 0 Then
  450.                         lblSaveMsg.Text = hdnSaveCnt.Text & " Records Added."
  451.                     End If
  452.                 End If
  453.                 If intSaveCnt > 0 And intDelCnt > 0 Then
  454.                     lblSaveMsg.Text += " "
  455.                 End If
  456.                 If intDelCnt = 1 Then
  457.                     lblSaveMsg.Text += "1 Record Deleted."
  458.                 ElseIf intDelCnt > 0 Then
  459.                     lblSaveMsg.Text += hdnDelCnt.Text & " Records Deleted."
  460.                 End If
  461.                 If (intSaveCnt > 0 Or intDelCnt > 0) And intUpdtCnt > 0 Then
  462.                     lblSaveMsg.Text += " "
  463.                 End If
  464.                 If intUpdtCnt = 1 Then
  465.                     lblSaveMsg.Text += "1 Record Updated."
  466.                 ElseIf intUpdtCnt > 0 Then
  467.                     lblSaveMsg.Text += hdnUpdtCnt.Text & " Records Updated."
  468.                 End If
  469.                 lblSaveMsg.Visible = True
  470.             Else
  471.                 lblSaveMsg.Text = ""
  472.             End If
  473.             hdnSaveCnt.Text = ""
  474.             hdnDelCnt.Text = ""
  475.             hdnUpdtCnt.Text = ""
  476.             MarkAll_OnClick()
  477.         Catch ex As Exception
  478.             ErrorCapture(frmCompl, ex)
  479.         End Try
  480.     End Sub
  481.  
  482.     Private Sub dgComplList_ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) Handles dgComplList.ItemDataBound
  483.         Try
  484.             CheckSession()
  485.             If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
  486.                 'Display Completion Information
  487.                 Dim txt As New TextBox
  488.                 txt = e.Item.FindControl("txtComplDt")
  489.                 txt.Attributes.Add("ReadOnly", "ReadOnly")
  490.                 Dim hl As New HyperLink
  491.                 hl = e.Item.FindControl("hlCalendar")
  492.                 Dim txtChange As New TextBox
  493.                 txtChange = e.Item.FindControl("txtChangeInd")
  494.                 txtChange.Attributes.Add("ReadOnly", "ReadOnly")
  495.                 Dim cbBox As New CheckBox
  496.                 cbBox = e.Item.FindControl("cbCompl")
  497.                 Dim lblPersGrp As New Label
  498.                 lblPersGrp = e.Item.FindControl("lblPersGrpCd")
  499.                 'Add link to calendar for datagrid dates  
  500.                 If e.Item.Cells(16).Text = "SOBT" Or e.Item.Cells(16).Text = "&nbsp;" Then
  501.                     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()};"
  502.                 Else
  503.                     hl.Text = ""
  504.                     cbBox.Enabled = False
  505.                 End If
  506.                 If e.Item.Cells(12).Text <> "&nbsp;" And e.Item.Cells(21).Text = "1" Then
  507.                     cbBox.Checked = True
  508.                     txt.Text = Format(CDate(e.Item.Cells(12).Text), "MM/dd/yyyy")
  509.                 End If
  510.                 Select Case e.Item.Cells(10).Text
  511.                     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"
  512.                     Case "USNR_ENL", "USNR_OFF", "USNR_ACDU_ENL_DRILL", "USNR_ACDU_OFF_DRILL" : lblPersGrp.Text = "RESERVE"
  513.                     Case "CIV_GOVT" : lblPersGrp.Text = "GOVT EMPLOYEE"
  514.                     Case "CONTR_GOVT" : lblPersGrp.Text = "CONTRACTOR"
  515.                     Case "CIV_IBFT" : lblPersGrp.Text = "CIVILIAN"
  516.                     Case "DEPN" : lblPersGrp.Text = "DEPENDENT"
  517.                     Case "USA_OFF", "USA_ENL" : lblPersGrp.Text = "USA"
  518.                     Case "USAF_OFF", "USAF_ENL" : lblPersGrp.Text = "USAF"
  519.                     Case "USCG_OFF", "USCG_ENL" : lblPersGrp.Text = "USCG"
  520.                     Case "FORNAT_OFF", "FORNAT_ENL" : lblPersGrp.Text = "FOREIGN NATIONAL"
  521.                     Case Else : e.Item.Cells(10).Controls.Remove(lblPersGrp)
  522.                         Dim ddl As New DropDownList
  523.                         ddl.Items.Add("Select Personnel Group")
  524.                         ddl.Items.Add("ACTIVE")
  525.                         ddl.Items.Add("RESERVE")
  526.                         ddl.Items.Add("CONTRACTOR")
  527.                         ddl.Items.Add("GOVT EMPLOYEE (CIV)")
  528.                         ddl.Items.Add("DEPENDENT")
  529.                         e.Item.Cells(10).Controls.Add(ddl)
  530.                 End Select
  531.                  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='"
  532.                 If e.Item.Cells(12).Text <> "&nbsp;" Then
  533.                     strCBClick = strCBClick & Format(CDate(e.Item.Cells(12).Text), "MM/dd/yyyy") & "';" & txtChange.ClientID & ".value='';}else{" & txt.ClientID & ".value='';" & txtChange.ClientID & ".value='1';};};"
  534.                 Else
  535.                     strCBClick = strCBClick & e.Item.Cells(12).Text & "';" & txtChange.ClientID & ".value='1';}else{" & txt.ClientID & ".value='1'};};"
  536.                 End If
  537.                 Dim strTotCbClick As String = ""
  538.                 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 & "};"
  539.                 cbBox.Attributes.Add("onClick", strTotCbClick)
  540.                 txt.Attributes.Add("onChange", txtChange.ClientID & ".value='1';" & cbBox.ClientID & ".checked=true;")
  541.             ElseIf e.Item.ItemType = ListItemType.Header Then
  542.                 Dim x As Int16 = 0
  543.                 For x = 1 To 5
  544.                     Select Case x
  545.                         Case 1 : If hdnSrchFld.Text = "NM" Then
  546.                                 e.Item.Cells(x).ToolTip = "Click to sort by Name " & hdnSrchMd.Text
  547.                             Else
  548.                                 e.Item.Cells(x).ToolTip = "Click to sort by Name Ascending"
  549.                             End If
  550.                         Case 2 : If hdnSrchFld.Text = "SSN" Then
  551.                                 e.Item.Cells(x).ToolTip = "Click to sort by SSN " & hdnSrchMd.Text
  552.                             Else
  553.                                 e.Item.Cells(x).ToolTip = "Click to sort by SSN Ascending"
  554.                             End If
  555.                         Case 5 : If hdnSrchFld.Text = "COMPL_DT" Then
  556.                                 e.Item.Cells(x).ToolTip = "Click to sort by Completion Date " & hdnSrchMd.Text
  557.                             Else
  558.                                 e.Item.Cells(x).ToolTip = "Click to sort by Completion Date Ascending"
  559.                             End If
  560.                         Case Else : e.Item.Cells(x).ToolTip = ""
  561.                     End Select
  562.                 Next
  563.             End If
  564.         Catch ex As Exception
  565.             ErrorCapture(frmCompl, ex)
  566.         End Try
  567.     End Sub
  568.  
  569.  
  570.     Sub SortGrid(ByVal sender As Object, ByVal e As DataGridSortCommandEventArgs)
  571.         Try
  572.             CheckSession()
  573.             lblSaveMsg.Text = ""
  574.             Dim SortExprs() As String
  575.             Dim CurrentSearchMode As String = ""
  576.             Dim NewSearchMode As String = ""
  577.             Dim ColumnToSort As String = ""
  578.             Dim NewSortExpr As String = ""
  579.             '  Parse the sort expression - delimiter space
  580.             SortExprs = Split(e.SortExpression, " ")
  581.             ColumnToSort = SortExprs(0)
  582.             ' If a sort order is specified get it, else default is descending
  583.             If SortExprs.Length() > 1 Then
  584.                 CurrentSearchMode = SortExprs(1).ToUpper()
  585.                 If CurrentSearchMode = "ASC" Then
  586.                     NewSearchMode = "DESC"
  587.                     hdnSrchMd.Text = "Ascending"
  588.                 Else
  589.                     NewSearchMode = "ASC"
  590.                     hdnSrchMd.Text = "Descending"
  591.                 End If
  592.             Else   ' If no mode specified, Default is descending
  593.                 NewSearchMode = "length0"
  594.             End If
  595.             '  Derive the new sort expression. 
  596.             NewSortExpr = ColumnToSort & " " & NewSearchMode
  597.             ' Figure out the column index 
  598.             Dim iIndex As Integer = 0
  599.             ' Figure out the column index 
  600.             Select Case ColumnToSort.ToUpper()
  601.                 Case "NAME"
  602.                     iIndex = 1
  603.                     hdnSrchFld.Text = "NM"
  604.                 Case "SSN"
  605.                     iIndex = 2
  606.                     hdnSrchFld.Text = "SSN"
  607.                 Case "UIC"
  608.                     iIndex = 3
  609.                     hdnSrchFld.Text = "UIC"
  610.                 Case "COMPL_DT"
  611.                     iIndex = 5
  612.                     hdnSrchFld.Text = "COMPL_DT"
  613.                 Case "Score"
  614.                     iIndex = 6
  615.                     hdnSrchFld.Text = "SCORE"
  616.                 Case ""
  617.             End Select
  618.             hdnSort.Text = " Order by " & NewSortExpr
  619.             dgComplList.Columns(iIndex).SortExpression = NewSortExpr
  620.             GetData()
  621.         Catch ex As Exception
  622.             ErrorCapture(frmCompl, ex)
  623.         End Try
  624.     End Sub
  625.  
  626.     Protected Sub SubmitData()
  627.         Try
  628.             CheckSession()
  629.             Dim item As DataGridItem
  630.             Dim cbBox As New CheckBox
  631.             Dim lblPersGrp As New Label
  632.             Dim txt As New TextBox
  633.             Dim txtChange As New TextBox
  634.             Dim strComplDt As String = ""
  635.             Dim valid As Int16 = 1
  636.             Dim intSaveCnt As Int16 = 0
  637.             Dim intDelCnt As Int16 = 0
  638.             Dim intUpdtCnt As Int16 = 0
  639.             Dim connObj As New OracleConnection(Session("svOraProviderString"))
  640.             lblWarn.Visible = False
  641.             lblWarnDupe.Visible = False
  642.             lblWarnDupe.Text = ""
  643.             Dim x As Int16 = 0
  644.             Dim y As Int16 = 0
  645.             'Declare arrays to be used in Del/Ins Procedures
  646.             Dim strSSNDel As String() = Nothing
  647.             Dim strSSNIns As String() = Nothing
  648.             Dim strCIN As String() = Nothing
  649.             Dim strCDPDel As String() = Nothing
  650.             Dim strCDPIns As String() = Nothing
  651.             Dim dtComplDtDel As Date() = Nothing
  652.             Dim dtComplDtIns As Date() = Nothing
  653.             Dim strCseUIC As String() = Nothing
  654.             Dim strCseLongTitle As String() = Nothing
  655.             Dim strUIC As String() = Nothing
  656.             Dim strNmLast As String() = Nothing
  657.             Dim strNmFirst As String() = Nothing
  658.             Dim strNmMid As String() = Nothing
  659.             Dim intRetirePoint As Int16() = Nothing
  660.             Dim strTrngDelivMethCd As String() = Nothing
  661.             Dim intCseLen As Int16() = Nothing
  662.             Dim strCseIntervl As String() = Nothing
  663.             Dim strPersGrpCd As String() = Nothing
  664.             Dim strSponSSN As String() = Nothing
  665.             Dim strDepnTypeCd As String() = Nothing
  666.             Dim strRcrdSrc As String() = Nothing
  667.             Dim strEntrySSN As String() = Nothing
  668.             For Each item In dgComplList.Items
  669.                 Dim dtCompl As Date
  670.                 cbBox = item.FindControl("cbCompl")
  671.                 lblPersGrp = item.FindControl("lblPersGrpCd")
  672.                 txt = item.FindControl("txtComplDt")
  673.                 txtChange = item.FindControl("txtChangeInd")
  674.                 If (txtDate.Text = "&nbsp;" Or Len(txtDate.Text) = 0) Then
  675.                     If (txt.Text = "&nbsp;" Or Len(txt.Text) = 0) And cbBox.Checked = True Then
  676.                         lblWarn.Visible = True
  677.                         valid = 0
  678.                     Else
  679.                         If cbBox.Checked = True Then
  680.                             dtCompl = Format(CDate(txt.Text), "dd-MMM-yyyy")
  681.                         End If
  682.                     End If
  683.                 Else
  684.                     If txt.Text <> "&nbsp;" And Len(txt.Text) > 0 Then
  685.                         dtCompl = Format(CDate(txt.Text), "dd-MMM-yyyy")
  686.                     Else
  687.                         dtCompl = Format(CDate(txtDate.Text), "dd-MMM-yyyy")
  688.                     End If
  689.                 End If
  690.                 If txtChange.Text = "1" And valid = 1 Then
  691.                     ReDim Preserve strSSNDel(x)
  692.                     ReDim Preserve strCDPDel(x)
  693.                     ReDim Preserve dtComplDtDel(x)
  694.                     dtComplDtDel(x) = dtCompl
  695.                     If item.Cells(12).Text <> "&nbsp;" Then
  696.                         strSSNDel(x) = item.Cells(14).Text
  697.                         strCDPDel(x) = hdnCDP.Text
  698.                         dtComplDtDel(x) = Format(CDate(item.Cells(12).Text), "dd-MMM-yyyy")
  699.                         If cbBox.Checked = True Then
  700.                             intUpdtCnt += 1
  701.                         Else
  702.                             intDelCnt += 1
  703.                         End If
  704.                     Else
  705.                         strSSNDel(x) = item.Cells(14).Text
  706.                         strCDPDel(x) = hdnCDP.Text
  707.                         dtComplDtDel(x) = Format(CDate(dtCompl), "dd-MMM-yyyy")
  708.                         If cbBox.Checked = True Then
  709.                             intUpdtCnt += 1
  710.                         Else
  711.                             intDelCnt += 1
  712.                         End If
  713.                     End If
  714.                     If cbBox.Checked = True Then
  715.                         ReDim Preserve strSSNIns(y)
  716.                         ReDim Preserve strCIN(y)
  717.                         ReDim Preserve strCDPIns(y)
  718.                         ReDim Preserve dtComplDtIns(y)
  719.                         ReDim Preserve strCseUIC(y)
  720.                         ReDim Preserve strCseLongTitle(y)
  721.                         ReDim Preserve strUIC(y)
  722.                         ReDim Preserve strNmLast(y)
  723.                         ReDim Preserve strNmFirst(y)
  724.                         ReDim Preserve strNmMid(y)
  725.                         ReDim Preserve intRetirePoint(y)
  726.                         ReDim Preserve strTrngDelivMethCd(y)
  727.                         ReDim Preserve intCseLen(y)
  728.                         ReDim Preserve strCseIntervl(y)
  729.                         ReDim Preserve strPersGrpCd(y)
  730.                         ReDim Preserve strSponSSN(y)
  731.                         ReDim Preserve strDepnTypeCd(y)
  732.                         ReDim Preserve strRcrdSrc(y)
  733.                         ReDim Preserve strEntrySSN(y)
  734.                         Dim strNm As String = ""
  735.                         Dim strNmLeft As String = ""
  736.                         Dim intIdx As Int16 = 0
  737.                         strNm = item.Cells(15).Text
  738.                         intIdx = InStr(strNm, " ")
  739.                         If intIdx > 0 Then
  740.                             strNmLast(y) = Left(strNm, intIdx - 1)
  741.                             strNmLeft = Trim(Mid(strNm, intIdx + 1))       'Remove extra white space
  742.                             intIdx = InStr(strNmLeft, " ")
  743.                             If intIdx > 0 Then
  744.                                 strNmFirst(y) = Left(strNmLeft, intIdx - 1)
  745.                                 strNmMid(y) = Trim(Mid(strNmLeft, intIdx + 1))          'Remove extra white space
  746.                             Else
  747.                                 strNmFirst(y) = strNmLeft
  748.                             End If
  749.                         End If
  750.                         strCseUIC(y) = Request.QueryString("UIC")
  751.                         If (Not lblPersGrp Is Nothing) Then
  752.                             strPersGrpCd(y) = lblPersGrp.Text
  753.                         Else
  754.                             Dim ddl As New DropDownList
  755.                             ddl = item.FindControl("ddlPersGrpCd")
  756.                             If (Not ddl Is Nothing) Then
  757.                                 strPersGrpCd(y) = ddl.SelectedItem.Value
  758.                             Else
  759.                                 strPersGrpCd(y) = ""
  760.                             End If
  761.                         End If
  762.                         If Len(hdnRetire_Point.Text & "") > 0 Then
  763.                             intRetirePoint(y) = CInt(hdnRetire_Point.Text)
  764.                         End If
  765.                         If Len(hdnCse_Len.Text & "") > 0 Then
  766.                             intCseLen(y) = hdnCse_Len.Text
  767.                         End If
  768.                         dtComplDtIns(y) = dtCompl
  769.                         strSSNIns(y) = item.Cells(14).Text
  770.                         strCIN(y) = lblCIN.Text
  771.                         strCDPIns(y) = hdnCDP.Text
  772.                         strCseLongTitle(y) = lblCseTitle.Text
  773.                         strUIC(y) = item.Cells(3).Text
  774.                         strTrngDelivMethCd(y) = hdnTrng_Deliv_Meth_Cd.Text
  775.                         strCseIntervl(y) = ""
  776.                         strPersGrpCd(y) = item.Cells(10).Text
  777.                         strEntrySSN(y) = Session("svEncryptLoginSSN")
  778.                         strDepnTypeCd(y) = "-"
  779.                         strRcrdSrc(y) = "SOBT"
  780.                         If item.Cells(12).Text = "&nbsp;" Then
  781.                             intSaveCnt += 1
  782.                         End If
  783.                         y += 1
  784.                     End If
  785.                     x += 1
  786.                 End If
  787.             Next
  788.             If x > 0 Then
  789.                 'Delete records from arrays
  790.                 CheckSession()
  791.                 Dim objConn As New OracleConnection(Session("svOraProviderString"))
  792.                 Dim myCmd As New OracleCommand
  793.                 myCmd.Connection = objConn
  794.                 myCmd.CommandType = CommandType.StoredProcedure
  795.                 myCmd.CommandText = "SP_USERCSECOMPL_DEL"
  796.                 myCmd.ArrayBindCount = x
  797.                 Dim strSSNParam As OracleParameter = New OracleParameter("strSSN", OracleDbType.Varchar2)
  798.                 strSSNParam.Direction = ParameterDirection.Input
  799.                 strSSNParam.Value = strSSNDel
  800.                 myCmd.Parameters.Add(strSSNParam)
  801.                 Dim strCDPParam As OracleParameter = New OracleParameter("strCDP", OracleDbType.Varchar2)
  802.                 strCDPParam.Direction = ParameterDirection.Input
  803.                 strCDPParam.Value = strCDPDel
  804.                 myCmd.Parameters.Add(strCDPParam)
  805.                 Dim dtComplDtParam As OracleParameter = New OracleParameter("dtComplDt", OracleDbType.Date)
  806.                 dtComplDtParam.Direction = ParameterDirection.Input
  807.                 dtComplDtParam.Value = dtComplDtDel
  808.                 myCmd.Parameters.Add(dtComplDtParam)
  809.                 Try
  810.                     objConn.Open()
  811.                     myCmd.ExecuteNonQuery()
  812.                 Catch ex As Exception
  813.                     ErrorCapture(frmCompl, ex)
  814.                 Finally
  815.                     objConn.Close()
  816.                     objConn.Dispose()
  817.                 End Try
  818.             End If
  819.             If y > 0 Then
  820.                 'Insert records from arrays
  821.                 CheckSession()
  822.                 Dim objConn2 As New OracleConnection(Session("svOraProviderString"))
  823.                 Dim myCmd2 As New OracleCommand
  824.                 myCmd2.Connection = objConn2
  825.                 myCmd2.CommandType = CommandType.StoredProcedure
  826.                 myCmd2.CommandText = "SP_USERCSECOMPL_INS"
  827.                 myCmd2.ArrayBindCount = y
  828.                 Dim strSSNParam2 As OracleParameter = New OracleParameter("strSSN", OracleDbType.Varchar2)
  829.                 strSSNParam2.Direction = ParameterDirection.Input
  830.                 strSSNParam2.Value = strSSNIns
  831.                 myCmd2.Parameters.Add(strSSNParam2)
  832.                 Dim strCINParam As OracleParameter = New OracleParameter("strCIN", OracleDbType.Varchar2)
  833.                 strCINParam.Direction = ParameterDirection.Input
  834.                 strCINParam.Value = strCIN
  835.                 myCmd2.Parameters.Add(strCINParam)
  836.                 Dim strCDPParam As OracleParameter = New OracleParameter("strCDP", OracleDbType.Varchar2)
  837.                 strCDPParam.Direction = ParameterDirection.Input
  838.                 strCDPParam.Value = strCDPIns
  839.                 myCmd2.Parameters.Add(strCDPParam)
  840.                 Dim dtComplDtParam As OracleParameter = New OracleParameter("dtComplDt", OracleDbType.Date)
  841.                 dtComplDtParam.Direction = ParameterDirection.Input
  842.                 dtComplDtParam.Value = dtComplDtIns
  843.                 myCmd2.Parameters.Add(dtComplDtParam)
  844.                 Dim strCseUICParam As OracleParameter = New OracleParameter("strCseUIC", OracleDbType.Varchar2)
  845.                 strCseUICParam.Direction = ParameterDirection.Input
  846.                 strCseUICParam.Value = strCseUIC
  847.                 myCmd2.Parameters.Add(strCseUICParam)
  848.                 Dim strCseLongTitleParam As OracleParameter = New OracleParameter("strCseLongTitle", OracleDbType.Varchar2)
  849.                 strCseLongTitleParam.Direction = ParameterDirection.Input
  850.                 strCseLongTitleParam.Value = strCseLongTitle
  851.                 myCmd2.Parameters.Add(strCseLongTitleParam)
  852.                 Dim strUICParam As OracleParameter = New OracleParameter("strUIC", OracleDbType.Varchar2)
  853.                 strUICParam.Direction = ParameterDirection.Input
  854.                 strUICParam.Value = strUIC
  855.                 myCmd2.Parameters.Add(strUICParam)
  856.                 Dim strNmLastParam As OracleParameter = New OracleParameter("strNmLast", OracleDbType.Varchar2)
  857.                 strNmLastParam.Direction = ParameterDirection.Input
  858.                 strNmLastParam.Value = strNmLast
  859.                 myCmd2.Parameters.Add(strNmLastParam)
  860.                 Dim strNmFirstParam As OracleParameter = New OracleParameter("strNmFirst", OracleDbType.Varchar2)
  861.                 strNmFirstParam.Direction = ParameterDirection.Input
  862.                 strNmFirstParam.Value = strNmFirst
  863.                 myCmd2.Parameters.Add(strNmFirstParam)
  864.                 Dim strNmMidParam As OracleParameter = New OracleParameter("strNmMid", OracleDbType.Varchar2)
  865.                 strNmMidParam.Direction = ParameterDirection.Input
  866.                 strNmMidParam.Value = strNmMid
  867.                 myCmd2.Parameters.Add(strNmMidParam)
  868.                 Dim intRetirePointParam As OracleParameter = New OracleParameter("intRetirePoint", OracleDbType.Int16)
  869.                 intRetirePointParam.Direction = ParameterDirection.Input
  870.                 intRetirePointParam.Value = intRetirePoint
  871.                 myCmd2.Parameters.Add(intRetirePointParam)
  872.                 Dim strTrngDelivMethCdParam As OracleParameter = New OracleParameter("strTrngDelivMethCd", OracleDbType.Varchar2)
  873.                 strTrngDelivMethCdParam.Direction = ParameterDirection.Input
  874.                 strTrngDelivMethCdParam.Value = strTrngDelivMethCd
  875.                 myCmd2.Parameters.Add(strTrngDelivMethCdParam)
  876.                 Dim intCseLenParam As OracleParameter = New OracleParameter("intCseLen", OracleDbType.Int16)
  877.                 intCseLenParam.Direction = ParameterDirection.Input
  878.                 intCseLenParam.Value = intCseLen
  879.                 myCmd2.Parameters.Add(intCseLenParam)
  880.                 Dim strCseIntervlParam As OracleParameter = New OracleParameter("strCseIntervl", OracleDbType.Varchar2)
  881.                 strCseIntervlParam.Direction = ParameterDirection.Input
  882.                 strCseIntervlParam.Value = strCseIntervl
  883.                 myCmd2.Parameters.Add(strCseIntervlParam)
  884.                 Dim strPersGrpCdParam As OracleParameter = New OracleParameter("strPersGrpCd", OracleDbType.Varchar2)
  885.                 strPersGrpCdParam.Direction = ParameterDirection.Input
  886.                 strPersGrpCdParam.Value = strPersGrpCd
  887.                 myCmd2.Parameters.Add(strPersGrpCdParam)
  888.                 Dim strDepnTypeCdParam As OracleParameter = New OracleParameter("strDepnTypeCd", OracleDbType.Varchar2)
  889.                 strDepnTypeCdParam.Direction = ParameterDirection.Input
  890.                 strDepnTypeCdParam.Value = strDepnTypeCd
  891.                 myCmd2.Parameters.Add(strDepnTypeCdParam)
  892.                 Dim strEntrySSNParam As OracleParameter = New OracleParameter("strEntrySSN", OracleDbType.Varchar2)
  893.                 strEntrySSNParam.Direction = ParameterDirection.Input
  894.                 strEntrySSNParam.Value = strEntrySSN
  895.                 myCmd2.Parameters.Add(strEntrySSNParam)
  896.                 Dim strRcrdSrcParam As OracleParameter = New OracleParameter("strRcrdSrc", OracleDbType.Varchar2)
  897.                 strRcrdSrcParam.Direction = ParameterDirection.Input
  898.                 strRcrdSrcParam.Value = strRcrdSrc
  899.                 myCmd2.Parameters.Add(strRcrdSrcParam)
  900.                 Try
  901.                     objConn2.Open()
  902.                     myCmd2.ExecuteNonQuery()
  903.                 Catch ex As Exception
  904.                     ErrorCapture(frmCompl, ex)
  905.                 Finally
  906.                     objConn2.Close()
  907.                     objConn2.Dispose()
  908.                 End Try
  909.             End If
  910.             'Count Records Changed
  911.             hdnSaveCnt.Text = intSaveCnt
  912.             hdnDelCnt.Text = intDelCnt
  913.             hdnUpdtCnt.Text = intUpdtCnt
  914.         Catch ex As Exception
  915.             ErrorCapture(frmCompl, ex)
  916.         End Try
  917.     End Sub
  918.  
  919.     Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
  920.         Try
  921.             CheckSession()
  922.             lblSaveMsg.Text = ""
  923.             lblSaveMsg.Visible = True
  924.             GetCDP()
  925.             SubmitData()
  926.             GetData()
  927.         Catch ex As Exception
  928.             ErrorCapture(frmCompl, ex)
  929.         End Try
  930.     End Sub
  931.  
  932.     Private Function DupeCheck(ByVal strSSN As String, ByVal strComplDt As String) As Boolean
  933.         Try
  934.             CheckSession()
  935.             Dim objConn As New OracleConnection(Session("svOraProviderString"))
  936.             Dim strDupe As New StringBuilder
  937.             strDupe.Append("SELECT COUNT(*) AS COMPL_COUNT FROM ALL_CSE_COMPL WHERE SSN_IND = :strSSN AND COMPL_DT = :dtCompl AND CIN = :strCIN ")
  938.             Dim cmdDupe As New OracleDataAdapter(strDupe.ToString, objConn)
  939.             cmdDupe.SelectCommand.Parameters.Add("strSSN", OracleDbType.Varchar2, 32).Value = strSSN
  940.             cmdDupe.SelectCommand.Parameters.Add("dtCompl", OracleDbType.Date).Value = Format(CDate(strComplDt), "dd-MMM-yyyy")
  941.             cmdDupe.SelectCommand.Parameters.Add("strCIN", OracleDbType.Varchar2, 30).Value = ddlSelCin.SelectedItem.Value
  942.             Dim DSDupe As New DataSet
  943.             Try
  944.                 Dim dt As Date = Now
  945.                 cmdDupe.Fill(DSDupe, "COMPL_COUNT")
  946.                 If AppSettings("asWebTracking") = "TRUE" Then
  947.                     WebTracking(frmCompl, 1817, dt, Now, 1, 1, "DupeCheck")
  948.                 End If
  949.             Catch ex As Exception
  950.                 ErrorCapture(frmCompl, ex)
  951.             Finally
  952.                 objConn.Close()
  953.                 objConn.Dispose()
  954.             End Try
  955.             If DSDupe.Tables(0).Rows.Count > 0 Then
  956.                 If DSDupe.Tables(0).Rows(0)("COMPL_COUNT") > 0 Then
  957.                     Return False
  958.                 Else
  959.                     Return True
  960.                 End If
  961.             Else
  962.                 Return True
  963.             End If
  964.         Catch ex As Exception
  965.             ErrorCapture(frmCompl, ex)
  966.         End Try
  967.     End Function
  968.  
  969.     Private Sub btnFilter_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnFilter.Click
  970.         Try
  971.             CheckSession()
  972.             lblWarnDupe.Visible = False
  973.             lblWarnDupe.Text = ""
  974.             GetData()
  975.         Catch ex As Exception
  976.             ErrorCapture(frmCompl, ex)
  977.         End Try
  978.     End Sub
  979.  
  980.     Private Sub MarkAll_OnClick()
  981.         Try
  982.             CheckSession()
  983.             Dim aMark As New HtmlAnchor
  984.             aMark = Page.FindControl("aMarkAll")
  985.             aMark.HRef = "javascript:void(0)"
  986.             Dim txt As New TextBox
  987.             txt = Page.FindControl("txtDate")
  988.             txt.Attributes.Add("ReadOnly", "ReadOnly")
  989.             Dim item As DataGridItem
  990.             Dim strMark As String
  991.             strMark = "if(" & txt.ClientID & ".value=='&nbsp;'||" & txt.ClientID & ".value==''){alert('You must first select a completion date.');}else{"
  992.             For Each item In dgComplList.Items
  993.                 Dim txtChange As New TextBox
  994.                 txtChange = item.FindControl("txtChangeInd")
  995.                 Dim txtCompl As New TextBox
  996.                 txtCompl = item.FindControl("txtComplDt")
  997.                 txtCompl.Attributes.Add("ReadOnly", "ReadOnly")
  998.                 Dim cbBox As New CheckBox
  999.                 cbBox = item.FindControl("cbCompl")
  1000.                 strMark += "if(" & cbBox.ClientID & ".checked != true){" & cbBox.ClientID & ".checked=true;" & txtChange.ClientID & ".value='1';" & txtCompl.ClientID & ".value=" & txt.ClientID & ".value;};"
  1001.             Next
  1002.             strMark += "};"
  1003.             aMark.Attributes.Add("onclick", strMark)
  1004.         Catch ex As Exception
  1005.             ErrorCapture(frmCompl, ex)
  1006.         End Try
  1007.     End Sub
  1008.  
  1009.     Private Sub GetCDP()
  1010.         Try
  1011.             CheckSession()
  1012.             'Need to get the CDP for the CIN that has been selected
  1013.             hdnCDP.Text = ""
  1014.             hdnCseUIC.Text = ""
  1015.             hdnRetire_Point.Text = ""
  1016.             hdnCse_Len.Text = ""
  1017.             hdnTrng_Deliv_Meth_Cd.Text = ""
  1018.             hdnCse_Intervl.Text = ""
  1019.             Dim objConn As New OracleConnection(Session("svOraProviderString"))
  1020.             Dim qryCDP As New StringBuilder
  1021.             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 ")
  1022.             qryCDP.Append(" from sub_onbd_Trng_cse sotc, sub_onbd_trng_uic_cls_cin succ , all_cse_title act ")
  1023.             qryCDP.Append("   where succ.cin = sotc.cin  ")
  1024.             qryCDP.Append(" and succ.cin = act.cin ")
  1025.             qryCDP.Append(" AND sotc.CIN =  :strCIN ")
  1026.  
  1027.             CheckSession()
  1028.             Dim cmdOracle As New OracleDataAdapter(qryCDP.ToString, objConn)
  1029.             cmdOracle.SelectCommand.Parameters.Add("strCIN", OracleDbType.Varchar2, 30).Value = lblCIN.Text
  1030.             Dim dsCDP As New DataSet
  1031.             Try
  1032.                 Dim dt As Date = Now
  1033.                 cmdOracle.Fill(dsCDP, "CDPSEL")
  1034.                 If AppSettings("asWebTracking") = "TRUE" Then
  1035.                     WebTracking(frmCompl, 1817, dt, Now, dsCDP.Tables(0).Rows.Count, dsCDP.Tables(0).Rows.Count, "GetCDP, " & lblCIN.Text)
  1036.                 End If
  1037.             Catch ex As Exception
  1038.                 ErrorCapture(frmCompl, ex)
  1039.             Finally
  1040.                 objConn.Close()
  1041.                 objConn.Dispose()
  1042.             End Try
  1043.             If dsCDP.Tables(0).Rows.Count > 0 Then
  1044.                 'a row better be returned or there's a problem
  1045.                 hdnCDP.Text = dsCDP.Tables(0).Rows(0)("CDP")
  1046.                  hdnCseUIC.Text = Request.QueryString("UIC")
  1047.                 hdnRetire_Point.Text = ""
  1048.                 hdnCse_Len.Text = ""
  1049.                 If Len(dsCDP.Tables(0).Rows(0)("Trng_Deliv_Meth_Cd") & "") > 0 Then
  1050.                     hdnTrng_Deliv_Meth_Cd.Text = dsCDP.Tables(0).Rows(0)("Trng_Deliv_Meth_Cd")
  1051.                 End If
  1052.                 hdnCse_Intervl.Text = ""
  1053.             End If
  1054.         Catch ex As Exception
  1055.             ErrorCapture(frmCompl, ex)
  1056.         End Try
  1057.     End Sub
  1058.  
  1059.     Private Sub btnFilterSSN_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnFilterSSN.Click
  1060.         Try
  1061.             CheckSession()
  1062.             lblWarnDupe.Visible = False
  1063.             lblWarnDupe.Text = ""
  1064.             GetData()
  1065.         Catch ex As Exception
  1066.             ErrorCapture(frmCompl, ex)
  1067.         End Try
  1068.     End Sub
  1069.  
  1070.     Private Sub ddlSelCin_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlSelCin.SelectedIndexChanged
  1071.         Try
  1072.             CheckSession()
  1073.             If ddlSelCin.SelectedIndex.ToString <> "Select" Then
  1074.                 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>")
  1075.             End If
  1076.         Catch ex As Exception
  1077.             ErrorCapture(frmCompl, ex)
  1078.         End Try
  1079.     End Sub
  1080.  
  1081.  
  1082.     Public Sub getrate()
  1083.         Try
  1084.             CheckSession()
  1085.             ddlRate.Items.Clear()
  1086.             Dim qryRate As New StringBuilder
  1087.             '  qryRate.Append("  select distinct DESIG_RATING DESIG_GRADE_RATE, DESIG_RATING || ' - ' || DESIG_RATING_DESCR DESIG_DESCR from display_paygrade ")
  1088.             '  qryRate.Append("  where paygrade_sort <> 'Z' ")
  1089.             '  qryRate.Append(" order by DESIG_GRADE_RATE ")
  1090.  
  1091.             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   ")
  1092.             qryRate.Append("       where ")
  1093.             qryRate.Append("       apg.uic_trng_uic_ruc_uic_cmd = :strUIC  ")
  1094.             qryRate.Append("       and apg.desig_grade_rate  =  dgr.desig_grade_rate   ")
  1095.             qryRate.Append("       order by DESIG_GRADE_RATE  ")
  1096.  
  1097.             CheckSession()
  1098.             Dim objConn4 As New OracleConnection(Session("svOraProviderString"))
  1099.             Dim MyCommand4 As New OracleDataAdapter(qryRate.ToString, objConn4)
  1100.             MyCommand4.SelectCommand.Parameters.Add("strUIC", OracleDbType.Varchar2, 30).Value = Request.QueryString("UIC")
  1101.  
  1102.             Dim DSRate As New DataSet
  1103.             Try
  1104.                 MyCommand4.Fill(DSRate, "Rate")
  1105.             Catch ex As Exception
  1106.                 ErrorCapture(frmCompl, ex)
  1107.             Finally
  1108.                 objConn4.Close()
  1109.                 objConn4.Dispose()
  1110.             End Try
  1111.             Dim DVRate As DataView = DSRate.Tables(0).DefaultView
  1112.             If DSRate.Tables(0).Rows.Count > 0 Then
  1113.                 ddlRate.DataSource = DVRate
  1114.                 ddlRate.DataTextField = "DESIG_DESCR"
  1115.                 ddlRate.DataValueField = "DESIG_GRADE_RATE"
  1116.                 ddlRate.DataBind()
  1117.             End If
  1118.             ddlRate.Items.Insert(0, "All Rates")
  1119.             ddlRate.Items(0).Value = "NONE"
  1120.  
  1121.         Catch ex As Exception
  1122.             ErrorCapture(frmCompl, ex)
  1123.         End Try
  1124.     End Sub
  1125.  
  1126.     Private Sub ddlRate_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlRate.SelectedIndexChanged
  1127.         Try
  1128.             CheckSession()
  1129.             GetData()
  1130.         Catch ex As Exception
  1131.             ErrorCapture(frmCompl, ex)
  1132.         End Try
  1133.  
  1134.     End Sub
  1135. End Class
  1136.  
  1137. <%@ Page Language="vb"  Trace="true" AutoEventWireup="false" Codebehind="RqmtsAviationTrngRqmtManBillets.aspx.vb" Inherits="Fleet.RqmtsAviationTrngRqmtManBillets"%>
  1138. <%@ Register tagprefix="Fleet" tagname="Header" src="~/Controls/cntrlFleetHeader.ascx" %>
  1139. <%@ Register tagprefix="Fleet" Tagname="UicList" src="~/Controls/cntrlUserUicList.ascx" %>
  1140. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  1141. <html xmlns="http://www.w3.org/1999/xhtml">
  1142.     <head>
  1143.         <title>Fleet Training Requirements by Authorized Manning Document Billets</title>
  1144.         <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR" />
  1145.         <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE" />
  1146.         <meta content="JavaScript" name="vs_defaultClientScript" />
  1147.         <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema" />
  1148.         <!-- #include virtual="/Fleet/Styles.htm" -->
  1149.         <!-- #include virtual="/Fleet/include/SessionTimeout/timer.htm" -->
  1150.     </head>
  1151.     <body >
  1152.         <form id="RqmtAviationTrngRqmtManBillets" method="post" runat="server">
  1153.                 <table cellspacing="1" cellpadding="1" width="100%"  align="center">
  1154.                     <tr>
  1155.                         <td colspan="3">
  1156.                             <Fleet:Header id="FleetHeader" runat="server"></Fleet:Header>                    
  1157.                         </td>
  1158.                     </tr>                            
  1159.                     <tr>
  1160.                         <td colspan="3">
  1161.                             <Fleet:UicList id="cntrlUicList" runat="server" visible="false"></Fleet:UicList>                            
  1162.                         </td>
  1163.                     </tr>
  1164.                     <tr>
  1165.                         <td colspan="3">
  1166.                             <asp:label ID="lblSelDispNum" runat="server" Visible="True" CssClass="FieldName">Number of Rows Displayed Per Screen:</asp:label>
  1167.                                 <asp:DropDownList ID="ddlPageSize" Runat="server" autopostback="True" Visible="True" CssClass="TableData">
  1168.                                     <asp:ListItem Value="100">100</asp:ListItem>
  1169.                                     <asp:ListItem Value="250">250</asp:ListItem>
  1170.                                     <asp:ListItem Value="500">500</asp:ListItem>                    
  1171.                                     <asp:ListItem Value="1000">1000</asp:ListItem>
  1172.                                 </asp:DropDownList>    
  1173.                         </td>
  1174.                     </tr>        
  1175.                     <tr>
  1176.                         <td>
  1177.                             <asp:Label ID="lblAbvCin9" Runat="server" Visible="True" CssClass="FieldName" ForeColor="steelblue" >Course/CIN Deactivated When Blue</asp:Label>
  1178.                         </td>
  1179.                         <td colspan="2">
  1180.                             <asp:hyperlink id="hlAbvCin9" Visible="false" Runat="server" Target="_blank">Click Here To View Training Requirements Above CIN08</asp:hyperlink>
  1181.                         </td>
  1182.                     </tr>
  1183.                     <tr>
  1184.                         <td>
  1185.                             <asp:Label ID="lblInvBSC" Runat="server" Visible="True" CssClass="FieldName" ForeColor="tomato">Course/CIN Invalid When Red</asp:Label>
  1186.                         </td>
  1187.                         <td colspan="2">
  1188.                             <asp:hyperlink id="hlInvBsc" Visible="false" Runat="server" Target="_blank">Click Here To View All Reported BSCs with Invalid Billets Highlighted</asp:hyperlink>                            
  1189.                         </td>                        
  1190.                     </tr>                                
  1191.                     <tr>
  1192.                         <td colspan="3">
  1193.                             <asp:datagrid id="dgManBsc" runat="server" AutoGenerateColumns="False" 
  1194.                                 PagerStyle-HorizontalAlign="Center" PagerStyle-Pagebuttoncount="10" PagerStyle-Mode="NumericPages"  
  1195.                                 AllowCustomPaging="False" AllowPaging="True" PagerStyle-Wrap="False" PageSize="100">
  1196.                                 <HeaderStyle Font-Bold="True" ForeColor="White" BackColor="SteelBlue"></HeaderStyle>
  1197.                                 <ItemStyle CssClass="tabledata"> </ItemStyle>
  1198.                                 <Columns>
  1199.                                     <asp:BoundColumn DataField="deptHeader" HeaderText="Dept Header" >
  1200.                                         <HeaderStyle VerticalAlign="Bottom"></HeaderStyle>
  1201.                                         <ItemStyle Width="2%" VerticalAlign="Bottom" Wrap="False"></ItemStyle>
  1202.                                     </asp:BoundColumn>
  1203.                                     <asp:BoundColumn DataField="divHeader" HeaderText="Div Header">
  1204.                                         <HeaderStyle VerticalAlign="Bottom"></HeaderStyle>
  1205.                                         <ItemStyle Width="2%" VerticalAlign="Bottom" Wrap="False"></ItemStyle>
  1206.                                     </asp:BoundColumn>
  1207.                                     <asp:BoundColumn DataField="bsc" HeaderText="BSC">
  1208.                                         <HeaderStyle VerticalAlign="Bottom"></HeaderStyle>
  1209.                                         <ItemStyle Width="2%" VerticalAlign="Bottom" Wrap="False"></ItemStyle>
  1210.                                     </asp:BoundColumn>
  1211.                                     <asp:BoundColumn DataField="billetTitle" HeaderText="Billet Title">
  1212.                                         <HeaderStyle VerticalAlign="Bottom"></HeaderStyle>
  1213.                                         <ItemStyle Width="14%" VerticalAlign="Bottom" Wrap="False"></ItemStyle>
  1214.                                     </asp:BoundColumn>
  1215.                                     <asp:BoundColumn DataField="oeCd" HeaderText="O/E">
  1216.                                         <HeaderStyle HorizontalAlign="Center" VerticalAlign="Bottom"></HeaderStyle>
  1217.                                         <ItemStyle HorizontalAlign="Center" Width="2%" VerticalAlign="Bottom" Wrap="False"></ItemStyle>
  1218.                                     </asp:BoundColumn>
  1219.                                     <asp:BoundColumn DataField="dgr" HeaderText="Desig&lt;br&gt;Grade&lt;br&gt;Rate">
  1220.                                         <HeaderStyle HorizontalAlign="Center" VerticalAlign="Bottom"></HeaderStyle>
  1221.                                         <ItemStyle HorizontalAlign="Center" Width="2%" VerticalAlign="Bottom" Wrap="False"></ItemStyle>
  1222.                                     </asp:BoundColumn>
  1223.                                     <asp:BoundColumn DataField="pNobc" HeaderText="PNEC/<br>PNOBC">
  1224.                                         <HeaderStyle HorizontalAlign="Center" VerticalAlign="Bottom"></HeaderStyle>
  1225.                                         <ItemStyle HorizontalAlign="Center" Width="3%" VerticalAlign="Bottom" Wrap="False"></ItemStyle>
  1226.                                     </asp:BoundColumn>
  1227.                                     <asp:BoundColumn DataField="sNobc" HeaderText="SNEC/<br>SNOBC">
  1228.                                         <HeaderStyle HorizontalAlign="Center" VerticalAlign="Bottom"></HeaderStyle>
  1229.                                         <ItemStyle HorizontalAlign="Center" Width="3%" VerticalAlign="Bottom" Wrap="False"></ItemStyle>
  1230.                                     </asp:BoundColumn>
  1231.                                     <asp:BoundColumn DataField="ibftJobDescr" HeaderText="Position Description">
  1232.                                         <HeaderStyle VerticalAlign="Bottom"></HeaderStyle>
  1233.                                         <ItemStyle VerticalAlign="Bottom" Wrap="False"></ItemStyle>
  1234.                                     </asp:BoundColumn>                                                                
  1235.                                     <asp:BoundColumn DataField="cin1" HeaderText="CIN 01" HeaderStyle-VerticalAlign="Bottom" 
  1236.                                         HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" ItemStyle-Width="8%" 
  1237.                                         ItemStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False"></asp:BoundColumn>
  1238.                                     <asp:BoundColumn DataField="cin2" HeaderText="CIN 02" HeaderStyle-VerticalAlign="Bottom" 
  1239.                                         HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" ItemStyle-Width="8%" 
  1240.                                         ItemStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False"></asp:BoundColumn>
  1241.                                     <asp:BoundColumn DataField="cin3" HeaderText="CIN 03" HeaderStyle-VerticalAlign="Bottom" 
  1242.                                         HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" ItemStyle-Width="8%" 
  1243.                                         ItemStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False"></asp:BoundColumn>
  1244.                                     <asp:BoundColumn DataField="cin4" HeaderText="CIN 04" HeaderStyle-VerticalAlign="Bottom" 
  1245.                                         HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" ItemStyle-Width="8%" 
  1246.                                         ItemStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False"></asp:BoundColumn>
  1247.                                     <asp:BoundColumn DataField="cin5" HeaderText="CIN 05" HeaderStyle-VerticalAlign="Bottom" 
  1248.                                         HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" ItemStyle-Width="8%" 
  1249.                                         ItemStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False"></asp:BoundColumn>
  1250.                                     <asp:BoundColumn DataField="cin6" HeaderText="CIN 06" HeaderStyle-VerticalAlign="Bottom"
  1251.                                         HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" ItemStyle-Width="8%" 
  1252.                                         ItemStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False"></asp:BoundColumn>
  1253.                                     <asp:BoundColumn DataField="cin7" HeaderText="CIN 07" HeaderStyle-VerticalAlign="Bottom" 
  1254.                                         HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" ItemStyle-Width="8%" 
  1255.                                         ItemStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False"></asp:BoundColumn>
  1256.                                     <asp:BoundColumn DataField="cin8" HeaderText="CIN 08" HeaderStyle-VerticalAlign="Bottom" 
  1257.                                         HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" ItemStyle-Width="8%" 
  1258.                                         ItemStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False"></asp:BoundColumn>
  1259.                                 </Columns>
  1260.                             </asp:datagrid>
  1261.                         </td>
  1262.                     </tr>
  1263.                     <tr><td>&nbsp;</td></tr>
  1264.                     <tr><td><asp:hyperlink id="hlExcel" Runat="server" Target="_blank"></asp:hyperlink></td></tr>                    
  1265.                 </table>
  1266.                 <asp:Label ID="hdnUIC" Runat="server" Visible="False"></asp:Label>
  1267.                 <asp:Label ID="hdnUICTitle" Runat="server" Visible="False"></asp:Label>
  1268.                 <asp:Label ID="hdnCmtyCd" Runat="server" Visible="False"></asp:Label>
  1269.                 <asp:label id="hdnRecRngCnt" runat="server" visible="False"></asp:label>
  1270.     <asp:Literal ID="litAlert" runat="Server"></asp:Literal>
  1271.         </form>
  1272.     </body>
  1273. </html>
  1274.  
  1275. Imports Oracle.DataAccess.Client
  1276. Imports Fleet.ConstClass
  1277. Imports System.Text
  1278. Imports System.Configuration.ConfigurationManager
  1279.  
  1280. Public Class RqmtsAviationTrngRqmtManBillets
  1281.     Inherits System.Web.UI.Page
  1282.     Dim myCommand As OracleDataAdapter
  1283.     Protected WithEvents hlExcel As HyperLink
  1284.     Protected WithEvents dgManBsc As DataGrid
  1285.     Protected WithEvents hlAbvCin9 As HyperLink
  1286.     Protected WithEvents hlInvBsc As HyperLink
  1287.     Protected WithEvents RqmtAviationTrngRqmtManBillets As HtmlForm
  1288.     Protected WithEvents lblInvBSC As Label
  1289.     Protected WithEvents lblAbvCin9 As Label
  1290.     Protected WithEvents hdnUICTitle As Label
  1291.     Protected WithEvents hdnUIC As Label
  1292.     Protected WithEvents cntrlUicList As cntrlUserUicList
  1293.     Protected WithEvents FleetHeader As cntrlFleetHeader
  1294.     Protected WithEvents hdnCmtyCd As Label
  1295.     Protected WithEvents lblSelDispNum As Label
  1296.     Protected WithEvents ddlPageSize As DropDownList
  1297.     Protected WithEvents hdnRecRngCnt As Label
  1298.     Dim RecCnt As Integer
  1299.     Dim totRecCnt As String
  1300.  
  1301. #Region " Web Form Designer Generated Code "
  1302.  
  1303.     'This call is required by the Web Form Designer.
  1304.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  1305.  
  1306.     End Sub
  1307.  
  1308.     'NOTE: The following placeholder declaration is required by the Web Form Designer.
  1309.     'Do not delete or move it.
  1310.     Private designerPlaceholderDeclaration As System.Object
  1311.  
  1312.     Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
  1313.         'CODEGEN: This method call is required by the Web Form Designer
  1314.         'Do not modify it using the code editor.
  1315.         InitializeComponent()
  1316.     End Sub
  1317.  
  1318. #End Region
  1319.  
  1320.     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  1321.         Try
  1322.             CheckSession()
  1323.             If Not Page.IsPostBack Then
  1324.                 WebTracking(RqmtAviationTrngRqmtManBillets, 1009, Now, Now, 1, 1, "LOAD")
  1325.                 Session("PgNum") = 0
  1326.                 Session("PgSize") = 100
  1327.                 hdnUIC.Text = Request.QueryString("UIC")
  1328.                 hdnUICTitle.Text = Request.QueryString("UICTITLE")
  1329.                 CreateHeader()
  1330.                 getRpt()
  1331.  
  1332.             End If
  1333.         Catch ex As Exception
  1334.             ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
  1335.         End Try
  1336.     End Sub
  1337.  
  1338.  
  1339.     Private Sub CreateHeader()
  1340.         Try
  1341.             CheckSession()
  1342.             If hdnUIC.Text = "000000" Then
  1343.                 cntrlUicList.ActiveReserve = "A"
  1344.                 cntrlUicList.Visible = True
  1345.                 cntrlUicList.GetList()
  1346.                 hdnUIC.Text = cntrlUicList.SelectedUic
  1347.                 hdnUICTitle.Text = cntrlUicList.SelectedUicTitle
  1348.             Else
  1349.                 FleetHeader.AddSelection("UIC: ", hdnUIC.Text & " " & hdnUICTitle.Text)
  1350.             End If
  1351.             FleetHeader.Header2 = "Training Requirements by Authorized Manning Document Billets"
  1352.         Catch ex As Exception
  1353.             ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
  1354.         End Try
  1355.     End Sub
  1356.  
  1357.  
  1358.     Sub getRpt()
  1359.         Try
  1360.             CheckSession()
  1361.             GetUicData()
  1362.             hlAbvCin9.NavigateUrl = "RqmtsAviationTrngRqmtManBilletsAbv08.aspx?Uic=" & hdnUIC.Text & "&UicTitle=" & hdnUICTitle.Text
  1363.             hlInvBsc.NavigateUrl = "RqmtsAviationTrngRqmtManBilletsInvBsc.aspx?Uic=" & hdnUIC.Text & "&UicTitle=" & hdnUICTitle.Text
  1364.             hlExcel.NavigateUrl = "RqmtsAviationTrngRqmtManBilletsExcel.aspx?Uic=" & hdnUIC.Text & "&UicTitle=" & hdnUICTitle.Text & "&xlsRecRange=" & hdnRecRngCnt.Text & "&recCnt=" & totRecCnt
  1365.             hlExcel.ImageUrl = "/Fleet/images/excelicon.gif"
  1366.             hlExcel.ToolTip = "Click to View in Excel"
  1367.             hlExcel.Height = Unit.Pixel(30)
  1368.             hlExcel.Width = Unit.Pixel(30)
  1369.         Catch ex As Exception
  1370.             ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
  1371.         End Try
  1372.     End Sub
  1373.  
  1374.     Sub GetUicData()
  1375.         Try
  1376.             CheckSession()
  1377.             hlInvBsc.Visible = False
  1378.             hlAbvCin9.Visible = False
  1379.             Dim ds As DataSet
  1380.             Dim strByUic As New StringBuilder
  1381.             strByUic.Append(" select decode(deptNm40,null,cd_w_invalid,deptNm40) deptHeader,DivNm40 divHeader, ")
  1382.             strByUic.Append(" bsc,billetTitle,oeCd,dgr,pNobc,sNobc,nvl(ibftJobDescr,billetTitle) ibftJobDescr, ")
  1383.             strByUic.Append(" cin1,cin2,cin3,cin4,cin5,cin6,cin7,cin8, ")
  1384.             strByUic.Append(" decode(DivNm5,null,'00000',DivNm5) divSort, ")
  1385.             strByUic.Append(" decode(deptNm5,null,(decode(deptNm40,null,cd_w_invalid,deptNm5)),deptNm5) deptSort ,cin9 ")
  1386.             strByUic.Append(" from (select T1.BSC bsc,T1.BILLET_TITLE billetTitle,T1.OE_CD oeCd,T1.DESIG_GRADE_RATE dgr, ")
  1387.             strByUic.Append(" T1.PNEC_NOBC pNobc,T1.SNEC_NOBC sNobc,T1.IBFT_JOB_DESCR ibftJobDescr,T1.CIN01 cin1,T1.CIN02 cin2, ")
  1388.             strByUic.Append(" T1.CIN03 cin3,T1.CIN04 cin4,T1.CIN05 cin5,T1.CIN06 cin6,T1.CIN07 cin7,T1.CIN08 cin8, ")
  1389.             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', ")
  1390.             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, ")
  1391.             strByUic.Append(" SUBSTR(T1.DIV_NM,7 ,40) DivNm40,SUBSTR(T1.DIV_NM,1 ,5) DivNm5,SUBSTR(T1.DEPT_NM,7 ,40) deptNm40, ")
  1392.             strByUic.Append(" SUBSTR(T1.DEPT_NM,1 ,5) deptNm5, T1.CIN09 cin9 ")
  1393.             strByUic.Append(" from VW_BSC_TRNG_RQMT_HORIZ T1, UIC T2 where T1.UIC=:strUIC and T1.UIC=T2.UIC) ")
  1394.             strByUic.Append(" order by deptSort,deptHeader,divSort,divHeader,bsc ")
  1395.             CheckSession()
  1396.             Dim objConn As New OracleConnection(Session("svOraProviderString"))
  1397.             myCommand = New OracleDataAdapter(strByUic.ToString, objConn)
  1398.             myCommand.SelectCommand.Parameters.Add("strUIC", OracleDbType.Varchar2, 6).Value = hdnUIC.Text
  1399.             ds = New DataSet
  1400.             Try
  1401.                 Dim dtBegDt As Date = Now
  1402.                 myCommand.Fill(ds, "BILLET_MATRIX")
  1403.                 If AppSettings("asWebTracking") = "TRUE" Then
  1404.                     WebTracking(RqmtAviationTrngRqmtManBillets, 1009, dtBegDt, Now, ds.Tables(0).Rows.Count, ds.Tables(0).Rows.Count, hdnUIC.Text)
  1405.                 End If
  1406.             Catch ex As Exception
  1407.                 ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
  1408.             Finally
  1409.                 objConn.Close()
  1410.                 objConn.Dispose()
  1411.             End Try
  1412.             Dim i As Integer = 0
  1413.             Dim prevDept, curDept, curDiv, prevDiv, cin09 As String
  1414.             curDept = ""
  1415.             prevDept = ""
  1416.             curDiv = ""
  1417.             prevDiv = ""
  1418.             cin09 = ""
  1419.             Dim shRow As DataRow
  1420.             If ds.Tables(0).Rows.Count > 0 Then
  1421.                 dgManBsc.Visible = True
  1422.                 Session("PgSize") = ddlPageSize.SelectedItem.Value
  1423.                 Session("PgNum") = dgManBsc.CurrentPageIndex
  1424.                 FleetHeader.Warning = False
  1425.                 If ds.Tables(0).Rows.Count > 100 Then
  1426.                     lblSelDispNum.Visible = True
  1427.                     ddlPageSize.Visible = True
  1428.                     dgManBsc.PagerStyle.Visible = True
  1429.                 Else
  1430.                     lblSelDispNum.Visible = False
  1431.                     ddlPageSize.Visible = False
  1432.                     dgManBsc.PagerStyle.Visible = False
  1433.                 End If
  1434.                 Do While (i <= ds.Tables(0).Rows.Count - 1)
  1435.                     If Not IsDBNull(ds.Tables(0).Rows(i)("deptHeader")) Then
  1436.                         If Not IsDBNull(ds.Tables(0).Rows(i)("cin9")) Then
  1437.                             hlAbvCin9.Visible = True
  1438.                             lblAbvCin9.Visible = True
  1439.                         End If
  1440.                         If IsDBNull(ds.Tables(0).Rows(i)("billetTitle")) Then
  1441.                             hlInvBsc.Visible = True
  1442.                             lblInvBSC.Visible = True
  1443.                         End If
  1444.                         If ds.Tables(0).Rows(i)("deptHeader") <> "00000" Then
  1445.                             curDept = ds.Tables(0).Rows(i).Item(0)
  1446.                             If (curDept <> prevDept) Then
  1447.                                 prevDept = curDept
  1448.                                 shRow = ds.Tables(0).NewRow
  1449.                                 shRow("deptHeader") = ds.Tables(0).Rows(i)("deptHeader")
  1450.                                 shRow("divHeader") = "Dept"
  1451.                                 ds.Tables(0).Rows.InsertAt(shRow, i)
  1452.                                 i = i + 1
  1453.                             End If
  1454.                         End If
  1455.                         If Not IsDBNull(ds.Tables(0).Rows(i)("divHeader")) Then
  1456.                             curDiv = ds.Tables(0).Rows(i)("divHeader")
  1457.                             If (curDiv <> prevDiv) Then
  1458.                                 prevDiv = curDiv
  1459.                                 shRow = ds.Tables(0).NewRow
  1460.                                 shRow("deptHeader") = "Div"
  1461.                                 shRow("divHeader") = ds.Tables(0).Rows(i)("divHeader")
  1462.                                 ds.Tables(0).Rows.InsertAt(shRow, i)
  1463.                                 i = i + 1
  1464.                             End If
  1465.                         End If
  1466.                     End If
  1467.                     i = i + 1
  1468.                 Loop
  1469.                 Dim dv As DataView
  1470.                 dv = ds.Tables(0).DefaultView
  1471.                 dgManBsc.DataSource = dv
  1472.                 dgManBsc.DataBind()
  1473.                 recRangeHead()
  1474.             Else
  1475.                 dgManBsc.Visible = False
  1476.                 FleetHeader.Warning = True
  1477.                 hlExcel.Visible = False
  1478.                 hlAbvCin9.Visible = False
  1479.                 hlInvBsc.Visible = False
  1480.                 lblInvBSC.Visible = False
  1481.                 lblAbvCin9.Visible = False
  1482.                 lblSelDispNum.Visible = False
  1483.                 ddlPageSize.Visible = False
  1484.                 dgManBsc.PagerStyle.Visible = False
  1485.             End If
  1486.         Catch ex As Exception
  1487.             ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
  1488.         End Try
  1489.     End Sub
  1490.  
  1491.     Private Sub dgManBsc_ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) Handles dgManBsc.ItemDataBound
  1492.         Try
  1493.             CheckSession()
  1494.             If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.Item Then
  1495.                 RecCnt += 1
  1496.             End If
  1497.             Dim cellDeptHeader As String = e.Item.Cells(0).Text
  1498.             Dim cellDivHeader As String = e.Item.Cells(1).Text
  1499.             Dim cellCIN1 As String
  1500.             Dim cellCIN2 As String
  1501.             Dim cellCIN3 As String
  1502.             Dim cellCIN4 As String
  1503.             Dim cellCIN5 As String
  1504.             Dim cellCIN6 As String
  1505.             Dim cellCIN7 As String
  1506.             Dim cellCIN8 As String
  1507.             cellCIN1 = e.Item.Cells(9).Text
  1508.             cellCIN2 = e.Item.Cells(10).Text
  1509.             cellCIN3 = e.Item.Cells(11).Text
  1510.             cellCIN4 = e.Item.Cells(12).Text
  1511.             cellCIN5 = e.Item.Cells(13).Text
  1512.             cellCIN6 = e.Item.Cells(14).Text
  1513.             cellCIN7 = e.Item.Cells(15).Text
  1514.             cellCIN8 = e.Item.Cells(16).Text
  1515.             If cellDivHeader = "Dept" Then
  1516.                 If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
  1517.                     e.Item.Cells(0).Attributes.Add("align", "Center")
  1518.                     e.Item.Cells(0).Font.Bold = True
  1519.                     e.Item.Cells(0).BackColor = Color.LemonChiffon
  1520.                     e.Item.Cells(0).ColumnSpan = e.Item.Cells.Count
  1521.                     Dim x As Int16 = 0
  1522.                     For x = 1 To e.Item.Cells.Count - 1
  1523.                         e.Item.Cells(x).Visible = False
  1524.                     Next
  1525.                 End If
  1526.             ElseIf cellDivHeader = "NoData" Then
  1527.                 If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
  1528.                     e.Item.Cells(0).Attributes.Add("align", "left")
  1529.                     e.Item.Cells(0).Font.Bold = True
  1530.                     e.Item.Cells(0).BackColor = Color.LemonChiffon
  1531.                     e.Item.Cells(0).ForeColor = Color.Crimson
  1532.                     e.Item.Cells(0).ColumnSpan = e.Item.Cells.Count
  1533.                     Dim x As Int16 = 0
  1534.                     For x = 1 To e.Item.Cells.Count - 1
  1535.                         e.Item.Cells(x).Visible = False
  1536.                     Next
  1537.                 End If
  1538.             ElseIf cellDeptHeader = "Div" Then
  1539.                 e.Item.Cells(0).Visible = False
  1540.                 If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
  1541.                     e.Item.Cells(1).Attributes.Add("align", "left")
  1542.                     e.Item.Cells(1).Font.Bold = True
  1543.                     e.Item.Cells(1).ColumnSpan = e.Item.Cells.Count
  1544.                     Dim x As Int16 = 0
  1545.                     For x = 2 To e.Item.Cells.Count - 1
  1546.                         e.Item.Cells(x).Visible = False
  1547.                     Next
  1548.                 End If
  1549.             Else
  1550.                 e.Item.Cells(0).Visible = False
  1551.                 e.Item.Cells(1).Visible = False
  1552.                 If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
  1553.                     If e.Item.ItemType = ListItemType.AlternatingItem Then
  1554.                         e.Item.Cells(2).BackColor = Color.WhiteSmoke
  1555.                         e.Item.Cells(3).BackColor = Color.WhiteSmoke
  1556.                         e.Item.Cells(4).BackColor = Color.WhiteSmoke
  1557.                         e.Item.Cells(5).BackColor = Color.WhiteSmoke
  1558.                         e.Item.Cells(6).BackColor = Color.WhiteSmoke
  1559.                         e.Item.Cells(7).BackColor = Color.WhiteSmoke
  1560.                         e.Item.Cells(8).BackColor = Color.WhiteSmoke
  1561.                     End If
  1562.                     If cellCIN1.StartsWith("(DEACT)") Then
  1563.                         e.Item.Cells(9).BackColor = Color.LightSteelBlue
  1564.                     ElseIf e.Item.Cells(9).Text.StartsWith("(") Then
  1565.                         e.Item.Cells(9).BackColor = Color.LightCoral
  1566.                     Else
  1567.                         If e.Item.ItemType = ListItemType.AlternatingItem Then
  1568.                             e.Item.Cells(9).BackColor = Color.WhiteSmoke
  1569.                         End If
  1570.                     End If
  1571.                     If cellCIN2.StartsWith("(DEACT)") Then
  1572.                         e.Item.Cells(10).BackColor = Color.LightSteelBlue
  1573.                     ElseIf e.Item.Cells(10).Text.StartsWith("(") Then
  1574.                         e.Item.Cells(10).BackColor = Color.LightCoral
  1575.                     Else
  1576.                         If e.Item.ItemType = ListItemType.AlternatingItem Then
  1577.                             e.Item.Cells(10).BackColor = Color.WhiteSmoke
  1578.                         End If
  1579.                     End If
  1580.                     If cellCIN3.StartsWith("(DEACT)") Then
  1581.                         e.Item.Cells(11).BackColor = Color.LightSteelBlue
  1582.                     ElseIf e.Item.Cells(11).Text.StartsWith("(") Then
  1583.                         e.Item.Cells(11).BackColor = Color.LightCoral
  1584.                     Else
  1585.                         If e.Item.ItemType = ListItemType.AlternatingItem Then
  1586.                             e.Item.Cells(11).BackColor = Color.WhiteSmoke
  1587.                         End If
  1588.                     End If
  1589.                     If cellCIN4.StartsWith("(DEACT)") Then
  1590.                         e.Item.Cells(12).BackColor = Color.LightSteelBlue
  1591.                     ElseIf e.Item.Cells(12).Text.StartsWith("(") Then
  1592.                         e.Item.Cells(12).BackColor = Color.LightCoral
  1593.                     Else
  1594.                         If e.Item.ItemType = ListItemType.AlternatingItem Then
  1595.                             e.Item.Cells(12).BackColor = Color.WhiteSmoke
  1596.                         End If
  1597.                     End If
  1598.                     If cellCIN5.StartsWith("(DEACT)") Then
  1599.                         e.Item.Cells(13).BackColor = Color.LightSteelBlue
  1600.                     ElseIf e.Item.Cells(13).Text.StartsWith("(") Then
  1601.                         e.Item.Cells(13).BackColor = Color.LightCoral
  1602.                     Else
  1603.                         If e.Item.ItemType = ListItemType.AlternatingItem Then
  1604.                             e.Item.Cells(13).BackColor = Color.WhiteSmoke
  1605.                         End If
  1606.                     End If
  1607.                     If cellCIN6.StartsWith("(DEACT)") Then
  1608.                         e.Item.Cells(14).BackColor = Color.LightSteelBlue
  1609.                     ElseIf e.Item.Cells(14).Text.StartsWith("(") Then
  1610.                         e.Item.Cells(14).BackColor = Color.LightCoral
  1611.                     Else
  1612.                         If e.Item.ItemType = ListItemType.AlternatingItem Then
  1613.                             e.Item.Cells(14).BackColor = Color.WhiteSmoke
  1614.                         End If
  1615.                     End If
  1616.                     If cellCIN7.StartsWith("(DEACT)") Then
  1617.                         e.Item.Cells(15).BackColor = Color.LightSteelBlue
  1618.                     ElseIf e.Item.Cells(15).Text.StartsWith("(") Then
  1619.                         e.Item.Cells(15).BackColor = Color.LightCoral
  1620.                     Else
  1621.                         If e.Item.ItemType = ListItemType.AlternatingItem Then
  1622.                             e.Item.Cells(15).BackColor = Color.WhiteSmoke
  1623.                         End If
  1624.                     End If
  1625.                     If cellCIN8.StartsWith("(DEACT)") Then
  1626.                         e.Item.Cells(16).BackColor = Color.LightSteelBlue
  1627.                     ElseIf e.Item.Cells(16).Text.StartsWith("(") Then
  1628.                         e.Item.Cells(16).BackColor = Color.LightCoral
  1629.                     Else
  1630.                         If e.Item.ItemType = ListItemType.AlternatingItem Then
  1631.                             e.Item.Cells(16).BackColor = Color.WhiteSmoke
  1632.                         End If
  1633.                     End If
  1634.                 End If       ' Item Type
  1635.             End If    ' Group Headers
  1636.         Catch ex As Exception
  1637.             ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
  1638.         End Try
  1639.     End Sub
  1640.  
  1641.     Private Sub UicList_selectedIndexChange(ByVal sender As Object, ByVal e As System.EventArgs) Handles cntrlUicList.cntrlSelectedEventRaised
  1642.         Try
  1643.             CheckSession()
  1644.             hdnUIC.Text = cntrlUicList.SelectedUic
  1645.             hdnUICTitle.Text = cntrlUicList.SelectedUicTitle
  1646.             Session("svSelActivity") = hdnUIC.Text
  1647.             Session("svSelUnit") = hdnUICTitle.Text
  1648.             dgManBsc.PageSize = 100
  1649.             dgManBsc.CurrentPageIndex = 0
  1650.             Session("PgNum") = 0
  1651.             Session("PgSize") = 100
  1652.             ddlPageSize.SelectedItem.Value = 100
  1653.             ddlPageSize.SelectedIndex = 0
  1654.             lblInvBSC.Visible = True
  1655.             lblAbvCin9.Visible = True
  1656.             getRpt()
  1657.         Catch ex As Exception
  1658.             ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
  1659.         End Try
  1660.     End Sub
  1661.  
  1662.     Public Sub recRangeHead()
  1663.         Try
  1664.             CheckSession()
  1665.             Dim min, max As String
  1666.             If (dgManBsc.CurrentPageIndex + 1) = 1 And (dgManBsc.CurrentPageIndex + 1) = dgManBsc.PageCount Then
  1667.                 '----when only one page index
  1668.                 min = 1
  1669.                 max = ((dgManBsc.CurrentPageIndex) * Session("PgSize")) + RecCnt
  1670.                 hdnRecRngCnt.Text = "Rows: " & min & "-" & max
  1671.             Else
  1672.                 Select Case True
  1673.                     Case (dgManBsc.CurrentPageIndex + 1) = 1
  1674.                         min = 1
  1675.                         max = ((dgManBsc.CurrentPageIndex + 1) * Session("PgSize"))
  1676.                         hdnRecRngCnt.Text = "Rows: " & min & "-" & max
  1677.                     Case (dgManBsc.CurrentPageIndex + 1) = dgManBsc.PageCount '----when last index
  1678.                         min = ((dgManBsc.CurrentPageIndex) * Session("PgSize")) + 1
  1679.                         max = ((dgManBsc.CurrentPageIndex) * Session("PgSize") + RecCnt)
  1680.                         hdnRecRngCnt.Text = "Rows: " & min & "-" & max
  1681.                     Case (dgManBsc.CurrentPageIndex + 1) > 1 '----for indexes in between
  1682.                         min = ((dgManBsc.CurrentPageIndex) * Session("PgSize")) + 1
  1683.                         max = ((dgManBsc.CurrentPageIndex + 1) * Session("PgSize"))
  1684.                         hdnRecRngCnt.Text = "Rows: " & min & "-" & max
  1685.                 End Select
  1686.             End If
  1687.         Catch ex As Exception
  1688.             ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
  1689.         End Try
  1690.     End Sub
  1691.  
  1692.     Private Sub ddlPageSize_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlPageSize.SelectedIndexChanged
  1693.         Try
  1694.             CheckSession()
  1695.             dgManBsc.PageSize = ddlPageSize.SelectedItem.Value
  1696.             dgManBsc.CurrentPageIndex = 0
  1697.             getRpt()
  1698.         Catch ex As Exception
  1699.             ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
  1700.         End Try
  1701.     End Sub
  1702.  
  1703.     Private Sub dgManBsc_PageIndexChanged(ByVal source As Object, ByVal e As DataGridPageChangedEventArgs) Handles dgManBsc.PageIndexChanged
  1704.         Try
  1705.             CheckSession()
  1706.             dgManBsc.CurrentPageIndex = e.NewPageIndex
  1707.             Session("PgNum") = e.NewPageIndex
  1708.             getRpt()
  1709.         Catch ex As Exception
  1710.             ErrorCapture(RqmtAviationTrngRqmtManBillets, ex)
  1711.         End Try
  1712.     End Sub
  1713. End Class
  1714.  
[/HTML]
Jan 30 '08 #6

Plater
Expert 5K+
P: 7,872
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?
Jan 30 '08 #7

P: 7
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
File Type: zip sobtcseaddcompletions.zip (11.0 KB, 110 views)
File Type: zip rqmtaviationtrngrqmtmanbillets.zip (5.3 KB, 96 views)
Jan 31 '08 #8

P: 7
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.
Feb 1 '08 #9

P: 7
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
Feb 1 '08 #10

Frinavale
Expert Mod 5K+
P: 9,731
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
Feb 1 '08 #11

Post your reply

Sign in to post your reply or Sign up for a free account.