Beispiel #1
0
    private bool DoEdit(int _id)
    {
        DateTime now     = DateTime.Now;
        string   note_no = now.ToString("yy") + now.ToString("MM") + now.ToString("dd") + now.ToString("HH") + now.ToString("mm") + now.ToString("ss");

        bool          result = false;
        ps_here_depot model  = new ps_here_depot();

        model.GetModel(_id);
        model.product_num = int.Parse(Litproduct_num.Text) - int.Parse(txtproduct_num.Text);

        ps_join_depot model1 = new ps_join_depot();

        model1.product_category_id = model.product_category_id;
        model1.note_no             = note_no;
        model1.add_time            = DateTime.Now;
        model1.product_name        = model.product_name;
        model1.product_code_state  = "退货";
        model1.go_price            = model.go_price;
        model1.salse_price         = model.salse_price;
        model1.user_id             = Convert.ToInt32(Session["AID"]);
        model1.product_num         = int.Parse(txtproduct_num.Text);
        model1.here_depot_id       = _id;
        model1.dw = model.dw;
        model1.Add();

        if (model.UpdateALL())
        {
            mym.AddAdminLog("出库", "出库商品:" + txtproduct_name.Text); //记录日志
            result = true;
        }

        return(result);
    }
Beispiel #2
0
    /// <summary>
    /// 获得购物车列表
    /// </summary>
    public static IList <cart_items> GetList()
    {
        IDictionary <string, int> dic = GetCart();

        if (dic != null)
        {
            IList <cart_items> iList = new List <cart_items>();

            foreach (var item in dic)
            {
                ps_here_depot model = new ps_here_depot();
                model.GetModel(Convert.ToInt32(item.Key));

                cart_items modelt = new cart_items();
                modelt.id                  = model.id;
                modelt.title               = model.product_name;
                modelt.img_url             = model.product_url;
                modelt.product_category_id = Convert.ToInt32(model.product_category_id);
                modelt.dw                  = model.dw;
                modelt.price               = Utils.StrToDecimal(model.salse_price.ToString(), 0);
                modelt.quantity            = item.Value;
                iList.Add(modelt);
            }
            return(iList);
        }
        return(null);
    }
Beispiel #3
0
    private void ShowInfo(int _id)
    {
        ps_here_depot model1 = new ps_here_depot();

        model1.GetModel(_id);
        this.dw = model1.dw;
        this.ddlproduct_category_id.Text = new ps_product_category().GetTitle(Convert.ToInt32(model1.product_category_id));
        this.txtImgUrl.ImageUrl          = model1.product_url;
        this.txtproduct_name.Text        = model1.product_name;
        this.txtgo_price.Text            = MyConvert(model1.go_price.ToString());
        this.txtsalse_price.Text         = MyConvert(model1.salse_price.ToString());
        this.Litproduct_num.Text         = model1.product_num.ToString();
    }
    // 可以订购
    protected void lbtnRefuseCaDG_Click(object sender, EventArgs e)
    {
        this.page = AXRequest.GetQueryInt("page", 1);
        // 当前点击的按钮
        LinkButton    lb   = (LinkButton)sender;
        int           caId = int.Parse(lb.CommandArgument);
        ps_here_depot bll  = new ps_here_depot();

        bll.GetModel(caId);
        bll.id    = caId;
        bll.is_xs = 0;
        bll.UpdateXS(); //更新是否暂停订购

        mym.JscriptMsg(this.Page, " 设置成功!", Utils.CombUrlTxt("depot_manager.aspx", "product_category_id={0}&note_no={1}", this.product_category_id.ToString(), txtNote_no.Text), "Success");
    }
    private bool DoEdit(int _id)
    {
        bool          result = false;
        ps_here_depot model  = new ps_here_depot();

        model.GetModel(_id);

        model.product_url         = this.txtImgUrl.Text;
        model.product_category_id = int.Parse(ddlproduct_category_id.SelectedValue);
        model.product_name        = txtproduct_name.Text;
        model.go_price            = Convert.ToDecimal(this.txtgo_price.Text);
        model.salse_price         = Convert.ToDecimal(this.txtsalse_price.Text);
        if (model.UpdateALL())
        {
            mym.AddAdminLog("修改", "修改商品:" + txtproduct_name.Text); //记录日志
            result = true;
        }

        return(result);
    }
Beispiel #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;
    }