Click here to Skip to main content
15,888,271 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Good Day all,

I have a big problem but i think its minor for you guys in CodeProject. I am creating a web application that has two main parts. The Payment part and Requisition part. It backbone is using access and the script is in ASP.NET. I managed to sort out most of the application. But I have been having a few problems. I was told to place the code here. So here it is:

ADDREQUISITION.ASPX:
XML
<%@ Register Tagprefix="Selectors" Namespace="PNR" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Tagprefix="PNR" Namespace="PNR.UI.Controls.AddRequisition" %>

<%@ Register Tagprefix="PNR" TagName="ThemeButton" Src="../Shared/ThemeButton.ascx" %>

<%@ Page Language="C#" EnableEventValidation="false" AutoEventWireup="false" CodeFile="AddRequisition.aspx.cs" Culture="en-GB" MasterPageFile="../Master Pages/VerticalMenu.master" Inherits="PNR.UI.AddRequisition" %>
<%@ Register Tagprefix="BaseClasses" Namespace="BaseClasses.Web.UI.WebControls" Assembly="BaseClasses" %><asp:Content id="PageSection" ContentPlaceHolderID="PageContent" Runat="server">
    <a id="StartOfPageContent"></a>
    <asp:UpdateProgress runat="server" id="UpdatePanel1_UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1">
            <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="UpdatePanel1" UpdateMode="Conditional">
            <ContentTemplate>
                <input type="hidden" id="_clientSideIsPostBack" name="clientSideIsPostBack" runat="server" />

                <table cellpadding="0" cellspacing="0" border="0"><tr><td><%= SystemUtils.GenerateEnterKeyCaptureBeginTag(FindControlRecursively("CancelButton"))%>
<%= SystemUtils.GenerateEnterKeyCaptureBeginTag(FindControlRecursively("EditButton"))%>
<%= SystemUtils.GenerateEnterKeyCaptureBeginTag(FindControlRecursively("OKButton"))%>
<%= SystemUtils.GenerateEnterKeyCaptureBeginTag(FindControlRecursively("SaveAndNewButton"))%>
<%= SystemUtils.GenerateEnterKeyCaptureBeginTag(FindControlRecursively("SaveButton"))%>

                        <PNR:RequisitionRecordControl runat="server" id="RequisitionRecordControl"> <table class="dv" cellpadding="0" cellspacing="0" border="0"><tr><td class="dh"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td class="dhel"><img src="../Images/space.gif" alt="" /></td><td class="dhb"><table cellpadding="0" cellspacing="0" border="0"><tr><td class="dht" valign="middle"><asp:Literal runat="server" id="RequisitionTitle" Text="&lt;%#String.Concat(GetResourceValue(&quot;Title:Add&quot;),&quot; Requisition&quot;) %>">   </asp:Literal></td></tr></table>
</td><td class="dher"><img src="../Images/space.gif" alt="" /></td></tr></table>
</td></tr><tr><td><asp:panel id="RequisitionRecordControlCollapsibleRegion" runat="server"><table class="dBody" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td><asp:panel id="RequisitionRecordControlPanel" runat="server"><table cellpadding="0" cellspacing="0" border="0"><tr><td class="fls"></td><td class="dfv"></td><td class="fls"><asp:Literal runat="server" id="RefNoLabel" Text="RefNo">  </asp:Literal></td><td class="dfv"><asp:TextBox runat="server" id="RefNo" MaxLength="50" columns="60" cssclass="field_input" rows="5" textmode="MultiLine"></asp:TextBox>&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="RefNoTextBoxMaxLengthValidator" ControlToValidate="RefNo" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;RefNo&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator></td></tr><tr><td class="fls"><asp:Literal runat="server" id="TransactionNoLabel" Text="TransactionNo">    </asp:Literal></td><td class="dfv"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="padding-right: 5px; vertical-align:top">
<asp:TextBox runat="server" id="TransactionNo" Columns="14" MaxLength="14" onkeyup="adjustInteger(this, event.keyCode)" cssclass="field_input"></asp:TextBox></td>
<td style="padding-right: 5px; white-space:nowrap;">
<%# SystemUtils.GenerateIncrementDecrementButtons(false, FindControlRecursively("TransactionNo"),"NumberTextBox","","","") %>
</td>
<td>
&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="TransactionNoTextBoxMaxLengthValidator" ControlToValidate="TransactionNo" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;TransactionNo&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator></td>
</tr>
</table>
 </td><td class="fls"><asp:Literal runat="server" id="TransactionDateLabel" Text="TransactionDate"> </asp:Literal></td><td class="dfv"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="padding-right: 5px; vertical-align:top">
<asp:TextBox runat="server" id="TransactionDate" Columns="20" MaxLength="20" cssclass="field_input"></asp:TextBox></td>
<td style="padding-right: 5px; white-space:nowrap;">

</td>
<td>
<Selectors:CalendarExtendarClass runat="server" ID="TransactionDateCalendarExtender" TargetControlID="TransactionDate" CssClass="MyCalendar" Format="D">
</Selectors:CalendarExtendarClass>&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="TransactionDateTextBoxMaxLengthValidator" ControlToValidate="TransactionDate" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;TransactionDate&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator></td>
</tr>
</table>
 </td></tr><tr><td class="fls"><asp:Literal runat="server" id="AmountLabel" Text="Amount">  </asp:Literal></td><td class="dfv"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="padding-right: 5px; vertical-align:top">
<asp:TextBox runat="server" id="Amount" Columns="20" MaxLength="20" onkeyup="adjustInteger(this, event.keyCode)" cssclass="field_input"></asp:TextBox></td>
<td style="padding-right: 5px; white-space:nowrap;">
<%# SystemUtils.GenerateIncrementDecrementButtons(false, FindControlRecursively("Amount"),"NumberTextBox","","","") %>
</td>
<td>
&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="AmountTextBoxMaxLengthValidator" ControlToValidate="Amount" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;Amount&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator></td>
</tr>
</table>
 </td><td class="fls"><asp:Literal runat="server" id="PreparedDateLabel" Text="PreparedDate">   </asp:Literal></td><td class="dfv"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="padding-right: 5px; vertical-align:top">
<asp:TextBox runat="server" id="PreparedDate" Columns="20" MaxLength="20" cssclass="field_input"></asp:TextBox></td>
<td style="padding-right: 5px; white-space:nowrap;">

</td>
<td>
<Selectors:CalendarExtendarClass runat="server" ID="PreparedDateCalendarExtender" TargetControlID="PreparedDate" CssClass="MyCalendar" Format="D">
</Selectors:CalendarExtendarClass>&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="PreparedDateTextBoxMaxLengthValidator" ControlToValidate="PreparedDate" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;PreparedDate&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator></td>
</tr>
</table>
 </td></tr><tr><td class="fls"><asp:Literal runat="server" id="CheckedDateLabel" Text="CheckedDate">    </asp:Literal></td><td class="dfv"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="padding-right: 5px; vertical-align:top">
<asp:TextBox runat="server" id="CheckedDate" Columns="20" MaxLength="20" cssclass="field_input"></asp:TextBox></td>
<td style="padding-right: 5px; white-space:nowrap;">

</td>
<td>
<Selectors:CalendarExtendarClass runat="server" ID="CheckedDateCalendarExtender" TargetControlID="CheckedDate" CssClass="MyCalendar" Format="D">
</Selectors:CalendarExtendarClass>&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="CheckedDateTextBoxMaxLengthValidator" ControlToValidate="CheckedDate" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;CheckedDate&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator></td>
</tr>
</table>
 </td><td class="fls"><asp:Literal runat="server" id="DateRequestedLabel" Text="DateRequested"> </asp:Literal></td><td class="dfv"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="padding-right: 5px; vertical-align:top">
<asp:TextBox runat="server" id="DateRequested" Columns="20" MaxLength="20" cssclass="field_input"></asp:TextBox></td>
<td style="padding-right: 5px; white-space:nowrap;">

</td>
<td>
<Selectors:CalendarExtendarClass runat="server" ID="DateRequestedCalendarExtender" TargetControlID="DateRequested" CssClass="MyCalendar" Format="D">
</Selectors:CalendarExtendarClass>&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="DateRequestedTextBoxMaxLengthValidator" ControlToValidate="DateRequested" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;DateRequested&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator></td>
</tr>
</table>
 </td></tr><tr><td class="fls"><asp:Literal runat="server" id="AuthorisedDateLabel" Text="AuthorisedDate">  </asp:Literal></td><td class="dfv"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="padding-right: 5px; vertical-align:top">
<asp:TextBox runat="server" id="AuthorisedDate" Columns="20" MaxLength="20" cssclass="field_input"></asp:TextBox></td>
<td style="padding-right: 5px; white-space:nowrap;">

</td>
<td>
<Selectors:CalendarExtendarClass runat="server" ID="AuthorisedDateCalendarExtender" TargetControlID="AuthorisedDate" CssClass="MyCalendar" Format="D">
</Selectors:CalendarExtendarClass>&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="AuthorisedDateTextBoxMaxLengthValidator" ControlToValidate="AuthorisedDate" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;AuthorisedDate&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator></td>
</tr>
</table>
 </td><td class="fls"><asp:Literal runat="server" id="ExchangeRateLabel" Text="ExchangeRate">   </asp:Literal></td><td class="dfv"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="padding-right: 5px; vertical-align:top">
<asp:TextBox runat="server" id="ExchangeRate" Columns="20" MaxLength="20" onkeyup="adjustInteger(this, event.keyCode)" cssclass="field_input"></asp:TextBox></td>
<td style="padding-right: 5px; white-space:nowrap;">
<%# SystemUtils.GenerateIncrementDecrementButtons(false, FindControlRecursively("ExchangeRate"),"NumberTextBox","","","") %>
</td>
<td>
&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="ExchangeRateTextBoxMaxLengthValidator" ControlToValidate="ExchangeRate" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;ExchangeRate&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator></td>
</tr>
</table>
 </td></tr><tr><td class="fls"></td><td class="dfv" colspan="3"></td></tr><tr><td class="fls"></td><td class="dfv"></td><td class="dfv"></td><td class="dfv"></td></tr><tr><td class="fls"></td><td class="dfv"></td><td class="dfv"></td><td class="dfv"></td></tr><tr><td class="fls"></td><td class="dfv"></td><td class="dfv"></td><td class="dfv"></td></tr><tr><td class="fls"><asp:Literal runat="server" id="PayeeIDLabel" Text="PayeeID">  </asp:Literal></td><td class="dfv" colspan="3" style="white-space:nowrap;"><asp:DropDownList runat="server" id="PayeeID" cssclass="field_input" onkeypress="dropDownListTypeAhead(this,false)"></asp:DropDownList>
