First of all, many thanks for your patience and assistance.
So sorry the code is very long.
MARKUP:
<%@ Page Language="C#" AutoEventWireup="true" MaintainScrollPositionOnPostback="true" CodeFile="Marines.aspx.cs" Inherits="Marines" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<%-- <title></title>--%>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="IE=edge, IE=8, IE=9, IE=10, IE11,chrome=1" />
<%-- Including CSS for different screen sizes--%>
<link rel="stylesheet" type="text/css" href="styles/responsiveform.css" />
<link rel="stylesheet" media="screen and (max-width: 1200px) and (min-width: 601px)" href="styles/responsiveform1.css" />
<link rel="stylesheet" media="screen and (max-width: 600px) and (min-width: 351px)" href="styles/responsiveform2.css" />
<link rel="stylesheet" media="screen and (max-width: 350px)" href="styles/responsiveform3.css" />
<link type="text/css" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet" />
<link href="styles/boxformats.css" rel="stylesheet" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="js/jquery.easing.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/additional-methods.min.js"></script>
<script type ="text/javascript" >
$(document).ready(function () {
$("#msform").validate({
rules: {
<%=accountnumber.UniqueID %>: {
required:true,
digits:true,
minlength:7,
maxlength:7,
},
<%=rblsitus.UniqueID %>: {
required: true,
},
<%=txtOwnerPhone.UniqueID %>: {
required: true,
},
<%=txtfname.UniqueID %>: {
required: true,
},
<%=txtfaddress.UniqueID %>: {
required: true,
},
<%=txtfcity.UniqueID %>: {
required: true,
},
<%=ddlstates.UniqueID %>: {
required: true,
},
<%=txtfzip.UniqueID %>: {
required: true,
},
},
messages: {
//This section we need to place our custom validation message for each control.
<%=accountnumber.UniqueID %>: {
required: "Account number is required." ,
},
<%=rblsitus.UniqueID %>: {
required: "Please select either UNINCORPORATED AREA or CITY OF option.",
},
<%=txtOwnerPhone.UniqueID %>: {
required: "Please select a state."
},
<%=txtfname.UniqueID %>: {
required: "Please enter your name."
},
<%=txtfaddress.UniqueID %>: {
required: "Please enter your address."
},
<%=txtfcity.UniqueID %>: {
required: "Please enter city."
},
<%=ddlstates.UniqueID %>: {
required: "Please select a state."
},
<%=txtfzip.UniqueID %>: {
required: "Please enter zip code."
},
},
});
});
</script>
<style type ="text/css" >
label.error {
color: red;
display:inline-flex ;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$('#rblIssues input').change(function () {
if ($(this).val() == "Yes") {
$("#functionalIsses").prop("disabled", false);
}
else {
$("#functionalIsses").prop("disabled", true);
}
});
});
</script>
<script type="text/javascript">
$(document).ready(function () {
$("#accountnumber").focus();
});
</script>
<style type="text/css">
body {
background-image: url("images/bg.png");
background-color: #fff;
}
.auto-style1 {
width: 45%;
text-align:center;
}
.auto-style2 {
width: 47%;
}
</style>
<style type="text/css">
/*form styles*/
#msform {
margin: 50px 0px 50px auto;
text-align: center;
position: relative;
}
#msform fieldset {
background: white;
margin-left:1px !important;
border: 0 none;
border-radius: 3px;
box-shadow: 0 0 15px 1px rgba(0, 0, 0, 0.4);
padding: 70px 30px;
box-sizing: border-box;
width: 100% !important;
margin: 0 10%;
/*stacking fieldsets above each other*/
position: absolute;
}
legend {
font-weight:bold;
background: orange;
width: 100%;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
/*progressbar*/
#progressbar {
margin-bottom: 10px;
overflow: hidden;
/*CSS counters to number the steps*/
counter-reset: step;
}
#progressbar li {
list-style-type: none;
color: #0093B2;
text-transform: uppercase;
font-size: 0.5625em;
width: 20%;
float: left;
position: relative;
}
#progressbar li:before {
content: counter(step);
counter-increment: step;
width: 20px;
line-height: 20px;
display: block;
font-size: 0.625em;
color: #333;
background: white;
border-radius: 3px;
margin: 0 auto 5px auto;
}
/*progressbar connectors*/
#progressbar li:after {
content: '';
width: 100%;
height: 2px;
background: #0093B2;
position: absolute;
left: -50%;
top: 9px;
z-index: -1; /*put it behind the numbers*/
}
#progressbar li:first-child:after {
/*connector not needed before the first step*/
content: none;
}
/*marking active/completed steps green*/
/*The number of the step and the connector before it = green*/
#progressbar li.active:before, #progressbar li.active:after {
background: #27AE60;
color: white;
}
.gridview {
width: 90%;
word-wrap:break-word;
table-layout: fixed;
}
</style>
<style type="text/css">
body
{
padding: 10px;
font-family:Calibri;
font-size:12pt;
}
td
{
padding:5px;
}
input
{
font-family:Calibri;
font-size:12pt;
}
span
{
font-family:Calibri;
font-size:9pt;
color:#0093B2;
}
.grvAddButton
{
border: 1px solid #6E6E6E;
font-family: 'Arial Unicode MS';
background-color: #0093B2;
color: #FFFFFF;
font-style: normal;
text-align: center;
padding-right: 10px;
padding-left: 10px;
}
.grvDelButton
{
border: 1px solid #6E6E6E;
font-family: 'Arial Unicode MS';
background-color: #0093B2;
color: #FFFFFF;
font-style: normal;
text-align: center;
padding-right: 10px;
padding-left: 10px;
}
.btnclass
{
color: #FFF;
background-color: #204D74;
display: inline-block;
padding: 6px 12px;
margin-bottom: 0px;
font-size: 14px;
font-weight: 400;
line-height: .5;
text-align: justify;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
-moz-user-select: none;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
var activeViewIndex = <%=myMultiView.ActiveViewIndex %>;
$("#progressbar li").each(function(){
$("#progressbar li").removeClass("active");
})
$("#progressbar li").eq(activeViewIndex).addClass("active");
})
</script>
<script type = "text/javascript">
function ValidateCheckBox(sender, args) {
if (document.getElementById("<%=same_as_taxpayeraddr.ClientID %>").checked == true) {
args.IsValid = true;
} else {
args.IsValid = false;
}
}
</script>
<style type="text/css">
.style-1 input[type="text"] {
padding: 10px;
border: solid 1px #dcdcdc;
transition: box-shadow 0.3s, border 0.3s;
}
.style-1 input[type="text"]:focus,
.style-1 input[type="text"].focus {
border: solid 1px #707070;
box-shadow: 0 0 5px 1px #969696;
}
.auto-style5 {
width: 31%;
}
.auto-style7 {
margin: auto;
width: 86%;
padding: 10px;
}
</style>
<style type="text/css">
.RBL label
{
display: block;
}
.RBL td
{
text-align: center;
width: 20px;
}
</style>
<style type="text/css">
.dropdownlist {
background-color: cornsilk;
font-weight: bold;
}
</style>
<script type="text/javascript">
$(function () {
$('[id*=txtboatregNum]').change(function () {
var value = $(this).val();
index = $(this).closest('tr').index();
var tr = $('[id*=repeaterTable]').find('tr')[index - 1];
$(tr).find("[id*=txtARegNo]").val(value);
});
});
</script>
<script type="text/javascript">
$('.repeaterItem input[type="radio"]').change(function () {
if ($(this).val() == "Yes") {
$(this).closest('div').children('input[type="text"]').prop("disabled", true);
}
else {
$(this).closest('div').children('input[type="text"]').prop("disabled", false);
}
});
</script>
<%-- <style type="text/css">
table {
table-layout : fixed;
}
</style>--%>
<style type="text/css">
.myForm {
border: 0px solid #ccc;
border-spacing: 0;
text-align: left;
}
.myForm td {
border: 1px solid #ccc
}
</style>
<style type="text/css">
.bs-example{
margin-left: 100px;
}
</style>
<style>
.disabledcss
{
background-color: #F9F9F9;
color: blue;
border: 1px solid gray;
color: Gray;
}
</style>
<style>
.enabledcss
{
background-color: #fff;
color: blue;
border: 1px solid white;
color: Gray;
}
</style>
<script type="text/javascript">
//jQuery time
var current_fs, next_fs, previous_fs; //fieldsets
var left, opacity, scale; //fieldset properties which we will animate
var animating; //flag to prevent quick multi-click glitches
$(".btnNext").click(function(){
if(animating) return false;
animating = true;
current_fs = $(this).parent();
next_fs = $(this).parent().next();
//activate next step on progressbar using the index of next_fs
$("#progressbar li").eq($("fieldset").index(next_fs)).addClass("active");
//show the next fieldset
next_fs.show();
//hide the current fieldset with style
current_fs.animate({opacity: 0}, {
step: function(now, mx) {
//as the opacity of current_fs reduces to 0 - stored in "now"
//1. scale current_fs down to 80%
scale = 1 - (1 - now) * 0.2;
//2. bring next_fs from the right(50%)
left = (now * 50)+"%";
//3. increase opacity of next_fs to 1 as it moves in
opacity = 1 - now;
current_fs.css({'transform': 'scale('+scale+')'});
next_fs.css({'left': left, 'opacity': opacity});
},
duration: 800,
complete: function(){
current_fs.hide();
animating = false;
},
//this comes from the custom easing plugin
easing: 'easeInOutBack'
});
});
$(".btnback").click(function(){
if(animating) return false;
animating = true;
current_fs = $(this).parent();
previous_fs = $(this).parent().prev();
//de-activate current step on progressbar
$("#progressbar li").eq($("fieldset").index(current_fs)).removeClass("active");
//show the previous fieldset
previous_fs.show();
//hide the current fieldset with style
current_fs.animate({opacity: 0}, {
step: function(now, mx) {
//as the opacity of current_fs reduces to 0 - stored in "now"
//1. scale previous_fs from 80% to 100%
scale = 0.8 + (1 - now) * 0.2;
//2. take current_fs to the right(50%) - from 0%
left = ((1-now) * 50)+"%";
//3. increase opacity of previous_fs to 1 as it moves in
opacity = 1 - now;
current_fs.css({'left': left});
previous_fs.css({'transform': 'scale('+scale+')', 'opacity': opacity});
},
duration: 800,
complete: function(){
current_fs.hide();
animating = false;
},
//this comes from the custom easing plugin
easing: 'easeInOutBack'
});
});
</script>
</head>
<body>
<div>
<form id="msform" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<header style="background-color:#0093B2;">
<span style="color:#faffff;"><h2>Marine Personal Property Tax Return with Base Data</h2></span><br /><br />
</header><br />
<!-- progressbar -->
<ul id="progressbar">
<li>Taxpayer Account Info</li>
<li>Marine Info</li>
<li>Schedule D</li>
<li>Review/Sign/Submit</li>
</ul>
<br />
<br />
<br />
<div class="bs-example">
<asp:MultiView ID="myMultiView" ActiveViewIndex="0" runat="server">
<asp:View ID="vwPayerInfo" runat="server">
<h2 style="color:#0093B2;font-weight:bold; width: 1421px;">Step 1: Taxpayer Account Info</h2><br />
<%-- All user textboxes for input here--%>
<table border="1" style="width:75%; text-align:left">
<tr>
<td style="width:70%;" colspan="2"><div style="margin: auto;padding: 10px;">
<span style="font-weight:bold;color:#27AE60;">MARINE PERSONAL PROPERTY TAX RETURN</span><br />
THIS RETURN WILL BE CONSIDERED PUBLIC INFORMATION
AND WILL BE OPEN FOR PUBLIC INSPECTION
RETURN COMPLETED FORM TO ADDRESS LISTED BELOW</div>
</td>
</tr>
<tr>
<td style="vertical-align: text-top;" class="auto-style25">
<table border="1" class="nav-justified">
<tr>
<td class="auto-style5">TAX YEAR</td>
<td rowspan="2" class="auto-style2"><span style="margin-left:5px;color:#000;">IF ASSISTANCE NEEDED </span><br /><span style="margin-left:5px;color:#000;">CALL</span> </td>
<td class="auto-style1">ACCOUNT NUMBER</td>
</tr>
<tr>
<td class="auto-style5"><asp:Label ID="txtTaxYr" runat="server"></asp:Label></td>
<td class="auto-style1"><div class="input text"><asp:TextBox ID="accountnumber" MaxLength="7" style="width:120px;background-color:#ffeeee;border-color:#ff0000;" runat="server"></asp:TextBox>
</div></td>
</tr>
<tr>
<td class="auto-style5"><span style="color:red;">DUE DATE</span></td>
<td colspan="2" >OWNER'S PHONE NUMBER (LIST)</td>
</tr>
<tr>
<td class="auto-style5"><asp:Label ID="txtDueDate" runat="server"></asp:Label></td>
<td colspan="2" ><asp:TextBox ID="txtOwnerPhone" Style="background-color:#ffeeee;border-color:#ff0000;" runat="server"></asp:TextBox></td>
</tr>
</table>
<table style="width:99%">
<tr>
<td style="text-align:center" class="auto-style19"><br />Taxpayer NAME AND ADDRESS</td>
</tr>
<tr><td style="border-collapse: collapse;border: 0px solid black;" class="auto-style19"> </td></tr>
<tr>
<td class="auto-style19">
<table border="0">
<tr>
<td>NAME:</td><td><div class="input text"><asp:TextBox ID="txtfname" style="width:430px;background-color:#ffeeee;border-color:#ff0000;" runat="server"></asp:TextBox></div></td>
</tr>
<tr>
<td>ADDRESS:</td><td><div class="input text"><asp:TextBox ID="txtfaddress" style="width:430px;background-color:#ffeeee;border-color:#ff0000;" runat="server"></asp:TextBox></div></td>
</tr>
</table>
<table border="0">
<tr>
<td><span style="margin-left:32px;color:#000;">CITY:</span></td><td><div class="input text"> <asp:TextBox ID="txtfcity" style="width:150px;background-color:#ffeeee;border-color:#ff0000;" runat="server"></asp:TextBox></div></td><td><span style="margin-left:5px;color:#000;">STATE:</span></td><td><div class="input select">
<asp:DropDownList ID="ddlstates" runat="server" placeholder="Please select a state..." AppendDataBoundItems="True" style="background-color:#ffeeee;border-color:#ff0000;">
<asp:ListItem Value="" Selected="True"></asp:ListItem>
</asp:DropDownList>
</div></td><td><span style="margin-left:5px;color:#000;">ZIP:</span></td><td><div class="input text"> <asp:TextBox ID="txtfzip" style="width:60px;background-color:#ffeeee;border-color:#ff0000;" runat="server"></asp:TextBox></div></td>
</tr>
</table>
</td>
</tr>
<tr><td style="border-collapse: collapse;border: 0px solid black;" class="auto-style19"> </td></tr><tr><td style="border-collapse: collapse;border: 0px solid black;" class="auto-style19"> </td></tr>
<tr>
<td style="border-collapse: collapse;border-top: 1px solid black;border-bottom: 1px solid black;" class="auto-style19"><span style="color:red">To avoid a 10% penalty on boats and motors not previously
returned, file this no later than the due date listed above.
This return is provided to you so you may return the fair
market value of your boat and motor for this tax year.
The return and supporting schedule must be completed
and returned in order for the boat and motor to be properly
returned. Department of Revenue Rule 560-11-10-.08 (3) (C).</span><br /></td>
</tr>
<tr>
<td style="text-align:center" class="auto-style19"><br />PERSONAL PROPERTY STRATA<br /><br /></td>
</tr>
</table>
</td>
<td style="vertical-align: text-top;width:50%;">
<table border="0">
<tr>
<td style="border-collapse: collapse;border-bottom: 1px solid black;" class="auto-style14"><div class="auto-style7" width="50%">NAME AND RETURN ADDRESS</div></td>
</tr>
<tr>
<td class="auto-style14"><div class="auto-style7">TAX ASSESSORS<br />
PROPERTY APPRAISAL</div></td>
</tr>
<tr>
<td style="border-collapse: collapse;border: 1px solid black;" class="auto-style14">TAX SITUS (WHERE YOU LIVE) CHECK ONE:</td>
</tr>
<tr>
<td class="auto-style14">
<asp:RadioButtonList ID="rblsitus" runat="server" style="width:90%;height:70px;" onselectedindexchanged="rblsitus_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Text ="UNINCORPORATED AREA" Value="UNINCORPORATED" />
<asp:ListItem Text ="CITY OF" Value="cityof" />
</asp:RadioButtonList>
<asp:DropDownList ID="citylist" runat="server" Width="200px" AppendDataBoundItems="true" Enabled="false">
<asp:ListItem Value="" Selected="True"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td style="border-collapse: collapse;border: 1px solid black;" class="auto-style14"><div class="auto-style7"><asp:CheckBox ID="same_as_taxpayeraddr" runat="server" /> CHECK BOX IF MAILING ADDRESS OR NAME IS SAME<br />
OTHERWISE, PLEASE CORRECT IN SPACE PROVIDED BELOW</div></td>
</tr>
</table>
<table border="0">
<tr>
<td class="auto-style12">NAME:</td><td style="border-collapse: collapse;border: 1px solid black;"><div class="input text"> <asp:TextBox ID="txtfullname" style="width:543px;" runat="server"></asp:TextBox></div></td>
</tr>
<tr>
<td class="auto-style12">ADDRESS:</td><td style="border-collapse: collapse;border: 1px solid black;"><div class="input text"> <asp:TextBox ID="txtaddress" style="width:543px;" runat="server"></asp:TextBox></div></td>
</tr>
</table>
<table border="0">
<tr>
<td class="auto-style13"><span style="margin-left:32px;color:#000;">CITY:</span></td><td style="border-collapse: collapse;border: 1px solid black;" class="auto-style21"><div class="input text"> <asp:TextBox ID="txtcity" style="width:150px;" runat="server"></asp:TextBox></div></td><td class="auto-style21"> STATE:</td><td style="border-collapse: collapse;border: 1px solid black;" class="auto-style21"><div class="input select">
<asp:DropDownList ID="ddlfillstates" runat="server" style="width:150px;" AppendDataBoundItems="True">
<asp:ListItem Value="" Selected="True"></asp:ListItem>
</asp:DropDownList>
</div></td><td class="auto-style22"><span style="margin-left:18px;color:#000;">ZIP:</span></td><td style="border-collapse: collapse;border: 1px solid black;" class="auto-style23"><div class="input text"> <asp:TextBox ID="txtzip" style="width:93px;" runat="server"></asp:TextBox></div></td>
</tr>
</table>
<table border="0" style="width:100%">
<tr>
<td style="border-collapse: collapse;border-top: 1px solid black;"><br /><span style="color:red;">BOATS SHALL BE RETURNED TO THE OFFICE WHERE LOCATED<br />
184 DAYS A YEAR OR MORE. LIST THE FAIR MARKET VALUE OF ALL<br />
BOATS AND MOTORS BELOW (EXCLUDE TRAILER).</span></td>
</tr>
</table>
</td>
</tr>
</table>
<script type="text/javascript">
$("#<%= same_as_taxpayeraddr.ClientID %>").on("change", function () {
if (this.checked) {
$("#<%= txtfullname.ClientID %>").val($("#txtfname").val());
$("#<%= txtaddress.ClientID %>").val($("#<%= txtfaddress.ClientID %>").val());
$("#<%= txtcity.ClientID %>").val($("#<%= txtfcity.ClientID %>").val());
$("#<%= ddlfillstates.ClientID %>").val($("#<%= ddlstates.ClientID %>").val());
$("#<%= txtzip.ClientID %>").val($("#<%= txtfzip.ClientID %>").val());
}
else
{
//Clear on uncheck
$('#<%= txtfullname.ClientID %>').val("");
$('#<%= txtaddress.ClientID %>').val("");
$('#<%= txtcity.ClientID %>').val("");
$('#<%= ddlfillstates.ClientID %>').val("");
$('#<%= txtzip.ClientID %>').val("");
}
});
</script>
<%-- <asp:Button ID="bntContinue" Text="Save and finish later" OnClick="bntContinue_Click" ValidationGroup ="stype" CssClass="btnclass" runat="server" Height="51px" Width="151px" />--%>
</asp:View>
<asp:View ID="vwAirportInfo" runat="server">
<h2 style="color:#0093B2;">Step 2: Marine Info</h2><br />
<table border="1" style="width: 100%; text-align: center;">
<tr>
<td style="vertical-align: text-top;" class="auto-style9">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table class="myForm">
<tr>
<td>B - BOATS AND MOTORS - INCLUDE ALL CRAFT IN AND ABOVE<br />
THE WATER, THE MOTORS BUT NOT THE LAND TRANSPORT<br />
VEHICLES (TRAILERS).</td><td>TAXPAYER RETURNED VALUE
AS OF JAN. 1 THIS YEAR
</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:TextBox ID="txtboatregNum" Text='<%# Eval("MarineRegNo")%>' runat="server" placeholder="Enter registration #..." Style="width: 450px;" class="form-control"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="txtPayerret" Text='<%# Eval("TaxPyrRetdVal")%>' runat="server" placeholder="Enter Taxpayer returned value as of Jan. 1..." Style="width: 400px;" class="form-control txtPayerret"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="cgaurdNumber" Text='<%# Eval("VesselRegNo")%>' runat="server" placeholder="Enter Coast Guard #..." Style="width: 450px;" class="form-control"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="cguardreturnedval" Text='<%# Eval("VesselTaxPyrRetdVal")%>' runat="server" placeholder="Enter Taxpayer returned value as of Jan. 1..." Style="width: 400px;" class="form-control txtPayerret"></asp:TextBox>
</td>
<td>
<asp:Button ID="BtnAdd" Style="width: 150px;" runat="server" Text="Next Boat"
OnClick="BtnAdd_Click" CssClass="btnclass" />
<asp:Button ID="btnDelete" Style="width: 120px;" runat="server" Text="Remove a row"
OnClick="btnDelete_Click" CommandArgument='<%# Container.ItemIndex %>' CssClass="btnclass" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:Repeater>
<tr>
<td style="width:33%;">
TOTAL<span style="margin-left: 208px; width:300px; color: #000000; font-weight: bold;">></span>
</td>
<td style="width:33%;">
$<asp:Label ID="lblTotal" runat="server"></asp:Label>
<asp:HiddenField ID="hfvalue" runat="server" />
</td>
<td style="width:33%;"></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</asp:View>
<asp:View ID="vwScheduleD" runat="server">
<h2 style="color:#0093B2;">Step 3: Schedule D</h2><br />
<asp:Repeater ID="Repeater2" runat="server" OnItemDataBound="repeater_ItemDataBound">
<ItemTemplate>
<table style="width: 100%;" class="myForm">
<tr>
<td style="white-space: nowrap;" colspan="2">
County:<asp:TextBox ID="aircraftcnty" Style="width: 150px;" runat="server"></asp:TextBox>
</td>
<tr>
<tr>
<td>
Registration "N" #:<asp:TextBox ID="aRegNo" Text='<%#Eval("aRegNo")%>' Style="width: 270px;
margin-left: 195px;" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td style="white-space: nowrap;">
MFG. Name: (make):<asp:TextBox ID="aMake" Style="width: 270px; margin-left: 175px;"
runat="server"></asp:TextBox>
</td>
<td style="white-space: nowrap;">
MFG. Name: (make):<asp:TextBox ID="mMake" Style="width: 270px; margin-left: 175px;"
runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="white-space: nowrap;">
Model Name OR #::<asp:TextBox ID="aModelNo" Style="width: 270px; margin-left: 184px;"
runat="server"></asp:TextBox>
</td>
<td>
Model Name OR #::<asp:TextBox ID="mModelNo" Style="width: 270px; margin-left: 184px;"
runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="white-space: nowrap;">
Year Built:<asp:TextBox ID="boatYrBuilt" Style="width: 270px; margin-left: 250px;" runat="server"></asp:TextBox>
</td>
<td>
Year Built:<asp:TextBox ID="motorYrBuilt" Style="width: 270px; margin-left: 250px;" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="white-space: nowrap;">
Length:<asp:TextBox ID="blength" Style="width: 130px; margin-left: 26px;" runat="server"></asp:TextBox>
<span style="margin-left:122px;">Hull Material:<asp:TextBox ID="hullmaterial" Style="width: 140px; margin-left: 26px;" runat="server"></asp:TextBox></span>
</td>
<td>
HorsePower:<asp:TextBox ID="mhorsepower" Style="width: 130px; margin-left: 231px;" runat="server"></asp:TextBox>
<asp:RadioButtonList ID="rdlmhorsepType" runat="server" ValidationGroup ="stype" RepeatDirection="Horizontal" TextAlign="Right" style="display:inline;" AutoPostBack="true" OnSelectedIndexChanged="rblPurchaseType_SelectedIndexChanged">
<asp:ListItem Text="Electric Start" />
<asp:ListItem Text="Recoil" />
</asp:RadioButtonList><br />
<asp:RequiredFieldValidator style="color:#ff0000;" id="RequiredFieldValidator5" ControlToValidate="rblPurchaseType" ErrorMessage="Please choose New or Used" ValidationGroup ="stype" runat="server" />
</td>
</tr>
<tr>
<td style="white-space: nowrap;">
Date Purchased:<asp:TextBox ID="txtdatePurchased" Style="width: 270px; margin-left: 205px;"
runat="server"></asp:TextBox>
</td>
<td>
Date Purchased:<asp:TextBox ID="mdatePurchased" Style="width: 270px; margin-left: 205px;"
runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Purchased:<asp:RadioButtonList ID="rblPurchaseType" runat="server" ValidationGroup ="stype" RepeatDirection="Horizontal" TextAlign="Right" style="display:inline;margin-left: 245px;" AutoPostBack="true" OnSelectedIndexChanged="rblPurchaseType_SelectedIndexChanged">
<asp:ListItem Text="New" />
<asp:ListItem Text="Used" />
</asp:RadioButtonList><br />
<asp:RequiredFieldValidator style="color:#ff0000;" id="RequiredFieldValidator1" ControlToValidate="rblPurchaseType" ErrorMessage="Please choose New or Used" ValidationGroup ="stype" runat="server" />
</td>
<td>
Purchased:<asp:RadioButtonList ID="rblmPurchasedType" runat="server" ValidationGroup ="stype" RepeatDirection="Horizontal" TextAlign="Right" style="display:inline;margin-left: 245px;" AutoPostBack="true" OnSelectedIndexChanged="rblmPurchasedType_SelectedIndexChanged">
<asp:ListItem Text="New" />
<asp:ListItem Text="Used" />
</asp:RadioButtonList><br />
<asp:RequiredFieldValidator style="color:#ff0000;" id="RequiredFieldValidator4" ControlToValidate="rblmPurchasedType" ErrorMessage="Please choose New or Used" ValidationGroup ="stype" runat="server" />
</td>
</tr>
<tr>
<td>
<asp:Panel ID="uPanel" runat="server" Enabled="false">
<span style="text-align:left;"> If purchased used this year, write the name and address of the
previous owner.</span>
<br />
<div class="input text select"> NAME: <asp:TextBox ID="txtPrevOnwerName" style="width:200px;" runat="server"></asp:TextBox>
ADDRESS: <asp:TextBox ID="txtprevAddr" style="width:200px;" runat="server"></asp:TextBox>
<span style="white-space:nowrap;">CITY:<asp:TextBox ID="txtprevCity" style="width:100px; margin-left:15px;" runat="server"></asp:TextBox>STATE:
<asp:DropDownList ID="ddlPrevState" cssClass="disabledcss" runat="server" AppendDataBoundItems="True">
<asp:ListItem Value="" Selected="True"></asp:ListItem>
</asp:DropDownList>
ZIP:<asp:TextBox ID="txtprevzip" runat="server"></asp:TextBox></div></span></asp:Panel>
</td>
<td>
<asp:Panel ID="uPanel3" runat="server" Enabled="false">
<span style="text-align:left;"> If purchased used this year, write the name and address of the
previous owner.</span>
<br />
<div class="input text select"> NAME: <asp:TextBox ID="txtmPrevOnwerName" style="width:200px;" runat="server"></asp:TextBox>
ADDRESS: <asp:TextBox ID="txtmprevAddr" style="width:200px;" runat="server"></asp:TextBox>
<span style="white-space:nowrap;">CITY:<asp:TextBox ID="txtmprevCity" style="width:100px; margin-left:15px;" runat="server"></asp:TextBox>STATE:
<asp:DropDownList ID="ddlmPrevState" cssClass="disabledcss" runat="server" AppendDataBoundItems="True">
<asp:ListItem Value="" Selected="True"></asp:ListItem>
</asp:DropDownList>
ZIP:<asp:TextBox ID="txtmprevzip" runat="server"></asp:TextBox></div></span></asp:Panel>
</td>
</tr>
<tr>
<td style="border-collapse: collapse;">
If you sold or traded your boat and did not own on January 1
this year, provide details of the new buyer below in order for the items
to be removed from your account.<br />
<div class="input text select"> NAME:<asp:TextBox ID="txtbuyername" style="width:200px;" runat="server"></asp:TextBox>
ADDRESS:<asp:TextBox ID="txtbuyeraddress" style="width:200px;" runat="server"></asp:TextBox><br />
<span style="margin-left:32px;color:#000;">CITY:<asp:TextBox ID="txtbuyercity" style="width:150px;" runat="server"></asp:TextBox>STATE:
<asp:DropDownList ID="lblbuyerstate" runat="server" AppendDataBoundItems="True">
<asp:ListItem Value="" Selected="True"></asp:ListItem>
</asp:DropDownList>
ZIP:<asp:TextBox ID="txtbuyerzip" style="width:50px;" runat="server"></asp:TextBox></div>
<div class="input text">Date Sold:<asp:TextBox ID="txtdatesold" runat="server"></asp:TextBox><span style="margin-left:220px;color:#333;">Sale Price:<asp:TextBox ID="txtsalePrice" runat="server"></asp:TextBox></span></div><br />
<div class="input textarea">Description:<asp:TextBox ID="txtDescription" TextMode="MultiLine" style="width:350px;" runat="server"></asp:TextBox></div>
</td>
<td style="border-collapse: collapse;">
If you sold or traded your motor and did not own on January 1
this year, provide details of the new buyer below in order for the items
to be removed from your account.<br />
<div class="input text select"> NAME:<asp:TextBox ID="txtmbuyername" style="width:200px;" runat="server"></asp:TextBox>
ADDRESS:<asp:TextBox ID="txtmbuyeraddress" style="width:200px;" runat="server"></asp:TextBox><br />
<span style="margin-left:32px;color:#000;">CITY:<asp:TextBox ID="txtmbuyercity" style="width:150px;" runat="server"></asp:TextBox>STATE:
<asp:DropDownList ID="lblmbuyerstate" runat="server" AppendDataBoundItems="True">
<asp:ListItem Value="" Selected="True"></asp:ListItem>
</asp:DropDownList>
ZIP:<asp:TextBox ID="txtmbuyerzip" style="width:50px;" runat="server"></asp:TextBox></div><br />
<div class="input text">Date Sold:<asp:TextBox ID="txtmdatesold" runat="server"></asp:TextBox><span style="margin-left:220px;color:#333;">Sale Price:<asp:TextBox ID="txtmsalePrice" runat="server"></asp:TextBox></span></div><br />
<div class="input textarea">Description:<asp:TextBox ID="txtmDescription" TextMode="MultiLine" style="width:350px;" runat="server"></asp:TextBox></div>
</td
</tr>
<tr>
<td style="white-space:nowrap;">
Cost:<asp:TextBox ID="boatCost" style="width:270px;margin-left:50px;" runat="server"></asp:TextBox>
</td>
<td>
Cost:<asp:TextBox ID="motorCost" style="width:270px;margin-left:50px;" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td align="center">
<div>
Is there anything functionally wrong with your boat?<br />
<asp:RadioButtonList ID="rblIssues" runat="server" ValidationGroup ="stype" RepeatDirection="Horizontal" TextAlign="Right" style="display:inline;" AutoPostBack="true" OnSelectedIndexChanged="rblIssues_SelectedIndexChanged">
<asp:ListItem Text="Yes" />
<asp:ListItem Text="No" />
</asp:RadioButtonList><br />
<asp:RequiredFieldValidator style="color:#ff0000;" id="RequiredFieldValidator3"
ControlToValidate="rblIssues"
ErrorMessage="Please Yes or No"
ValidationGroup = "stype" runat="server"/><br />
If yes please provide the Board of Assessors with
documentation<br /> in order for them to make a proper assessment.<br />
<br />
List anything functionally wrong with your boat:
<asp:Panel ID="uPanel1" runat="server" Enabled="false"><div class="input textarea"> <asp:TextBox ID="functionalIsses" style="width:400px;" TextMode="MultiLine" runat="server"></asp:TextBox></div></asp:Panel>
</div>
</td>
<td align="center">
<div>
Is there anything functionally wrong with your motor?<br />
<asp:RadioButtonList ID="mrblIssues" runat="server" ValidationGroup ="stype" RepeatDirection="Horizontal" TextAlign="Right" style="display:inline;" AutoPostBack="true" OnSelectedIndexChanged="mrblIssues_SelectedIndexChanged">
<asp:ListItem Text="Yes" />
<asp:ListItem Text="No" />
</asp:RadioButtonList><br />
<asp:RequiredFieldValidator style="color:#ff0000;" id="RequiredFieldValidator2"
ControlToValidate="mrblIssues"
ErrorMessage="Please Yes or No"
ValidationGroup ="stype" runat="server"/><br />
If yes please provide the Board of Assessors with
documentation<br /> in order for them to make a proper assessment.<br />
<br />
List anything functionally wrong with your boat:
<asp:Panel ID="uPanel2" runat="server" Enabled="false"><div class="input textarea"> <asp:TextBox ID="mfunctionalIsses" style="width:400px;" TextMode="MultiLine" runat="server"></asp:TextBox></div></asp:Panel>
</div>
</td>
</tr>
<tr>
<td colspan="2">
FEDERAL DOCUMENTED VESSEL
</td>
</tr>
<tr>
<td colspan="2">
Type and Use of Vessel:<asp:TextBox ID="txtvesseltypeUse" style="width:800px;margin-left:50px;" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="white-space:nowrap;" colspan="2">
Vessel Name:<asp:TextBox ID="txtvesselname" style="width:200px;margin-left:125px;" runat="server"></asp:TextBox></span>
<span style="margin-left:30px;"></span>Length:<asp:TextBox ID="txtvessellength" style="width:200px;margin-left:10px;" runat="server"></asp:TextBox></span>
<span style="margin-left:30px;color:#000;font-weight:bold;">Year Built:<asp:TextBox ID="txtvesselYrBult" style="width:200px;margin-left:10px;" runat="server"></asp:TextBox></span>
<span style="margin-left:30px;color:#000;font-weight:bold;">Hull Material:<asp:TextBox ID="txtVeseelHullMateria" style="width:200px;margin-left:10px;" runat="server"></asp:TextBox></span>
</td>
</tr>
<tr>
<td style="white-space:nowrap;" colspan="2">
HorsePower and Type of Engine:<asp:TextBox ID="vessehorsepEngine" style="width:500px;margin-left:125px;" runat="server"></asp:TextBox>
<span style="margin-left:135px;"></span>Coast Guard Number:<asp:TextBox ID="coastGuardNumber" style="width:200px;margin-left:10px;" Text='<%#Eval("coastGuardNumber")%>' runat="server"></asp:TextBox></span>
</td>
</tr>
<tr>
<td style="white-space:nowrap;" colspan="2">
Year Purchased:<asp:TextBox ID="txtVesselYrPurchased" style="width:200px;margin-left:241px;color:#000;font-weight:bold;" runat="server"></asp:TextBox></span>
<span style="margin-left:30px;color:#000;font-weight:bold;">Purchased New?:</span> <span style="margin-left:60px;color:#000;font-weight:bold;">
<asp:RadioButtonList ID="rblVPurchasedNew" runat="server" ValidationGroup ="stype" RepeatDirection="Horizontal" TextAlign="Right" style="display:inline;" AutoPostBack="true" OnSelectedIndexChanged="rblPurchaseType_SelectedIndexChanged">
<asp:ListItem Text="Yes" />
<asp:ListItem Text="No" />
</asp:RadioButtonList></span>
<asp:RequiredFieldValidator style="color:#ff0000;" id="RequiredFieldValidator6"
ControlToValidate="rblVPurchasedNew"
ErrorMessage="Please Yes or No"
ValidationGroup ="stype" runat="server"/>
<span style="margin-left:30px;color:#000;font-weight:bold;">Amount of Purchase:<asp:TextBox ID="VesselPurchaseAmt" style="width:200px;margin-left:18px;color:#6E6E6E;" runat="server"></asp:TextBox></span>
</td>
</tr>
<tr>
<td style="white-space:nowrap;" colspan="2">
Home Port:<asp:TextBox ID="txthomePort" style="width:350px;margin-left:125px;" runat="server"></asp:TextBox>
<span style="margin-left:313px;"></span>Where Docked:<asp:TextBox ID="txtwhereDocked" style="width:350px;margin-left:38px;" runat="server"></asp:TextBox></span>
</td>
</tr>
<tr>
<td colspan="2" style="margin-left:313px;">
Boat and Motor Equipment Accessory List:<br /><asp:TextBox ID="bmequipAccessoryList" style="width:700px;" TextMode="MultiLine" runat="server"></asp:TextBox></div>
</td>
</tr>
</tr>
</table>
<table>
<tr>
<td colspan="2">
<asp:Button ID="BtnAdd2" Style="width: 150px;" runat="server" Text="Next Aircraft"
OnClick="ButtonAdd2_Click" CssClass="btnclass" />
<asp:Button ID="btnDelete2" Style="width: 120px;" runat="server" Text="Remove a row"
OnClick="btnDelete2_Click" CssClass="btnclass" />
</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
</asp:View>
<asp:View ID="vwPreview" runat="server">
<h2 style="color:#0093B2;">Step 4: Review/Sign/Submit</h2><br />
<asp:Panel id="pnlContents" runat = "server">
<table border="1" style="width:90%; text-align:left">
<tr>
<td style="width:30%;vertical-align: text-top;font-weight:normal;text-align:center;color:gainsboro">FOR OFFICE ONLY</td>
<td style="width:70%;"><div class="auto-style7"><span style="font-weight:bold;color:#4b4b4b;">MARINE PERSONAL PROPERTY TAX RETURN</span><br />
<span style="color:#4b4b4b;">This Return will be considered Public Information and Open for Public Inspection<br />
Return completed form to address listed below.</span></div></td>
</tr>
<tr>
<td style="vertical-align: text-top;width:45%;">
<table border="1" class="nav-justified">
<tr>
<td class="auto-style5">TAX YEAR</td>
<td rowspan="2" class="auto-style2"><span style="margin-left:7px;color:#000;">IF ASSISTANCE NEEDED CALL</span><br /> <span style="margin-left:32px;color:#000;"></span></td>
<td class="auto-style1">ACCOUNT NUMBER</td>
</tr>
<tr>
<td class="auto-style5"><asp:Label ID="lblTaxYr" style="color: #0093B2;font-weight:bold;" runat="server" /></td>
<td class="auto-style1"><div class="input text"> <asp:Label ID="lblAcctNo" disabled="disabled" style="width:155px; color: #0093B2;font-weight:bold;" runat="server"></asp:Label></div></td>
</tr>
<tr>
<td class="auto-style5"><span style="color:red;">DUE DATE</span></td>
<td colspan="2" >OWNER'S PHONE NUMBER (LIST)</td>
</tr>
<tr>
<td class="auto-style5"><asp:Label ID="lblDueDate" style="color: #0093B2;font-weight:bold;" runat="server" /></td>
<td colspan="2" ><asp:Label ID="lblOwnerPhone" style="color: #0093B2;font-weight:bold;" runat="server" /></td>
</tr>
</table>
<table style="width:60%">
<tr>
<td style="text-align:center"><br />Taxpayer NAME AND ADDRESS</td>
</tr>
<tr><td style="border-collapse: collapse;border: 0px solid black;"> </td></tr>
<tr>
<td>
<table border="0">
<tr>
<td>NAME:</td><td><div class="input text"> <asp:Label ID="lblfName" style="width:459px;color: #0093B2;font-weight:bold;" runat="server"></asp:Label></div></td>
</tr>
<tr>
<td>ADDRESS:</td><td><div class="input text"> <asp:Label ID="lblfAddress" style="width:459px;color: #0093B2;font-weight:bold;" runat="server"></asp:Label></div></td>
</tr>
</table>
<table border="0">
<tr>
<td><span style="margin-left:2px;color:#000;">CITY:</span> </td><td><div class="input text"> <asp:Label ID="lblfCity" style="width:150px; color: #0093B2;font-weight:bold;" runat="server"></asp:Label></div></td><td> STATE:</td><td><div class="input select">
<asp:Label ID="lblfStates" CssClass="Label" disabled="disabled" runat="server">
</asp:Label>
</div></td><td> ZIP:</td><td><div class="input text"> <asp:Label ID="lblfZip" style="width:57px; color: #0093B2;font-weight:bold;" runat="server"></asp:Label></div></td>
</tr>
</table>
</td>
</tr>
<tr><td style="border-collapse: collapse;border: 0px solid black;"> </td></tr><tr><td style="border-collapse: collapse;border: 0px solid black;"> </td></tr>
<tr>
<td style="border-collapse: collapse;border-top: 1px solid black;border-bottom: 1px solid black;width:100%;"><span style="color:red">The last day for filing this application to receive full exemption<br />
is listed in the DUE DATE column above.</span> Note: Most counties do not accept metered mail dates as filing date unless counter<br />
stamped by the post office. Be sure that the date of deposit and the postmark date are the same if mailing is close to the deadline.<br /></td>
</tr>
</table>
</td>
<td style="vertical-align: text-top;width:55%;">
<table border="0" style="width:100%">
<tr>
<td style="border-collapse: collapse;border-bottom: 1px solid black;"><div class="auto-style7">NAME AND RETURN ADDRESS</div></td>
</tr>
<tr>
<td style="border-collapse: collapse;border-bottom: 1px solid black;"><div class="auto-style7">TAX ASSESSORS<br />
PROPERTY APPRAISAL </div></td>
</tr>
<tr>
<td style="border-collapse: collapse;border: 1px solid black;">TAX SITUS (WHERE YOU LIVE):</td>
</tr>
<tr><td> </td></tr>
<tr>
<td>
<asp:Label ID="lblsitus" runat="server" style="width:90%;height:70px;width:257px;color: #0093B2;font-weight:bold;" disabled="disabled">
</asp:Label>
<div id="divcitylistprev" style="margin-top:-45px;margin-left:110px;"><asp:Label ID="lblcitylist" class="form-control" style="width:400px; color: #0093B2;font-weight:bold;" placeholder="(Choose...)" runat="server" /></div>
</td>
</tr>
<tr>
<td style="border-collapse: collapse;border: 1px solid black;"><div class="auto-style7"><asp:CheckBox ID="chksameAddr" style="color: #0093B2;font-weight:bold;" runat="server" />CHECK BOX IF MAILING ADDRESS OR NAME IS SAME<br />
OTHERWISE, PLEASE CORRECT IN SPACE PROVIDED BELOW</div></td>
</tr>
</table>
<table border="0">
<tr>
<td>NAME:</td><td style="border-collapse: collapse;border: 1px solid black;"><div class="input text"> <asp:Label ID="lblfullName" style=" color: #0093B2;font-weight:bold;width:600px;" runat="server"></asp:Label></div></td>
</tr>
<tr>
<td>ADDRESS:</td><td style="border-collapse: collapse;border: 1px solid black;"><div class="input text"> <asp:Label ID="lblAddress" style="width:600px; color: #0093B2;font-weight:bold;" runat="server"></asp:Label></div></td>
</tr>
</table>
<table border="0">
<tr>
<td>CITY:<span style="margin-left:32px;color:#000;"></span></td><td style="border-collapse: collapse;border: 1px solid black;"><div class="input text"> <asp:Label ID="lblCity" style="color: #0093B2;font-weight:bold;width:100px;" runat="server"></asp:Label></div></td><td><span style="margin-left:7px;color:#000;">STATE:</span></td><td style="border-collapse: collapse;border: 1px solid black;"><div class="input select">
<asp:Label ID="lblStates" CssClass="Label" disabled="disabled" runat="server" style="width:150px;">
</asp:Label>
</div></td><td><span style="margin-left:30px;color:#000;">ZIP:</span></td><td style="border-collapse: collapse;border: 1px solid black;"><div class="input text"> <asp:Label ID="lblZip" style="color: #0093B2;font-weight:bold;width:100px;" runat="server"></asp:Label></div></td>
</tr>
</table>
</td>
</tr>
</table>
<table border="1" style="width:100%;text-align:center;">
<tr>
<td style="width:100%;vertical-align: text-top;">
<table cellspacing="0" rules="all" border="1" width="100%" style="border-collapse:collapse;table-layout: fixed;">
<tr>
<th align="left" scope="col">B - BOATS AND MOTORS - INCLUDE ALL CRAFT IN AND ABOVE<br />
THE WATER, THE MOTORS BUT NOT THE LAND TRANSPORT VEHICLES (TRAILERS).</th>
<th scope="col">Payer Returned Value <br />As of Jan This Year</th>
<th scope="col"><span style="color:gainsboro;margin-left:50px;">For Tax Office use Only</span> <br /><span style="color:gainsboro;margin-left:50px;"> (Tax Assessirs Value)</span></th>
</tr>
<%foreach (System.Data.DataRow row in dtAirInfoTable.Rows)
{%>
<tr>
<td>
<span class="form-control" style="width: 493px; color: #0093B2;font-weight: bold;"> <%=row.ItemArray[1].ToString()%></span>
</td>
<td align="center">
<span class="form-control txtPayerret" style="width: 400px;color: #0093B2; font-weight: bold;"><%=row.ItemArray[2].ToString()%></span>
</td>
</tr>
<tr>
<td>
<span class="form-control" style="width: 493px; color: #0093B2;font-weight: bold;"> <%=row.ItemArray[3].ToString()%></span>
</td>
<td align="center">
<span class="form-control txtPayerret" style="width: 400px;color: #0093B2; font-weight: bold;"><%=row.ItemArray[4].ToString()%></span>
</td>
</tr>
<% } %>
</table>
</td>
</tr>
<tr>
<td>
<table cellspacing="0" rules="all" border="1" width="100%" style="border-collapse:collapse;table-layout: fixed;">
<tr>
<td>TOTAL<span style="margin-left:200px;color:#000000;font-weight:bold;">></span></td>
<td>
<asp:Label ID="lblTotalPrev" style="color: #0093B2;font-weight: bold;width: 326px;" runat="server"></asp:Label></td>
<td></td>
</tr>
</table>
</td>
</tr>
</table>
<asp:Repeater ID="rptpreview" runat="server">
<ItemTemplate>
<table style="width: 100%;" class="myForm">
<tr>
<td style="white-space: nowrap;" colspan=2>
County:<asp:Label ID="aircraftcntyPreview" Text='<%#Eval("boatcnty") %>' Style="width: 150px;" runat="server"></asp:Label>
</td>
<tr>
<td>Registration "N" #:<asp:Label ID="aRegNoPreview" runat="server" Style="width: 270px;
margin-left: 195px;" Text='<%#Eval("aRegNo")%>'></asp:Label>
</td>
<td></td>
</tr>
<tr>
<td style="white-space: nowrap;">MFG. Name: (make):<asp:Label ID="aMakePreview" runat="server" Text='<%#Eval("aMake") %>' Style="width: 270px; margin-left: 175px;"></asp:Label>
</td>
<td style="white-space: nowrap;">MFG. Name: (make):<asp:Label ID="mMakePreview" runat="server" Text='<%#Eval("mMake") %>' Style="width: 270px; margin-left: 175px;"></asp:Label>
</td>
</tr>
<tr>
<td style="white-space: nowrap;">Model Name OR #::<asp:Label ID="aModelNoPreview" runat="server" Text='<%#Eval("ModelNoA") %>' Style="width: 270px; margin-left: 184px;"></asp:Label>
</td>
<td>Model Name OR #::<asp:Label ID="mModelNoPreview" runat="server" Text='<%#Eval("ModelNoM") %>' Style="width: 270px; margin-left: 184px;"></asp:Label>
</td>
</tr>
<tr>
<td style="white-space: nowrap;">Year Built:<asp:Label ID="boatYrBuiltPreview" runat="server" Text='<%#Eval("boatYrBuilt") %>' Style="width: 270px; margin-left: 250px;"></asp:Label>
</td>
<td>Year Built:<asp:Label ID="motorYrBuiltPreview" runat="server" Text='<%#Eval("motorYrBuilt") %>' Style="width: 270px; margin-left: 250px;"></asp:Label>
</td>
</tr>
<tr>
<td style="white-space: nowrap;">Length:<asp:Label ID="blengthPreview" runat="server" Text='<%#Eval("blength") %>' Style="width: 130px; margin-left: 26px;"></asp:Label>
<span style="margin-left:122px;">Hull Material:<asp:Label ID="hullmaterial" runat="server" Text='<%#Eval("hullmaterial") %>' Style="width: 140px; margin-left: 26px;"></asp:Label>
</span></td>
<td>HorsePower:<asp:Label ID="mhorsepowerPreview" runat="server" Text='<%#Eval("mhorsepower") %>' Style="width: 130px; margin-left: 231px;"></asp:Label>
<asp:Label ID="mhorsepTypePreview" runat="server" Text='<%#Eval("rdlmhorsepType") %>' style="display:inline;" TextAlign="Right">
</asp:Label>
<br />
</td>
</tr>
<tr>
<td style="white-space: nowrap;">Date Purchased:<asp:Label ID="datePurchasedvPreview" runat="server" Text='<%#Eval("datePurchased") %>' Style="width: 270px; margin-left: 205px;"></asp:Label>
</td>
<td>Date Purchased:<asp:Label ID="mdatePurchasedPreview" runat="server" Text='<%#Eval("mdatePurchased") %>' Style="width: 270px; margin-left: 205px;"></asp:Label>
</td>
</tr>
<tr>
<td>Purchased:<asp:Label ID="rblPurchaseTypePreview" runat="server" Text='<%#Eval("PurchaseType") %>' style="display:inline;margin-left: 245px;" TextAlign="Right">
</asp:Label>
<br />
</td>
<td>Purchased:<asp:Label ID="rblmPurchasedTypePreview" runat="server" AutoPostBack="true" RepeatDirection="Horizontal" Text='<%#Eval("rblmPurchasedType") %>' style="display:inline;margin-left: 245px;" TextAlign="Right" ValidationGroup="stype">
</asp:Label>
<br />
</td>
</tr>
<tr>
<td>
<span style="text-align:left;">If purchased used this year, write the name and address of the previous owner.</span>
<br />
<div class="input text select">
NAME:
<asp:Label ID="PrevOnwerNamePreview" runat="server" Text='<%#Eval("txtPrevOnwerName") %>' style="width:200px;"></asp:Label>
ADDRESS:
<asp:Label ID="txtprevAddrPreview" runat="server" Text='<%#Eval("prevAddr") %>' style="width:200px;"></asp:Label>
<span style="white-space:nowrap;">CITY:<asp:Label ID="prevCityPreview" runat="server" Text='<%#Eval("prevCity") %>' style="width:100px; margin-left:15px;"></asp:Label>
STATE:
<asp:Label ID="ddlPrevStatePreview" runat="server" Text='<%#Eval("PrevState") %>' cssClass="disabledcss"> </asp:Label>
ZIP:<asp:Label ID="prevzipPreview" Text='<%#Eval("prevzip") %>' runat="server"></asp:Label>
</span>
</div>
</td>
<td>
<asp:Panel ID="Panel1" runat="server" Enabled="false">
<span style="text-align:left;">If purchased used this year, write the name and address of the previous owner.</span>
<br />
<div class="input text select">
NAME:
<asp:Label ID="mPrevOnwerNamePreview" runat="server" Text='<%#Eval("mPrevOnwerName") %>' style="width:200px;"></asp:Label>
ADDRESS:
<asp:Label ID="mprevAddrPreview" runat="server" Text='<%#Eval("mprevAddr") %>' style="width:200px;"></asp:Label>
<span style="white-space:nowrap;">CITY:<asp:Label ID="mprevCityPreview" runat="server" Text='<%#Eval("mprevCity") %>' style="width:100px; margin-left:15px;"></asp:Label>
STATE:
<asp:Label ID="mPrevStatePreview" runat="server" Text='<%#Eval("mPrevState") %>' cssClass="disabledcss"></asp:Label>
ZIP:<asp:Label ID="mprevzipPreview" runat="server" Text='<%#Eval("mprevzip") %>'></asp:Label>
</span>
</div>
</asp:Panel>
</td>
</tr>
<tr>
<td style="border-collapse: collapse;">If you sold or traded your boat and did not own on January 1 this year, provide details of the new buyer below in order for the items to be removed from your account.<br />
<div class="input text select">
NAME:<asp:Label ID="buyernamePreview" runat="server" Text='<%#Eval("buyername") %>' style="width:200px;"></asp:Label>
ADDRESS:<asp:Label ID="buyeraddressPreview" runat="server" Text='<%#Eval("buyeraddress") %>' style="width:200px;"></asp:Label>
<br />
<span style="margin-left:32px;color:#000;">CITY:<asp:Label ID="buyercityPreview" runat="server" Text='<%#Eval("buyercity") %>' style="width:150px;"></asp:Label>
</span>STATE:
<asp:Label ID="buyerstatePreview" runat="server" Text='<%#Eval("buyerstate") %>'> </asp:Label>
ZIP:<asp:Label ID="buyerzipPreview" runat="server" Text='<%#Eval("buyerzip") %>' style="width:50px;"></asp:Label>
</div>
<div class="input text">
Date Sold:<asp:Label ID="datesoldPreview" runat="server" Text='<%#Eval("datesold") %>'></asp:Label>
<span style="margin-left:220px;color:#333;">Sale Price:<asp:Label ID="bsalePricePreview" runat="server" Text='<%#Eval("salePrice") %>'></asp:Label>
</span>
</div>
<br />
<div class="input textarea">
Description:<asp:Label ID="DescriptionPreview" runat="server" Text='<%#Eval("Description") %>' style="width:350px;" TextMode="MultiLine"></asp:Label>
</div>
</td>
<td style="border-collapse: collapse;">If you sold or traded your motor and did not own on January 1 this year, provide details of the new buyer below in order for the items to be removed from your account.<br />
<div class="input text select">
NAME:<asp:Label ID="mbuyernamePreview" runat="server" Text='<%#Eval("mbuyername") %>' style="width:200px;"></asp:Label>
ADDRESS:<asp:Label ID="mbuyeraddressPreview" runat="server" Text='<%#Eval("mbuyeraddress") %>' style="width:200px;"></asp:Label>
<br />
<span style="margin-left:32px;color:#000;">CITY:<asp:Label ID="mbuyercityPreview" runat="server" Text='<%#Eval("mbuyercity") %>' style="width:150px;"></asp:Label>
STATE:
<asp:Label ID="mbuyerstatePreview" runat="server" Text='<%#Eval("mbuyerstate") %>'> </asp:Label>
ZIP:<asp:Label ID="mbuyerzipPreview" runat="server" Text='<%#Eval("mbuyerzip") %>' style="width:50px;"></asp:Label>
</span>
</div>
<br />
<div class="input text">
Date Sold:<asp:Label ID="mdatesoldPreview" runat="server" Text='<%#Eval("mdatesold") %>'></asp:Label>
<span style="margin-left:220px;color:#333;">Sale Price:<asp:Label ID="msalePricePreview" runat="server" Text='<%#Eval("msalePrice") %>'></asp:Label>
</span>
</div>
<br />
<div class="input textarea">
Description:<asp:Label ID="mDescriptionPreview" runat="server" Text='<%#Eval("mDescription") %>' style="width:350px;" TextMode="MultiLine"></asp:Label>
</div>
</td>
</tr>
<tr>
<td style="white-space:nowrap;">Cost:<asp:Label ID="boatCostPreview" runat="server" Text='<%#Eval("boatCost") %>' style="width:270px;margin-left:50px;"></asp:Label>
</td>
<td>Cost:<asp:Label ID="motorCostPreview" runat="server" Text='<%#Eval("motorCost") %>' style="width:270px;margin-left:50px;"></asp:Label>
</td>
</tr>
<tr>
<td align="center">
<div>
Is there anything functionally wrong with your boat?<br />
<asp:Label ID="rblIssuesPreview" runat="server" Text='<%#Eval("rblIssues") %>' style="display:inline;" TextAlign="Right">
</asp:Label>
<br />
If yes please provide the Board of Assessors with documentation<br /> in order for them to make a proper assessment.<br />
<br />
List anything functionally wrong with your boat:
<div class="input textarea">
<asp:Label ID="functionalIssesPreview" runat="server" Text='<%#Eval("functionalIsses") %>' style="width:400px;" TextMode="MultiLine"></asp:Label>
</div>
</div>
</td>
<td align="center">
<div>
Is there anything functionally wrong with your motor?<br />
<asp:Label ID="mrblIssuesPreview" runat="server" Text='<%#Eval("mrblIssues") %>' style="display:inline;" TextAlign="Right">
</asp:Label>
<br />
If yes please provide the Board of Assessors with documentation<br /> in order for them to make a proper assessment.<br />
<br />
List anything functionally wrong with your boat:
<div class="input textarea">
<asp:Label ID="mfunctionalIssesPreview" runat="server" Text='<%#Eval("mfunctionalIsses") %>' style="width:400px;" TextMode="MultiLine"></asp:Label>
</div>
</div>
</td>
</tr>
<tr>
<td colspan="2">FEDERAL DOCUMENTED VESSEL </td>
</tr>
<tr>
<td colspan="2">Type and Use of Vessel:<asp:Label ID="vesseltypeUsePreview" runat="server" Text='<%#Eval("vesseltypeUse") %>' style="width:800px;margin-left:50px;"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2" style="white-space:nowrap;">Vessel Name:<asp:Label ID="vesselnamePreview" runat="server" Text='<%#Eval("vesselname") %>' style="width:200px;margin-left:125px;"></asp:Label>
<span style="margin-left:30px;"></span>Length:<asp:Label ID="vessellengthPreview" runat="server" Text='<%#Eval("vessellength") %>' style="width:200px;margin-left:10px;"></asp:Label>
<span style="margin-left:30px;color:#000;font-weight:bold;">Year Built:<asp:Label ID="vesselYrBultPreview" runat="server" Text='<%#Eval("vesselYrBult") %>' style="width:200px;margin-left:10px;"></asp:Label>
</span><span style="margin-left:30px;color:#000;font-weight:bold;">Hull Material:<asp:Label ID="VeseelHullMateriaPreview" runat="server" Text='<%#Eval("VeseelHullMateria") %>' style="width:200px;margin-left:10px;"></asp:Label>
</span></td>
</tr>
<tr>
<td colspan="2" style="white-space:nowrap;">HorsePower and Type of Engine:<asp:Label ID="vessehorsepEnginePreview" runat="server" Text='<%#Eval("vessehorsepEngine") %>' style="width:500px;margin-left:125px;"></asp:Label>
<span style="margin-left:135px;"></span>Coast Guard Number:<asp:Label ID="vesselCGuardNumPreview" runat="server" style="width:200px;margin-left:10px;" Text='<%#Eval("coastGuardNumber")%>'></asp:Label>
</td>
</tr>
<tr>
<td colspan="2" style="white-space:nowrap;">Year Purchased:<asp:Label ID="VesselYrPurchasedPreview" runat="server" Text='<%#Eval("VesselYrPurchased") %>' style="width:200px;margin-left:241px;color:#000;font-weight:bold;"></asp:Label>
<span style="margin-left:30px;color:#000;font-weight:bold;">Purchased New?:</span> <span style="margin-left:60px;color:#000;font-weight:bold;">
<asp:Label ID="VPurchasedNewPreview" runat="server" Text='<%#Eval("PurchasedNew") %>' style="display:inline;" TextAlign="Right">
</asp:Label>
</span><span style="margin-left:30px;color:#000;font-weight:bold;">Amount of Purchase:<asp:Label ID="VesselPurchaseAmtPreview" runat="server" Text='<%#Eval("VesselPurchaseAmt") %>' style="width:200px;margin-left:18px;color:#6E6E6E;"></asp:Label>
</span></td>
</tr>
<tr>
<td colspan="2" style="white-space:nowrap;">Home Port:<asp:Label ID="homePortPreview" runat="server" Text='<%#Eval("homePort") %>' style="width:350px;margin-left:125px;"></asp:Label>
<span style="margin-left:313px;"></span>Where Docked:<asp:Label ID="whereDockedPreview" runat="server" Text='<%#Eval("whereDocked") %>' style="width:350px;margin-left:38px;"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2" style="margin-left:313px;">Boat and Motor Equipment Accessory List:<br /><asp:Label ID="bmequipAccessoryListPreview" runat="server" Text='<%#Eval("bmequipAccessoryList") %>' style="width:700px;" TextMode="MultiLine"></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
<br /><br />
<table border="1" style="width:90%; text-align:left">
<tr>
<td>
<br /><span style="font-size:5em;margin-left:400px;font-weight:bold;">Payer'S DECLARATION</span><br />
“I do solemnly swear, or affirm, that I have carefully read (or have heard read) and have duly considered the questions propounded in the foregoing tax list, and that
the value placed by me on the property listed as shown, is the true market value there of, and I further swear, or affirm, that I returned, for the purpose of being taxed
thereon, every species of inventory that I own in my right, or have control of, either as agent, executor, administrator, or otherwise; and in making this application,
for the purpose of being taxed thereon, I have not attempted, either by transferring my property to another or by any other means, to evade the laws governing
taxation in this state. I do further swear, or affirm, that in making this application, I have done so by estimating the true worth and value of every species of inventory
contained therein.”<br /><br />
</td>
</tr>
</table>
<table border="1" style="width:90%; text-align:left">
<tr>
<td style="width:40%"><div>
<asp:CheckBox ID="chkTerms" runat="server" />
I do: <span id="TermsRequired" style="display: none; color: red;"><span style="color:red;">Check the box before you can submit your data</span></span>
</div></td><td style="width:40%">Title: <asp:TextBox id="txtTitle" runat="server"></asp:TextBox></td><td style="width:20%">Date: <asp:Label id="signDate" runat="server"></asp:Label></td>
</tr>
</table>
</asp:Panel>
<br />
<asp:Button ID="btnPrint" runat="server" Text="Print" OnClientClick = "return PrintPPTRForm();" />
<style type="text/css">
.modal {
position:relative;
top:-1em;
z-index:100;
}
.loading{
font-family: Arial;
font-size: 10pt;
border: 5px solid #0093B2;
width: 200px;
height: 100px;
display: none;
position: fixed;
margin-top:400px;
margin-left:300px;
background-color: White;
z-index: 999;
}
</style>
<script type="text/javascript">
$(function () {
$('#btnSave').click(function (e) {
if ($('#<%=chkTerms.ClientID%>').prop('checked')) {
$(".loading").addClass('modal');
$(".loading").show();
}
else {
$('#TermsRequired').show();
e.preventDefault();
}
});
$('#chkTerms').click(function () {
if ($(this).prop('checked')) {
$('#TermsRequired').hide();
}
});
});
</script>
<script type = "text/javascript">
function PrintPPTRForm() {
var panel = document.getElementById("<%=pnlContents.ClientID %>");
var printWindow = window.open('', '', ',<span style="height:100%;width:100%;display:block;overflow: auto;"></span>');
printWindow.document.write('<html><head><title>Marine Personal Property Tax Return</title>');
printWindow.document.write('</head><body >');
printWindow.document.write(panel.innerHTML);
printWindow.document.write('</body></html>');
printWindow.document.close();
setTimeout(function () {
printWindow.print();
}, 500);
return false;
}
</script>
<br />
</asp:View>
</asp:MultiView>
</div>
<br /><br />
<span style="margin-left:10px;">
<asp:Button ID="btnContinue" Text="Save and finish later" OnClick="btnContinue_Click" ValidationGroup ="stype" CssClass="btnclass" runat="server" Height="51px" Width="151px" />
<asp:Button ID="btnback" Text="Back" CssClass="btnclass" OnClick="onBack" runat="server" Height="51px" Width="94px" />
<asp:Button ID="btnNext" Text="Next" OnClick="OnClickNext" ValidationGroup ="stype" CssClass="btnclass" runat="server" Height="51px" Width="79px" />
<asp:Button ID="btnSave" Text="Save" class="btnclass" OnClick="btnSave_Click" runat="server" Height="51px" Width="109px" /></span>
<p><asp:Label id="lblResult" Visible="true" runat="server"></asp:Label></p>
</div>
</form>
</div>
<div>
<script type="text/javascript">
function pageLoad() {
totalcalculate();
$('[id*=txtPayerret]').keyup(function () {
totalcalculate();
});
$('[id*=cguardreturnedval]').keyup(function () {
totalcalculate();
});
}
//function totalcalculate() {
// var total = 0;
// for (var i = 0; i < $('.txtPayerret').length; i++) {
// var temp = $('.txtPayerret')[i].value;
// temp != "" ? temp : temp = 0;
// total = parseFloat(temp) + parseFloat(total);
// $('[id*=lblTotal]').html(total);
// $('[id*=hfvalue]').val(total);
// }
//}
function totalcalculate() {
var total = 0;
for (var i = 0; i < $('.txtPayerret').length; i++) {
var temp = $('.txtPayerret')[i].value;
temp != "" ? temp : temp = 0;
total = parseFloat(temp) + parseFloat(total);
$('#lblTotal').html(total.toFixed(2));
$('[id*=hfvalue]').val(total);
}
}
</script>
<style type="text/css">
body
{
font-family: Arial;
font-size: 10pt;
}
table
{
border: 1px solid #ccc;
}
table th
{
background-color: #F7F7F7;
color: #333;
font-weight: bold;
}
table th, table td
{
padding: 5px;
border-color: #ccc;
}
.btnclass
{
color: #FFF;
background-color: #0093B2;
display: inline-block;
padding: 6px 12px;
margin-bottom: 0px;
font-size: 14px;
font-weight: 400;
line-height: 1.42857;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
-moz-user-select: none;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
.auto-style8 {
width: 922px;
}
.auto-style9 {
width: 2023px;
}
.auto-style10 {
width: 30%;
height: 89px;
}
.auto-style11 {
width: 30%;
}
.auto-style12 {
width: 3px;
}
.auto-style13 {
width: 93px;
height: 84px;
}
.auto-style14 {
width: 825px;
}
.auto-style15 {
width: 33%;
height: 89px;
}
.auto-style16 {
width: 36%;
height: 89px;
}
.auto-style17 {
width: 52%;
}
.auto-style18 {
width: 119px;
}
.auto-style19 {
width: 562px;
}
.auto-style21 {
height: 84px;
}
.auto-style22 {
height: 84px;
width: 12px;
}
.auto-style23 {
height: 84px;
width: 89px;
}
.auto-style25 {
width: 24%;
}
.auto-style26 {
width: 47%;
height: 89px;
}
</style>
</div>
</body>
</html>
C#:
using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI;
using System.Data.SqlClient;
using System.Net.Mail;
using System.Net;
using System.Threading;
using System.Net.Mime;
using System.Drawing;
using System.Collections.Specialized;
public partial class MarinesPPTR : System.Web.UI.Page
{
string connStr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
DataTable cstable;
// string s = "";
int? pin = null;
int? mTaxYear = null;
string mMarineRegNo = null;
string mVesselRegNo = null;
Decimal mTaxPyrRetdVal = 0;
int? mEquipmentTypeID = null;
Decimal mVesselTaxPyrRetdVal = 0;
DateTime mpDateSold;
Decimal mpSalePrice = 0;
string mpDescr = null;
string mpBuyerFullName = null;
string mpBuyerFirstName = null;
string mpBuyerLastName = null;
string mpBuyerAddress = null;
string mpBuyerCity = null;
string mpBuyerState = null;
string mpBuyerZipCode = null;
DateTime mDateSold;
Decimal mSalePrice = 0;
string mDescription = null;
string mBuyerFullName = null;
string mBuyerFirstName = null;
string mBuyerLastName = null;
string mBuyerAddress = null;
string mBuyerCity = null;
string mBuyerState = null;
string mBuyerZipCode = null;
string mpPreviousOwnerName = null;
string mpPreviousOwnerFirstName = null;
string mpPreviousOwnerLastName = null;
string mpPreviousOwnerAddress = null;
string mpPreviousOwnerCity = null;
string mpPreviousOwnerState = null;
string mpPreviousOwnerZipCode = null;
string mPreviousOwnerName = null;
string mPreviousOwnerFirstName = null;
string mPreviousOwnerLastName = null;
string mPreviousOwnerAddress = null;
string mPreviousOwnerCity = null;
string mPreviousOwnerState = null;
string mPreviousOwnerZipCode = null;
DateTime mpsignDte;
string mpsTitle = null;
string msCounty = null;
string msRegistration_No = null;
string msMotor_MFG_Make = null;
string msBoat_MFG_Make = null;
string msMotor_MFG_Model = null;
string msBoat_MFG_Model = null;
int? msBoat_Year_Built = null;
int? msMotor_Year_Built = null;
string msbLength = null;
string msHullMaterial = null;
string msHorsePower = null;
string msHorsePowerType = null;
DateTime msBoat_DatePurchased;
DateTime msMotor_DatePurchased;
string msBoat_PurchaseType = null;
string msMotor_PurchaseType = null;
Decimal msMotorCost = 0;
Decimal msBoatCost = 0;
DateTime msFileDate;
string msboatIssues = null;
string msmotorIssues = null;
string msboatIssuesDetails = null;
string msmotorIssuesDetails = null;
string mfTypeOfVessel = null;
string mfVesselName = null;
string mfHorspwrTypOfEngine = null;
string mfCoastGuardNo = null;
int? mfYearPurchased = null;
string mfPurchaseType = null;
Decimal mfAmtOfPurchase = 0;
string mfHomePort = null;
string mfWhereDocked = null;
string mfBoat_Motor_Accsry_Equip = null;
string mfvesselLength = null;
int? mfYrVesselBuilt = null;
string mfVHullMaterial = null;
protected void Page_Load(object sender, EventArgs e)
{
signDate.Text = DateTime.Now.ToString(); //automatically display current date on page. This helps with when a taxpayer submits form.
txtfname.Text = Session["passfname"].ToString(); //store taxpayer fullname into session variable to be used around the several pages that need it.
accountnumber.Text = Session["accountNumber"].ToString(); //store account number into session variable to be used around the several pages that need it.
SqlConnection con = new SqlConnection(connStr);
SqlCommand cmd1 = new SqlCommand("SELECT DISTINCT b.citylist FROM [dbo].[BoatMarincePurchaserInfo] b INNER JOIN TaxPayer t ON b.PID=t.PID WHERE b.PID = @pin", con);
con.Open();
cmd1.Parameters.AddWithValue("@pin", Session["accountNumber"].ToString());
SqlDataReader dr = cmd1.ExecuteReader();
if (dr.Read())
{
citylist.SelectedItem.Text = dr["citylist"].ToString();
}
// Populate all states dropdownlist boxes
// First dropdownlist box
SqlCommand fstates = new SqlCommand("Select sID, sName from states ORDER By sName ASC", new SqlConnection(ConfigurationManager.ConnectionStrings["constr"].ConnectionString));
fstates.Connection.Open();
SqlDataReader fstatesValues = default(SqlDataReader);
fstatesValues = fstates.ExecuteReader();
ddlstates.DataSource = fstatesValues;
ddlstates.DataValueField = "sID";
ddlstates.DataTextField = "sName";
ddlstates.DataBind();
fstates.Connection.Close();
//Second dropdownList box
SqlCommand Sstates = new SqlCommand("Select sID, sName from states ORDER By sName ASC", new SqlConnection(ConfigurationManager.ConnectionStrings["constr"].ConnectionString));
Sstates.Connection.Open();
SqlDataReader SstatesValues = default(SqlDataReader);
SstatesValues = Sstates.ExecuteReader();
ddlfillstates.DataSource = SstatesValues;
ddlfillstates.DataValueField = "sID";
ddlfillstates.DataTextField = "sName";
ddlfillstates.DataBind();
Sstates.Connection.Close();
//citylist dropdownlist
SqlCommand clList = new SqlCommand("Select DISTINCT CityName from DekalbCity ORDER By CityName ASC", new SqlConnection(ConfigurationManager.ConnectionStrings["constr"].ConnectionString));
clList.Connection.Open();
SqlDataReader clReader = default(SqlDataReader);
clReader = clList.ExecuteReader();
citylist.DataSource = clReader;
citylist.DataValueField = "CityName";
citylist.DataTextField = "CityName";
citylist.DataBind();
// citylist.Items.Insert(0, new ListItem("Select a city", ""));
clList.Connection.Close();
//We query the DB only once in the Page Load
con = new SqlConnection(ConfigurationManager.ConnectionStrings["constr"].ToString());
string sSQL = "Select sID,sName from states ORDER By sName ASC";
// Response.Write(sSQL);
//Response.End();
SqlCommand cmd3 = new SqlCommand(sSQL, con);
con.Open();
cstable = new DataTable();
cstable.Load(cmd3.ExecuteReader());
if (!Page.IsPostBack)
{
Int32 pid = Int32.Parse(Session["accountNumber"].ToString());
getTaxpayerRecords(pid);
this.getMarineRecs(pid);
//this.getCityList(pid);
this.SetInitialRow();
txtTaxYr.Text = DateTime.Now.Year.ToString();
txtDueDate.Text = "04/01/2017";
}
}
private void getTaxpayerRecords(int pin)
{
SqlConnection conn = new SqlConnection(connStr);
conn.Open();
SqlCommand cmd1 = new SqlCommand("popTaxpayerRecs", conn);
cmd1.CommandType = CommandType.StoredProcedure;
cmd1.Parameters.AddWithValue("@pin", Session["accountNumber"]);
SqlDataReader dr = cmd1.ExecuteReader();
if (dr.Read())
{
txtfname.Text = dr["TaxPayerFullName"].ToString();
txtfaddress.Text = dr["Address"].ToString();
txtfcity.Text = dr["City"].ToString();
ddlstates.SelectedValue = dr["State"].ToString();
txtfzip.Text = dr["Zip"].ToString();
txtOwnerPhone.Text = dr["Phone"].ToString();
}
}
//populate Marine Info with records if exists based on account (pin) number.
private void getMarineRecs(int pin)
{
SqlConnection conn = new SqlConnection(connStr);
SqlCommand cmd = new SqlCommand("uspGetMarineRecs", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter p1 = new SqlParameter("@pin", pin);
cmd.Parameters.Add(p1);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dtPreviousRecords = new DataTable();
sda.Fill(dtPreviousRecords);
if (dtPreviousRecords.Rows.Count > 0)
{
Repeater1.DataSource = dtPreviousRecords;
Repeater1.DataBind();
}
}
//populate form with records if exists based on account (pin) number.
private void getRecs(int pin)
{
SqlConnection conn = new SqlConnection(connStr);
SqlCommand cmd = new SqlCommand("sp_AllRecs", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter p1 = new SqlParameter("@pin", pin);
cmd.Parameters.Add(p1);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dtPreviousRecords = new DataTable();
sda.Fill(dtPreviousRecords);
Repeater1.DataSource = dtPreviousRecords;
Repeater1.DataBind();
Repeater2.DataSource = dtPreviousRecords;
Repeater2.DataBind();
}
//We load the DropDownList in the event
protected void repeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
var ddlPState = (DropDownList)e.Item.FindControl("ddlPrevState");
ddlPState.DataSource = cstable;
ddlPState.DataTextField = "sName";
ddlPState.DataValueField = "sID";
ddlPState.DataBind();
var ddlmPState = (DropDownList)e.Item.FindControl("ddlmPrevState");
ddlmPState.DataSource = cstable;
ddlmPState.DataTextField = "sName";
ddlmPState.DataValueField = "sID";
ddlmPState.DataBind();
var lblBState = (DropDownList)e.Item.FindControl("lblbuyerstate");
lblBState.DataSource = cstable;
lblBState.DataTextField = "sName";
lblBState.DataValueField = "sID";
lblBState.DataBind();
var lblmBState = (DropDownList)e.Item.FindControl("lblmbuyerstate");
lblmBState.DataSource = cstable;
lblmBState.DataTextField = "sName";
lblmBState.DataValueField = "sID";
lblmBState.DataBind();
RadioButtonList rbPurchase = e.Item.FindControl("rblPurchaseType") as RadioButtonList;
foreach (RepeaterItem ReapterItem in Repeater2.Items)
{
var rblType = (DropDownList)e.Item.FindControl("ddlPrevState");
if (rblType.Enabled == false)
{
rblType.CssClass = "disabledcss";
}
else
{
rblType.CssClass = "enabledcss";
}
}
}
protected void rblPurchaseType_SelectedIndexChanged(object sender, EventArgs e)
{
//Find the radiobutton list control
RadioButtonList rdolist = sender as RadioButtonList;
//Find the repeater Item
RepeaterItem item = rdolist.NamingContainer as RepeaterItem;
//Check if radiobuttonlist selected control is "Used"
if ((item != null) && (rdolist.SelectedItem.Text == "Used"))
{
//if so then find the panel control
Panel pnlm = item.FindControl("uPanel") as Panel;
//then enable the panel
pnlm.Enabled = true;
}
else if (rdolist.SelectedItem.Text == "New")
{
//if so then find the panel control
Panel pnlm = item.FindControl("uPanel") as Panel;
//then disable the panel
pnlm.Enabled = false;
}
}
protected void rblmPurchasedType_SelectedIndexChanged(object sender, EventArgs e)
{
//Find the radiobutton list control
RadioButtonList rmdolist = sender as RadioButtonList;
//Find the repeater Item
RepeaterItem Item = rmdolist.NamingContainer as RepeaterItem;
//Check if radiobuttonlist selected control is "Used"
if ((Item != null) && (rmdolist.SelectedItem.Text == "Used"))
{
//if so then find the panel control
Panel pnl2 = Item.FindControl("uPanel3") as Panel;
//then enable the panel
pnl2.Enabled = true;
}
else if (rmdolist.SelectedItem.Text == "New")
{
//if so then find the panel control
Panel pnl2 = Item.FindControl("uPanel3") as Panel;
//then disable the panel
pnl2.Enabled = false;
}
}
protected void rblIssues_SelectedIndexChanged(object sender, EventArgs e)
{
//Find the radiobutton list control
RadioButtonList rdoIssueslist = sender as RadioButtonList;
//Find the repeater Item
RepeaterItem item = rdoIssueslist.NamingContainer as RepeaterItem;
//Check if radiobuttonlist selected control is "Used"
if ((item != null) && (rdoIssueslist.SelectedItem.Text == "Yes"))
{
//if so then find the panel control
Panel pnl = item.FindControl("uPanel1") as Panel;
//then enable the panel
pnl.Enabled = true;
}
else if (rdoIssueslist.SelectedItem.Text == "No")
{
//if so then find the panel control
Panel pnl = item.FindControl("uPanel1") as Panel;
//then disable the panel
pnl.Enabled = false;
}
}
protected void mrblIssues_SelectedIndexChanged(object sender, EventArgs e)
{
//Find the radiobutton list control
RadioButtonList rdlIssueslist = sender as RadioButtonList;
//Find the repeater Item
RepeaterItem Item = rdlIssueslist.NamingContainer as RepeaterItem;
//Check if radiobuttonlist selected control is "Used"
if ((Item != null) && (rdlIssueslist.SelectedItem.Text == "Yes"))
{
//if so then find the panel control
Panel pnl1 = Item.FindControl("uPanel2") as Panel;
//then enable the panel
pnl1.Enabled = true;
}
else if (rdlIssueslist.SelectedItem.Text == "No")
{
//if so then find the panel control
Panel pnl1 = Item.FindControl("uPanel2") as Panel;
//then disable the panel
pnl1.Enabled = false;
}
}
private void SetInitialRow()
{
myMultiView.ActiveViewIndex = 0;
DataTable dt = new DataTable();
DataRow dr = null;
dt.Columns.Add(new DataColumn("ID", typeof(string)));
dt.Columns.Add(new DataColumn("MarineRegNo", typeof(string)));
dt.Columns.Add(new DataColumn("TaxPyrRetdVal", typeof(string)));
dt.Columns.Add(new DataColumn("VesselRegNo", typeof(string)));
dt.Columns.Add(new DataColumn("VesselTaxPyrRetdVal", typeof(string)));
dr = dt.NewRow();
dr["ID"] = 1;
dr["MarineRegNo"] = string.Empty;
dr["TaxPyrRetdVal"] = string.Empty;
dr["VesselRegNo"] = string.Empty;
dr["VesselTaxPyrRetdVal"] = string.Empty;
dt.Rows.Add(dr);
ViewState["CurrTable"] = dt;
Repeater1.DataSource = dt;
Repeater1.DataBind();
}
private void SetInitialRow2(string registerNumber, string bregisterNumber)
{
DataTable dt = new DataTable();
DataRow dr = null;
//Create DataTable columns
dt.Columns.Add(new DataColumn("RowNumber", typeof(string)));
dt.Columns.Add(new DataColumn("boatcnty", typeof(string)));
dt.Columns.Add(new DataColumn("aRegNo", typeof(string)));
dt.Columns.Add(new DataColumn("aMake", typeof(string)));
dt.Columns.Add(new DataColumn("mMake", typeof(string)));
dt.Columns.Add(new DataColumn("ModelNoA", typeof(string)));
dt.Columns.Add(new DataColumn("ModelNoM", typeof(string)));
dt.Columns.Add(new DataColumn("boatYrBuilt", typeof(string)));
dt.Columns.Add(new DataColumn("motorYrBuilt", typeof(string)));
dt.Columns.Add(new DataColumn("blength", typeof(string)));
dt.Columns.Add(new DataColumn("hullmaterial", typeof(string)));
dt.Columns.Add(new DataColumn("mhorsepower", typeof(string)));
dt.Columns.Add(new DataColumn("rdlmhorsepType", typeof(string)));
dt.Columns.Add(new DataColumn("datePurchased", typeof(string)));
dt.Columns.Add(new DataColumn("mdatePurchased", typeof(string)));
dt.Columns.Add(new DataColumn("PurchaseType", typeof(string)));
dt.Columns.Add(new DataColumn("rblmPurchasedType", typeof(string)));
dt.Columns.Add(new DataColumn("txtPrevOnwerName", typeof(string)));
dt.Columns.Add(new DataColumn("prevAddr", typeof(string)));
dt.Columns.Add(new DataColumn("prevCity", typeof(string)));
dt.Columns.Add(new DataColumn("PrevState", typeof(string)));
dt.Columns.Add(new DataColumn("prevzip", typeof(string)));
dt.Columns.Add(new DataColumn("mPrevOnwerName", typeof(string)));
dt.Columns.Add(new DataColumn("mprevAddr", typeof(string)));
dt.Columns.Add(new DataColumn("mprevCity", typeof(string)));
dt.Columns.Add(new DataColumn("mPrevState", typeof(string)));
dt.Columns.Add(new DataColumn("mprevzip", typeof(string)));
dt.Columns.Add(new DataColumn("buyername", typeof(string)));
dt.Columns.Add(new DataColumn("buyeraddress", typeof(string)));
dt.Columns.Add(new DataColumn("buyercity", typeof(string)));
dt.Columns.Add(new DataColumn("buyerstate", typeof(string)));
dt.Columns.Add(new DataColumn("buyerzip", typeof(string)));
dt.Columns.Add(new DataColumn("datesold", typeof(string)));
dt.Columns.Add(new DataColumn("salePrice", typeof(string)));
dt.Columns.Add(new DataColumn("Description", typeof(string)));
dt.Columns.Add(new DataColumn("mbuyername", typeof(string)));
dt.Columns.Add(new DataColumn("mbuyeraddress", typeof(string)));
dt.Columns.Add(new DataColumn("mbuyercity", typeof(string)));
dt.Columns.Add(new DataColumn("mbuyerstate", typeof(string)));
dt.Columns.Add(new DataColumn("mbuyerzip", typeof(string)));
dt.Columns.Add(new DataColumn("mdatesold", typeof(string)));
dt.Columns.Add(new DataColumn("msalePrice", typeof(string)));
dt.Columns.Add(new DataColumn("mDescription", typeof(string)));
dt.Columns.Add(new DataColumn("boatCost", typeof(string)));
dt.Columns.Add(new DataColumn("motorCost", typeof(string)));
dt.Columns.Add(new DataColumn("rblIssues", typeof(string)));
dt.Columns.Add(new DataColumn("functionalIsses", typeof(string)));
dt.Columns.Add(new DataColumn("mrblIssues", typeof(string)));
dt.Columns.Add(new DataColumn("mfunctionalIsses", typeof(string)));
dt.Columns.Add(new DataColumn("vesseltypeUse", typeof(string)));
dt.Columns.Add(new DataColumn("vesselname", typeof(string)));
dt.Columns.Add(new DataColumn("vessellength", typeof(string)));
dt.Columns.Add(new DataColumn("vesselYrBult", typeof(string)));
dt.Columns.Add(new DataColumn("VeseelHullMateria", typeof(string)));
dt.Columns.Add(new DataColumn("vessehorsepEngine", typeof(string)));
dt.Columns.Add(new DataColumn("coastGuardNumber", typeof(string)));
dt.Columns.Add(new DataColumn("VesselYrPurchased", typeof(string)));
dt.Columns.Add(new DataColumn("PurchasedNew", typeof(string)));
dt.Columns.Add(new DataColumn("VesselPurchaseAmt", typeof(string)));
dt.Columns.Add(new DataColumn("homePort", typeof(string)));
dt.Columns.Add(new DataColumn("whereDocked", typeof(string)));
dt.Columns.Add(new DataColumn("bmequipAccessoryList", typeof(string)));
//Create Row for each columns
dr = dt.NewRow();
dr["RowNumber"] = 1;
dr["boatcnty"] = string.Empty;
dr["ARegNo"] = registerNumber;
dr["aMake"] = string.Empty;
dr["mMake"] = string.Empty;
dr["ModelNoA"] = string.Empty;
dr["ModelNoM"] = string.Empty;
dr["boatYrBuilt"] = string.Empty;
dr["motorYrBuilt"] = string.Empty;
dr["blength"] = string.Empty;
dr["hullmaterial"] = string.Empty;
dr["mhorsepower"] = string.Empty;
dr["rdlmhorsepType"] = string.Empty;
dr["datePurchased"] = string.Empty;
dr["mdatePurchased"] = string.Empty;
dr["PurchaseType"] = string.Empty;
dr["rblmPurchasedType"] = string.Empty;
dr["txtPrevOnwerName"] = string.Empty;
dr["prevAddr"] = string.Empty;
dr["prevCity"] = string.Empty;
dr["PrevState"] = string.Empty;
dr["prevzip"] = string.Empty;
dr["mPrevOnwerName"] = string.Empty;
dr["mprevAddr"] = string.Empty;
dr["mprevCity"] = string.Empty;
dr["mPrevState"] = string.Empty;
dr["mprevzip"] = string.Empty;
dr["buyername"] = string.Empty;
dr["buyeraddress"] = string.Empty;
dr["buyercity"] = string.Empty;
dr["buyerstate"] = string.Empty;
dr["buyerzip"] = string.Empty;
dr["datesold"] = string.Empty;
dr["salePrice"] = string.Empty;
dr["Description"] = string.Empty;
dr["mbuyername"] = string.Empty;
dr["mbuyeraddress"] = string.Empty;
dr["mbuyercity"] = string.Empty;
dr["mbuyerstate"] = string.Empty;
dr["mbuyerzip"] = string.Empty;
dr["mdatesold"] = string.Empty;
dr["msalePrice"] = string.Empty;
dr["mDescription"] = string.Empty;
dr["boatCost"] = string.Empty;
dr["motorCost"] = string.Empty;
dr["rblIssues"] = string.Empty;
dr["functionalIsses"] = string.Empty;
dr["mrblIssues"] = string.Empty;
dr["mfunctionalIsses"] = string.Empty;
dr["vesseltypeUse"] = string.Empty;
dr["vesselname"] = string.Empty;
dr["vessellength"] = string.Empty;
dr["vesselYrBult"] = string.Empty;
dr["VeseelHullMateria"] = string.Empty;
dr["vessehorsepEngine"] = string.Empty;
dr["coastGuardNumber"] = bregisterNumber;
dr["VesselYrPurchased"] = string.Empty;
dr["PurchasedNew"] = string.Empty;
dr["VesselPurchaseAmt"] = string.Empty;
dr["homePort"] = string.Empty;
dr["whereDocked"] = string.Empty;
dr["bmequipAccessoryList"] = string.Empty;
dt.Rows.Add(dr);
//Store the DataTable in ViewState for future reference
ViewState["CurrentTable"] = dt;
//Bind the Repeater with the DataTable
Repeater2.DataSource = dt;
Repeater2.DataBind();
}
private void AddNewRow2(string registerNumber, string bregisterNumber)
{
int rowIndex = 0;
if (ViewState["CurrentTable"] != null)
{
DataTable dtCurrentTable = (DataTable)ViewState["CurrentTable"];
DataRow drCurrentRow = null;
if (dtCurrentTable.Rows.Count > 0)
{
for (int i = 1; i <= dtCurrentTable.Rows.Count; i++)
{
//extract the TextBox values
TextBox tbaircnty = (TextBox)Repeater2.Items[rowIndex].FindControl("aircraftcnty");
TextBox tbTextBox2 = (TextBox)Repeater2.Items[rowIndex].FindControl("aRegNo");
TextBox tbaMake = (TextBox)Repeater2.Items[rowIndex].FindControl("aMake");
TextBox tbmMake = (TextBox)Repeater2.Items[rowIndex].FindControl("mMake");
TextBox tbaModelNo = (TextBox)Repeater2.Items[rowIndex].FindControl("aModelNo");
TextBox tbmModelNo = (TextBox)Repeater2.Items[rowIndex].FindControl("mModelNo");
TextBox tbboatYrBuilt = (TextBox)Repeater2.Items[rowIndex].FindControl("boatYrBuilt");
TextBox tbmotorYrBuilt = (TextBox)Repeater2.Items[rowIndex].FindControl("motorYrBuilt");
TextBox tbblength = (TextBox)Repeater2.Items[rowIndex].FindControl("blength");
TextBox tbhullmaterial = (TextBox)Repeater2.Items[rowIndex].FindControl("hullmaterial");
TextBox tbmhorsepower = (TextBox)Repeater2.Items[rowIndex].FindControl("mhorsepower");
RadioButtonList tbrdlmhorsepType = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("rdlmhorsepType");
TextBox tbdatePurchased = (TextBox)Repeater2.Items[rowIndex].FindControl("txtdatePurchased");
TextBox tbrbmdatePurchased = (TextBox)Repeater2.Items[rowIndex].FindControl("mdatePurchased");
RadioButtonList tbPurchaseType = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("rblPurchaseType");
RadioButtonList tbrblmPurchasedType = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("rblmPurchasedType");
TextBox tbPrevOnwerName = (TextBox)Repeater2.Items[rowIndex].FindControl("txtPrevOnwerName");
TextBox tbprevAddr = (TextBox)Repeater2.Items[rowIndex].FindControl("txtprevAddr");
TextBox tbprevCity = (TextBox)Repeater2.Items[rowIndex].FindControl("txtprevCity");
DropDownList tbPrevState = (DropDownList)Repeater2.Items[rowIndex].FindControl("ddlPrevState");
TextBox tbprevzip = (TextBox)Repeater2.Items[rowIndex].FindControl("txtprevzip");
TextBox tbmPrevOnwerNam = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmPrevOnwerName");
DropDownList tbmPrevState = (DropDownList)Repeater2.Items[rowIndex].FindControl("ddlmPrevState");
TextBox tbmprevAddr = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmprevAddr");
TextBox tbmprevCity = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmprevCity");
TextBox tbmprevzip = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmprevzip");
TextBox tbbuyername = (TextBox)Repeater2.Items[rowIndex].FindControl("txtbuyername");
TextBox tbbuyeraddress = (TextBox)Repeater2.Items[rowIndex].FindControl("txtbuyeraddress");
TextBox tbbuyercity = (TextBox)Repeater2.Items[rowIndex].FindControl("txtbuyercity");
DropDownList tbbuyerstate = (DropDownList)Repeater2.Items[rowIndex].FindControl("lblbuyerstate");
TextBox tbbuyerzip = (TextBox)Repeater2.Items[rowIndex].FindControl("txtbuyerzip");
TextBox txtdatesold = (TextBox)Repeater2.Items[rowIndex].FindControl("txtdatesold");
TextBox tbsalePrice = (TextBox)Repeater2.Items[rowIndex].FindControl("txtsalePrice");
TextBox tbDescription = (TextBox)Repeater2.Items[rowIndex].FindControl("txtDescription");
TextBox tbmbuyername = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmbuyername");
TextBox tbmbuyeraddress = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmbuyeraddress");
TextBox tbmbuyercity = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmbuyercity");
DropDownList tbmbuyerstate = (DropDownList)Repeater2.Items[rowIndex].FindControl("lblmbuyerstate");
TextBox tbmbuyerzip = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmbuyerzip");
TextBox tbmdatesold = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmdatesold");
TextBox tbmsalePrice = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmsalePrice");
TextBox tbmDescription = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmDescription");
TextBox tbboatCost = (TextBox)Repeater2.Items[rowIndex].FindControl("boatCost");
TextBox tbmotorCost = (TextBox)Repeater2.Items[rowIndex].FindControl("motorCost");
RadioButtonList tbrblIssues = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("rblIssues");
TextBox tbfunctionalIsses = (TextBox)Repeater2.Items[rowIndex].FindControl("functionalIsses");
RadioButtonList tbmrblIssues = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("mrblIssues");
TextBox tbmfunctionalIsses = (TextBox)Repeater2.Items[rowIndex].FindControl("mfunctionalIsses");
TextBox tbvesseltypeUse = (TextBox)Repeater2.Items[rowIndex].FindControl("txtvesseltypeUse");
TextBox tbvesselname = (TextBox)Repeater2.Items[rowIndex].FindControl("txtvesselname");
TextBox tbvessellength = (TextBox)Repeater2.Items[rowIndex].FindControl("txtvessellength");
TextBox tbvesselYrBult = (TextBox)Repeater2.Items[rowIndex].FindControl("txtvesselYrBult");
TextBox tbVeseelHullMateria = (TextBox)Repeater2.Items[rowIndex].FindControl("txtVeseelHullMateria");
TextBox tbvessehorsepEngine = (TextBox)Repeater2.Items[rowIndex].FindControl("vessehorsepEngine");
TextBox tbcoastGuardNumber = (TextBox)Repeater2.Items[rowIndex].FindControl("coastGuardNumber");
TextBox tbVesselYrPurchased = (TextBox)Repeater2.Items[rowIndex].FindControl("txtVesselYrPurchased");
RadioButtonList tbPurchasedNew = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("rblVPurchasedNew");
TextBox tbVesselPurchaseAmt = (TextBox)Repeater2.Items[rowIndex].FindControl("VesselPurchaseAmt");
TextBox tbhomePort = (TextBox)Repeater2.Items[rowIndex].FindControl("txthomePort");
TextBox tbwhereDocked = (TextBox)Repeater2.Items[rowIndex].FindControl("txtwhereDocked");
TextBox tbmequipAccessoryList = (TextBox)Repeater2.Items[rowIndex].FindControl("bmequipAccessoryList");
//Create new row in DataTable and set its values
drCurrentRow = dtCurrentTable.NewRow();
drCurrentRow["RowNumber"] = i + 1;
dtCurrentTable.Rows[i - 1]["boatcnty"] = tbaircnty.Text;
dtCurrentTable.Rows[i - 1]["aRegNo"] = tbTextBox2.Text;
dtCurrentTable.Rows[i - 1]["aMake"] = tbaMake.Text;
dtCurrentTable.Rows[i - 1]["mMake"] = tbmMake.Text;
dtCurrentTable.Rows[i - 1]["ModelNoA"] = tbaModelNo.Text;
dtCurrentTable.Rows[i - 1]["ModelNoM"] = tbmModelNo.Text;
dtCurrentTable.Rows[i - 1]["boatYrBuilt"] = tbboatYrBuilt.Text;
dtCurrentTable.Rows[i - 1]["motorYrBuilt"] = tbmotorYrBuilt.Text;
dtCurrentTable.Rows[i - 1]["blength"] = tbblength.Text;
dtCurrentTable.Rows[i - 1]["bhullmaterial"] = tbhullmaterial.Text;
dtCurrentTable.Rows[i - 1]["mhorsepower"] = tbmhorsepower.Text;
dtCurrentTable.Rows[i - 1]["rdlmhorsepType"] = tbrdlmhorsepType.Text;
dtCurrentTable.Rows[i - 1]["datePurchased"] = tbdatePurchased.Text;
dtCurrentTable.Rows[i - 1]["mdatePurchased"] = tbrbmdatePurchased.Text;
dtCurrentTable.Rows[i - 1]["PurchaseType"] = tbPurchaseType.Text;
dtCurrentTable.Rows[i - 1]["rblmPurchasedType"] = tbrblmPurchasedType.Text;
dtCurrentTable.Rows[i - 1]["txtPrevOnwerName"] = tbPrevOnwerName.Text;
dtCurrentTable.Rows[i - 1]["prevAddr"] = tbprevAddr.Text;
dtCurrentTable.Rows[i - 1]["prevCity"] = tbprevCity.Text;
dtCurrentTable.Rows[i - 1]["PrevState"] = tbPrevState.Text;
dtCurrentTable.Rows[i - 1]["prevzip"] = tbprevzip.Text;
dtCurrentTable.Rows[i - 1]["PrevOnwerName"] = tbmPrevOnwerNam.Text;
dtCurrentTable.Rows[i - 1]["mprevAddr"] = tbmprevAddr.Text;
dtCurrentTable.Rows[i - 1]["mprevCity"] = tbmprevCity.Text;
dtCurrentTable.Rows[i - 1]["mPrevState"] = tbmPrevState.Text;
dtCurrentTable.Rows[i - 1]["mprevzip"] = tbmprevzip.Text;
dtCurrentTable.Rows[i - 1]["buyername"] = tbbuyername.Text;
dtCurrentTable.Rows[i - 1]["buyeraddress"] = tbbuyeraddress.Text;
dtCurrentTable.Rows[i - 1]["buyercity"] = tbbuyercity.Text;
dtCurrentTable.Rows[i - 1]["buyerstate"] = tbbuyerstate.Text;
dtCurrentTable.Rows[i - 1]["buyerzip"] = tbbuyerzip.Text;
dtCurrentTable.Rows[i - 1]["datesold"] = txtdatesold.Text;
dtCurrentTable.Rows[i - 1]["salePrice"] = tbsalePrice.Text;
dtCurrentTable.Rows[i - 1]["Description"] = tbDescription.Text;
dtCurrentTable.Rows[i - 1]["mbuyername"] = tbmbuyername.Text;
dtCurrentTable.Rows[i - 1]["mbuyeraddress"] = tbmbuyeraddress.Text;
dtCurrentTable.Rows[i - 1]["mbuyercity"] = tbmbuyercity.Text;
dtCurrentTable.Rows[i - 1]["mbuyerstate"] = tbmbuyerstate.Text;
dtCurrentTable.Rows[i - 1]["mbuyerzip"] = tbmbuyerzip.Text;
dtCurrentTable.Rows[i - 1]["mdatesold"] = tbmdatesold.Text;
dtCurrentTable.Rows[i - 1]["msalePrice"] = tbmsalePrice.Text;
dtCurrentTable.Rows[i - 1]["mDescription"] = tbmDescription.Text;
dtCurrentTable.Rows[i - 1]["boatCost"] = tbboatCost.Text;
dtCurrentTable.Rows[i - 1]["motorCost"] = tbmotorCost.Text;
dtCurrentTable.Rows[i - 1]["rblIssues"] = tbrblIssues.Text;
dtCurrentTable.Rows[i - 1]["functionalIsses"] = tbfunctionalIsses.Text;
dtCurrentTable.Rows[i - 1]["mrblIssues"] = tbmrblIssues.Text;
dtCurrentTable.Rows[i - 1]["mfunctionalIsses"] = tbmfunctionalIsses.Text;
dtCurrentTable.Rows[i - 1]["vesseltypeUse"] = tbvesseltypeUse.Text;
dtCurrentTable.Rows[i - 1]["vesselname"] = tbvesselname.Text;
dtCurrentTable.Rows[i - 1]["vessellength"] = tbvessellength.Text;
dtCurrentTable.Rows[i - 1]["vesselYrBult"] = tbvesselYrBult.Text;
dtCurrentTable.Rows[i - 1]["VeseelHullMateria"] = tbVeseelHullMateria.Text;
dtCurrentTable.Rows[i - 1]["vessehorsepEngine"] = tbvessehorsepEngine.Text;
dtCurrentTable.Rows[i - 1]["coastGuardNumber"] = tbcoastGuardNumber.Text;
dtCurrentTable.Rows[i - 1]["VesselYrPurchased"] = tbVesselYrPurchased.Text;
dtCurrentTable.Rows[i - 1]["PurchasedNew"] = tbPurchasedNew.Text;
dtCurrentTable.Rows[i - 1]["VesselPurchaseAmt"] = tbVesselPurchaseAmt.Text;
dtCurrentTable.Rows[i - 1]["homePort"] = tbhomePort.Text;
dtCurrentTable.Rows[i - 1]["whereDocked"] = tbwhereDocked.Text;
dtCurrentTable.Rows[i - 1]["bmequipAccessoryList"] = tbmequipAccessoryList.Text;
rowIndex++;
}
//add the new row to the current DataTable
dtCurrentTable.Rows.Add(drCurrentRow);
//store the current DataTable in ViewState
ViewState["CurrentTable"] = dtCurrentTable;
//rebind the Repeater with the updated DataTable
Repeater2.DataSource = dtCurrentTable;
Repeater2.DataBind();
}
}
else
{
Response.Write("ViewState is null");
}
//Set Previous Data on Postbacks
SetPreviousData2(registerNumber,bregisterNumber);
}
private void SetPreviousData2(string registerNumber, string bregisterNumber)
{
int rowIndex = 0;
if (ViewState["CurrentTable"] != null)
{
DataTable dt = (DataTable)ViewState["CurrentTable"];
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
//extract the TextBox values
TextBox tbaircnty = (TextBox)Repeater2.Items[rowIndex].FindControl("aircraftcnty");
TextBox tbTextBox2 = (TextBox)Repeater2.Items[rowIndex].FindControl("aRegNo");
TextBox tbaMake = (TextBox)Repeater2.Items[rowIndex].FindControl("aMake");
TextBox tbmMake = (TextBox)Repeater2.Items[rowIndex].FindControl("mMake");
TextBox tbaModelNo = (TextBox)Repeater2.Items[rowIndex].FindControl("aModelNo");
TextBox tbmModelNo = (TextBox)Repeater2.Items[rowIndex].FindControl("mModelNo");
TextBox tbboatYrBuilt = (TextBox)Repeater2.Items[rowIndex].FindControl("boatYrBuilt");
TextBox tbmotorYrBuilt = (TextBox)Repeater2.Items[rowIndex].FindControl("motorYrBuilt");
TextBox tbblength = (TextBox)Repeater2.Items[rowIndex].FindControl("blength");
TextBox tbhullmaterial = (TextBox)Repeater2.Items[rowIndex].FindControl("hullmaterial");
TextBox tbmhorsepower = (TextBox)Repeater2.Items[rowIndex].FindControl("mhorsepower");
RadioButtonList rblhoreslist = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("rdlmhorsepType");
TextBox tbdatePurchased = (TextBox)Repeater2.Items[rowIndex].FindControl("txtdatePurchased");
TextBox tbrbmdatePurchased = (TextBox)Repeater2.Items[rowIndex].FindControl("mdatePurchased");
RadioButtonList rbltypelist = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("rblPurchaseType");
RadioButtonList rblpurchasedlist = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("rblmPurchasedType");
TextBox tbPrevOnwerName = (TextBox)Repeater2.Items[rowIndex].FindControl("txtPrevOnwerName");
TextBox tbprevAddr = (TextBox)Repeater2.Items[rowIndex].FindControl("txtprevAddr");
TextBox tbprevCity = (TextBox)Repeater2.Items[rowIndex].FindControl("txtprevCity");
DropDownList tbPrevState = (DropDownList)Repeater2.Items[rowIndex].FindControl("ddlPrevState");
TextBox tbprevzip = (TextBox)Repeater2.Items[rowIndex].FindControl("txtprevzip");
TextBox tbmPrevOnwerName = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmPrevOnwerName");
TextBox tbmprevAddr = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmprevAddr");
TextBox tbmprevCity = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmprevCity");
DropDownList tbmPrevState = (DropDownList)Repeater2.Items[rowIndex].FindControl("ddlmPrevState");
TextBox tbmprevzip = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmprevzip");
TextBox tbbuyername = (TextBox)Repeater2.Items[rowIndex].FindControl("txtbuyername");
TextBox tbbuyeraddress = (TextBox)Repeater2.Items[rowIndex].FindControl("txtbuyeraddress");
TextBox tbbuyercity = (TextBox)Repeater2.Items[rowIndex].FindControl("txtbuyercity");
DropDownList tbbuyerstate = (DropDownList)Repeater2.Items[rowIndex].FindControl("lblbuyerstate");
TextBox tbbuyerzip = (TextBox)Repeater2.Items[rowIndex].FindControl("txtbuyerzip");
TextBox txtdatesold = (TextBox)Repeater2.Items[rowIndex].FindControl("txtdatesold");
TextBox tbsalePrice = (TextBox)Repeater2.Items[rowIndex].FindControl("txtsalePrice");
TextBox tbDescription = (TextBox)Repeater2.Items[rowIndex].FindControl("txtDescription");
TextBox tbmbuyername = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmbuyername");
TextBox tbmbuyeraddress = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmbuyeraddress");
TextBox tbmbuyercity = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmbuyercity");
DropDownList tbmbuyerstate = (DropDownList)Repeater2.Items[rowIndex].FindControl("lblmbuyerstate");
TextBox tbmbuyerzip = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmbuyerzip");
TextBox tbmdatesold = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmdatesold");
TextBox tbmsalePrice = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmsalePrice");
TextBox tbmDescription = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmDescription");
TextBox tbboatCost = (TextBox)Repeater2.Items[rowIndex].FindControl("boatCost");
TextBox tbmotorCost = (TextBox)Repeater2.Items[rowIndex].FindControl("motorCost");
RadioButtonList rbllist1 = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("rblIssues");
TextBox tbfunctionalIsses = (TextBox)Repeater2.Items[rowIndex].FindControl("functionalIsses");
RadioButtonList rbllist2 = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("mrblIssues");
TextBox tbmfunctionalIsses = (TextBox)Repeater2.Items[rowIndex].FindControl("mfunctionalIsses");
TextBox tbvesseltypeUse = (TextBox)Repeater2.Items[rowIndex].FindControl("txtvesseltypeUse");
TextBox tbvesselname = (TextBox)Repeater2.Items[rowIndex].FindControl("txtvesselname");
TextBox tbvessellength = (TextBox)Repeater2.Items[rowIndex].FindControl("txtvessellength");
TextBox tbvesselYrBult = (TextBox)Repeater2.Items[rowIndex].FindControl("txtvesselYrBult");
TextBox tbVeseelHullMateria = (TextBox)Repeater2.Items[rowIndex].FindControl("txtVeseelHullMateria");
TextBox tbvessehorsepEngine = (TextBox)Repeater2.Items[rowIndex].FindControl("vessehorsepEngine");
TextBox tbcoastGuardNumber = (TextBox)Repeater2.Items[rowIndex].FindControl("coastGuardNumber");
TextBox txtVesselYrPurchased = (TextBox)Repeater2.Items[rowIndex].FindControl("txtVesselYrPurchased");
RadioButtonList PurchasedNew = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("rblVPurchasedNew");
TextBox tbVesselPurchaseAmt = (TextBox)Repeater2.Items[rowIndex].FindControl("VesselPurchaseAmt");
TextBox tbtxthomePort = (TextBox)Repeater2.Items[rowIndex].FindControl("txthomePort");
TextBox tbtxtwhereDocked = (TextBox)Repeater2.Items[rowIndex].FindControl("txtwhereDocked");
TextBox tbbmequipAccessoryList = (TextBox)Repeater2.Items[rowIndex].FindControl("bmequipAccessoryList");
tbaircnty.Text = dt.Rows[i]["boatcnty"].ToString();
tbTextBox2.Text = dt.Rows[i]["aRegNo"].ToString();
tbaMake.Text = dt.Rows[i]["aMake"].ToString();
tbmMake.Text = dt.Rows[i]["mMake"].ToString();
tbaModelNo.Text = dt.Rows[i]["ModelNoA"].ToString();
tbmModelNo.Text = dt.Rows[i]["ModelNoM"].ToString();
tbboatYrBuilt.Text = dt.Rows[i]["boatYrBuilt"].ToString();
tbmotorYrBuilt.Text = dt.Rows[i]["motorYrBuilt"].ToString();
tbblength.Text = dt.Rows[i]["blength"].ToString();
tbhullmaterial.Text = dt.Rows[i]["bhullmaterial"].ToString();
tbmhorsepower.Text = dt.Rows[i]["mhorsepower"].ToString();
//account for null values to prevent errors.
if (!string.IsNullOrEmpty(dt.Rows[i]["rdlmhorsepType"].ToString()))
{
rblhoreslist.Items.FindByText(dt.Rows[i]["rblhoreslist"].ToString()).Selected = true;
}
tbdatePurchased.Text = dt.Rows[i]["datePurchased"].ToString();
tbrbmdatePurchased.Text = dt.Rows[i]["mdatePurchased"].ToString();
if (!string.IsNullOrEmpty(dt.Rows[i]["PurchaseType"].ToString()))
{
rbltypelist.Items.FindByText(dt.Rows[i]["PurchaseType"].ToString()).Selected = true;
}
if (!string.IsNullOrEmpty(dt.Rows[i]["rblmPurchasedType"].ToString()))
{
rblpurchasedlist.Items.FindByText(dt.Rows[i]["rblmPurchasedType"].ToString()).Selected = true;
}
tbPrevOnwerName.Text = dt.Rows[i]["PrevOnwerName"].ToString();
tbprevAddr.Text = dt.Rows[i]["prevAddr"].ToString();
tbprevCity.Text = dt.Rows[i]["prevCity"].ToString();
tbPrevState.Text = dt.Rows[i]["PrevState"].ToString();
tbprevzip.Text = dt.Rows[i]["prevzip"].ToString();
tbmPrevOnwerName.Text = dt.Rows[i]["mPrevOnwerName"].ToString();
tbmprevAddr.Text = dt.Rows[i]["mprevAddr"].ToString();
tbmprevCity.Text = dt.Rows[i]["mprevCity"].ToString();
tbmprevzip.Text = dt.Rows[i]["mprevzip"].ToString();
tbbuyername.Text = dt.Rows[i]["buyername"].ToString();
tbbuyeraddress.Text = dt.Rows[i]["buyeraddress"].ToString();
tbbuyercity.Text = dt.Rows[i]["buyercity"].ToString();
tbbuyerstate.Text = dt.Rows[i]["buyerstate"].ToString();
tbbuyerzip.Text = dt.Rows[i]["buyerzip"].ToString();
txtdatesold.Text = dt.Rows[i]["datesold"].ToString();
tbsalePrice.Text = dt.Rows[i]["salePrice"].ToString();
tbDescription.Text = dt.Rows[i]["Description"].ToString();
tbmbuyername.Text = dt.Rows[i]["mbuyername"].ToString();
tbmbuyeraddress.Text = dt.Rows[i]["mbuyeraddress"].ToString();
tbmbuyerstate.Text = dt.Rows[i]["mbuyerstate"].ToString();
tbmbuyerzip.Text = dt.Rows[i]["mbuyerzip"].ToString();
tbmdatesold.Text = dt.Rows[i]["mdatesold"].ToString();
tbmsalePrice.Text = dt.Rows[i]["msalePrice"].ToString();
tbmDescription.Text = dt.Rows[i]["mDescription"].ToString();
tbboatCost.Text = dt.Rows[i]["boatCost"].ToString();
tbmotorCost.Text = dt.Rows[i]["motorCost"].ToString();
if (!string.IsNullOrEmpty(dt.Rows[i]["rblIssues"].ToString()))
{
rbllist1.Items.FindByText(dt.Rows[i]["rblIssues"].ToString()).Selected = true;
}
tbfunctionalIsses.Text = dt.Rows[i]["functionalIsses"].ToString();
if (!string.IsNullOrEmpty(dt.Rows[i]["mrblIssues"].ToString()))
{
rbllist2.Items.FindByText(dt.Rows[i]["mrblIssues"].ToString()).Selected = true;
}
tbmfunctionalIsses.Text = dt.Rows[i]["mfunctionalIsses"].ToString();
tbvesseltypeUse.Text = dt.Rows[i]["vesseltypeUse"].ToString();
tbvesselname.Text = dt.Rows[i]["vesselname"].ToString();
tbvessellength.Text = dt.Rows[i]["vessellength"].ToString();
tbvesselYrBult.Text = dt.Rows[i]["vesselYrBult"].ToString();
tbVeseelHullMateria.Text = dt.Rows[i]["VeseelHullMateria"].ToString();
tbvessehorsepEngine.Text = dt.Rows[i]["vessehorsepEngine"].ToString();
tbcoastGuardNumber.Text = dt.Rows[i]["coastGuardNumber"].ToString();
txtVesselYrPurchased.Text = dt.Rows[i]["VesselYrPurchased"].ToString();
if (!string.IsNullOrEmpty(dt.Rows[i]["PurchasedNew"].ToString()))
{
PurchasedNew.Items.FindByText(dt.Rows[i]["PurchasedNew"].ToString()).Selected = true;
}
tbVesselPurchaseAmt.Text = dt.Rows[i]["VesselPurchaseAmt"].ToString();
tbtxthomePort.Text = dt.Rows[i]["homePort"].ToString();
tbtxtwhereDocked.Text = dt.Rows[i]["whereDocked"].ToString();
tbbmequipAccessoryList.Text = dt.Rows[i]["bmequipAccessoryList"].ToString();
if (dt.Rows.Count - 1 == i)
{
tbTextBox2.Text = registerNumber;
tbcoastGuardNumber.Text = bregisterNumber;
}
rowIndex++;
}
}
}
}
private void SetRowData()
{
int rowIndex = 0;
if (ViewState["CurrTable"] != null)
{
DataTable dtCurrentTable = (DataTable)ViewState["CurrTable"];
DataRow drCurrentRow = null;
if (dtCurrentTable.Rows.Count > 0)
{
for (int i = 1; i <= dtCurrentTable.Rows.Count; i++)
{
TextBox tbboatregNum = (TextBox)Repeater1.Items[rowIndex].FindControl("txtboatregNum");
TextBox tbPayerret = (TextBox)Repeater1.Items[rowIndex].FindControl("txtPayerret");
TextBox tbCGvesselNum = (TextBox)Repeater1.Items[rowIndex].FindControl("cgaurdNumber");
TextBox tbCGtaxpayerret = (TextBox)Repeater1.Items[rowIndex].FindControl("cguardreturnedval");
drCurrentRow = dtCurrentTable.NewRow();
drCurrentRow["ID"] = i + 1;
dtCurrentTable.Rows[i - 1]["MarineRegNo"] = tbboatregNum.Text;
dtCurrentTable.Rows[i - 1]["TaxPyrRetdVal"] = tbPayerret.Text;
dtCurrentTable.Rows[i - 1]["VesselRegNo"] = tbCGvesselNum.Text;
dtCurrentTable.Rows[i - 1]["VesselTaxPyrRetdVal"] = tbCGtaxpayerret.Text;
rowIndex++;
}
ViewState["CurrTable"] = dtCurrentTable;
}
}
else
{
Response.Write("ViewState is null");
}
}
private void SetRowData2()
{
int rowIndex = 0;
if (ViewState["CurrentTable"] != null)
{
DataTable dtCurrentTable = (DataTable)ViewState["CurrentTable"];
DataRow drCurrentRow = null;
if (dtCurrentTable.Rows.Count > 0)
{
for (int i = 1; i <= dtCurrentTable.Rows.Count; i++)
{
//extract the TextBox values
TextBox tbaircnty = (TextBox)Repeater2.Items[rowIndex].FindControl("aircraftcnty");
TextBox tbTextBox2 = (TextBox)Repeater2.Items[rowIndex].FindControl("aRegNo");
TextBox tbaMake = (TextBox)Repeater2.Items[rowIndex].FindControl("aMake");
TextBox tbmMake = (TextBox)Repeater2.Items[rowIndex].FindControl("mMake");
TextBox tbaModelNo = (TextBox)Repeater2.Items[rowIndex].FindControl("aModelNo");
TextBox tbmModelNo = (TextBox)Repeater2.Items[rowIndex].FindControl("mModelNo");
TextBox tbboatYrBuilt = (TextBox)Repeater2.Items[rowIndex].FindControl("boatYrBuilt");
TextBox tbmotorYrBuilt = (TextBox)Repeater2.Items[rowIndex].FindControl("motorYrBuilt");
TextBox tbblength = (TextBox)Repeater2.Items[rowIndex].FindControl("blength");
TextBox tbhullmaterial = (TextBox)Repeater2.Items[rowIndex].FindControl("hullmaterial");
TextBox tbmhorsepower = (TextBox)Repeater2.Items[rowIndex].FindControl("mhorsepower");
RadioButtonList tbrdlmhorsepType = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("rdlmhorsepType");
TextBox tbdatePurchased = (TextBox)Repeater2.Items[rowIndex].FindControl("txtdatePurchased");
TextBox tbrbmdatePurchased = (TextBox)Repeater2.Items[rowIndex].FindControl("mdatePurchased");
RadioButtonList tbPurchaseType = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("rblPurchaseType");
RadioButtonList tbrblmPurchasedType = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("rblmPurchasedType");
TextBox tbPrevOnwerName = (TextBox)Repeater2.Items[rowIndex].FindControl("txtPrevOnwerName");
TextBox tbprevAddr = (TextBox)Repeater2.Items[rowIndex].FindControl("txtprevAddr");
TextBox tbprevCity = (TextBox)Repeater2.Items[rowIndex].FindControl("txtprevCity");
DropDownList tbPrevState = (DropDownList)Repeater2.Items[rowIndex].FindControl("ddlPrevState");
TextBox tbprevzip = (TextBox)Repeater2.Items[rowIndex].FindControl("txtprevzip");
TextBox tbmPrevOnwerNam = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmPrevOnwerName");
DropDownList tbmPrevState = (DropDownList)Repeater2.Items[rowIndex].FindControl("ddlmPrevState");
TextBox tbmprevAddr = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmprevAddr");
TextBox tbmprevCity = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmprevCity");
TextBox tbmprevzip = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmprevzip");
TextBox tbbuyername = (TextBox)Repeater2.Items[rowIndex].FindControl("txtbuyername");
TextBox tbbuyeraddress = (TextBox)Repeater2.Items[rowIndex].FindControl("txtbuyeraddress");
TextBox tbbuyercity = (TextBox)Repeater2.Items[rowIndex].FindControl("txtbuyercity");
DropDownList tbbuyerstate = (DropDownList)Repeater2.Items[rowIndex].FindControl("lblbuyerstate");
TextBox tbbuyerzip = (TextBox)Repeater2.Items[rowIndex].FindControl("txtbuyerzip");
TextBox txtdatesold = (TextBox)Repeater2.Items[rowIndex].FindControl("txtdatesold");
TextBox tbsalePrice = (TextBox)Repeater2.Items[rowIndex].FindControl("txtsalePrice");
TextBox tbDescription = (TextBox)Repeater2.Items[rowIndex].FindControl("txtDescription");
TextBox tbmbuyername = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmbuyername");
TextBox tbmbuyeraddress = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmbuyeraddress");
TextBox tbmbuyercity = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmbuyercity");
DropDownList tbmbuyerstate = (DropDownList)Repeater2.Items[rowIndex].FindControl("lblmbuyerstate");
TextBox tbmbuyerzip = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmbuyerzip");
TextBox tbmdatesold = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmdatesold");
TextBox tbmsalePrice = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmsalePrice");
TextBox tbmDescription = (TextBox)Repeater2.Items[rowIndex].FindControl("txtmDescription");
TextBox tbboatCost = (TextBox)Repeater2.Items[rowIndex].FindControl("boatCost");
TextBox tbmotorCost = (TextBox)Repeater2.Items[rowIndex].FindControl("motorCost");
RadioButtonList tbrblIssues = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("rblIssues");
TextBox tbfunctionalIsses = (TextBox)Repeater2.Items[rowIndex].FindControl("functionalIsses");
RadioButtonList tbmrblIssues = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("mrblIssues");
TextBox tbmfunctionalIsses = (TextBox)Repeater2.Items[rowIndex].FindControl("mfunctionalIsses");
TextBox tbvesseltypeUse = (TextBox)Repeater2.Items[rowIndex].FindControl("txtvesseltypeUse");
TextBox tbvesselname = (TextBox)Repeater2.Items[rowIndex].FindControl("txtvesselname");
TextBox tbvessellength = (TextBox)Repeater2.Items[rowIndex].FindControl("txtvessellength");
TextBox tbvesselYrBult = (TextBox)Repeater2.Items[rowIndex].FindControl("txtvesselYrBult");
TextBox tbVeseelHullMateria = (TextBox)Repeater2.Items[rowIndex].FindControl("txtVeseelHullMateria");
TextBox tbvessehorsepEngine = (TextBox)Repeater2.Items[rowIndex].FindControl("vessehorsepEngine");
TextBox tbcoastGuardNumber = (TextBox)Repeater2.Items[rowIndex].FindControl("coastGuardNumber");
TextBox tbVesselYrPurchased = (TextBox)Repeater2.Items[rowIndex].FindControl("txtVesselYrPurchased");
RadioButtonList tbPurchasedNew = (RadioButtonList)Repeater2.Items[rowIndex].FindControl("rblVPurchasedNew");
TextBox tbVesselPurchaseAmt = (TextBox)Repeater2.Items[rowIndex].FindControl("VesselPurchaseAmt");
TextBox tbhomePort = (TextBox)Repeater2.Items[rowIndex].FindControl("txthomePort");
TextBox tbwhereDocked = (TextBox)Repeater2.Items[rowIndex].FindControl("txtwhereDocked");
TextBox tbmequipAccessoryList = (TextBox)Repeater2.Items[rowIndex].FindControl("bmequipAccessoryList");
//Create new row in DataTable and set its values
drCurrentRow = dtCurrentTable.NewRow();
drCurrentRow["RowNumber"] = i + 1;
dtCurrentTable.Rows[i - 1]["boatcnty"] = tbaircnty.Text;
dtCurrentTable.Rows[i - 1]["aRegNo"] = tbTextBox2.Text;
dtCurrentTable.Rows[i - 1]["aMake"] = tbaMake.Text;
dtCurrentTable.Rows[i - 1]["mMake"] = tbmMake.Text;
dtCurrentTable.Rows[i - 1]["ModelNoA"] = tbaModelNo.Text;
dtCurrentTable.Rows[i - 1]["ModelNoM"] = tbmModelNo.Text;
dtCurrentTable.Rows[i - 1]["boatYrBuilt"] = tbboatYrBuilt.Text;
dtCurrentTable.Rows[i - 1]["motorYrBuilt"] = tbmotorYrBuilt.Text;
dtCurrentTable.Rows[i - 1]["blength"] = tbblength.Text;
dtCurrentTable.Rows[i - 1]["hullmaterial"] = tbhullmaterial.Text;
dtCurrentTable.Rows[i - 1]["mhorsepower"] = tbmhorsepower.Text;
dtCurrentTable.Rows[i - 1]["rdlmhorsepType"] = tbrdlmhorsepType.Text;
dtCurrentTable.Rows[i - 1]["datePurchased"] = tbdatePurchased.Text;
dtCurrentTable.Rows[i - 1]["mdatePurchased"] = tbrbmdatePurchased.Text;
dtCurrentTable.Rows[i - 1]["PurchaseType"] = tbPurchaseType.Text;
dtCurrentTable.Rows[i - 1]["rblmPurchasedType"] = tbrblmPurchasedType.Text;
dtCurrentTable.Rows[i - 1]["txtPrevOnwerName"] = tbPrevOnwerName.Text;
dtCurrentTable.Rows[i - 1]["prevAddr"] = tbprevAddr.Text;
dtCurrentTable.Rows[i - 1]["prevCity"] = tbprevCity.Text;
dtCurrentTable.Rows[i - 1]["PrevState"] = tbPrevState.Text;
dtCurrentTable.Rows[i - 1]["prevzip"] = tbprevzip.Text;
dtCurrentTable.Rows[i - 1]["txtPrevOnwerName"] = tbmPrevOnwerNam.Text;
dtCurrentTable.Rows[i - 1]["mprevAddr"] = tbmprevAddr.Text;
dtCurrentTable.Rows[i - 1]["mprevCity"] = tbmprevCity.Text;
dtCurrentTable.Rows[i - 1]["mPrevState"] = tbmPrevState.Text;
dtCurrentTable.Rows[i - 1]["mprevzip"] = tbmprevzip.Text;
dtCurrentTable.Rows[i - 1]["buyername"] = tbbuyername.Text;
dtCurrentTable.Rows[i - 1]["buyeraddress"] = tbbuyeraddress.Text;
dtCurrentTable.Rows[i - 1]["buyercity"] = tbbuyercity.Text;
dtCurrentTable.Rows[i - 1]["buyerstate"] = tbbuyerstate.Text;
dtCurrentTable.Rows[i - 1]["buyerzip"] = tbbuyerzip.Text;
dtCurrentTable.Rows[i - 1]["datesold"] = txtdatesold.Text;
dtCurrentTable.Rows[i - 1]["salePrice"] = tbsalePrice.Text;
dtCurrentTable.Rows[i - 1]["Description"] = tbDescription.Text;
dtCurrentTable.Rows[i - 1]["mbuyername"] = tbmbuyername.Text;
dtCurrentTable.Rows[i - 1]["mbuyeraddress"] = tbmbuyeraddress.Text;
dtCurrentTable.Rows[i - 1]["mbuyercity"] = tbmbuyercity.Text;
dtCurrentTable.Rows[i - 1]["mbuyerstate"] = tbmbuyerstate.Text;
dtCurrentTable.Rows[i - 1]["mbuyerzip"] = tbmbuyerzip.Text;
dtCurrentTable.Rows[i - 1]["mdatesold"] = tbmdatesold.Text;
dtCurrentTable.Rows[i - 1]["msalePrice"] = tbmsalePrice.Text;
dtCurrentTable.Rows[i - 1]["mDescription"] = tbmDescription.Text;
dtCurrentTable.Rows[i - 1]["boatCost"] = tbboatCost.Text;
dtCurrentTable.Rows[i - 1]["motorCost"] = tbmotorCost.Text;
dtCurrentTable.Rows[i - 1]["rblIssues"] = tbrblIssues.Text;
dtCurrentTable.Rows[i - 1]["functionalIsses"] = tbfunctionalIsses.Text;
dtCurrentTable.Rows[i - 1]["mrblIssues"] = tbmrblIssues.Text;
dtCurrentTable.Rows[i - 1]["mfunctionalIsses"] = tbmfunctionalIsses.Text;
dtCurrentTable.Rows[i - 1]["vesseltypeUse"] = tbvesseltypeUse.Text;
dtCurrentTable.Rows[i - 1]["vesselname"] = tbvesselname.Text;
dtCurrentTable.Rows[i - 1]["vessellength"] = tbvessellength.Text;
dtCurrentTable.Rows[i - 1]["vesselYrBult"] = tbvesselYrBult.Text;
dtCurrentTable.Rows[i - 1]["VeseelHullMateria"] = tbVeseelHullMateria.Text;
dtCurrentTable.Rows[i - 1]["vessehorsepEngine"] = tbvessehorsepEngine.Text;
dtCurrentTable.Rows[i - 1]["coastGuardNumber"] = tbcoastGuardNumber.Text;
dtCurrentTable.Rows[i - 1]["VesselYrPurchased"] = tbVesselYrPurchased.Text;
dtCurrentTable.Rows[i - 1]["PurchasedNew"] = tbPurchasedNew.Text;
dtCurrentTable.Rows[i - 1]["VesselPurchaseAmt"] = tbVesselPurchaseAmt.Text;
dtCurrentTable.Rows[i - 1]["homePort"] = tbhomePort.Text;
dtCurrentTable.Rows[i - 1]["whereDocked"] = tbwhereDocked.Text;
dtCurrentTable.Rows[i - 1]["bmequipAccessoryList"] = tbmequipAccessoryList.Text;
rowIndex += 1;
}
ViewState["CurrentTable"] = dtCurrentTable;
}
}
else
{
Response.Write("ViewState is null");
}
}
protected void ButtonAdd2_Click(object sender, EventArgs e)
{
}
private void AddNewRowToGrid()
{
int rowIndex = 0;
if (ViewState["CurrTable"] != null)
{
DataTable dtCurrentTable = (DataTable)ViewState["CurrTable"];
DataRow drCurrentRow = null;
if (dtCurrentTable.Rows.Count > 0)
{
for (int i = 1; i <= dtCurrentTable.Rows.Count; i++)
{
TextBox tbboatregNum = (TextBox)Repeater1.Items[rowIndex].FindControl("txtboatregNum");
TextBox tbPayerret = (TextBox)Repeater1.Items[rowIndex].FindControl("txtPayerret");
TextBox tbCGvesselNum = (TextBox)Repeater1.Items[rowIndex].FindControl("cgaurdNumber");
TextBox tbCGtaxpayerret = (TextBox)Repeater1.Items[rowIndex].FindControl("cguardreturnedval");
drCurrentRow = dtCurrentTable.NewRow();
drCurrentRow["ID"] = i + 1;
dtCurrentTable.Rows[i - 1]["MarineRegNo"] = tbboatregNum.Text;
dtCurrentTable.Rows[i - 1]["TaxPyrRetdVal"] = tbPayerret.Text;
dtCurrentTable.Rows[i - 1]["VesselRegNo"] = tbCGvesselNum.Text;
dtCurrentTable.Rows[i - 1]["VesselTaxPyrRetdVal"] = tbCGtaxpayerret.Text;
rowIndex++;
}
dtCurrentTable.Rows.Add(drCurrentRow);
ViewState["CurrTable"] = dtCurrentTable;
Repeater1.DataSource = dtCurrentTable;
Repeater1.DataBind();
}
}
else
{
Response.Write("ViewState is null");
}
SetPreviousData();
}
private void SetPreviousData()
{
int rowIndex = 0;
if (ViewState["CurrTable"] != null)
{
DataTable dt = (DataTable)ViewState["CurrTable"];
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
TextBox tbboatregNum = (TextBox)Repeater1.Items[rowIndex].FindControl("txtboatregNum");
TextBox tbPayerret = (TextBox)Repeater1.Items[rowIndex].FindControl("txtPayerret");
TextBox tbCGvesselNum = (TextBox)Repeater1.Items[rowIndex].FindControl("cgaurdNumber");
TextBox tbCGtaxpayerret = (TextBox)Repeater1.Items[rowIndex].FindControl("cguardreturnedval");
tbboatregNum.Text = dt.Rows[i]["MarineRegNo"].ToString();
tbPayerret.Text = dt.Rows[i]["TaxPyrRetdVal"].ToString();
tbCGvesselNum.Text = dt.Rows[i]["VesselRegNo"].ToString();
tbCGtaxpayerret.Text = dt.Rows[i]["VesselTaxPyrRetdVal"].ToString();
rowIndex++;
}
}
}
}
protected void BtnAdd_Click(object sender, EventArgs e)
{
AddNewRowToGrid();
}
protected void btnDelete_Click(object sender, EventArgs e)
{
int rowIndex = 0;
// int rowID = e.RowIndex;
//Get the reference of the clicked button.
Button btn = (sender as Button);
//Get the command argument
string commandArgument = btn.CommandArgument;
//Get the Repeater Item reference
RepeaterItem item = btn.NamingContainer as RepeaterItem;
//Get the repeater item index
int rowID = item.ItemIndex;
//Initialize total by emptying the bucket first
lblTotal.Text = "0";
if (ViewState["CurrTable"] != null)
{
DataTable dtCurrentTable = (DataTable)ViewState["CurrTable"];
if (dtCurrentTable.Rows.Count > 0)
{
for (int i = 1; i <= Repeater1.Items.Count; i++)
{
TextBox tbboatregNum = (TextBox)Repeater1.Items[rowIndex].FindControl("txtboatregNum");
TextBox tbPayerret = (TextBox)Repeater1.Items[rowIndex].FindControl("txtPayerret");
TextBox tbCGvesselNum = (TextBox)Repeater1.Items[rowIndex].FindControl("cgaurdNumber");
TextBox tbCGtaxpayerret = (TextBox)Repeater1.Items[rowIndex].FindControl("cguardreturnedval");
dtCurrentTable.Rows[i - 1]["MarineRegNo"] = tbboatregNum.Text;
dtCurrentTable.Rows[i - 1]["TaxPyrRetdVal"] = tbPayerret.Text;
dtCurrentTable.Rows[i - 1]["VesselRegNo"] = tbCGvesselNum.Text;
dtCurrentTable.Rows[i - 1]["VesselTaxPyrRetdVal"] = tbCGtaxpayerret.Text;
rowIndex++;
}
if (item.ItemIndex < dtCurrentTable.Rows.Count)
{
dtCurrentTable.Rows.Remove(dtCurrentTable.Rows[rowID]);
}
}
ViewState["CurrTable"] = dtCurrentTable;
Repeater1.DataSource = dtCurrentTable;
Repeater1.DataBind();
}
SetPreviousData();
}
protected void btnDelete2_Click(object sender, EventArgs e)
{
}
protected void OnClickNext(object sender, EventArgs e)
{
int rowIndex = 0;
if (ViewState["CurrTable"] != null)
{
DataTable dtCurrentTable = (DataTable)ViewState["CurrTable"];
if (dtCurrentTable.Rows.Count > 0)
{
for (int i = 1; i <= Repeater1.Items.Count; i++)
{
TextBox tbboatregNum = (TextBox)Repeater1.Items[rowIndex].FindControl("txtboatregNum");
TextBox tbPayerret = (TextBox)Repeater1.Items[rowIndex].FindControl("txtPayerret");
TextBox tbCGvesselNum = (TextBox)Repeater1.Items[rowIndex].FindControl("cgaurdNumber");
TextBox tbCGtaxpayerret = (TextBox)Repeater1.Items[rowIndex].FindControl("cguardreturnedval");
dtCurrentTable.Rows[i - 1]["MarineRegNo"] = tbboatregNum.Text;
dtCurrentTable.Rows[i - 1]["TaxPyrRetdVal"] = tbPayerret.Text;
dtCurrentTable.Rows[i - 1]["VesselRegNo"] = tbCGvesselNum.Text;
dtCurrentTable.Rows[i - 1]["VesselTaxPyrRetdVal"] = tbCGtaxpayerret.Text;
rowIndex++;
}
ViewState["TempData"] = dtCurrentTable;
}
myMultiView.ActiveViewIndex += 1;
if (myMultiView.ActiveViewIndex != 3)
{
PopulateRecord();
}
}
}
protected void onBack(object sender, EventArgs e)
{
lblTotal.Text = lblTotalPrev.Text;
myMultiView.ActiveViewIndex -= 1;
}
private void PopulateRecord()
{
foreach (RepeaterItem item in Repeater1.Items)
{
string registerNumber = (item.FindControl("txtboatregNum") as TextBox).Text;
string bregisterNumber = (item.FindControl("cgaurdNumber") as TextBox).Text;
if (item.ItemIndex == 0)
{
this.SetInitialRow2(registerNumber,bregisterNumber);
}
else
{
AddNewRow2(registerNumber,bregisterNumber);
}
foreach (RepeaterItem Item in Repeater2.Items)
{
(Item.FindControl("BtnAdd2") as Button).Visible = Repeater2.Items.Count > 1;
(Item.FindControl("btnDelete2") as Button).Visible = Repeater2.Items.Count > 1;
}
}
}
protected void rblsitus_SelectedIndexChanged(object sender, EventArgs e)
{
foreach (ListItem Li in rblsitus.Items)
{
if (Li.Text.Trim() == "CITY OF")
if (Li.Selected)
{
citylist.Enabled = true;
SetFocus(citylist);
}
else
{
citylist.Enabled = false;
}
}
}
protected override void OnPreRender(EventArgs e)
{
if (myMultiView.ActiveViewIndex == myMultiView.Views.Count - 1)
{
FillSummary();
}
btnback.Visible = myMultiView.ActiveViewIndex > 0;
btnNext.Visible = myMultiView.ActiveViewIndex < myMultiView.Views.Count - 1;
btnSave.Visible = myMultiView.ActiveViewIndex == myMultiView.Views.Count - 1;
base.OnPreRender(e);
}
public DataTable dtAirInfoTable;
private void FillSummary()
{
//preview of total tax return year
lblTotal.Text = hfvalue.Value;
//Show Payer summary info
lblAcctNo.Text = accountnumber.Text;
lblTaxYr.Text = txtTaxYr.Text;
lblOwnerPhone.Text = txtOwnerPhone.Text;
lblDueDate.Text = txtDueDate.Text;
lblfName.Text = txtfname.Text;
lblfAddress.Text = txtfaddress.Text;
lblfCity.Text = txtfcity.Text;
lblfStates.Text = ddlstates.SelectedItem.ToString();
lblfZip.Text = txtfzip.Text;
lblsitus.Text = rblsitus.SelectedItem.ToString();
lblcitylist.Text = citylist.Text;
lblTotalPrev.Text = lblTotal.Text;
//If Address is different
if (same_as_taxpayeraddr.Checked == true)
{
chksameAddr.Checked = true;
lblfullName.Text = txtfullname.Text;
lblAddress.Text = txtaddress.Text;
lblCity.Text = txtcity.Text;
lblStates.Text = ddlfillstates.SelectedItem.ToString();
lblZip.Text = txtzip.Text;
}
else
{
chksameAddr.Checked = false;
lblfullName.Text = "";
lblAddress.Text = "";
lblCity.Text = "";
lblStates.Text = "";
lblfZip.Text = "";
}
lblTotalPrev.Text = hfvalue.Value;
if (ViewState["TempData"] != null)
{
dtAirInfoTable = (DataTable)ViewState["TempData"];
}
int rowIndex = 0;
if (ViewState["CurrentTable"] != null)
{
//Initialize datatable.
DataTable ctable = ViewState["CurrentTable"] as DataTable;
DataTable preview = ctable.Clone();
int rowNumber = 1;
//Lets start looping through the second datatable for aircraft schedule info. .
if (ctable.Rows.Count > 0)
{
for (int i = 1; i <= Repeater2.Items.Count; i++)
{
DataRow dr = preview.NewRow();
dr["RowNumber"] = rowNumber;
dr["boatcnty"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("aircraftcnty")).Text;
dr["aRegNo"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("aRegNo")).Text;
dr["aMake"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("aMake")).Text;
dr["mMake"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("mMake")).Text;
dr["ModelNoA"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("aModelNo")).Text;
dr["ModelNoM"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("mModelNo")).Text;
dr["boatYrBuilt"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("boatYrBuilt")).Text;
dr["motorYrBuilt"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("motorYrBuilt")).Text;
dr["blength"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("blength")).Text;
dr["hullmaterial"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("hullmaterial")).Text;
dr["mhorsepower"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("mhorsepower")).Text;
dr["rdlmhorsepType"] = ((RadioButtonList)Repeater2.Items[rowIndex].FindControl("rdlmhorsepType")).SelectedValue;
dr["datePurchased"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtdatePurchased")).Text;
dr["mdatePurchased"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("mdatePurchased")).Text;
dr["PurchaseType"] = ((RadioButtonList)Repeater2.Items[rowIndex].FindControl("rblPurchaseType")).SelectedValue;
dr["rblmPurchasedType"] = ((RadioButtonList)Repeater2.Items[rowIndex].FindControl("rblmPurchasedType")).SelectedValue;
dr["txtPrevOnwerName"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtPrevOnwerName")).Text;
dr["prevAddr"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtprevAddr")).Text;
dr["prevCity"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtprevCity")).Text;
dr["PrevState"] = ((DropDownList)Repeater2.Items[rowIndex].FindControl("ddlPrevState")).SelectedItem.Text;
dr["prevzip"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtprevzip")).Text;
dr["mPrevOnwerName"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtmPrevOnwerName")).Text;
dr["mprevAddr"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtmprevAddr")).Text;
dr["mprevCity"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtmprevCity")).Text;
dr["mPrevState"] = ((DropDownList)Repeater2.Items[rowIndex].FindControl("ddlmPrevState")).SelectedItem.Text;
dr["mprevzip"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtmprevzip")).Text;
dr["buyername"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtbuyername")).Text;
dr["buyeraddress"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtbuyeraddress")).Text;
dr["buyercity"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtbuyercity")).Text;
dr["buyerstate"] = ((DropDownList)Repeater2.Items[rowIndex].FindControl("lblbuyerstate")).SelectedItem.Text;
dr["buyerzip"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtbuyerzip")).Text;
dr["datesold"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtdatesold")).Text;
dr["salePrice"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtsalePrice")).Text;
dr["Description"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtDescription")).Text;
dr["mbuyername"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtmbuyername")).Text;
dr["mbuyeraddress"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtmbuyeraddress")).Text;
dr["mbuyercity"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtmbuyercity")).Text;
dr["mbuyerstate"] = ((DropDownList)Repeater2.Items[rowIndex].FindControl("lblmbuyerstate")).SelectedItem.Text;
dr["mbuyerzip"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtmbuyerzip")).Text;
dr["mdatesold"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtmdatesold")).Text;
dr["msalePrice"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtmsalePrice")).Text;
dr["mDescription"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtmDescription")).Text;
dr["boatCost"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("boatCost")).Text;
dr["motorCost"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("MotorCost")).Text;
dr["rblIssues"] = ((RadioButtonList)Repeater2.Items[rowIndex].FindControl("rblIssues")).SelectedValue;
dr["functionalIsses"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("functionalIsses")).Text;
dr["mrblIssues"] = ((RadioButtonList)Repeater2.Items[rowIndex].FindControl("mrblIssues")).SelectedValue;
dr["mfunctionalIsses"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("mfunctionalIsses")).Text;
dr["vesseltypeUse"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtvesseltypeUse")).Text;
dr["vesselname"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtvesselname")).Text;
dr["vessellength"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtvessellength")).Text;
dr["vesselYrBult"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtvesselYrBult")).Text;
dr["VeseelHullMateria"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtVeseelHullMateria")).Text;
dr["vessehorsepEngine"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("vessehorsepEngine")).Text;
dr["VesselYrPurchased"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtVesselYrPurchased")).Text;
dr["PurchasedNew"] = ((RadioButtonList)Repeater2.Items[rowIndex].FindControl("rblVPurchasedNew")).Text;
dr["VesselPurchaseAmt"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("VesselPurchaseAmt")).Text;
dr["homePort"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txthomePort")).Text;
dr["whereDocked"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("txtwhereDocked")).Text;
dr["bmequipAccessoryList"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("bmequipAccessoryList")).Text;
dr["coastGuardNumber"] = ((TextBox)Repeater2.Items[rowIndex].FindControl("coastGuardNumber")).Text;
preview.Rows.Add(dr);
rowNumber++;
rowIndex++;
}
rptpreview.DataSource = preview;
rptpreview.DataBind();
}
}
}
//helper class for dealing with empty numeric values
private decimal? CheckNull(decimal? checkAmount)
{
if (checkAmount == null)
{
checkAmount = 0;
}
return checkAmount;
}
protected void btnContinue_Click(object sender, EventArgs e)
{
//Begin by posting to the Taxpayer table but first, get connection string to sql server database
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["constr"].ConnectionString);
try
{
//open connection
conn.Open();
SqlCommand cmd = new SqlCommand();
Int32 rowsAffected;
cmd.CommandText = "usp_TaxPayer";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@taxPayerFullName", txtfname.Text);
cmd.Parameters.AddWithValue("@address", txtfaddress.Text);
cmd.Parameters.AddWithValue("@city", txtcity.Text);
cmd.Parameters.AddWithValue("@state", ddlstates.SelectedValue);
cmd.Parameters.AddWithValue("@zip", txtfzip.Text);
cmd.Parameters.AddWithValue("@pid", accountnumber.Text);
cmd.Parameters.AddWithValue("@phone", txtOwnerPhone.Text);
cmd.Connection = conn;
rowsAffected = cmd.ExecuteNonQuery();
//Display some feedback to the user to let them know it was processed
lblResult.ForeColor = System.Drawing.Color.Green;
lblResult.Text = "Thank you! <br>You have successfully saved this portion of your. Close the window but don't forget to come back to complete this form.";
}
catch (Exception ex)
{
lblResult.Text = "Uh oh. Error! " + ex.Message;
}
finally
{
conn.Close();
}
//Now deal with Marine Info stuff (Registration #, tax return year, etc)
// First get datatable information as defined at beginning of page
SetRowData();
DataTable regtable = ViewState["CurrTable"] as DataTable;
try
{
conn.Open();
if (regtable != null)
{
foreach (DataRow row in regtable.Rows)
{
string txBoatRegNum = row.ItemArray[1] as string;
string txTaxPayerRet = row.ItemArray[2] as string;
string txVesselRegNum = row.ItemArray[3] as string;
string txVTaxPayerRet = row.ItemArray[4] as string;
//prevent money data types from breaking. If user does not enter value, then enter 0 in its place
//This sub will store Marine and Vessel info to the database.
if (txTaxPayerRet != null & txVTaxPayerRet != null)
{
if (string.IsNullOrEmpty(txTaxPayerRet))
{
txTaxPayerRet = "0";
}
if (string.IsNullOrEmpty(txVTaxPayerRet))
{
txVTaxPayerRet = "0";
}
SqlCommand aircmd = new SqlCommand("sp_saveMarineInfo", conn);
aircmd.CommandType = CommandType.StoredProcedure;
aircmd.Parameters.AddWithValue("@pid", accountnumber.Text);
aircmd.Parameters.AddWithValue("@eID", Request["pageId"]);
aircmd.Parameters.AddWithValue("@txYr", txtTaxYr.Text);
aircmd.Parameters.AddWithValue("@marineRegno", txBoatRegNum);
aircmd.Parameters.AddWithValue("@vesselRegno", txVesselRegNum);
aircmd.Parameters.Add("@txretval", SqlDbType.Money).Value = decimal.Parse(txTaxPayerRet); //convert text back to money
aircmd.Parameters.Add("@vtxretval", SqlDbType.Money).Value = decimal.Parse(txVTaxPayerRet); //convert text back to money
aircmd.ExecuteNonQuery();
}
}
}
//Display some feedback to the user to let them know it was processed
lblResult.ForeColor = System.Drawing.Color.Green;
lblResult.Text = "Thank you! <br>You have successfully saved this portion of your. Close the window but don't forget to come back to complete this form.";
}
catch (Exception ex)
{
//this will catch your second exception
lblResult.ForeColor = System.Drawing.Color.Red;
lblResult.Text = "Uh oh. Error with second operation! " + ex.Message;
}
finally
{
conn.Close();
}
////Now store data into the MarineScheduleE table
SetRowData2();
DataTable stable = ViewState["CurrentTable"] as DataTable;
try
{
conn.Open();
if (stable != null)
{
foreach (DataRow row in stable.Rows)
{
string boatcnty = row.ItemArray[1] as string;
string aRegNo = row.ItemArray[2] as string;
string aMake = row.ItemArray[3] as string;
string mMake = row.ItemArray[4] as string;
string ModelNoA = row.ItemArray[5] as string;
string ModelNoM = row.ItemArray[6] as string;
string boatYrBuilt = row.ItemArray[7] as string;
string motorYrBuilt = row.ItemArray[8] as string;
string blength = row.ItemArray[9] as string;
string bhullmateria = row.ItemArray[10] as string;
string mhorsepower = row.ItemArray[11] as string;
string rdlmhorsepType = row.ItemArray[12] as string;
string datePurchased = row.ItemArray[13] as string;
string mdatePurchased = row.ItemArray[14] as string;
string PurchaseType = row.ItemArray[15] as string;
string rblmPurchasedType = row.ItemArray[16] as string;
//Previous Onwer info
string PrevOnwerName = row.ItemArray[17] as string;
string prevAddr = row.ItemArray[18] as string;
string prevCity = row.ItemArray[19] as string;
string PrevState = row.ItemArray[20] as string;
string prevzip = row.ItemArray[21] as string;
string mPrevOnwerName = row.ItemArray[22] as string;
string mprevAddr = row.ItemArray[23] as string;
string mprevCity = row.ItemArray[24] as string;
string mPrevState = row.ItemArray[25] as string;
string mprevzip = row.ItemArray[26] as string;
//New buyer info
string buyername = row.ItemArray[27] as string;
string buyeraddress = row.ItemArray[28] as string;
string buyercity = row.ItemArray[29] as string;
string buyerstate = row.ItemArray[30] as string;
string buyerzip = row.ItemArray[31] as string;
string datesold = row.ItemArray[32] as string;
string salePrice = row.ItemArray[33] as string;
string Description = row.ItemArray[34] as string;
string mbuyername = row.ItemArray[35] as string;
string mbuyeraddress = row.ItemArray[36] as string;
string mbuyercity = row.ItemArray[37] as string;
string mbuyerstate = row.ItemArray[38] as string;
string mbuyerzip = row.ItemArray[39] as string;
string mdatesold = row.ItemArray[40] as string;
string msalePrice = row.ItemArray[41] as string;
string mDescription = row.ItemArray[42] as string;
//Additional Marine Schedule D info
string boatCost = row.ItemArray[43] as string;
string motorCost = row.ItemArray[44] as string;
string rblIssues = row.ItemArray[45] as string;
string functionalIsses = row.ItemArray[46] as string;
string mrblIssues = row.ItemArray[47] as string;
string mfunctionalIsses = row.ItemArray[48] as string;
string vesseltypeUse = row.ItemArray[49] as string;
string vesselname = row.ItemArray[50] as string;
string vessellength = row.ItemArray[51] as string;
string vesselYrBult = row.ItemArray[52] as string;
string VeseelHullMateria = row.ItemArray[53] as string;
string vessehorsepEngine = row.ItemArray[54] as string;
string coastGuardNumber = row.ItemArray[55] as string;
string VesselYrPurchased = row.ItemArray[56] as string;
string PurchasedNew = row.ItemArray[57] as string;
string VesselPurchaseAmt = row.ItemArray[58] as string;
string homePort = row.ItemArray[59] as string;
string whereDocked = row.ItemArray[60] as string;
string bmequipAccessoryList = row.ItemArray[61] as string;
if (boatCost != null & motorCost != null & salePrice != null & msalePrice != null)
{
if (string.IsNullOrEmpty(boatCost))
{
boatCost = "0";
}
if (string.IsNullOrEmpty(motorCost))
{
motorCost = "0";
}
if (string.IsNullOrEmpty(salePrice))
{
salePrice = "0";
}
if (string.IsNullOrEmpty(msalePrice))
{
msalePrice = "0";
}
SqlCommand cmd2 = new SqlCommand("sp_MarineScheduleD", conn);
cmd2.CommandType = CommandType.StoredProcedure;
cmd2.Parameters.AddWithValue("@pid", accountnumber.Text);
cmd2.Parameters.AddWithValue("@txYr", txtTaxYr.Text);
cmd2.Parameters.AddWithValue("@cnty", boatcnty);
cmd2.Parameters.AddWithValue("@regno", aRegNo);
cmd2.Parameters.AddWithValue("@boatmfgMake", aMake);
cmd2.Parameters.AddWithValue("@motormfgMake", mMake);
cmd2.Parameters.AddWithValue("@boatmfgModel", ModelNoA);
cmd2.Parameters.AddWithValue("@motormfgModel", ModelNoM);
cmd2.Parameters.AddWithValue("@boatYrBuilt", boatYrBuilt);
cmd2.Parameters.AddWithValue("@motorYrBuilt", motorYrBuilt);
cmd2.Parameters.AddWithValue("@blength", blength);
cmd2.Parameters.AddWithValue("@hullmaterial", bhullmateria);
cmd2.Parameters.AddWithValue("@horsepower", mhorsepower);
cmd2.Parameters.AddWithValue("@horsepowertype", rdlmhorsepType);
cmd2.Parameters.AddWithValue("@boatDatePurchased", datePurchased);
cmd2.Parameters.AddWithValue("@motorDatePurchased", mdatePurchased);
cmd2.Parameters.AddWithValue("@boatPurchaseType", PurchaseType);
cmd2.Parameters.AddWithValue("@motorPurchaseType", rblmPurchasedType);
cmd2.Parameters.AddWithValue("@boatCost", boatCost.ToString());
cmd2.Parameters.AddWithValue("@motorCost", motorCost.ToString());
cmd2.Parameters.AddWithValue("@boatIssues", rblIssues);
cmd2.Parameters.AddWithValue("@boatIssuesDetails", functionalIsses);
cmd2.Parameters.AddWithValue("@motorIssues", mrblIssues);
cmd2.Parameters.AddWithValue("@motorIssuesDetails", mfunctionalIsses);
cmd2.Parameters.AddWithValue("@vesseltypeUse", vesseltypeUse);
cmd2.Parameters.AddWithValue("@vesselname", vesselname);
cmd2.Parameters.AddWithValue("@vessellength", vessellength);
cmd2.Parameters.AddWithValue("@vesselYrBult", vesselYrBult);
cmd2.Parameters.AddWithValue("@VeseelHullMateria", VeseelHullMateria);
cmd2.Parameters.AddWithValue("@vessehorsepEngine", vessehorsepEngine);
cmd2.Parameters.AddWithValue("@coastGuardNumber", coastGuardNumber);
cmd2.Parameters.AddWithValue("@VesselYrPurchased", VesselYrPurchased);
cmd2.Parameters.AddWithValue("@PurchasedNew", PurchasedNew);
cmd2.Parameters.AddWithValue("@VesselPurchaseAmt", VesselPurchaseAmt.ToString());
cmd2.Parameters.AddWithValue("@homePort", homePort);
cmd2.Parameters.AddWithValue("@whereDocked", whereDocked);
cmd2.Parameters.AddWithValue("@bmequipAccessoryList", bmequipAccessoryList);
cmd2.Parameters.AddWithValue("@fdate", DateTime.Now);
cmd2.ExecuteNonQuery();
string fullName = PrevOnwerName;
var names = fullName.Split(' ');
string firstName = names[0];
string lastName = names[1];
string buyernames = buyername;
var flnames = buyernames.Split(' ');
string bFName = flnames[0];
string bLName = flnames[1];
if (salePrice != null)
{
if (string.IsNullOrEmpty(salePrice))
{
salePrice = "0";
}
// Insert into Marine Previous owner if user chooses "Used"
foreach (RepeaterItem item in Repeater2.Items)
{
// Checking the item is a data item
if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
{
var rdbList = item.FindControl("rblPurchaseType") as RadioButtonList;
// Get the selected value
if (rdbList.SelectedValue == "Used")
{
SqlCommand cmd3 = new SqlCommand("sp_MarinePurchaserInfo", conn);
cmd3.CommandType = CommandType.StoredProcedure;
cmd3.Parameters.AddWithValue("@pid", accountnumber.Text);
cmd3.Parameters.AddWithValue("@txYr", txtTaxYr.Text);
cmd3.Parameters.AddWithValue("@prevOwnerName", PrevOnwerName);
cmd3.Parameters.AddWithValue("@fname", firstName);
cmd3.Parameters.AddWithValue("@lname", lastName);
cmd3.Parameters.AddWithValue("@PrevOnwerAddr", prevAddr);
cmd3.Parameters.AddWithValue("@PrevOnwerCity", prevCity);
cmd3.Parameters.AddWithValue("@PrevOnwerState", PrevState);
cmd3.Parameters.AddWithValue("@PrevOnwerZip", prevzip);
cmd3.Parameters.AddWithValue("@mprevOwnerName", mPrevOnwerName);
cmd3.Parameters.AddWithValue("@mfname", firstName);
cmd3.Parameters.AddWithValue("@mlname", lastName);
cmd3.Parameters.AddWithValue("@mprevAddr", mprevAddr);
cmd3.Parameters.AddWithValue("@mPrevCity", mprevCity);
cmd3.Parameters.AddWithValue("@mPrevState", mPrevState);
cmd3.Parameters.AddWithValue("@mPrevZip", mprevzip);
cmd3.Parameters.AddWithValue("@sTitle", txtTitle.Text);
cmd3.Parameters.AddWithValue("@signDate", signDate.Text);
cmd3.Parameters.AddWithValue("@dtesold", datesold);
cmd3.Parameters.AddWithValue("@saleprice", salePrice.ToString());
cmd3.Parameters.AddWithValue("@descr", Description);
cmd3.Parameters.AddWithValue("@buyerfullname", buyername);
cmd3.Parameters.AddWithValue("@buyerfname", bFName);
cmd3.Parameters.AddWithValue("@buyerlname", bLName);
cmd3.Parameters.AddWithValue("@buyeraddr", buyeraddress);
cmd3.Parameters.AddWithValue("@buyercity", buyercity);
cmd3.Parameters.AddWithValue("@buyerstate", buyerstate);
cmd3.Parameters.AddWithValue("@buyerzip", buyerzip);
cmd3.Parameters.AddWithValue("@mdatesold", datesold);
cmd3.Parameters.AddWithValue("@msaleprice", msalePrice.ToString());
cmd3.Parameters.AddWithValue("@mdescription", Description);
cmd3.Parameters.AddWithValue("@mbuyername", buyername);
cmd3.Parameters.AddWithValue("@mbuyerfname", bFName);
cmd3.Parameters.AddWithValue("@mbuyerlname", bLName);
cmd3.Parameters.AddWithValue("@mbuyeraddr", buyeraddress);
cmd3.Parameters.AddWithValue("@mbuyercity", buyercity);
cmd3.Parameters.AddWithValue("@mbuyerstate", buyerstate);
cmd3.Parameters.AddWithValue("@mbuyerzip", buyerzip);
cmd3.Parameters.AddWithValue("@citylist", citylist.SelectedValue);
cmd3.ExecuteNonQuery();
}
else
{
SqlCommand cmdpurchaser = new SqlCommand("sp_MarinePurchaserInfo", conn);
cmdpurchaser.CommandType = CommandType.StoredProcedure;
cmdpurchaser.Parameters.AddWithValue("@pid", accountnumber.Text);
cmdpurchaser.Parameters.AddWithValue("@txYr", txtTaxYr.Text);
cmdpurchaser.Parameters.AddWithValue("@dtesold", datesold);
cmdpurchaser.Parameters.AddWithValue("@saleprice", salePrice.ToString());
cmdpurchaser.Parameters.AddWithValue("@descr", Description);
cmdpurchaser.Parameters.AddWithValue("@buyerfullname", buyername);
cmdpurchaser.Parameters.AddWithValue("@buyerfname", bFName);
cmdpurchaser.Parameters.AddWithValue("@buyerlname", bLName);
cmdpurchaser.Parameters.AddWithValue("@buyeraddr", buyeraddress);
cmdpurchaser.Parameters.AddWithValue("@buyercity", buyercity);
cmdpurchaser.Parameters.AddWithValue("@buyerstate", buyerstate);
cmdpurchaser.Parameters.AddWithValue("@buyerzip", buyerzip);
cmdpurchaser.Parameters.AddWithValue("@sTitle", txtTitle.Text);
cmdpurchaser.Parameters.AddWithValue("@signDate", signDate.Text);
cmdpurchaser.Parameters.AddWithValue("@mdatesold", datesold);
cmdpurchaser.Parameters.AddWithValue("@msaleprice", msalePrice.ToString());
cmdpurchaser.Parameters.AddWithValue("@mdescription", Description);
cmdpurchaser.Parameters.AddWithValue("@mbuyername", mbuyername);
cmdpurchaser.Parameters.AddWithValue("@mbuyerfname", bFName);
cmdpurchaser.Parameters.AddWithValue("@mbuyerlname", bLName);
cmdpurchaser.Parameters.AddWithValue("@mbuyeraddr", buyeraddress);
cmdpurchaser.Parameters.AddWithValue("@mbuyercity", buyercity);
cmdpurchaser.Parameters.AddWithValue("@mbuyerstate", buyerstate);
cmdpurchaser.Parameters.AddWithValue("@mbuyerzip", buyerzip);
cmdpurchaser.Parameters.AddWithValue("@citylist", citylist.SelectedValue);
cmdpurchaser.ExecuteNonQuery();
}
}
}
}
}
}
}
//Display some feedback to the user to let them know it was processed
lblResult.ForeColor = System.Drawing.Color.Green;
lblResult.Text = "Thank you! <br>You have successfully saved this portion of your. Close the window but don't forget to come back to complete this form.";
}
catch (Exception ex)
{
//this will catch your second exception
lblResult.ForeColor = System.Drawing.Color.Red;
lblResult.Text = "Uh oh. Error with second operation! " + ex.Message;
}
finally
{
conn.Close();
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(connStr);
//try
{
SetRowData2();
DataTable table = ViewState["CurrTable"] as DataTable;
DataTable cstable = ViewState["CurrentTable"] as DataTable;
//open connection to database
conn.Open();
//Time to gather all the form fields from details section and ensure we capture additional dynamically added rows. In our case, there are just two sections.
if (table != null & cstable != null)
{
//Begin by posting to the Taxpayer table
SqlCommand cmd = new SqlCommand("usp_TaxPayer", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@taxPayerFullName", txtfname.Text);
cmd.Parameters.AddWithValue("@address", txtfaddress.Text);
cmd.Parameters.AddWithValue("@city", txtcity.Text);
cmd.Parameters.AddWithValue("@state", ddlstates.SelectedValue);
cmd.Parameters.AddWithValue("@zip", txtfzip.Text);
cmd.Parameters.AddWithValue("@pid", accountnumber.Text);
cmd.Parameters.AddWithValue("@phone", txtOwnerPhone.Text);
cmd.ExecuteNonQuery();
//Now deal with AircraftInfo stuff (Registration #, tax return year, etc)
foreach (DataRow row in table.Rows)
{
string txBoatRegNum = row.ItemArray[1] as string;
string txTaxPayerRet = row.ItemArray[2] as string;
string txVesselRegNum = row.ItemArray[3] as string;
string txVTaxPayerRet = row.ItemArray[4] as string;
//string txOfficeO = row.ItemArray[3] as string;
if (txTaxPayerRet != null & txVTaxPayerRet != null)
{
if (string.IsNullOrEmpty(txTaxPayerRet))
{
txTaxPayerRet = "0";
}
if (string.IsNullOrEmpty(txVTaxPayerRet))
{
txVTaxPayerRet = "0";
}
SqlCommand aircmd = new SqlCommand("sp_saveMarineInfo", conn);
aircmd.CommandType = CommandType.StoredProcedure;
aircmd.Parameters.AddWithValue("@pid", accountnumber.Text);
aircmd.Parameters.AddWithValue("@eID", Request["pageId"]);
aircmd.Parameters.AddWithValue("@txYr", txtTaxYr.Text);
aircmd.Parameters.AddWithValue("@marineRegno", txBoatRegNum);
aircmd.Parameters.AddWithValue("@vesselRegno", txVesselRegNum);
aircmd.Parameters.AddWithValue("@txretval", txTaxPayerRet.ToString());
aircmd.Parameters.AddWithValue("@vtxretval", txVTaxPayerRet.ToString());
aircmd.ExecuteNonQuery();
//Display some feedback to the user to let them know it was processed
lblResult.ForeColor = System.Drawing.Color.Green;
lblResult.Text = "Thank you! <br>You have successfully completed the Aircraft form. An email has been sent to the email address you provided. If you do not receive an email within five minutes (usually immediately), please check your spam folder.";
//If the message failed at some point, let the user know
lblResult.ForeColor = System.Drawing.Color.Red;
lblResult.Text = "Your form failed to save, please try again.";
}
}
//Now store data into the AircraftScheduleE table
foreach (DataRow row in cstable.Rows)
{
string boatcnty = row.ItemArray[1] as string;
string aRegNo = row.ItemArray[2] as string;
string aMake = row.ItemArray[3] as string;
string mMake = row.ItemArray[4] as string;
string ModelNoA = row.ItemArray[5] as string;
string ModelNoM = row.ItemArray[6] as string;
string boatYrBuilt = row.ItemArray[7] as string;
string motorYrBuilt = row.ItemArray[8] as string;
string blength = row.ItemArray[9] as string;
string bhullmateria = row.ItemArray[10] as string;
string mhorsepower = row.ItemArray[11] as string;
string rdlmhorsepType = row.ItemArray[12] as string;
string datePurchased = row.ItemArray[13] as string;
string mdatePurchased = row.ItemArray[14] as string;
string PurchaseType = row.ItemArray[15] as string;
string rblmPurchasedType = row.ItemArray[16] as string;
//Previous Onwer info
string PrevOnwerName = row.ItemArray[17] as string;
string prevAddr = row.ItemArray[18] as string;
string prevCity = row.ItemArray[19] as string;
string PrevState = row.ItemArray[20] as string;
string prevzip = row.ItemArray[21] as string;
string mPrevOnwerName = row.ItemArray[22] as string;
string mprevAddr = row.ItemArray[23] as string;
string mprevCity = row.ItemArray[24] as string;
string mPrevState = row.ItemArray[25] as string;
string mprevzip = row.ItemArray[26] as string;
//New buyer info
string buyername = row.ItemArray[27] as string;
string buyeraddress = row.ItemArray[28] as string;
string buyercity = row.ItemArray[29] as string;
string buyerstate = row.ItemArray[30] as string;
string buyerzip = row.ItemArray[31] as string;
string datesold = row.ItemArray[32] as string;
string salePrice = row.ItemArray[33] as string;
string Description = row.ItemArray[34] as string;
string mbuyername = row.ItemArray[35] as string;
string mbuyeraddress = row.ItemArray[36] as string;
string mbuyercity = row.ItemArray[37] as string;
string mbuyerstate = row.ItemArray[38] as string;
string mbuyerzip = row.ItemArray[39] as string;
string mdatesold = row.ItemArray[40] as string;
string msalePrice = row.ItemArray[41] as string;
string mDescription = row.ItemArray[42] as string;
//Additional Marine Schedule D info
string boatCost = row.ItemArray[43] as string;
string motorCost = row.ItemArray[44] as string;
string rblIssues = row.ItemArray[45] as string;
string functionalIsses = row.ItemArray[46] as string;
string mrblIssues = row.ItemArray[47] as string;
string mfunctionalIsses = row.ItemArray[48] as string;
string vesseltypeUse = row.ItemArray[49] as string;
string vesselname = row.ItemArray[50] as string;
string vessellength = row.ItemArray[51] as string;
string vesselYrBult = row.ItemArray[52] as string;
string VeseelHullMateria = row.ItemArray[53] as string;
string vessehorsepEngine = row.ItemArray[54] as string;
string coastGuardNumber = row.ItemArray[55] as string;
string VesselYrPurchased = row.ItemArray[56] as string;
string PurchasedNew = row.ItemArray[57] as string;
string VesselPurchaseAmt = row.ItemArray[58] as string;
string homePort = row.ItemArray[59] as string;
string whereDocked = row.ItemArray[60] as string;
string bmequipAccessoryList = row.ItemArray[61] as string;
if (boatCost != null & motorCost != null & salePrice != null & msalePrice != null)
{
if (string.IsNullOrEmpty(boatCost))
{
boatCost = "0";
}
if (string.IsNullOrEmpty(motorCost))
{
motorCost = "0";
}
if (string.IsNullOrEmpty(salePrice))
{
salePrice = "0";
}
if (string.IsNullOrEmpty(msalePrice))
{
msalePrice = "0";
}
SqlCommand cmd2 = new SqlCommand("sp_MarineScheduleD", conn);
cmd2.CommandType = CommandType.StoredProcedure;
cmd2.Parameters.AddWithValue("@pid", accountnumber.Text);
cmd2.Parameters.AddWithValue("@txYr", txtTaxYr.Text);
cmd2.Parameters.AddWithValue("@cnty", boatcnty);
cmd2.Parameters.AddWithValue("@regno", aRegNo);
cmd2.Parameters.AddWithValue("@boatmfgMake", aMake);
cmd2.Parameters.AddWithValue("@motormfgMake", mMake);
cmd2.Parameters.AddWithValue("@boatmfgModel", ModelNoA);
cmd2.Parameters.AddWithValue("@motormfgModel", ModelNoM);
cmd2.Parameters.AddWithValue("@boatYrBuilt", boatYrBuilt);
cmd2.Parameters.AddWithValue("@motorYrBuilt", motorYrBuilt);
cmd2.Parameters.AddWithValue("@blength", blength);
cmd2.Parameters.AddWithValue("@hullmaterial", bhullmateria);
cmd2.Parameters.AddWithValue("@horsepower", mhorsepower);
cmd2.Parameters.AddWithValue("@horsepowertype", rdlmhorsepType);
cmd2.Parameters.AddWithValue("@boatDatePurchased", datePurchased);
cmd2.Parameters.AddWithValue("@motorDatePurchased", mdatePurchased);
cmd2.Parameters.AddWithValue("@boatPurchaseType", PurchaseType);
cmd2.Parameters.AddWithValue("@motorPurchaseType", rblmPurchasedType);
cmd2.Parameters.AddWithValue("@boatCost", boatCost.ToString());
cmd2.Parameters.AddWithValue("@motorCost", motorCost.ToString());
cmd2.Parameters.AddWithValue("@boatIssues", rblIssues);
cmd2.Parameters.AddWithValue("@boatIssuesDetails", functionalIsses);
cmd2.Parameters.AddWithValue("@motorIssues", mrblIssues);
cmd2.Parameters.AddWithValue("@motorIssuesDetails", mfunctionalIsses);
cmd2.Parameters.AddWithValue("@vesseltypeUse", vesseltypeUse);
cmd2.Parameters.AddWithValue("@vesselname", vesselname);
cmd2.Parameters.AddWithValue("@vessellength", vessellength);
cmd2.Parameters.AddWithValue("@vesselYrBult", vesselYrBult);
cmd2.Parameters.AddWithValue("@VeseelHullMateria", VeseelHullMateria);
cmd2.Parameters.AddWithValue("@vessehorsepEngine", vessehorsepEngine);
cmd2.Parameters.AddWithValue("@coastGuardNumber", coastGuardNumber);
cmd2.Parameters.AddWithValue("@VesselYrPurchased", VesselYrPurchased);
cmd2.Parameters.AddWithValue("@PurchasedNew", PurchasedNew);
cmd2.Parameters.AddWithValue("@VesselPurchaseAmt", VesselPurchaseAmt.ToString());
cmd2.Parameters.AddWithValue("@homePort", homePort);
cmd2.Parameters.AddWithValue("@whereDocked", whereDocked);
cmd2.Parameters.AddWithValue("@bmequipAccessoryList", bmequipAccessoryList);
cmd2.Parameters.AddWithValue("@fdate", DateTime.Now);
cmd2.ExecuteNonQuery();
//Display some feedback to the user to let them know it was processed
lblResult.ForeColor = System.Drawing.Color.Green;
lblResult.Text = "Thank you! <br>You have successfully completed the Aircraft form. An email has been sent to the email address you provided. If you do not receive an email within five minutes (usually immediately), please check your spam folder.";
//If the message failed at some point, let the user know
lblResult.ForeColor = System.Drawing.Color.Red;
lblResult.Text = "Your form failed to save, please try again.";
string fullName = PrevOnwerName;
var names = fullName.Split(' ');
string firstName = names[0];
string lastName = names[1];
string buyernames = buyername;
var flnames = buyernames.Split(' ');
string bFName = flnames[0];
string bLName = flnames[1];
// Insert into Marine Previous owner if user chooses "Used"
foreach (RepeaterItem item in Repeater2.Items)
{
// Checking the item is a data item
if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
{
var rdbList = item.FindControl("rblPurchaseType") as RadioButtonList;
// Get the selected value
if (rdbList.SelectedValue == "Used")
{
SqlCommand cmd3 = new SqlCommand("sp_MarinePurchaserInfo", conn);
cmd3.CommandType = CommandType.StoredProcedure;
cmd3.Parameters.AddWithValue("@pid", accountnumber.Text);
cmd3.Parameters.AddWithValue("@txYr", txtTaxYr.Text);
cmd3.Parameters.AddWithValue("@prevOwnerName", PrevOnwerName);
cmd3.Parameters.AddWithValue("@fname", firstName);
cmd3.Parameters.AddWithValue("@lname", lastName);
cmd3.Parameters.AddWithValue("@PrevOnwerAddr", prevAddr);
cmd3.Parameters.AddWithValue("@PrevOnwerCity", prevCity);
cmd3.Parameters.AddWithValue("@PrevOnwerState", PrevState);
cmd3.Parameters.AddWithValue("@PrevOnwerZip", prevzip);
cmd3.Parameters.AddWithValue("@mprevOwnerName", mPrevOnwerName);
cmd3.Parameters.AddWithValue("@mfname", firstName);
cmd3.Parameters.AddWithValue("@mlname", lastName);
cmd3.Parameters.AddWithValue("@mprevAddr", mprevAddr);
cmd3.Parameters.AddWithValue("@mPrevCity", mprevCity);
cmd3.Parameters.AddWithValue("@mPrevState", mPrevState);
cmd3.Parameters.AddWithValue("@mPrevZip", mprevzip);
cmd3.Parameters.AddWithValue("@sTitle", txtTitle.Text);
cmd3.Parameters.AddWithValue("@signDate", signDate.Text);
cmd3.Parameters.AddWithValue("@dtesold", datesold);
cmd3.Parameters.AddWithValue("@saleprice", salePrice.ToString());
cmd3.Parameters.AddWithValue("@descr", Description);
cmd3.Parameters.AddWithValue("@buyerfullname", buyername);
cmd3.Parameters.AddWithValue("@buyerfname", "Sam");
cmd3.Parameters.AddWithValue("@buyerlname", "Okeh");
cmd3.Parameters.AddWithValue("@buyeraddr", buyeraddress);
cmd3.Parameters.AddWithValue("@buyercity", buyercity);
cmd3.Parameters.AddWithValue("@buyerstate", buyerstate);
cmd3.Parameters.AddWithValue("@buyerzip", buyerzip);
cmd3.Parameters.AddWithValue("@mdatesold", datesold);
cmd3.Parameters.AddWithValue("@msaleprice", msalePrice.ToString());
cmd3.Parameters.AddWithValue("@mdescription", Description);
cmd3.Parameters.AddWithValue("@mbuyername", buyername);
cmd3.Parameters.AddWithValue("@mbuyerfname", bFName);
cmd3.Parameters.AddWithValue("@mbuyerlname", bLName);
cmd3.Parameters.AddWithValue("@mbuyeraddr", buyeraddress);
cmd3.Parameters.AddWithValue("@mbuyercity", buyercity);
cmd3.Parameters.AddWithValue("@mbuyerstate", buyerstate);
cmd3.Parameters.AddWithValue("@mbuyerzip", buyerzip);
cmd3.Parameters.AddWithValue("@citylist", citylist.SelectedValue);
cmd3.ExecuteNonQuery();
}
else
{
SqlCommand cmdpurchaser = new SqlCommand("sp_MarinePurchaserInfo", conn);
cmdpurchaser.CommandType = CommandType.StoredProcedure;
cmdpurchaser.Parameters.AddWithValue("@pid", accountnumber.Text);
cmdpurchaser.Parameters.AddWithValue("@txYr", txtTaxYr.Text);
cmdpurchaser.Parameters.AddWithValue("@dtesold", datesold);
cmdpurchaser.Parameters.AddWithValue("@saleprice", salePrice.ToString());
cmdpurchaser.Parameters.AddWithValue("@descr", Description);
cmdpurchaser.Parameters.AddWithValue("@buyerfullname", buyername);
cmdpurchaser.Parameters.AddWithValue("@buyerfname", "Peter");
cmdpurchaser.Parameters.AddWithValue("@buyerlname", "Torch");
cmdpurchaser.Parameters.AddWithValue("@buyeraddr", buyeraddress);
cmdpurchaser.Parameters.AddWithValue("@buyercity", buyercity);
cmdpurchaser.Parameters.AddWithValue("@buyerstate", buyerstate);
cmdpurchaser.Parameters.AddWithValue("@buyerzip", buyerzip);
cmdpurchaser.Parameters.AddWithValue("@sTitle", txtTitle.Text);
cmdpurchaser.Parameters.AddWithValue("@signDate", signDate.Text);
cmdpurchaser.Parameters.AddWithValue("@mdatesold", datesold);
cmdpurchaser.Parameters.AddWithValue("@msaleprice", msalePrice.ToString());
cmdpurchaser.Parameters.AddWithValue("@mdescription", Description);
cmdpurchaser.Parameters.AddWithValue("@mbuyername", buyername);
cmdpurchaser.Parameters.AddWithValue("@mbuyerfname", bFName);
cmdpurchaser.Parameters.AddWithValue("@mbuyerlname", bLName);
cmdpurchaser.Parameters.AddWithValue("@mbuyeraddr", buyeraddress);
cmdpurchaser.Parameters.AddWithValue("@mbuyercity", buyercity);
cmdpurchaser.Parameters.AddWithValue("@mbuyerstate", buyerstate);
cmdpurchaser.Parameters.AddWithValue("@mbuyerzip", buyerzip);
cmdpurchaser.Parameters.AddWithValue("@citylist", citylist.SelectedValue);
cmdpurchaser.ExecuteNonQuery();
}
}
}
}
}
}
}
conn.Close();
// redirect to same page - stops refresh duplicates
Response.Redirect("thankyou.html", false);
}
}