S
sparks
I had the bright idea of using if/else to call different constructors based on
a web form and what the user entered.
=======================================
IF I DECLARE this here everything works fine...
====>>>> Member member = new Member();
=======================================
public void Button1_Click(object sender,System.EventArgs e)
{
if (ContractNumber.Text =="")
{
Warning.Visible=true;
Warning.Text = "you Must put in a Contract Number to continue";
}
else
{
Warning.Visible=false;
=======================================
=======================================
THE PROBLEM COMES HERE...HOW TO USE AN OVERLOAD FUNCTION IN
THIS WAY.
THE RECORD1 GOES OUT OF SCOPE AFTER THE CLOSING }
SO THE CALLS TO THE VARIABLES AFTER THIS STATEMENT WILL NEVER BE
SEEN..
if(fee.Text!="" || memvalidation.Text!="")
{
====>>>> Member record1 = new Member(fee.Text,memvalidation.Text,Name.Text,barcode.Text,Address.Text,phone.Text);
}
=======================================
=======================================
Response.Write ("<br>" +record1.getName());
Response.Write ("<br>" +record1.getAddress());
}
is there any way to do conditional checks with overload constructors?
I can't figure out how to make decisions based on user input so I can populate a class and its parent class
ANY help or pointers or flames are very welcome.
I am stumped
thanks again
sparks
a web form and what the user entered.
=======================================
IF I DECLARE this here everything works fine...
====>>>> Member member = new Member();
=======================================
public void Button1_Click(object sender,System.EventArgs e)
{
if (ContractNumber.Text =="")
{
Warning.Visible=true;
Warning.Text = "you Must put in a Contract Number to continue";
}
else
{
Warning.Visible=false;
=======================================
=======================================
THE PROBLEM COMES HERE...HOW TO USE AN OVERLOAD FUNCTION IN
THIS WAY.
THE RECORD1 GOES OUT OF SCOPE AFTER THE CLOSING }
SO THE CALLS TO THE VARIABLES AFTER THIS STATEMENT WILL NEVER BE
SEEN..
if(fee.Text!="" || memvalidation.Text!="")
{
====>>>> Member record1 = new Member(fee.Text,memvalidation.Text,Name.Text,barcode.Text,Address.Text,phone.Text);
}
=======================================
=======================================
Response.Write ("<br>" +record1.getName());
Response.Write ("<br>" +record1.getAddress());
}
is there any way to do conditional checks with overload constructors?
I can't figure out how to make decisions based on user input so I can populate a class and its parent class
ANY help or pointers or flames are very welcome.
I am stumped
thanks again
sparks