<Selectors:FvLlsHyperLink runat="server" id="PayeeIDFvLlsHyperLink" ControlToUpdate="PayeeID" Text="&lt;%# GetResourceValue(&quot;LLS:Text&quot;, &quot;PNR&quot;) %>" MinListItems="100" Table="PayeeDetails" Field="PayeeDetails_.PayeeID" DisplayField="PayeeDetails_.PayeeDesc"></Selectors:FvLlsHyperLink>
<asp:ImageButton runat="server" id="PayeeIDAddRecordLink" causesvalidation="False" commandname="Redirect" imageurl="../Images/iconNewFlat.gif" tooltip="&lt;%# GetResourceValue(&quot;Btn:Add&quot;, &quot;PNR&quot;) %>">
    </asp:ImageButton> </td></tr><tr><td class="fls"><asp:Literal runat="server" id="ReasonLabel" Text="Reason">    </asp:Literal></td><td class="dfv" colspan="3"><asp:TextBox runat="server" id="Reason" MaxLength="50" columns="60" cssclass="field_input" rows="5" textmode="MultiLine"></asp:TextBox>&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="ReasonTextBoxMaxLengthValidator" ControlToValidate="Reason" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;Reason&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator> </td></tr><tr><td class="fls"><asp:Literal runat="server" id="PayerBankRefLabel" Text="PayerBankRef">  </asp:Literal></td><td class="dfv" colspan="3" style="white-space:nowrap;"><asp:DropDownList runat="server" id="PayerBankRef" cssclass="field_input" onkeypress="dropDownListTypeAhead(this,false)"></asp:DropDownList>
<Selectors:FvLlsHyperLink runat="server" id="PayerBankRefFvLlsHyperLink" ControlToUpdate="PayerBankRef" Text="&lt;%# GetResourceValue(&quot;LLS:Text&quot;, &quot;PNR&quot;) %>" MinListItems="100" Table="PayerBank" Field="PayerBank_.PayerBankRef" DisplayField="PayerBank_.PayerBankName"></Selectors:FvLlsHyperLink>
<asp:ImageButton runat="server" id="PayerBankRefAddRecordLink" causesvalidation="False" commandname="Redirect" imageurl="../Images/iconNewFlat.gif" tooltip="&lt;%# GetResourceValue(&quot;Btn:Add&quot;, &quot;PNR&quot;) %>">
    </asp:ImageButton> </td></tr><tr><td class="fls"><asp:Literal runat="server" id="CurrencyPaidInLabel" Text="CurrencyPaidIn">    </asp:Literal></td><td class="dfv" colspan="3"><asp:TextBox runat="server" id="CurrencyPaidIn" MaxLength="50" columns="60" cssclass="field_input" rows="5" textmode="MultiLine"></asp:TextBox>&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="CurrencyPaidInTextBoxMaxLengthValidator" ControlToValidate="CurrencyPaidIn" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;CurrencyPaidIn&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator> </td></tr><tr><td class="fls"><asp:Literal runat="server" id="AmountINWordsLabel" Text="AmountINWords">    </asp:Literal></td><td class="dfv" colspan="3"><asp:TextBox runat="server" id="AmountINWords" MaxLength="50" columns="60" cssclass="field_input" rows="5" textmode="MultiLine"></asp:TextBox>&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="AmountINWordsTextBoxMaxLengthValidator" ControlToValidate="AmountINWords" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;AmountINWords&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator> </td></tr><tr><td class="fls"><asp:Literal runat="server" id="ModeOfPaymentLabel" Text="ModeOfPayment">   </asp:Literal></td><td class="dfv" colspan="3"><asp:TextBox runat="server" id="ModeOfPayment" MaxLength="50" columns="60" cssclass="field_input" rows="5" textmode="MultiLine"></asp:TextBox>&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="ModeOfPaymentTextBoxMaxLengthValidator" ControlToValidate="ModeOfPayment" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;ModeOfPayment&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator> </td></tr><tr><td class="fls"><asp:Literal runat="server" id="ChequeNoLabel" Text="ChequeNo"> </asp:Literal></td><td class="dfv" colspan="3"><asp:TextBox runat="server" id="ChequeNo" MaxLength="50" columns="60" cssclass="field_input" rows="5" textmode="MultiLine"></asp:TextBox>&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="ChequeNoTextBoxMaxLengthValidator" ControlToValidate="ChequeNo" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;ChequeNo&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator> </td></tr><tr><td class="fls"><asp:Literal runat="server" id="ElectronicFTIDLabel" Text="ElectronicFTID">    </asp:Literal></td><td class="dfv" colspan="3"><asp:TextBox runat="server" id="ElectronicFTID" MaxLength="50" columns="60" cssclass="field_input" rows="5" textmode="MultiLine"></asp:TextBox>&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="ElectronicFTIDTextBoxMaxLengthValidator" ControlToValidate="ElectronicFTID" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;ElectronicFTID&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator> </td></tr><tr><td class="fls"><asp:Literal runat="server" id="StaffIDLabel" Text="StaffID">    </asp:Literal></td><td class="dfv" colspan="3" style="white-space:nowrap;"><asp:DropDownList runat="server" id="StaffID" cssclass="field_input" onkeypress="dropDownListTypeAhead(this,false)"></asp:DropDownList>
<Selectors:FvLlsHyperLink runat="server" id="StaffIDFvLlsHyperLink" ControlToUpdate="StaffID" Text="&lt;%# GetResourceValue(&quot;LLS:Text&quot;, &quot;PNR&quot;) %>" MinListItems="100" Table="Staff" Field="Staff_.StaffID" DisplayField="Staff_.StaffName"></Selectors:FvLlsHyperLink>
<asp:ImageButton runat="server" id="StaffIDAddRecordLink" causesvalidation="False" commandname="Redirect" imageurl="../Images/iconNewFlat.gif" tooltip="&lt;%# GetResourceValue(&quot;Btn:Add&quot;, &quot;PNR&quot;) %>">
    </asp:ImageButton> </td></tr><tr><td class="fls"><asp:Literal runat="server" id="ContractNoLabel" Text="ContractNo">    </asp:Literal></td><td class="dfv" colspan="3"><asp:TextBox runat="server" id="ContractNo" MaxLength="50" columns="60" cssclass="field_input" rows="5" textmode="MultiLine"></asp:TextBox>&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="ContractNoTextBoxMaxLengthValidator" ControlToValidate="ContractNo" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;ContractNo&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator> </td></tr><tr><td class="fls"><asp:Literal runat="server" id="LedgerCodeLabel" Text="LedgerCode">  </asp:Literal></td><td class="dfv" colspan="3"><asp:TextBox runat="server" id="LedgerCode" MaxLength="50" columns="60" cssclass="field_input" rows="5" textmode="MultiLine"></asp:TextBox>&nbsp;
<BaseClasses:TextBoxMaxLengthValidator runat="server" id="LedgerCodeTextBoxMaxLengthValidator" ControlToValidate="LedgerCode" ErrorMessage="&lt;%# GetResourceValue(&quot;Val:ValueTooLong&quot;, &quot;PNR&quot;).Replace(&quot;{FieldName}&quot;, &quot;LedgerCode&quot;) %>"></BaseClasses:TextBoxMaxLengthValidator> </td></tr><tr><td class="fls"><asp:Literal runat="server" id="SignatoryIDLabel" Text="SignatoryID">    </asp:Literal></td><td class="dfv" colspan="3" style="white-space:nowrap;"><asp:DropDownList runat="server" id="SignatoryID" cssclass="field_input" onkeypress="dropDownListTypeAhead(this,false)"></asp:DropDownList>
<Selectors:FvLlsHyperLink runat="server" id="SignatoryIDFvLlsHyperLink" ControlToUpdate="SignatoryID" Text="&lt;%# GetResourceValue(&quot;LLS:Text&quot;, &quot;PNR&quot;) %>" MinListItems="100" Table="Signatory" Field="Signatory_.SignatoryID" DisplayField="Signatory_.SignatoryID"></Selectors:FvLlsHyperLink>
<asp:ImageButton runat="server" id="SignatoryIDAddRecordLink" causesvalidation="False" commandname="Redirect" imageurl="../Images/iconNewFlat.gif" tooltip="&lt;%# GetResourceValue(&quot;Btn:Add&quot;, &quot;PNR&quot;) %>">
    </asp:ImageButton> </td></tr><tr><td class="fls"><asp:Literal runat="server" id="SystemUserIDLabel" Text="SystemUserID">    </asp:Literal></td><td class="dfv" colspan="3" style="white-space:nowrap;"><asp:DropDownList runat="server" id="SystemUserID" cssclass="field_input" onkeypress="dropDownListTypeAhead(this,false)"></asp:DropDownList>
<Selectors:FvLlsHyperLink runat="server" id="SystemUserIDFvLlsHyperLink" ControlToUpdate="SystemUserID" Text="&lt;%# GetResourceValue(&quot;LLS:Text&quot;, &quot;PNR&quot;) %>" MinListItems="100" Table="Users" Field="Users_.UserID" DisplayField="Users_.UserName"></Selectors:FvLlsHyperLink>
<asp:ImageButton runat="server" id="SystemUserIDAddRecordLink" causesvalidation="False" commandname="Redirect" imageurl="../Images/iconNewFlat.gif" tooltip="&lt;%# GetResourceValue(&quot;Btn:Add&quot;, &quot;PNR&quot;) %>">
    </asp:ImageButton> </td></tr></table></asp:panel>
</td></tr></table>
</asp:panel></td></tr></table>
</PNR:RequisitionRecordControl>

            <%= SystemUtils.GenerateEnterKeyCaptureEndTag(FindControlRecursively("SaveButton"))%>
<%= SystemUtils.GenerateEnterKeyCaptureEndTag(FindControlRecursively("SaveAndNewButton"))%>
<%= SystemUtils.GenerateEnterKeyCaptureEndTag(FindControlRecursively("OKButton"))%>
<%= SystemUtils.GenerateEnterKeyCaptureEndTag(FindControlRecursively("EditButton"))%>
<%= SystemUtils.GenerateEnterKeyCaptureEndTag(FindControlRecursively("CancelButton"))%>
</td></tr><tr><td class="recordPanelButtonsAlignment"><table cellpadding="0" cellspacing="0" border="0"><tr><td><PNR:ThemeButton runat="server" id="SaveButton" button-causesvalidation="True" button-commandname="UpdateData" button-text="&lt;%# GetResourceValue(&quot;Btn:Save&quot;, &quot;PNR&quot;) %>" button-tooltip="&lt;%# GetResourceValue(&quot;Btn:Save&quot;, &quot;PNR&quot;) %>" postback="True"></PNR:ThemeButton></td><td><PNR:ThemeButton runat="server" id="SaveAndNewButton" button-causesvalidation="True" button-commandname="UpdateData" button-text="&lt;%# GetResourceValue(&quot;Btn:SaveNNew&quot;, &quot;PNR&quot;) %>" button-tooltip="&lt;%# GetResourceValue(&quot;Btn:SaveNNew&quot;, &quot;PNR&quot;) %>" postback="True"></PNR:ThemeButton></td><td><PNR:ThemeButton runat="server" id="CancelButton" button-causesvalidation="False" button-commandname="Redirect" button-text="&lt;%# GetResourceValue(&quot;Btn:Cancel&quot;, &quot;PNR&quot;) %>" button-tooltip="&lt;%# GetResourceValue(&quot;Btn:Cancel&quot;, &quot;PNR&quot;) %>" postback="False"></PNR:ThemeButton></td></tr></table>
</td></tr></table>
    </ContentTemplate>
