visible=true evaluation
am 09.04.2008 20:06:48 von duncfair
asp.net 2.0 and language is c#
I need to add a single checkbox on an aspx page based on evaluating
two aspects of the items the customer has placed in the shopping
cart.
The price must be $100 or more and the brand must be a specific
brand.
There may be multiple items in the cart but there can be only one
checkbox. I wrote some code on the codebehind, but it only evaluates
the last item in the cart. How can I evaluate all o the items?
Thanks in advance for any help.
Re: visible=true evaluation
am 09.04.2008 20:59:39 von Michel Racicot
That highly depends on two factors:
-Do you want to do this client side or server side?
-How is your data organized?
"duncfair" wrote in message
news:2c30ce99-395d-43f9-b0dd-a714047c6ed7@x19g2000prg.google groups.com...
> asp.net 2.0 and language is c#
>
> I need to add a single checkbox on an aspx page based on evaluating
> two aspects of the items the customer has placed in the shopping
> cart.
>
>
> The price must be $100 or more and the brand must be a specific
> brand.
> There may be multiple items in the cart but there can be only one
> checkbox. I wrote some code on the codebehind, but it only evaluates
> the last item in the cart. How can I evaluate all o the items?
>
>
> Thanks in advance for any help.
Re: visible=true evaluation
am 09.04.2008 22:57:38 von duncfair
Server side solution.
Data is MS SQL server and all datasets, etc. are accessed via stored
procedures.
On Apr 9, 11:59=A0am, "Michel Racicot" wrote:
> That highly depends on two factors:
>
> -Do you want to do this client side or server side?
> -How is your data organized?
>
> "duncfair" wrote in message
>
> news:2c30ce99-395d-43f9-b0dd-a714047c6ed7@x19g2000prg.google groups.com...
>
>
>
> > asp.net 2.0 and language is c#
>
> > I need to add a single checkbox on an aspx page based on evaluating
> > two aspects of the items the customer has placed in the shopping
> > cart.
>
> > The price must be $100 or more and the brand must be a specific
> > brand.
> > There may be multiple items in the cart but there can be only one
> > checkbox. =A0I wrote some code on the codebehind, but it only evaluates
> > the last item in the cart. =A0How can I evaluate all o the items?
>
> > Thanks in advance for any help.- Hide quoted text -
>
> - Show quoted text -
Re: visible=true evaluation
am 10.04.2008 15:24:45 von Michel Racicot
In that case, maybe the problem resides in the browsing of all item in the
cart.
Paste your stored procedure / SQL Code that must evaluate all items in the
cart and the code that handles the checkbox and maybe we can help you.
"duncfair" wrote in message
news:236b2ede-ac1c-4fa7-9ed2-8446cdac1c54@q27g2000prf.google groups.com...
Server side solution.
Data is MS SQL server and all datasets, etc. are accessed via stored
procedures.
On Apr 9, 11:59 am, "Michel Racicot" wrote:
> That highly depends on two factors:
>
> -Do you want to do this client side or server side?
> -How is your data organized?
>
> "duncfair" wrote in message
>
> news:2c30ce99-395d-43f9-b0dd-a714047c6ed7@x19g2000prg.google groups.com...
>
>
>
> > asp.net 2.0 and language is c#
>
> > I need to add a single checkbox on an aspx page based on evaluating
> > two aspects of the items the customer has placed in the shopping
> > cart.
>
> > The price must be $100 or more and the brand must be a specific
> > brand.
> > There may be multiple items in the cart but there can be only one
> > checkbox. I wrote some code on the codebehind, but it only evaluates
> > the last item in the cart. How can I evaluate all o the items?
>
> > Thanks in advance for any help.- Hide quoted text -
>
> - Show quoted text -
Re: visible=true evaluation
am 11.04.2008 19:55:47 von duncfair
The stored procedure is fine; SQL programming is my comfort zone.
Here is the code:
-------------------------------------------------------
Dansko_chkbx.Visible =3D false;
ProductDetailTableAdapter productadp =3D new
ProductDetailTableAdapter();
DataTable productdatatable =3D
productadp.GetDanskoProductDetailById(Convert.ToInt32(Orderi d.ToString()));
foreach (DataRow ProductDataRow in productdatatable.Rows)
{
DanskoPrice =3D
Convert.ToDecimal(ProductDataRow["Price"].ToString());
Danskobrandname =3D
ProductDataRow["BrandName"].ToString();
if ((Danskobrandname.Contains("Dansko")) &&
(DanskoPrice > 100))
{
Dansko_chkbx.Visible =3D true;
}
else
{
Dansko_chkbx.Visible =3D false;
}
}
----------------------------------------------
On Apr 10, 6:24=A0am, "Michel Racicot" wrote:
> In that case, maybe the problem resides in the browsing of all item in the=
> cart.
>
> Paste your stored procedure / SQL Code that must evaluate all items in the=
> cart and the code that handles the checkbox and maybe we can help you.
>
> "duncfair" wrote in message
>
> news:236b2ede-ac1c-4fa7-9ed2-8446cdac1c54@q27g2000prf.google groups.com...
> Server side solution.
>
> Data is MS SQL server and all datasets, etc. are accessed via stored
> procedures.
>
> On Apr 9, 11:59 am, "Michel Racicot" wrote:
>
>
>
> > That highly depends on two factors:
>
> > -Do you want to do this client side or server side?
> > -How is your data organized?
>
> > "duncfair" wrote in message
>
> >news:2c30ce99-395d-43f9-b0dd-a714047c6ed7@x19g2000prg.googl egroups.com...=
>
> > > asp.net 2.0 and language is c#
>
> > > I need to add a single checkbox on an aspx page based on evaluating
> > > two aspects of the items the customer has placed in the shopping
> > > cart.
>
> > > The price must be $100 or more and the brand must be a specific
> > > brand.
> > > There may be multiple items in the cart but there can be only one
> > > checkbox. I wrote some code on the codebehind, but it only evaluates
> > > the last item in the cart. How can I evaluate all o the items?
>
> > > Thanks in advance for any help.- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
Re: visible=true evaluation
am 11.04.2008 21:55:25 von Michel Racicot
This is the problem ...
You keep changing the visibility of your checkbox at every row because
Dansko_chkbx.Visible is set inside the foreach statement!!! (and it will be
set for every row, so the value it will get at the end will indeed be for
the last iteration of your foreach)
"duncfair" wrote in message
news:b75bdad2-e7bc-4b36-b5f1-e4ddc8179bac@i36g2000prf.google groups.com...
The stored procedure is fine; SQL programming is my comfort zone.
Here is the code:
-------------------------------------------------------
Dansko_chkbx.Visible = false;
ProductDetailTableAdapter productadp = new
ProductDetailTableAdapter();
DataTable productdatatable =
productadp.GetDanskoProductDetailById(Convert.ToInt32(Orderi d.ToString()));
foreach (DataRow ProductDataRow in productdatatable.Rows)
{
DanskoPrice =
Convert.ToDecimal(ProductDataRow["Price"].ToString());
Danskobrandname =
ProductDataRow["BrandName"].ToString();
if ((Danskobrandname.Contains("Dansko")) &&
(DanskoPrice > 100))
{
Dansko_chkbx.Visible = true;
}
else
{
Dansko_chkbx.Visible = false;
}
}
----------------------------------------------
On Apr 10, 6:24 am, "Michel Racicot" wrote:
> In that case, maybe the problem resides in the browsing of all item in the
> cart.
>
> Paste your stored procedure / SQL Code that must evaluate all items in the
> cart and the code that handles the checkbox and maybe we can help you.
>
> "duncfair" wrote in message
>
> news:236b2ede-ac1c-4fa7-9ed2-8446cdac1c54@q27g2000prf.google groups.com...
> Server side solution.
>
> Data is MS SQL server and all datasets, etc. are accessed via stored
> procedures.
>
> On Apr 9, 11:59 am, "Michel Racicot" wrote:
>
>
>
> > That highly depends on two factors:
>
> > -Do you want to do this client side or server side?
> > -How is your data organized?
>
> > "duncfair" wrote in message
>
> >news:2c30ce99-395d-43f9-b0dd-a714047c6ed7@x19g2000prg.googl egroups.com...
>
> > > asp.net 2.0 and language is c#
>
> > > I need to add a single checkbox on an aspx page based on evaluating
> > > two aspects of the items the customer has placed in the shopping
> > > cart.
>
> > > The price must be $100 or more and the brand must be a specific
> > > brand.
> > > There may be multiple items in the cart but there can be only one
> > > checkbox. I wrote some code on the codebehind, but it only evaluates
> > > the last item in the cart. How can I evaluate all o the items?
>
> > > Thanks in advance for any help.- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
Re: visible=true evaluation
am 12.04.2008 00:38:19 von duncfair
OK. So how do I evaluate if any of the rows meet the criteria?
On Apr 11, 12:55=A0pm, "Michel Racicot" wrote:
> This is the problem ...
>
> You keep changing the visibility of your checkbox at every row because
> Dansko_chkbx.Visible is set inside the foreach statement!!! =A0(and it wil=
l be
> set for every row, so the value it will get at the end will indeed be for
> the last iteration of your foreach)
>
> "duncfair" wrote in message
>
> news:b75bdad2-e7bc-4b36-b5f1-e4ddc8179bac@i36g2000prf.google groups.com...
> The stored procedure is fine; SQL programming is my comfort zone.
>
> Here is the code:
>
> -------------------------------------------------------
>
> =A0 =A0 =A0 =A0 =A0 =A0 Dansko_chkbx.Visible =3D false;
> =A0 =A0 =A0 =A0 =A0 =A0 ProductDetailTableAdapter productadp =3D new
> ProductDetailTableAdapter();
> =A0 =A0 =A0 =A0 =A0 =A0 DataTable productdatatable =3D
> productadp.GetDanskoProductDetailById(Convert.ToInt32(Orderi d.ToString()))=
;
> =A0 =A0 =A0 =A0 =A0 =A0 foreach (DataRow ProductDataRow in productdatatabl=
e.Rows)
> =A0 =A0 =A0 =A0 =A0 =A0 {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 DanskoPrice =3D
> Convert.ToDecimal(ProductDataRow["Price"].ToString());
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Danskobrandname =3D
> ProductDataRow["BrandName"].ToString();
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((Danskobrandname.Contains("Dansko")) =
=A0&&
> (DanskoPrice > 100))
> {
> Dansko_chkbx.Visible =3D true;}
>
> else
> {
> Dansko_chkbx.Visible =3D false;}
>
> =A0 =A0 =A0 =A0 =A0 =A0 }
>
> ----------------------------------------------
>
> On Apr 10, 6:24 am, "Michel Racicot" wrote:
>
>
>
> > In that case, maybe the problem resides in the browsing of all item in t=
he
> > cart.
>
> > Paste your stored procedure / SQL Code that must evaluate all items in t=
he
> > cart and the code that handles the checkbox and maybe we can help you.
>
> > "duncfair" wrote in message
>
> >news:236b2ede-ac1c-4fa7-9ed2-8446cdac1c54@q27g2000prf.googl egroups.com...=
> > Server side solution.
>
> > Data is MS SQL server and all datasets, etc. are accessed via stored
> > procedures.
>
> > On Apr 9, 11:59 am, "Michel Racicot" wrote:
>
> > > That highly depends on two factors:
>
> > > -Do you want to do this client side or server side?
> > > -How is your data organized?
>
> > > "duncfair" wrote in message
>
> > >news:2c30ce99-395d-43f9-b0dd-a714047c6ed7@x19g2000prg.googl egroups.com.=
...
>
> > > > asp.net 2.0 and language is c#
>
> > > > I need to add a single checkbox on an aspx page based on evaluating
> > > > two aspects of the items the customer has placed in the shopping
> > > > cart.
>
> > > > The price must be $100 or more and the brand must be a specific
> > > > brand.
> > > > There may be multiple items in the cart but there can be only one
> > > > checkbox. I wrote some code on the codebehind, but it only evaluates=
> > > > the last item in the cart. How can I evaluate all o the items?
>
> > > > Thanks in advance for any help.- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
Re: visible=true evaluation
am 14.04.2008 15:56:09 von Michel Racicot
Sorry to tell you that but this is beginner's stuff... I highly suggest that
you try to understand what you're doing a little better before.
There is several way to achieve the result.
Since it can be for a school project and I don't want to give the answer
crudely, here comes a hint for one possible solution:
You can use a variable.
Another hint for another possible solution:
When if ((Danskobrandname.Contains("Dansko")) && (DanskoPrice > 100)) is
true, you don't even have to evaluate the reminder items. It saves some
iterations...
Good luck.
"duncfair" wrote in message
news:78faa082-29d4-4442-b24f-09a560357341@p39g2000prm.google groups.com...
OK. So how do I evaluate if any of the rows meet the criteria?
On Apr 11, 12:55 pm, "Michel Racicot" wrote:
> This is the problem ...
>
> You keep changing the visibility of your checkbox at every row because
> Dansko_chkbx.Visible is set inside the foreach statement!!! (and it will
> be
> set for every row, so the value it will get at the end will indeed be for
> the last iteration of your foreach)
>
> "duncfair" wrote in message
>
> news:b75bdad2-e7bc-4b36-b5f1-e4ddc8179bac@i36g2000prf.google groups.com...
> The stored procedure is fine; SQL programming is my comfort zone.
>
> Here is the code:
>
> -------------------------------------------------------
>
> Dansko_chkbx.Visible = false;
> ProductDetailTableAdapter productadp = new
> ProductDetailTableAdapter();
> DataTable productdatatable =
> productadp.GetDanskoProductDetailById(Convert.ToInt32(Orderi d.ToString()));
> foreach (DataRow ProductDataRow in productdatatable.Rows)
> {
> DanskoPrice =
> Convert.ToDecimal(ProductDataRow["Price"].ToString());
> Danskobrandname =
> ProductDataRow["BrandName"].ToString();
>
> if ((Danskobrandname.Contains("Dansko")) &&
> (DanskoPrice > 100))
> {
> Dansko_chkbx.Visible = true;}
>
> else
> {
> Dansko_chkbx.Visible = false;}
>
> }
>
> ----------------------------------------------
>
> On Apr 10, 6:24 am, "Michel Racicot" wrote:
>
>
>
> > In that case, maybe the problem resides in the browsing of all item in
> > the
> > cart.
>
> > Paste your stored procedure / SQL Code that must evaluate all items in
> > the
> > cart and the code that handles the checkbox and maybe we can help you.
>
> > "duncfair" wrote in message
>
> >news:236b2ede-ac1c-4fa7-9ed2-8446cdac1c54@q27g2000prf.googl egroups.com...
> > Server side solution.
>
> > Data is MS SQL server and all datasets, etc. are accessed via stored
> > procedures.
>
> > On Apr 9, 11:59 am, "Michel Racicot" wrote:
>
> > > That highly depends on two factors:
>
> > > -Do you want to do this client side or server side?
> > > -How is your data organized?
>
> > > "duncfair" wrote in message
>
> > >news:2c30ce99-395d-43f9-b0dd-a714047c6ed7@x19g2000prg.googl egroups.com...
>
> > > > asp.net 2.0 and language is c#
>
> > > > I need to add a single checkbox on an aspx page based on evaluating
> > > > two aspects of the items the customer has placed in the shopping
> > > > cart.
>
> > > > The price must be $100 or more and the brand must be a specific
> > > > brand.
> > > > There may be multiple items in the cart but there can be only one
> > > > checkbox. I wrote some code on the codebehind, but it only evaluates
> > > > the last item in the cart. How can I evaluate all o the items?
>
> > > > Thanks in advance for any help.- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
Re: visible=true evaluation
am 14.04.2008 17:21:00 von duncfair
Thanks! I will end the loop when I get a 'true'.
Unfortunately, it's not a school project. I am a sql db programmer
struggling through web development tasks.
On Apr 14, 6:56=A0am, "Michel Racicot" wrote:
> Sorry to tell you that but this is beginner's stuff... I highly suggest th=
at
> you try to understand what you're doing a little better before.
>
> There is several way to achieve the result.
>
> Since it can be for a school project and I don't want to give the answer
> crudely, here comes a hint for one possible solution:
>
> You can use a variable.
>
> Another hint for another possible solution:
>
> When if ((Danskobrandname.Contains("Dansko")) && (DanskoPrice > 100)) is
> true, you don't even have to evaluate the reminder items. =A0It saves some=
> iterations...
>
> Good luck.
>
> "duncfair" wrote in message
>
> news:78faa082-29d4-4442-b24f-09a560357341@p39g2000prm.google groups.com...
> OK. So how do I evaluate if any of the rows meet the criteria?
>
> On Apr 11, 12:55 pm, "Michel Racicot" wrote:
>
>
>
> > This is the problem ...
>
> > You keep changing the visibility of your checkbox at every row because
> > Dansko_chkbx.Visible is set inside the foreach statement!!! (and it will=
> > be
> > set for every row, so the value it will get at the end will indeed be fo=
r
> > the last iteration of your foreach)
>
> > "duncfair" wrote in message
>
> >news:b75bdad2-e7bc-4b36-b5f1-e4ddc8179bac@i36g2000prf.googl egroups.com...=
> > The stored procedure is fine; SQL programming is my comfort zone.
>
> > Here is the code:
>
> > -------------------------------------------------------
>
> > Dansko_chkbx.Visible =3D false;
> > ProductDetailTableAdapter productadp =3D new
> > ProductDetailTableAdapter();
> > DataTable productdatatable =3D
> > productadp.GetDanskoProductDetailById(Convert.ToInt32(Orderi d.ToString()=
));
> > foreach (DataRow ProductDataRow in productdatatable.Rows)
> > {
> > DanskoPrice =3D
> > Convert.ToDecimal(ProductDataRow["Price"].ToString());
> > Danskobrandname =3D
> > ProductDataRow["BrandName"].ToString();
>
> > if ((Danskobrandname.Contains("Dansko")) &&
> > (DanskoPrice > 100))
> > {
> > Dansko_chkbx.Visible =3D true;}
>
> > else
> > {
> > Dansko_chkbx.Visible =3D false;}
>
> > }
>
> > ----------------------------------------------
>
> > On Apr 10, 6:24 am, "Michel Racicot" wrote:
>
> > > In that case, maybe the problem resides in the browsing of all item in=
> > > the
> > > cart.
>
> > > Paste your stored procedure / SQL Code that must evaluate all items in=
> > > the
> > > cart and the code that handles the checkbox and maybe we can help you.=
>
> > > "duncfair" wrote in message
>
> > >news:236b2ede-ac1c-4fa7-9ed2-8446cdac1c54@q27g2000prf.googl egroups.com.=
...
> > > Server side solution.
>
> > > Data is MS SQL server and all datasets, etc. are accessed via stored
> > > procedures.
>
> > > On Apr 9, 11:59 am, "Michel Racicot" wrote:
>
> > > > That highly depends on two factors:
>
> > > > -Do you want to do this client side or server side?
> > > > -How is your data organized?
>
> > > > "duncfair" wrote in message
>
> > > >news:2c30ce99-395d-43f9-b0dd-a714047c6ed7@x19g2000prg.googl egroups.co=
m...
>
> > > > > asp.net 2.0 and language is c#
>
> > > > > I need to add a single checkbox on an aspx page based on evaluatin=
g
> > > > > two aspects of the items the customer has placed in the shopping
> > > > > cart.
>
> > > > > The price must be $100 or more and the brand must be a specific
> > > > > brand.
> > > > > There may be multiple items in the cart but there can be only one
> > > > > checkbox. I wrote some code on the codebehind, but it only evaluat=
es
> > > > > the last item in the cart. How can I evaluate all o the items?
>
> > > > > Thanks in advance for any help.- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -