打印本文 打印本文 关闭窗口 关闭窗口
asp.net 实现购物车
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2693  更新时间:2009/4/23 10:43:44  文章录入:mintao  责任编辑:mintao
sp;   nowTable2.Rows[i][4] = Int32.Parse(nowTable2.Rows[i][1].ToString()) * Double.Parse(nowTable2.Rows[i][3].ToString());

    if(ProductIDCheck.Checked)
    {
     nowTable2.Rows[i][5] = 1;//添加删除标记1
     j=j+1;
    }
    
   }
   string strExpr="IsDeleted>0";                     //http://msdn.microsoft.com/library/chs/default.asp?url=/library/CHS/cpref/html/frlrfSystemDataDataTableClassSelectTopic.asp
   DataRow[] foundRows = nowTable2.Select(strExpr);
   for(int m = 0; m < foundRows.Length; m ++)
   {
    //Console.WriteLine(foundRows[i][0]);
    foundRows[m].Delete();
   }
          
            
             
                              
   
   ShoppingCartDlt.DataSource = nowTable2.DefaultView;       
   ShoppingCartDlt.DataBind();
   Session["myCartTable"] = nowTable2;
   Caculator();

  }

  #region Web 窗体设计器生成的代码
  override protected void OnInit(EventArgs e)
  {
   //
   // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
   //
   InitializeComponent();
   base.OnInit(e);
  }
  
  /// <summary>
  /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  /// 此方法的内容。
  /// </summary>
  private void InitializeComponent()
  {   
   this.update.Click += new System.EventHandler(this.update_Click);
   this.CheckOut.Click += new System.EventHandler(this.CheckOut_Click);
   this.Load += new System.EventHandler(this.Page_Load);

  }
  #endregion

  private void update_Click(object sender, System.EventArgs e)
  {
   Update();
  
  }

  private void CheckOut_Click(object sender, System.EventArgs e)
  {
   Update();
   Response.Redirect("checkout.aspx");
  }
 }
}

上一页  [1] [2] [3] 

打印本文 打印本文 关闭窗口 关闭窗口