</asp:UpdatePanel>

    <div id="detailPopup" class="detailRolloverPopup" onmouseout="detailRolloverPopupClose();" onmouseover="clearTimeout(gPopupTimer);"></div>
    <asp:ValidationSummary id="ValidationSummary1" ShowMessageBox="true" ShowSummary="false" runat="server"></asp:ValidationSummary>
</asp:Content>


-----------------------------------------------------------------------------------------------
ADDREQUISITION.ASPX.CS

C#
// This file implements the code-behind class for AddRequisition.aspx.
// App_Code\AddRequisition.Controls.vb contains the Table, Row and Record control classes
// for the page.  Best practices calls for overriding methods in the Row or Record control classes.

#region "Using statements"    

using System;
using System.Data;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
        
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BaseClasses;
using BaseClasses.Utils;
using BaseClasses.Data;
using BaseClasses.Data.SqlProvider;
using BaseClasses.Web.UI.WebControls;
        
using PNR.Business;
using PNR.Data;
        

#endregion

  
namespace PNR.UI
{
  
public partial class AddRequisition
        : BaseApplicationPage
// Code-behind class for the AddRequisition page.
// Place your customizations in Section 1. Do not modify Section 2.
{
        
      #region "Section 1: Place your customizations here."

      public AddRequisition()
        {
            this.Initialize();
    

        }
        
    public void SetPageFocus()
    {
      //load scripts to all controls on page so that they will retain focus on PostBack
      this.LoadFocusScripts(this.Page);		
      //To set focus on page load to a specific control pass this control to the SetStartupFocus method. To get a hold of a control
      //use FindControlRecursively method. For example:
      //System.Web.UI.WebControls.TextBox controlToFocus = (System.Web.UI.WebControls.TextBox)(this.FindControlRecursively("ProductsSearch"));
      //this.SetFocusOnLoad(controlToFocus);
      //If no control is passed or control does not exist this method will set focus on the first focusable control on the page.
      this.SetFocusOnLoad();	
    }
         
        public void 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();            
        }
        
      private string EvaluateFormula(string formula, BaseClasses.Data.BaseRecord dataSourceForEvaluate, string format, System.Collections.Generic.IDictionary<string,object> variables, bool includeDS)
      {
          return EvaluateFormula_Base(formula, dataSourceForEvaluate, format, variables, includeDS);
      }
      
      public void Page_InitializeEventHandlers(object sender, System.EventArgs e)
      {
          // Handles base.Init. 
          // Register the Event handler for any Events.
          this.Page_InitializeEventHandlers_Base(sender, e);
      }
      
      protected override void SaveControlsToSession()
      {
        SaveControlsToSession_Base();
      }


      protected override void ClearControlsFromSession()
      {
        ClearControlsFromSession_Base();
      }

      protected override void LoadViewState(object savedState)
      {
        LoadViewState_Base(savedState);
      }


      protected override object SaveViewState()
      {
        return SaveViewState_Base();
      }      


        public void Page_PreRender(object sender, System.EventArgs e)
        {
            this.Page_PreRender_Base(sender, e);
        }
        
      
      public override void SaveData()
      {
          this.SaveData_Base();
      }          
    
    
      public override void SetChartControl(string chartCtrlName)
      {
          this.SetChartControl_Base(chartCtrlName);
      }
    
    
      public void Page_PreInit(object sender, System.EventArgs e)
      {
          //override call to PreInit_Base() here to change top level master page used by this page.
          //For example for Microsoft SharePoint applications uncomment next line to use Microsoft SharePoint default master page
          //if(this.Master != null) this.Master.MasterPageFile = Microsoft.SharePoint.SPContext.Current.Web.MasterUrl;	
          //You may change here assignment of application theme
          try
          {
              this.PreInit_Base();
          }
          catch
          {
          
          } 
      }
      
#region "Ajax Functions"

        [System.Web.Services.WebMethod()]
        public static Object[] GetRecordFieldValue(string contextName,
                                                   string tableName , 
                                                   string recordID , 
                                                   string columnName, 
                                                   string fieldName, 
                                                   string title, 
                                                   bool persist, 
                                                   int popupWindowHeight, 
                                                   int popupWindowWidth, 
                                                   bool popupWindowScrollBar)
        {
            // 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(contextName, tableName, recordID, columnName, fieldName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar);
        }

        [System.Web.Services.WebMethod()]
        public static object[] GetImage(string contextName,
                                        string tableName,
                                        string recordID, 
                                        string columnName, 
                                        string title, 
                                        bool persist, 
                                        int popupWindowHeight, 
                                        int popupWindowWidth, 
                                        bool popupWindowScrollBar)
        {
            // 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(contextName, tableName, recordID, columnName, title, persist, popupWindowHeight, popupWindowWidth, popupWindowScrollBar);
        }
        
    
      protected override void BasePage_PreRender(object sender, EventArgs e)
      {
          base.BasePage_PreRender(sender, e);
          RegisterPostback();
      }
      
      protected void RegisterPostback()
      {
          Base_RegisterPostback();	  
      }
    
      
      #endregion

      // Page Event Handlers - buttons, sort, links
      
