How/where have you declared

objShoppingCart?



On 10/23/05, reg_barbara <[EMAIL PROTECTED]> wrote:
> Good morning,
>
> This code was jumbled together in HTML(but it worked). I'm bringing
> it into VS 1.1.
> I noticed that you can't get away with certain things in VS.
>
> Could someone explain why:
>
> ATC1.UserControls.Shoppingcart does not contain a definition
> of "Add", "Remove" , "Items"
>
> The intellisence recognizes it, and when doing a "go to definition"
> it jumps to the appropriate function?
>
> the Items issue:
>
> private void Page_PreRender(Object sender , EventArgs e)
> {
>   if ( objShoppingCart.Items.Count == 0 )
>   {
>     btnCheckOut.Visible = false;
>   }
>   else
>   {
>     btnCheckOut.Visible = true;
>     btnCheckOut.NavigateUrl = string.Format("~/CheckOut.aspx?cat=
> {0}", intCategory );
>   }
> }
>
>
>
>
> public DataView Items
> {
>   get { return _dstCart.Tables["Cart"].DefaultView ;}
> }
>
>
> public void Remove( int ItemIndex )
> {
>  _dstCart.Tables["Cart"].Rows[ItemIndex].Delete();
>  UpdateCartDB();
> }
>
>
> public void Add( int ProductID, string  ProductName, Decimal
> UnitPrice )
> {
> bool blnMatch = false;
>  DataRow drowItem;
>
> foreach (DataRow row in _dstCart.Tables["Cart"].Rows)
> {
>  if ( (int)row["ProductID"] == ProductID )
>    {
>    row["Quantity"] = (int)row["Quantity"]+1;
>    blnMatch = true;
>   }
> }
>
> if (! blnMatch ) {
>   drowItem = _dstCart.Tables["Cart"].NewRow();
>   drowItem["UserID"] = _guidUserID;
>   drowItem["ProductID"] = ProductID;
>   drowItem["ProductName"] = ProductName ;
>   drowItem["UnitPrice"] = UnitPrice;
>   drowItem["Quantity"] = 1;
>   _dstCart.Tables["Cart"].Rows.Add( drowItem );
>  }
>   UpdateCartDB();
>  }
>
>
> Thanking you in advance,
>
>
>
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>


--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to