ucLoanSearch.ascx:
<%
@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucLoanSearch.ascx.cs" Inherits="VHIWebSite.Controls.ucLoanSearch" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<
script type="text/javascript" language="javascript">
</
script>
<
telerik:RadScriptManager ID="ScriptManager" runat="server" />
<
asp:ObjectDataSource ID="SearchByNameObjectDataSource" EnablePaging="true"
SelectCountMethod="SearchByNameCount" SortParametername="SortColumns"
MaximumRowsParameterName = "maximumRows" StartRowIndexParameterName="startRowIndex"
TypeName="TellerBL.TellerDataObjects" SelectMethod="SearchByName"
EnableCaching="false" runat="server"
onselecting="SearchByNameObjectDataSource_Selecting"
onselected="SearchByNameObjectDataSource_Selected">
<
SelectParameters>
<asp:Parameter Name="mspDataConnectString" Type="String" />
<asp:Parameter Name="clientCode" Type="String" />
<asp:Parameter Name="firstName" Type="String" />
<asp:Parameter Name="lastName" Type="String" />
<asp:Parameter Name="totalRows" Direction="Output" Type="Int32" />
</
SelectParameters>
</
asp:ObjectDataSource>
<
asp:ObjectDataSource ID="SearchByAddressObjectDataSource" EnablePaging="true" SelectCountMethod="SearchByAddressCount" SortParametername="SortColumns"
TypeName="TellerBL.TellerDataObjects" SelectMethod="SearchByAddress" EnableCaching="false" runat="server"
onselecting="SearchByAddressObjectDataSource_Selecting">
<
SelectParameters>
<asp:Parameter Name="mspDataConnectString" Type="String" />
<asp:Parameter Name="clientCode" Type="String" />
<asp:Parameter Name="houseNumber" Type="String" />
<asp:Parameter Name="street" Type="String" />
<asp:Parameter Name="city" Type="String" />
<asp:Parameter Name="state" Type="String" />
<asp:Parameter Name="zipCode" Type="String" />
</
SelectParameters>
</
asp:ObjectDataSource>
<
table cellspacing="0" cellpadding="0">
<tr valign="top">
<td>
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
SelectedIndex="0" CssClass="TabStrip" ontabclick="RadTabStrip1_TabClick"
CausesValidation="False" ClickSelectedTab="True">
<Tabs>
<telerik:RadTab Text="Loan Number" Selected="True">
</telerik:RadTab>
<telerik:RadTab Text="Borrower/Co-Borrower">
</telerik:RadTab>
<telerik:RadTab Text="Property Address">
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
</td>
</tr>
<tr>
<td>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0"
CssClass="PageView">
<telerik:RadPageView ID="LoanNumberPageView" runat="server">
<table cellspacing="0" cellpadding="0" style="padding-left:10px;padding-top:10px">
<tr valign="top">
<td colspan="4">
<asp:Label ID="LoanNumberLabel" runat="server" Text="Label">Loan Number:</asp:Label>
</td>
</tr>
<tr valign="top">
<td>
<asp:TextBox ID="LoanNumberTextBox" CssClass="TellerInput TellerRequired" CausesValidation="true" MaxLength="10" Width="100px" runat="server" ValidationGroup="loan"></asp:TextBox>
<asp:RegularExpressionValidator ID="LoanNumberRegularExpressionValidator" ValidationGroup="loan" ControlToValidate="LoanNumberTextBox" runat="server" Display="None" ValidationExpression="^\d{0,10}" ErrorMessage="Loan Number must be numeric."></asp:RegularExpressionValidator>
<asp:CustomValidator ValidationGroup="loan" ID="LoanNumberCustomValidator" runat="server" Display="None" ErrorMessage="Invalid Loan Number." onservervalidate="LoanNumberCustomValidator_ServerValidate"></asp:CustomValidator>
</td>
<td> </td>
<td>
<asp:Button id="SearchButton" runat="server" CssClass="TellerInput" UseSubmitBehavior="false" Text="Go" onclick="SearchButton_Click" ValidationGroup="loan" CausesValidation="True" />
</td>
<td> </td>
</tr>
<tr valign="top">
<td colspan="4">
<asp:ValidationSummary ID="LoanNumberValidationSummary" DisplayMode="BulletList" runat="server" ValidationGroup="loan" SkinID="TellerSkin" />
</td>
</tr>
</table>
</telerik:RadPageView>
<telerik:RadPageView ID="NamePageView" runat="server" DefaultButton="NameSearchButton">
<div id="nameDiv" runat="server">
<table cellspacing="0" cellpadding="0" style="padding-left:10px;padding-top:10px">
<tr valign="top">
<td>
<asp:Label ID="LastNameLabel" runat="server">Last</asp:Label>
</td>
<td> </td>
<td>
<asp:Label ID="FirstNameLabel" runat="server">First</asp:Label>
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr valign="top">
<td>
<asp:TextBox ID="LastNameTextBox" CssClass="TellerInput TellerRequired" CausesValidation="true" MaxLength="10" Width="150px" runat="server" ValidationGroup="name"></asp:TextBox>
<asp:RegularExpressionValidator ID="LastNameRegularExpressionValidator" ValidationGroup="name" ControlToValidate="LastNameTextBox" runat="server" Display="None" ValidationExpression="^[a-zA-Z]{2,}$" ErrorMessage="Please enter at least two characters for Last Name."></asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" ValidationGroup="name" ControlToValidate="LastNameTextBox" runat="server" Display="None" ErrorMessage="Please enter a Last Name."></asp:RequiredFieldValidator>
</td>
<td> </td>
<td>
<asp:TextBox ID="FirstNameTextBox" CssClass="TellerInput" CausesValidation="true" MaxLength="10" Width="150px" runat="server" ValidationGroup="name"></asp:TextBox>
</td>
<td> </td>
<td>
<asp:Button id="NameSearchButton" runat="server" CssClass="TellerInput"
UseSubmitBehavior="false" Text="Search"
onclick="NameSearchButton_Click" ValidationGroup="name"
CausesValidation="True" />
</td>
<td> </td>
</tr>
<tr valign="top">
<td colspan="6">
<asp:ValidationSummary ID="ValidationSummary1" DisplayMode="BulletList" runat="server" ValidationGroup="name" SkinID="TellerSkin" />
</td>
</tr>
</table>
</div>
</telerik:RadPageView>
<telerik:RadPageView ID="AddressPageView" runat="server" DefaultButton="PropertySearchButton">
<table cellspacing="0" cellpadding="0" style="padding-left:10px;padding-top:10px">
<tr valign="top">
<td>
<asp:Label ID="Label2" runat="server">H/B #</asp:Label>
</td>
<td> </td>
<td>
<asp:Label ID="Label3" runat="server">Street</asp:Label>
</td>
<td> </td>
<td><asp:Label ID="Label1" runat="server">City</asp:Label></td>
<td> </td>
<td><asp:Label ID="Label4" runat="server">State</asp:Label></td>
<td> </td>
<td><asp:Label ID="Label5" runat="server">Zip Code</asp:Label></td>
<td> </td>
</tr>
<tr valign="top">
<td>
<asp:TextBox ID="HouseNumberTextBox" CssClass="TellerInput" CausesValidation="true" MaxLength="10" Width="50px" runat="server" ValidationGroup="address"></asp:TextBox>
</td>
<td> </td>
<td>
<asp:TextBox ID="StreetTextBox" CssClass="TellerInput TellerRequired" CausesValidation="true" MaxLength="10" Width="150px" runat="server" ValidationGroup="address"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" ValidationGroup="address" ControlToValidate="StreetTextBox" runat="server" Display="None" ErrorMessage="Please enter a Street Name."></asp:RequiredFieldValidator>
</td>
<td> </td>
<td>
<asp:TextBox ID="CityTextBox" CssClass="TellerInput TellerRequired" CausesValidation="true" MaxLength="10" Width="100px" runat="server" ValidationGroup="address"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ValidationGroup="address" ControlToValidate="CityTextBox" runat="server" Display="None" ErrorMessage="Please enter a City."></asp:RequiredFieldValidator>
</td>
<td> </td>
<td>
<asp:TextBox ID="StateTextBox" CssClass="TellerInput TellerRequired" CausesValidation="true" MaxLength="2" Width="20px" runat="server" ValidationGroup="address"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ValidationGroup="address" ControlToValidate="StateTextBox" runat="server" Display="None" ErrorMessage="Please enter a State."></asp:RequiredFieldValidator>
</td>
<td> </td>
<td>
<asp:TextBox ID="ZipTextBox" CssClass="TellerInput" CausesValidation="true" MaxLength="10" Width="50px" runat="server" ValidationGroup="address"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator4" ValidationGroup="address" ControlToValidate="ZipTextBox" runat="server" Display="None" ValidationExpression="^[0-9]{0,5}$" ErrorMessage="Zip Code must be 5 digits."></asp:RegularExpressionValidator>
</td>
<td> </td>
<td>
<asp:Button id="PropertySearchButton" runat="server" CssClass="TellerInput"
UseSubmitBehavior="false" Text="Search"
onclick="PropertySearchButton_Click" ValidationGroup="address"
CausesValidation="True" />
</td>
<td> </td>
</tr>
<tr valign="top" class="TellerAnnotation">
<td>House or<br />Building Number</td>
<td> </td>
<td>Please use only the street name<br />(e.g. "Main" instead of "N. Main St.")</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td>(5 digits only)</td>
<td> </td>
</tr>
<tr valign="top">
<td colspan="6">
<asp:ValidationSummary ID="ValidationSummary2" DisplayMode="BulletList" runat="server" ValidationGroup="address" SkinID="TellerSkin" />
</td>
</tr>
</table>
</telerik:RadPageView>
</telerik:RadMultiPage>
</td>
</
tr>
<
tr>
<td>
<telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="SearchResultsRadGrid" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
</telerik:RadAjaxLoadingPanel>
<telerik:RadGrid runat="server" ID="SearchResultsRadGrid"
AutoGenerateColumns="False" Visible="False"
EnableHeaderContextMenu="True" AllowSorting="True" BorderStyle="Solid"
CellSpacing="0" GridLines="None" BorderWidth="1px" BorderColor="Black"
onitemcommand="SearchResultsRadGrid_ItemCommand"
AllowCustomPaging="False" PageSize ="10"
AllowPaging="True" GroupingEnabled="False" EnableLinqExpressions="false" >
<clientsettings allowcolumnsreorder="False"
allowgroupexpandcollapse="False" reordercolumnsonclient="False"
enablepostbackonrowclick="True">
<Selecting AllowRowSelect="True" enabledragtoselectrows="False"></Selecting>
</clientsettings>
<PagerStyle AlwaysVisible="true" Mode="NumericPages"></PagerStyle>
<mastertableview allowpaging="False" commanditemdisplay="None" OverrideDataSourceControlSorting="True" CanRetrieveAllData="false"
datakeynames="Id, LoanNo" insertitempageindexaction="ShowItemOnCurrentPage"
grouploadmode="Server" GroupsDefaultExpanded="False">
<commanditemsettings exporttopdftext="Export to PDF" />
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
<rowindicatorcolumn filtercontrolalttext="Filter RowIndicator column"
visible="True">
</rowindicatorcolumn>
<expandcollapsecolumn filtercontrolalttext="Filter ExpandColumn column"
visible="True">
</expandcollapsecolumn>
<Columns>
<telerik:GridBoundColumn DataField="BorrowerName" UniqueName="BorrowerName" HeaderText="Borrower" >
<ItemStyle Wrap="False"/>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="BorrowerSSNFormatted" UniqueName="BorrowerSSNFormatted" HeaderText="Borrower SSN" >
<ItemStyle Wrap="False"/>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="CoBorrowerName" UniqueName="CoBorrowerName" HeaderText="Co-Borrower" >
<ItemStyle Wrap="False"/>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="CoBorrowerSSNFormatted" UniqueName="CoBorrowerSSNFormatted" HeaderText="Co‑Borrower SSN" >
<ItemStyle Wrap="False"/>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="PropertyAddress" UniqueName="PropertyAddress" HeaderText="Property Address" >
<ItemStyle Wrap="False"/>
</telerik:GridBoundColumn>
</Columns>
<editformsettings>
<editcolumn filtercontrolalttext="Filter EditCommandColumn column">
</editcolumn>
</editformsettings>
</mastertableview>
<filtermenu enableimagesprites="False">
</filtermenu>
</telerik:RadGrid>
</td>
</
tr>
</
table>
ucLoanSearch.ascx.cs:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
TellerBL;
using
DmiCore.DataAccess;
using
System.Configuration;
using
System.Web.Profile;
using
DMI.UserManagement;
using
Dmi.Extensions;
using
Telerik.Web.UI;
 
