| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 501 人关注过本帖
标题:求高手 帮忙翻译下C#代码
只看楼主 加入收藏
kid105203963
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-1-14
结帖率:0
收藏
已结贴  问题点数:20 回复次数:2 
求高手 帮忙翻译下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");
    }
}


 
搜索更多相关主题的帖子: 翻译 代码 
2010-01-14 17:14
zhangwc
Rank: 2
等 级:论坛游民
帖 子:49
专家分:67
注 册:2008-6-11
收藏
得分:10 
发错了。
2010-01-14 17:24
saitor
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
威 望:5
帖 子:373
专家分:1520
注 册:2009-5-18
收藏
得分:10 
标你看不懂的说下,没调用的类的代码,难道让人猜?
2010-01-14 19:29
快速回复:求高手 帮忙翻译下C#代码
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028064 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved