Пример #1
0
        public static List <string> TestClose()
        {
            FayRetailMain.AddCheckToAddBonus("10005", CardTrack);

            Check Chk = new Check();

            Chk.AlohaCheckNum = 10005;
            Chk.Dishez        = new List <Dish>();
            Dish d1 = new Dish()
            {
                BarCode     = 100,
                Price       = 123.5m,
                Count       = 1,
                LongName    = "Test D1",
                QtyQUANTITY = 1,
                QUANTITY    = 1
            };

            Chk.Dishez.Add(d1);
            Dish d2 = new Dish()
            {
                BarCode     = 200,
                Price       = 150.5m,
                Count       = 1,
                LongName    = "Test D2",
                QtyQUANTITY = 1,
                QUANTITY    = 1
            };

            Chk.Dishez.Add(d2);
            List <string> res = FayRetailMain.CloseCheck(Chk);

            return(res);
        }
        private void AddBonusToCard()
        {
            this.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
                                        (ThreadStart) delegate()
            {
                string CardNum = tbCode.Text;
                FayRetailMain.AddCheckToAddBonus(CurentCheck.ChequeNumber, CardNum);
                tbFinalMsg.Text = "Успешно. ";
                SetVisState(3);

                /*
                 * string ErrMsg = "";
                 * bool Res = FayRetailClient.AddBonustoCard(CardNum, CurentCheck, CurentCashier, out ErrMsg);
                 *
                 * if (!Res)
                 * {
                 *  tbCode.Focus();
                 *  tbError.Text = ErrMsg;
                 *  SetVisState(0);
                 * }
                 * else
                 * {
                 *  FayRetailMain.AddCheckToAddBonus(CurentCheck.ChequeNumber, CardNum);
                 *  tbFinalMsg.Text = "Успешно. " +Environment.NewLine+ ErrMsg;
                 *  SetVisState(3);
                 * }
                 * */
            }
                                        );
        }
Пример #3
0
        public static void TestWnd()
        {
            FayRetailCheckInfo CheckInfo = new FayRetailCheckInfo()
            {
                Items        = GetTestChequeLines(),
                ChequeNumber = "10002",
                ChequeDate   = DateTime.Now
            };

            FayRetailMain.ShowWndApplyCard(CheckInfo);
        }
        private void ApplyDiscount(double Amount)
        {
            this.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
                                        (ThreadStart) delegate()
            {
                string DiscErr = "";
                int CompId     = AlohaTSClass.ApplyComp(iniFile.FayRetailDiscountId, out DiscErr, Amount);
                if (CompId == 0)
                {
                    tbCode.Focus();
                    tbError.Text = "Ошибка применения скидки на чек " + DiscErr;
                    SetVisState(0);
                }
                else
                {
                    CurentCheck    = FayRetail.FayRetailMain.GetCurentFRCheck();
                    string CardNum = tbCode.Text;
                    string ErrMsg  = "";
                    bool Res       = FayRetailClient.ApplyFayRetPaymentToCheck(CardNum, CurentCheck, CurentCashier, Amount, out ErrMsg);
                    Utils.ToCardLog("ApplyDiscount FayRetailClient.ApplyFayRetPaymentToCheck end Res: " + Res.ToString());

                    if (!Res)
                    {
                        tbCode.Focus();
                        tbError.Text = ErrMsg;
                        AlohaTSClass.DeleteComp(CompId);
                        SetVisState(0);
                    }
                    else
                    {
                        FayRetailMain.AddCheckToAddBonus(CurentCheck.ChequeNumber, CardNum);
                        tbFinalMsg.Text = "Успешно. " + ErrMsg;
                        SetVisState(3);
                    }
                }
            }
                                        );
        }