initial commit
This commit is contained in:
commit
252dac3143
1516 changed files with 694271 additions and 0 deletions
104
Shared/ConfigureAddRecord.aspx
Normal file
104
Shared/ConfigureAddRecord.aspx
Normal file
|
@ -0,0 +1,104 @@
|
|||
<%@ Page Language="vb" AutoEventWireup="false" Inherits="Persons.UI.BaseApplicationPage" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<specificcontent requirement="WS/WAP">
|
||||
<script runat="server" language="VB">
|
||||
Public Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
|
||||
Dim selectedTheme As String = Me.GetSelectedTheme()
|
||||
If Not String.IsNullOrEmpty(selectedTheme) Then Me.Page.Theme = selectedTheme
|
||||
End Sub
|
||||
</script>
|
||||
</specificcontent>
|
||||
<title>Configure Add Record Page</title>
|
||||
</head>
|
||||
<body class="pBack">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pWrapper">
|
||||
<tr>
|
||||
<td class="panelTL">
|
||||
<img src="../Images/space.gif" class="panelTLSpace" alt="" /></td>
|
||||
<td class="panelT">
|
||||
<img src="../Images/space.gif" class="panelTSpace" alt="" /></td>
|
||||
<td class="panelTR">
|
||||
<img src="../Images/space.gif" class="panelTRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelL">
|
||||
<img src="../Images/space.gif" class="panelLSpace" alt="" /></td>
|
||||
<td class="panelC">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pContent">
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"
|
||||
width="100%" id="AutoNumber1">
|
||||
<tr>
|
||||
<td class="dialog_header" colspan="3">
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="dialogHeaderEdgeL">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
<td class="dhb">
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td class="dialog_header_text">
|
||||
Configuring an Add Record Page</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="dialogHeaderEdgeR">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
<td class="configureErrorPagesText">
|
||||
<br />
|
||||
The New button or icon you clicked on is not yet bound to an Add Record page.<br />
|
||||
<br />
|
||||
To bind the New button or icon to an Add Record page:<br />
|
||||
<br />
|
||||
<ol>
|
||||
<li>If you have not yet created an Add Record page, use the Application Wizard to create
|
||||
one.<br />
|
||||
<br />
|
||||
</li>
|
||||
<li>Go to the Application Explorer tab, navigate in the tree to the page that contains
|
||||
the New button or icon, then click the Properties button on the tool bar.<br />
|
||||
<br />
|
||||
<ul style="list-style-type: disc">
|
||||
<li>Select the name of the New button or icon in the tree.</li>
|
||||
<li>On the Bindings tab, modify the Redirect URL to point to your Add Record page.<br />
|
||||
Example: ../MyPages/MyAddRecordPage.aspx<br />
|
||||
<br />
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Save changes and rebuild the application.</li>
|
||||
</ol>
|
||||
</td>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="panelR">
|
||||
<img src="../Images/space.gif" class="panelRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelBL">
|
||||
<img src="../Images/space.gif" class="panelBLSpace" alt="" /></td>
|
||||
<td class="panelB">
|
||||
<img src="../Images/space.gif" class="panelBSpace" alt="" /></td>
|
||||
<td class="panelBR">
|
||||
<img src="../Images/space.gif" class="panelBRSpace" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
103
Shared/ConfigureCollapseExpandRowBtn.aspx
Normal file
103
Shared/ConfigureCollapseExpandRowBtn.aspx
Normal file
|
@ -0,0 +1,103 @@
|
|||
<%@ Page Language="vb" AutoEventWireup="false" Inherits="Persons.UI.BaseApplicationPage" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<specificcontent requirement="WS/WAP">
|
||||
<script runat="server" language="VB">
|
||||
Public Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
|
||||
Dim selectedTheme As String = Me.GetSelectedTheme()
|
||||
If Not String.IsNullOrEmpty(selectedTheme) Then Me.Page.Theme = selectedTheme
|
||||
End Sub
|
||||
</script>
|
||||
</specificcontent>
|
||||
<title>Configuring an Expand / Collapse Row Button</title>
|
||||
</head>
|
||||
<body class="pBack">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pWrapper">
|
||||
<tr>
|
||||
<td class="panelTL">
|
||||
<img src="../Images/space.gif" class="panelTLSpace" alt="" /></td>
|
||||
<td class="panelT">
|
||||
<img src="../Images/space.gif" class="panelTSpace" alt="" /></td>
|
||||
<td class="panelTR">
|
||||
<img src="../Images/space.gif" class="panelTRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelL">
|
||||
<img src="../Images/space.gif" class="panelLSpace" alt="" /></td>
|
||||
<td class="panelC">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pContent">
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"
|
||||
width="100%" id="AutoNumber1">
|
||||
<tr>
|
||||
<td class="dialog_header" colspan="3">
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="dialogHeaderEdgeL">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
<td class="dhb">
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td class="dialog_header_text">
|
||||
Configuring an Expand / Collapse Row Button</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="dialogHeaderEdgeR">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
<td class="configureErrorPagesText">
|
||||
<br />
|
||||
The Expand / Collapse Row button you clicked on is not yet configured.<br />
|
||||
<br />
|
||||
To configure the Expand / Collapse button:<br />
|
||||
<br />
|
||||
<ol>
|
||||
<li>In the Quick Layout editor, select the second row you wish to expand and collapse
|
||||
when the button is clicked.<br />
|
||||
<br />
|
||||
</li>
|
||||
<li>Open the Row Attributes… dialog by (Right-click on the row you want to collapse
|
||||
or expand, Styles -> Row ...) and set these attributes:<br />
|
||||
<br />
|
||||
<ul style="list-style-type: disc">
|
||||
<li>Id=<Table Control Name>AltRow</li>
|
||||
<li>runat=server<br />
|
||||
<br />
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Save changes and rebuild the application.</li>
|
||||
</ol>
|
||||
</td>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="panelR">
|
||||
<img src="../Images/space.gif" class="panelRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelBL">
|
||||
<img src="../Images/space.gif" class="panelBLSpace" alt="" /></td>
|
||||
<td class="panelB">
|
||||
<img src="../Images/space.gif" class="panelBSpace" alt="" /></td>
|
||||
<td class="panelBR">
|
||||
<img src="../Images/space.gif" class="panelBRSpace" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
105
Shared/ConfigureEditRecord.aspx
Normal file
105
Shared/ConfigureEditRecord.aspx
Normal file
|
@ -0,0 +1,105 @@
|
|||
<%@ Page Language="vb" AutoEventWireup="false" Inherits="Persons.UI.BaseApplicationPage" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<specificcontent requirement="WS/WAP">
|
||||
<script runat="server" language="VB">
|
||||
Public Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
|
||||
Dim selectedTheme As String = Me.GetSelectedTheme()
|
||||
If Not String.IsNullOrEmpty(selectedTheme) Then Me.Page.Theme = selectedTheme
|
||||
End Sub
|
||||
</script>
|
||||
</specificcontent>
|
||||
<title>Configure Edit Record Page</title>
|
||||
</head>
|
||||
<body class="pBack">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pWrapper">
|
||||
<tr>
|
||||
<td class="panelTL">
|
||||
<img src="../Images/space.gif" class="panelTLSpace" alt="" /></td>
|
||||
<td class="panelT">
|
||||
<img src="../Images/space.gif" class="panelTSpace" alt="" /></td>
|
||||
<td class="panelTR">
|
||||
<img src="../Images/space.gif" class="panelTRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelL">
|
||||
<img src="../Images/space.gif" class="panelLSpace" alt="" /></td>
|
||||
<td class="panelC">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pContent">
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"
|
||||
width="100%" id="AutoNumber1">
|
||||
<tr>
|
||||
<td class="dialog_header" colspan="3">
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="dialogHeaderEdgeL">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
<td class="dhb">
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td class="dialog_header_text">
|
||||
Configuring an Edit Record Page</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="dialogHeaderEdgeR">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
<td class="configureErrorPagesText">
|
||||
<br />
|
||||
The Edit button or icon you clicked on is not yet bound to an Edit Record page.<br />
|
||||
<br />
|
||||
To bind the Edit button or icon to an Edit Record page:<br />
|
||||
<br />
|
||||
<ol>
|
||||
<li>If you have not yet created an Edit Record page, use the Application Wizard to create
|
||||
one.<br />
|
||||
<br />
|
||||
</li>
|
||||
<li>Go to the Application Explorer tab, navigate in the tree to the page that contains
|
||||
the Edit button or icon, then click the Properties button on the tool bar.<br />
|
||||
<br />
|
||||
<ul style="list-style-type: disc">
|
||||
<li>Select the name of the Edit button or icon in the tree.</li>
|
||||
<li>On the Bindings tab, modify the Redirect URL to point to your Edit Record page.<br />
|
||||
Example: ../MyPages/MyEditRecordPage.aspx?QueryStringParam={0}</li>
|
||||
<li>Make sure the Redirect parameter is "ID".<br />
|
||||
<br />
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Save changes and rebuild the application.</li>
|
||||
</ol>
|
||||
</td>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="panelR">
|
||||
<img src="../Images/space.gif" class="panelRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelBL">
|
||||
<img src="../Images/space.gif" class="panelBLSpace" alt="" /></td>
|
||||
<td class="panelB">
|
||||
<img src="../Images/space.gif" class="panelBSpace" alt="" /></td>
|
||||
<td class="panelBR">
|
||||
<img src="../Images/space.gif" class="panelBRSpace" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
117
Shared/ConfigureSpecialEditRecord.aspx
Normal file
117
Shared/ConfigureSpecialEditRecord.aspx
Normal file
|
@ -0,0 +1,117 @@
|
|||
<%@ Page Language="vb" AutoEventWireup="false" Inherits="Persons.UI.BaseApplicationPage" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<specificcontent requirement="WS/WAP">
|
||||
<script runat="server" language="VB">
|
||||
Public Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
|
||||
Dim selectedTheme As String = Me.GetSelectedTheme()
|
||||
If Not String.IsNullOrEmpty(selectedTheme) Then Me.Page.Theme = selectedTheme
|
||||
End Sub
|
||||
</script>
|
||||
</specificcontent>
|
||||
<title>Configure Special Edit Record Page</title>
|
||||
</head>
|
||||
<body class="pBack">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pWrapper">
|
||||
<tr>
|
||||
<td class="panelTL">
|
||||
<img src="../Images/space.gif" class="panelTLSpace" alt="" /></td>
|
||||
<td class="panelT">
|
||||
<img src="../Images/space.gif" class="panelTSpace" alt="" /></td>
|
||||
<td class="panelTR">
|
||||
<img src="../Images/space.gif" class="panelTRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelL">
|
||||
<img src="../Images/space.gif" class="panelLSpace" alt="" /></td>
|
||||
<td class="panelC">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pContent">
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"
|
||||
width="100%" id="AutoNumber1">
|
||||
<tr>
|
||||
<td class="dialog_header" colspan="3">
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="dialogHeaderEdgeL">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
<td class="dhb">
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td class="dialog_header_text">
|
||||
Configuring a Special Edit Record Page</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="dialogHeaderEdgeR">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
<td class="configureErrorPagesText">
|
||||
<br />
|
||||
The table that contains the record you are trying to edit is either a non-physical
|
||||
table (i.e. a View or a Query), or has no primary key. However, you can still create
|
||||
an Edit button for it by binding the Edit Icon and providing a Primary Key from
|
||||
a referenced physical table.<br />
|
||||
<br />
|
||||
This will enable you to edit a record from one of the referenced physical tables.
|
||||
For example, you could bind the Edit Icon for the 'Alphabetical list of products'
|
||||
view from the Northwind database so that it displays a Products record for editing.<br />
|
||||
<br />
|
||||
To bind the Edit button or icon to an Edit Record page:<br />
|
||||
<br />
|
||||
<ol>
|
||||
<li>If you have not yet created an Edit Record page, use the Application Wizard to create
|
||||
one.<br />
|
||||
<br />
|
||||
</li>
|
||||
<li>Go to the Application Explorer tab, navigate in the tree to the page that contains
|
||||
the Edit button or icon, then click the Properties button on the tool bar.<br />
|
||||
<br />
|
||||
<ul style="list-style-type: disc">
|
||||
<li>Select the name of the Edit button or icon in the tree.</li>
|
||||
<li>On the Bindings tab, modify the Redirect URL to point to your Edit Record page.<br />
|
||||
Example: ../MyPages/MyEditRecordPage.aspx?QueryStringParam={0}<br />
|
||||
<br />
|
||||
</li>
|
||||
<li>The Redirect parameter should reference the field that is a Primary Key for an associated
|
||||
physical table.<br />
|
||||
Example: "FV:ProductID"
|
||||
<br />
|
||||
<br />
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Save changes and rebuild the application.</li>
|
||||
</ol>
|
||||
</td>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="panelR">
|
||||
<img src="../Images/space.gif" class="panelRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelBL">
|
||||
<img src="../Images/space.gif" class="panelBLSpace" alt="" /></td>
|
||||
<td class="panelB">
|
||||
<img src="../Images/space.gif" class="panelBSpace" alt="" /></td>
|
||||
<td class="panelBR">
|
||||
<img src="../Images/space.gif" class="panelBRSpace" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
117
Shared/ConfigureSpecialViewRecord.aspx
Normal file
117
Shared/ConfigureSpecialViewRecord.aspx
Normal file
|
@ -0,0 +1,117 @@
|
|||
<%@ Page Language="vb" AutoEventWireup="false" Inherits="Persons.UI.BaseApplicationPage" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<specificcontent requirement="WS/WAP">
|
||||
<script runat="server" language="VB">
|
||||
Public Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
|
||||
Dim selectedTheme As String = Me.GetSelectedTheme()
|
||||
If Not String.IsNullOrEmpty(selectedTheme) Then Me.Page.Theme = selectedTheme
|
||||
End Sub
|
||||
</script>
|
||||
</specificcontent>
|
||||
<title>Configure Special View Record Page</title>
|
||||
</head>
|
||||
<body class="pBack">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pWrapper">
|
||||
<tr>
|
||||
<td class="panelTL">
|
||||
<img src="../Images/space.gif" class="panelTLSpace" alt="" /></td>
|
||||
<td class="panelT">
|
||||
<img src="../Images/space.gif" class="panelTSpace" alt="" /></td>
|
||||
<td class="panelTR">
|
||||
<img src="../Images/space.gif" class="panelTRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelL">
|
||||
<img src="../Images/space.gif" class="panelLSpace" alt="" /></td>
|
||||
<td class="panelC">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pContent">
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"
|
||||
width="100%" id="AutoNumber1">
|
||||
<tr>
|
||||
<td class="dialog_header" colspan="3">
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="dialogHeaderEdgeL">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
<td class="dhb">
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td class="dialog_header_text">
|
||||
Configuring a Special View Record Page</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="dialogHeaderEdgeR">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
<td class="configureErrorPagesText">
|
||||
<br />
|
||||
You cannot view the selected record because the underlying View button or icon is
|
||||
not yet bound to a View Record page. The table that contains the record you are
|
||||
trying to view is either a non-physical table (i.e. a View or a Query), or has no
|
||||
primary key. However, you can still create a View button for it by binding the View
|
||||
Icon and providing a Primary Key from a referenced physical table.<br />
|
||||
<br />
|
||||
This will enable you to view a record from one of the referenced physical tables.
|
||||
For example, you could bind the View Icon for the 'Alphabetical list of products'
|
||||
view from the Northwind database so that it displayes a Products record for viewing.<br />
|
||||
<br />
|
||||
To bind the View button or icon to a View Record page:<br />
|
||||
<br />
|
||||
<ol>
|
||||
<li>If you have not yet created a View Record page, use the Application Wizard to create
|
||||
one.<br />
|
||||
<br />
|
||||
</li>
|
||||
<li>Go to the Application Explorer tab, navigate in the tree to the page that contains
|
||||
the View button or icon, then click the Properties button on the tool bar.<br />
|
||||
<br />
|
||||
<ul style="list-style-type: disc">
|
||||
<li>Select the name of the View button or icon in the tree.</li>
|
||||
<li>On the Bindings tab, modify the Redirect URL to point to your View Record page.<br />
|
||||
Example: ../MyPages/MyViewRecordPage.aspx?QueryStringParam={0}<br />
|
||||
<br />
|
||||
</li>
|
||||
<li>The Redirect parameter should reference the field that is a Primary Key for an associated
|
||||
physical table.<br />
|
||||
Example: "FV:ProductID"<br />
|
||||
<br />
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Save changes and rebuild the application.</li>
|
||||
</ol>
|
||||
</td>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="panelR">
|
||||
<img src="../Images/space.gif" class="panelRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelBL">
|
||||
<img src="../Images/space.gif" class="panelBLSpace" alt="" /></td>
|
||||
<td class="panelB">
|
||||
<img src="../Images/space.gif" class="panelBSpace" alt="" /></td>
|
||||
<td class="panelBR">
|
||||
<img src="../Images/space.gif" class="panelBRSpace" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
108
Shared/ConfigureViewRecord.aspx
Normal file
108
Shared/ConfigureViewRecord.aspx
Normal file
|
@ -0,0 +1,108 @@
|
|||
<%@ Page Language="vb" AutoEventWireup="false" Inherits="Persons.UI.BaseApplicationPage" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<specificcontent requirement="WS/WAP">
|
||||
<script runat="server" language="VB">
|
||||
Public Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
|
||||
Dim selectedTheme As String = Me.GetSelectedTheme()
|
||||
If Not String.IsNullOrEmpty(selectedTheme) Then Me.Page.Theme = selectedTheme
|
||||
End Sub
|
||||
</script>
|
||||
</specificcontent>
|
||||
<title>Configure View Record Page</title>
|
||||
</head>
|
||||
<body class="pBack">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pWrapper">
|
||||
<tr>
|
||||
<td class="panelTL">
|
||||
<img src="../Images/space.gif" class="panelTLSpace" alt="" /></td>
|
||||
<td class="panelT">
|
||||
<img src="../Images/space.gif" class="panelTSpace" alt="" /></td>
|
||||
<td class="panelTR">
|
||||
<img src="../Images/space.gif" class="panelTRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelL">
|
||||
<img src="../Images/space.gif" class="panelLSpace" alt="" /></td>
|
||||
<td class="panelC">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pContent">
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"
|
||||
width="100%" id="AutoNumber1">
|
||||
<tr>
|
||||
<td class="dialog_header" colspan="3">
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="dialogHeaderEdgeL">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
<td class="dhb">
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td class="dialog_header_text">
|
||||
Configuring a View Record Page</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="dialogHeaderEdgeR">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
<td class="configureErrorPagesText">
|
||||
<br />
|
||||
You cannot view the selected record because the underlying View button or icon is
|
||||
not yet bound to a View Record page.<br />
|
||||
<br />
|
||||
To bind the View button or icon to a View Record page:<br />
|
||||
<br />
|
||||
<ol>
|
||||
<li>If you have not yet created a View Record page, use the Application Wizard to create
|
||||
one.<br />
|
||||
<br />
|
||||
</li>
|
||||
<li>Go to the Application Explorer tab, navigate in the tree to the page that contains
|
||||
the View button or icon, then click the Properties button on the tool bar.<br />
|
||||
<br />
|
||||
<ul style="list-style-type: disc">
|
||||
<li>Select the name of the View button or icon in the tree.</li>
|
||||
<li>On the Bindings tab, modify the Redirect URL to point to your View Record page.<br />
|
||||
Example: ../MyPages/MyViewRecordPage.aspx?QueryStringParam={0}<br />
|
||||
<br />
|
||||
</li>
|
||||
<li>Make sure the Redirect parameter is "ID".<br />
|
||||
<br />
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Save changes and rebuild the application.</li>
|
||||
</ol>
|
||||
</td>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="panelR">
|
||||
<img src="../Images/space.gif" class="panelRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelBL">
|
||||
<img src="../Images/space.gif" class="panelBLSpace" alt="" /></td>
|
||||
<td class="panelB">
|
||||
<img src="../Images/space.gif" class="panelBSpace" alt="" /></td>
|
||||
<td class="panelBR">
|
||||
<img src="../Images/space.gif" class="panelBRSpace" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
21
Shared/DatePagination.ascx
Normal file
21
Shared/DatePagination.ascx
Normal file
|
@ -0,0 +1,21 @@
|
|||
<%@ Control Language="vb" AutoEventWireup="false" CodeFile="DatePagination.ascx.vb" Inherits="Persons.UI.DatePagination" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Register Tagprefix="Selectors" Namespace="Persons" %>
|
||||
|
||||
<%@ Register Tagprefix="Persons" TagName="ThemeButton" Src="../Shared/ThemeButton.ascx" %>
|
||||
|
||||
<%@ Register Tagprefix="BaseClasses" Namespace="BaseClasses.Web.UI.WebControls" Assembly="BaseClasses" %>
|
||||
<a id="StartOfPageContent"></a>
|
||||
|
||||
<table cellpadding="0" cellspacing="0" border="0"><tr><td style="text-align:center;"><Persons:ThemeButton runat="server" id="_PreviousPageInterval" button-causesvalidation="False" button-commandname="PreviousPageInterval" postback="False"></Persons:ThemeButton></td><td style="text-align:center;"><Persons:ThemeButton runat="server" id="_PreviousInterval" button-causesvalidation="False" button-commandname="PreviousInterval" button-text="-" button-tooltip="-" postback="False"></Persons:ThemeButton></td><td class="dfv"><asp:LinkButton runat="server" id="_Day" causesvalidation="False" commandname="Day" text="<%# GetResourceValue("Btn:Day", "Persons") %>" tooltip="<%# GetResourceValue("Btn:Day", "Persons") %>">
|
||||
</asp:LinkButton><asp:Literal runat="server" id="_Day1" Text="<%# GetResourceValue("Btn:Day", "Persons") %>"> </asp:Literal></td><td> </td><td class="dfv"><asp:LinkButton runat="server" id="_Week" causesvalidation="False" commandname="Week" text="<%# GetResourceValue("Btn:Week", "Persons") %>" tooltip="<%# GetResourceValue("Btn:Week", "Persons") %>">
|
||||
</asp:LinkButton><asp:Literal runat="server" id="_Week1" Text="<%# GetResourceValue("Btn:Week", "Persons") %>"> </asp:Literal></td><td> </td><td class="dfv"><asp:LinkButton runat="server" id="_Month" causesvalidation="False" commandname="Month" text="<%# GetResourceValue("Btn:Month", "Persons") %>" tooltip="<%# GetResourceValue("Btn:Month", "Persons") %>">
|
||||
</asp:LinkButton><asp:Literal runat="server" id="_Month1" Text="<%# GetResourceValue("Btn:Month", "Persons") %>"> </asp:Literal></td><td> </td><td class="dfv"><asp:LinkButton runat="server" id="_Quarter" causesvalidation="False" commandname="Quarter" text="<%# GetResourceValue("Btn:Quarter", "Persons") %>" tooltip="<%# GetResourceValue("Btn:Quarter", "Persons") %>">
|
||||
</asp:LinkButton><asp:Literal runat="server" id="_Quarter1" Text="<%# GetResourceValue("Btn:Quarter", "Persons") %>"> </asp:Literal></td><td> </td><td class="dfv"><asp:LinkButton runat="server" id="_Year" causesvalidation="False" commandname="Year" enabled="True" text="<%# GetResourceValue("Btn:Year", "Persons") %>" tooltip="<%# GetResourceValue("Btn:Year", "Persons") %>">
|
||||
</asp:LinkButton>
|
||||
<asp:Literal runat="server" id="_Year1" Text="<%# GetResourceValue("Btn:Year", "Persons") %>"> </asp:Literal></td><td style="text-align:center;"><Persons:ThemeButton runat="server" id="_NextInterval" button-causesvalidation="False" button-commandname="NextInterval" button-text="+" button-tooltip="+" postback="False"></Persons:ThemeButton></td><td style="text-align:center;"><Persons:ThemeButton runat="server" id="_NextPageInterval" button-causesvalidation="False" button-commandname="NextPageInterval" postback="False"></Persons:ThemeButton></td><td style="text-align:left;" nowrap="nowrap"><asp:Literal runat="server" id="_StartDate1" visible="False"> </asp:Literal></td></tr></table>
|
||||
|
||||
<div id="detailPopup" class="detailRolloverPopup" onmouseout="detailRolloverPopupClose();" onmouseover="clearTimeout(gPopupTimer);"></div>
|
||||
<asp:ValidationSummary id="ValidationSummary1" ShowMessageBox="true" ShowSummary="false" runat="server"></asp:ValidationSummary>
|
||||
|
||||
|
908
Shared/DatePagination.ascx.vb
Normal file
908
Shared/DatePagination.ascx.vb
Normal file
|
@ -0,0 +1,908 @@
|
|||
|
||||
#Region "Imports statements"
|
||||
Option Strict On
|
||||
Imports System
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports System.ComponentModel
|
||||
Imports BaseClasses
|
||||
Imports BaseClasses.Data
|
||||
Imports BaseClasses.Utils
|
||||
Imports BaseClasses.Web.UI.WebControls
|
||||
|
||||
Imports Persons.Business
|
||||
Imports Persons.Data
|
||||
|
||||
#End Region
|
||||
|
||||
Namespace Persons.UI
|
||||
|
||||
' Code-behind class for the DatePagination user control.
|
||||
Partial Public Class DatePagination
|
||||
Inherits BaseApplicationUserControl
|
||||
Implements IDatePagination
|
||||
#Region "Section 1: Place your customizations here."
|
||||
|
||||
Public Sub LoadData()
|
||||
' LoadData reads database data and assigns it to UI controls.
|
||||
' Customize by adding code before or after the call to LoadData_Base()
|
||||
' or replace the call to LoadData_Base().
|
||||
LoadData_Base()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate as BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS as Boolean) As String
|
||||
Return EvaluateFormula_Base(formula, dataSourceForEvaluate, format, variables, includeDS)
|
||||
End Function
|
||||
|
||||
Public Sub Page_InitializeEventHandlers(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Init
|
||||
' Handles MyBase.Init.
|
||||
' Register the Event handler for any Events.
|
||||
Me.Page_InitializeEventHandlers_Base(sender,e)
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub SaveControlsToSession()
|
||||
SaveControlsToSession_Base()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Overrides Sub ClearControlsFromSession()
|
||||
ClearControlsFromSession_Base()
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub LoadViewState(ByVal savedState As Object)
|
||||
LoadViewState_Base(savedState)
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Overrides Function SaveViewState() As Object
|
||||
Return SaveViewState_Base()
|
||||
End Function
|
||||
|
||||
Public Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
|
||||
Me.Page_PreRender_Base(sender,e)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Public Overrides Sub SetChartControl(ByVal chartCtrlName As String)
|
||||
Me.SetChartControl_Base(chartCtrlName)
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "Ajax Functions"
|
||||
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' or replace the call to GetRecordFieldValue_Base().
|
||||
Return GetRecordFieldValue_Base(tableName, recordID, columnName, fieldName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetImage(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetImage gets the Image url for the image in the column "columnName" and
|
||||
' in the record specified by recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetImage_Base()
|
||||
' or replace the call to GetImage_Base().
|
||||
Return GetImage_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
Protected Overloads Overrides Sub BasePage_PreRender(ByVal sender As Object, ByVal e As EventArgs)
|
||||
MyBase.BasePage_PreRender(sender, e)
|
||||
Base_RegisterPostback()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
' Page Event Handlers - buttons, sort, links
|
||||
|
||||
Public Sub NextInterval_Click(ByVal sender As Object, ByVal args As EventArgs)
|
||||
' Click handler for NextInterval.
|
||||
' Customize by adding code before the call or replace the call to the Base function with your own code.
|
||||
NextInterval_Click_Base(sender, args)
|
||||
' NOTE: If the Base function redirects to another page, any code here will not be executed.
|
||||
End Sub
|
||||
|
||||
Public Sub NextPageInterval_Click(ByVal sender As Object, ByVal args As EventArgs)
|
||||
' Click handler for NextPageInterval.
|
||||
' Customize by adding code before the call or replace the call to the Base function with your own code.
|
||||
NextPageInterval_Click_Base(sender, args)
|
||||
' NOTE: If the Base function redirects to another page, any code here will not be executed.
|
||||
End Sub
|
||||
|
||||
Public Sub PreviousInterval_Click(ByVal sender As Object, ByVal args As EventArgs)
|
||||
' Click handler for PreviousInterval.
|
||||
' Customize by adding code before the call or replace the call to the Base function with your own code.
|
||||
PreviousInterval_Click_Base(sender, args)
|
||||
' NOTE: If the Base function redirects to another page, any code here will not be executed.
|
||||
End Sub
|
||||
|
||||
Public Sub PreviousPageInterval_Click(ByVal sender As Object, ByVal args As EventArgs)
|
||||
' Click handler for PreviousPageInterval.
|
||||
' Customize by adding code before the call or replace the call to the Base function with your own code.
|
||||
PreviousPageInterval_Click_Base(sender, args)
|
||||
' NOTE: If the Base function redirects to another page, any code here will not be executed.
|
||||
End Sub
|
||||
|
||||
|
||||
' Write out the Set methods
|
||||
|
||||
|
||||
' Write out the methods for DataSource
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Section 2: Do not modify this section."
|
||||
|
||||
|
||||
|
||||
Private Sub SetPeriodsShown_Base(ByVal periodsShown As Integer)
|
||||
|
||||
Me.PreviousPageInterval.Button.Text = "-" & periodsShown
|
||||
Me.PreviousPageInterval.Button.ToolTip = "-" & periodsShown
|
||||
|
||||
Me.NextPageInterval.Button.Text = "+" & periodsShown
|
||||
Me.NextPageInterval.Button.ToolTip = "+" & periodsShown
|
||||
|
||||
End Sub
|
||||
|
||||
Private Property Interval_Base() As String
|
||||
|
||||
Get
|
||||
|
||||
If Me.Year1.Visible Then Return "Year"
|
||||
|
||||
If Me.Quarter1.Visible Then Return "Quarter"
|
||||
|
||||
If Me.Month1.Visible Then Return "Month"
|
||||
|
||||
If Me.Week1.Visible Then Return "Week"
|
||||
|
||||
If Me.Day1.Visible Then Return "Day"
|
||||
|
||||
Return ""
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
'set the selected interval link button to be invisible.
|
||||
'set the corresponded interval literal control to be visible.
|
||||
'for the rest of the interval, set the corresponded link button to be visible, and literal to be invisible.
|
||||
|
||||
Me.Day.Visible = True
|
||||
Me.Day1.Visible = False
|
||||
|
||||
Me.Week.Visible = True
|
||||
Me.Week1.Visible = False
|
||||
|
||||
Me.Month.Visible = True
|
||||
Me.Month1.Visible = False
|
||||
|
||||
Me.Quarter.Visible = True
|
||||
Me.Quarter1.Visible = False
|
||||
|
||||
Me.Year.Visible = True
|
||||
Me.Year1.Visible = False
|
||||
|
||||
Select Case value
|
||||
Case "Year"
|
||||
|
||||
Me.Year.Visible = False
|
||||
Me.Year1.Visible = True
|
||||
|
||||
Case "Quarter"
|
||||
|
||||
Me.Quarter.Visible = False
|
||||
Me.Quarter1.Visible = True
|
||||
|
||||
Case "Month"
|
||||
|
||||
Me.Month.Visible = False
|
||||
Me.Month1.Visible = True
|
||||
|
||||
Case "Week"
|
||||
|
||||
Me.Week.Visible = False
|
||||
Me.Week1.Visible = True
|
||||
|
||||
Case "Day"
|
||||
|
||||
Me.Day.Visible = False
|
||||
Me.Day1.Visible = True
|
||||
|
||||
End Select
|
||||
End Set
|
||||
|
||||
End Property
|
||||
|
||||
Private Sub ProcessNextPeriod_Base()
|
||||
If FirstStartDate = "" Then
|
||||
Return
|
||||
End If
|
||||
Select Case Interval
|
||||
Case "Year"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddYears(1).ToShortDateString()
|
||||
Case "Quarter"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddMonths(3).ToShortDateString()
|
||||
Case "Month"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddMonths(1).ToShortDateString()
|
||||
Case "Week"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddDays(7).ToShortDateString()
|
||||
Case "Day"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddDays(1).ToShortDateString()
|
||||
End Select
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ProcessNextPagePeriod_Base(ByVal periodsShown As Integer)
|
||||
If FirstStartDate = "" Then
|
||||
Return
|
||||
End If
|
||||
Select Case Interval
|
||||
Case "Year"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddYears(1 * periodsShown).ToShortDateString()
|
||||
Case "Quarter"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddMonths(3 * periodsShown).ToShortDateString()
|
||||
Case "Month"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddMonths(1 * periodsShown).ToShortDateString()
|
||||
Case "Week"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddDays(7 * periodsShown).ToShortDateString()
|
||||
Case "Day"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddDays(1 * periodsShown).ToShortDateString()
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub ProcessPreviousPeriod_Base()
|
||||
If FirstStartDate = "" Then
|
||||
Return
|
||||
End If
|
||||
Select Case Interval
|
||||
Case "Year"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddYears(-1).ToShortDateString()
|
||||
Case "Quarter"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddMonths(-3).ToShortDateString()
|
||||
Case "Month"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddMonths(-1).ToShortDateString()
|
||||
Case "Week"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddDays(-7).ToShortDateString()
|
||||
Case "Day"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddDays(-1).ToShortDateString()
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub ProcessPreviousPagePeriod_Base(ByVal periodsShown As Integer)
|
||||
If FirstStartDate = "" Then
|
||||
Return
|
||||
End If
|
||||
Select Case Interval
|
||||
Case "Year"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddYears(-1 * periodsShown).ToShortDateString()
|
||||
Case "Quarter"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddMonths(-3 * periodsShown).ToShortDateString()
|
||||
Case "Month"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddMonths(-1 * periodsShown).ToShortDateString()
|
||||
Case "Week"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddDays(-7 * periodsShown).ToShortDateString()
|
||||
Case "Day"
|
||||
FirstStartDate = Convert.ToDateTime(FirstStartDate).AddDays(-1 * periodsShown).ToShortDateString()
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Property FirstStartDate_Base() As String
|
||||
Set(ByVal value As String)
|
||||
Me.StartDate1.Text = value
|
||||
End Set
|
||||
Get
|
||||
If Me.StartDate1.Text <> "" Then
|
||||
Return Me.StartDate1.Text
|
||||
Else
|
||||
Return ""
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected Sub Page_InitializeEventHandlers_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
|
||||
' the following code for accordion is necessary or the Me.{ControlName} will return Nothing
|
||||
|
||||
' Register the Event handler for any Events.
|
||||
|
||||
|
||||
' Setup the pagination events.
|
||||
|
||||
AddHandler Me.NextInterval.Button.Click, AddressOf NextInterval_Click
|
||||
|
||||
AddHandler Me.NextPageInterval.Button.Click, AddressOf NextPageInterval_Click
|
||||
|
||||
AddHandler Me.PreviousInterval.Button.Click, AddressOf PreviousInterval_Click
|
||||
|
||||
AddHandler Me.PreviousPageInterval.Button.Click, AddressOf PreviousPageInterval_Click
|
||||
|
||||
Me.ClearControlsFromSession()
|
||||
End Sub
|
||||
|
||||
Private Sub Base_RegisterPostback()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
' Handles MyBase.Load. Read database data and put into the UI controls.
|
||||
' If you need to, you can add additional Load handlers in Section 1.
|
||||
Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
|
||||
|
||||
If (Not Me.IsPostBack) Then
|
||||
|
||||
End If
|
||||
|
||||
|
||||
' Load data only when displaying the page for the first time or if postback from child window
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Read the data for all controls on the page.
|
||||
' To change the behavior, override the DataBind method for the individual
|
||||
' record or table UI controls.
|
||||
Me.LoadData()
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetRecordFieldValue_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
If Not IsNothing(recordID) Then
|
||||
recordID = System.Web.HttpUtility.UrlDecode(recordID)
|
||||
End If
|
||||
Dim content as String = BaseClasses.Utils.MiscUtils.GetFieldData(tableName, recordID, columnName)
|
||||
|
||||
content = NetUtils.EncodeStringForHtmlDisplay(content)
|
||||
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window
|
||||
'returnValue(1) represents content of the pop up window
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function GetImage_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
Dim content As String = "<IMG alt =""" & title & """ src =" & """../Shared/ExportFieldValue.aspx?Table=" & tableName & "&Field=" & columnName & "&Record=" & recordID & """/>"
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window.
|
||||
'returnValue(1) represents content ie, image url.
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
Public Sub SetChartControl_Base(ByVal chartCtrlName As String)
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub SaveControlsToSession_Base()
|
||||
MyBase.SaveControlsToSession()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub ClearControlsFromSession_Base()
|
||||
MyBase.ClearControlsFromSession()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LoadViewState_Base(ByVal savedState As Object)
|
||||
MyBase.LoadViewState(savedState)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Function SaveViewState_Base() As Object
|
||||
|
||||
Return MyBase.SaveViewState()
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub Page_PreRender_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
' Data bind for each chart UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
' Load data from database into UI controls.
|
||||
' Modify LoadData in Section 1 above to customize. Or override DataBind() in
|
||||
' the individual table and record controls to customize.
|
||||
Public Sub LoadData_Base()
|
||||
Try
|
||||
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Must start a transaction before performing database operations
|
||||
DbUtils.StartTransaction()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Me.DataBind()
|
||||
|
||||
' Load and bind data for each record and table UI control.
|
||||
|
||||
|
||||
' Load data for chart.
|
||||
|
||||
|
||||
' initialize aspx controls
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
' An error has occured so display an error message.
|
||||
Utils.RegisterJScriptAlert(Me, "Page_Load_Error_Message", ex.Message)
|
||||
Finally
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' End database transaction
|
||||
DbUtils.EndTransaction()
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public EvaluateFormulaDelegate As BaseClasses.Data.DataSource.EvaluateFormulaDelegate = New BaseClasses.Data.DataSource.EvaluateFormulaDelegate(AddressOf Me.EvaluateFormula)
|
||||
|
||||
Public Overridable Function EvaluateFormula_Base(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS As Boolean) As String
|
||||
Dim e As FormulaEvaluator = New FormulaEvaluator()
|
||||
|
||||
' add variables for formula evaluation
|
||||
If variables IsNot Nothing Then
|
||||
Dim enumerator As System.Collections.Generic.IEnumerator(Of System.Collections.Generic.KeyValuePair(Of String, Object)) = variables.GetEnumerator()
|
||||
While enumerator.MoveNext()
|
||||
e.Variables.Add(enumerator.Current.Key, enumerator.Current.Value)
|
||||
End While
|
||||
End If
|
||||
|
||||
If includeDS
|
||||
|
||||
End If
|
||||
|
||||
|
||||
e.CallingControl = Me
|
||||
|
||||
e.DataSource = dataSourceForEvaluate
|
||||
|
||||
|
||||
Dim resultObj As Object = e.Evaluate(formula)
|
||||
If resultObj Is Nothing Then
|
||||
Return ""
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrEmpty(format) AndAlso (String.IsNullOrEmpty(formula) OrElse formula.IndexOf("Format(") < 0) Then
|
||||
Return FormulaUtils.Format(resultObj, format)
|
||||
Else
|
||||
Return resultObj.ToString()
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object)) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, format, variables, True)
|
||||
End Function
|
||||
|
||||
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal includeDS As Boolean) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, includeDS)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
' Write out the Set methods
|
||||
|
||||
|
||||
' Write out the DataSource properties and methods
|
||||
|
||||
|
||||
' Write out event methods for the page events
|
||||
|
||||
' event handler for Button with Layout
|
||||
Public Sub NextInterval_Click_Base(ByVal sender As Object, ByVal args As EventArgs)
|
||||
|
||||
Try
|
||||
' Enclose all database retrieval/update code within a Transaction boundary
|
||||
DbUtils.StartTransaction
|
||||
|
||||
Catch ex As Exception
|
||||
' Upon error, rollback the transaction
|
||||
Ctype(Me.Page, BaseApplicationPage).RollBackTransaction(sender)
|
||||
Ctype(Me.Page, BaseApplicationPage).ErrorOnPage = True
|
||||
|
||||
' Report the error message to the end user
|
||||
Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", ex.Message)
|
||||
|
||||
Finally
|
||||
DbUtils.EndTransaction
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
' event handler for Button with Layout
|
||||
Public Sub NextPageInterval_Click_Base(ByVal sender As Object, ByVal args As EventArgs)
|
||||
|
||||
Try
|
||||
' Enclose all database retrieval/update code within a Transaction boundary
|
||||
DbUtils.StartTransaction
|
||||
|
||||
Catch ex As Exception
|
||||
' Upon error, rollback the transaction
|
||||
Ctype(Me.Page, BaseApplicationPage).RollBackTransaction(sender)
|
||||
Ctype(Me.Page, BaseApplicationPage).ErrorOnPage = True
|
||||
|
||||
' Report the error message to the end user
|
||||
Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", ex.Message)
|
||||
|
||||
Finally
|
||||
DbUtils.EndTransaction
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
' event handler for Button with Layout
|
||||
Public Sub PreviousInterval_Click_Base(ByVal sender As Object, ByVal args As EventArgs)
|
||||
|
||||
Try
|
||||
' Enclose all database retrieval/update code within a Transaction boundary
|
||||
DbUtils.StartTransaction
|
||||
|
||||
Catch ex As Exception
|
||||
' Upon error, rollback the transaction
|
||||
Ctype(Me.Page, BaseApplicationPage).RollBackTransaction(sender)
|
||||
Ctype(Me.Page, BaseApplicationPage).ErrorOnPage = True
|
||||
|
||||
' Report the error message to the end user
|
||||
Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", ex.Message)
|
||||
|
||||
Finally
|
||||
DbUtils.EndTransaction
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
' event handler for Button with Layout
|
||||
Public Sub PreviousPageInterval_Click_Base(ByVal sender As Object, ByVal args As EventArgs)
|
||||
|
||||
Try
|
||||
' Enclose all database retrieval/update code within a Transaction boundary
|
||||
DbUtils.StartTransaction
|
||||
|
||||
Catch ex As Exception
|
||||
' Upon error, rollback the transaction
|
||||
Ctype(Me.Page, BaseApplicationPage).RollBackTransaction(sender)
|
||||
Ctype(Me.Page, BaseApplicationPage).ErrorOnPage = True
|
||||
|
||||
' Report the error message to the end user
|
||||
Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", ex.Message)
|
||||
|
||||
Finally
|
||||
DbUtils.EndTransaction
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub SetPeriodsShown(ByVal periodsShown As Integer) Implements IDatePagination.SetPeriodsShown
|
||||
SetPeriodsShown_Base(periodsShown)
|
||||
End Sub
|
||||
|
||||
Public Property Interval() As String Implements IDatePagination.Interval
|
||||
Get
|
||||
Return Interval_Base
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
Interval_Base = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Sub ProcessNextPeriod() Implements IDatePagination.ProcessNextPeriod
|
||||
ProcessNextPeriod_Base()
|
||||
End Sub
|
||||
|
||||
Public Sub ProcessNextPagePeriod(ByVal periodsShown As Integer) Implements IDatePagination.ProcessNextPagePeriod
|
||||
ProcessNextPagePeriod_Base(periodsShown)
|
||||
End Sub
|
||||
|
||||
Public Sub ProcessPreviousPeriod() Implements IDatePagination.ProcessPreviousPeriod
|
||||
ProcessPreviousPeriod_Base()
|
||||
End Sub
|
||||
|
||||
Public Sub ProcessPreviousPagePeriod(ByVal periodsShown As Integer) Implements IDatePagination.ProcessPreviousPagePeriod
|
||||
ProcessPreviousPagePeriod_Base(periodsShown)
|
||||
End Sub
|
||||
|
||||
Public Property FirstStartDate() As String Implements IDatePagination.FirstStartDate
|
||||
Set(ByVal value As String)
|
||||
FirstStartDate_Base = value
|
||||
End Set
|
||||
Get
|
||||
Return FirstStartDate_Base
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Interface Properties"
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property Day() As System.Web.UI.WebControls.LinkButton Implements IDatePagination.Day
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_Day"), System.Web.UI.WebControls.LinkButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property Day1() As System.Web.UI.WebControls.Literal Implements IDatePagination.Day1
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_Day1"), System.Web.UI.WebControls.Literal)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property Month() As System.Web.UI.WebControls.LinkButton Implements IDatePagination.Month
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_Month"), System.Web.UI.WebControls.LinkButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property Month1() As System.Web.UI.WebControls.Literal Implements IDatePagination.Month1
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_Month1"), System.Web.UI.WebControls.Literal)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property NextInterval() As IThemeButton Implements IDatePagination.NextInterval
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_NextInterval"), IThemeButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property NextPageInterval() As IThemeButton Implements IDatePagination.NextPageInterval
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_NextPageInterval"), IThemeButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property PageTitle() As System.Web.UI.WebControls.Literal Implements IDatePagination.PageTitle
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_PageTitle"), System.Web.UI.WebControls.Literal)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property PreviousInterval() As IThemeButton Implements IDatePagination.PreviousInterval
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_PreviousInterval"), IThemeButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property PreviousPageInterval() As IThemeButton Implements IDatePagination.PreviousPageInterval
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_PreviousPageInterval"), IThemeButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property Quarter() As System.Web.UI.WebControls.LinkButton Implements IDatePagination.Quarter
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_Quarter"), System.Web.UI.WebControls.LinkButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property Quarter1() As System.Web.UI.WebControls.Literal Implements IDatePagination.Quarter1
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_Quarter1"), System.Web.UI.WebControls.Literal)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property StartDate1() As System.Web.UI.WebControls.Literal Implements IDatePagination.StartDate1
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_StartDate1"), System.Web.UI.WebControls.Literal)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property Week() As System.Web.UI.WebControls.LinkButton Implements IDatePagination.Week
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_Week"), System.Web.UI.WebControls.LinkButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property Week1() As System.Web.UI.WebControls.Literal Implements IDatePagination.Week1
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_Week1"), System.Web.UI.WebControls.Literal)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property Year() As System.Web.UI.WebControls.LinkButton Implements IDatePagination.Year
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_Year"), System.Web.UI.WebControls.LinkButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property Year1() As System.Web.UI.WebControls.Literal Implements IDatePagination.Year1
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_Year1"), System.Web.UI.WebControls.Literal)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Property Visible() As Boolean Implements IDatePagination.Visible
|
||||
|
||||
Get
|
||||
Return MyBase.Visible
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
MyBase.Visible = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Public Shadows ReadOnly Property Page() As BaseApplicationPage
|
||||
Get
|
||||
Return DirectCast(MyBase.Page, BaseApplicationPage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
|
||||
|
480
Shared/DatePagination.xml
Normal file
480
Shared/DatePagination.xml
Normal file
|
@ -0,0 +1,480 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<ComponentDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.ironspeed.com/designer">
|
||||
<Generator>Iron Speed Designer</Generator>
|
||||
<Version>9.2.0</Version>
|
||||
<Self>
|
||||
<Name>DatePagination</Name>
|
||||
<Type>DatePagination</Type>
|
||||
<SubType>DotNet</SubType>
|
||||
<GenerateDirectory>Shared</GenerateDirectory>
|
||||
<Layout>Shared\DatePagination.html</Layout>
|
||||
<DisplayName>DatePagination</DisplayName>
|
||||
<Description>(Description)</Description>
|
||||
</Self>
|
||||
<ComposedOf>
|
||||
<ContainedComponent>
|
||||
<Name>Day</Name>
|
||||
<Type>LinkButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>Day</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Btn:Day</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:Day</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>Day1</Name>
|
||||
<Type>Literal</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Btn:Day</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>Month</Name>
|
||||
<Type>LinkButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>Month</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Btn:Month</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:Month</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>Month1</Name>
|
||||
<Type>Literal</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Btn:Month</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>NextInterval</Name>
|
||||
<Type>Button</Type>
|
||||
<Layout>..\Shared\ThemeButton.ascx</Layout>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Button-CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Button-CommandName</Name>
|
||||
<Value>NextInterval</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Button-Consumers</Name>
|
||||
<Value>page</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Button-Text</Name>
|
||||
<Value>+</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Button-ToolTip</Name>
|
||||
<Value>+</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>PostBack</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>NextPageInterval</Name>
|
||||
<Type>Button</Type>
|
||||
<Layout>..\Shared\ThemeButton.ascx</Layout>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Button-CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Button-CommandName</Name>
|
||||
<Value>NextPageInterval</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Button-Consumers</Name>
|
||||
<Value>page</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>PostBack</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>PageTitle</Name>
|
||||
<Type>Literal</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Blank page</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>PreviousInterval</Name>
|
||||
<Type>Button</Type>
|
||||
<Layout>..\Shared\ThemeButton.ascx</Layout>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Button-CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Button-CommandName</Name>
|
||||
<Value>PreviousInterval</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Button-Consumers</Name>
|
||||
<Value>page</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Button-Text</Name>
|
||||
<Value>-</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Button-ToolTip</Name>
|
||||
<Value>-</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>PostBack</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>PreviousPageInterval</Name>
|
||||
<Type>Button</Type>
|
||||
<Layout>..\Shared\ThemeButton.ascx</Layout>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Button-CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Button-CommandName</Name>
|
||||
<Value>PreviousPageInterval</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Button-Consumers</Name>
|
||||
<Value>page</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>PostBack</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>Quarter</Name>
|
||||
<Type>LinkButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>Quarter</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Btn:Quarter</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:Quarter</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>Quarter1</Name>
|
||||
<Type>Literal</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Btn:Quarter</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>StartDate1</Name>
|
||||
<Type>Literal</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Visible</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>UpdatePanel1</Name>
|
||||
<Type>UpdatePanel</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>SmoothPanelUpdate</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>Week</Name>
|
||||
<Type>LinkButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>Week</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Btn:Week</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:Week</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>Week1</Name>
|
||||
<Type>Literal</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Btn:Week</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>Year</Name>
|
||||
<Type>LinkButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>Year</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Enabled</Name>
|
||||
<Value>True</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Btn:Year</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:Year</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>Year1</Name>
|
||||
<Type>Literal</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Btn:Year</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
</ComposedOf>
|
||||
<LayoutDefinition><![CDATA[<?xml version="1.0" encoding="utf-16"?>
|
||||
<LayoutDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<Layout Name="UserControl" Type="RootLayout">
|
||||
<Prolog>
|
||||
<Value>&lt;asp:Content id="PageSection" ContentPlaceHolderID="PageContent" Runat="server"&gt;
|
||||
&lt;a id="StartOfPageContent"&gt;&lt;/a&gt;
|
||||
&lt;GEN:UPDATEPANEL NAME="UpdatePanel1"&gt;
|
||||
</Value>
|
||||
</Prolog>
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:BUTTON NAME="PreviousPageInterval" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>style</Name>
|
||||
<AttributeValue>text-align:center;</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:BUTTON NAME="PreviousInterval" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>style</Name>
|
||||
<AttributeValue>text-align:center;</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:LINKBUTTON NAME="Day" /&gt;&lt;GEN:LITERAL Name="Day1" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>dfv</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&amp;nbsp;</Value>
|
||||
<CellAttributes />
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:LINKBUTTON NAME="Week" /&gt;&lt;GEN:LITERAL Name="Week1" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>dfv</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&amp;nbsp;</Value>
|
||||
<CellAttributes />
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:LINKBUTTON NAME="Month" /&gt;&lt;GEN:LITERAL Name="Month1" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>dfv</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&amp;nbsp;</Value>
|
||||
<CellAttributes />
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:LINKBUTTON NAME="Quarter" /&gt;&lt;GEN:LITERAL Name="Quarter1" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>dfv</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&amp;nbsp;</Value>
|
||||
<CellAttributes />
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:LINKBUTTON NAME="Year" /&gt;
|
||||
&lt;GEN:LITERAL Name="Year1" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>dfv</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:BUTTON NAME="NextInterval" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>style</Name>
|
||||
<AttributeValue>text-align:center;</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:BUTTON NAME="NextPageInterval" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>style</Name>
|
||||
<AttributeValue>text-align:center;</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:LITERAL Name="StartDate1" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>style</Name>
|
||||
<AttributeValue>text-align:left;</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>nowrap</Name>
|
||||
<AttributeValue>nowrap</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<RowAttributes />
|
||||
</Row>
|
||||
<Epilog>
|
||||
<Value>
|
||||
&lt;/GEN:UPDATEPANEL&gt;
|
||||
&lt;div id="detailPopup" class="detailRolloverPopup" onmouseout="detailRolloverPopupClose();" onmouseover="clearTimeout(gPopupTimer);"&gt;&lt;/div&gt;
|
||||
&lt;asp:ValidationSummary id="ValidationSummary1" ShowMessageBox="true" ShowSummary="false" runat="server"&gt;&lt;/asp:ValidationSummary&gt;
|
||||
&lt;/asp:Content&gt;
|
||||
</Value>
|
||||
</Epilog>
|
||||
<TableAttributes>
|
||||
<Attribute>
|
||||
<Name>cellpadding</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>cellspacing</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>border</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
</TableAttributes>
|
||||
</Layout>
|
||||
</LayoutDefinition>]]></LayoutDefinition>
|
||||
</ComponentDefinition>
|
92
Shared/Default.aspx
Normal file
92
Shared/Default.aspx
Normal file
|
@ -0,0 +1,92 @@
|
|||
<%@ Page Language="vb" AutoEventWireup="false" Inherits="Persons.UI.BaseApplicationPage" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<specificcontent requirement="WS/WAP">
|
||||
<script runat="server" language="VB">
|
||||
Public Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
|
||||
Dim selectedTheme As String = Me.GetSelectedTheme()
|
||||
If Not String.IsNullOrEmpty(selectedTheme) Then Me.Page.Theme = selectedTheme
|
||||
End Sub
|
||||
</script>
|
||||
</specificcontent>
|
||||
<title>Configuring Your Application Start Page</title>
|
||||
</head>
|
||||
<body class="pBack">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pWrapper">
|
||||
<tr>
|
||||
<td class="panelTL">
|
||||
<img src="../Images/space.gif" class="panelTLSpace" alt="" /></td>
|
||||
<td class="panelT">
|
||||
<img src="../Images/space.gif" class="panelTSpace" alt="" /></td>
|
||||
<td class="panelTR">
|
||||
<img src="../Images/space.gif" class="panelTRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelL">
|
||||
<img src="../Images/space.gif" class="panelLSpace" alt="" /></td>
|
||||
<td class="panelC">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pContent">
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"
|
||||
width="100%" id="AutoNumber1">
|
||||
<tr>
|
||||
<td class="dialog_header" colspan="3">
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="dialogHeaderEdgeL">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
<td class="dhb">
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td class="dialog_header_text">
|
||||
Configuring Your Application Start Page</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="dialogHeaderEdgeR">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
<td class="configureErrorPagesText">
|
||||
<br />
|
||||
Your application does not currently have a default start page. You need to
|
||||
configure a start page to be displayed whenever you access:<br />
|
||||
<br />
|
||||
<blockquote>
|
||||
http://<machine name>/<application name><br />
|
||||
<br />
|
||||
</blockquote>
|
||||
To configure your application's start page, select Configure Start Page from the
|
||||
Tools menu.<br />
|
||||
<br />
|
||||
</td>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="panelR">
|
||||
<img src="../Images/space.gif" class="panelRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelBL">
|
||||
<img src="../Images/space.gif" class="panelBLSpace" alt="" /></td>
|
||||
<td class="panelB">
|
||||
<img src="../Images/space.gif" class="panelBSpace" alt="" /></td>
|
||||
<td class="panelBR">
|
||||
<img src="../Images/space.gif" class="panelBRSpace" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
23
Shared/ExportFieldValue.aspx
Normal file
23
Shared/ExportFieldValue.aspx
Normal file
|
@ -0,0 +1,23 @@
|
|||
<%@ Page Language="vb" AutoEventWireup="false" Codefile="ExportFieldValue.aspx.vb" Inherits="Persons.ExportFieldValue" %>
|
||||
<%@ Register Tagprefix="BaseClasses" Namespace="BaseClasses.Web.UI.WebControls" Assembly="BaseClasses" %>
|
||||
|
||||
<%--
|
||||
Example URL:
|
||||
http://localhost/Persons/ExportFieldValue.aspx?Table=authors&Field=au_lname&Record=<key+au_id="172-32-1176"+/>
|
||||
--%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>Export Field Value</title>
|
||||
<meta name='GENERATOR' content='Microsoft Visual Studio.NET 7.0' />
|
||||
<meta name='CODE_LANGUAGE' content='Visual Basic 7.0' />
|
||||
<meta name='vs_defaultClientScript' content='JavaScript' />
|
||||
<meta name='vs_targetSchema' content='http://schemas.microsoft.com/intellisense/ie5' />
|
||||
</head>
|
||||
<body>
|
||||
<form id='Form1' method='post' runat='server'>
|
||||
<BaseClasses:BasePageSettings id="PageSettings" runat="server"></BaseClasses:BasePageSettings>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
227
Shared/ExportFieldValue.aspx.vb
Normal file
227
Shared/ExportFieldValue.aspx.vb
Normal file
|
@ -0,0 +1,227 @@
|
|||
Imports BaseClasses
|
||||
Imports BaseClasses.Utils
|
||||
Imports BaseClasses.Data
|
||||
|
||||
Namespace Persons
|
||||
Partial Public Class ExportFieldValue
|
||||
Inherits Persons.UI.BaseApplicationPage
|
||||
|
||||
#Region " Generated Code for Web Form Designer "
|
||||
#Region " Web Form Designer Generated Code "
|
||||
|
||||
'This call is required by the Web Form Designer.
|
||||
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
|
||||
'CODEGEN: This method call is required by the Web Form Designer
|
||||
'Do not modify it using the code editor.
|
||||
InitializeComponent()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
#End Region
|
||||
|
||||
Private Const ASSEMBLY_NAME As String = "Persons.Business"
|
||||
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property FieldId() As String
|
||||
Get
|
||||
Return Me.Decrypt(Me.Request.Params.Item("Field"))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property FileName() As String
|
||||
Get
|
||||
Dim fn As String = Me.Request.Params.Item("FileName")
|
||||
Try
|
||||
' Try to decrypt
|
||||
Return Me.Decrypt(fn)
|
||||
Catch
|
||||
' For backward compatibility we support unencrypted version as well
|
||||
Return fn
|
||||
End Try
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property RecordId() As String
|
||||
Get
|
||||
Return Me.Decrypt(Me.Request.Params.Item("Record"))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property TableId() As String
|
||||
Get
|
||||
Dim tableName As String = Me.Request.Params.Item("Table")
|
||||
If String.IsNullOrEmpty(tableName) Then Return ""
|
||||
tableName = Me.Decrypt(tableName)
|
||||
Return tableName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Offset() As Integer
|
||||
Get
|
||||
If Not IsNothing(Me.Request.Params.Item("Offset")) Then
|
||||
Return CInt(Me.Request.Params.Item("Offset"))
|
||||
Else
|
||||
Return 0
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ImageHeight() As Integer
|
||||
Get
|
||||
If Not IsNothing(Me.Request.Params.Item("ImageHeight")) Then
|
||||
Return CInt(Me.Request.Params.Item("ImageHeight"))
|
||||
Else
|
||||
Return 0
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ImageWidth() As Integer
|
||||
Get
|
||||
If Not IsNothing(Me.Request.Params.Item("ImageWidth")) Then
|
||||
Return CInt(Me.Request.Params.Item("ImageWidth"))
|
||||
Else
|
||||
Return 0
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ImagePercentSize() As Double
|
||||
Get
|
||||
If Not IsNothing(Me.Request.Params.Item("ImagePercentSize")) Then
|
||||
Return CDbl(Me.Request.Params.Item("ImagePercentSize"))
|
||||
Else
|
||||
Return 0.0
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
' Handler for the Load event.
|
||||
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
'Validate the URL params
|
||||
If ((Len(BaseClasses.Utils.GetUrlParam(Me, "Table", True)) < 1) OrElse _
|
||||
(Len(BaseClasses.Utils.GetUrlParam(Me, "Record", True)) < 1) OrElse _
|
||||
(Len(BaseClasses.Utils.GetUrlParam(Me, "Field", True)) < 1) _
|
||||
) Then
|
||||
Return
|
||||
End If
|
||||
Me.DataBind() 'Always call DataBind, even on PostBacks.
|
||||
Me.ExportData() 'Then export the data
|
||||
End Sub
|
||||
|
||||
Protected Sub ExportData()
|
||||
If String.IsNullOrEmpty(Me.TableId) Then
|
||||
Return
|
||||
End If
|
||||
Try
|
||||
Dim t As PrimaryKeyTable = DirectCast(DatabaseObjects.GetTableObject(Me.TableId), PrimaryKeyTable)
|
||||
Dim rec As IRecord = t.GetRecordData(Me.RecordId, False)
|
||||
If (Me.ImagePercentSize <> 100.0 AndAlso Not (Me.ImagePercentSize = 0.0)) OrElse Not (Me.ImageHeight = 0 OrElse Me.ImageWidth = 0) Then
|
||||
' To display image with shrinking according to user specified height/width or ImagePercentSize
|
||||
Dim fieldData As ColumnValue = MiscUtils.GetData(rec, _
|
||||
t.TableDefinition.ColumnList.GetByAnyName(Me.FieldId) _
|
||||
)
|
||||
Dim binaryData() As Byte = MiscUtils.GetBinaryData(t.TableDefinition.ColumnList.GetByAnyName(Me.FieldId), _
|
||||
fieldData)
|
||||
If binaryData Is Nothing OrElse binaryData.Length = 0 Then
|
||||
RegisterJScriptAlert(Me, "No Content", "Field " & Me.FieldId & " does not contain any binary data.", False, True)
|
||||
Return
|
||||
End If
|
||||
Dim thumbNailSizeImage() As Byte = GetThumbNailSizeImage(binaryData)
|
||||
Dim filName As String = MiscUtils.GetFileNameWithExtension(t.TableDefinition.ColumnList.GetByAnyName(Me.FieldId), _
|
||||
binaryData, _
|
||||
Nothing)
|
||||
MiscUtils.SendToWriteResponse(Me.Response, _
|
||||
thumbNailSizeImage, _
|
||||
filName, _
|
||||
t.TableDefinition.ColumnList.GetByAnyName(Me.FieldId), _
|
||||
fieldData, _
|
||||
Me.Offset)
|
||||
Else
|
||||
'Calling ExportFieldData method without image shrinking.
|
||||
If Not MiscUtils.ExportFieldData( _
|
||||
Me.Response, _
|
||||
rec, _
|
||||
t.TableDefinition.ColumnList.GetByAnyName(Me.FieldId), _
|
||||
FileName, _
|
||||
Me.Offset) Then
|
||||
RegisterJScriptAlert(Me, "No Content", "Field " & Me.FieldId & " does not contain any binary data.", False, True)
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End Sub
|
||||
Protected Function GetThumbNailSizeImage(ByVal binaryData() As Byte) As Byte()
|
||||
Dim ThumbNailBinaryData() As Byte = Nothing
|
||||
Try
|
||||
Dim TempMemStream As New System.IO.MemoryStream(binaryData)
|
||||
Dim ImageObj As System.Drawing.Image
|
||||
Dim ThumbSizeImageObj As System.Drawing.Image
|
||||
ImageObj = System.Drawing.Image.FromStream(TempMemStream)
|
||||
Dim temHeight As Integer
|
||||
Dim temWidth As Integer
|
||||
temHeight = ImageObj.Height
|
||||
temWidth = ImageObj.Width
|
||||
Dim TempFileStream As New System.IO.MemoryStream
|
||||
'If Imagesize is less than 20*20 then return the original image
|
||||
If (temWidth < 20 And temHeight < 20) Then
|
||||
Dim ImageBinaryData() As Byte
|
||||
Try
|
||||
' load as raw format so that the image can have transparency is retained.
|
||||
ImageObj.Save(TempFileStream, ImageObj.RawFormat)
|
||||
Catch ex As Exception
|
||||
' if exception happens which can be for .ico, then load as jpeg but transparency cannot be retained.
|
||||
ImageObj.Save(TempFileStream, System.Drawing.Imaging.ImageFormat.Jpeg)
|
||||
End Try
|
||||
|
||||
ImageBinaryData = New Byte(CType(TempFileStream.Length, Integer)) {}
|
||||
ImageBinaryData = TempFileStream.ToArray()
|
||||
Return ImageBinaryData
|
||||
End If
|
||||
Dim ImagePercentSize As Double = Me.ImagePercentSize
|
||||
' If the ImagePercentSize is 0.2 then the actual percent calculation will result in generating
|
||||
' temHeight and temWidth as Zero. When the height and width is zero, GetThumbnailImage()
|
||||
' will generate image of arbitrary size. Hence the image will not display as predicted,
|
||||
' ie, with size 0.2%. For this purpose, to maintain consistant image size, when ImagePercentSize
|
||||
' is less than 1, it is taken as actual percentage for eg. when ImagePercentSize is 0.2, it is considered as 20%
|
||||
' and image will displayed with 20% of original size.
|
||||
If (Me.ImagePercentSize <= 1) Then
|
||||
ImagePercentSize = Me.ImagePercentSize * 100
|
||||
End If
|
||||
'Actual percentage calculation. as ImagePercentSize value provided by client is a number not a percent
|
||||
ImagePercentSize = ImagePercentSize / 100
|
||||
temHeight = CInt(ImagePercentSize * temHeight)
|
||||
temWidth = CInt(ImagePercentSize * temWidth)
|
||||
'Create thumbnail size of the original Image ImageObj
|
||||
If (Me.ImagePercentSize = 0.0) Then
|
||||
ThumbSizeImageObj = ImageObj.GetThumbnailImage(Me.ImageWidth, Me.ImageHeight, Nothing, IntPtr.Zero)
|
||||
Else
|
||||
ThumbSizeImageObj = ImageObj.GetThumbnailImage(temWidth, temHeight, Nothing, IntPtr.Zero)
|
||||
End If
|
||||
Try
|
||||
' load as raw format so that the image can have transparency is retained.
|
||||
ThumbSizeImageObj.Save(TempFileStream, ImageObj.RawFormat)
|
||||
Catch ex As Exception
|
||||
' if exception happens which can be for .ico, then load as jpeg but transparency cannot be retained.
|
||||
ThumbSizeImageObj.Save(TempFileStream, System.Drawing.Imaging.ImageFormat.Jpeg)
|
||||
End Try
|
||||
|
||||
ThumbNailBinaryData = New Byte(CType(TempFileStream.Length, Integer)) {}
|
||||
ThumbNailBinaryData = TempFileStream.ToArray()
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
Return ThumbNailBinaryData
|
||||
End Function
|
||||
'Since this is a "utility" page, do not log requests for it in the Session's Navigation History
|
||||
Protected Overrides Sub UpdateSessionNavigationHistory()
|
||||
'Do Nothing
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
|
80
Shared/Forbidden.aspx
Normal file
80
Shared/Forbidden.aspx
Normal file
|
@ -0,0 +1,80 @@
|
|||
<%@ Page Language="vb" AutoEventWireup="true" EnableEventValidation="false" Codefile="Forbidden.aspx.vb" Inherits="Persons.UI.Forbidden" %>
|
||||
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>Forbidden</title>
|
||||
</head>
|
||||
<body class="pBack">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pWrapper">
|
||||
<tr>
|
||||
<td class="panelTL">
|
||||
<img src="../Images/space.gif" class="panelTLSpace" alt="" /></td>
|
||||
<td class="panelT">
|
||||
<img src="../Images/space.gif" class="panelTSpace" alt="" /></td>
|
||||
<td class="panelTR">
|
||||
<img src="../Images/space.gif" class="panelTRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelL">
|
||||
<img src="../Images/space.gif" class="panelLSpace" alt="" /></td>
|
||||
<td class="panelC">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pContent">
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"
|
||||
width="100%" id="AutoNumber1">
|
||||
<tr>
|
||||
<td class="dialog_header" colspan="3">
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="dialogHeaderEdgeL">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
<td class="dhb">
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td class="dialog_header_text">
|
||||
Forbidden</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="dialogHeaderEdgeR">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
<td class="configureErrorPagesText">
|
||||
<br />
|
||||
<asp:Literal ID="ForbiddenText1" runat="server" Text='<%# GetResourceValue("Txt:ForbiddenLine1") %>' /><br />
|
||||
<br />
|
||||
<asp:Literal ID="ForbiddenText2" runat="server" Text='<%# GetResourceValue("Txt:ForbiddenLine2") %>' /><br />
|
||||
<br />
|
||||
</td>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="panelR">
|
||||
<img src="../Images/space.gif" class="panelRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelBL">
|
||||
<img src="../Images/space.gif" class="panelBLSpace" alt="" /></td>
|
||||
<td class="panelB">
|
||||
<img src="../Images/space.gif" class="panelBSpace" alt="" /></td>
|
||||
<td class="panelBR">
|
||||
<img src="../Images/space.gif" class="panelBRSpace" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
70
Shared/Forbidden.aspx.vb
Normal file
70
Shared/Forbidden.aspx.vb
Normal file
|
@ -0,0 +1,70 @@
|
|||
Namespace Persons.UI
|
||||
|
||||
' Code-behind class for the Forbidden page.
|
||||
' Place your customizations in Section 1. Do not modify Section 2.
|
||||
Partial Public Class Forbidden
|
||||
Inherits BaseApplicationPage
|
||||
|
||||
|
||||
#Region "Section 1: Place your customizations here."
|
||||
Public Sub New()
|
||||
Me.IsUpdatesSessionNavigationHistory = False
|
||||
End Sub
|
||||
|
||||
' LoadData reads database data and assigns it to UI controls.
|
||||
' Customize by adding code before or after the call to LoadData_Base()
|
||||
' or replace the call to LoadData_Base().
|
||||
Public Sub LoadData()
|
||||
LoadData_Base()
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
|
||||
'Override call to PreInit_Base() here to change top level master page used by this page, for example uncomment
|
||||
'next line to use Microsoft SharePoint default master page
|
||||
'If Not Me.Master Is Nothing Then Me.Master.MasterPageFile = Microsoft.SharePoint.SPContext.Current.Web.MasterUrl
|
||||
'You may change here assignment of application theme
|
||||
Me.PreInit_Base()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "Section 2: Do not modify this section."
|
||||
|
||||
' Handles MyBase.Load. If you need to, you can add additional Load handlers in Section 1.
|
||||
' Read database data and put into the UI controls.
|
||||
Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
' Load data only when displaying the page for the first time
|
||||
If (Not Me.IsPostBack) Then
|
||||
|
||||
' Read the data for all controls on the page.
|
||||
' To change the behavior, override the DataBind method for the individual
|
||||
' record or table UI controls.
|
||||
Me.LoadData()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
' Load data from database into UI controls.
|
||||
' Modify LoadData in Section 1 above to customize. Or override DataBind() in
|
||||
' the individual table and record controls to customize.
|
||||
Public Sub LoadData_Base()
|
||||
Me.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub UpdateSessionNavigationHistory()
|
||||
'Do nothing
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub PreInit_Base()
|
||||
'If it is SharePoint application this function performs dynamic Master Page assignment.
|
||||
'If application uses multi-color theme this function performs dynamic theme assignment.
|
||||
'This is multi-color theme, so assign proper theme
|
||||
Dim selectedTheme As String = Me.GetSelectedTheme()
|
||||
If Not String.IsNullOrEmpty(selectedTheme) Then Me.Page.Theme = selectedTheme
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
30
Shared/ForbiddenMobile.aspx
Normal file
30
Shared/ForbiddenMobile.aspx
Normal file
|
@ -0,0 +1,30 @@
|
|||
<%@ Page Language="vb" AutoEventWireup="true" EnableEventValidation="false" Codefile="ForbiddenMobile.aspx.vb" Inherits="Persons.UI.ForbiddenMobile" %>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>Forbidden</title>
|
||||
</head>
|
||||
<body style="margin: 0px; padding: 0px;">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="mobileBase">
|
||||
<tr>
|
||||
<td class="mobileHeader">
|
||||
<table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
|
||||
<tr>
|
||||
<td class="mobileHeaderLeft"> </td>
|
||||
<td class="mobileHeaderTitle" style="padding-top: 0px;">Forbidden</td>
|
||||
<td class="mobileHeaderOption"> </td>
|
||||
<td class="mobileHeaderRight"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="mobileBody">
|
||||
<br />
|
||||
<asp:Literal id="ForbiddenText1" runat="server" Text='<%# GetResourceValue("Txt:ForbiddenLine1") %>'/><br /><br />
|
||||
<asp:Literal id="ForbiddenText2" runat="server" Text='<%# GetResourceValue("Txt:ForbiddenLine2") %>'/><br /><br />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
70
Shared/ForbiddenMobile.aspx.vb
Normal file
70
Shared/ForbiddenMobile.aspx.vb
Normal file
|
@ -0,0 +1,70 @@
|
|||
Namespace Persons.UI
|
||||
|
||||
' Code-behind class for the Forbidden page.
|
||||
' Place your customizations in Section 1. Do not modify Section 2.
|
||||
Partial Public Class ForbiddenMobile
|
||||
Inherits BaseApplicationPage
|
||||
|
||||
|
||||
#Region "Section 1: Place your customizations here."
|
||||
Public Sub New()
|
||||
Me.IsUpdatesSessionNavigationHistory = False
|
||||
End Sub
|
||||
|
||||
' LoadData reads database data and assigns it to UI controls.
|
||||
' Customize by adding code before or after the call to LoadData_Base()
|
||||
' or replace the call to LoadData_Base().
|
||||
Public Sub LoadData()
|
||||
LoadData_Base()
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
|
||||
'Override call to PreInit_Base() here to change top level master page used by this page, for example uncomment
|
||||
'next line to use Microsoft SharePoint default master page
|
||||
'If Not Me.Master Is Nothing Then Me.Master.MasterPageFile = Microsoft.SharePoint.SPContext.Current.Web.MasterUrl
|
||||
'You may change here assignment of application theme
|
||||
Me.PreInit_Base()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "Section 2: Do not modify this section."
|
||||
|
||||
' Handles MyBase.Load. If you need to, you can add additional Load handlers in Section 1.
|
||||
' Read database data and put into the UI controls.
|
||||
Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
' Load data only when displaying the page for the first time
|
||||
If (Not Me.IsPostBack) Then
|
||||
|
||||
' Read the data for all controls on the page.
|
||||
' To change the behavior, override the DataBind method for the individual
|
||||
' record or table UI controls.
|
||||
Me.LoadData()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
' Load data from database into UI controls.
|
||||
' Modify LoadData in Section 1 above to customize. Or override DataBind() in
|
||||
' the individual table and record controls to customize.
|
||||
Public Sub LoadData_Base()
|
||||
Me.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub UpdateSessionNavigationHistory()
|
||||
'Do nothing
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub PreInit_Base()
|
||||
'If it is SharePoint application this function performs dynamic Master Page assignment.
|
||||
'If application uses multi-color theme this function performs dynamic theme assignment.
|
||||
'This is multi-color theme, so assign proper theme
|
||||
Dim selectedTheme As String = Me.GetSelectedTheme()
|
||||
If Not String.IsNullOrEmpty(selectedTheme) Then Me.Page.Theme = selectedTheme
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
78
Shared/ImportData.aspx
Normal file
78
Shared/ImportData.aspx
Normal file
|
@ -0,0 +1,78 @@
|
|||
<%@ Register Tagprefix="Persons" TagName="ThemeButton" Src="../Shared/ThemeButton.ascx" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Page Language="VB" EnableEventValidation="false" AutoEventWireup="false" Codefile="ImportData.aspx.vb" Inherits="Persons.UI.ImportData" %>
|
||||
<%@ Register Tagprefix="Selectors" Namespace="Persons" %>
|
||||
<%@ Register Tagprefix="BaseClasses" Namespace="BaseClasses.Web.UI.WebControls" Assembly="BaseClasses" %>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head id="Head1" runat="server">
|
||||
<title>ImportData</title>
|
||||
<base target="_self" />
|
||||
</head>
|
||||
<body id="Body1" runat="server" class="importWizardpBack">
|
||||
<form id="Form1" method="post" runat="server"><BaseClasses:ScrollCoordinates id="ScrollCoordinates" runat="server"></BaseClasses:ScrollCoordinates>
|
||||
<BaseClasses:BasePageSettings id="PageSettings" runat="server"></BaseClasses:BasePageSettings>
|
||||
<script language="JavaScript" type="text/javascript">clearRTL()</script>
|
||||
<script language='javascript' type='text/javascript'>function CloseWindow(msg,msg2){ alert(msg.concat("\r\n",msg2));window.opener.__doPostBack('ChildWindowPostBack', ''); window.opener.focus();window.close();}</script>
|
||||
<asp:ScriptManager ID="scriptManager1" runat="server" EnablePartialRendering="True" EnablePageMethods="True" />
|
||||
|
||||
<div id="detailPopup" class="detailRolloverPopup" onmouseout="detailRolloverPopupClose();" onmouseover="clearTimeout(gPopupTimer);"></div>
|
||||
<table cellpadding="0" cellspacing="0" border="0"><tr>
|
||||
<td class="importWizardmarginTL"></td>
|
||||
<td class="importWizardpcT"></td>
|
||||
<td class="importWizardmarginTR"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="importWizardmarginL"></td>
|
||||
<td class="importWizardpcC">
|
||||
<table class="importWizarddv" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td class="importWizarddBody" style="width:100%; height:100%">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="tableCellValue"><asp:Literal id="ImportSelectColumns" runat="server" Text='<%# GetResourceValue("Txt:ImportSelectColumns") %>'/>
|
||||
<%-- Select and assign the data columns you wish to import.--%>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableCellValue"><asp:checkbox id="ImportFirstRowCheckBox" runat="server" Text=""/>
|
||||
|
||||
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td class="tableCellValue"><asp:checkbox id="ImportResolveForeignKeys" runat="server" Text=""/>
|
||||
|
||||
|
||||
</td></tr>
|
||||
<tr><td class="tableCellValue">
|
||||
<asp:Table id="DisplayTable" runat="server" CellSpacing="0" CellPadding="3" GridLines="Both" BorderStyle="Solid" BorderWidth="1" CssClass="ttc">
|
||||
</asp:Table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td><Persons:ThemeButton runat="server" id="PreviousButton" Button-Text="<%# GetResourceValue("Import:Previous") %>" Button-ToolTip="<%# GetResourceValue("Import:Previous", "Persons") %>">
|
||||
</Persons:ThemeButton></td>
|
||||
<td><Persons:ThemeButton runat="server" id="ImportButton" Button-Text="<%# GetResourceValue("Import:Import") %>" Button-ToolTip="<%# GetResourceValue("Import:Import", "Persons") %>">
|
||||
</Persons:ThemeButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="importWizardmarginR"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="importWizardmarginBL"></td>
|
||||
<td class="importWizardpcB"></td>
|
||||
<td class="importWizardmarginBR"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:ValidationSummary id="ValidationSummary1" ShowMessageBox="true" ShowSummary="false" runat="server"></asp:ValidationSummary></form>
|
||||
</body>
|
||||
</html>
|
613
Shared/ImportData.aspx.vb
Normal file
613
Shared/ImportData.aspx.vb
Normal file
|
@ -0,0 +1,613 @@
|
|||
' This file implements the code-behind class for ImportData.aspx.
|
||||
|
||||
#region"Imports statements"
|
||||
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Collections
|
||||
Imports System.ComponentModel
|
||||
Imports System.Web
|
||||
Imports System.Web.UI
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports BaseClasses
|
||||
Imports BaseClasses.Utils
|
||||
Imports BaseClasses.Data
|
||||
Imports BaseClasses.Data.SqlProvider
|
||||
Imports BaseClasses.Web.UI.WebControls
|
||||
|
||||
Imports Persons.Business
|
||||
Imports Persons.Data
|
||||
|
||||
Imports System.Text
|
||||
Imports System.IO
|
||||
|
||||
|
||||
|
||||
#end region
|
||||
|
||||
Namespace Persons.UI
|
||||
|
||||
|
||||
Partial Public Class ImportData
|
||||
Inherits BaseApplicationPage
|
||||
|
||||
#Region "Section 1: Place your customizations here."
|
||||
' Code-behind class for the ImportData page.
|
||||
' Place your customizations in Section 1. Do not modify Section 2.
|
||||
Private Const MAXIMUMCHAR As Integer = 100
|
||||
Private Const CHARLIMIT As Integer = 2000
|
||||
Private Const ENDING As String = "..."
|
||||
Private Const SKIPTHRESHOLD As Integer = 25
|
||||
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
Me.Initialize()
|
||||
AddHandler Init, AddressOf Me.MyInit
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property AppName() As String
|
||||
Get
|
||||
Return BaseClasses.Configuration.ApplicationSettings.Current.GetAppSetting(BaseClasses.Configuration.ApplicationSettings.ConfigurationKey.ApplicationName)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property TableName() As String
|
||||
Get
|
||||
Return Me.Decrypt(BaseClasses.Utils.NetUtils.GetUrlParam(Me, "TableName", True))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property FilePath() As String
|
||||
Get
|
||||
Return CType(Session("FilePath"), String)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub LoadData()
|
||||
' LoadData reads database data and assigns it to UI controls.
|
||||
' Customize by adding code before or after the call to LoadData_Base()
|
||||
' or replace the call to LoadData_Base().
|
||||
LoadData_Base()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
|
||||
Me.Page_PreInit_Base()
|
||||
End Sub
|
||||
|
||||
<System.Web.Services.WebMethod()> _
|
||||
Public Shared Function GetRecordFieldValue(ByVal tableName As String, ByVal recordID As String, ByVal columnName As String, ByVal title As String, ByVal persist As Boolean, ByVal popupWindowHeight As Integer, ByVal popupWindowWidth As Integer, ByVal popupWindowScrollBar As Boolean) As Object()
|
||||
' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' or replace the call to GetRecordFieldValue_Base().
|
||||
Return GetRecordFieldValue_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
<System.Web.Services.WebMethod()> _
|
||||
Public Shared Function GetImage(ByVal tableName As String, ByVal recordID As String, ByVal columnName As String, ByVal title As String, ByVal persist As Boolean, ByVal popupWindowHeight As Integer, ByVal popupWindowWidth As Integer, ByVal popupWindowScrollBar As Boolean) As Object()
|
||||
' GetImage gets the Image url for the image in the column "columnName" and
|
||||
' in the record specified by recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetImage_Base()
|
||||
' or replace the call to GetImage_Base().
|
||||
Return GetImage_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
Private Sub MyInit(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
If Not (Session("FilePath") Is Nothing) Then
|
||||
' Retrieve information from session.
|
||||
Dim updatedRecordID As String = CType(Session("FilePath"), String)
|
||||
ParseCSVFile()
|
||||
End If
|
||||
Me.Page.Title = Me.GetResourceValue("Import:Step2", Me.AppName)
|
||||
Me.ImportFirstRowCheckBox.Checked = True
|
||||
Me.ImportResolveForeignKeys.Checked = True
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub PreviousButton_Click(ByVal sender As Object, ByVal args As EventArgs)
|
||||
' Click handler for PreviousButton.
|
||||
' Customize by adding code before the call or replace the call to the Base function with your own code.
|
||||
'PreviousButton_Click_Base(sender, args);
|
||||
If (File.Exists(Me.FilePath)) Then
|
||||
File.Delete(Me.FilePath)
|
||||
End If
|
||||
Me.Page.Response.Redirect(("SelectFileToImport.aspx?TableName=" + Me.Encrypt(Me.TableName)))
|
||||
' pass the table name as it is, without decryption.
|
||||
' NOTE: If the Base function redirects to another page, any code here will not be executed.
|
||||
End Sub
|
||||
|
||||
'This is the Import button click
|
||||
Public Sub ImportButton_Click(ByVal sender As Object, ByVal args As EventArgs)
|
||||
' Click handler for ImportButton.
|
||||
' Customize by adding code before the call or replace the call to the Base function with your own code.
|
||||
'ImportButton_Click_Base(sender, args);
|
||||
ImportButton_Click_Base(sender, args)
|
||||
End Sub
|
||||
|
||||
|
||||
Public Function GetTable() As BaseClasses.Data.BaseTable
|
||||
Try
|
||||
Return DatabaseObjects.GetTableObject(Me.TableName)
|
||||
Catch ex As System.Exception
|
||||
Return DatabaseObjects.GetTableObject(Me.TableName)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Section 2: Do not modify this section."
|
||||
|
||||
Private Sub Initialize()
|
||||
' Called by the class constructor to initialize event handlers for Init and Load
|
||||
' You can customize by modifying the constructor in Section 1.
|
||||
AddHandler Init, AddressOf Me.Page_InitializeEventHandlers
|
||||
AddHandler Load, AddressOf Me.Page_Load
|
||||
End Sub
|
||||
|
||||
' Handles base.Init. Registers event handler for any button, sort or links.
|
||||
' You can add additional Init handlers in Section 1.
|
||||
Protected Overridable Sub Page_InitializeEventHandlers(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
' Register the Event handler for any Events.
|
||||
AddHandler ImportButton.Button.Click, AddressOf Me.ImportButton_Click
|
||||
AddHandler PreviousButton.Button.Click, AddressOf Me.PreviousButton_Click
|
||||
End Sub
|
||||
|
||||
Protected Sub Page_PreInit_Base()
|
||||
'If this is multi-color theme assign proper theme
|
||||
Dim selectedTheme As String = Me.GetSelectedTheme()
|
||||
If Not String.IsNullOrEmpty(selectedTheme) Then Me.Page.Theme = selectedTheme
|
||||
End Sub
|
||||
|
||||
' Handles base.Load. Read database data and put into the UI controls.
|
||||
' You can add additional Load handlers in Section 1.
|
||||
Protected Overridable Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
|
||||
' Check if user has access to this page. Redirects to either sign-in page
|
||||
' or 'no access' page if not. Does not do anything if role-based security
|
||||
' is not turned on, but you can override to add your own security.
|
||||
Me.Authorize(Me.GetAuthorizedRoles)
|
||||
' Load data only when displaying the page for the first time
|
||||
If Not Me.IsPostBack Then
|
||||
' Setup the header text for the validation summary control.
|
||||
Me.ValidationSummary1.HeaderText = GetResourceValue("ValidationSummaryHeaderText", Me.AppName)
|
||||
' Show message on Click
|
||||
|
||||
' Read the data for all controls on the page.
|
||||
' To change the behavior, override the DataBind method for the individual
|
||||
' record or table UI controls.
|
||||
Me.LoadData()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetRecordFieldValue_Base(ByVal tableName As String, ByVal recordID As String, ByVal columnName As String, ByVal title As String, ByVal persist As Boolean, ByVal popupWindowHeight As Integer, ByVal popupWindowWidth As Integer, ByVal popupWindowScrollBar As Boolean) As Object()
|
||||
Dim content As String = NetUtils.EncodeStringForHtmlDisplay(BaseClasses.Utils.MiscUtils.GetFieldData(tableName, recordID, columnName))
|
||||
' returnValue is an array of string values.
|
||||
' returnValue(0) represents title of the pop up window.
|
||||
' returnValue(1) represents content ie, image url.
|
||||
' returnValue(2) represents whether pop up window should be made persistant
|
||||
' or it should close as soon as mouse moves out.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' (0),(2),(3) and (4) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue() As Object = New Object((6) - 1) {}
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
Public Shared Function GetImage_Base(ByVal tableName As String, ByVal recordID As String, ByVal columnName As String, ByVal title As String, ByVal persist As Boolean, ByVal popupWindowHeight As Integer, ByVal popupWindowWidth As Integer, ByVal popupWindowScrollBar As Boolean) As Object()
|
||||
Dim content As String = ("<IMG alt =\""" + title + "\"" src =" + ("\""../Shared/ExportFieldValue.aspx?Table=" _
|
||||
+ (tableName + ("&Field=" _
|
||||
+ (columnName + ("&Record=" _
|
||||
+ (recordID + "\""/>")))))))
|
||||
' returnValue is an array of string values.
|
||||
' returnValue(0) represents title of the pop up window.
|
||||
' returnValue(1) represents content ie, image url.
|
||||
' returnValue(2) represents whether pop up window should be made persistant
|
||||
' or it should close as soon as mouse moves out.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' (0),(2),(3), (4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue() As Object = New Object((6) - 1) {}
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
' Load data from database into UI controls.
|
||||
' Modify LoadData in Section 1 above to customize. Or override DataBind() in
|
||||
' the individual table and record controls to customize.
|
||||
Public Sub LoadData_Base()
|
||||
Me.ImportFirstRowCheckBox.Text = GetResourceValue("Import:FirstRowText", Me.AppName)
|
||||
Me.ImportResolveForeignKeys.Text = GetResourceValue("Import:ResolveForeignKeys", Me.AppName)
|
||||
Me.DataBind()
|
||||
End Sub
|
||||
|
||||
' Write out event methods for the page events
|
||||
' event handler for Button with Layout
|
||||
Public Sub ImportButton_Click_Base(ByVal sender As Object, ByVal args As EventArgs)
|
||||
Dim bt As BaseTable = Me.GetTable
|
||||
Dim success As Boolean = False
|
||||
Dim recordsImported As BaseClasses.Utils.ImportedResults = Nothing
|
||||
Try
|
||||
' Get the column names list and importChkBox list.
|
||||
Dim disp As Table = CType(Me.Page.FindControl("DisplayTable"), Table)
|
||||
Dim cellcount As Integer = disp.Rows(0).Cells.Count
|
||||
Dim ddListSelected As ArrayList = New ArrayList
|
||||
Dim chkBoxList As ArrayList = New ArrayList
|
||||
Dim rc As Integer = 0
|
||||
Do While (rc _
|
||||
< (cellcount - 1))
|
||||
Dim dd As DropDownList = CType(disp.FindControl(("dropDownList" & rc)), DropDownList)
|
||||
If ddListSelected.Contains(dd.SelectedValue) AndAlso dd.SelectedValue <> "" Then
|
||||
MiscUtils.RegisterJScriptAlert(Me, "Duplicate Column", Me.GetResourceValue("Import:DuplicateColumn", Me.AppName).Replace("{ColumnName}", dd.SelectedValue))
|
||||
Return
|
||||
End If
|
||||
ddListSelected.Add(dd.SelectedValue)
|
||||
Dim chkBox As CheckBox = CType(disp.FindControl(("importChkBox" & rc)), CheckBox)
|
||||
chkBoxList.Add(chkBox)
|
||||
'Store the index of the column which matches with the column name selected in the ColumnList drop down list.
|
||||
' This will be used later to updated a row based on this index
|
||||
'if (dd.SelectedValue == this.ColumnsList.SelectedValue)
|
||||
' columnIndex = rc;
|
||||
rc = (rc + 1)
|
||||
Loop
|
||||
' Validate selected columns.
|
||||
If Not validateColumns(ddListSelected, chkBoxList, bt) Then
|
||||
Return
|
||||
End If
|
||||
Dim imp As ImportDataItems = New ImportDataItems(Me.FilePath, GetFileType(), bt, ddListSelected, chkBoxList)
|
||||
recordsImported = imp.ImportRecords(Me.ImportFirstRowCheckBox.Checked, Me.ImportResolveForeignKeys.Checked)
|
||||
Catch e As Exception
|
||||
ScriptManager.RegisterStartupScript(Me.Page, Page.GetType, "ErrorMsg", ("alert(" _
|
||||
& (BaseClasses.Web.AspxTextWriter.CreateJScriptStringLiteral(e.Message) & ");")), True)
|
||||
End Try
|
||||
If recordsImported Is Nothing Then recordsImported = New BaseClasses.Utils.ImportedResults
|
||||
Dim script As String = Me.ConstructScriptForSkippedRecords(recordsImported)
|
||||
If script.Contains("<script>") Then
|
||||
ClientScript.RegisterStartupScript(Page.GetType(), "CloseWindow", script)
|
||||
Else
|
||||
WriteTextFileForSkippedRecords(script)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ConstructScriptForSkippedRecords(ByVal recordsImported As BaseClasses.Utils.ImportedResults) As String
|
||||
Dim msg As String = Me.GetResourceValue("Import:Success", Me.AppName).Replace("{Records}", recordsImported.NumberOfImported.ToString()) 'NumberOfRecordImported(0).ToString())
|
||||
Dim msg2 As String = Me.GetResourceValue("Import:Skipped", Me.AppName).Replace("{Records}", recordsImported.NumberOfSkipped.ToString()) 'NumberOfRecordImported(1).ToString())
|
||||
Dim script As String = ""
|
||||
Dim symbolsCount As Integer = 0
|
||||
script &= "<script>"
|
||||
If recordsImported.NumberOfSkipped > 0 Then
|
||||
script &= "CloseWindow('" & msg & "','" & msg2
|
||||
|
||||
Dim msg3 As String = Me.GetResourceValue("Import:FirstSkippedRecords", Me.AppName) '"Skipped Records (Line number: record):"
|
||||
|
||||
symbolsCount += msg.Length + msg2.Length + msg3.Length
|
||||
|
||||
Dim linesMsg As String = ""
|
||||
Dim index As Integer = 0
|
||||
For Each rec As BaseClasses.Utils.SkippedLine In recordsImported.ListOfSkipped
|
||||
Dim newLineEntry As String = ""
|
||||
If recordsImported.NumberOfSkipped >= SKIPTHRESHOLD OrElse (recordsImported.NumberOfSkipped > 0 AndAlso recordsImported.NumberOfImported > 0) Then
|
||||
newLineEntry = Me.ConstructLineEntryForTextFile(rec, MAXIMUMCHAR)
|
||||
Else
|
||||
newLineEntry = Me.ConstructLineEntry(rec, MAXIMUMCHAR)
|
||||
End If
|
||||
If newLineEntry.Length + symbolsCount < CHARLIMIT Then
|
||||
linesMsg &= newLineEntry
|
||||
symbolsCount += newLineEntry.Length
|
||||
index += 1
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If index < recordsImported.ListOfSkipped.Count Then
|
||||
msg3 = Me.GetResourceValue("Import:FirstSkippedRecords", Me.AppName).Replace("{Number}", index.ToString)
|
||||
Else
|
||||
msg3 = Me.GetResourceValue("Import:SkippedRecords", Me.AppName)
|
||||
End If
|
||||
If recordsImported.NumberOfSkipped >= SKIPTHRESHOLD OrElse (recordsImported.NumberOfSkipped > 0 AndAlso recordsImported.NumberOfImported > 0) Then
|
||||
script = ""
|
||||
If recordsImported.NumberOfImported > 0 Then
|
||||
script &= msg & vbCrLf
|
||||
End If
|
||||
script &= msg3 & vbCrLf
|
||||
script &= linesMsg
|
||||
Return script
|
||||
Else
|
||||
script &= "\n" & "\n" & msg3
|
||||
script &= linesMsg
|
||||
script &= "');"
|
||||
End If
|
||||
Else
|
||||
script &= "CloseWindow('" & msg & "','" & msg2 & "');"
|
||||
End If
|
||||
script &= "</" + "script>"
|
||||
Return script
|
||||
End Function
|
||||
|
||||
Private Function ConstructLineEntry(ByVal skippedLine As BaseClasses.Utils.SkippedLine, ByVal maximumChar As Integer) As String
|
||||
Dim result As String = ""
|
||||
Try
|
||||
result &= "\n\n" & Me.GetResourceValue("Import:LineNumber", Me.AppName).Replace("{Number}", skippedLine.LineNumber.ToString)
|
||||
Dim truncatedContent As String = skippedLine.LineContent.Replace("'", "\'")
|
||||
If truncatedContent.Length > maximumChar Then
|
||||
truncatedContent = truncatedContent.Substring(0, maximumChar - 3) & ENDING
|
||||
End If
|
||||
result &= " " & truncatedContent
|
||||
If skippedLine.ErrorMessage.Trim <> "" Then
|
||||
result &= "\n" & Me.GetResourceValue("Import:ErrorMessage", Me.AppName) & " " & skippedLine.ErrorMessage
|
||||
End If
|
||||
Catch
|
||||
Return ""
|
||||
End Try
|
||||
|
||||
Return result
|
||||
End Function
|
||||
Private Function ConstructLineEntryForTextFile(ByVal skippedLine As BaseClasses.Utils.SkippedLine, ByVal maximumChar As Integer) As String
|
||||
Dim result As String = ""
|
||||
Try
|
||||
result &= Me.GetResourceValue("Import:LineNumber", Me.AppName).Replace("{Number}", skippedLine.LineNumber.ToString)
|
||||
Dim truncatedContent As String = skippedLine.LineContent.Replace("'", "\'")
|
||||
If truncatedContent.Length > maximumChar Then
|
||||
truncatedContent = " " & truncatedContent.Substring(0, maximumChar - 3) & ENDING
|
||||
End If
|
||||
result &= " " & truncatedContent & vbCrLf
|
||||
If skippedLine.ErrorMessage.Trim <> "" Then
|
||||
result &= " " & Me.GetResourceValue("Import:ErrorMessage", Me.AppName) & " " & skippedLine.ErrorMessage & vbCrLf
|
||||
End If
|
||||
Catch
|
||||
Return ""
|
||||
End Try
|
||||
|
||||
Return result
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub WriteTextFileForSkippedRecords(ByVal script As String)
|
||||
Dim name As String = Me.GetResourceValue("Import:SkippedRecords", Me.AppName)
|
||||
If name.Contains(":") Then
|
||||
name.Replace(":", "")
|
||||
name.Trim()
|
||||
End If
|
||||
Dim fileName As String = name & ".txt"
|
||||
SetupResponse(Response, fileName)
|
||||
Response.ContentType = "text/plain"
|
||||
Dim Writer As StreamWriter = New StreamWriter(Response.OutputStream, System.Text.Encoding.UTF8)
|
||||
Writer.Write(script)
|
||||
Writer.Flush()
|
||||
Response.End()
|
||||
End Sub
|
||||
|
||||
Public Sub SetupResponse(ByVal response As System.Web.HttpResponse, ByVal fileName As String)
|
||||
response.ClearHeaders()
|
||||
response.Clear()
|
||||
response.Cache.SetCacheability(System.Web.HttpCacheability.[Private])
|
||||
response.Cache.SetMaxAge(New TimeSpan(0))
|
||||
response.Cache.SetExpires(New DateTime(0))
|
||||
response.Cache.SetNoServerCaching()
|
||||
response.AppendHeader("Content-Disposition", ("attachment; filename=""" & (fileName & """")))
|
||||
End Sub
|
||||
|
||||
' event handler for Button with Layout
|
||||
Public Sub PreviousButton_Click_Base(ByVal sender As Object, ByVal args As EventArgs)
|
||||
Try
|
||||
|
||||
Catch ex As Exception
|
||||
Me.ErrorOnPage = True
|
||||
BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", ex.Message)
|
||||
Finally
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
''' <summary>
|
||||
''' Parses CSV file and retrieves five rows and populates ASP DataTable.
|
||||
''' </summary>
|
||||
Public Sub ParseCSVFile()
|
||||
If File.Exists(Me.FilePath) Then
|
||||
Dim bt As BaseTable = Me.GetTable
|
||||
Dim td As TableDefinition = Nothing
|
||||
If (Not (bt) Is Nothing) Then
|
||||
td = bt.TableDefinition
|
||||
End If
|
||||
Try
|
||||
Dim parser As Parser = parser.GetParser(Me.FilePath, GetFileType())
|
||||
'new CsvParser(path);
|
||||
Dim checkboxChecked As String = CType(Session("checked"), String)
|
||||
Dim columnListAspTableRow As TableRow = New TableRow
|
||||
Dim columnAspTableRow As TableRow = New TableRow
|
||||
Dim importAspTableRow As TableRow = New TableRow
|
||||
' Add first row with header label
|
||||
Dim columnHeaderTableCell As TableCell = New TableCell
|
||||
Dim importHeaderTableCell As TableCell = New TableCell
|
||||
Dim columnListHeaderTableCell As TableCell = New TableCell
|
||||
Dim columnHeaderLabel As Label = New Label
|
||||
columnHeaderLabel.ID = "columnLabelHeader"
|
||||
columnHeaderLabel.Text = GetResourceValue("Import:Column", Me.AppName) 'Column
|
||||
|
||||
Dim importLabel As Label = New Label
|
||||
importLabel.ID = "importLabelHeader"
|
||||
importLabel.Text = GetResourceValue("Import:Import", Me.AppName) 'Import
|
||||
|
||||
Dim columnListLabel As Label = New Label
|
||||
columnListLabel.ID = "columnListLabelHeader"
|
||||
'"Column names list"
|
||||
columnListLabel.Text = GetResourceValue("Import:ColumnNames", Me.AppName)
|
||||
columnHeaderTableCell.Controls.Add(columnHeaderLabel)
|
||||
columnAspTableRow.Cells.Add(columnHeaderTableCell)
|
||||
importHeaderTableCell.Controls.Add(importLabel)
|
||||
importAspTableRow.Cells.Add(importHeaderTableCell)
|
||||
columnListHeaderTableCell.Controls.Add(columnListLabel)
|
||||
columnListHeaderTableCell.Wrap = False
|
||||
columnListAspTableRow.Cells.Add(columnListHeaderTableCell)
|
||||
DisplayTable.Rows.Add(columnAspTableRow)
|
||||
DisplayTable.Rows.Add(importAspTableRow)
|
||||
DisplayTable.Rows.Add(columnListAspTableRow)
|
||||
Dim rowIndex As Integer = 0
|
||||
Dim i As Integer = 0
|
||||
|
||||
' Read 5 rows from csv file and display them in a Data Table.
|
||||
|
||||
While (rowIndex < 5)
|
||||
Dim collValues() As String = parser.GetNextRow()
|
||||
If collValues Is Nothing Then
|
||||
parser.Close()
|
||||
Return
|
||||
End If
|
||||
If collValues(0) Is Nothing Then
|
||||
Continue While
|
||||
End If
|
||||
'Create column names dropdownList, import checkbox and Columns header
|
||||
If (rowIndex = 0) Then
|
||||
|
||||
For Each value As String In collValues
|
||||
Dim aspTableCell As TableCell = New TableCell
|
||||
Dim x As DropDownList = New DropDownList
|
||||
x.ID = ("dropDownList" & i)
|
||||
x.CssClass = "fili"
|
||||
x.Items.Add("")
|
||||
'this.ColumnsList.Items.Add(DDLIST_TEXT);
|
||||
'Adding column names to drop down list which are retrieved from database
|
||||
For Each column As BaseColumn In td.Columns
|
||||
Dim item As New ListItem()
|
||||
item.Text = column.Name
|
||||
item.Value = column.InternalName
|
||||
x.Items.Add(item)
|
||||
Next
|
||||
aspTableCell.Controls.Add(x)
|
||||
columnListAspTableRow.Cells.Add(aspTableCell)
|
||||
Dim columnTableCell As TableCell = New TableCell
|
||||
Dim importTableCell As TableCell = New TableCell
|
||||
Dim columnLabel As Label = New Label
|
||||
columnLabel.ID = ("columnLabel" & i)
|
||||
columnLabel.Text = (i + 1).ToString
|
||||
Dim importChkBox As CheckBox = New CheckBox
|
||||
importChkBox.ID = ("importChkBox" & i)
|
||||
' center align the check boxes and column numbers
|
||||
importTableCell.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center
|
||||
columnTableCell.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center
|
||||
columnTableCell.Controls.Add(columnLabel)
|
||||
columnAspTableRow.Cells.Add(columnTableCell)
|
||||
importTableCell.Controls.Add(importChkBox)
|
||||
importAspTableRow.Cells.Add(importTableCell)
|
||||
If ((Not (value) Is Nothing) _
|
||||
AndAlso (Not (x.Items.FindByText(value)) Is Nothing)) Then
|
||||
x.Items.FindByText(value).Selected = True
|
||||
importChkBox.Checked = True
|
||||
End If
|
||||
i = (i + 1)
|
||||
Next
|
||||
End If
|
||||
' reads through temp table and creates table cell and rows out of it and adds it to Display table
|
||||
Dim aspTableRow As TableRow = New TableRow
|
||||
' let the first cell contains row number.
|
||||
Dim firstTableCell As TableCell = New TableCell
|
||||
firstTableCell.Text = (rowIndex + 1).ToString
|
||||
aspTableRow.Cells.Add(firstTableCell)
|
||||
For Each value As String In collValues
|
||||
Dim aspTableCell As TableCell = New TableCell
|
||||
If (value.Length > 100) Then
|
||||
aspTableCell.Text = HttpUtility.HtmlEncode(value.Substring(0, 100) & "...")
|
||||
Else
|
||||
aspTableCell.Text = HttpUtility.HtmlEncode(value)
|
||||
End If
|
||||
aspTableRow.Cells.Add(aspTableCell)
|
||||
Next
|
||||
DisplayTable.Rows.Add(aspTableRow)
|
||||
rowIndex = (rowIndex + 1)
|
||||
|
||||
End While
|
||||
parser.Close()
|
||||
Catch ex As Exception
|
||||
MiscUtils.RegisterJScriptAlert(Me, "Import_Error_Message", ex.Message)
|
||||
Me.ImportButton.Button.Enabled = False
|
||||
End Try
|
||||
Else
|
||||
BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", "file not found")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Perform validation on selected columns
|
||||
''' </summary>
|
||||
''' <param name="ddListSelected"></param>
|
||||
''' <param name="chkBoxList"></param>
|
||||
''' <param name="bTable"></param>
|
||||
''' <returns></returns>
|
||||
Public Function validateColumns(ByVal ddListSelected As ArrayList, ByVal chkBoxList As ArrayList, ByVal bTable As BaseTable) As Boolean
|
||||
Dim j As Integer = 0
|
||||
|
||||
While (j < ddListSelected.Count)
|
||||
If ((ddListSelected(j).ToString <> "") _
|
||||
AndAlso CType(chkBoxList(j), CheckBox).Checked) Then
|
||||
Dim currentColumn As BaseColumn = bTable.TableDefinition.ColumnList.GetByAnyName(CType(ddListSelected(j), String))
|
||||
'Dim fkColumn As ForeignKey = bTable.TableDefinition.GetForeignKeyByColumnName(currentColumn.InternalName)
|
||||
'' Check if the foreign key has DFKA. If so, then check the value from csv file against the DFKA column in the parent/foreign key table.
|
||||
'' If a match is found retrieve its ID and set that as value to be inserted in the current table where you are adding records.
|
||||
'If ((Not (fkColumn) Is Nothing) _
|
||||
' AndAlso fkColumn.IsCompositeKey) Then
|
||||
' Throw New Exception(Me.GetResourceValue("Import:CompositeColumn", Me.AppName))
|
||||
' Return False
|
||||
'End If
|
||||
'If currentColumn.IsPrimaryKeyElement Then
|
||||
' MiscUtils.RegisterJScriptAlert(Me, "Import_Error_Message", Me.GetResourceValue("Import:PrimaryKey", Me.AppName).Replace("{ColumnName}", currentColumn.Name))
|
||||
' Return False
|
||||
'End If
|
||||
If currentColumn.IsValuesComputed Then
|
||||
MiscUtils.RegisterJScriptAlert(Me, "Import_Error_Message", Me.GetResourceValue("Import:ReadOnly", Me.AppName).Replace("{ColumnName}", currentColumn.Name))
|
||||
Return False
|
||||
End If
|
||||
|
||||
End If
|
||||
j = (j + 1)
|
||||
|
||||
End While
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function GetFileType() As Parser.FileTypes
|
||||
Dim type As String = String.Empty
|
||||
If Session("FileType").ToString() <> "" Then
|
||||
type = Session("FileType").ToString()
|
||||
Select Case type
|
||||
Case "CSV"
|
||||
Return Parser.FileTypes.CSV
|
||||
Case "TAB"
|
||||
Return Parser.FileTypes.TAB
|
||||
Case "XLS"
|
||||
Return Parser.FileTypes.XLS
|
||||
Case "XLSX"
|
||||
Return Parser.FileTypes.XLSX
|
||||
Case "MDB"
|
||||
Me.ImportFirstRowCheckBox.Checked = False
|
||||
Me.ImportFirstRowCheckBox.Enabled = False
|
||||
Return Parser.FileTypes.MDB
|
||||
Case "ACCDB"
|
||||
Me.ImportFirstRowCheckBox.Checked = False
|
||||
Me.ImportFirstRowCheckBox.Enabled = False
|
||||
Return Parser.FileTypes.ACCDB
|
||||
End Select
|
||||
End If
|
||||
|
||||
Return Parser.FileTypes.CSV
|
||||
|
||||
End Function
|
||||
|
||||
Protected Overrides Sub UpdateSessionNavigationHistory()
|
||||
'Do Nothing
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
End Namespace
|
||||
|
5
Shared/IncludeComponent.ascx
Normal file
5
Shared/IncludeComponent.ascx
Normal file
|
@ -0,0 +1,5 @@
|
|||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Control Language="vb" AutoEventWireup="false" CodeFile="IncludeComponent.ascx.vb" Inherits="Persons.UI.IncludeComponent" %>
|
||||
<%@ Register Tagprefix="Selectors" Namespace="Persons" %>
|
||||
|
||||
<%@ Register Tagprefix="BaseClasses" Namespace="BaseClasses.Web.UI.WebControls" Assembly="BaseClasses" %><table cellspacing="1" cellpadding="1" border="0" style="text-align: center;"><tr><td colspan="4"><img src="../Images/ASCXControlPlaceholder.gif" alt="" /></td></tr></table>
|
421
Shared/IncludeComponent.ascx.vb
Normal file
421
Shared/IncludeComponent.ascx.vb
Normal file
|
@ -0,0 +1,421 @@
|
|||
|
||||
#Region "Imports statements"
|
||||
Option Strict On
|
||||
Imports System
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports System.ComponentModel
|
||||
Imports BaseClasses
|
||||
Imports BaseClasses.Data
|
||||
Imports BaseClasses.Utils
|
||||
Imports BaseClasses.Web.UI.WebControls
|
||||
|
||||
Imports Persons.Business
|
||||
Imports Persons.Data
|
||||
|
||||
#End Region
|
||||
|
||||
Namespace Persons.UI
|
||||
|
||||
' Code-behind class for the IncludeComponent user control.
|
||||
Partial Public Class IncludeComponent
|
||||
Inherits BaseApplicationUserControl
|
||||
Implements IIncludeComponent
|
||||
#Region "Section 1: Place your customizations here."
|
||||
|
||||
Public Sub LoadData()
|
||||
' LoadData reads database data and assigns it to UI controls.
|
||||
' Customize by adding code before or after the call to LoadData_Base()
|
||||
' or replace the call to LoadData_Base().
|
||||
LoadData_Base()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate as BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS as Boolean) As String
|
||||
Return EvaluateFormula_Base(formula, dataSourceForEvaluate, format, variables, includeDS)
|
||||
End Function
|
||||
|
||||
Public Sub Page_InitializeEventHandlers(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Init
|
||||
' Handles MyBase.Init.
|
||||
' Register the Event handler for any Events.
|
||||
Me.Page_InitializeEventHandlers_Base(sender,e)
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub SaveControlsToSession()
|
||||
SaveControlsToSession_Base()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Overrides Sub ClearControlsFromSession()
|
||||
ClearControlsFromSession_Base()
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub LoadViewState(ByVal savedState As Object)
|
||||
LoadViewState_Base(savedState)
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Overrides Function SaveViewState() As Object
|
||||
Return SaveViewState_Base()
|
||||
End Function
|
||||
|
||||
Public Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
|
||||
Me.Page_PreRender_Base(sender,e)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Overrides Sub SaveData() Implements IIncludeComponent.SaveData
|
||||
Me.SaveData_Base()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Overrides Sub SetChartControl(ByVal chartCtrlName As String)
|
||||
Me.SetChartControl_Base(chartCtrlName)
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "Ajax Functions"
|
||||
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' or replace the call to GetRecordFieldValue_Base().
|
||||
Return GetRecordFieldValue_Base(tableName, recordID, columnName, fieldName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetImage(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetImage gets the Image url for the image in the column "columnName" and
|
||||
' in the record specified by recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetImage_Base()
|
||||
' or replace the call to GetImage_Base().
|
||||
Return GetImage_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
Protected Overloads Overrides Sub BasePage_PreRender(ByVal sender As Object, ByVal e As EventArgs)
|
||||
MyBase.BasePage_PreRender(sender, e)
|
||||
Base_RegisterPostback()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
' Page Event Handlers - buttons, sort, links
|
||||
|
||||
|
||||
' Write out the Set methods
|
||||
|
||||
|
||||
' Write out the methods for DataSource
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Section 2: Do not modify this section."
|
||||
|
||||
Protected Sub Page_InitializeEventHandlers_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
|
||||
' the following code for accordion is necessary or the Me.{ControlName} will return Nothing
|
||||
|
||||
' Register the Event handler for any Events.
|
||||
|
||||
|
||||
' Setup the pagination events.
|
||||
|
||||
Me.ClearControlsFromSession()
|
||||
End Sub
|
||||
|
||||
Private Sub Base_RegisterPostback()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
' Handles MyBase.Load. Read database data and put into the UI controls.
|
||||
' If you need to, you can add additional Load handlers in Section 1.
|
||||
Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
|
||||
|
||||
If (Not Me.IsPostBack) Then
|
||||
|
||||
End If
|
||||
|
||||
|
||||
' Load data only when displaying the page for the first time or if postback from child window
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Read the data for all controls on the page.
|
||||
' To change the behavior, override the DataBind method for the individual
|
||||
' record or table UI controls.
|
||||
Me.LoadData()
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetRecordFieldValue_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
If Not IsNothing(recordID) Then
|
||||
recordID = System.Web.HttpUtility.UrlDecode(recordID)
|
||||
End If
|
||||
Dim content as String = BaseClasses.Utils.MiscUtils.GetFieldData(tableName, recordID, columnName)
|
||||
|
||||
content = NetUtils.EncodeStringForHtmlDisplay(content)
|
||||
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window
|
||||
'returnValue(1) represents content of the pop up window
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function GetImage_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
Dim content As String = "<IMG alt =""" & title & """ src =" & """../Shared/ExportFieldValue.aspx?Table=" & tableName & "&Field=" & columnName & "&Record=" & recordID & """/>"
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window.
|
||||
'returnValue(1) represents content ie, image url.
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
Public Sub SetChartControl_Base(ByVal chartCtrlName As String)
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Public Sub SaveData_Base()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub SaveControlsToSession_Base()
|
||||
MyBase.SaveControlsToSession()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub ClearControlsFromSession_Base()
|
||||
MyBase.ClearControlsFromSession()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LoadViewState_Base(ByVal savedState As Object)
|
||||
MyBase.LoadViewState(savedState)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Function SaveViewState_Base() As Object
|
||||
|
||||
Return MyBase.SaveViewState()
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub Page_PreRender_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
' Data bind for each chart UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
' Load data from database into UI controls.
|
||||
' Modify LoadData in Section 1 above to customize. Or override DataBind() in
|
||||
' the individual table and record controls to customize.
|
||||
Public Sub LoadData_Base()
|
||||
Try
|
||||
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Must start a transaction before performing database operations
|
||||
DbUtils.StartTransaction()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Me.DataBind()
|
||||
|
||||
' Load and bind data for each record and table UI control.
|
||||
|
||||
|
||||
' Load data for chart.
|
||||
|
||||
|
||||
' initialize aspx controls
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
' An error has occured so display an error message.
|
||||
Utils.RegisterJScriptAlert(Me, "Page_Load_Error_Message", ex.Message)
|
||||
Finally
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' End database transaction
|
||||
DbUtils.EndTransaction()
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public EvaluateFormulaDelegate As BaseClasses.Data.DataSource.EvaluateFormulaDelegate = New BaseClasses.Data.DataSource.EvaluateFormulaDelegate(AddressOf Me.EvaluateFormula)
|
||||
|
||||
Public Overridable Function EvaluateFormula_Base(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS As Boolean) As String
|
||||
Dim e As FormulaEvaluator = New FormulaEvaluator()
|
||||
|
||||
' add variables for formula evaluation
|
||||
If variables IsNot Nothing Then
|
||||
Dim enumerator As System.Collections.Generic.IEnumerator(Of System.Collections.Generic.KeyValuePair(Of String, Object)) = variables.GetEnumerator()
|
||||
While enumerator.MoveNext()
|
||||
e.Variables.Add(enumerator.Current.Key, enumerator.Current.Value)
|
||||
End While
|
||||
End If
|
||||
|
||||
If includeDS
|
||||
|
||||
End If
|
||||
|
||||
|
||||
e.CallingControl = Me
|
||||
|
||||
e.DataSource = dataSourceForEvaluate
|
||||
|
||||
|
||||
Dim resultObj As Object = e.Evaluate(formula)
|
||||
If resultObj Is Nothing Then
|
||||
Return ""
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrEmpty(format) AndAlso (String.IsNullOrEmpty(formula) OrElse formula.IndexOf("Format(") < 0) Then
|
||||
Return FormulaUtils.Format(resultObj, format)
|
||||
Else
|
||||
Return resultObj.ToString()
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object)) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, format, variables, True)
|
||||
End Function
|
||||
|
||||
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal includeDS As Boolean) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, includeDS)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
' Write out the Set methods
|
||||
|
||||
|
||||
' Write out the DataSource properties and methods
|
||||
|
||||
|
||||
' Write out event methods for the page events
|
||||
|
||||
#Region "Interface Properties"
|
||||
|
||||
Public Overrides Property Visible() As Boolean Implements IIncludeComponent.Visible
|
||||
|
||||
Get
|
||||
Return MyBase.Visible
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
MyBase.Visible = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Public Shadows ReadOnly Property Page() As BaseApplicationPage
|
||||
Get
|
||||
Return DirectCast(MyBase.Page, BaseApplicationPage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
|
||||
|
61
Shared/IncludeComponent.xml
Normal file
61
Shared/IncludeComponent.xml
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<ComponentDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.ironspeed.com/designer">
|
||||
<Generator>Iron Speed Designer</Generator>
|
||||
<Version>9.2.0</Version>
|
||||
<Self>
|
||||
<Name>IncludeComponent</Name>
|
||||
<Type>UserControl</Type>
|
||||
<GenerateDirectory>Shared</GenerateDirectory>
|
||||
<Layout>Shared\IncludeComponent.html</Layout>
|
||||
<DisplayName>IncludeComponent</DisplayName>
|
||||
<Description>(Description)</Description>
|
||||
</Self>
|
||||
<ComposedOf/>
|
||||
<LayoutDefinition><![CDATA[<?xml version="1.0" encoding="utf-16"?>
|
||||
<LayoutDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<Layout Name="UserControl" Type="RootLayout">
|
||||
|
||||
<TableAttributes>
|
||||
<Attribute>
|
||||
<Name>cellspacing</Name>
|
||||
<AttributeValue>1</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>cellpadding</Name>
|
||||
<AttributeValue>1</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>border</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>style</Name>
|
||||
<AttributeValue>text-align: center;</AttributeValue>
|
||||
</Attribute>
|
||||
</TableAttributes>
|
||||
|
||||
<Prolog>
|
||||
<Value></Value>
|
||||
</Prolog>
|
||||
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ASCXControlPlaceholder.gif" alt="" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>colspan</Name>
|
||||
<AttributeValue>4</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<Epilog>
|
||||
<Value></Value>
|
||||
</Epilog>
|
||||
</Layout>
|
||||
|
||||
</LayoutDefinition>]]>
|
||||
</LayoutDefinition>
|
||||
</ComponentDefinition>
|
75
Shared/Internal_Server_Error.html
Normal file
75
Shared/Internal_Server_Error.html
Normal file
|
@ -0,0 +1,75 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head>
|
||||
<title>Internal Server Error</title>
|
||||
<link rel="stylesheet" rev="stylesheet" type="text/css" href="../Styles/BaseStyles.css"/>
|
||||
<link rel="stylesheet" rev="stylesheet" type="text/css" href="../Styles/Styles.css" />
|
||||
</head><body>
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pageBackground">
|
||||
<tr>
|
||||
<td class="pageAlignment">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="borderTable">
|
||||
<tr>
|
||||
<td class="pageBorderTL"><img src="../Images/space.gif" height="1" width="1" alt="" /></td>
|
||||
<td class="pageBorderT"><img src="../Images/space.gif" height="1" width="1" alt="" /></td>
|
||||
<td class="pageBorderTR"><img src="../Images/space.gif" height="1" width="1" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pageBorderL"><img src="../Images/space.gif" height="1" width="1" alt="" /></td>
|
||||
<td class="pageBorderC">
|
||||
<table cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td class="page_yellow">
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber1">
|
||||
<tr>
|
||||
<td class="dialog_header" colspan="3">
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="dialogHeaderEdgeL"><img src="../Images/space.gif" alt="" /></td>
|
||||
<td class="dialog_header_text" style="font-size:15px;"><span id="ErrorHeading">Internal Server Error</span></td>
|
||||
<td class="dialogHeaderEdgeR"><img src="../Images/space.gif" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20px;"></td>
|
||||
<td class="configureErrorPagesText"><br />
|
||||
The requested web page either has an error or does not exist.<br /><br />
|
||||
Please contact your system administrator or customer support.<br /><br />
|
||||
</td>
|
||||
<td style="width: 20px;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="pageBorderR"><img src="../Images/space.gif" height="1" width="1" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pageBorderBL"><img src="../Images/space.gif" height="1" width="1" alt="" /></td>
|
||||
<td class="pageBorderB"><img src="../Images/space.gif" height="1" width="1" alt="" /></td>
|
||||
<td class="pageBorderBR"><img src="../Images/space.gif" height="1" width="1" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
<script language="javascript">
|
||||
if ( window.navigator.userAgent.indexOf("iPhone") >= 0 ||
|
||||
window.navigator.userAgent.indexOf("iPod") >= 0 ||
|
||||
window.navigator.userAgent.indexOf("Android") >= 0 ) {
|
||||
var heading = document.getElementById("ErrorHeading");
|
||||
|
||||
if ( heading != null ) {
|
||||
heading.style.fontSize = "4.0em";
|
||||
}
|
||||
|
||||
document.body.style.fontSize = "3.0em";
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</html>
|
122
Shared/LargeListSelector.aspx
Normal file
122
Shared/LargeListSelector.aspx
Normal file
|
@ -0,0 +1,122 @@
|
|||
<%@ Page Language="vb" AutoEventWireup="true" EnableEventValidation="false" Codefile="LargeListSelector.aspx.vb" Inherits="Persons.UI.LargeListSelector" %>
|
||||
<%@ Register Tagprefix="Persons" TagName="Pagination" Src="PaginationMedium.ascx" %>
|
||||
|
||||
<%@ Register Tagprefix="Selectors" Namespace="Persons" %>
|
||||
|
||||
|
||||
<%@ Register Tagprefix="Persons" Namespace="Persons.UI.Controls.LargeListSelector" %>
|
||||
|
||||
<%@ Register Tagprefix="BaseClasses" Namespace="BaseClasses.Web.UI.WebControls" Assembly="BaseClasses" %>
|
||||
<%@ Register Tagprefix="Persons" TagName="ThemeButton" Src="ThemeButton.ascx" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head id="Head1" runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body id="Body1" runat="server" style="background-color: #ffffff;">
|
||||
<form id="Form1" method="post" runat="server">
|
||||
<BaseClasses:BasePageSettings id="PageSettings" runat="server" />
|
||||
<asp:ScriptManager ID="scriptManager1" runat="server" EnablePartialRendering="True" EnablePageMethods="True" />
|
||||
|
||||
<asp:UpdateProgress runat="server" id="ItemsTableControlUpdateProgress" AssociatedUpdatePanelID="ItemsTableControlUpdatePanel">
|
||||
<ProgressTemplate>
|
||||
<div class="ajaxUpdatePanel">
|
||||
</div>
|
||||
<div style=" position:absolute; padding:30px;">
|
||||
<img src="../Images/updating.gif" alt="Updating" />
|
||||
</div>
|
||||
</ProgressTemplate>
|
||||
</asp:UpdateProgress>
|
||||
<asp:UpdatePanel runat="server" id="ItemsTableControlUpdatePanel" UpdateMode="Conditional">
|
||||
|
||||
<ContentTemplate>
|
||||
<Persons:ItemsTable runat="server" id="ItemsTable">
|
||||
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<!-- BEGIN Search -->
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<%= SystemUtils.GenerateEnterKeyCaptureBeginTag(FindControl("ItemsTable$SearchButton")) %>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="filter_area">
|
||||
<asp:Literal runat="server" id="StartsWithText" Text='<%# GetResourceValue("Txt:StartsWith")%>'/>
|
||||
</td>
|
||||
<td class="dfv">
|
||||
<asp:TextBox runat="server" id="StartsWith" CssClass="Search_Input_Classic" Columns="50" />
|
||||
<asp:AutoCompleteExtender id="StartsWithAutoCompleteExtender" runat="server" TargetControlID="StartsWith" ServiceMethod="GetAutoCompletionList_StartsWith" MinimumPrefixLength="2" CompletionInterval="700" CompletionSetCount="10" CompletionListCssClass="autotypeahead_completionListElement" CompletionListItemCssClass="autotypeahead_listItem" CompletionListHighlightedItemCssClass="autotypeahead_highlightedListItem">
|
||||
</asp:AutoCompleteExtender>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="filter_area">
|
||||
<asp:Literal runat="server" id="ContainsText" Text='<%# GetResourceValue("Txt:Contains")%>'/>
|
||||
</td>
|
||||
<td class="dfv">
|
||||
<asp:TextBox runat="server" id="Contains" CssClass="Search_Input_Classic" Columns="50" />
|
||||
<asp:AutoCompleteExtender id="ContainsAutoCompleteExtender" runat="server" TargetControlID="Contains" ServiceMethod="GetAutoCompletionList_Contains" MinimumPrefixLength="2" CompletionInterval="700" CompletionSetCount="10" CompletionListCssClass="autotypeahead_completionListElement" CompletionListItemCssClass="autotypeahead_listItem" CompletionListHighlightedItemCssClass="autotypeahead_highlightedListItem">
|
||||
</asp:AutoCompleteExtender>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<%= SystemUtils.GenerateEnterKeyCaptureEndTag(FindControl("ItemsTable$SearchButton")) %>
|
||||
</td>
|
||||
<td style="vertical-align:middle;">
|
||||
<Persons:ThemeButton runat="server" id="SearchButton" Button-CausesValidation="False" Button-CommandName="Search" Button-Text="<%# GetResourceValue("Btn:SearchGoButtonText") %>">
|
||||
</Persons:ThemeButton>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- END Search -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<!-- BEGIN Pagination -->
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="pagination_row">
|
||||
<table cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td><img src="../Images/paginationRowEdgeL.gif" alt="" /></td>
|
||||
<td class="pagination_area" style="width:100%;">
|
||||
<Persons:Pagination runat="server" id="Pagination"></Persons:Pagination>
|
||||
</td>
|
||||
<td><img src="../Images/paginationRowEdgeR.gif" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- END Pagination -->
|
||||
</td>
|
||||
</tr>
|
||||
<asp:Repeater runat="server" id="Row1">
|
||||
<ITEMTEMPLATE>
|
||||
<Persons:ItemsTableRecordControl runat="server" id="ItemsTableRecordControl">
|
||||
|
||||
<tr>
|
||||
<td class="header_cell" style="text-align:center;">
|
||||
<div class="column_header"><asp:Label runat="server" ID="ValueText" Visible="false"></asp:Label><asp:Label runat="server" ID="Formula" Visible="false"></asp:Label><asp:LinkButton runat="server" id="SelectButton" CausesValidation="False" Text="Select"></asp:LinkButton></div>
|
||||
</td>
|
||||
<td class="table_cell">
|
||||
<asp:Label runat="server" id="ItemText"></asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</Persons:ItemsTableRecordControl>
|
||||
</ITEMTEMPLATE>
|
||||
</asp:Repeater>
|
||||
</table>
|
||||
|
||||
</Persons:ItemsTable>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
140
Shared/LargeListSelector.aspx.vb
Normal file
140
Shared/LargeListSelector.aspx.vb
Normal file
|
@ -0,0 +1,140 @@
|
|||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Collections
|
||||
Imports System.ComponentModel
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports BaseClasses
|
||||
Imports BaseClasses.Utils
|
||||
Imports BaseClasses.Data
|
||||
Imports BaseClasses.Data.SqlProvider
|
||||
Imports BaseClasses.Web.UI.WebControls
|
||||
Imports Persons.Business
|
||||
Imports Persons.Data
|
||||
Imports Persons.UI.Controls.LargeListSelector
|
||||
Namespace Persons.UI
|
||||
|
||||
' Code-behind class for the LargeListSelector page.
|
||||
' Place your customizations in Section 1. Do not modify Section 2.
|
||||
Partial Public Class LargeListSelector
|
||||
Inherits BaseApplicationPage
|
||||
|
||||
|
||||
#Region "Section 1: Place your customizations here."
|
||||
Public Sub New()
|
||||
Me.IsUpdatesSessionNavigationHistory = False
|
||||
End Sub
|
||||
|
||||
' LoadData reads database data and assigns it to UI controls.
|
||||
' Customize by adding code before or after the call to LoadData_Base()
|
||||
' or replace the call to LoadData_Base().
|
||||
Public Sub LoadData()
|
||||
LoadData_Base()
|
||||
End Sub
|
||||
|
||||
Private Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
|
||||
Me.Page_PreInit_Base()
|
||||
End Sub
|
||||
#Region "Ajax Functions"
|
||||
|
||||
|
||||
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetAutoCompletionList_StartsWith(ByVal prefixText As String, ByVal count As Integer) As String()
|
||||
' GetEmployeesSearchAreaCompletionList gets the list of suggestions from the database.
|
||||
' prefixText is the search text typed by the user .
|
||||
' count specifies the number of suggestions to be returned.
|
||||
' Customize by adding code before or after the call to GetAutoCompletionList_EmployeesSearchArea()
|
||||
' or replace the call to GetAutoCompletionList_EmployeesSearchArea().
|
||||
Return GetAutoCompletionList_Base(prefixText, Nothing, count)
|
||||
End Function
|
||||
|
||||
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetAutoCompletionList_Contains(ByVal prefixText As String, ByVal count As Integer) As String()
|
||||
' GetEmployeesSearchAreaCompletionList gets the list of suggestions from the database.
|
||||
' prefixText is the search text typed by the user .
|
||||
' count specifies the number of suggestions to be returned.
|
||||
' Customize by adding code before or after the call to GetAutoCompletionList_EmployeesSearchArea()
|
||||
' or replace the call to GetAutoCompletionList_EmployeesSearchArea().
|
||||
Return GetAutoCompletionList_Base(Nothing, prefixText, count)
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Section 2: Do not modify this section."
|
||||
|
||||
|
||||
Protected Sub Page_PreInit_Base()
|
||||
'This is multi-color theme, so assign proper theme
|
||||
Dim selectedTheme As String = Me.GetSelectedTheme()
|
||||
If Not String.IsNullOrEmpty(selectedTheme) Then Me.Page.Theme = selectedTheme
|
||||
End Sub
|
||||
|
||||
' Handles MyBase.Load. If you need to, you can add additional Load handlers in Section 1.
|
||||
' Read database data and put into the UI controls.
|
||||
Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
' Load data only when displaying the page for the first time
|
||||
If (Not Me.IsPostBack) Then
|
||||
|
||||
' Check if user has access to this page. Redirects to either sign-in page
|
||||
' or 'no access' page if not. Does not do anything if role-based security
|
||||
' is not turned on, but you can override to add your own security.
|
||||
Me.Authorize(Me.GetAuthorizedRoles())
|
||||
|
||||
' Read the data for all controls on the page.
|
||||
' To change the behavior, override the DataBind method for the individual
|
||||
' record or table UI controls.
|
||||
Me.LoadData()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetAutoCompletionList_Base(ByVal startsWithText As String, ByVal containsText As String, ByVal count As Integer) As String()
|
||||
' Since this method is a shared/static method it does not maintain information about page or controls within the page.
|
||||
' Hence we can not invoke any method associated with any controls.
|
||||
' So, if we need to use any control in the page we need to instantiate it.
|
||||
Dim control As Persons.UI.Controls.LargeListSelector.ItemsTable
|
||||
control = New Persons.UI.Controls.LargeListSelector.ItemsTable
|
||||
Return control.GetAutoCompletionList(startsWithText, containsText, count)
|
||||
End Function
|
||||
|
||||
|
||||
' Load data from database into UI controls.
|
||||
' Modify LoadData in Section 1 above to customize. Or override DataBind() in
|
||||
' the individual table and record controls to customize.
|
||||
Public Sub LoadData_Base()
|
||||
Try
|
||||
' Load data only when displaying the page for the first time
|
||||
If (Not Me.IsPostBack) Then
|
||||
|
||||
' Must start a transaction before performing database operations
|
||||
DbUtils.StartTransaction()
|
||||
|
||||
' Load data for each record and table UI control.
|
||||
' Ordering is important because child controls get
|
||||
' their parent ids from their parent UI controls.
|
||||
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
' An error has occured so display an error message.
|
||||
Utils.RegisterJScriptAlert(Me, "Page_Load_Error_Message", ex.Message)
|
||||
Finally
|
||||
If Not Me.IsPostBack Then
|
||||
' End database transaction
|
||||
DbUtils.EndTransaction()
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub UpdateSessionNavigationHistory()
|
||||
'Do nothing
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
6
Shared/Menu_Item.ascx
Normal file
6
Shared/Menu_Item.ascx
Normal file
|
@ -0,0 +1,6 @@
|
|||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Control Language="vb" AutoEventWireup="false" CodeFile="Menu_Item.ascx.vb" Inherits="Persons.UI.Menu_Item" %>
|
||||
<%@ Register Tagprefix="Selectors" Namespace="Persons" %>
|
||||
|
||||
<%@ Register Tagprefix="BaseClasses" Namespace="BaseClasses.Web.UI.WebControls" Assembly="BaseClasses" %><table cellspacing="0" cellpadding="0" border="0" onmouseover="this.style.cursor='pointer'; return true;" onclick="clickLinkButtonText(this, event);"><tr><td class="mTL"><img src="../Images/space.gif" height="5" width="6" alt="" /></td><td class="mT"><img src="../Images/space.gif" height="5" width="1" alt="" /></td><td class="mTR"><img src="../Images/space.gif" height="5" width="9" alt="" /></td></tr><tr><td class="mL"><img src="../Images/space.gif" height="12" width="6" alt="" /></td><td class="mC"><asp:LinkButton CommandName="Redirect" runat="server" id="_Button" cssclass="menu">
|
||||
</asp:LinkButton></td><td class="mR"><img src="../Images/space.gif" height="12" width="9" alt="" /></td></tr><tr><td class="mBL"><img src="../Images/space.gif" height="5" width="6" alt="" /></td><td class="mB"><img src="../Images/space.gif" height="5" width="1" alt="" /></td><td class="mBR"><img src="../Images/space.gif" height="5" width="9" alt="" /></td></tr></table>
|
436
Shared/Menu_Item.ascx.vb
Normal file
436
Shared/Menu_Item.ascx.vb
Normal file
|
@ -0,0 +1,436 @@
|
|||
|
||||
Option Strict On
|
||||
Imports System
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports System.ComponentModel
|
||||
Imports BaseClasses
|
||||
Imports BaseClasses.Utils
|
||||
Imports BaseClasses.Web.UI.WebControls
|
||||
|
||||
Imports Persons.Business
|
||||
Imports Persons.Data
|
||||
|
||||
Namespace Persons.UI
|
||||
|
||||
' Code-behind class for the Menu_Item user control.
|
||||
Public Partial Class Menu_Item
|
||||
Inherits BaseApplicationUserControl
|
||||
Implements IMenu_Item
|
||||
#Region "Section 1: Place your customizations here."
|
||||
|
||||
Public Sub LoadData()
|
||||
' LoadData reads database data and assigns it to UI controls.
|
||||
' Customize by adding code before or after the call to LoadData_Base()
|
||||
' or replace the call to LoadData_Base().
|
||||
LoadData_Base()
|
||||
End Sub
|
||||
|
||||
#Region "Ajax Functions"
|
||||
|
||||
' <Services.WebMethod()> _
|
||||
' Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
' ByVal recordID As String, _
|
||||
' ByVal columnName As String, _
|
||||
' ByVal title As String, _
|
||||
' ByVal persist As Boolean, _
|
||||
' ByVal popupWindowHeight As Integer, _
|
||||
' ByVal popupWindowWidth As Integer, _
|
||||
' ByVal popupWindowScrollBar As Boolean _
|
||||
' ) As Object()
|
||||
' ' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' ' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' ' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' ' or replace the call to GetRecordFieldValue_Base().
|
||||
' Return GetRecordFieldValue_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
' End Function
|
||||
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetImage(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetImage gets the Image url for the image in the column "columnName" and
|
||||
' in the record specified by recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetImage_Base()
|
||||
' or replace the call to GetImage_Base().
|
||||
Return GetImage_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
' Page Event Handlers - buttons, sort, links
|
||||
|
||||
Public Sub Button_Click(ByVal sender As Object, ByVal args As EventArgs)
|
||||
|
||||
' Click handler for Button.
|
||||
' Customize by adding code before the call or replace the call to the Base function with your own code.
|
||||
Button_Click_Base(sender, args)
|
||||
' NOTE: If the Base function redirects to another page, any code here will not be executed.
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Overloads Overrides Sub BasePage_PreRender(ByVal sender As Object, ByVal e As EventArgs)
|
||||
MyBase.BasePage_PreRender(sender, e)
|
||||
Base_RegisterPostback()
|
||||
End Sub
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' or replace the call to GetRecordFieldValue_Base().
|
||||
Return GetRecordFieldValue_Base(tableName, recordID, columnName, fieldName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
Public Overrides Sub SetChartControl(ByVal chartCtrlName As String)
|
||||
Me.SetChartControl_Base(chartCtrlName)
|
||||
End Sub
|
||||
Public Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
|
||||
Me.Page_PreRender_Base(sender,e)
|
||||
End Sub
|
||||
Protected Overrides Function SaveViewState() As Object
|
||||
Return SaveViewState_Base()
|
||||
End Function
|
||||
Protected Overrides Sub LoadViewState(ByVal savedState As Object)
|
||||
LoadViewState_Base(savedState)
|
||||
End Sub
|
||||
Protected Overrides Sub ClearControlsFromSession()
|
||||
ClearControlsFromSession_Base()
|
||||
End Sub
|
||||
Protected Overrides Sub SaveControlsToSession()
|
||||
SaveControlsToSession_Base()
|
||||
End Sub
|
||||
Public Sub Page_InitializeEventHandlers(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Init
|
||||
' Handles MyBase.Init.
|
||||
' Register the Event handler for any Events.
|
||||
Me.Page_InitializeEventHandlers_Base(sender,e)
|
||||
End Sub
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate as BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS as Boolean) As String
|
||||
Return EvaluateFormula_Base(formula, dataSourceForEvaluate, format, variables, includeDS)
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "Section 2: Do not modify this section."
|
||||
|
||||
Protected Sub Page_InitializeEventHandlers_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
|
||||
' the following code for accordion is necessary or the Me.{ControlName} will return Nothing
|
||||
|
||||
' Register the Event handler for any Events.
|
||||
|
||||
|
||||
' Setup the pagination events.
|
||||
|
||||
AddHandler Me.Button.Click, AddressOf Button_Click
|
||||
|
||||
Me.ClearControlsFromSession()
|
||||
End Sub
|
||||
|
||||
Private Sub Base_RegisterPostback()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
' Handles MyBase.Load. Read database data and put into the UI controls.
|
||||
' If you need to, you can add additional Load handlers in Section 1.
|
||||
Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
|
||||
|
||||
If (Not Me.IsPostBack) Then
|
||||
|
||||
End If
|
||||
|
||||
|
||||
' Load data only when displaying the page for the first time or if postback from child window
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Read the data for all controls on the page.
|
||||
' To change the behavior, override the DataBind method for the individual
|
||||
' record or table UI controls.
|
||||
Me.LoadData()
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetRecordFieldValue_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
If Not IsNothing(recordID) Then
|
||||
recordID = System.Web.HttpUtility.UrlDecode(recordID)
|
||||
End If
|
||||
Dim content as String = BaseClasses.Utils.MiscUtils.GetFieldData(tableName, recordID, columnName)
|
||||
|
||||
content = NetUtils.EncodeStringForHtmlDisplay(content)
|
||||
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window
|
||||
'returnValue(1) represents content of the pop up window
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function GetImage_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
Dim content As String = "<IMG alt =""" & title & """ src =" & """../Shared/ExportFieldValue.aspx?Table=" & tableName & "&Field=" & columnName & "&Record=" & recordID & """/>"
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window.
|
||||
'returnValue(1) represents content ie, image url.
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
Public Sub SetChartControl_Base(ByVal chartCtrlName As String)
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub SaveControlsToSession_Base()
|
||||
MyBase.SaveControlsToSession()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub ClearControlsFromSession_Base()
|
||||
MyBase.ClearControlsFromSession()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LoadViewState_Base(ByVal savedState As Object)
|
||||
MyBase.LoadViewState(savedState)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Function SaveViewState_Base() As Object
|
||||
|
||||
Return MyBase.SaveViewState()
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub Page_PreRender_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
' Data bind for each chart UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
' Load data from database into UI controls.
|
||||
' Modify LoadData in Section 1 above to customize. Or override DataBind() in
|
||||
' the individual table and record controls to customize.
|
||||
Public Sub LoadData_Base()
|
||||
Try
|
||||
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Must start a transaction before performing database operations
|
||||
DbUtils.StartTransaction()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Me.DataBind()
|
||||
|
||||
' Load and bind data for each record and table UI control.
|
||||
|
||||
|
||||
' Load data for chart.
|
||||
|
||||
|
||||
' initialize aspx controls
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
' An error has occured so display an error message.
|
||||
Utils.RegisterJScriptAlert(Me, "Page_Load_Error_Message", ex.Message)
|
||||
Finally
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' End database transaction
|
||||
DbUtils.EndTransaction()
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public EvaluateFormulaDelegate As BaseClasses.Data.DataSource.EvaluateFormulaDelegate = New BaseClasses.Data.DataSource.EvaluateFormulaDelegate(AddressOf Me.EvaluateFormula)
|
||||
|
||||
Public Overridable Function EvaluateFormula_Base(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS As Boolean) As String
|
||||
Dim e As FormulaEvaluator = New FormulaEvaluator()
|
||||
|
||||
' add variables for formula evaluation
|
||||
If variables IsNot Nothing Then
|
||||
Dim enumerator As System.Collections.Generic.IEnumerator(Of System.Collections.Generic.KeyValuePair(Of String, Object)) = variables.GetEnumerator()
|
||||
While enumerator.MoveNext()
|
||||
e.Variables.Add(enumerator.Current.Key, enumerator.Current.Value)
|
||||
End While
|
||||
End If
|
||||
|
||||
If includeDS
|
||||
|
||||
End If
|
||||
|
||||
|
||||
e.CallingControl = Me
|
||||
|
||||
e.DataSource = dataSourceForEvaluate
|
||||
|
||||
|
||||
Dim resultObj As Object = e.Evaluate(formula)
|
||||
If resultObj Is Nothing Then
|
||||
Return ""
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrEmpty(format) AndAlso (String.IsNullOrEmpty(formula) OrElse formula.IndexOf("Format(") < 0) Then
|
||||
Return FormulaUtils.Format(resultObj, format)
|
||||
Else
|
||||
Return resultObj.ToString()
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object)) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, format, variables, True)
|
||||
End Function
|
||||
|
||||
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal includeDS As Boolean) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, includeDS)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
' Write out the Set methods
|
||||
|
||||
|
||||
' Write out the DataSource properties and methods
|
||||
|
||||
|
||||
' Write out event methods for the page events
|
||||
|
||||
' event handler for LinkButton
|
||||
Public Sub Button_Click_Base(ByVal sender As Object, ByVal args As EventArgs)
|
||||
|
||||
Try
|
||||
|
||||
Catch ex As Exception
|
||||
Ctype(Me.Page, BaseApplicationPage).ErrorOnPage = True
|
||||
|
||||
' Report the error message to the end user
|
||||
Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", ex.Message)
|
||||
|
||||
Finally
|
||||
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
#Region "Interface Properties"
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property Button() As System.Web.UI.WebControls.LinkButton Implements IMenu_Item.Button
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_Button"), System.Web.UI.WebControls.LinkButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Property Visible() As Boolean Implements IMenu_Item.Visible
|
||||
|
||||
Get
|
||||
Return MyBase.Visible
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
MyBase.Visible = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Public Shadows ReadOnly Property Page() As BaseApplicationPage
|
||||
Get
|
||||
Return DirectCast(MyBase.Page, BaseApplicationPage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
|
||||
|
155
Shared/Menu_Item.xml
Normal file
155
Shared/Menu_Item.xml
Normal file
|
@ -0,0 +1,155 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<ComponentDefinition xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ironspeed.com/designer">
|
||||
<Generator>Iron Speed Designer</Generator>
|
||||
<Version>9.2.0</Version>
|
||||
<Self>
|
||||
<Name>Menu_Item</Name>
|
||||
<Type>Button</Type>
|
||||
<GenerateDirectory>Shared</GenerateDirectory>
|
||||
<Layout>Shared\Menu_Item.html</Layout>
|
||||
<DisplayName>Menu_Item</DisplayName>
|
||||
<Description>(Description)</Description>
|
||||
</Self>
|
||||
<ComposedOf>
|
||||
<ContainedComponent>
|
||||
<Name>Button</Name>
|
||||
<Type>LinkButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CssClass</Name>
|
||||
<Value>menu</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
</ComposedOf>
|
||||
|
||||
<LayoutDefinition><![CDATA[<?xml version="1.0" encoding="utf-16"?>
|
||||
<LayoutDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<Layout Name="Button" Type="RootLayout">
|
||||
|
||||
<TableAttributes>
|
||||
<Attribute>
|
||||
<Name>cellspacing</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>cellpadding</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>border</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<AttributeValue>this.style.cursor='pointer'; return true;</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onclick</Name>
|
||||
<AttributeValue>clickLinkButtonText(this, event);</AttributeValue>
|
||||
</Attribute>
|
||||
</TableAttributes>
|
||||
|
||||
<Prolog>
|
||||
<Value></Value>
|
||||
</Prolog>
|
||||
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mTL</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="1" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mT</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="9" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mTR</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="12" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mL</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:LINKBUTTON NAME="Button" CssClass="menu"/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mC</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="12" width="9" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mR</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mBL</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="1" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mB</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="9" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mBR</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<Epilog>
|
||||
<Value></Value>
|
||||
</Epilog>
|
||||
</Layout>
|
||||
|
||||
</LayoutDefinition>]]>
|
||||
</LayoutDefinition>
|
||||
</ComponentDefinition>
|
6
Shared/Menu_ItemVertical.ascx
Normal file
6
Shared/Menu_ItemVertical.ascx
Normal file
|
@ -0,0 +1,6 @@
|
|||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Register Tagprefix="Selectors" Namespace="Persons" %>
|
||||
|
||||
<%@ Control Language="vb" AutoEventWireup="false" CodeFile="Menu_ItemVertical.ascx.vb" Inherits="Persons.UI.Menu_ItemVertical" %>
|
||||
<%@ Register Tagprefix="BaseClasses" Namespace="BaseClasses.Web.UI.WebControls" Assembly="BaseClasses" %><table cellspacing="0" cellpadding="0" border="0" onmouseover="this.style.cursor='pointer'; return true;" onclick="clickLinkButtonText(this, event);" width="100%"><tr><td class="mvTL"><img src="../Images/space.gif" height="5" width="6" alt="" /></td><td class="mvT"><img src="../Images/space.gif" height="5" width="1" alt="" /></td><td class="mvTR"><img src="../Images/space.gif" height="5" width="6" alt="" /></td></tr><tr><td class="mvL"><img src="../Images/space.gif" height="12" width="6" alt="" /></td><td class="mvC"><asp:LinkButton CommandName="Redirect" runat="server" id="_Button" cssclass="menu">
|
||||
</asp:LinkButton></td><td class="mvR"><img src="../Images/space.gif" height="12" width="6" alt="" /></td></tr><tr><td class="mvBL"><img src="../Images/space.gif" height="8" width="6" alt="" /></td><td class="mvB"><img src="../Images/space.gif" height="8" width="1" alt="" /></td><td class="mvBR"><img src="../Images/space.gif" height="8" width="6" alt="" /></td></tr></table>
|
436
Shared/Menu_ItemVertical.ascx.vb
Normal file
436
Shared/Menu_ItemVertical.ascx.vb
Normal file
|
@ -0,0 +1,436 @@
|
|||
|
||||
Option Strict On
|
||||
Imports System
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports System.ComponentModel
|
||||
Imports BaseClasses
|
||||
Imports BaseClasses.Utils
|
||||
Imports BaseClasses.Web.UI.WebControls
|
||||
|
||||
Imports Persons.Business
|
||||
Imports Persons.Data
|
||||
|
||||
Namespace Persons.UI
|
||||
|
||||
' Code-behind class for the Menu_ItemVertical user control.
|
||||
Public Partial Class Menu_ItemVertical
|
||||
Inherits BaseApplicationUserControl
|
||||
Implements IMenu_ItemVertical
|
||||
#Region "Section 1: Place your customizations here."
|
||||
|
||||
Public Sub LoadData()
|
||||
' LoadData reads database data and assigns it to UI controls.
|
||||
' Customize by adding code before or after the call to LoadData_Base()
|
||||
' or replace the call to LoadData_Base().
|
||||
LoadData_Base()
|
||||
End Sub
|
||||
|
||||
#Region "Ajax Functions"
|
||||
|
||||
' <Services.WebMethod()> _
|
||||
' Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
' ByVal recordID As String, _
|
||||
' ByVal columnName As String, _
|
||||
' ByVal title As String, _
|
||||
' ByVal persist As Boolean, _
|
||||
' ByVal popupWindowHeight As Integer, _
|
||||
' ByVal popupWindowWidth As Integer, _
|
||||
' ByVal popupWindowScrollBar As Boolean _
|
||||
' ) As Object()
|
||||
' ' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' ' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' ' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' ' or replace the call to GetRecordFieldValue_Base().
|
||||
' Return GetRecordFieldValue_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
' End Function
|
||||
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetImage(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetImage gets the Image url for the image in the column "columnName" and
|
||||
' in the record specified by recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetImage_Base()
|
||||
' or replace the call to GetImage_Base().
|
||||
Return GetImage_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
' Page Event Handlers - buttons, sort, links
|
||||
|
||||
Public Sub Button_Click(ByVal sender As Object, ByVal args As EventArgs)
|
||||
|
||||
' Click handler for Button.
|
||||
' Customize by adding code before the call or replace the call to the Base function with your own code.
|
||||
Button_Click_Base(sender, args)
|
||||
' NOTE: If the Base function redirects to another page, any code here will not be executed.
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Overloads Overrides Sub BasePage_PreRender(ByVal sender As Object, ByVal e As EventArgs)
|
||||
MyBase.BasePage_PreRender(sender, e)
|
||||
Base_RegisterPostback()
|
||||
End Sub
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' or replace the call to GetRecordFieldValue_Base().
|
||||
Return GetRecordFieldValue_Base(tableName, recordID, columnName, fieldName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
Public Overrides Sub SetChartControl(ByVal chartCtrlName As String)
|
||||
Me.SetChartControl_Base(chartCtrlName)
|
||||
End Sub
|
||||
Public Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
|
||||
Me.Page_PreRender_Base(sender,e)
|
||||
End Sub
|
||||
Protected Overrides Function SaveViewState() As Object
|
||||
Return SaveViewState_Base()
|
||||
End Function
|
||||
Protected Overrides Sub LoadViewState(ByVal savedState As Object)
|
||||
LoadViewState_Base(savedState)
|
||||
End Sub
|
||||
Protected Overrides Sub ClearControlsFromSession()
|
||||
ClearControlsFromSession_Base()
|
||||
End Sub
|
||||
Protected Overrides Sub SaveControlsToSession()
|
||||
SaveControlsToSession_Base()
|
||||
End Sub
|
||||
Public Sub Page_InitializeEventHandlers(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Init
|
||||
' Handles MyBase.Init.
|
||||
' Register the Event handler for any Events.
|
||||
Me.Page_InitializeEventHandlers_Base(sender,e)
|
||||
End Sub
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate as BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS as Boolean) As String
|
||||
Return EvaluateFormula_Base(formula, dataSourceForEvaluate, format, variables, includeDS)
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "Section 2: Do not modify this section."
|
||||
|
||||
Protected Sub Page_InitializeEventHandlers_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
|
||||
' the following code for accordion is necessary or the Me.{ControlName} will return Nothing
|
||||
|
||||
' Register the Event handler for any Events.
|
||||
|
||||
|
||||
' Setup the pagination events.
|
||||
|
||||
AddHandler Me.Button.Click, AddressOf Button_Click
|
||||
|
||||
Me.ClearControlsFromSession()
|
||||
End Sub
|
||||
|
||||
Private Sub Base_RegisterPostback()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
' Handles MyBase.Load. Read database data and put into the UI controls.
|
||||
' If you need to, you can add additional Load handlers in Section 1.
|
||||
Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
|
||||
|
||||
If (Not Me.IsPostBack) Then
|
||||
|
||||
End If
|
||||
|
||||
|
||||
' Load data only when displaying the page for the first time or if postback from child window
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Read the data for all controls on the page.
|
||||
' To change the behavior, override the DataBind method for the individual
|
||||
' record or table UI controls.
|
||||
Me.LoadData()
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetRecordFieldValue_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
If Not IsNothing(recordID) Then
|
||||
recordID = System.Web.HttpUtility.UrlDecode(recordID)
|
||||
End If
|
||||
Dim content as String = BaseClasses.Utils.MiscUtils.GetFieldData(tableName, recordID, columnName)
|
||||
|
||||
content = NetUtils.EncodeStringForHtmlDisplay(content)
|
||||
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window
|
||||
'returnValue(1) represents content of the pop up window
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function GetImage_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
Dim content As String = "<IMG alt =""" & title & """ src =" & """../Shared/ExportFieldValue.aspx?Table=" & tableName & "&Field=" & columnName & "&Record=" & recordID & """/>"
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window.
|
||||
'returnValue(1) represents content ie, image url.
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
Public Sub SetChartControl_Base(ByVal chartCtrlName As String)
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub SaveControlsToSession_Base()
|
||||
MyBase.SaveControlsToSession()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub ClearControlsFromSession_Base()
|
||||
MyBase.ClearControlsFromSession()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LoadViewState_Base(ByVal savedState As Object)
|
||||
MyBase.LoadViewState(savedState)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Function SaveViewState_Base() As Object
|
||||
|
||||
Return MyBase.SaveViewState()
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub Page_PreRender_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
' Data bind for each chart UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
' Load data from database into UI controls.
|
||||
' Modify LoadData in Section 1 above to customize. Or override DataBind() in
|
||||
' the individual table and record controls to customize.
|
||||
Public Sub LoadData_Base()
|
||||
Try
|
||||
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Must start a transaction before performing database operations
|
||||
DbUtils.StartTransaction()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Me.DataBind()
|
||||
|
||||
' Load and bind data for each record and table UI control.
|
||||
|
||||
|
||||
' Load data for chart.
|
||||
|
||||
|
||||
' initialize aspx controls
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
' An error has occured so display an error message.
|
||||
Utils.RegisterJScriptAlert(Me, "Page_Load_Error_Message", ex.Message)
|
||||
Finally
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' End database transaction
|
||||
DbUtils.EndTransaction()
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public EvaluateFormulaDelegate As BaseClasses.Data.DataSource.EvaluateFormulaDelegate = New BaseClasses.Data.DataSource.EvaluateFormulaDelegate(AddressOf Me.EvaluateFormula)
|
||||
|
||||
Public Overridable Function EvaluateFormula_Base(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS As Boolean) As String
|
||||
Dim e As FormulaEvaluator = New FormulaEvaluator()
|
||||
|
||||
' add variables for formula evaluation
|
||||
If variables IsNot Nothing Then
|
||||
Dim enumerator As System.Collections.Generic.IEnumerator(Of System.Collections.Generic.KeyValuePair(Of String, Object)) = variables.GetEnumerator()
|
||||
While enumerator.MoveNext()
|
||||
e.Variables.Add(enumerator.Current.Key, enumerator.Current.Value)
|
||||
End While
|
||||
End If
|
||||
|
||||
If includeDS
|
||||
|
||||
End If
|
||||
|
||||
|
||||
e.CallingControl = Me
|
||||
|
||||
e.DataSource = dataSourceForEvaluate
|
||||
|
||||
|
||||
Dim resultObj As Object = e.Evaluate(formula)
|
||||
If resultObj Is Nothing Then
|
||||
Return ""
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrEmpty(format) AndAlso (String.IsNullOrEmpty(formula) OrElse formula.IndexOf("Format(") < 0) Then
|
||||
Return FormulaUtils.Format(resultObj, format)
|
||||
Else
|
||||
Return resultObj.ToString()
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object)) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, format, variables, True)
|
||||
End Function
|
||||
|
||||
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal includeDS As Boolean) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, includeDS)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
' Write out the Set methods
|
||||
|
||||
|
||||
' Write out the DataSource properties and methods
|
||||
|
||||
|
||||
' Write out event methods for the page events
|
||||
|
||||
' event handler for LinkButton
|
||||
Public Sub Button_Click_Base(ByVal sender As Object, ByVal args As EventArgs)
|
||||
|
||||
Try
|
||||
|
||||
Catch ex As Exception
|
||||
Ctype(Me.Page, BaseApplicationPage).ErrorOnPage = True
|
||||
|
||||
' Report the error message to the end user
|
||||
Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", ex.Message)
|
||||
|
||||
Finally
|
||||
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
#Region "Interface Properties"
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property Button() As System.Web.UI.WebControls.LinkButton Implements IMenu_ItemVertical.Button
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_Button"), System.Web.UI.WebControls.LinkButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Property Visible() As Boolean Implements IMenu_ItemVertical.Visible
|
||||
|
||||
Get
|
||||
Return MyBase.Visible
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
MyBase.Visible = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Public Shadows ReadOnly Property Page() As BaseApplicationPage
|
||||
Get
|
||||
Return DirectCast(MyBase.Page, BaseApplicationPage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
|
||||
|
159
Shared/Menu_ItemVertical.xml
Normal file
159
Shared/Menu_ItemVertical.xml
Normal file
|
@ -0,0 +1,159 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<ComponentDefinition xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ironspeed.com/designer">
|
||||
<Generator>Iron Speed Designer</Generator>
|
||||
<Version>9.2.0</Version>
|
||||
<Self>
|
||||
<Name>Menu_ItemVertical</Name>
|
||||
<Type>Button</Type>
|
||||
<GenerateDirectory>Shared</GenerateDirectory>
|
||||
<Layout>Shared\Menu_ItemVertical.html</Layout>
|
||||
<DisplayName>Menu_ItemVertical</DisplayName>
|
||||
<Description>(Description)</Description>
|
||||
</Self>
|
||||
<ComposedOf>
|
||||
<ContainedComponent>
|
||||
<Name>Button</Name>
|
||||
<Type>LinkButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CssClass</Name>
|
||||
<Value>menu</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
</ComposedOf>
|
||||
|
||||
<LayoutDefinition><![CDATA[<?xml version="1.0" encoding="utf-16"?>
|
||||
<LayoutDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<Layout Name="Button" Type="RootLayout">
|
||||
|
||||
<TableAttributes>
|
||||
<Attribute>
|
||||
<Name>cellspacing</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>cellpadding</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>border</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<AttributeValue>this.style.cursor='pointer'; return true;</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onclick</Name>
|
||||
<AttributeValue>clickLinkButtonText(this, event);</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>width</Name>
|
||||
<AttributeValue>100%</AttributeValue>
|
||||
</Attribute>
|
||||
</TableAttributes>
|
||||
|
||||
<Prolog>
|
||||
<Value></Value>
|
||||
</Prolog>
|
||||
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvTL</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="1" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvT</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvTR</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="12" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvL</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:LINKBUTTON NAME="Button" CssClass="menu"/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvC</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="12" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvR</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="8" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvBL</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="8" width="1" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvB</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="8" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvBR</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<Epilog>
|
||||
<Value></Value>
|
||||
</Epilog>
|
||||
</Layout>
|
||||
|
||||
</LayoutDefinition>]]>
|
||||
</LayoutDefinition>
|
||||
</ComponentDefinition>
|
6
Shared/Menu_Item_Highlighted.ascx
Normal file
6
Shared/Menu_Item_Highlighted.ascx
Normal file
|
@ -0,0 +1,6 @@
|
|||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Register Tagprefix="Selectors" Namespace="Persons" %>
|
||||
|
||||
<%@ Control Language="vb" AutoEventWireup="false" CodeFile="Menu_Item_Highlighted.ascx.vb" Inherits="Persons.UI.Menu_Item_Highlighted" %>
|
||||
<%@ Register Tagprefix="BaseClasses" Namespace="BaseClasses.Web.UI.WebControls" Assembly="BaseClasses" %><table cellspacing="0" cellpadding="0" border="0" onmouseover="this.style.cursor='pointer'; return true;" onclick="clickLinkButtonText(this, event);"><tr><td class="moTL"><img src="../Images/space.gif" height="5" width="6" alt="" /></td><td class="moT"><img src="../Images/space.gif" height="5" width="1" alt="" /></td><td class="moTR"><img src="../Images/space.gif" height="5" width="9" alt="" /></td></tr><tr><td class="moL"><img src="../Images/space.gif" height="12" width="6" alt="" /></td><td class="moC"><asp:LinkButton CommandName="Redirect" runat="server" id="_Button" cssclass="menu">
|
||||
</asp:LinkButton></td><td class="moR"><img src="../Images/space.gif" height="12" width="9" alt="" /></td></tr><tr><td class="moBL"><img src="../Images/space.gif" height="5" width="6" alt="" /></td><td class="moB"><img src="../Images/space.gif" height="5" width="1" alt="" /></td><td class="moBR"><img src="../Images/space.gif" height="5" width="9" alt="" /></td></tr></table>
|
436
Shared/Menu_Item_Highlighted.ascx.vb
Normal file
436
Shared/Menu_Item_Highlighted.ascx.vb
Normal file
|
@ -0,0 +1,436 @@
|
|||
|
||||
Option Strict On
|
||||
Imports System
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports System.ComponentModel
|
||||
Imports BaseClasses
|
||||
Imports BaseClasses.Utils
|
||||
Imports BaseClasses.Web.UI.WebControls
|
||||
|
||||
Imports Persons.Business
|
||||
Imports Persons.Data
|
||||
|
||||
Namespace Persons.UI
|
||||
|
||||
' Code-behind class for the Menu_Item_Highlighted user control.
|
||||
Public Partial Class Menu_Item_Highlighted
|
||||
Inherits BaseApplicationUserControl
|
||||
Implements IMenu_Item_Highlighted
|
||||
#Region "Section 1: Place your customizations here."
|
||||
|
||||
Public Sub LoadData()
|
||||
' LoadData reads database data and assigns it to UI controls.
|
||||
' Customize by adding code before or after the call to LoadData_Base()
|
||||
' or replace the call to LoadData_Base().
|
||||
LoadData_Base()
|
||||
End Sub
|
||||
|
||||
#Region "Ajax Functions"
|
||||
|
||||
' <Services.WebMethod()> _
|
||||
' Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
' ByVal recordID As String, _
|
||||
' ByVal columnName As String, _
|
||||
' ByVal title As String, _
|
||||
' ByVal persist As Boolean, _
|
||||
' ByVal popupWindowHeight As Integer, _
|
||||
' ByVal popupWindowWidth As Integer, _
|
||||
' ByVal popupWindowScrollBar As Boolean _
|
||||
' ) As Object()
|
||||
' ' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' ' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' ' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' ' or replace the call to GetRecordFieldValue_Base().
|
||||
' Return GetRecordFieldValue_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
' End Function
|
||||
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetImage(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetImage gets the Image url for the image in the column "columnName" and
|
||||
' in the record specified by recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetImage_Base()
|
||||
' or replace the call to GetImage_Base().
|
||||
Return GetImage_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
' Page Event Handlers - buttons, sort, links
|
||||
|
||||
Public Sub Button_Click(ByVal sender As Object, ByVal args As EventArgs)
|
||||
|
||||
' Click handler for Button.
|
||||
' Customize by adding code before the call or replace the call to the Base function with your own code.
|
||||
Button_Click_Base(sender, args)
|
||||
' NOTE: If the Base function redirects to another page, any code here will not be executed.
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Overloads Overrides Sub BasePage_PreRender(ByVal sender As Object, ByVal e As EventArgs)
|
||||
MyBase.BasePage_PreRender(sender, e)
|
||||
Base_RegisterPostback()
|
||||
End Sub
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' or replace the call to GetRecordFieldValue_Base().
|
||||
Return GetRecordFieldValue_Base(tableName, recordID, columnName, fieldName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
Public Overrides Sub SetChartControl(ByVal chartCtrlName As String)
|
||||
Me.SetChartControl_Base(chartCtrlName)
|
||||
End Sub
|
||||
Public Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
|
||||
Me.Page_PreRender_Base(sender,e)
|
||||
End Sub
|
||||
Protected Overrides Function SaveViewState() As Object
|
||||
Return SaveViewState_Base()
|
||||
End Function
|
||||
Protected Overrides Sub LoadViewState(ByVal savedState As Object)
|
||||
LoadViewState_Base(savedState)
|
||||
End Sub
|
||||
Protected Overrides Sub ClearControlsFromSession()
|
||||
ClearControlsFromSession_Base()
|
||||
End Sub
|
||||
Protected Overrides Sub SaveControlsToSession()
|
||||
SaveControlsToSession_Base()
|
||||
End Sub
|
||||
Public Sub Page_InitializeEventHandlers(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Init
|
||||
' Handles MyBase.Init.
|
||||
' Register the Event handler for any Events.
|
||||
Me.Page_InitializeEventHandlers_Base(sender,e)
|
||||
End Sub
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate as BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS as Boolean) As String
|
||||
Return EvaluateFormula_Base(formula, dataSourceForEvaluate, format, variables, includeDS)
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "Section 2: Do not modify this section."
|
||||
|
||||
Protected Sub Page_InitializeEventHandlers_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
|
||||
' the following code for accordion is necessary or the Me.{ControlName} will return Nothing
|
||||
|
||||
' Register the Event handler for any Events.
|
||||
|
||||
|
||||
' Setup the pagination events.
|
||||
|
||||
AddHandler Me.Button.Click, AddressOf Button_Click
|
||||
|
||||
Me.ClearControlsFromSession()
|
||||
End Sub
|
||||
|
||||
Private Sub Base_RegisterPostback()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
' Handles MyBase.Load. Read database data and put into the UI controls.
|
||||
' If you need to, you can add additional Load handlers in Section 1.
|
||||
Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
|
||||
|
||||
If (Not Me.IsPostBack) Then
|
||||
|
||||
End If
|
||||
|
||||
|
||||
' Load data only when displaying the page for the first time or if postback from child window
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Read the data for all controls on the page.
|
||||
' To change the behavior, override the DataBind method for the individual
|
||||
' record or table UI controls.
|
||||
Me.LoadData()
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetRecordFieldValue_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
If Not IsNothing(recordID) Then
|
||||
recordID = System.Web.HttpUtility.UrlDecode(recordID)
|
||||
End If
|
||||
Dim content as String = BaseClasses.Utils.MiscUtils.GetFieldData(tableName, recordID, columnName)
|
||||
|
||||
content = NetUtils.EncodeStringForHtmlDisplay(content)
|
||||
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window
|
||||
'returnValue(1) represents content of the pop up window
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function GetImage_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
Dim content As String = "<IMG alt =""" & title & """ src =" & """../Shared/ExportFieldValue.aspx?Table=" & tableName & "&Field=" & columnName & "&Record=" & recordID & """/>"
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window.
|
||||
'returnValue(1) represents content ie, image url.
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
Public Sub SetChartControl_Base(ByVal chartCtrlName As String)
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub SaveControlsToSession_Base()
|
||||
MyBase.SaveControlsToSession()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub ClearControlsFromSession_Base()
|
||||
MyBase.ClearControlsFromSession()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LoadViewState_Base(ByVal savedState As Object)
|
||||
MyBase.LoadViewState(savedState)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Function SaveViewState_Base() As Object
|
||||
|
||||
Return MyBase.SaveViewState()
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub Page_PreRender_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
' Data bind for each chart UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
' Load data from database into UI controls.
|
||||
' Modify LoadData in Section 1 above to customize. Or override DataBind() in
|
||||
' the individual table and record controls to customize.
|
||||
Public Sub LoadData_Base()
|
||||
Try
|
||||
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Must start a transaction before performing database operations
|
||||
DbUtils.StartTransaction()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Me.DataBind()
|
||||
|
||||
' Load and bind data for each record and table UI control.
|
||||
|
||||
|
||||
' Load data for chart.
|
||||
|
||||
|
||||
' initialize aspx controls
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
' An error has occured so display an error message.
|
||||
Utils.RegisterJScriptAlert(Me, "Page_Load_Error_Message", ex.Message)
|
||||
Finally
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' End database transaction
|
||||
DbUtils.EndTransaction()
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public EvaluateFormulaDelegate As BaseClasses.Data.DataSource.EvaluateFormulaDelegate = New BaseClasses.Data.DataSource.EvaluateFormulaDelegate(AddressOf Me.EvaluateFormula)
|
||||
|
||||
Public Overridable Function EvaluateFormula_Base(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS As Boolean) As String
|
||||
Dim e As FormulaEvaluator = New FormulaEvaluator()
|
||||
|
||||
' add variables for formula evaluation
|
||||
If variables IsNot Nothing Then
|
||||
Dim enumerator As System.Collections.Generic.IEnumerator(Of System.Collections.Generic.KeyValuePair(Of String, Object)) = variables.GetEnumerator()
|
||||
While enumerator.MoveNext()
|
||||
e.Variables.Add(enumerator.Current.Key, enumerator.Current.Value)
|
||||
End While
|
||||
End If
|
||||
|
||||
If includeDS
|
||||
|
||||
End If
|
||||
|
||||
|
||||
e.CallingControl = Me
|
||||
|
||||
e.DataSource = dataSourceForEvaluate
|
||||
|
||||
|
||||
Dim resultObj As Object = e.Evaluate(formula)
|
||||
If resultObj Is Nothing Then
|
||||
Return ""
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrEmpty(format) AndAlso (String.IsNullOrEmpty(formula) OrElse formula.IndexOf("Format(") < 0) Then
|
||||
Return FormulaUtils.Format(resultObj, format)
|
||||
Else
|
||||
Return resultObj.ToString()
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object)) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, format, variables, True)
|
||||
End Function
|
||||
|
||||
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal includeDS As Boolean) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, includeDS)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
' Write out the Set methods
|
||||
|
||||
|
||||
' Write out the DataSource properties and methods
|
||||
|
||||
|
||||
' Write out event methods for the page events
|
||||
|
||||
' event handler for LinkButton
|
||||
Public Sub Button_Click_Base(ByVal sender As Object, ByVal args As EventArgs)
|
||||
|
||||
Try
|
||||
|
||||
Catch ex As Exception
|
||||
Ctype(Me.Page, BaseApplicationPage).ErrorOnPage = True
|
||||
|
||||
' Report the error message to the end user
|
||||
Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", ex.Message)
|
||||
|
||||
Finally
|
||||
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
#Region "Interface Properties"
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property Button() As System.Web.UI.WebControls.LinkButton Implements IMenu_Item_Highlighted.Button
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_Button"), System.Web.UI.WebControls.LinkButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Property Visible() As Boolean Implements IMenu_Item_Highlighted.Visible
|
||||
|
||||
Get
|
||||
Return MyBase.Visible
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
MyBase.Visible = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Public Shadows ReadOnly Property Page() As BaseApplicationPage
|
||||
Get
|
||||
Return DirectCast(MyBase.Page, BaseApplicationPage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
|
||||
|
154
Shared/Menu_Item_Highlighted.xml
Normal file
154
Shared/Menu_Item_Highlighted.xml
Normal file
|
@ -0,0 +1,154 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<ComponentDefinition xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ironspeed.com/designer">
|
||||
<Generator>Iron Speed Designer</Generator>
|
||||
<Version>9.2.0</Version>
|
||||
<Self>
|
||||
<Name>Menu_Item_Highlighted</Name>
|
||||
<Type>Button</Type>
|
||||
<GenerateDirectory>Shared</GenerateDirectory>
|
||||
<Layout>Shared\Menu_Item_Highlighted.html</Layout>
|
||||
<DisplayName>Menu_Item_Highlighted</DisplayName>
|
||||
<Description>(Description)</Description>
|
||||
</Self>
|
||||
<ComposedOf>
|
||||
<ContainedComponent>
|
||||
<Name>Button</Name>
|
||||
<Type>LinkButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CssClass</Name>
|
||||
<Value>menu</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
</ComposedOf>
|
||||
<LayoutDefinition><![CDATA[<?xml version="1.0" encoding="utf-16"?>
|
||||
<LayoutDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<Layout Name="Button" Type="RootLayout">
|
||||
|
||||
<TableAttributes>
|
||||
<Attribute>
|
||||
<Name>cellspacing</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>cellpadding</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>border</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<AttributeValue>this.style.cursor='pointer'; return true;</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onclick</Name>
|
||||
<AttributeValue>clickLinkButtonText(this, event);</AttributeValue>
|
||||
</Attribute>
|
||||
</TableAttributes>
|
||||
|
||||
<Prolog>
|
||||
<Value></Value>
|
||||
</Prolog>
|
||||
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>moTL</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="1" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>moT</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="9" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>moTR</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="12" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>moL</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:LINKBUTTON NAME="Button" CssClass="menu"/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>moC</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="12" width="9" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>moR</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>moBL</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="1" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>moB</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="9" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>moBR</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<Epilog>
|
||||
<Value></Value>
|
||||
</Epilog>
|
||||
</Layout>
|
||||
|
||||
</LayoutDefinition>]]>
|
||||
</LayoutDefinition>
|
||||
</ComponentDefinition>
|
6
Shared/Menu_Item_HighlightedVertical.ascx
Normal file
6
Shared/Menu_Item_HighlightedVertical.ascx
Normal file
|
@ -0,0 +1,6 @@
|
|||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Register Tagprefix="Selectors" Namespace="Persons" %>
|
||||
|
||||
<%@ Register Tagprefix="BaseClasses" Namespace="BaseClasses.Web.UI.WebControls" Assembly="BaseClasses" %>
|
||||
<%@ Control Language="vb" AutoEventWireup="false" CodeFile="Menu_Item_HighlightedVertical.ascx.vb" Inherits="Persons.UI.Menu_Item_HighlightedVertical" %><table cellspacing="0" cellpadding="0" border="0" onmouseover="this.style.cursor='pointer'; return true;" onclick="clickLinkButtonText(this, event);" width="100%"><tr><td class="mvoTL"><img src="../Images/space.gif" height="5" width="6" alt="" /></td><td class="mvoT"><img src="../Images/space.gif" height="5" width="1" alt="" /></td><td class="mvoTR"><img src="../Images/space.gif" height="5" width="6" alt="" /></td></tr><tr><td class="mvoL"><img src="../Images/space.gif" height="12" width="6" alt="" /></td><td class="mvoC"><asp:LinkButton CommandName="Redirect" runat="server" id="_Button" cssclass="menu">
|
||||
</asp:LinkButton></td><td class="mvoR"><img src="../Images/space.gif" height="12" width="6" alt="" /></td></tr><tr><td class="mvoBL"><img src="../Images/space.gif" height="8" width="6" alt="" /></td><td class="mvoB"><img src="../Images/space.gif" height="8" width="1" alt="" /></td><td class="mvoBR"><img src="../Images/space.gif" height="8" width="6" alt="" /></td></tr></table>
|
436
Shared/Menu_Item_HighlightedVertical.ascx.vb
Normal file
436
Shared/Menu_Item_HighlightedVertical.ascx.vb
Normal file
|
@ -0,0 +1,436 @@
|
|||
|
||||
Option Strict On
|
||||
Imports System
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports System.ComponentModel
|
||||
Imports BaseClasses
|
||||
Imports BaseClasses.Utils
|
||||
Imports BaseClasses.Web.UI.WebControls
|
||||
|
||||
Imports Persons.Business
|
||||
Imports Persons.Data
|
||||
|
||||
Namespace Persons.UI
|
||||
|
||||
' Code-behind class for the Menu_Item_HighlightedVertical user control.
|
||||
Public Partial Class Menu_Item_HighlightedVertical
|
||||
Inherits BaseApplicationUserControl
|
||||
Implements IMenu_Item_HighlightedVertical
|
||||
#Region "Section 1: Place your customizations here."
|
||||
|
||||
Public Sub LoadData()
|
||||
' LoadData reads database data and assigns it to UI controls.
|
||||
' Customize by adding code before or after the call to LoadData_Base()
|
||||
' or replace the call to LoadData_Base().
|
||||
LoadData_Base()
|
||||
End Sub
|
||||
|
||||
#Region "Ajax Functions"
|
||||
|
||||
' <Services.WebMethod()> _
|
||||
' Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
' ByVal recordID As String, _
|
||||
' ByVal columnName As String, _
|
||||
' ByVal title As String, _
|
||||
' ByVal persist As Boolean, _
|
||||
' ByVal popupWindowHeight As Integer, _
|
||||
' ByVal popupWindowWidth As Integer, _
|
||||
' ByVal popupWindowScrollBar As Boolean _
|
||||
' ) As Object()
|
||||
' ' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' ' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' ' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' ' or replace the call to GetRecordFieldValue_Base().
|
||||
' Return GetRecordFieldValue_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
' End Function
|
||||
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetImage(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetImage gets the Image url for the image in the column "columnName" and
|
||||
' in the record specified by recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetImage_Base()
|
||||
' or replace the call to GetImage_Base().
|
||||
Return GetImage_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
' Page Event Handlers - buttons, sort, links
|
||||
|
||||
Public Sub Button_Click(ByVal sender As Object, ByVal args As EventArgs)
|
||||
|
||||
' Click handler for Button.
|
||||
' Customize by adding code before the call or replace the call to the Base function with your own code.
|
||||
Button_Click_Base(sender, args)
|
||||
' NOTE: If the Base function redirects to another page, any code here will not be executed.
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Overloads Overrides Sub BasePage_PreRender(ByVal sender As Object, ByVal e As EventArgs)
|
||||
MyBase.BasePage_PreRender(sender, e)
|
||||
Base_RegisterPostback()
|
||||
End Sub
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' or replace the call to GetRecordFieldValue_Base().
|
||||
Return GetRecordFieldValue_Base(tableName, recordID, columnName, fieldName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
Public Overrides Sub SetChartControl(ByVal chartCtrlName As String)
|
||||
Me.SetChartControl_Base(chartCtrlName)
|
||||
End Sub
|
||||
Public Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
|
||||
Me.Page_PreRender_Base(sender,e)
|
||||
End Sub
|
||||
Protected Overrides Function SaveViewState() As Object
|
||||
Return SaveViewState_Base()
|
||||
End Function
|
||||
Protected Overrides Sub LoadViewState(ByVal savedState As Object)
|
||||
LoadViewState_Base(savedState)
|
||||
End Sub
|
||||
Protected Overrides Sub ClearControlsFromSession()
|
||||
ClearControlsFromSession_Base()
|
||||
End Sub
|
||||
Protected Overrides Sub SaveControlsToSession()
|
||||
SaveControlsToSession_Base()
|
||||
End Sub
|
||||
Public Sub Page_InitializeEventHandlers(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Init
|
||||
' Handles MyBase.Init.
|
||||
' Register the Event handler for any Events.
|
||||
Me.Page_InitializeEventHandlers_Base(sender,e)
|
||||
End Sub
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate as BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS as Boolean) As String
|
||||
Return EvaluateFormula_Base(formula, dataSourceForEvaluate, format, variables, includeDS)
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "Section 2: Do not modify this section."
|
||||
|
||||
Protected Sub Page_InitializeEventHandlers_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
|
||||
' the following code for accordion is necessary or the Me.{ControlName} will return Nothing
|
||||
|
||||
' Register the Event handler for any Events.
|
||||
|
||||
|
||||
' Setup the pagination events.
|
||||
|
||||
AddHandler Me.Button.Click, AddressOf Button_Click
|
||||
|
||||
Me.ClearControlsFromSession()
|
||||
End Sub
|
||||
|
||||
Private Sub Base_RegisterPostback()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
' Handles MyBase.Load. Read database data and put into the UI controls.
|
||||
' If you need to, you can add additional Load handlers in Section 1.
|
||||
Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
|
||||
|
||||
If (Not Me.IsPostBack) Then
|
||||
|
||||
End If
|
||||
|
||||
|
||||
' Load data only when displaying the page for the first time or if postback from child window
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Read the data for all controls on the page.
|
||||
' To change the behavior, override the DataBind method for the individual
|
||||
' record or table UI controls.
|
||||
Me.LoadData()
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetRecordFieldValue_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
If Not IsNothing(recordID) Then
|
||||
recordID = System.Web.HttpUtility.UrlDecode(recordID)
|
||||
End If
|
||||
Dim content as String = BaseClasses.Utils.MiscUtils.GetFieldData(tableName, recordID, columnName)
|
||||
|
||||
content = NetUtils.EncodeStringForHtmlDisplay(content)
|
||||
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window
|
||||
'returnValue(1) represents content of the pop up window
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function GetImage_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
Dim content As String = "<IMG alt =""" & title & """ src =" & """../Shared/ExportFieldValue.aspx?Table=" & tableName & "&Field=" & columnName & "&Record=" & recordID & """/>"
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window.
|
||||
'returnValue(1) represents content ie, image url.
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
Public Sub SetChartControl_Base(ByVal chartCtrlName As String)
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub SaveControlsToSession_Base()
|
||||
MyBase.SaveControlsToSession()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub ClearControlsFromSession_Base()
|
||||
MyBase.ClearControlsFromSession()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LoadViewState_Base(ByVal savedState As Object)
|
||||
MyBase.LoadViewState(savedState)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Function SaveViewState_Base() As Object
|
||||
|
||||
Return MyBase.SaveViewState()
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub Page_PreRender_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
' Data bind for each chart UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
' Load data from database into UI controls.
|
||||
' Modify LoadData in Section 1 above to customize. Or override DataBind() in
|
||||
' the individual table and record controls to customize.
|
||||
Public Sub LoadData_Base()
|
||||
Try
|
||||
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Must start a transaction before performing database operations
|
||||
DbUtils.StartTransaction()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Me.DataBind()
|
||||
|
||||
' Load and bind data for each record and table UI control.
|
||||
|
||||
|
||||
' Load data for chart.
|
||||
|
||||
|
||||
' initialize aspx controls
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
' An error has occured so display an error message.
|
||||
Utils.RegisterJScriptAlert(Me, "Page_Load_Error_Message", ex.Message)
|
||||
Finally
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' End database transaction
|
||||
DbUtils.EndTransaction()
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public EvaluateFormulaDelegate As BaseClasses.Data.DataSource.EvaluateFormulaDelegate = New BaseClasses.Data.DataSource.EvaluateFormulaDelegate(AddressOf Me.EvaluateFormula)
|
||||
|
||||
Public Overridable Function EvaluateFormula_Base(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS As Boolean) As String
|
||||
Dim e As FormulaEvaluator = New FormulaEvaluator()
|
||||
|
||||
' add variables for formula evaluation
|
||||
If variables IsNot Nothing Then
|
||||
Dim enumerator As System.Collections.Generic.IEnumerator(Of System.Collections.Generic.KeyValuePair(Of String, Object)) = variables.GetEnumerator()
|
||||
While enumerator.MoveNext()
|
||||
e.Variables.Add(enumerator.Current.Key, enumerator.Current.Value)
|
||||
End While
|
||||
End If
|
||||
|
||||
If includeDS
|
||||
|
||||
End If
|
||||
|
||||
|
||||
e.CallingControl = Me
|
||||
|
||||
e.DataSource = dataSourceForEvaluate
|
||||
|
||||
|
||||
Dim resultObj As Object = e.Evaluate(formula)
|
||||
If resultObj Is Nothing Then
|
||||
Return ""
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrEmpty(format) AndAlso (String.IsNullOrEmpty(formula) OrElse formula.IndexOf("Format(") < 0) Then
|
||||
Return FormulaUtils.Format(resultObj, format)
|
||||
Else
|
||||
Return resultObj.ToString()
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object)) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, format, variables, True)
|
||||
End Function
|
||||
|
||||
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal includeDS As Boolean) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, includeDS)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
' Write out the Set methods
|
||||
|
||||
|
||||
' Write out the DataSource properties and methods
|
||||
|
||||
|
||||
' Write out event methods for the page events
|
||||
|
||||
' event handler for LinkButton
|
||||
Public Sub Button_Click_Base(ByVal sender As Object, ByVal args As EventArgs)
|
||||
|
||||
Try
|
||||
|
||||
Catch ex As Exception
|
||||
Ctype(Me.Page, BaseApplicationPage).ErrorOnPage = True
|
||||
|
||||
' Report the error message to the end user
|
||||
Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", ex.Message)
|
||||
|
||||
Finally
|
||||
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
#Region "Interface Properties"
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property Button() As System.Web.UI.WebControls.LinkButton Implements IMenu_Item_HighlightedVertical.Button
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_Button"), System.Web.UI.WebControls.LinkButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Property Visible() As Boolean Implements IMenu_Item_HighlightedVertical.Visible
|
||||
|
||||
Get
|
||||
Return MyBase.Visible
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
MyBase.Visible = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Public Shadows ReadOnly Property Page() As BaseApplicationPage
|
||||
Get
|
||||
Return DirectCast(MyBase.Page, BaseApplicationPage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
|
||||
|
159
Shared/Menu_Item_HighlightedVertical.xml
Normal file
159
Shared/Menu_Item_HighlightedVertical.xml
Normal file
|
@ -0,0 +1,159 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<ComponentDefinition xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ironspeed.com/designer">
|
||||
<Generator>Iron Speed Designer</Generator>
|
||||
<Version>9.2.0</Version>
|
||||
<Self>
|
||||
<Name>Menu_Item_HighlightedVertical</Name>
|
||||
<Type>Button</Type>
|
||||
<GenerateDirectory>Shared</GenerateDirectory>
|
||||
<Layout>Shared\Menu_Item_HighlightedVertical.html</Layout>
|
||||
<DisplayName>Menu_Item_HighlightedVertical</DisplayName>
|
||||
<Description>(Description)</Description>
|
||||
</Self>
|
||||
<ComposedOf>
|
||||
<ContainedComponent>
|
||||
<Name>Button</Name>
|
||||
<Type>LinkButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CssClass</Name>
|
||||
<Value>menu</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
</ComposedOf>
|
||||
|
||||
<LayoutDefinition><![CDATA[<?xml version="1.0" encoding="utf-16"?>
|
||||
<LayoutDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<Layout Name="Button" Type="RootLayout">
|
||||
|
||||
<TableAttributes>
|
||||
<Attribute>
|
||||
<Name>cellspacing</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>cellpadding</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>border</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<AttributeValue>this.style.cursor='pointer'; return true;</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onclick</Name>
|
||||
<AttributeValue>clickLinkButtonText(this, event);</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>width</Name>
|
||||
<AttributeValue>100%</AttributeValue>
|
||||
</Attribute>
|
||||
</TableAttributes>
|
||||
|
||||
<Prolog>
|
||||
<Value></Value>
|
||||
</Prolog>
|
||||
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvoTL</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="1" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvoT</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="5" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvoTR</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="12" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvoL</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:LINKBUTTON NAME="Button" CssClass="menu"/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvoC</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="12" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvoR</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="8" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvoBL</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="8" width="1" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvoB</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" height="8" width="6" alt=""/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>mvoBR</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<Epilog>
|
||||
<Value></Value>
|
||||
</Epilog>
|
||||
</Layout>
|
||||
|
||||
</LayoutDefinition>]]>
|
||||
</LayoutDefinition>
|
||||
</ComponentDefinition>
|
10
Shared/Pagination.ascx
Normal file
10
Shared/Pagination.ascx
Normal file
|
@ -0,0 +1,10 @@
|
|||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Control Language="vb" AutoEventWireup="false" CodeFile="Pagination.ascx.vb" Inherits="Persons.UI.Pagination" %>
|
||||
<%@ Register Tagprefix="Selectors" Namespace="Persons" %>
|
||||
|
||||
<%@ Register Tagprefix="BaseClasses" Namespace="BaseClasses.Web.UI.WebControls" Assembly="BaseClasses" %><table style="width: 100%" border="0" cellpadding="0" cellspacing="0"><tr><td style="width: 50%"><img src="../Images/space.gif" width="10" height="1" alt="" /></td><td><img src="../Images/ButtonBarEdgeL.gif" alt="" /></td><td><img src="../Images/ButtonBarDivider.gif" alt="" /></td><td><asp:ImageButton runat="server" id="_FirstPage" causesvalidation="False" commandname="FirstPage" imageurl="../Images/ButtonBarFirst.gif" onmouseout="this.src='../Images/ButtonBarFirst.gif'" onmouseover="this.src='../Images/ButtonBarFirstOver.gif'" tooltip="<%# GetResourceValue("Btn:FirstPage", "Persons") %>">
|
||||
</asp:ImageButton></td><td><img src="../Images/ButtonBarDivider.gif" alt="" /></td><td><asp:ImageButton runat="server" id="_PreviousPage" causesvalidation="False" commandname="PreviousPage" imageurl="../Images/ButtonBarPrevious.gif" onmouseout="this.src='../Images/ButtonBarPrevious.gif'" onmouseover="this.src='../Images/ButtonBarPreviousOver.gif'" tooltip="<%# GetResourceValue("Btn:PreviousPage", "Persons") %>">
|
||||
</asp:ImageButton></td><td><img src="../Images/ButtonBarDivider.gif" alt="" /></td><td class="prbg"><%= SystemUtils.GenerateEnterKeyCaptureBeginTag(FindControl("_PageSizeButton")) %><asp:TextBox runat="server" id="_CurrentPage" cssclass="Pagination_Input" maxlength="10" size="5"> </asp:TextBox><%= SystemUtils.GenerateEnterKeyCaptureEndTag(FindControl("_PageSizeButton")) %></td><td class="prbg"><%# GetResourceValue("Txt:Of", "Persons") %> <b><asp:Label runat="server" id="_TotalPages"> </asp:Label></b></td><td><img src="../Images/ButtonBarDivider.gif" alt="" /></td><td><asp:ImageButton runat="server" id="_NextPage" causesvalidation="False" commandname="NextPage" imageurl="../Images/ButtonBarNext.gif" onmouseout="this.src='../Images/ButtonBarNext.gif'" onmouseover="this.src='../Images/ButtonBarNextOver.gif'" tooltip="<%# GetResourceValue("Btn:NextPage", "Persons") %>">
|
||||
</asp:ImageButton></td><td><img src="../Images/ButtonBarDivider.gif" alt="" /></td><td><asp:ImageButton runat="server" id="_LastPage" causesvalidation="False" commandname="LastPage" imageurl="../Images/ButtonBarLast.gif" onmouseout="this.src='../Images/ButtonBarLast.gif'" onmouseover="this.src='../Images/ButtonBarLastOver.gif'" tooltip="<%# GetResourceValue("Btn:LastPage", "Persons") %>">
|
||||
</asp:ImageButton></td><td><img src="../Images/ButtonBarPageItemDivider.gif" alt="" /></td><td class="prbg"><b><asp:Label runat="server" id="_TotalItems"> </asp:Label></b> <%# GetResourceValue("Txt:Items", "Persons") %></td><td><img src="../Images/ButtonBarDivider.gif" alt="" /></td><td class="prbg"><%= SystemUtils.GenerateEnterKeyCaptureBeginTag(FindControl("_PageSizeButton")) %><asp:TextBox runat="server" id="_PageSize" cssclass="Pagination_Input" maxlength="5" size="5"> </asp:TextBox><%= SystemUtils.GenerateEnterKeyCaptureEndTag(FindControl("_PageSizeButton")) %></td><td class="prbg">/</td><td class="prbggo"><asp:LinkButton runat="server" id="_PageSizeButton" causesvalidation="False" commandname="PageSize" cssclass="button_link" text="<%# GetResourceValue("Txt:Page", "Persons") %>">
|
||||
</asp:LinkButton></td><td style="width: 50%"><img src="../Images/ButtonBarEdgeR.gif" alt="" /></td></tr></table>
|
501
Shared/Pagination.ascx.vb
Normal file
501
Shared/Pagination.ascx.vb
Normal file
|
@ -0,0 +1,501 @@
|
|||
|
||||
Option Strict On
|
||||
Imports System
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports System.ComponentModel
|
||||
Imports BaseClasses
|
||||
Imports BaseClasses.Utils
|
||||
Imports BaseClasses.Web.UI.WebControls
|
||||
|
||||
Imports Persons.Business
|
||||
Imports Persons.Data
|
||||
|
||||
Namespace Persons.UI
|
||||
|
||||
' Code-behind class for the Pagination user control.
|
||||
Public Partial Class Pagination
|
||||
Inherits BaseApplicationUserControl
|
||||
Implements IPagination
|
||||
#Region "Section 1: Place your customizations here."
|
||||
|
||||
Public Sub LoadData()
|
||||
' LoadData reads database data and assigns it to UI controls.
|
||||
' Customize by adding code before or after the call to LoadData_Base()
|
||||
' or replace the call to LoadData_Base().
|
||||
LoadData_Base()
|
||||
End Sub
|
||||
|
||||
#Region "Ajax Functions"
|
||||
|
||||
' <Services.WebMethod()> _
|
||||
' Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
' ByVal recordID As String, _
|
||||
' ByVal columnName As String, _
|
||||
' ByVal title As String, _
|
||||
' ByVal persist As Boolean, _
|
||||
' ByVal popupWindowHeight As Integer, _
|
||||
' ByVal popupWindowWidth As Integer, _
|
||||
' ByVal popupWindowScrollBar As Boolean _
|
||||
' ) As Object()
|
||||
' ' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' ' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' ' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' ' or replace the call to GetRecordFieldValue_Base().
|
||||
' Return GetRecordFieldValue_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
' End Function
|
||||
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetImage(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetImage gets the Image url for the image in the column "columnName" and
|
||||
' in the record specified by recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetImage_Base()
|
||||
' or replace the call to GetImage_Base().
|
||||
Return GetImage_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
' Page Event Handlers - buttons, sort, links
|
||||
|
||||
|
||||
|
||||
Protected Overloads Overrides Sub BasePage_PreRender(ByVal sender As Object, ByVal e As EventArgs)
|
||||
MyBase.BasePage_PreRender(sender, e)
|
||||
Base_RegisterPostback()
|
||||
End Sub
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' or replace the call to GetRecordFieldValue_Base().
|
||||
Return GetRecordFieldValue_Base(tableName, recordID, columnName, fieldName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
Public Overrides Sub SetChartControl(ByVal chartCtrlName As String)
|
||||
Me.SetChartControl_Base(chartCtrlName)
|
||||
End Sub
|
||||
Public Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
|
||||
Me.Page_PreRender_Base(sender,e)
|
||||
End Sub
|
||||
Protected Overrides Function SaveViewState() As Object
|
||||
Return SaveViewState_Base()
|
||||
End Function
|
||||
Protected Overrides Sub LoadViewState(ByVal savedState As Object)
|
||||
LoadViewState_Base(savedState)
|
||||
End Sub
|
||||
Protected Overrides Sub ClearControlsFromSession()
|
||||
ClearControlsFromSession_Base()
|
||||
End Sub
|
||||
Protected Overrides Sub SaveControlsToSession()
|
||||
SaveControlsToSession_Base()
|
||||
End Sub
|
||||
Public Sub Page_InitializeEventHandlers(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Init
|
||||
' Handles MyBase.Init.
|
||||
' Register the Event handler for any Events.
|
||||
Me.Page_InitializeEventHandlers_Base(sender,e)
|
||||
End Sub
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate as BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS as Boolean) As String
|
||||
Return EvaluateFormula_Base(formula, dataSourceForEvaluate, format, variables, includeDS)
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "Section 2: Do not modify this section."
|
||||
|
||||
Protected Sub Page_InitializeEventHandlers_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
|
||||
' the following code for accordion is necessary or the Me.{ControlName} will return Nothing
|
||||
|
||||
' Register the Event handler for any Events.
|
||||
|
||||
|
||||
' Setup the pagination events.
|
||||
|
||||
Me.ClearControlsFromSession()
|
||||
End Sub
|
||||
|
||||
Private Sub Base_RegisterPostback()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
' Handles MyBase.Load. Read database data and put into the UI controls.
|
||||
' If you need to, you can add additional Load handlers in Section 1.
|
||||
Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
|
||||
If ( Me.IsPostBack ) Then
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If (Not Me.IsPostBack) Then
|
||||
|
||||
End If
|
||||
|
||||
|
||||
' Load data only when displaying the page for the first time or if postback from child window
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Read the data for all controls on the page.
|
||||
' To change the behavior, override the DataBind method for the individual
|
||||
' record or table UI controls.
|
||||
Me.LoadData()
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetRecordFieldValue_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
If Not IsNothing(recordID) Then
|
||||
recordID = System.Web.HttpUtility.UrlDecode(recordID)
|
||||
End If
|
||||
Dim content as String = BaseClasses.Utils.MiscUtils.GetFieldData(tableName, recordID, columnName)
|
||||
|
||||
content = NetUtils.EncodeStringForHtmlDisplay(content)
|
||||
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window
|
||||
'returnValue(1) represents content of the pop up window
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function GetImage_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
Dim content As String = "<IMG alt =""" & title & """ src =" & """../Shared/ExportFieldValue.aspx?Table=" & tableName & "&Field=" & columnName & "&Record=" & recordID & """/>"
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window.
|
||||
'returnValue(1) represents content ie, image url.
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
Public Sub SetChartControl_Base(ByVal chartCtrlName As String)
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub SaveControlsToSession_Base()
|
||||
MyBase.SaveControlsToSession()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub ClearControlsFromSession_Base()
|
||||
MyBase.ClearControlsFromSession()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LoadViewState_Base(ByVal savedState As Object)
|
||||
MyBase.LoadViewState(savedState)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Function SaveViewState_Base() As Object
|
||||
|
||||
Return MyBase.SaveViewState()
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub Page_PreRender_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
' Data bind for each chart UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
' Load data from database into UI controls.
|
||||
' Modify LoadData in Section 1 above to customize. Or override DataBind() in
|
||||
' the individual table and record controls to customize.
|
||||
Public Sub LoadData_Base()
|
||||
Try
|
||||
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Must start a transaction before performing database operations
|
||||
DbUtils.StartTransaction()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Me.DataBind()
|
||||
|
||||
' Load and bind data for each record and table UI control.
|
||||
|
||||
|
||||
' Load data for chart.
|
||||
|
||||
|
||||
' initialize aspx controls
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
' An error has occured so display an error message.
|
||||
Utils.RegisterJScriptAlert(Me, "Page_Load_Error_Message", ex.Message)
|
||||
Finally
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' End database transaction
|
||||
DbUtils.EndTransaction()
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public EvaluateFormulaDelegate As BaseClasses.Data.DataSource.EvaluateFormulaDelegate = New BaseClasses.Data.DataSource.EvaluateFormulaDelegate(AddressOf Me.EvaluateFormula)
|
||||
|
||||
Public Overridable Function EvaluateFormula_Base(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS As Boolean) As String
|
||||
Dim e As FormulaEvaluator = New FormulaEvaluator()
|
||||
|
||||
' add variables for formula evaluation
|
||||
If variables IsNot Nothing Then
|
||||
Dim enumerator As System.Collections.Generic.IEnumerator(Of System.Collections.Generic.KeyValuePair(Of String, Object)) = variables.GetEnumerator()
|
||||
While enumerator.MoveNext()
|
||||
e.Variables.Add(enumerator.Current.Key, enumerator.Current.Value)
|
||||
End While
|
||||
End If
|
||||
|
||||
If includeDS
|
||||
|
||||
End If
|
||||
|
||||
|
||||
e.CallingControl = Me
|
||||
|
||||
e.DataSource = dataSourceForEvaluate
|
||||
|
||||
|
||||
Dim resultObj As Object = e.Evaluate(formula)
|
||||
If resultObj Is Nothing Then
|
||||
Return ""
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrEmpty(format) AndAlso (String.IsNullOrEmpty(formula) OrElse formula.IndexOf("Format(") < 0) Then
|
||||
Return FormulaUtils.Format(resultObj, format)
|
||||
Else
|
||||
Return resultObj.ToString()
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object)) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, format, variables, True)
|
||||
End Function
|
||||
|
||||
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal includeDS As Boolean) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, includeDS)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
' Write out the Set methods
|
||||
|
||||
|
||||
' Write out the DataSource properties and methods
|
||||
|
||||
|
||||
' Write out event methods for the page events
|
||||
|
||||
#Region "Interface Properties"
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property CurrentPage() As System.Web.UI.WebControls.TextBox Implements IPagination.CurrentPage
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_CurrentPage"), System.Web.UI.WebControls.TextBox)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property FirstPage() As System.Web.UI.WebControls.ImageButton Implements IPagination.FirstPage
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_FirstPage"), System.Web.UI.WebControls.ImageButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property LastPage() As System.Web.UI.WebControls.ImageButton Implements IPagination.LastPage
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_LastPage"), System.Web.UI.WebControls.ImageButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property NextPage() As System.Web.UI.WebControls.ImageButton Implements IPagination.NextPage
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_NextPage"), System.Web.UI.WebControls.ImageButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property PageSize() As System.Web.UI.WebControls.TextBox Implements IPagination.PageSize
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_PageSize"), System.Web.UI.WebControls.TextBox)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property PageSizeButton() As System.Web.UI.WebControls.LinkButton Implements IPagination.PageSizeButton
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_PageSizeButton"), System.Web.UI.WebControls.LinkButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property PreviousPage() As System.Web.UI.WebControls.ImageButton Implements IPagination.PreviousPage
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_PreviousPage"), System.Web.UI.WebControls.ImageButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property TotalItems() As System.Web.UI.WebControls.Label Implements IPagination.TotalItems
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_TotalItems"), System.Web.UI.WebControls.Label)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property TotalPages() As System.Web.UI.WebControls.Label Implements IPagination.TotalPages
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_TotalPages"), System.Web.UI.WebControls.Label)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Property Visible() As Boolean Implements IPagination.Visible
|
||||
|
||||
Get
|
||||
Return MyBase.Visible
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
MyBase.Visible = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Public Shadows ReadOnly Property Page() As BaseApplicationPage
|
||||
Get
|
||||
Return DirectCast(MyBase.Page, BaseApplicationPage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
|
||||
|
421
Shared/Pagination.xml
Normal file
421
Shared/Pagination.xml
Normal file
|
@ -0,0 +1,421 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<ComponentDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.ironspeed.com/designer">
|
||||
<Generator>Iron Speed Designer</Generator>
|
||||
<Version>9.2.0</Version>
|
||||
<Self>
|
||||
<Name>Pagination</Name>
|
||||
<Type>Pagination</Type>
|
||||
<GenerateDirectory>Shared</GenerateDirectory>
|
||||
<Layout>Shared\Pagination.html</Layout>
|
||||
<DisplayName>Pagination</DisplayName>
|
||||
<Description>(Description)</Description>
|
||||
</Self>
|
||||
<ComposedOf>
|
||||
<ContainedComponent>
|
||||
<Name>CurrentPage</Name>
|
||||
<Type>TextBox</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CssClass</Name>
|
||||
<Value>Pagination_Input</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>EnableIncrementDecrementButtons</Name>
|
||||
<Value>Default</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>MaxLength</Name>
|
||||
<Value>10</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Size</Name>
|
||||
<Value>5</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>FirstPage</Name>
|
||||
<Type>ImageButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>FirstPage</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ImageURL</Name>
|
||||
<Value>../Images/ButtonBarFirst.gif</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseout</Name>
|
||||
<Value>this.src='../Images/ButtonBarFirst.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<Value>this.src='../Images/ButtonBarFirstOver.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:FirstPage</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>LastPage</Name>
|
||||
<Type>ImageButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>LastPage</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ImageURL</Name>
|
||||
<Value>../Images/ButtonBarLast.gif</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseout</Name>
|
||||
<Value>this.src='../Images/ButtonBarLast.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<Value>this.src='../Images/ButtonBarLastOver.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:LastPage</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>NextPage</Name>
|
||||
<Type>ImageButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>NextPage</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ImageURL</Name>
|
||||
<Value>../Images/ButtonBarNext.gif</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseout</Name>
|
||||
<Value>this.src='../Images/ButtonBarNext.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<Value>this.src='../Images/ButtonBarNextOver.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:NextPage</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>OfText</Name>
|
||||
<Type>Text</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Txt:Of</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>PageSize</Name>
|
||||
<Type>TextBox</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CssClass</Name>
|
||||
<Value>Pagination_Input</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>EnableIncrementDecrementButtons</Name>
|
||||
<Value>Default</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>MaxLength</Name>
|
||||
<Value>5</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Size</Name>
|
||||
<Value>5</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>PageSizeButton</Name>
|
||||
<Type>LinkButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>PageSize</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CssClass</Name>
|
||||
<Value>button_link</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Txt:Page</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>PageSizeText</Name>
|
||||
<Type>Text</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Txt:PageSize</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>PreviousPage</Name>
|
||||
<Type>ImageButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>PreviousPage</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ImageURL</Name>
|
||||
<Value>../Images/ButtonBarPrevious.gif</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseout</Name>
|
||||
<Value>this.src='../Images/ButtonBarPrevious.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<Value>this.src='../Images/ButtonBarPreviousOver.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:PreviousPage</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>TotalItems</Name>
|
||||
<Type>Label</Type>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>TotalItemsText</Name>
|
||||
<Type>Text</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Txt:TotalItems</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>Items</Name>
|
||||
<Type>Text</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Txt:Items</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>TotalPages</Name>
|
||||
<Type>Label</Type>
|
||||
</ContainedComponent>
|
||||
</ComposedOf>
|
||||
<LayoutDefinition><![CDATA[<?xml version="1.0" encoding="utf-16"?>
|
||||
<LayoutDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<Layout Name="Pagination" Type="RootLayout">
|
||||
|
||||
<TableAttributes>
|
||||
<Attribute>
|
||||
<Name>cellspacing</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>cellpadding</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>border</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
</TableAttributes>
|
||||
|
||||
<Prolog>
|
||||
<Value></Value>
|
||||
</Prolog>
|
||||
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" width="10" height="1" alt="" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>style</Name>
|
||||
<AttributeValue>width: 50%</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarEdgeL.gif" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarDivider.gif" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:ImageButton Name="FirstPage" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarDivider.gif" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:ImageButton Name="PreviousPage" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarDivider.gif" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;%= SystemUtils.GenerateEnterKeyCaptureBeginTag(FindControl("_PageSizeButton")) %&gt;&lt;GEN:TextBox Name="CurrentPage" /&gt;&lt;%= SystemUtils.GenerateEnterKeyCaptureEndTag(FindControl("_PageSizeButton")) %&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>prbg</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:Text name="OfText" /&gt; &lt;b&gt;&lt;GEN:Label Name="TotalPages" /&gt;&lt;/b&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>prbg</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarDivider.gif" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:ImageButton Name="NextPage" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarDivider.gif" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:ImageButton Name="LastPage" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarPageItemDivider.gif" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;b&gt;&lt;GEN:Label Name="TotalItems" /&gt;&lt;/b&gt;&amp;nbsp;&lt;GEN:Text Name="Items" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>prbg</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarDivider.gif" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;%= SystemUtils.GenerateEnterKeyCaptureBeginTag(FindControl("_PageSizeButton")) %&gt;&lt;GEN:TextBox Name="PageSize" /&gt;&lt;%= SystemUtils.GenerateEnterKeyCaptureEndTag(FindControl("_PageSizeButton")) %&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>prbg</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>/</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>prbg</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:LINKBUTTON NAME="PageSizeButton" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>prbggo</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarEdgeR.gif" alt="" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>style</Name>
|
||||
<AttributeValue>width: 50%</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<Epilog>
|
||||
<Value></Value>
|
||||
</Epilog>
|
||||
|
||||
<TableAttributes>
|
||||
<Attribute>
|
||||
<Name>style</Name>
|
||||
<AttributeValue>width: 100%</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>border</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>cellpadding</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>cellspacing</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
</TableAttributes>
|
||||
|
||||
</Layout>
|
||||
|
||||
</LayoutDefinition>]]>
|
||||
</LayoutDefinition>
|
||||
|
||||
</ComponentDefinition>
|
10
Shared/PaginationMedium.ascx
Normal file
10
Shared/PaginationMedium.ascx
Normal file
|
@ -0,0 +1,10 @@
|
|||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Register Tagprefix="Selectors" Namespace="Persons" %>
|
||||
|
||||
<%@ Control Language="vb" AutoEventWireup="false" CodeFile="PaginationMedium.ascx.vb" Inherits="Persons.UI.PaginationMedium" %>
|
||||
<%@ Register Tagprefix="BaseClasses" Namespace="BaseClasses.Web.UI.WebControls" Assembly="BaseClasses" %><table cellspacing="0" cellpadding="0" border="0" style="width: 100%"><tr><td style="width: 50%"><img src="../Images/space.gif" width="10" height="1" alt="" /></td><td><img src="../Images/ButtonBarEdgeL.gif" alt="" /></td><td><asp:ImageButton runat="server" id="_FirstPage" causesvalidation="False" commandname="FirstPage" imageurl="../Images/ButtonBarFirst.gif" onmouseout="this.src='../Images/ButtonBarFirst.gif'" onmouseover="this.src='../Images/ButtonBarFirstOver.gif'" tooltip="<%# GetResourceValue("Btn:FirstPage", "Persons") %>" visible="False">
|
||||
</asp:ImageButton></td><td><asp:ImageButton runat="server" id="_PreviousPage" causesvalidation="False" commandname="PreviousPage" imageurl="../Images/ButtonBarPrevious.gif" onmouseout="this.src='../Images/ButtonBarPrevious.gif'" onmouseover="this.src='../Images/ButtonBarPreviousOver.gif'" tooltip="<%# GetResourceValue("Btn:PreviousPage", "Persons") %>">
|
||||
</asp:ImageButton></td><td class="prbg"><%= SystemUtils.GenerateEnterKeyCaptureBeginTag(FindControl("_PageSizeButton")) %><asp:TextBox runat="server" id="_CurrentPage" cssclass="Pagination_Input" maxlength="10" size="5"> </asp:TextBox><%= SystemUtils.GenerateEnterKeyCaptureEndTag(FindControl("_PageSizeButton")) %></td><td class="prbg"><%# GetResourceValue("Txt:Of", "Persons") %> <b><asp:Label runat="server" id="_TotalPages"> </asp:Label></b></td><td><asp:ImageButton runat="server" id="_NextPage" causesvalidation="False" commandname="NextPage" imageurl="../Images/ButtonBarNext.gif" onmouseout="this.src='../Images/ButtonBarNext.gif'" onmouseover="this.src='../Images/ButtonBarNextOver.gif'" tooltip="<%# GetResourceValue("Btn:NextPage", "Persons") %>">
|
||||
</asp:ImageButton></td><td><asp:ImageButton runat="server" id="_LastPage" causesvalidation="False" commandname="LastPage" imageurl="../Images/ButtonBarLast.gif" onmouseout="this.src='../Images/ButtonBarLast.gif'" onmouseover="this.src='../Images/ButtonBarLastOver.gif'" tooltip="<%# GetResourceValue("Btn:LastPage", "Persons") %>" visible="False">
|
||||
</asp:ImageButton></td><td class="prbg"><%= SystemUtils.GenerateEnterKeyCaptureBeginTag(FindControl("_PageSizeButton")) %><asp:TextBox runat="server" id="_PageSize" cssclass="Pagination_Input" maxlength="5" size="5"> </asp:TextBox><%= SystemUtils.GenerateEnterKeyCaptureEndTag(FindControl("_PageSizeButton")) %></td><td class="prbg">/</td><td class="prbggo"><asp:LinkButton runat="server" id="_PageSizeButton" causesvalidation="False" commandname="PageSize" cssclass="button_link" text="<%# GetResourceValue("Txt:Page", "Persons") %>">
|
||||
</asp:LinkButton></td><td><img src="../Images/ButtonBarEdgeR.gif" alt="" /></td><td style="width: 50%"><img src="../Images/space.gif" width="10" height="1" alt="" /></td></tr></table>
|
500
Shared/PaginationMedium.ascx.vb
Normal file
500
Shared/PaginationMedium.ascx.vb
Normal file
|
@ -0,0 +1,500 @@
|
|||
|
||||
#Region "Imports statements"
|
||||
Option Strict On
|
||||
Imports System
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports System.ComponentModel
|
||||
Imports BaseClasses
|
||||
Imports BaseClasses.Data
|
||||
Imports BaseClasses.Utils
|
||||
Imports BaseClasses.Web.UI.WebControls
|
||||
|
||||
Imports Persons.Business
|
||||
Imports Persons.Data
|
||||
|
||||
#End Region
|
||||
|
||||
Namespace Persons.UI
|
||||
|
||||
' Code-behind class for the PaginationMedium user control.
|
||||
Partial Public Class PaginationMedium
|
||||
Inherits BaseApplicationUserControl
|
||||
Implements IPaginationMedium
|
||||
#Region "Section 1: Place your customizations here."
|
||||
|
||||
Public Sub LoadData()
|
||||
' LoadData reads database data and assigns it to UI controls.
|
||||
' Customize by adding code before or after the call to LoadData_Base()
|
||||
' or replace the call to LoadData_Base().
|
||||
LoadData_Base()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate as BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS as Boolean) As String
|
||||
Return EvaluateFormula_Base(formula, dataSourceForEvaluate, format, variables, includeDS)
|
||||
End Function
|
||||
|
||||
Public Sub Page_InitializeEventHandlers(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Init
|
||||
' Handles MyBase.Init.
|
||||
' Register the Event handler for any Events.
|
||||
Me.Page_InitializeEventHandlers_Base(sender,e)
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub SaveControlsToSession()
|
||||
SaveControlsToSession_Base()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Overrides Sub ClearControlsFromSession()
|
||||
ClearControlsFromSession_Base()
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub LoadViewState(ByVal savedState As Object)
|
||||
LoadViewState_Base(savedState)
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Overrides Function SaveViewState() As Object
|
||||
Return SaveViewState_Base()
|
||||
End Function
|
||||
|
||||
Public Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
|
||||
Me.Page_PreRender_Base(sender,e)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Public Overrides Sub SetChartControl(ByVal chartCtrlName As String)
|
||||
Me.SetChartControl_Base(chartCtrlName)
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "Ajax Functions"
|
||||
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' or replace the call to GetRecordFieldValue_Base().
|
||||
Return GetRecordFieldValue_Base(tableName, recordID, columnName, fieldName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetImage(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetImage gets the Image url for the image in the column "columnName" and
|
||||
' in the record specified by recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetImage_Base()
|
||||
' or replace the call to GetImage_Base().
|
||||
Return GetImage_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
Protected Overloads Overrides Sub BasePage_PreRender(ByVal sender As Object, ByVal e As EventArgs)
|
||||
MyBase.BasePage_PreRender(sender, e)
|
||||
Base_RegisterPostback()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
' Page Event Handlers - buttons, sort, links
|
||||
|
||||
|
||||
' Write out the Set methods
|
||||
|
||||
|
||||
' Write out the methods for DataSource
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Section 2: Do not modify this section."
|
||||
|
||||
Protected Sub Page_InitializeEventHandlers_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
|
||||
' the following code for accordion is necessary or the Me.{ControlName} will return Nothing
|
||||
|
||||
' Register the Event handler for any Events.
|
||||
|
||||
|
||||
' Setup the pagination events.
|
||||
|
||||
Me.ClearControlsFromSession()
|
||||
End Sub
|
||||
|
||||
Private Sub Base_RegisterPostback()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
' Handles MyBase.Load. Read database data and put into the UI controls.
|
||||
' If you need to, you can add additional Load handlers in Section 1.
|
||||
Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
|
||||
If ( Me.IsPostBack ) Then
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If (Not Me.IsPostBack) Then
|
||||
|
||||
End If
|
||||
|
||||
|
||||
' Load data only when displaying the page for the first time or if postback from child window
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Read the data for all controls on the page.
|
||||
' To change the behavior, override the DataBind method for the individual
|
||||
' record or table UI controls.
|
||||
Me.LoadData()
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetRecordFieldValue_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
If Not IsNothing(recordID) Then
|
||||
recordID = System.Web.HttpUtility.UrlDecode(recordID)
|
||||
End If
|
||||
Dim content as String = BaseClasses.Utils.MiscUtils.GetFieldData(tableName, recordID, columnName)
|
||||
|
||||
content = NetUtils.EncodeStringForHtmlDisplay(content)
|
||||
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window
|
||||
'returnValue(1) represents content of the pop up window
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function GetImage_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
Dim content As String = "<IMG alt =""" & title & """ src =" & """../Shared/ExportFieldValue.aspx?Table=" & tableName & "&Field=" & columnName & "&Record=" & recordID & """/>"
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window.
|
||||
'returnValue(1) represents content ie, image url.
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
Public Sub SetChartControl_Base(ByVal chartCtrlName As String)
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub SaveControlsToSession_Base()
|
||||
MyBase.SaveControlsToSession()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub ClearControlsFromSession_Base()
|
||||
MyBase.ClearControlsFromSession()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LoadViewState_Base(ByVal savedState As Object)
|
||||
MyBase.LoadViewState(savedState)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Function SaveViewState_Base() As Object
|
||||
|
||||
Return MyBase.SaveViewState()
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub Page_PreRender_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
' Data bind for each chart UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
' Load data from database into UI controls.
|
||||
' Modify LoadData in Section 1 above to customize. Or override DataBind() in
|
||||
' the individual table and record controls to customize.
|
||||
Public Sub LoadData_Base()
|
||||
Try
|
||||
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Must start a transaction before performing database operations
|
||||
DbUtils.StartTransaction()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Me.DataBind()
|
||||
|
||||
' Load and bind data for each record and table UI control.
|
||||
|
||||
|
||||
' Load data for chart.
|
||||
|
||||
|
||||
' initialize aspx controls
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
' An error has occured so display an error message.
|
||||
Utils.RegisterJScriptAlert(Me, "Page_Load_Error_Message", ex.Message)
|
||||
Finally
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' End database transaction
|
||||
DbUtils.EndTransaction()
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public EvaluateFormulaDelegate As BaseClasses.Data.DataSource.EvaluateFormulaDelegate = New BaseClasses.Data.DataSource.EvaluateFormulaDelegate(AddressOf Me.EvaluateFormula)
|
||||
|
||||
Public Overridable Function EvaluateFormula_Base(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS As Boolean) As String
|
||||
Dim e As FormulaEvaluator = New FormulaEvaluator()
|
||||
|
||||
' add variables for formula evaluation
|
||||
If variables IsNot Nothing Then
|
||||
Dim enumerator As System.Collections.Generic.IEnumerator(Of System.Collections.Generic.KeyValuePair(Of String, Object)) = variables.GetEnumerator()
|
||||
While enumerator.MoveNext()
|
||||
e.Variables.Add(enumerator.Current.Key, enumerator.Current.Value)
|
||||
End While
|
||||
End If
|
||||
|
||||
If includeDS
|
||||
|
||||
End If
|
||||
|
||||
|
||||
e.CallingControl = Me
|
||||
|
||||
e.DataSource = dataSourceForEvaluate
|
||||
|
||||
|
||||
Dim resultObj As Object = e.Evaluate(formula)
|
||||
If resultObj Is Nothing Then
|
||||
Return ""
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrEmpty(format) AndAlso (String.IsNullOrEmpty(formula) OrElse formula.IndexOf("Format(") < 0) Then
|
||||
Return FormulaUtils.Format(resultObj, format)
|
||||
Else
|
||||
Return resultObj.ToString()
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object)) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, format, variables, True)
|
||||
End Function
|
||||
|
||||
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal includeDS As Boolean) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, includeDS)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
' Write out the Set methods
|
||||
|
||||
|
||||
' Write out the DataSource properties and methods
|
||||
|
||||
|
||||
' Write out event methods for the page events
|
||||
|
||||
#Region "Interface Properties"
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property CurrentPage() As System.Web.UI.WebControls.TextBox Implements IPaginationMedium.CurrentPage
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_CurrentPage"), System.Web.UI.WebControls.TextBox)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property FirstPage() As System.Web.UI.WebControls.ImageButton Implements IPaginationMedium.FirstPage
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_FirstPage"), System.Web.UI.WebControls.ImageButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property LastPage() As System.Web.UI.WebControls.ImageButton Implements IPaginationMedium.LastPage
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_LastPage"), System.Web.UI.WebControls.ImageButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property NextPage() As System.Web.UI.WebControls.ImageButton Implements IPaginationMedium.NextPage
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_NextPage"), System.Web.UI.WebControls.ImageButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property PageSize() As System.Web.UI.WebControls.TextBox Implements IPaginationMedium.PageSize
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_PageSize"), System.Web.UI.WebControls.TextBox)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property PageSizeButton() As System.Web.UI.WebControls.LinkButton Implements IPaginationMedium.PageSizeButton
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_PageSizeButton"), System.Web.UI.WebControls.LinkButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property PreviousPage() As System.Web.UI.WebControls.ImageButton Implements IPaginationMedium.PreviousPage
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_PreviousPage"), System.Web.UI.WebControls.ImageButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property TotalPages() As System.Web.UI.WebControls.Label Implements IPaginationMedium.TotalPages
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_TotalPages"), System.Web.UI.WebControls.Label)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Property Visible() As Boolean Implements IPaginationMedium.Visible
|
||||
|
||||
Get
|
||||
Return MyBase.Visible
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
MyBase.Visible = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Public Shadows ReadOnly Property Page() As BaseApplicationPage
|
||||
Get
|
||||
Return DirectCast(MyBase.Page, BaseApplicationPage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
|
||||
|
358
Shared/PaginationMedium.xml
Normal file
358
Shared/PaginationMedium.xml
Normal file
|
@ -0,0 +1,358 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<ComponentDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.ironspeed.com/designer">
|
||||
<Generator>Iron Speed Designer</Generator>
|
||||
<Version>9.2.0</Version>
|
||||
<Self>
|
||||
<Name>PaginationMedium</Name>
|
||||
<Type>Pagination</Type>
|
||||
<SubType>DotNet</SubType>
|
||||
<GenerateDirectory>Shared</GenerateDirectory>
|
||||
<Layout>Shared\PaginationMedium.html</Layout>
|
||||
<DisplayName>PaginationMedium</DisplayName>
|
||||
<Description>(Description)</Description>
|
||||
<CheckSum>CUSTOMIZED</CheckSum>
|
||||
</Self>
|
||||
<ComposedOf>
|
||||
<ContainedComponent>
|
||||
<Name>CurrentPage</Name>
|
||||
<Type>TextBox</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CssClass</Name>
|
||||
<Value>Pagination_Input</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>EnableIncrementDecrementButtons</Name>
|
||||
<Value>Default</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>MaxLength</Name>
|
||||
<Value>10</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Size</Name>
|
||||
<Value>5</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>FirstPage</Name>
|
||||
<Type>ImageButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>FirstPage</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ImageURL</Name>
|
||||
<Value>../Images/ButtonBarFirst.gif</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseout</Name>
|
||||
<Value>this.src='../Images/ButtonBarFirst.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<Value>this.src='../Images/ButtonBarFirstOver.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:FirstPage</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Visible</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>LastPage</Name>
|
||||
<Type>ImageButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>LastPage</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ImageURL</Name>
|
||||
<Value>../Images/ButtonBarLast.gif</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseout</Name>
|
||||
<Value>this.src='../Images/ButtonBarLast.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<Value>this.src='../Images/ButtonBarLastOver.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:LastPage</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Visible</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>NextPage</Name>
|
||||
<Type>ImageButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>NextPage</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ImageURL</Name>
|
||||
<Value>../Images/ButtonBarNext.gif</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseout</Name>
|
||||
<Value>this.src='../Images/ButtonBarNext.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<Value>this.src='../Images/ButtonBarNextOver.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:NextPage</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>OfText</Name>
|
||||
<Type>Text</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Txt:Of</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>PageSize</Name>
|
||||
<Type>TextBox</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CssClass</Name>
|
||||
<Value>Pagination_Input</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>EnableIncrementDecrementButtons</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>MaxLength</Name>
|
||||
<Value>5</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Size</Name>
|
||||
<Value>5</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>PageSizeButton</Name>
|
||||
<Type>LinkButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>PageSize</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CssClass</Name>
|
||||
<Value>button_link</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Txt:Page</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>PageSizeText</Name>
|
||||
<Type>Text</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Txt:PageSize</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>PreviousPage</Name>
|
||||
<Type>ImageButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>PreviousPage</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ImageURL</Name>
|
||||
<Value>../Images/ButtonBarPrevious.gif</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseout</Name>
|
||||
<Value>this.src='../Images/ButtonBarPrevious.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<Value>this.src='../Images/ButtonBarPreviousOver.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:PreviousPage</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>TotalPages</Name>
|
||||
<Type>Label</Type>
|
||||
</ContainedComponent>
|
||||
</ComposedOf>
|
||||
<LayoutDefinition><![CDATA[<?xml version="1.0" encoding="utf-16"?>
|
||||
<LayoutDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<Layout Name="Pagination" Type="RootLayout">
|
||||
<Prolog />
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" width="10" height="1" alt="" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>style</Name>
|
||||
<AttributeValue>width: 50%</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarEdgeL.gif" alt="" /&gt;</Value>
|
||||
<CellAttributes />
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:ImageButton Name="FirstPage" /&gt;</Value>
|
||||
<CellAttributes />
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:ImageButton Name="PreviousPage" /&gt;</Value>
|
||||
<CellAttributes />
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;%= SystemUtils.GenerateEnterKeyCaptureBeginTag(FindControl("_PageSizeButton")) %&gt;&lt;GEN:TextBox Name="CurrentPage" /&gt;&lt;%= SystemUtils.GenerateEnterKeyCaptureEndTag(FindControl("_PageSizeButton")) %&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>prbg</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:Text name="OfText" /&gt; &lt;b&gt;&lt;GEN:Label Name="TotalPages" /&gt;&lt;/b&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>prbg</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:ImageButton Name="NextPage" /&gt;</Value>
|
||||
<CellAttributes />
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:ImageButton Name="LastPage" /&gt;</Value>
|
||||
<CellAttributes />
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;%= SystemUtils.GenerateEnterKeyCaptureBeginTag(FindControl("_PageSizeButton")) %&gt;&lt;GEN:TextBox Name="PageSize" /&gt;&lt;%= SystemUtils.GenerateEnterKeyCaptureEndTag(FindControl("_PageSizeButton")) %&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>prbg</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>/</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>prbg</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:LINKBUTTON NAME="PageSizeButton" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>prbggo</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarEdgeR.gif" alt="" /&gt;</Value>
|
||||
<CellAttributes />
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" width="10" height="1" alt="" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>style</Name>
|
||||
<AttributeValue>width: 50%</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<RowAttributes />
|
||||
</Row>
|
||||
<Epilog />
|
||||
<TableAttributes>
|
||||
<Attribute>
|
||||
<Name>cellspacing</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>cellpadding</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>border</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>style</Name>
|
||||
<AttributeValue>width: 100%</AttributeValue>
|
||||
</Attribute>
|
||||
</TableAttributes>
|
||||
</Layout>
|
||||
</LayoutDefinition>]]></LayoutDefinition>
|
||||
</ComponentDefinition>
|
10
Shared/PaginationShort.ascx
Normal file
10
Shared/PaginationShort.ascx
Normal file
|
@ -0,0 +1,10 @@
|
|||
<%@ Control Language="vb" AutoEventWireup="false" CodeFile="PaginationShort.ascx.vb" Inherits="Persons.UI.PaginationShort" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Register Tagprefix="Selectors" Namespace="Persons" %>
|
||||
|
||||
<%@ Register Tagprefix="BaseClasses" Namespace="BaseClasses.Web.UI.WebControls" Assembly="BaseClasses" %><table cellspacing="0" cellpadding="0" border="0"><tr><td><img src="../Images/space.gif" width="10" height="1" alt="" /></td><td><img src="../Images/ButtonBarEdgeL.gif" alt="" /></td><td><img src="../Images/ButtonBarDivider.gif" alt="" /></td><td><asp:ImageButton runat="server" id="_FirstPage" causesvalidation="False" commandname="FirstPage" imageurl="../Images/ButtonBarFirst.gif" onmouseout="this.src='../Images/ButtonBarFirst.gif'" onmouseover="this.src='../Images/ButtonBarFirstOver.gif'" tooltip="<%# GetResourceValue("Btn:FirstPage", "Persons") %>">
|
||||
</asp:ImageButton></td><td><img src="../Images/ButtonBarDivider.gif" alt="" /></td><td><asp:ImageButton runat="server" id="_PreviousPage" causesvalidation="False" commandname="PreviousPage" imageurl="../Images/ButtonBarPrevious.gif" onmouseout="this.src='../Images/ButtonBarPrevious.gif'" onmouseover="this.src='../Images/ButtonBarPreviousOver.gif'" tooltip="<%# GetResourceValue("Btn:PreviousPage", "Persons") %>">
|
||||
</asp:ImageButton></td><td><img src="../Images/ButtonBarDivider.gif" alt="" /></td><td class="prbg"><%= SystemUtils.GenerateEnterKeyCaptureBeginTag(FindControl("_PageSizeButton")) %><asp:TextBox runat="server" id="_CurrentPage" cssclass="Pagination_Input" maxlength="5" size="3"> </asp:TextBox><%= SystemUtils.GenerateEnterKeyCaptureEndTag(FindControl("_PageSizeButton")) %></td><td class="prbg"><%# GetResourceValue("Txt:Of", "Persons") %><b><asp:Label runat="server" id="_TotalPages"> </asp:Label></b></td><td><img src="../Images/ButtonBarDivider.gif" alt="" /></td><td><asp:ImageButton runat="server" id="_NextPage" causesvalidation="False" commandname="NextPage" imageurl="../Images/ButtonBarNext.gif" onmouseout="this.src='../Images/ButtonBarNext.gif'" onmouseover="this.src='../Images/ButtonBarNextOver.gif'" tooltip="<%# GetResourceValue("Btn:NextPage", "Persons") %>">
|
||||
</asp:ImageButton></td><td><img src="../Images/ButtonBarDivider.gif" alt="" /></td><td><asp:ImageButton runat="server" id="_LastPage" causesvalidation="False" commandname="LastPage" imageurl="../Images/ButtonBarLast.gif" onmouseout="this.src='../Images/ButtonBarLast.gif'" onmouseover="this.src='../Images/ButtonBarLastOver.gif'" tooltip="<%# GetResourceValue("Btn:LastPage", "Persons") %>">
|
||||
</asp:ImageButton></td><td><img src="../Images/ButtonBarDivider.gif" alt="" /></td><td class="prbg"><asp:LinkButton runat="server" id="_PageSizeButton" causesvalidation="False" commandname="PageSize" cssclass="button_link" text="<%# GetResourceValue("Btn:Go", "Persons") %>">
|
||||
</asp:LinkButton></td><td><img src="../Images/ButtonBarEdgeR.gif" alt="" /></td></tr></table>
|
479
Shared/PaginationShort.ascx.vb
Normal file
479
Shared/PaginationShort.ascx.vb
Normal file
|
@ -0,0 +1,479 @@
|
|||
|
||||
Option Strict On
|
||||
Imports System
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports System.ComponentModel
|
||||
Imports BaseClasses
|
||||
Imports BaseClasses.Utils
|
||||
Imports BaseClasses.Web.UI.WebControls
|
||||
|
||||
Imports Persons.Business
|
||||
Imports Persons.Data
|
||||
|
||||
Namespace Persons.UI
|
||||
|
||||
' Code-behind class for the PaginationShort user control.
|
||||
Public Partial Class PaginationShort
|
||||
Inherits BaseApplicationUserControl
|
||||
Implements IPaginationShort
|
||||
#Region "Section 1: Place your customizations here."
|
||||
|
||||
Public Sub LoadData()
|
||||
' LoadData reads database data and assigns it to UI controls.
|
||||
' Customize by adding code before or after the call to LoadData_Base()
|
||||
' or replace the call to LoadData_Base().
|
||||
LoadData_Base()
|
||||
End Sub
|
||||
|
||||
#Region "Ajax Functions"
|
||||
|
||||
' <Services.WebMethod()> _
|
||||
' Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
' ByVal recordID As String, _
|
||||
' ByVal columnName As String, _
|
||||
' ByVal title As String, _
|
||||
' ByVal persist As Boolean, _
|
||||
' ByVal popupWindowHeight As Integer, _
|
||||
' ByVal popupWindowWidth As Integer, _
|
||||
' ByVal popupWindowScrollBar As Boolean _
|
||||
' ) As Object()
|
||||
' ' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' ' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' ' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' ' or replace the call to GetRecordFieldValue_Base().
|
||||
' Return GetRecordFieldValue_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
' End Function
|
||||
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetImage(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetImage gets the Image url for the image in the column "columnName" and
|
||||
' in the record specified by recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetImage_Base()
|
||||
' or replace the call to GetImage_Base().
|
||||
Return GetImage_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
' Page Event Handlers - buttons, sort, links
|
||||
|
||||
|
||||
|
||||
Protected Overloads Overrides Sub BasePage_PreRender(ByVal sender As Object, ByVal e As EventArgs)
|
||||
MyBase.BasePage_PreRender(sender, e)
|
||||
Base_RegisterPostback()
|
||||
End Sub
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' or replace the call to GetRecordFieldValue_Base().
|
||||
Return GetRecordFieldValue_Base(tableName, recordID, columnName, fieldName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
Public Overrides Sub SetChartControl(ByVal chartCtrlName As String)
|
||||
Me.SetChartControl_Base(chartCtrlName)
|
||||
End Sub
|
||||
Public Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
|
||||
Me.Page_PreRender_Base(sender,e)
|
||||
End Sub
|
||||
Protected Overrides Function SaveViewState() As Object
|
||||
Return SaveViewState_Base()
|
||||
End Function
|
||||
Protected Overrides Sub LoadViewState(ByVal savedState As Object)
|
||||
LoadViewState_Base(savedState)
|
||||
End Sub
|
||||
Protected Overrides Sub ClearControlsFromSession()
|
||||
ClearControlsFromSession_Base()
|
||||
End Sub
|
||||
Protected Overrides Sub SaveControlsToSession()
|
||||
SaveControlsToSession_Base()
|
||||
End Sub
|
||||
Public Sub Page_InitializeEventHandlers(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Init
|
||||
' Handles MyBase.Init.
|
||||
' Register the Event handler for any Events.
|
||||
Me.Page_InitializeEventHandlers_Base(sender,e)
|
||||
End Sub
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate as BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS as Boolean) As String
|
||||
Return EvaluateFormula_Base(formula, dataSourceForEvaluate, format, variables, includeDS)
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "Section 2: Do not modify this section."
|
||||
|
||||
Protected Sub Page_InitializeEventHandlers_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
|
||||
' the following code for accordion is necessary or the Me.{ControlName} will return Nothing
|
||||
|
||||
' Register the Event handler for any Events.
|
||||
|
||||
|
||||
' Setup the pagination events.
|
||||
|
||||
Me.ClearControlsFromSession()
|
||||
End Sub
|
||||
|
||||
Private Sub Base_RegisterPostback()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
' Handles MyBase.Load. Read database data and put into the UI controls.
|
||||
' If you need to, you can add additional Load handlers in Section 1.
|
||||
Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
|
||||
If ( Me.IsPostBack ) Then
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If (Not Me.IsPostBack) Then
|
||||
|
||||
End If
|
||||
|
||||
|
||||
' Load data only when displaying the page for the first time or if postback from child window
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Read the data for all controls on the page.
|
||||
' To change the behavior, override the DataBind method for the individual
|
||||
' record or table UI controls.
|
||||
Me.LoadData()
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetRecordFieldValue_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
If Not IsNothing(recordID) Then
|
||||
recordID = System.Web.HttpUtility.UrlDecode(recordID)
|
||||
End If
|
||||
Dim content as String = BaseClasses.Utils.MiscUtils.GetFieldData(tableName, recordID, columnName)
|
||||
|
||||
content = NetUtils.EncodeStringForHtmlDisplay(content)
|
||||
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window
|
||||
'returnValue(1) represents content of the pop up window
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function GetImage_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
Dim content As String = "<IMG alt =""" & title & """ src =" & """../Shared/ExportFieldValue.aspx?Table=" & tableName & "&Field=" & columnName & "&Record=" & recordID & """/>"
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window.
|
||||
'returnValue(1) represents content ie, image url.
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
Public Sub SetChartControl_Base(ByVal chartCtrlName As String)
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub SaveControlsToSession_Base()
|
||||
MyBase.SaveControlsToSession()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub ClearControlsFromSession_Base()
|
||||
MyBase.ClearControlsFromSession()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LoadViewState_Base(ByVal savedState As Object)
|
||||
MyBase.LoadViewState(savedState)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Function SaveViewState_Base() As Object
|
||||
|
||||
Return MyBase.SaveViewState()
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub Page_PreRender_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
' Data bind for each chart UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
' Load data from database into UI controls.
|
||||
' Modify LoadData in Section 1 above to customize. Or override DataBind() in
|
||||
' the individual table and record controls to customize.
|
||||
Public Sub LoadData_Base()
|
||||
Try
|
||||
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Must start a transaction before performing database operations
|
||||
DbUtils.StartTransaction()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Me.DataBind()
|
||||
|
||||
' Load and bind data for each record and table UI control.
|
||||
|
||||
|
||||
' Load data for chart.
|
||||
|
||||
|
||||
' initialize aspx controls
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
' An error has occured so display an error message.
|
||||
Utils.RegisterJScriptAlert(Me, "Page_Load_Error_Message", ex.Message)
|
||||
Finally
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' End database transaction
|
||||
DbUtils.EndTransaction()
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public EvaluateFormulaDelegate As BaseClasses.Data.DataSource.EvaluateFormulaDelegate = New BaseClasses.Data.DataSource.EvaluateFormulaDelegate(AddressOf Me.EvaluateFormula)
|
||||
|
||||
Public Overridable Function EvaluateFormula_Base(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS As Boolean) As String
|
||||
Dim e As FormulaEvaluator = New FormulaEvaluator()
|
||||
|
||||
' add variables for formula evaluation
|
||||
If variables IsNot Nothing Then
|
||||
Dim enumerator As System.Collections.Generic.IEnumerator(Of System.Collections.Generic.KeyValuePair(Of String, Object)) = variables.GetEnumerator()
|
||||
While enumerator.MoveNext()
|
||||
e.Variables.Add(enumerator.Current.Key, enumerator.Current.Value)
|
||||
End While
|
||||
End If
|
||||
|
||||
If includeDS
|
||||
|
||||
End If
|
||||
|
||||
|
||||
e.CallingControl = Me
|
||||
|
||||
e.DataSource = dataSourceForEvaluate
|
||||
|
||||
|
||||
Dim resultObj As Object = e.Evaluate(formula)
|
||||
If resultObj Is Nothing Then
|
||||
Return ""
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrEmpty(format) AndAlso (String.IsNullOrEmpty(formula) OrElse formula.IndexOf("Format(") < 0) Then
|
||||
Return FormulaUtils.Format(resultObj, format)
|
||||
Else
|
||||
Return resultObj.ToString()
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object)) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, format, variables, True)
|
||||
End Function
|
||||
|
||||
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal includeDS As Boolean) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, includeDS)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
' Write out the Set methods
|
||||
|
||||
|
||||
' Write out the DataSource properties and methods
|
||||
|
||||
|
||||
' Write out event methods for the page events
|
||||
|
||||
#Region "Interface Properties"
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property CurrentPage() As System.Web.UI.WebControls.TextBox Implements IPaginationShort.CurrentPage
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_CurrentPage"), System.Web.UI.WebControls.TextBox)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property FirstPage() As System.Web.UI.WebControls.ImageButton Implements IPaginationShort.FirstPage
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_FirstPage"), System.Web.UI.WebControls.ImageButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property LastPage() As System.Web.UI.WebControls.ImageButton Implements IPaginationShort.LastPage
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_LastPage"), System.Web.UI.WebControls.ImageButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property NextPage() As System.Web.UI.WebControls.ImageButton Implements IPaginationShort.NextPage
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_NextPage"), System.Web.UI.WebControls.ImageButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property PageSizeButton() As System.Web.UI.WebControls.LinkButton Implements IPaginationShort.PageSizeButton
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_PageSizeButton"), System.Web.UI.WebControls.LinkButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property PreviousPage() As System.Web.UI.WebControls.ImageButton Implements IPaginationShort.PreviousPage
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_PreviousPage"), System.Web.UI.WebControls.ImageButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property TotalPages() As System.Web.UI.WebControls.Label Implements IPaginationShort.TotalPages
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_TotalPages"), System.Web.UI.WebControls.Label)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Property Visible() As Boolean Implements IPaginationShort.Visible
|
||||
|
||||
Get
|
||||
Return MyBase.Visible
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
MyBase.Visible = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Public Shadows ReadOnly Property Page() As BaseApplicationPage
|
||||
Get
|
||||
Return DirectCast(MyBase.Page, BaseApplicationPage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
|
||||
|
290
Shared/PaginationShort.xml
Normal file
290
Shared/PaginationShort.xml
Normal file
|
@ -0,0 +1,290 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<ComponentDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.ironspeed.com/designer">
|
||||
<Generator>Iron Speed Designer</Generator>
|
||||
<Version>9.2.0</Version>
|
||||
<Self>
|
||||
<Name>PaginationShort</Name>
|
||||
<Type>Pagination</Type>
|
||||
<SubType>DotNet</SubType>
|
||||
<GenerateDirectory>Shared</GenerateDirectory>
|
||||
<Layout>Shared\PaginationShort.html</Layout>
|
||||
<DisplayName>PaginationShort</DisplayName>
|
||||
<Description>(Description)</Description>
|
||||
<CheckSum>CUSTOMIZED</CheckSum>
|
||||
</Self>
|
||||
<ComposedOf>
|
||||
<ContainedComponent>
|
||||
<Name>CurrentPage</Name>
|
||||
<Type>TextBox</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CssClass</Name>
|
||||
<Value>Pagination_Input</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>EnableIncrementDecrementButtons</Name>
|
||||
<Value>Default</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>MaxLength</Name>
|
||||
<Value>5</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Size</Name>
|
||||
<Value>3</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>FirstPage</Name>
|
||||
<Type>ImageButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>FirstPage</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ImageURL</Name>
|
||||
<Value>../Images/ButtonBarFirst.gif</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseout</Name>
|
||||
<Value>this.src='../Images/ButtonBarFirst.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<Value>this.src='../Images/ButtonBarFirstOver.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:FirstPage</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>LastPage</Name>
|
||||
<Type>ImageButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>LastPage</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ImageURL</Name>
|
||||
<Value>../Images/ButtonBarLast.gif</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseout</Name>
|
||||
<Value>this.src='../Images/ButtonBarLast.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<Value>this.src='../Images/ButtonBarLastOver.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:LastPage</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>NextPage</Name>
|
||||
<Type>ImageButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>NextPage</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ImageURL</Name>
|
||||
<Value>../Images/ButtonBarNext.gif</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseout</Name>
|
||||
<Value>this.src='../Images/ButtonBarNext.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<Value>this.src='../Images/ButtonBarNextOver.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:NextPage</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>OfText</Name>
|
||||
<Type>Text</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Txt:Of</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>PageSizeButton</Name>
|
||||
<Type>LinkButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>PageSize</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CssClass</Name>
|
||||
<Value>button_link</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>Text</Name>
|
||||
<Value>Btn:Go</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>PreviousPage</Name>
|
||||
<Type>ImageButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CausesValidation</Name>
|
||||
<Value>False</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>CommandName</Name>
|
||||
<Value>PreviousPage</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ImageURL</Name>
|
||||
<Value>../Images/ButtonBarPrevious.gif</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseout</Name>
|
||||
<Value>this.src='../Images/ButtonBarPrevious.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<Value>this.src='../Images/ButtonBarPreviousOver.gif'</Value>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>ToolTip</Name>
|
||||
<Value>Btn:PreviousPage</Value>
|
||||
<Type>ResourceReference</Type>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
<ContainedComponent>
|
||||
<Name>TotalPages</Name>
|
||||
<Type>Label</Type>
|
||||
</ContainedComponent>
|
||||
</ComposedOf>
|
||||
<LayoutDefinition><?xml version="1.0" encoding="utf-16"?>
|
||||
<LayoutDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<Layout Name="Pagination" Type="RootLayout">
|
||||
<Prolog />
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" width="10" height="1" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarEdgeL.gif" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarDivider.gif" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:ImageButton Name="FirstPage" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarDivider.gif" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:ImageButton Name="PreviousPage" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarDivider.gif" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;%= SystemUtils.GenerateEnterKeyCaptureBeginTag(FindControl("_PageSizeButton")) %&gt;&lt;GEN:TextBox Name="CurrentPage" /&gt;&lt;%= SystemUtils.GenerateEnterKeyCaptureEndTag(FindControl("_PageSizeButton")) %&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>prbg</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:Text name="OfText" /&gt;&lt;b &gt;&lt;GEN:Label Name="TotalPages" /&gt;&lt;/b&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>prbg</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarDivider.gif" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:ImageButton Name="NextPage" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarDivider.gif" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:ImageButton Name="LastPage" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarDivider.gif" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:LINKBUTTON NAME="PageSizeButton" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>prbg</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/ButtonBarEdgeR.gif" alt="" /&gt;</Value>
|
||||
</Cell>
|
||||
</Row>
|
||||
<Epilog />
|
||||
<TableAttributes>
|
||||
<Attribute>
|
||||
<Name>cellspacing</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>cellpadding</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>border</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
</TableAttributes>
|
||||
</Layout>
|
||||
</LayoutDefinition></LayoutDefinition>
|
||||
</ComponentDefinition>
|
59
Shared/PreviewPage.html
Normal file
59
Shared/PreviewPage.html
Normal file
|
@ -0,0 +1,59 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head>
|
||||
<title>Preview Page</title>
|
||||
<link rel="stylesheet" rev="stylesheet" type="text/css" href="../Styles/BaseStyles.css"/>
|
||||
<link rel="stylesheet" rev="stylesheet" type="text/css" href="../Styles/Styles.css" />
|
||||
</head><body>
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pageBackground">
|
||||
<tr>
|
||||
<td class="pageAlignment">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="borderTable">
|
||||
<tr>
|
||||
<td class="pageBorderTL"><img src="../Images/space.gif" height="1" width="1" alt="" /></td>
|
||||
<td class="pageBorderT"><img src="../Images/space.gif" height="1" width="1" alt="" /></td>
|
||||
<td class="pageBorderTR"><img src="../Images/space.gif" height="1" width="1" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pageBorderL"><img src="../Images/space.gif" height="1" width="1" alt="" /></td>
|
||||
<td class="pageBorderC">
|
||||
<table cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td class="page_yellow">
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="600" id="AutoNumber1">
|
||||
<tr>
|
||||
<td class="dialog_header" colspan="3">
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<!--<td class="dialogHeaderEdgeL"><img src="../Images/space.gif" alt="" /></td>-->
|
||||
<td class="dialog_header_text">PAGE PREVIEW</td>
|
||||
<!--<td class="dialogHeaderEdgeR"><img src="../Images/space.gif" alt="" /></td>-->
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20px;"></td>
|
||||
<td class="configureErrorPagesText"><br />
|
||||
Live Preview is currently turned off. Click the Live Preview checkbox above to see your live <br /><br />
|
||||
application. It will be updated automatically as you configure your application.<br /><br />
|
||||
Click the red Configure… buttons in the Configure Page tab to configure your page.<br /><br />
|
||||
</td>
|
||||
<td style="width: 20px;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="pageBorderR"><img src="../Images/space.gif" height="1" width="1" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pageBorderBL"><img src="../Images/space.gif" height="1" width="1" alt="" /></td>
|
||||
<td class="pageBorderB"><img src="../Images/space.gif" height="1" width="1" alt="" /></td>
|
||||
<td class="pageBorderBR"><img src="../Images/space.gif" height="1" width="1" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body></html>
|
170
Shared/SelectFileToImport.aspx
Normal file
170
Shared/SelectFileToImport.aspx
Normal file
|
@ -0,0 +1,170 @@
|
|||
<%@ Register TagPrefix="Persons" TagName="ThemeButton" Src="../Shared/ThemeButton.ascx" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Register TagPrefix="Selectors" Namespace="Persons" %>
|
||||
<%@ Register TagPrefix="BaseClasses" Namespace="BaseClasses.Web.UI.WebControls" Assembly="BaseClasses" %>
|
||||
<%@ Page Language="VB" EnableEventValidation="false" AutoEventWireup="false" Codefile="SelectFileToImport.aspx.vb"
|
||||
Inherits="Persons.UI.SelectFileToImport" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head id="Head1" runat="server">
|
||||
<title>SelectFileToImport</title>
|
||||
<base target="_self" />
|
||||
</head>
|
||||
<body id="Body1" runat="server" class="importWizardpBack">
|
||||
<form id="Form1" method="post" runat="server">
|
||||
<BaseClasses:ScrollCoordinates id="ScrollCoordinates" runat="server">
|
||||
</BaseClasses:ScrollCoordinates>
|
||||
<BaseClasses:BasePageSettings id="PageSettings" runat="server">
|
||||
</BaseClasses:BasePageSettings>
|
||||
|
||||
<script language="JavaScript" type="text/javascript">clearRTL()</script>
|
||||
|
||||
<asp:ScriptManager ID="scriptManager1" runat="server" EnablePartialRendering="True"
|
||||
EnablePageMethods="True" />
|
||||
<div id="detailPopup" class="detailRolloverPopup" onmouseout="detailRolloverPopupClose();"
|
||||
onmouseover="clearTimeout(gPopupTimer);">
|
||||
</div>
|
||||
<table cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td class="importWizardmarginTL">
|
||||
</td>
|
||||
<td class="importWizardpcT">
|
||||
</td>
|
||||
<td class="importWizardmarginTR">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="importWizardmarginL">
|
||||
</td>
|
||||
<td class="importWizardpcC">
|
||||
<table class="importWizarddv" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td class="importWizarddBody" style="width: 100%; height: 100%">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="tableCellValue">
|
||||
<asp:Label runat="server" ID="InfoLabel"></asp:Label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableCellValue">
|
||||
<input type="file" id="InputFile" name="InputFile" runat="server" size="80" /></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableCellValue">
|
||||
<br />
|
||||
<asp:Label runat="server" ID="fileInfo"></asp:Label></td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:UpdatePanel ID="FileSelectionPanel" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="tableCellValue" colspan="4">
|
||||
<asp:RadioButton ID="rbtnCSV" runat="server" AutoPostBack="true" Checked="true" GroupName="ImportGroup"
|
||||
OnCheckedChanged="rbtnCSV_CheckedChanged" />
|
||||
<%--<asp:Panel ID="pnlCSV" runat="server" Enabled="true">
|
||||
</asp:Panel>--%>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableCellValue" colspan="4">
|
||||
<asp:RadioButton ID="rbtnTAB" runat="server" AutoPostBack="true" Checked="false" GroupName="ImportGroup"
|
||||
OnCheckedChanged="rbtnTAB_CheckedChanged" />
|
||||
<%--<asp:Panel ID="pnlTAB" runat="server" Enabled="true">
|
||||
</asp:Panel>--%>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableCellValue" colspan="4">
|
||||
<asp:RadioButton ID="rbtnExcel" runat="server" AutoPostBack="true" GroupName="ImportGroup"
|
||||
OnCheckedChanged="rbtnExcel_CheckedChanged" />
|
||||
</td>
|
||||
</tr>
|
||||
<%--<asp:Panel ID="pnlExcel" runat="server" Enabled="false">--%>
|
||||
<tr>
|
||||
<td style="width: 28px">
|
||||
</td>
|
||||
<td class="tableCellValue">
|
||||
<asp:Label ID="ExcelSheetname" runat="server">
|
||||
</asp:Label>
|
||||
</td>
|
||||
<td class="tableCellValue">
|
||||
<asp:TextBox ID="txtExcelSheetname" runat="server" CssClass="field_input" Text="Sheet1"></asp:TextBox>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<%--</asp:Panel>--%>
|
||||
<tr>
|
||||
<td class="tableCellValue" colspan="4">
|
||||
<asp:RadioButton ID="rbtnAccess" runat="server" AutoPostBack="true" GroupName="ImportGroup"
|
||||
OnCheckedChanged="rbtnAccess_CheckedChanged" />
|
||||
</td>
|
||||
</tr>
|
||||
<%--<asp:Panel ID="pnlAccess" runat="server" Enabled="false">--%>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td class="tableCellValue">
|
||||
<asp:Label ID="AccessTableName" runat="server">
|
||||
</asp:Label>
|
||||
</td>
|
||||
<td class="tableCellValue">
|
||||
<asp:TextBox ID="txtAccessTableName" runat="server" CssClass="field_input" Text="Table1"></asp:TextBox><br />
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td class="tableCellValue">
|
||||
<asp:Label ID="AccessPassword" runat="server">
|
||||
</asp:Label>
|
||||
</td>
|
||||
<td class="tableCellValue">
|
||||
<asp:TextBox ID="txtAccessPassword" runat="server" CssClass="field_input" TextMode="Password"></asp:TextBox>
|
||||
</td>
|
||||
<td class="tableCellValue">
|
||||
<asp:Label ID="AccessPasswordOptional" runat="server">
|
||||
</asp:Label>
|
||||
</td>
|
||||
</tr>
|
||||
<%--</asp:Panel>--%>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<br />
|
||||
<Persons:Themebutton runat="server" id="NextButton" button-text="<%# GetResourceValue("Import:Next") %>"
|
||||
button-tooltip="<%# GetResourceValue("Import:Next") %>">
|
||||
</Persons:Themebutton>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="importWizardmarginR">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="importWizardmarginBL">
|
||||
</td>
|
||||
<td class="importWizardpcB">
|
||||
</td>
|
||||
<td class="importWizardmarginBR">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:ValidationSummary ID="ValidationSummary1" ShowMessageBox="true" ShowSummary="false"
|
||||
runat="server"></asp:ValidationSummary>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
355
Shared/SelectFileToImport.aspx.vb
Normal file
355
Shared/SelectFileToImport.aspx.vb
Normal file
|
@ -0,0 +1,355 @@
|
|||
' This file implements the code-behind class for SelectFileToImport.aspx.
|
||||
|
||||
#region "Imports statements"
|
||||
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Collections
|
||||
Imports System.ComponentModel
|
||||
Imports System.Web
|
||||
Imports System.IO
|
||||
Imports System.Web.UI
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports BaseClasses
|
||||
Imports BaseClasses.Utils
|
||||
Imports BaseClasses.Data
|
||||
Imports BaseClasses.Data.SqlProvider
|
||||
Imports BaseClasses.Web.UI.WebControls
|
||||
Imports Persons.Business
|
||||
Imports Persons.Data
|
||||
|
||||
#end region
|
||||
|
||||
Namespace Persons.UI
|
||||
|
||||
|
||||
Partial Public Class SelectFileToImport
|
||||
Inherits BaseApplicationPage
|
||||
#Region "Section 1: Place your customizations here."
|
||||
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
Me.Initialize()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property TableName() As String
|
||||
Get
|
||||
Return Me.Decrypt(BaseClasses.Utils.NetUtils.GetUrlParam(Me, "TableName", True))
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property AppName() As String
|
||||
Get
|
||||
Return BaseClasses.Configuration.ApplicationSettings.Current.GetAppSetting(BaseClasses.Configuration.ApplicationSettings.ConfigurationKey.ApplicationName)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
|
||||
Me.Page_PreInit_Base()
|
||||
End Sub
|
||||
|
||||
Public Sub LoadData()
|
||||
' LoadData reads database data and assigns it to UI controls.
|
||||
' Customize by adding code before or after the call to LoadData_Base()
|
||||
' or replace the call to LoadData_Base().
|
||||
LoadData_Base()
|
||||
|
||||
Me.Page.Title = Me.GetResourceValue("Import:Step1", Me.AppName)
|
||||
Me.InfoLabel.Text = Me.GetResourceValue("Import:InfoText", Me.AppName)
|
||||
Me.fileInfo.Text = Me.GetResourceValue("Import:FileInfoText", Me.AppName)
|
||||
Me.rbtnCSV.Text = Me.GetResourceValue("Import:CSVText", Me.AppName) & " [" & System.Globalization.CultureInfo.CurrentUICulture.TextInfo.ListSeparator & "]"
|
||||
Me.rbtnTAB.Text = Me.GetResourceValue("Import:TABText", Me.AppName)
|
||||
Me.rbtnExcel.Text = Me.GetResourceValue("Import:ExcelText", Me.AppName)
|
||||
Me.rbtnAccess.Text = Me.GetResourceValue("Import:AccessText", Me.AppName)
|
||||
Me.AccessPassword.Text = Me.GetResourceValue("Import:AccessPassword", Me.AppName)
|
||||
Me.AccessTableName.Text = Me.GetResourceValue("Import:AccessTable", Me.AppName)
|
||||
Me.ExcelSheetname.Text = Me.GetResourceValue("Import:ExcelSheet", Me.AppName)
|
||||
Me.AccessPasswordOptional.Text = Me.GetResourceValue("Import:AccessPasswordOptional", Me.AppName)
|
||||
|
||||
Me.txtAccessPassword.Enabled = False
|
||||
Me.txtAccessTableName.Enabled = False
|
||||
Me.txtExcelSheetname.Enabled = False
|
||||
|
||||
|
||||
End Sub
|
||||
#Region "Ajax Functions"
|
||||
|
||||
<System.Web.Services.WebMethod()> _
|
||||
Public Shared Function GetRecordFieldValue(ByVal tableName As String, ByVal recordID As String, ByVal columnName As String, ByVal title As String, ByVal persist As Boolean, ByVal popupWindowHeight As Integer, ByVal popupWindowWidth As Integer, ByVal popupWindowScrollBar As Boolean) As Object()
|
||||
' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' or replace the call to GetRecordFieldValue_Base().
|
||||
Return GetRecordFieldValue_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
<System.Web.Services.WebMethod()> _
|
||||
Public Shared Function GetImage(ByVal tableName As String, ByVal recordID As String, ByVal columnName As String, ByVal title As String, ByVal persist As Boolean, ByVal popupWindowHeight As Integer, ByVal popupWindowWidth As Integer, ByVal popupWindowScrollBar As Boolean) As Object()
|
||||
' GetImage gets the Image url for the image in the column "columnName" and
|
||||
' in the record specified by recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetImage_Base()
|
||||
' or replace the call to GetImage_Base().
|
||||
Return GetImage_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
' Page Event Handlers - buttons, sort, links
|
||||
Public Sub NextButton_Click(ByVal sender As Object, ByVal args As EventArgs)
|
||||
NextButton_Click_Base(sender, args)
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Section 2: Do not modify this section."
|
||||
|
||||
|
||||
|
||||
Private Sub Initialize()
|
||||
' Called by the class constructor to initialize event handlers for Init and Load
|
||||
' You can customize by modifying the constructor in Section 1.
|
||||
AddHandler Init, AddressOf Me.Page_InitializeEventHandlers
|
||||
AddHandler Load, AddressOf Me.Page_Load
|
||||
End Sub
|
||||
|
||||
' Handles base.Init. Registers event handler for any button, sort or links.
|
||||
' You can add additional Init handlers in Section 1.
|
||||
Protected Overridable Sub Page_InitializeEventHandlers(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
' Register the Event handler for any Events.
|
||||
|
||||
AddHandler NextButton.Button.Click, AddressOf Me.NextButton_Click
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub Page_PreInit_Base()
|
||||
'If this is multi-color theme assign proper theme
|
||||
Dim selectedTheme As String = Me.GetSelectedTheme()
|
||||
If Not String.IsNullOrEmpty(selectedTheme) Then Me.Page.Theme = selectedTheme
|
||||
End Sub
|
||||
|
||||
' Handles base.Load. Read database data and put into the UI controls.
|
||||
' You can add additional Load handlers in Section 1.
|
||||
Protected Overridable Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
|
||||
' Check if user has access to this page. Redirects to either sign-in page
|
||||
' or 'no access' page if not. Does not do anything if role-based security
|
||||
' is not turned on, but you can override to add your own security.
|
||||
Me.Authorize(Me.GetAuthorizedRoles)
|
||||
' Load data only when displaying the page for the first time
|
||||
If Not Me.IsPostBack Then
|
||||
' Setup the header text for the validation summary control.
|
||||
Me.ValidationSummary1.HeaderText = GetResourceValue("ValidationSummaryHeaderText", Me.AppName)
|
||||
' Read the data for all controls on the page.
|
||||
' To change the behavior, override the DataBind method for the individual
|
||||
' record or table UI controls.
|
||||
Me.LoadData()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetRecordFieldValue_Base(ByVal tableName As String, ByVal recordID As String, ByVal columnName As String, ByVal title As String, ByVal persist As Boolean, ByVal popupWindowHeight As Integer, ByVal popupWindowWidth As Integer, ByVal popupWindowScrollBar As Boolean) As Object()
|
||||
Dim content As String = NetUtils.EncodeStringForHtmlDisplay(BaseClasses.Utils.MiscUtils.GetFieldData(tableName, recordID, columnName))
|
||||
' returnValue is an array of string values.
|
||||
' returnValue(0) represents title of the pop up window.
|
||||
' returnValue(1) represents content ie, image url.
|
||||
' returnValue(2) represents whether pop up window should be made persistant
|
||||
' or it should close as soon as mouse moves out.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' (0),(2),(3) and (4) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue() As Object = New Object((6) - 1) {}
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
Public Shared Function GetImage_Base(ByVal tableName As String, ByVal recordID As String, ByVal columnName As String, ByVal title As String, ByVal persist As Boolean, ByVal popupWindowHeight As Integer, ByVal popupWindowWidth As Integer, ByVal popupWindowScrollBar As Boolean) As Object()
|
||||
Dim content As String = ("<IMG alt =\""" + title + "\"" src =" + ("\""../Shared/ExportFieldValue.aspx?Table=" _
|
||||
+ (tableName + ("&Field=" _
|
||||
+ (columnName + ("&Record=" _
|
||||
+ (recordID + "\""/>")))))))
|
||||
' returnValue is an array of string values.
|
||||
' returnValue(0) represents title of the pop up window.
|
||||
' returnValue(1) represents content ie, image url.
|
||||
' returnValue(2) represents whether pop up window should be made persistant
|
||||
' or it should close as soon as mouse moves out.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' (0),(2),(3), (4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue() As Object = New Object((6) - 1) {}
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
' Load data from database into UI controls.
|
||||
' Modify LoadData in Section 1 above to customize. Or override DataBind() in
|
||||
' the individual table and record controls to customize.
|
||||
Public Sub LoadData_Base()
|
||||
|
||||
End Sub
|
||||
|
||||
' event handler for Button with Layout
|
||||
Public Sub NextButton_Click_Base(ByVal sender As Object, ByVal args As EventArgs)
|
||||
Dim inputFile As System.Web.UI.HtmlControls.HtmlInputFile
|
||||
inputFile = DirectCast((Me.Page.FindControl("InputFile")), System.Web.UI.HtmlControls.HtmlInputFile)
|
||||
|
||||
Dim tmpPath As String = String.Empty
|
||||
|
||||
|
||||
If (Not (inputFile.PostedFile Is Nothing) AndAlso (inputFile.PostedFile.ContentLength > 0)) Then
|
||||
If ValidateFileTypeSupported(inputFile.PostedFile.FileName) Then
|
||||
SyncLock Me
|
||||
tmpPath = Server.MapPath("../Temp/" + Guid.NewGuid().ToString())
|
||||
End SyncLock
|
||||
Me.Page.Session("FilePath") = tmpPath
|
||||
|
||||
Try
|
||||
inputFile.PostedFile.SaveAs(tmpPath)
|
||||
' pass the table name with encryption.
|
||||
Me.Page.Response.Redirect("ImportData.aspx?TableName=" + Me.Encrypt(Me.TableName))
|
||||
Catch
|
||||
Dim msg As String = Me.GetResourceValue("Import:FailedToSaveFile", Me.AppName)
|
||||
BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", msg)
|
||||
End Try
|
||||
Else
|
||||
|
||||
BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", Me.GetResourceValue("Import:FileTypeMsg", Me.AppName))
|
||||
End If
|
||||
Else
|
||||
BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", Me.GetResourceValue("Import:SelectFile", Me.AppName))
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub rbtnCSV_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
|
||||
'Me.pnlCSV.Enabled = True
|
||||
'Me.pnlTAB.Enabled = False
|
||||
'Me.pnlExcel.Enabled = False
|
||||
'Me.pnlAccess.Enabled = False
|
||||
Me.txtAccessPassword.Enabled = False
|
||||
Me.txtAccessTableName.Enabled = False
|
||||
Me.txtExcelSheetname.Enabled = False
|
||||
End Sub
|
||||
Protected Sub rbtnTAB_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
|
||||
'Me.pnlCSV.Enabled = False
|
||||
'Me.pnlTAB.Enabled = True
|
||||
'Me.pnlExcel.Enabled = False
|
||||
'Me.pnlAccess.Enabled = False
|
||||
Me.txtAccessPassword.Enabled = False
|
||||
Me.txtAccessTableName.Enabled = False
|
||||
Me.txtExcelSheetname.Enabled = False
|
||||
End Sub
|
||||
Protected Sub rbtnExcel_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
|
||||
'Me.pnlCSV.Enabled = False
|
||||
'Me.pnlTAB.Enabled = False
|
||||
'Me.pnlExcel.Enabled = True
|
||||
'Me.pnlAccess.Enabled = False
|
||||
Me.txtAccessPassword.Enabled = False
|
||||
Me.txtAccessTableName.Enabled = False
|
||||
Me.txtExcelSheetname.Enabled = True
|
||||
Me.txtExcelSheetname.Focus()
|
||||
End Sub
|
||||
Protected Sub rbtnAccess_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
|
||||
'Me.pnlCSV.Enabled = False
|
||||
'Me.pnlTAB.Enabled = False
|
||||
'Me.pnlExcel.Enabled = False
|
||||
'Me.pnlAccess.Enabled = True
|
||||
Me.txtAccessPassword.Enabled = True
|
||||
Me.txtAccessTableName.Enabled = True
|
||||
Me.txtExcelSheetname.Enabled = False
|
||||
Me.txtAccessTableName.Focus()
|
||||
End Sub
|
||||
|
||||
|
||||
''' -----------------------------------------------------------------------------
|
||||
''' <summary>
|
||||
''' To validate supported file type for Import
|
||||
''' </summary>
|
||||
''' <remarks>
|
||||
''' </remarks>
|
||||
''' <history>
|
||||
''' [nparmar] 5/2008 Created
|
||||
''' </history>
|
||||
''' -----------------------------------------------------------------------------
|
||||
Public Function ValidateFileTypeSupported(ByVal FileName As String) As Boolean
|
||||
If (FileName Is Nothing) Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim extension As String = BaseClasses.Utils.FileUtils.GetFileExtension(FileName).ToUpper()
|
||||
|
||||
If (extension = "MDB" OrElse extension = "ACCDB") AndAlso (Me.rbtnCSV.Checked OrElse Me.rbtnTAB.Checked OrElse Me.rbtnExcel.Checked) Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
If (extension = "XLS" OrElse extension = "XLSX") AndAlso (Me.rbtnCSV.Checked OrElse Me.rbtnTAB.Checked OrElse Me.rbtnAccess.Checked) Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
If Me.rbtnCSV.Checked Then
|
||||
Session("FileType") = "CSV"
|
||||
Return True
|
||||
End If
|
||||
|
||||
If Me.rbtnTAB.Checked Then
|
||||
Session("FileType") = "TAB"
|
||||
Return True
|
||||
End If
|
||||
|
||||
If Me.rbtnExcel.Checked Then
|
||||
Select Case extension
|
||||
Case "XLS"
|
||||
Session("FileType") = "XLS"
|
||||
Case "XLSX"
|
||||
Session("FileType") = "XLSX"
|
||||
End Select
|
||||
|
||||
If Me.txtExcelSheetname.Text <> "" Then
|
||||
Session("SheetName") = Me.txtExcelSheetname.Text
|
||||
Else
|
||||
Session("SheetName") = "Sheet1"
|
||||
End If
|
||||
|
||||
Return True
|
||||
End If
|
||||
|
||||
If Me.rbtnAccess.Checked Then
|
||||
Select Case extension
|
||||
Case "MDB"
|
||||
Session("FileType") = "MDB"
|
||||
Case "ACCDB"
|
||||
Session("FileType") = "ACCDB"
|
||||
End Select
|
||||
|
||||
If Me.txtAccessTableName.Text <> "" Then
|
||||
Session("TableName") = Me.txtAccessTableName.Text
|
||||
Else
|
||||
Session("TableName") = "Table1"
|
||||
End If
|
||||
|
||||
If Me.txtAccessPassword.Text <> "" Then
|
||||
Session("pwd") = Me.txtAccessPassword.Text
|
||||
End If
|
||||
|
||||
Return True
|
||||
End If
|
||||
|
||||
Session("FileType") = ""
|
||||
Return False
|
||||
End Function
|
||||
Protected Overrides Sub UpdateSessionNavigationHistory()
|
||||
'Do Nothing
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
|
86
Shared/Show_Error.aspx
Normal file
86
Shared/Show_Error.aspx
Normal file
|
@ -0,0 +1,86 @@
|
|||
<%@ Page Language="vb" AutoEventWireup="true" EnableEventValidation="false" Codefile="Show_Error.aspx.vb" Inherits="Persons.UI.Show_Error" %>
|
||||
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<specificcontent requirement="WS/WAP">
|
||||
<script runat="server" language="VB">
|
||||
Public Overloads Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
|
||||
Dim selectedTheme As String = Me.GetSelectedTheme()
|
||||
If Not String.IsNullOrEmpty(selectedTheme) Then Me.Page.Theme = selectedTheme
|
||||
End Sub
|
||||
</script>
|
||||
</specificcontent>
|
||||
<title>Show Error Page</title>
|
||||
</head>
|
||||
<body class="pBack">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pWrapper">
|
||||
<tr>
|
||||
<td class="panelTL">
|
||||
<img src="../Images/space.gif" class="panelTLSpace" alt="" /></td>
|
||||
<td class="panelT">
|
||||
<img src="../Images/space.gif" class="panelTSpace" alt="" /></td>
|
||||
<td class="panelTR">
|
||||
<img src="../Images/space.gif" class="panelTRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelL">
|
||||
<img src="../Images/space.gif" class="panelLSpace" alt="" /></td>
|
||||
<td class="panelC">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="pContent">
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"
|
||||
width="100%" id="AutoNumber1">
|
||||
<tr>
|
||||
<td class="dialog_header" colspan="3">
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="dialogHeaderEdgeL">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
<td class="dhb">
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td class="dialog_header_text">
|
||||
Error</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="dialogHeaderEdgeR">
|
||||
<img src="../Images/space.gif" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
<td class="configureErrorPagesText">
|
||||
<br />
|
||||
<asp:Literal ID="ShowErrorLine1" runat="server" Text='<%# GetResourceValue("Txt:ShowErrorLine1") %>' /><br />
|
||||
<br />
|
||||
<%-- Unable to access data. Please contact your system administrator or customer support.--%>
|
||||
</td>
|
||||
<td style="width: 20px;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="panelR">
|
||||
<img src="../Images/space.gif" class="panelRSpace" alt="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="panelBL">
|
||||
<img src="../Images/space.gif" class="panelBLSpace" alt="" /></td>
|
||||
<td class="panelB">
|
||||
<img src="../Images/space.gif" class="panelBSpace" alt="" /></td>
|
||||
<td class="panelBR">
|
||||
<img src="../Images/space.gif" class="panelBRSpace" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
72
Shared/Show_Error.aspx.vb
Normal file
72
Shared/Show_Error.aspx.vb
Normal file
|
@ -0,0 +1,72 @@
|
|||
Namespace Persons.UI
|
||||
|
||||
' Code-behind class for the Show_Error page.
|
||||
' Place your customizations in Section 1. Do not modify Section 2.
|
||||
Partial Public Class Show_Error
|
||||
Inherits BaseApplicationPage
|
||||
|
||||
|
||||
#Region "Section 1: Place your customizations here."
|
||||
Public Sub New()
|
||||
Me.IsUpdatesSessionNavigationHistory = False
|
||||
End Sub
|
||||
|
||||
' LoadData reads database data and assigns it to UI controls.
|
||||
' Customize by adding code before or after the call to LoadData_Base()
|
||||
' or replace the call to LoadData_Base().
|
||||
Public Sub LoadData()
|
||||
LoadData_Base()
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
|
||||
'Override call to PreInit_Base() here to change top level master page used by this page, for example uncomment
|
||||
'next line to use Microsoft SharePoint default master page
|
||||
'If Not Me.Master Is Nothing Then Me.Master.MasterPageFile = Microsoft.SharePoint.SPContext.Current.Web.MasterUrl
|
||||
'You may change here assignment of application theme
|
||||
Me.PreInit_Base()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Section 2: Do not modify this section."
|
||||
|
||||
' Handles MyBase.Load. If you need to, you can add additional Load handlers in Section 1.
|
||||
' Read database data and put into the UI controls.
|
||||
Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
' Load data only when displaying the page for the first time
|
||||
If (Not Me.IsPostBack) Then
|
||||
|
||||
' Read the data for all controls on the page.
|
||||
' To change the behavior, override the DataBind method for the individual
|
||||
' record or table UI controls.
|
||||
Me.LoadData()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
' Load data from database into UI controls.
|
||||
' Modify LoadData in Section 1 above to customize. Or override DataBind() in
|
||||
' the individual table and record controls to customize.
|
||||
Public Sub LoadData_Base()
|
||||
Me.Databind()
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub UpdateSessionNavigationHistory()
|
||||
'Do nothing
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub PreInit_Base()
|
||||
'If it is SharePoint application this function performs dynamic Master Page assignment.
|
||||
'If application uses multi-color theme this function performs dynamic theme assignment.
|
||||
'This is multi-color theme, so assign proper theme
|
||||
Dim selectedTheme As String = Me.GetSelectedTheme()
|
||||
If Not String.IsNullOrEmpty(selectedTheme) Then Me.Page.Theme = selectedTheme
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
6
Shared/ThemeButton.ascx
Normal file
6
Shared/ThemeButton.ascx
Normal file
|
@ -0,0 +1,6 @@
|
|||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<%@ Control Language="vb" AutoEventWireup="false" CodeFile="ThemeButton.ascx.vb" Inherits="Persons.UI.ThemeButton" %>
|
||||
<%@ Register Tagprefix="Selectors" Namespace="Persons" %>
|
||||
|
||||
<%@ Register Tagprefix="BaseClasses" Namespace="BaseClasses.Web.UI.WebControls" Assembly="BaseClasses" %><table class="buttonPadding" cellspacing="0" cellpadding="0" border="0" onmouseover="this.style.cursor='pointer'; return true;" onclick="clickLinkButtonText(this, event);"><tr><td class="bTL"><img src="../Images/space.gif" alt="" class="bTLSpace" /></td><td class="bT"><img src="../Images/space.gif" alt="" class="bTSpace" style="width: 100%;" /></td><td class="bTR"><img src="../Images/space.gif" alt="" class="bTRSpace" /></td></tr><tr><td class="bL"><img src="../Images/space.gif" alt="" class="bLSpace" style="height: 100%;" /></td><td class="bC"><asp:LinkButton CommandName="Redirect" runat="server" id="_Button" cssclass="button_link">
|
||||
</asp:LinkButton></td><td class="bR"><img src="../Images/space.gif" alt="" class="bRSpace" style="height: 100%;" /></td></tr><tr><td class="bBL"><img src="../Images/space.gif" alt="" class="bBLSpace" /></td><td class="bB"><img src="../Images/space.gif" alt="" class="bBSpace" style="width: 100%;" /></td><td class="bBR"><img src="../Images/space.gif" alt="" class="bBRSpace" /></td></tr></table>
|
436
Shared/ThemeButton.ascx.vb
Normal file
436
Shared/ThemeButton.ascx.vb
Normal file
|
@ -0,0 +1,436 @@
|
|||
|
||||
Option Strict On
|
||||
Imports System
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports System.ComponentModel
|
||||
Imports BaseClasses
|
||||
Imports BaseClasses.Utils
|
||||
Imports BaseClasses.Web.UI.WebControls
|
||||
|
||||
Imports Persons.Business
|
||||
Imports Persons.Data
|
||||
|
||||
Namespace Persons.UI
|
||||
|
||||
' Code-behind class for the ThemeButton user control.
|
||||
Public Partial Class ThemeButton
|
||||
Inherits BaseApplicationUserControl
|
||||
Implements IThemeButton
|
||||
#Region "Section 1: Place your customizations here."
|
||||
|
||||
Public Sub LoadData()
|
||||
' LoadData reads database data and assigns it to UI controls.
|
||||
' Customize by adding code before or after the call to LoadData_Base()
|
||||
' or replace the call to LoadData_Base().
|
||||
LoadData_Base()
|
||||
End Sub
|
||||
|
||||
#Region "Ajax Functions"
|
||||
|
||||
' <Services.WebMethod()> _
|
||||
' Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
' ByVal recordID As String, _
|
||||
' ByVal columnName As String, _
|
||||
' ByVal title As String, _
|
||||
' ByVal persist As Boolean, _
|
||||
' ByVal popupWindowHeight As Integer, _
|
||||
' ByVal popupWindowWidth As Integer, _
|
||||
' ByVal popupWindowScrollBar As Boolean _
|
||||
' ) As Object()
|
||||
' ' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' ' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' ' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' ' or replace the call to GetRecordFieldValue_Base().
|
||||
' Return GetRecordFieldValue_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
' End Function
|
||||
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetImage(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetImage gets the Image url for the image in the column "columnName" and
|
||||
' in the record specified by recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetImage_Base()
|
||||
' or replace the call to GetImage_Base().
|
||||
Return GetImage_Base(tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
' Page Event Handlers - buttons, sort, links
|
||||
|
||||
Public Sub Button_Click(ByVal sender As Object, ByVal args As EventArgs)
|
||||
|
||||
' Click handler for Button.
|
||||
' Customize by adding code before the call or replace the call to the Base function with your own code.
|
||||
Button_Click_Base(sender, args)
|
||||
' NOTE: If the Base function redirects to another page, any code here will not be executed.
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Overloads Overrides Sub BasePage_PreRender(ByVal sender As Object, ByVal e As EventArgs)
|
||||
MyBase.BasePage_PreRender(sender, e)
|
||||
Base_RegisterPostback()
|
||||
End Sub
|
||||
<Services.WebMethod()> _
|
||||
Public Shared Function GetRecordFieldValue(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
' GetRecordFieldValue gets the pop up window content from the column specified by
|
||||
' columnName in the record specified by the recordID in data base table specified by tableName.
|
||||
' Customize by adding code before or after the call to GetRecordFieldValue_Base()
|
||||
' or replace the call to GetRecordFieldValue_Base().
|
||||
Return GetRecordFieldValue_Base(tableName, recordID, columnName, fieldName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar)
|
||||
End Function
|
||||
Public Overrides Sub SetChartControl(ByVal chartCtrlName As String)
|
||||
Me.SetChartControl_Base(chartCtrlName)
|
||||
End Sub
|
||||
Public Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
|
||||
Me.Page_PreRender_Base(sender,e)
|
||||
End Sub
|
||||
Protected Overrides Function SaveViewState() As Object
|
||||
Return SaveViewState_Base()
|
||||
End Function
|
||||
Protected Overrides Sub LoadViewState(ByVal savedState As Object)
|
||||
LoadViewState_Base(savedState)
|
||||
End Sub
|
||||
Protected Overrides Sub ClearControlsFromSession()
|
||||
ClearControlsFromSession_Base()
|
||||
End Sub
|
||||
Protected Overrides Sub SaveControlsToSession()
|
||||
SaveControlsToSession_Base()
|
||||
End Sub
|
||||
Public Sub Page_InitializeEventHandlers(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Init
|
||||
' Handles MyBase.Init.
|
||||
' Register the Event handler for any Events.
|
||||
Me.Page_InitializeEventHandlers_Base(sender,e)
|
||||
End Sub
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate as BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS as Boolean) As String
|
||||
Return EvaluateFormula_Base(formula, dataSourceForEvaluate, format, variables, includeDS)
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "Section 2: Do not modify this section."
|
||||
|
||||
Protected Sub Page_InitializeEventHandlers_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
|
||||
' the following code for accordion is necessary or the Me.{ControlName} will return Nothing
|
||||
|
||||
' Register the Event handler for any Events.
|
||||
|
||||
|
||||
' Setup the pagination events.
|
||||
|
||||
AddHandler Me.Button.Click, AddressOf Button_Click
|
||||
|
||||
Me.ClearControlsFromSession()
|
||||
End Sub
|
||||
|
||||
Private Sub Base_RegisterPostback()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
' Handles MyBase.Load. Read database data and put into the UI controls.
|
||||
' If you need to, you can add additional Load handlers in Section 1.
|
||||
Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
|
||||
|
||||
If (Not Me.IsPostBack) Then
|
||||
|
||||
End If
|
||||
|
||||
|
||||
' Load data only when displaying the page for the first time or if postback from child window
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Read the data for all controls on the page.
|
||||
' To change the behavior, override the DataBind method for the individual
|
||||
' record or table UI controls.
|
||||
Me.LoadData()
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetRecordFieldValue_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal fieldName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
If Not IsNothing(recordID) Then
|
||||
recordID = System.Web.HttpUtility.UrlDecode(recordID)
|
||||
End If
|
||||
Dim content as String = BaseClasses.Utils.MiscUtils.GetFieldData(tableName, recordID, columnName)
|
||||
|
||||
content = NetUtils.EncodeStringForHtmlDisplay(content)
|
||||
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window
|
||||
'returnValue(1) represents content of the pop up window
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function GetImage_Base(ByVal tableName As String, _
|
||||
ByVal recordID As String, _
|
||||
ByVal columnName As String, _
|
||||
ByVal title As String, _
|
||||
ByVal persist As Boolean, _
|
||||
ByVal popupWindowHeight As Integer, _
|
||||
ByVal popupWindowWidth As Integer, _
|
||||
ByVal popupWindowScrollBar As Boolean _
|
||||
) As Object()
|
||||
Dim content As String = "<IMG alt =""" & title & """ src =" & """../Shared/ExportFieldValue.aspx?Table=" & tableName & "&Field=" & columnName & "&Record=" & recordID & """/>"
|
||||
'returnValue is an array of string values.
|
||||
'returnValue(0) represents title of the pop up window.
|
||||
'returnValue(1) represents content ie, image url.
|
||||
' retrunValue(2) represents whether pop up window should be made persistant
|
||||
' or it should closes as soon as mouse moved out.
|
||||
' returnValue(3), (4) represents pop up window height and width respectivly
|
||||
' returnValue(5) represents whether pop up window should contain scroll bar.
|
||||
' (0),(2),(3),(4) and (5) is initially set as pass through attribute.
|
||||
' They can be modified by going to Attribute tab of the properties window of the control in aspx page.
|
||||
Dim returnValue(6) As Object
|
||||
returnValue(0) = title
|
||||
returnValue(1) = content
|
||||
returnValue(2) = persist
|
||||
returnValue(3) = popupWindowWidth
|
||||
returnValue(4) = popupWindowHeight
|
||||
returnValue(5) = popupWindowScrollBar
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
Public Sub SetChartControl_Base(ByVal chartCtrlName As String)
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub SaveControlsToSession_Base()
|
||||
MyBase.SaveControlsToSession()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub ClearControlsFromSession_Base()
|
||||
MyBase.ClearControlsFromSession()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LoadViewState_Base(ByVal savedState As Object)
|
||||
MyBase.LoadViewState(savedState)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Function SaveViewState_Base() As Object
|
||||
|
||||
Return MyBase.SaveViewState()
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub Page_PreRender_Base(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
|
||||
' Load data for each record and table UI control.
|
||||
|
||||
' Data bind for each chart UI control.
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
' Load data from database into UI controls.
|
||||
' Modify LoadData in Section 1 above to customize. Or override DataBind() in
|
||||
' the individual table and record controls to customize.
|
||||
Public Sub LoadData_Base()
|
||||
Try
|
||||
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' Must start a transaction before performing database operations
|
||||
DbUtils.StartTransaction()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Me.DataBind()
|
||||
|
||||
' Load and bind data for each record and table UI control.
|
||||
|
||||
|
||||
' Load data for chart.
|
||||
|
||||
|
||||
' initialize aspx controls
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
' An error has occured so display an error message.
|
||||
Utils.RegisterJScriptAlert(Me, "Page_Load_Error_Message", ex.Message)
|
||||
Finally
|
||||
If (Not Me.IsPostBack OrElse Me.Request("__EVENTTARGET") = "ChildWindowPostBack") Then
|
||||
' End database transaction
|
||||
DbUtils.EndTransaction()
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public EvaluateFormulaDelegate As BaseClasses.Data.DataSource.EvaluateFormulaDelegate = New BaseClasses.Data.DataSource.EvaluateFormulaDelegate(AddressOf Me.EvaluateFormula)
|
||||
|
||||
Public Overridable Function EvaluateFormula_Base(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object), ByVal includeDS As Boolean) As String
|
||||
Dim e As FormulaEvaluator = New FormulaEvaluator()
|
||||
|
||||
' add variables for formula evaluation
|
||||
If variables IsNot Nothing Then
|
||||
Dim enumerator As System.Collections.Generic.IEnumerator(Of System.Collections.Generic.KeyValuePair(Of String, Object)) = variables.GetEnumerator()
|
||||
While enumerator.MoveNext()
|
||||
e.Variables.Add(enumerator.Current.Key, enumerator.Current.Value)
|
||||
End While
|
||||
End If
|
||||
|
||||
If includeDS
|
||||
|
||||
End If
|
||||
|
||||
|
||||
e.CallingControl = Me
|
||||
|
||||
e.DataSource = dataSourceForEvaluate
|
||||
|
||||
|
||||
Dim resultObj As Object = e.Evaluate(formula)
|
||||
If resultObj Is Nothing Then
|
||||
Return ""
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrEmpty(format) AndAlso (String.IsNullOrEmpty(formula) OrElse formula.IndexOf("Format(") < 0) Then
|
||||
Return FormulaUtils.Format(resultObj, format)
|
||||
Else
|
||||
Return resultObj.ToString()
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord, ByVal format As String, ByVal variables As System.Collections.Generic.IDictionary(Of String, Object)) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, format, variables, True)
|
||||
End Function
|
||||
|
||||
|
||||
Private Function EvaluateFormula(ByVal formula As String, ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord) As String
|
||||
Return EvaluateFormula(formula, dataSourceForEvaluate, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String, ByVal includeDS As Boolean) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, includeDS)
|
||||
End Function
|
||||
|
||||
Public Function EvaluateFormula(ByVal formula As String) As String
|
||||
Return EvaluateFormula(formula, Nothing, Nothing, Nothing, True)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
' Write out the Set methods
|
||||
|
||||
|
||||
' Write out the DataSource properties and methods
|
||||
|
||||
|
||||
' Write out event methods for the page events
|
||||
|
||||
' event handler for LinkButton
|
||||
Public Sub Button_Click_Base(ByVal sender As Object, ByVal args As EventArgs)
|
||||
|
||||
Try
|
||||
|
||||
Catch ex As Exception
|
||||
Ctype(Me.Page, BaseApplicationPage).ErrorOnPage = True
|
||||
|
||||
' Report the error message to the end user
|
||||
Utils.MiscUtils.RegisterJScriptAlert(Me, "BUTTON_CLICK_MESSAGE", ex.Message)
|
||||
|
||||
Finally
|
||||
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
#Region "Interface Properties"
|
||||
|
||||
<Bindable(True), _
|
||||
Category("Behavior"), _
|
||||
DefaultValue(""), _
|
||||
NotifyParentProperty(True), _
|
||||
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
|
||||
Public ReadOnly Property Button() As System.Web.UI.WebControls.LinkButton Implements IThemeButton.Button
|
||||
Get
|
||||
Return CType(BaseClasses.Utils.MiscUtils.FindControlRecursively(Me, "_Button"), System.Web.UI.WebControls.LinkButton)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Property Visible() As Boolean Implements IThemeButton.Visible
|
||||
|
||||
Get
|
||||
Return MyBase.Visible
|
||||
End Get
|
||||
Set(ByVal value As Boolean)
|
||||
MyBase.Visible = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Public Shadows ReadOnly Property Page() As BaseApplicationPage
|
||||
Get
|
||||
Return DirectCast(MyBase.Page, BaseApplicationPage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
|
||||
|
150
Shared/ThemeButton.xml
Normal file
150
Shared/ThemeButton.xml
Normal file
|
@ -0,0 +1,150 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<ComponentDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.ironspeed.com/designer">
|
||||
<Generator>Iron Speed Designer</Generator>
|
||||
<Version>9.2.0</Version>
|
||||
<Self>
|
||||
<Name>ThemeButton</Name>
|
||||
<Type>Button</Type>
|
||||
<GenerateDirectory>Shared</GenerateDirectory>
|
||||
<Layout>Shared\ThemeButton.html</Layout>
|
||||
<DisplayName>ThemeButton</DisplayName>
|
||||
<Description>(Description)</Description>
|
||||
</Self>
|
||||
<ComposedOf>
|
||||
<ContainedComponent>
|
||||
<Name>Button</Name>
|
||||
<Type>LinkButton</Type>
|
||||
<PassthroughAttributes>
|
||||
<Attribute>
|
||||
<Name>CssClass</Name>
|
||||
<Value>button_link</Value>
|
||||
</Attribute>
|
||||
</PassthroughAttributes>
|
||||
</ContainedComponent>
|
||||
</ComposedOf>
|
||||
|
||||
<LayoutDefinition><![CDATA[<?xml version="1.0" encoding="utf-16"?>
|
||||
<LayoutDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<Layout Name="Button" Type="RootLayout">
|
||||
<Prolog />
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" alt="" class="bTLSpace" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>bTL</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" alt="" class="bTSpace" style="width: 100%;" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>bT</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" alt="" class="bTRSpace" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>bTR</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<RowAttributes />
|
||||
</Row>
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" alt="" class="bLSpace" style="height: 100%;" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>bL</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;GEN:LINKBUTTON NAME="Button"/&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>bC</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" alt="" class="bRSpace" style="height: 100%;" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>bR</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<RowAttributes />
|
||||
</Row>
|
||||
<Row>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" alt="" class="bBLSpace" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>bBL</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" alt="" class="bBSpace" style="width: 100%;" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>bB</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<Cell>
|
||||
<Value>&lt;img src="../Images/space.gif" alt="" class="bBRSpace" /&gt;</Value>
|
||||
<CellAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>bBR</AttributeValue>
|
||||
</Attribute>
|
||||
</CellAttributes>
|
||||
</Cell>
|
||||
<RowAttributes />
|
||||
</Row>
|
||||
<Epilog />
|
||||
<TableAttributes>
|
||||
<Attribute>
|
||||
<Name>class</Name>
|
||||
<AttributeValue>buttonPadding</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>cellspacing</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>cellpadding</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>border</Name>
|
||||
<AttributeValue>0</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onmouseover</Name>
|
||||
<AttributeValue>this.style.cursor='pointer'; return true;</AttributeValue>
|
||||
</Attribute>
|
||||
<Attribute>
|
||||
<Name>onclick</Name>
|
||||
<AttributeValue>clickLinkButtonText(this, event);</AttributeValue>
|
||||
</Attribute>
|
||||
</TableAttributes>
|
||||
</Layout>
|
||||
</LayoutDefinition>]]></LayoutDefinition>
|
||||
|
||||
</ComponentDefinition>
|
Loading…
Add table
Add a link
Reference in a new issue