Example #1
0
        /// <summary>
        /// 收银
        /// </summary>
        public void CashRegisters(Goods goods)
        {
            this._totalAmount += goods.GoodsPrice * goods.GoodsNumber;
            //同一中商品,只要条码相同,则不论批次是否相同,都是一个价格
            GoodsSalePriceVM spVM = GoodsSalePriceList.Where(p => p.SerialNumber == goods.SerialNumber).First();

            goods.GoodsPrice = spVM.DiscountPrice;//更新实收的价格
        }
Example #2
0
        /// <summary>
        /// 指定的客户是否还需要继续等待
        /// </summary>
        /// <param name="customer"></param>
        /// <param name="salePriceVM">销售价格单</param>
        /// <returns></returns>
        public bool Waite(Customer customer)
        {
            if (this.processingCustomer == customer)
            {
                //是当前用户,开始收银
                //如果客户同意付款
                //对客户所购物品的售价进行实际的计算
                List <GoodsSalePriceVM> salesPriceInfo = new List <GoodsSalePriceVM>();

                GoodsManageBIZ    biz  = new GoodsManageBIZ();
                CustomerManageBIZ cbiz = new CustomerManageBIZ();
                bool isCustomer        = (cbiz.GetCustomerContactInfo(customer.CustomerID) != null);

                foreach (Goods goods in customer.Goodss)
                {
                    GoodsSalePriceVM vm = new GoodsSalePriceVM(goods);
                    int     integral;
                    decimal sellPrice = biz.GoodsSellPrice(goods.GoodsID, goods.SerialNumber, goods.GoodsNumber, isCustomer, out integral);

                    if (sellPrice == 0)
                    {
                        vm.GoodsNumber    = 0;
                        goods.GoodsNumber = 0;
                    }
                    vm.DiscountPrice = sellPrice;
                    //goods.GoodsPrice = sellPrice;
                    goods.Integral = integral;
                    salesPriceInfo.Add(vm);
                }

                this.CurrCRManchines.ReSet();
                this.CurrCRManchines.GoodsSalePriceList = salesPriceInfo;
                return(false);
            }
            else
            {
                if (this.processingCustomer == null)
                {
                    if (customerQueue.Count > 0)
                    {
                        //准备进行下一个客户的处理
                        this.processingCustomer = customerQueue.Dequeue();
                        this.lastProcessTime    = DateTime.Now;
                    }
                }
                else
                {
                    //当前客户可能已经离开,放弃购物了,需要强行清除,否则后面的客户将会一直等待
                    if (DateTime.Now.Subtract(lastProcessTime).Minutes > 5)
                    {
                        this.processingCustomer = null;
                    }
                }

                return(true);
            }
        }