求高手 帮忙翻译下C#代码
这是一个购物车的后台代码。。我很多看不懂。。下面有注释的是直接复制老师的
希望有高手能帮忙翻译下 注释下
急求 希望8点前能翻译好。。
Check2..aspx.cs
using eb;
public partial class check2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
GridView1.DataSource = Profile.ProfileShoppingCart.CartItems;
GridView1.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
order myorder = new order();
DateTime time_order = DateTime.Now;
myorder.save_order(time_order, txtUserName.Text, txtGetName.Text, txtAddress.Text, txtTel.Text);
int orderid = myorder.getorderid(time_order);
for (int i = 0; i <= (GridView1.Rows.Count - 1); i++)
{
int productid = Convert.ToInt16(GridView1.DataKeys[i].Value);
decimal price = Convert.ToDecimal(GridView1.Rows[i].Cells[1].Text);
int quantity = Convert.ToInt16(GridView1.Rows[i].Cells[2].Text);
orderlist myorderlist = new orderlist();
myorderlist.save_orderlist(orderid, productid, price, quantity);
}
}
}
shopcart2.aspx.cs
using eb;
public partial class shopcart2 : System.Web.UI.Page
{
private static ProfileBase mProfile;
protected void Page_Load(object sender, EventArgs e)
{
//ProfileCommon p = new ProfileCommon();
if (!User.Identity.IsAuthenticated)
{
Response.Redirect("login3.aspx");
}
if (!IsPostBack)
{
int ID = Convert.ToInt16(Request.QueryString["prdid"]);
String Name = Convert.ToString(Request.QueryString["prdname"]);
decimal Price = Convert.ToDecimal(Request.QueryString["prdprice"]);
if (Profile.ProfileShoppingCart == null)
{
Profile.ProfileShoppingCart = new ProfileShoppingCart();
}
Profile.ProfileShoppingCart.AddItem(ID, Name, Price);
Label1.Text = Convert.ToString(Profile.ProfileShoppingCart.Total());
Profile.Save();
CartGrid.DataSource = Profile.ProfileShoppingCart.CartItems;
CartGrid.DataBind();
}
}
protected void RemoveCartItem(object sender, EventArgs e)
{
int ID = (int)CartGrid.SelectedDataKey.Value;
Profile.ProfileShoppingCart.RemoveItem(ID);
Label1.Text = Convert.ToString(Profile.ProfileShoppingCart.Total());
CartGrid.DataSource = Profile.ProfileShoppingCart.CartItems;
CartGrid.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("moreproduct2.aspx");
}
protected void Button2_Click(object sender, EventArgs e)
{
//Response.Write(Profile.UserName);
ProfileManager.DeleteProfile(Profile.UserName);
CartGrid.DataSource = Profile.ProfileShoppingCart.CartItems;
CartGrid.DataBind();
Label1.Text = "";
}
protected void Button3_Click(object sender, EventArgs e)
{
Response.Redirect("check2.aspx");
}
}