namespace
VHIWebSite.Controls
{
public partial class ucLoanSearch : System.Web.UI.UserControl
{
const string CLIENTCODE = "ClientCode";
const string CUSTOMERID = "CustomerId";
const string GOTO_PAGE = "~/TellerWeb/LoanSummary.aspx";
public string ClientCode
{
get
{
Object o = ViewState[CLIENTCODE];
if (o == null)
if (PopulateClientCustInfo())
return ViewState[CLIENTCODE].ToString();
return o.ToString();
}
set
{
if (!String.IsNullOrEmpty(value))
ViewState[CLIENTCODE] =
value;
}
}
public string CustomerId
{
get
{
Object o = ViewState[CUSTOMERID];
if (o == null)
if (PopulateClientCustInfo())
return ViewState[CUSTOMERID].ToString();
return o.ToString();
}
set
{
if (!String.IsNullOrEmpty(value))
ViewState[CUSTOMERID] =
value;
}
}
public string LoanNumber
{
get
{
return LoanNumberTextBox.Text;
}
set
{
LoanNumberTextBox.Text =
value;
}
}
 
protected void Page_Load(object sender, EventArgs e)
{
SetDefaultFocus();
}
protected bool PopulateClientCustInfo()
{
User currentUser = UserManager.GetUser(HttpContext.Current.User.Identity.Name);
if (currentUser == null)
return false;
Customer c = CustomerManager.GetCustomer(currentUser.CustomerID);
if (c == null)
return false;
Client cl = ClientManager.GetClient(c.ClientID);
if (cl == null)
return false;
ViewState[CUSTOMERID] = c.CustomerID;
ViewState[CLIENTCODE] = cl.ClientCode;
return true;
}
protected void SearchButton_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
Session[
TellerStringConstants.TellerLoanNo] = LoanNumberTextBox.Text;
Response.Redirect(GOTO_PAGE);
}
}
protected void LoanNumberCustomValidator_ServerValidate(object source, ServerValidateEventArgs args)
{
args.IsValid =
true;
string loanNumber = String.Empty;
if (!String.IsNullOrEmpty(LoanNumberTextBox.Text))
{
LoanNumberTextBox.Text = LoanNumberTextBox.Text.PadLeft(10,
'0');
loanNumber = LoanNumberTextBox.Text;
}
else
{
args.IsValid =
false;
return;
}
if (!loanNumber.IsValidLoanNumber())
{
EventLog.
Web.OnTellerInvalidLoanNumber(ConfigurationManager.ConnectionStrings["LoggingEntity"].ToString(),
"Failed parity check", true, Request.ServerVariables["remote_addr"].ToString(),
ConfigurationManager.AppSettings["ApplicationName"].ToString(), Page.Request.Url.AbsoluteUri, HttpContext.Current.User.Identity.Name, Session[TellerStringConstants.TellerLoanNo] != null ? Session[TellerStringConstants.TellerLoanNo].ToString() : String.Empty);
args.IsValid =
false;
return;
}
DataErrors errorCode;
IHeaderInfo hi = TellerDataObjects.GetHeaderInfo(ConfigurationManager.ConnectionStrings[TellerStringConstants.MspDataEntity].ToString(), loanNumber, out errorCode);
if (hi == null)
{
EventLog.
Web.OnTellerInvalidLoanNumber(ConfigurationManager.ConnectionStrings["LoggingEntity"].ToString(),
"Loan Number does not exist.", true, Request.ServerVariables["remote_addr"].ToString(),
ConfigurationManager.AppSettings["ApplicationName"].ToString(), Page.Request.Url.AbsoluteUri, HttpContext.Current.User.Identity.Name, loanNumber);
args.IsValid =
false;
return;
}
 
}
protected void SearchByNameObjectDataSource_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.InputParameters[
"mspDataConnectString"] = ConfigurationManager.ConnectionStrings[TellerStringConstants.MspDataEntity].ToString();
e.InputParameters[
"clientCode"] = ClientCode;
e.InputParameters[
"firstName"] = FirstNameTextBox.Text;
e.InputParameters[
"lastName"] = LastNameTextBox.Text;
e.Arguments.MaximumRows = 10;
}
protected void SearchByAddressObjectDataSource_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.InputParameters[
"mspDataConnectString"] = ConfigurationManager.ConnectionStrings[TellerStringConstants.MspDataEntity].ToString();
e.InputParameters[
"clientCode"] = ClientCode;
e.InputParameters[
"houseNumber"] = HouseNumberTextBox.Text;
e.InputParameters[
"street"] = StreetTextBox.Text;
e.InputParameters[
"city"] = CityTextBox.Text;
e.InputParameters[
"state"] = StateTextBox.Text;
e.InputParameters[
"zipCode"] = ZipTextBox.Text;
e.Arguments.MaximumRows = 10;
}
protected void SearchResultsRadGrid_ItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "RowClick")
{
GridDataItem dataItem = (GridDataItem)SearchResultsRadGrid.SelectedItems[0];
if (dataItem != null)
{
object o = dataItem.GetDataKeyValue("Id");
if (o == null)
return;
object os = dataItem.GetDataKeyValue("LoanNo");
if (os == null)
return;
Session[
TellerStringConstants.TellerLoanNo] = os.ToString();
Response.Redirect(GOTO_PAGE);
}
}
}
protected void NameSearchButton_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
SearchResultsRadGrid.DataSourceID =
"SearchByNameObjectDataSource";
SearchResultsRadGrid.Visible =
true;
SearchResultsRadGrid.DataBind();
}
}
protected void PropertySearchButton_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
SearchResultsRadGrid.DataSourceID =
"SearchByAddressObjectDataSource";
SearchResultsRadGrid.DataBind();
SearchResultsRadGrid.Visible =
true;
}
}
protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
{
SearchResultsRadGrid.Visible =
false;
SetDefaultFocus();
foreach (Control ctrl in Page.Controls)
ClearControls(ctrl);
}
private void ClearControls(Control c)
{
foreach (Control ctrl in c.Controls )
{
if (ctrl is TextBox)
((
TextBox)(ctrl)).Text = null;
if (ctrl.Controls.Count > 0)
ClearControls(ctrl);
}
}
 
 
private void SetDefaultFocus()
{
switch (RadTabStrip1.SelectedIndex)
{
case 0:
Page.Form.DefaultButton = SearchButton.UniqueID;
LoanNumberTextBox.Focus();
break;
case 1:
Page.Form.DefaultButton = NameSearchButton.UniqueID;
LastNameTextBox.Focus();
break;
case 2:
Page.Form.DefaultButton = PropertySearchButton.UniqueID;
HouseNumberTextBox.Focus();
break;
}
}
protected void SearchByNameObjectDataSource_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
SearchResultsRadGrid.PageSize = 10;
SearchResultsRadGrid.AllowPaging =
true;
SearchResultsRadGrid.MasterTableView.VirtualItemCount = (
int)e.OutputParameters["totalRows"];
SearchResultsRadGrid.VirtualItemCount = (
int)e.OutputParameters["totalRows"];
}
 
}
}
TellerDataObjects.cs:
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Diagnostics.Contracts;
using
TellerDataAccess;
using
System.Linq;
using
System.Web.UI.WebControls;
namespace
TellerBL
{
[
DataObjectAttribute]
public static class TellerDataObjects
{
[
DataObjectMethodAttribute(DataObjectMethodType.Select, false)]
public static IHeaderInfo GetHeaderInfo(string mspDataConnectString, string loanNumber, out DataErrors errorCode)
{
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(mspDataConnectString));
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(loanNumber));
errorCode =
DataErrors.None;
IHeaderInfo hi = null;
try
{
List<IGeneralLoanInfo> gli = TellerBusinessLogic.GetGeneralLoanInfo(mspDataConnectString, loanNumber);
if (gli != null && gli.Count > 0)
{
HeaderInfo hi2 = new HeaderInfo();
hi2.LoanNumber = loanNumber;
hi2.BankruptcyStop = gli[0].BankruptcyStop;
hi2.BillingCityAndState = gli[0].BillingCityAndState;
hi2.BillingStreetAddress = gli[0].BillingStreetAddress;
hi2.BorrowerName = gli[0].BorrowerName;
hi2.BorrowerSSN = gli[0].MortgagorSSN;
hi2.CoBorrowerName = gli[0].CoBorrowerName;
hi2.CoBorrowerSSN = gli[0].CoMortgagorSSN;
hi2.DelinquentBalance = (gli[0].DelinquentBalance.HasValue ? gli[0].DelinquentBalance.Value :
decimal.Zero);
hi2.ForeclosureStop = gli[0].ForeclosureStop;
hi2.LastApplied = gli[0].LastFullPaymentDate;
hi2.LateCharges = gli[0].LateCharges;
hi2.NextPaymentDueDate = gli[0].Duedate;
hi2.OtherFees = (gli[0].OtherFees.HasValue ? gli[0].OtherFees.Value :
decimal.Zero);
hi2.PhoneNumber = gli[0].FstTelephoneNo;
hi2.PhoneNumber2 = gli[0].SecTelephoneNo;
hi2.PropertyCity = gli[0].PropertyCity;
hi2.PropertyState = gli[0].PropertyState;
hi2.PropertyStreet = gli[0].PropertyStreet;
hi2.PropertyZipCode = gli[0].PropertyZip;
hi2.TotalMonthlyPayment = gli[0].TotalPayment;
hi2.ZipCode = gli[0].Zipcode;
hi = hi2
as IHeaderInfo;
}
}
catch
{ errorCode =
DataErrors.UnknownErrorPleaseRetry; }
return hi;
}
[
DataObjectMethodAttribute(DataObjectMethodType.Select, false)]
public static List<ILoanSearch> SearchByName(out int totalRows, string mspDataConnectString, string clientCode, string firstName, string lastName, string SortColumns, int startRowIndex, int maximumRows)
{
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(mspDataConnectString));
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(clientCode));
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(lastName));
List<ILoanInfoSearchResult> l = TellerBusinessLogic.SearchByName(mspDataConnectString, clientCode, firstName, lastName);
totalRows = l.Count;
List<ILoanSearch> l2 = l.OrderBy(x => x.BorrowerName).Select(x => new LoanSearch(x)).Skip(startRowIndex).Take(maximumRows).ToList<ILoanSearch>();
return l2;
}
[
DataObjectMethodAttribute(DataObjectMethodType.Select, false)]
public static int SearchByNameCount(string mspDataConnectString, string clientCode, string firstName, string lastName)
{
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(mspDataConnectString));
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(clientCode));
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(lastName));
List<ILoanInfoSearchResult> l = TellerBusinessLogic.SearchByName(mspDataConnectString, clientCode, firstName, lastName);
return l.Count;
}
[
DataObjectMethodAttribute(DataObjectMethodType.Select, false)]
public static List<ILoanSearch> SearchByAddress(out int totalRows, string mspDataConnectString, string clientCode, string houseNumber, string street, string city, string state, string zipCode, string SortColumns, int startRowIndex, int maximumRows)
{
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(mspDataConnectString));
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(street));
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(state));
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(city));
List<ILoanInfoSearchResult> l = TellerBusinessLogic.SearchByAddress(mspDataConnectString, clientCode, houseNumber, street, city, state, zipCode);
totalRows = l.Count;
return l.Select(x => new LoanSearch(x)).OrderBy(x => x.PropertyAddress).Skip(startRowIndex).Take(maximumRows).ToList<ILoanSearch>();
}
[
DataObjectMethodAttribute(DataObjectMethodType.Select, false)]
public static int SearchByAddressCount(string mspDataConnectString, string clientCode, string houseNumber, string street, string city, string state, string zipCode)
{
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(mspDataConnectString));
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(street));
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(state));
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(city));
List<ILoanInfoSearchResult> l = TellerBusinessLogic.SearchByAddress(mspDataConnectString, clientCode, houseNumber, street, city, state, zipCode);
return l.Count;
}
}
}
TellerBusinessLogic.cs:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Diagnostics.Contracts;
using
TellerDataAccess;
using
System.Data;
using
System.ComponentModel;
using
DMI.Crypto;
using
DMI.UserManagement;
using
VHIWebSite;
using
DMI.VHI.TellerApp;
using
System.Configuration;
using
VHIDataAccess;
namespace
TellerBL
{
public static class TellerBusinessLogic
{
internal static List<ILoanInfoSearchResult> SearchByName(string mspDataConnectString, string clientCode, string firstName, string lastName)
{
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(mspDataConnectString));
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(clientCode));
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(lastName));
return SearchDA.SearchByName(mspDataConnectString, clientCode, firstName, lastName).ToList<ILoanInfoSearchResult>();
}
internal static List<ILoanInfoSearchResult> SearchByAddress(string mspDataConnectString, string clientCode, string houseNumber, string street, string city, string state, string zipCode)
{
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(mspDataConnectString));
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(street));
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(state));
Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(city));
return SearchDA.SearchByAddress(mspDataConnectString, clientCode, houseNumber, street, city, state, zipCode).ToList<ILoanInfoSearchResult>();
}
}
}