示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (subTool.CheckUserLogin("-1"))
     {
         userID = WebUnitily.CheckInt(mycookie.getCookiesValue("shop8517User", "userID"));
         if (!IsPostBack)
         {
             if (Request.QueryString["InfoID"] != null && Request.QueryString["InfoID"] != "")
             {
                 InfoID                = Int32.Parse(Request.QueryString["InfoID"]);
                 txtInfoId.Text        = InfoID.ToString();
                 btnAdd.Visible        = false;
                 btnUpdate.Visible     = true;
                 lblAddAcceptAddr.Text = "修改收货人地址";
                 BindUpdateAcceptAddr(InfoID);
             }
             else
             {
                 btnAdd.Visible        = true;
                 btnUpdate.Visible     = false;
                 lblAddAcceptAddr.Text = "添加收货人地址";
             }
         }
     }
 }
示例#2
0
    protected void btnAdd_Click(object sender, ImageClickEventArgs e)
    {
        int addrID = WebUnitily.CheckInt(rbListAddr.SelectedValue);

        if (addrID == 0)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("请您选择收货地址!"));
            return;
        }
        L_AcceptAddrInfo addrinfo = new AcceptAddrInfo().GetBindUpdateAcceptAddr(addrID, userID);

        if (addrinfo == null)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您所选择的收货地址不存在!"));
            return;
        }

        L_OrderListInfo olistinfo = new L_OrderListInfo();

        olistinfo.UserID     = userID;
        olistinfo.AcceptName = addrinfo.RealityName;
        olistinfo.AcceptAddr = addrinfo.Province + addrinfo.City + addrinfo.Country + addrinfo.RowAddr;
        olistinfo.HandSet    = addrinfo.HandSet;
        olistinfo.Tel        = addrinfo.Tel;
        olistinfo.ZipCode    = addrinfo.zipCode;

        olistinfo.OrderTime   = DateTime.Now;
        olistinfo.ShippedTime = DateTime.Now;
        olistinfo.OrderState  = 10; //0代表取消订单  10代表等待付款  20代表已付款 30代表已发货
        olistinfo.IsNew       = 0;  //0 新订单 1一查看
        olistinfo.AdminID     = 0;
        olistinfo.OrderID     = userID.ToString() + DateTime.Now.ToString("yyyyMMddmm");

        int exeResult = order.AddUserOrderItem(olistinfo);

        switch (exeResult)
        {
        case 10:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您的订单提交成功,你需要付款"));
            break;

        case 0:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您的订单提交成功,你需要付款"));
            break;

        case -2:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您的购物车中没有产品,请您选择产品", "UserCard.aspx"));
            break;

        case -3:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您还没有购物车呢,请您先选择产品", "UserCard.aspx"));
            break;

        default:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您的订单提交失败"));
            break;
        }
        BindDataListShoppingRar();
    }
示例#3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (subTool.CheckAdminLogin("20"))
     {
         adminID = WebUnitily.CheckInt(mycookie.getCookiesValue("shop8517Admin", "adminType"));
         if (!IsPostBack)
         {
             BindIndexyifahuo();
         }
     }
 }
示例#4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (subTool.CheckAdminLogin("20"))
     {
         adminID = WebUnitily.CheckInt(mycookie.getCookiesValue("shop8517Admin", "adminID"));
     }
     if (!IsPostBack)
     {
         BindAdminManagerOrderList();
     }
 }
示例#5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         classID = WebUnitily.CheckInt(Request["classID"]);
         keyWord = WebUnitily.CheckStr(Request["keyWord"]);
         orderBy = WebUnitily.CheckStr(Request["orderBy"]);
         BindIndexHelp();
         BindIndexHelpTitle();
     }
 }
示例#6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (subTool.CheckUserLogin("-1"))
     {
         userID = WebUnitily.CheckInt(mycookie.getCookiesValue("shop8517User", "userID"));
         if (!IsPostBack)
         {
             BindIndexOrderListInfo();
         }
     }
 }
