Exemple #1
0
        private void ShowSelectedGoods()
        {
            if (currGoods != null)
            {
                IBLL.ISaleData bll = new BLL.SaleData();
                if (supcus_no != "")
                {
                    lbl_price.Text = bll.GetSupItemPrice(supcus_no, currGoods.item_no).ToString("F2"); //供应商进价
                }
                else
                {
                    lbl_price.Text = currGoods.price.ToString("F2");//进价
                }

                lblgoods.Text = currGoods.item_name;

                //自动取重模式:称重商品将自动取重
                if (Program.weight_model == "2" && currGoods.item_flag == "1")
                {
                    inputQty("取重");
                }
            }
        }
Exemple #2
0
        //取重、输入数量
        private void inputQty(string text)
        {
            if (supcus_no == "")
            {
                new MsgForm("未选择供应商").ShowDialog();
                return;
            }
            if (currGoods != null)
            {
                if (Program.is_continue_weight == "1" && total_weight == Weight)
                {
                    new MsgForm("请先放商品,再取重").ShowDialog();
                    return;
                }
                IBLL.ISaleData       bll      = new BLL.SaleData();
                IBLL.IGoods          goodsBLL = new BLL.Goods();
                Model.bi_t_item_info gd       = currGoods;
                Model.t_order_detail item     = new Model.t_order_detail();
                item.item_no = gd.item_no;
                switch (text)
                {
                case "取重":
                    if (Program.is_continue_weight == "1" && total_weight != 0)
                    {
                        item.qty = Weight - total_weight;
                    }
                    else
                    {
                        item.qty = Weight;
                    }
                    break;

                case "手输数量":
                    if (Program.can_input_qty == "1" && currGoods.item_flag == "1")
                    {
                        new MsgForm("称重商品不可手输数量").ShowDialog();
                        return;
                    }
                    InputNumerForm frm = new InputNumerForm("数量", 3);
                    decimal        qty = 0;
                    if (frm.Input(out qty) == true)
                    {
                        if (qty <= 0)
                        {
                            new MsgForm("数量不正确").ShowDialog();
                            return;
                        }
                        item.qty = qty;
                    }
                    else
                    {
                        return;
                    }

                    break;
                }
                total_weight = Weight;

                item.price        = bll.GetSupItemPrice(supcus_no, item.item_no);//gd.price;
                item.item_subno   = gd.item_subno;
                item.item_name    = gd.item_name;
                item.unit_no      = gd.unit_no;
                item.amt          = item.qty * item.price;
                item.sheet_no     = lblsheet_no.Text;
                item.oper_id      = Program.oper_id;
                item.oper_date    = DateTime.Now;
                item.jh           = Program.jh;
                item.cost_price   = goodsBLL.GetCost(gd.item_no, Program.branch_no);
                item.branch_no    = Program.branch_no;
                item.cus_no       = supcus_no;
                item.sup_no       = supcus_no;
                item.is_give      = "0";
                item.source_price = item.price;
                item.discount     = 1;

                int flow_id = 0;
                bll.Insert(item, out flow_id);
                item.flow_id = flow_id;
                this.lines.Add(item);
                this.ShowLine();
            }
        }