代码怎么写,求高手指导
解决方案 »
- 特定ID下面的checkbox用jQuery如何选择?
- web客户端文件批量下载的问题
- 请问ASP.NET中模块的作用是什么?
- 将Word文档转化为HTML格式的文档---存取拒絕!!!!!!!!!!!!!
- asp.net 读取EXCEL文件出现问题,
- WEB自定义控件问题
- 我公司的iis服务器正在运行,我自己做了一个小网站,想发布,我只是把本机的一些文件拷到手工建的一个网站下,系统能运行,但经常出错.我只要
- 请问如何在模板列中控制数据?
- 急~ASP.NET怎么隐藏窗体?
- asp.net中只能有一个runet=server的form的问题
- 大家小心点 CSDN出现一个打字兼职的广告是骗子
- 新人求教一个问题。。
实例到51aspx.com里看看
其实昨天我打了一段代码回复你的时候 csdn提示正在升级 气死了
protected void Button1_Click(object sender, EventArgs e)
{
//添加订单
Model.Orders o = new Model.Orders();
o.O_ID = DateTime.Now.ToString().Replace("-", "").Replace("-","");
o.O_Email = Session["email"].ToString();
o.O_ReceiveName = TextBox2.Text;
o.O_Phone = TextBox3.Text;
o.O_PostalCode = TextBox5.Text;
o.O_Address = TextBox4.Text;
o.O_OrderDate = DateTime.Now;
o.O_IsDeal = false;
o.O_IsPaid = false;
BLL.Orders.InsertOrders(o);
//添加订单明细
Dictionary<int, int> cart = (Dictionary<int, int>)Session["cart"];
var OrderDetailsQuery =
from order in cart
let p = BLL.Product.GetAllProductByP_ID(order.Key)
select new Model.OrderDetails { O_ID = o.O_ID, P_ID = p.P_ID, P_Name = p.P_Name, P_SalePrice = p.P_SalePrice, OD_Quantity=order.Value };
if (BLL.OrderDetails.InsertAllArderDetails(OrderDetailsQuery))
{
this.ClientScript.RegisterStartupScript(this.GetType(), "a", "alert('您的订单已提交,请耐心等待处理。');", true);
}
else
{
this.ClientScript.RegisterStartupScript(this.GetType(), "a", "alert('提交失败!');", true);
}
}当然都是调用的业务逻辑层的方法,比较简单的添加查询方法