有如下代码:如果OrderList.count中的长度有n长,也就是说OrderList里面有n个数,而哪个循环把每个数都会过一遍那subtotal.Text
和Total.Text 里面应该显示哪个数据的价格。
void updateshopchart()
{
ArrayList OrderList;
ArrayList qtyList;
int productId;
DataRow product;
double subt;
double tal;
double de = 0.9;
OrderList = (ArrayList)Session["orderList"];
qtyList = (ArrayList)Session["qtyList"];
subt = 0;
for (int i = 0; i <= OrderList.Count - 1; i++)
{
productId = (int)OrderList[i];
product = GetProduct(productId);
subt += double.Parse(product["price"].ToString()) * double.Parse(qtyList[i].ToString());
}
tal = subt * de;
subtotal.Text = string.Format("{0:C}", subt);
dec.Text = de.ToString();
Total.Text = string.Format("{0:C}", tal);
}
和Total.Text 里面应该显示哪个数据的价格。
void updateshopchart()
{
ArrayList OrderList;
ArrayList qtyList;
int productId;
DataRow product;
double subt;
double tal;
double de = 0.9;
OrderList = (ArrayList)Session["orderList"];
qtyList = (ArrayList)Session["qtyList"];
subt = 0;
for (int i = 0; i <= OrderList.Count - 1; i++)
{
productId = (int)OrderList[i];
product = GetProduct(productId);
subt += double.Parse(product["price"].ToString()) * double.Parse(qtyList[i].ToString());
}
tal = subt * de;
subtotal.Text = string.Format("{0:C}", subt);
dec.Text = de.ToString();
Total.Text = string.Format("{0:C}", tal);
}
解决方案 »
- 讨论MVC3中<input type="checkbox"...
- 客户端已安装powerpoint,怎么直接在页面显示ppt,而不是弹出下载提示框图
- 可以插入广告的Flash视频播放器
- asp.net中WEB应用程序开发,新建项目所选模板有哪些区别?
- (挑战智慧)asp.net 中调用存储过程很奇怪的问题
- ASP.NET2.0的上传文件代码?
- 加框里面的东西老是出错,循环利用OleDbcommand只换条件的查询应该怎么写?
- 将图片上传变小存入数据库(C#写ASP.NET)怎么实现
- 日期函数问题!!!
- 请问:在一张网页中对象(new)该怎样进行释放内存???
- 有点难度的显示问题!!!!
- checkboxList 勾选筐颜色
取到的是3个的和
我要的就是这个意思,谢谢各位同仁的帮助!!