        public void CancelButton_Click(object sender, EventArgs args)
        {

          // Click handler for CancelButton.
          // Customize by adding code before the call or replace the call to the Base function with your own code.
          CancelButton_Click_Base(sender, args);
          // NOTE: If the Base function redirects to another page, any code here will not be executed.
        }
            
        public void SaveAndNewButton_Click(object sender, EventArgs args)
        {

          // Click handler for SaveAndNewButton.
          // Customize by adding code before the call or replace the call to the Base function with your own code.
          SaveAndNewButton_Click_Base(sender, args);
          // NOTE: If the Base function redirects to another page, any code here will not be executed.
        }
            
        public void SaveButton_Click(object sender, EventArgs args)
        {

          // Click handler for SaveButton.
          // Customize by adding code before the call or replace the call to the Base function with your own code.
          SaveButton_Click_Base(sender, args);
          // NOTE: If the Base function redirects to another page, any code here will not be executed.
        }
            
    
        // Write out the Set methods
        
        
        // Write out the methods for DataSource
        


#endregion

#region "Section 2: Do not modify this section."

      
        private void Initialize()
        {
            // Called by the class constructor to initialize event handlers for Init and Load
            // You can customize by modifying the constructor in Section 1.
            this.Init += new EventHandler(Page_InitializeEventHandlers);
            this.PreInit += new EventHandler(Page_PreInit);
            this.Load += new EventHandler(Page_Load);

            EvaluateFormulaDelegate = new BaseClasses.Data.DataSource.EvaluateFormulaDelegate(EvaluateFormula);        
        }
        
    
      // Handles base.Init. Registers event handler for any button, sort or links.
      // You can add additional Init handlers in Section 1.
      public void Page_InitializeEventHandlers_Base(object sender, System.EventArgs e)
      {
    
        // This page does not have FileInput  control inside repeater which requires "multipart/form-data" form encoding, but it might
        // include ascx controls which in turn do have FileInput controls inside repeater. So check if they set Enctype property.
        if(!string.IsNullOrEmpty(this.Enctype)) this.Page.Form.Enctype = this.Enctype;
        	  
          this.PreRender += new EventHandler(Page_PreRender);    
          
          // Register the Event handler for any Events.
      
            
            // the following code for accordion is necessary or the this.{ControlName} will return null
            


          // Setup the pagination events.
        
              this.CancelButton.Button.Click += CancelButton_Click;
        
              this.SaveAndNewButton.Button.Click += SaveAndNewButton_Click;
        
              this.SaveAndNewButton.Button.Attributes.Add("onclick", "SubmitHRefOnce(this, \"" + this.GetResourceValue("Txt:SaveRecord", "PNR") + "\");");
        
              this.SaveButton.Button.Click += SaveButton_Click;
        
              this.SaveButton.Button.Attributes.Add("onclick", "SubmitHRefOnce(this, \"" + this.GetResourceValue("Txt:SaveRecord", "PNR") + "\");");
        
          this.ClearControlsFromSession();    
        }

        private void Base_RegisterPostback()
        {
        
                  this.RegisterPostBackTrigger(MiscUtils.FindControlRecursively(this,"SaveAndNewButton"));
                        
                  this.RegisterPostBackTrigger(MiscUtils.FindControlRecursively(this,"SaveButton"));
                                
        }

        protected void BasePage_PreRender_Base(object sender, System.EventArgs e)
        {
            // Load data for each record and table UI control.
                  
            // Data bind for each chart UI control.
          
        }

        // Handles base.Load.  Read database data and put into the UI controls.
        // You can add additional Load handlers in Section 1.
        protected virtual void Page_Load(object sender, EventArgs e)
        {
    
      this.SetPageFocus();
    
            // 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.
            this.Authorize("");
             if (!this.IsPostBack)
             {
            
                    // Setup the header text for the validation summary control.
                    this.ValidationSummary1.HeaderText = GetResourceValue("ValidationSummaryHeaderText", "PNR");
                 
             }
             
            //Set value of the hidden control depending on the postback. It will be used by SetFocus script on the client side.	
            System.Web.UI.HtmlControls.HtmlInputHidden clientSideIsPostBack = (System.Web.UI.HtmlControls.HtmlInputHidden)(this.FindControlRecursively("_clientSideIsPostBack"));
            if(clientSideIsPostBack != null) {
                if(this.IsPostBack && (this.Request["__EVENTTARGET"] != "ChildWindowPostBack")) {
                    clientSideIsPostBack.Value = "Y";
                } else {
                    clientSideIsPostBack.Value = "N";
                }
            }
             // Load data only when displaying the page for the first time or if postback from child window
             if ((!this.IsPostBack) || ( this.Request["__EVENTTARGET"] == "ChildWindowPostBack")) {   

                // 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.
                this.LoadData();
             }
                
            
            Page.Title = GetResourceValue("Title:Add") + " Requisition";
        
            }

            public static object[] GetRecordFieldValue_Base(string contextName,
                        string tableName ,
                        string recordID ,
                        string columnName,
                        string fieldName,
                        string title,
                        bool persist,
                        int popupWindowHeight,
                        int popupWindowWidth,
                        bool popupWindowScrollBar)
            {
            if (recordID != ""){
                recordID = System.Web.HttpUtility.UrlDecode(recordID);
            }
        
            string content = 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 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.
            object[] returnValue = new object[6];
            returnValue[0] = title;
            returnValue[1] = content;
            returnValue[2] = persist;
            returnValue[3] = popupWindowWidth;
            returnValue[4] = popupWindowHeight;
            returnValue[5] = popupWindowScrollBar;
            return returnValue;
        }
        