示例#7
0
    private void BindIndexHelp()
    {
        StringBuilder sb       = new StringBuilder();
        int           currPage = WebUnitily.CheckInt(Request["p"]);

        if (currPage == 0)
        {
            currPage = 1;
        }

        L_PageList pl = new L_PageList();

        pl.Currpage             = currPage;
        pl.PageSize             = 10;
        new8517PageList.CurPage = currPage;
        //select helpID,helptitle,postTime from ShopHelp where isPost=1
        pl.TableName = " ShopHelp";
        pl.PKey      = " helpID";
        pl.FieldList = " helpID,helptitle,postTime";

        if (classID != 0)
        {
            pl.Conditon = " and classID=" + classID + " or ParentIDRoute like '%/,'+CAST(" + classID + " as varchar(10))+'/,%' ESCAPE '/'";
        }
        if (keyWord != "")
        {
            pl.Conditon = " and HelpTitle like '%" + keyWord + "%'";
        }
        pl.Conditon = " and isPost=1";
        if (orderBy == "")
        {
            pl.OrderBy = " postTime desc";
        }

        longyuan_TableUpDateFieldsInfo tb = new longyuan_TableUpDateFieldsInfo();
        DataSet dSet = tb.GetPageList(pl);

        if (dSet.Tables.Count > 0)
        {
            if (dSet.Tables[0].Rows.Count > 0)
            {
                ddlBindIndexHelpInfo.DataSource = dSet.Tables[0];
                ddlBindIndexHelpInfo.DataBind();
                new8517PageList.TotalPage = int.Parse(tb.PageCount.ToString());
            }
            else
            {
                new8517PageList.Visible      = false;
                ddlBindIndexHelpInfo.Visible = false;
                lbInfo.Visible = true;
                lbInfo.Text    = "此类别还没有帮助主题呢!!";
            }
        }
    }
示例#8
0
    private void changeBuyNum()
    {
        StringBuilder sb    = new StringBuilder();
        L_CartInfo    cInfo = new L_CartInfo();

        cInfo.UserID    = userID;
        cInfo.CartID    = WebUnitily.CheckStr(Request["cartID"]);
        cInfo.ProductID = WebUnitily.CheckInt(Request["PId"]);
        cInfo.BugNum    = WebUnitily.CheckInt(Request["BuyNum"]);

        DataSet Set = cartinfo.GetUpdateShoppingNumMoney(cInfo);

        sb.Append("<table style=\" width:100%; margin-top:5px; padding:5px; border:none;\" cellpadding=\"0\" cellspacing=\"0\">");
        if (Set.Tables.Count > 0)
        {
            string proName;
            sb.Append("<tr class=\"cartListTitle\"><td>商品名称/图片</td><td class=\"FieldName100\">单价</td><td class=\"FieldName120\">数量</td><td class=\"FieldName120\">本商品合计</td><td class=\"FieldName80\"> 操作</td></tr>");
            for (int i = 0; i < Set.Tables[0].Rows.Count; i++)
            {
                DataRow drv = Set.Tables[0].Rows[i];
                sb.Append("<tr>");
                sb.Append("<tr class=\"cartListRow\">");
                if (drv["ProSmallPath"].ToString() != "")
                {
                    sb.Append("<td><img src=\"" + "../photo/" + drv["ProSmallPath"] + "\" alt=\"产品图片\" />");
                }
                else
                {
                    sb.Append("<td><img src=\"/Images/Erro.png\" alt=\"产品图片\" />");
                }
                proName = drv["ProductName"].ToString();
                if (proName.Length > 20)
                {
                    proName = proName.Substring(0, 20);
                }
                sb.Append("<p class=\"wenzi\"><a href=\"../product/ProductInfo.aspx?PId=" + drv["ProductID"] + "\" title=" + drv["ProductName"] + "\" target=\"_blank\">" + proName + "</a></p></td>");
                sb.Append("<td class=\"FieldName100\">" + string.Format("{0:C2}", drv["MenberPrince"]) + "</td>");
                sb.Append("<td class=\"FieldName120\"><input id=\"txtBuyNum_" + drv["ProductId"] + "\" type=\"text\" class=\"input\" maxlength=\"5\" style=\"width:50px;\" onblur=\"Cart8517.ChangeBuyNum('" + drv["CartID"] + "'," + drv["ProductID"] + ");\" value=\"" + drv["BuyNum"] + "\" /></td>");
                sb.Append("<td class=\"FieldName120\"><span class=\"red\">" + string.Format("{0:C2}", drv["MoneyAmount"]) + "</span></td>");
                sb.Append("<td class=\"FieldName80\"><a href=\"javascript:void(0);\" onclick=\"Cart8517.DelCartProduct('" + drv["CartID"] + "','" + drv["ProductID"] + "');\" title=\"删除\">删除</a></td>");
                sb.Append("</tr>");
            }
            sb.Append("<tr class=\"cartListRow\"><td colspan=\"5\" style=\"text-align:right;\">总价(包含运费):<span class=\"red\">" + string.Format("{0:C2}", Set.Tables[1].Rows[0]["MoneyTotal"]) + "</span>元</td></tr>");
        }
        else
        {
            sb.Append("<tr class=\"cartListRow\"><td colspan=\"5\" style=\"text-align:right;\"><div class=\"NoInfo\">您还没有购买产品!!</div></td></tr>");
        }
        sb.Append("</table>");

        Response.Write(sb.ToString());
        Response.End();
    }
示例#9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     classID = WebUnitily.CheckInt(Request["ClassId"]);
     bindClassList();
     if (Request.QueryString["Order"] == null)
     {
     }
     else
     {
         order = Request.QueryString["Order"].ToString();
     }
 }
示例#10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (subTool.CheckUserLogin("-1"))
     {
         userID = WebUnitily.CheckInt(mycookie.getCookiesValue("shop8517User", "userID"));
         if (!IsPostBack)
         {
             BindIndexHotShopping();
             BindDataListShoppingRar();
             BindAcceptAddrList();
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         Int32 Id = WebUnitily.CheckInt(Request["Id"]);
         if (Id == 0)
         {
             Response.Write(WebUnitily.AlertUrl("请选择产品", "/"));
             Response.End();
         }
         bindDataInfo(Id);
     }
 }
示例#12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int infoID = WebUnitily.CheckInt(Request["helpID"]);
         if (infoID == 0)
         {
             Response.Write(WebUnitily.AlertUrl("请您选择帮助主题", "HelpList.aspx"));
             Response.End();
         }
         BindIndexHelpTitle();
         BindHelpInfo(infoID);
     }
 }
示例#13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int PId = WebUnitily.CheckInt(Request["PId"]);
         ViewState["PID"] = PId;
         if (PId == 0)
         {
             Response.Write(WebUnitily.AlertUrl("请选择产品", "ProductList.aspx"));
             Response.End();
         }
         txtId.Text = PId.ToString();
         GetBindTuiJian();
         BindProductInfoByProductID(PId);
     }
 }
示例#14
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        L_AcceptAddrInfo acceptinfo = new L_AcceptAddrInfo();

        acceptinfo.ProvinceID = WebUnitily.CheckInt(Request.Form["ProvinceId"]);
        acceptinfo.Province   = WebUnitily.CheckStr(txtProvince.Text.Trim());
        acceptinfo.CityID     = WebUnitily.CheckInt(Request.Form["CityId"]);
        acceptinfo.City       = WebUnitily.CheckStr(txtcity.Text.Trim());
        acceptinfo.CountryID  = WebUnitily.CheckInt(Request.Form["CountyId"]);
        acceptinfo.Country    = WebUnitily.CheckStr(txtCountry.Text.Trim());

        acceptinfo.RowAddr     = WebUnitily.CheckStr(txtRowAddr.Text.Trim());
        acceptinfo.RealityName = WebUnitily.CheckStr(txtRealityName.Text.Trim());
        acceptinfo.HandSet     = WebUnitily.CheckStr(txtHandset.Text.Trim());
        acceptinfo.Tel         = WebUnitily.CheckStr(txtDel.Text.Trim());
        acceptinfo.zipCode     = WebUnitily.CheckStr(txtZipCode.Text.Trim());
        acceptinfo.QQNum       = WebUnitily.CheckStr(txtQQMath.Text.Trim());

        acceptinfo.UserID   = userID;
        acceptinfo.PostTime = DateTime.Now;

        int exeResult = accept.InsertAcceptAddr(acceptinfo);

        switch (exeResult)
        {
        case 1:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("收货地址添加成功!"));
            break;

        case 0:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("收货地址最多只能添加10个,请您检查!"));
            break;

        default:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("收货地址添加失败,请您检查!"));
            break;
        }
        txtcity.Text        = "";
        txtCountry.Text     = "";
        txtDel.Text         = "";
        txtHandset.Text     = "";
        txtProvince.Text    = "";
        txtQQMath.Text      = "";
        txtRealityName.Text = "";
        txtRowAddr.Text     = "";
        txtZipCode.Text     = "";
    }
示例#15
0
    protected void linkDelete_Click(object sender, EventArgs e)
    {
        L_CartInfo cart = new L_CartInfo();

        cart.UserID    = userID;
        cart.CartID    = WebUnitily.CheckStr(Request["CardID"]);
        cart.ProductID = WebUnitily.CheckInt(Request["PId"]);
        if (cartinfo.GetCartListDelete(cart) == 1)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("购物车中的商品删除成功!"));
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("商品删除失败!"));
        }
        BindIndexShoppingCartInfo();
    }
示例#16
0
    private void BindIndexOrderListInfo()
    {
        StringBuilder sb = new StringBuilder();

        int currPage = WebUnitily.CheckInt(Request["p"]);

        if (currPage == 0)
        {
            currPage = 1;
        }

        L_PageList pl = new L_PageList();

        pl.Currpage       = currPage;
        pl.PageSize       = 16;
        pList8517.CurPage = currPage;

        pl.TableName = " (OrderList as a Left Join (Select orderID,Sum(memberPrice*discount) as PriceTotal,Sum(freign) as FreightTotal From orderDetail group by orderID) as b On b.orderID=a.orderID) ";
        pl.PKey      = " a.orderID ";
        pl.FieldList = " a.orderID,a.userID,isNew,orderState,orderTime,ISNULL(b.PriceTotal,0) as PriceTotal,ISNULL(b.FreightTotal,0) as FreightTotal ";
        pl.Conditon  = " and orderState=10 and userID= " + userID;
        pl.OrderBy   = " orderTime Desc ";

        TableUpDateFieldsInfo tb = new TableUpDateFieldsInfo();
        DataSet dSet             = tb.GetPageList(pl);

        if (dSet.Tables.Count > 0)
        {
            if (dSet.Tables[0].Rows.Count > 0)
            {
                gvBindOrderListInfo.DataSource   = dSet.Tables[0];
                gvBindOrderListInfo.DataKeyNames = new string[] { "orderID" };
                gvBindOrderListInfo.DataBind();

                pList8517.TotalPage = int.Parse(tb.PageCount.ToString());
            }
            else
            {
                gvBindOrderListInfo.DataBind();
            }
        }
        else
        {
            gvBindOrderListInfo.DataBind();
        }
    }
示例#17
0
    private void BindProduct()
    {
        int currPage = WebUnitily.CheckInt(Request["p"]);  //获取所请求页的索引

        if (currPage == 0)
        {
            currPage = 1;
        }

        L_PageList p1 = new L_PageList();

        p1.Currpage = currPage;
        p1.PageSize = 15;

        //获取分页的用户控件
        pList8517.CurPage = currPage;

        p1.TableName = "Product";
        p1.PKey      = "productID";
        p1.FieldList = "productID,productName,categoryName,productImage,currentPrice,menberPrice,danwei,productStore,remainDay,addTime,isPost,isCommend";
        // p1.Conditon = " and isPost=1";
        p1.OrderBy = " addTime Desc";

        TableUpDateFieldsInfo tb = new TableUpDateFieldsInfo();
        DataSet dsSet            = tb.GetPageList(p1);

        if (dsSet.Tables.Count > 0)
        {
            if (dsSet.Tables[0].Rows.Count > 0)
            {
                gvProduct.DataSource   = dsSet.Tables[0];
                gvProduct.DataKeyNames = new string[] { "ProductID" };
                gvProduct.DataBind();
                pList8517.TotalPage = int.Parse(tb.PageCount.ToString());
            }
            else
            {
                gvProduct.DataBind();
            }
        }
        else
        {
            gvProduct.DataBind();
        }
    }
示例#18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (subTool.CheckUserLogin("-1"))
        {
            userID = WebUnitily.CheckInt(mycookie.getCookiesValue("shop8517User", "userID"));
            string requestType = WebUnitily.CheckStr(Request.Form["RequestType"]);  //获取窗体变量的集合

            switch (requestType)
            {
            case "add":
                userAddCart();
                break;

            case "change":
                break;
            }
        }
    }
示例#19
0
    private void BindIndexyifahuo()
    {
        StringBuilder sb       = new StringBuilder();
        int           currPage = WebUnitily.CheckInt(Request["p"]);

        if (currPage == 0)
        {
            currPage = 1;
        }

        L_PageList pl = new L_PageList();

        pl.Currpage = currPage;
        pl.PageSize = 15;

        plist8571.CurPage = currPage;

        pl.TableName = "(OrderList as a Left Join (Select orderID,sum(memberPrice*BugNum*DisCount) as PriceTotal,sum(freign) as freightTotal From OrderDeTail Group by orderID) as b on b.orderID=a.orderID) ";
        pl.PKey      = "a.orderID ";
        pl.FieldList = "a.orderID,a.userID,isNew,orderState,acceptName,acceptAddr,handSet,tel,zipCode,orderTime,ISNULL(b.priceTotal,0) as priceTotal,ISNULL(b.freightTotal,0) as freightTotal ";
        pl.Conditon  = "and orderState=30 ";
        pl.OrderBy   = "orderTime Desc ";

        longyuan_TableUpDateFieldsInfo tb = new longyuan_TableUpDateFieldsInfo();
        DataSet set = tb.GetPageList(pl);

        if (set.Tables.Count > 0)
        {
            if (set.Tables[0].Rows.Count > 0)
            {
                gvBindyifahuo.DataSource   = set.Tables[0];
                gvBindyifahuo.DataKeyNames = new string[] { "orderID" };
                gvBindyifahuo.DataBind();
            }
            else
            {
                gvBindyifahuo.DataBind();
            }
        }
        else
        {
            gvBindyifahuo.DataBind();
        }
    }
示例#20
0
    private void bindClassList()
    {
        StringBuilder sb       = new StringBuilder();
        int           currpage = WebUnitily.CheckInt(Request["p"]);

        if (currpage == 0)
        {
            currpage = 1;
        }
        L_PageList pl = new L_PageList();

        pl.Currpage = currpage;
        pl.PageSize = 10;

        plList8531.CurPage = currpage;

        pl.TableName = "Product ";
        pl.PKey      = "productID ";
        pl.FieldList = "productID,ProductName,ProductImage,Price,CurrentPrice,MenberPrice,Danwei,RemainDay,AddTime,LinkQQId,LinkQQName ";
        pl.OrderBy   = " AddTime Desc ";

        TableUpDateFieldsInfo tb = new TableUpDateFieldsInfo();
        DataSet set = tb.GetPageList(pl);

        if (set.Tables.Count > 0)
        {
            if (set.Tables[0].Rows.Count > 0)
            {
                rpDataList.DataSource = set.Tables[0];
                rpDataList.DataBind();
                plList8531.TotalPage = int.Parse(tb.PageCount.ToString());
            }
            else
            {
                rpDataList.DataBind();
            }
        }
        else
        {
            rpDataList.DataBind();
        }
    }
示例#21
0
    private void BindHelpInfo()
    {
        int currPage = WebUnitily.CheckInt(Request["p"]);

        if (currPage == 0)
        {
            currPage = 1;
        }
        L_PageList pl = new L_PageList();

        pl.Currpage       = currPage;
        pl.PageSize       = 10;
        pList8517.CurPage = currPage;

        pl.TableName = "ShopHelp";
        pl.PKey      = "helpID";
        pl.FieldList = "helpID,helpTitle,classID,className,helpContent,postTime,isPost";
        pl.OrderBy   = "postTime desc";

        longyuan_TableUpDateFieldsInfo tb = new longyuan_TableUpDateFieldsInfo();
        DataSet dsSet = tb.GetPageList(pl);

        if (dsSet.Tables.Count > 0)
        {
            if (dsSet.Tables[0].Rows.Count > 0)
            {
                gvHelpInfo.DataSource   = dsSet.Tables[0];
                gvHelpInfo.DataKeyNames = new string[] { "helpID" };
                gvHelpInfo.DataBind();

                pList8517.TotalPage = Int32.Parse(tb.PageCount.ToString());
            }
            else
            {
                gvHelpInfo.DataBind();
            }
        }
        else
        {
            gvHelpInfo.DataBind();
        }
    }
示例#22
0
    protected void imgBuyProduct_Click(object sender, ImageClickEventArgs e)
    {
        if (subTool.CheckUserLogin("-1"))
        {
            int        userID = WebUnitily.CheckInt(mycookie.getCookiesValue("shop8517User", "userID"));
            L_CartInfo cInfo  = new L_CartInfo();
            cInfo.UserID    = userID;
            cInfo.CartID    = userID.ToString() + DateTime.Now.ToString("yyyyMMddmm");
            cInfo.ProductID = WebUnitily.CheckInt(ViewState["PID"]);
            cInfo.BugNum    = WebUnitily.CheckInt(txtBuyNum.Text);
            cInfo.bugTime   = DateTime.Now;

            if (cInfo.ProductID == 0)
            {
                Response.Write("你需要加入购物车的商品不存在,请您检查!!");
                Response.End();
            }
            if (cInfo.BugNum == 0)
            {
                Response.Write("请检查你要购买的商品数!");
                Response.End();
            }

            int exresult = cartinfo.addCart(cInfo);
            switch (exresult)
            {
            case 20:
                Response.Write("<script>alert('商品添加购物车成功');</script>");
                Server.Transfer("../orderinfo/UserCard.aspx");
                break;

            case 10:
                Response.Write("<script>alert('商品添加收藏夹成功');</script>");
                Server.Transfer("../orderinfo/UserCard.aspx");
                break;

            default:
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("加入购物车失败,请您检查"));
                break;
            }
        }
    }
示例#23
0
    private void userAddCart()
    {
        L_CartInfo cInfo = new L_CartInfo();

        cInfo.UserID    = userID;
        cInfo.CartID    = userID.ToString() + DateTime.Now.ToString("yyyyMMddmm");
        cInfo.ProductID = WebUnitily.CheckInt(Request.Form["PId"]);
        cInfo.BugNum    = WebUnitily.CheckInt(Request.Form["BuyNum"]);
        cInfo.bugTime   = DateTime.Now;

        if (cInfo.ProductID == 0)
        {
            Response.Write("-1");
            Response.End();
        }
        if (cInfo.BugNum == 0)
        {
            Response.Write("-1");
            Response.End();
        }

        int extResult = cartinfo.addCart(cInfo);

        switch (extResult)
        {
        case 20:
            Response.Write("产品已经在购物车中");
            Response.End();
            break;

        case 10:
            Response.Write("产品加入购物车成功");
            Response.End();
            break;

        default:
            Response.Write("加入购物车失败");
            Response.End();
            break;
        }
    }
示例#24
0
    private void BindBulletin()
    {
        int currPage = WebUnitily.CheckInt(Request["p"]);

        if (currPage == 0)
        {
            currPage = 1;
        }
        L_PageList pl = new L_PageList();

        pl.Currpage = currPage;

        pl.PageSize       = 2;
        pList8517.CurPage = currPage;
        pl.TableName      = "Bulletin";
        pl.PKey           = "ID";
        pl.FieldList      = "ID,bulletinTitle,bulletinContent,isPost,orderNum,postTime";
        pl.OrderBy        = "postTime desc";

        TableUpDateFieldsInfo tb = new TableUpDateFieldsInfo();
        DataSet Dset             = tb.GetPageList(pl);

        if (Dset.Tables.Count > 0)
        {
            if (Dset.Tables[0].Rows.Count > 0)
            {
                gvBulletin.DataSource   = Dset.Tables[0];
                gvBulletin.DataKeyNames = new string[] { "ID" };
                gvBulletin.DataBind();

                pList8517.TotalPage = int.Parse(tb.PageCount.ToString());
            }
            else
            {
                gvBulletin.DataBind();
            }
        }
    }