//绑定记录
    public void binddr()
    {
        string         sqlstr = "";
        ps_order_goods bll    = new ps_order_goods();

        sqlstr = "id>0";
        sqlstr = sqlstr + CombSqlTxt(this.product_category_id, this.note_no);
        DataView dv = bll.GetListRep(sqlstr).Tables[0].DefaultView;

        repCategory.DataSource = dv;
        repCategory.DataBind();
    }
Esempio n. 2
0
    // 取消订单
    protected void lbtnDelCa_Click(object sender, EventArgs e)
    {
        this.page = AXRequest.GetQueryInt("page", 1);
        // 当前点击的按钮
        LinkButton lb   = (LinkButton)sender;
        int        caId = int.Parse(lb.CommandArgument);
        ps_orders  bll  = new ps_orders();

        bll.Delete(caId);
        ps_order_goods bllg = new ps_order_goods();

        bllg.DeleteOid(caId);

        mym.JscriptMsg(this.Page, " 取消订单成功!", Utils.CombUrlTxt("my_order.aspx", "depot_category_id={0}&depot_id={1}&status={2}&start_time={3}&stop_time={4}&note_no={5}&page={6}", this.depot_category_id.ToString(), this.depot_id.ToString(), this.status.ToString(), this.txtstart_time.Value, this.txtstop_time.Value, txtNote_no.Text, this.page.ToString()), "Success");
    }
Esempio n. 3
0
    private void ShowInfo(int _id)
    {
        model.GetModel(_id);
        //绑定商品列表
        ps_order_goods bll = new ps_order_goods();
        string         sql = " order_id =" + _id;

        DataTable dt = bll.GetList(sql).Tables[0];

        this.rptList.DataSource = dt;
        this.rptList.DataBind();

        //获得商家信息
        if (model.depot_id > 0)
        {
            ps_depot user_info = new ps_depot();
            user_info.GetModel(Convert.ToInt32(model.depot_id));
            user_name.Text       = model.user_name;
            title.Text           = user_info.title;
            contact_address.Text = user_info.contact_address;
            contact_name.Text    = user_info.contact_name;
            contact_tel.Text     = user_info.contact_mobile;
        }
        //根据订单状态,显示各类操作按钮
        switch (model.status)
        {
        case 1:     //订单为已生成状态
                    //确认订单、取消订单显示
            btnConfirm.Visible = btnCancel.Visible = true;
            //修改订单备注、调价按钮显示
            btnEditRemark.Visible = btnEditPaymentFee.Visible = true;
            break;

        case 2:     //如果订单为已确认状态
            //完成显示
            btnComplete.Visible = true;
            //修改订单备注按钮可见
            btnEditRemark.Visible = true;
            break;
        }
    }
Esempio n. 4
0
    private void ShowInfo(string _order_no)
    {
        model.GetModel(_order_no);

        ps_order_goods bll = new ps_order_goods();
        string         sql = " order_id =" + model.id;
        DataTable      dt  = bll.GetList(sql).Tables[0];

        this.rptList.DataSource = dt;
        this.rptList.DataBind();
        //获得商家信息
        if (model.depot_id > 0)
        {
            ps_depot user_info = new ps_depot();
            user_info.GetModel(Convert.ToInt32(model.depot_id));
            title.Text           = user_info.title;
            contact_address.Text = user_info.contact_address;
            contact_name.Text    = user_info.contact_name;
            contact_tel.Text     = user_info.contact_mobile;
        }
    }
    private void RptBind(string _strWhere, string _orderby)
    {
        this.page = AXRequest.GetQueryInt("page", 1);


        if (this.product_category_id > 0)
        {
            this.ddlproduct_category_id.SelectedValue = this.product_category_id.ToString();
        }

        txtNote_no.Text = this.note_no;

        ps_order_goods bll = new ps_order_goods();

        this.rptList.DataSource = bll.GetListGroup(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
        this.rptList.DataBind();

        //绑定页码
        txtPageNum.Text = this.pageSize.ToString();
        string pageUrl = Utils.CombUrlTxt("order_collect.aspx", "product_category_id={0}&note_no={1}&page={2}", this.product_category_id.ToString(), this.note_no, "__id__");

        PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
Esempio n. 6
0
    //提交订单
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        int    user_id           = 0;
        int    depot_category_id = 0;
        int    depot_id          = 0;
        string user_name         = string.Empty;

        user_id           = Convert.ToInt32(Session["AID"]);
        depot_category_id = Convert.ToInt32(Session["DepotCatID"]);
        depot_id          = Convert.ToInt32(Session["DepotID"]);
        user_name         = Session["AdminName"].ToString();

        //检查购物车商品
        IList <cart_items> iList = ShopCart.GetList();

        if (iList == null)
        {
            mym.JscriptMsg(this.Page, "对不起,购物车为空,无法结算!", "", "Error");
            return;
        }

        //统计购物车
        cart_total cartModel = ShopCart.GetTotal();

        //判断是否有商品
        if (cartModel.payable_amount == 0)
        {
            mym.JscriptMsg(this.Page, "对不起,购物车为空,无法结算!", "", "Error");
            return;
        }

        //保存订单=======================================================================
        ps_orders model = new ps_orders();

        model.order_no          = Utils.GetOrderNumber(); //订单号B开头为商品订单
        model.user_id           = user_id;
        model.depot_category_id = depot_category_id;
        model.depot_id          = depot_id;
        model.user_name         = user_name;
        model.payment_id        = 1;//未支付
        model.message           = message.Text;
        model.payable_amount    = cartModel.payable_amount;
        model.real_amount       = 0;

        //订单总金额=实付商品金额
        model.order_amount = cartModel.payable_amount;
        model.add_time     = DateTime.Now;


        if (model.Add() == 0)
        {
            mym.JscriptMsg(this.Page, "订单保存过程中发生错误,请重新提交!", "", "Error");
            return;
        }
        //商品详细列表
        ps_order_goods gls = new ps_order_goods();
        ps_here_depot  my  = new ps_here_depot();

        foreach (cart_items item in iList)
        {
            my.GetModel(item.id);
            gls.order_id            = model.GetMaxId();
            gls.goods_id            = item.id;
            gls.goods_title         = item.title;
            gls.goods_price         = my.go_price;
            gls.real_price          = item.price;
            gls.quantity            = item.quantity;
            gls.product_category_id = item.product_category_id;
            gls.dw = item.dw;
            gls.Add();
        }
        //清空购物车
        ShopCart.Clear("0");
        //提交成功,返回URL
        mym.JscriptMsg(this.Page, "恭喜您,订单已成功提交!", "my_order.aspx", "Success");
        return;
    }