        public static object[] GetImage_Base(string contextName,
        string tableName,
        string recordID,
        string columnName,
        string title,
        bool persist,
        int popupWindowHeight,
        int popupWindowWidth,
        bool popupWindowScrollBar)
        {
            string  content;
            if (contextName != null && contextName != "NULL")
            {
                content = "<IMG alt =\"" + title + "\" src =" + "\"../Shared/ExportFieldValue.aspx?Context=" + contextName + "&Table=" + tableName + "&Field=" + columnName + "&Record=" + recordID + "\"/>";
            }
            else
            {
                content = "<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.
        object[] returnValue = new object[6];
        returnValue[0] = title;
        returnValue[1] = content;
        returnValue[2] = persist;
        returnValue[3] = popupWindowWidth;
        returnValue[4] = popupWindowHeight;
        returnValue[5] = popupWindowScrollBar;
        return returnValue;
    }

      public void SetChartControl_Base(string chartCtrlName)
      {
          // Load data for each record and table UI control.
        
      }   

    
      
      public void SaveData_Base()
      {
      
        this.RequisitionRecordControl.SaveData();
        
      }
      
         
    
        protected void SaveControlsToSession_Base()
        {
            base.SaveControlsToSession();
        
        }


        protected void ClearControlsFromSession_Base()
        {
            base.ClearControlsFromSession();
        
        }

        protected void LoadViewState_Base(object savedState)
        {
            base.LoadViewState(savedState);
        
        }


        protected object SaveViewState_Base()
        {
            
            return base.SaveViewState();
        }
        
    
     
      public void PreInit_Base()
      {
      //If it is SharePoint application this function performs dynamic Master Page assignment.
      
      }
      
      public void Page_PreRender_Base(object sender, System.EventArgs e)
      {
     
            // Load data for each record and table UI control.
                  
            // Data bind for each chart UI control.
              
      }  
  

    // 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 void LoadData_Base()
    {
    
            try {
                
                if ((!this.IsPostBack) || ( this.Request["__EVENTTARGET"] == "ChildWindowPostBack")) {
                      // Must start a transaction before performing database operations
                      DbUtils.StartTransaction();
                }
      
                this.DataBind();

                // Load and bind data for each record and table UI control.
                
        this.RequisitionRecordControl.LoadData();
        this.RequisitionRecordControl.DataBind();
        
    
                // Load data for chart.
                
      
            
                // initialize aspx controls
                
                //Set the corresponding menu item to be highlighted for this page
                System.Web.UI.MasterPage pageMaster = this.Master;
                if (!(pageMaster == null)) {
                IMenuComponent menuComponent = ((IMenuComponent)(this.Master.FindControl("_MenuV")));
                    if (!(menuComponent == null)) {
                        menuComponent.HiliteSettings = "RequisitionMenuItem";
                    }
                }
            
            } catch (Exception ex) {
                // An error has occured so display an error message.
                BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(this, "Page_Load_Error_Message", ex.Message);
            } finally {
                if ((!this.IsPostBack) || ( this.Request["__EVENTTARGET"] == "ChildWindowPostBack")) {
                    // End database transaction
                    DbUtils.EndTransaction();
                }
            }
      
        }
        
        public BaseClasses.Data.DataSource.EvaluateFormulaDelegate EvaluateFormulaDelegate;      
        public string EvaluateFormula_Base(string formula, BaseClasses.Data.BaseRecord dataSourceForEvaluate, string format, System.Collections.Generic.IDictionary<string,> variables, bool includeDS)
        {
            FormulaEvaluator e = new FormulaEvaluator();

            // add variables for formula evaluation
            if (variables != null)
            {
                System.Collections.Generic.IEnumerator<system.collections.generic.keyvaluepair><string,>> enumerator = variables.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    e.Variables.Add(enumerator.Current.Key, enumerator.Current.Value);
                }
            }
            
            if (includeDS)
            {
                
            }

            
            e.CallingControl = this;

            // All variables referred to in the formula are expected to be
            // properties of the DataSource.  For example, referring to
            // UnitPrice as a variable will refer to DataSource.UnitPrice
            e.DataSource = dataSourceForEvaluate;
            
            // Define the calling control.  
            e.CallingControl = this;

            object resultObj = e.Evaluate(formula);
            if (resultObj == null)
                return "";
            
            if ( !string.IsNullOrEmpty(format) && (string.IsNullOrEmpty(formula) || formula.IndexOf("Format(") < 0) )
            {
                return FormulaUtils.Format(resultObj, format);
            }
            else
            {
                return resultObj.ToString();
            }
        }		
        
        public string EvaluateFormula(string formula, BaseClasses.Data.BaseRecord dataSourceForEvaluate, string format, System.Collections.Generic.IDictionary<string,> variables)
        {
            return EvaluateFormula(formula, dataSourceForEvaluate, format, variables, true);
        }
        
        
        private string EvaluateFormula(string formula, BaseClasses.Data.BaseRecord dataSourceForEvaluate)
        {
            return EvaluateFormula(formula, dataSourceForEvaluate, null, null, true);
        }
        
        public string EvaluateFormula(string formula, bool includeDS)
        {
            return EvaluateFormula(formula, null, null, null, includeDS);
        }
        
        public string EvaluateFormula(string formula)
        {
            return EvaluateFormula(formula, null, null, null, true);
        }
        
                
        // 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 void CancelButton_Click_Base(object sender, EventArgs args)
        {
              
        bool shouldRedirect = true;
        string TargetKey = null;
        string DFKA = TargetKey;
        string id = DFKA;
        string value = id;
      
            try {
                
          
                TargetKey = this.Page.Request.QueryString["Target"];
                if (TargetKey != null){
                    shouldRedirect = false;
                }
      
            } catch (Exception ex) {
                  shouldRedirect = false;
                  this.ErrorOnPage = true;

            // Report the error message to the end user
            BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(this, "BUTTON_CLICK_MESSAGE", ex.Message);
    
            } finally {
    
            }
            if (shouldRedirect) {
                this.ShouldSaveControlsToSession = true;
                this.RedirectBack();
            }
        
            else if (TargetKey != null && !shouldRedirect){
            this.ShouldSaveControlsToSession = true ; 
            this.CloseWindow(true);
            }
        
        }
            
        // event handler for Button with Layout
        public void SaveAndNewButton_Click_Base(object sender, EventArgs args)
        {
              
            try {
                // Enclose all database retrieval/update code within a Transaction boundary
                DbUtils.StartTransaction();
                
        
              if (!this.IsPageRefresh)
              {
                  this.SaveData();
              }

                    this.CommitTransaction(sender);
            } catch (Exception ex) {
                  // Upon error, rollback the transaction
                  this.RollBackTransaction(sender);
                  this.ErrorOnPage = true;

            // Report the error message to the end user
            BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(this, "BUTTON_CLICK_MESSAGE", ex.Message);
    
            } finally {
                DbUtils.EndTransaction();
            }
    
        }
            
        // event handler for Button with Layout
        public void SaveButton_Click_Base(object sender, EventArgs args)
        {
              
        bool shouldRedirect = true;
        string TargetKey = null;
        string DFKA = TargetKey;
        string id = DFKA;
        string value = id;
      
            try {
                // Enclose all database retrieval/update code within a Transaction boundary
                DbUtils.StartTransaction();
                
        
              if (!this.IsPageRefresh)
              {
                  this.SaveData();
              }

                    this.CommitTransaction(sender);
        TargetKey = this.Page.Request.QueryString["Target"];

        if (TargetKey != null)
        {
          
            DFKA = NetUtils.GetUrlParam(this, "DFKA", false);
            if (this.RequisitionRecordControl != null && this.RequisitionRecordControl.DataSource != null){

                id = this.RequisitionRecordControl.DataSource.RefNo.ToString();
                if (!String.IsNullOrEmpty(DFKA))
                {
                    if (DFKA.Trim().StartsWith("="))
                    {
                        System.Collections.Generic.IDictionary<string,> variables = new System.Collections.Generic.Dictionary<string,>();
                        variables.Add(this.RequisitionRecordControl.DataSource.TableAccess.TableDefinition.TableCodeName, this.RequisitionRecordControl.DataSource);
                        value = EvaluateFormula(DFKA, this.RequisitionRecordControl.DataSource, null,variables);
                    }
                    else
                    {
                        value = this.RequisitionRecordControl.DataSource.GetValue(this.RequisitionRecordControl.DataSource.TableAccess.TableDefinition.ColumnList.GetByAnyName(DFKA)).ToString();
                    }
                }

                if(value == null){
                value = id;
                }
                string formula = this.Page.Request.QueryString["Formula"];
                if (formula != null && formula != "")
                {
                    System.Collections.Generic.IDictionary<string,> variables = new System.Collections.Generic.Dictionary<string,>();
                    variables.Add(this.RequisitionRecordControl.DataSource.TableAccess.TableDefinition.TableCodeName, this.RequisitionRecordControl.DataSource);
                    value = EvaluateFormula(formula, this.RequisitionRecordControl.DataSource, null,variables);
                }
                BaseClasses.Utils.MiscUtils.RegisterAddButtonScript(this, TargetKey, id, value);
            }
            shouldRedirect = false;
                
      }
          
            } catch (Exception ex) {
                  // Upon error, rollback the transaction
                  this.RollBackTransaction(sender);
                  shouldRedirect = false;
                  this.ErrorOnPage = true;

            // Report the error message to the end user
            BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(this, "BUTTON_CLICK_MESSAGE", ex.Message);
    
            } finally {
                DbUtils.EndTransaction();
            }
            if (shouldRedirect) {
                this.ShouldSaveControlsToSession = true;
                this.RedirectBack();
            }
        
            else if (TargetKey != null && !shouldRedirect){
            this.ShouldSaveControlsToSession = true ; 
            this.CloseWindow(true);
            }
        
        }
            
      


#endregion
  
}
  
}



Now for my problems:

1. The AddRequisition.aspx/AddPayment.aspx: both have a reference number. I wanted it to be unique number(but not a primary key). I wanted it to be in the following format: DDMMYY(TransactionNo)(UserID) eg: 24061101PK. I have tried and tried but have not been able to sort it out.

2. The AmountINWords gets the value from Amount. It converts the Amount into words. Thats not all. It picks what currncy was picked in the CurrencyPaidIn and pust the respective currency inside. eg. 123.45 USD becomes One Hundred and twenty three dollars and forty five cents. I tried using queries but as you will see that went all wrong.

Those are the only two things that I cant seem to get my head around. I do know that there are some things that are not conventional ASP.NET and some text boxes are not the right size. I was thinking of sorting out those after I get those two fixed because they are simple to do.

I really need some help with this application please. If someone can just have a look at the code and add a few things here and there.

Thanks in advance.

Faz
Posted
Updated 24-Jun-13 22:35pm
v4
Comments
Thanks7872 25-Jun-13 0:15am    
Never post links like this.Remove link to project as early as possible. Post only the code related to the problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900