//public static event RunOperationAsincDelegate RunOperationAsincComplited;

        static private void RunOperationAsincComplitedVoid(int res, string resStr, string Response, string Receipt)
        {
            TrPosXAlohaIntegrator.TrPosXClass_RunOperationAsincComplited(res, resStr, Response, Receipt);

            /*
             * if (RunOperationAsincComplited != null)
             * {
             *  RunOperationAsincComplited(res, resStr, Response, Receipt);
             * }
             * */
        }
        static private void ShowScreenVoid(ScreenParamsOut Params, bool NeedAnswer)
        {
            TrPosXAlohaIntegrator.TrPosXClass_ShowScreenEvent(null, Params, NeedAnswer);

            /*
             * if (ShowScreenEvent != null)
             * {
             *  ShowScreenEvent(null, Params, NeedAnswer);
             * }
             * */
        }
        //public int Num = 0;
        override protected void OkEvent(int Num)
        {
            SlipNumber = Num;
            string s = "";

            if (Arcus)
            {
                ArcusAlohaIntegrator.GetSipCopy(Num);
            }
            else
            {
                TrPosXAlohaIntegrator.GetJRNCheck(Num, false);
            }

            if (iniFile.Arcus2Enabled)
            {
            }

            this.Hide();
        }
Example #4
0
        static public void SverkaWithQ()
        {
            QSverkaForm F1 = new QSverkaForm();

            F1.ShowDialog();
            if (!F1.IsGood)
            {
                return;
            }
            else
            {
                if (TrPosXAlohaIntegrator.Sverka())
                {
                    PDiscountCard.CloseCheck.ZeroPlastNum();
                    FiskInfo fi = PDiscountCard.CloseCheck.ReadFiskInfo();
                    fi.NeedSverka = false;
                    PDiscountCard.CloseCheck.WriteFiskInfo(fi);
                }
            }
        }
Example #5
0
        internal static void ApplyCardPayment(int ManagerId, int EmployeeId, int QueueId, int TableId, int CheckId, int TenderId, int PaymentId)
        {
            if ((TenderId == 20) && (EmployeeId != iniFile.RemoteCloseEmployee))
            {
                if (MainClass.ComApplyPayment)
                {
                    Utils.ToLog("MainClass.ComApplyPayment return");
                    MainClass.ComApplyPayment = false;
                    return;
                }
                if ((!iniFile.TRPOSXEnables) && (!iniFile.ArcusEnabled))
                {
                    return;
                }


                Utils.ToLog("Создаю форму вопроса безналичной оплаты");

                FTermonalSelect M3 = new FTermonalSelect();
                M3.ShowDialog();
                if (M3.Cancel)
                {
                    M3.Dispose();
                    return;
                }
                M3.Dispose();

                if (MainClass.IsWiFi == 2)
                {
                    return;
                }


                if (MainClass.PlasticTransactionInProcess)
                {
                    MF2 MesFrm = new MF2("Предыдущая транзакция еще не завершена.");
                    MesFrm.button1.Visible = false;
                    MesFrm.button3.Visible = false;
                    MesFrm.button2.Text    = "Ок";
                    MesFrm.ShowDialog();
                }
                else
                {
                    MainClass.PlasticTransactionInProcess = true;
                    // string Resp = "";
                    // string Rcp = "";
                    // string RespMes = "";
                    FiskInfo fi = PDiscountCard.CloseCheck.ReadFiskInfo();
                    bool     AllChecksOnTable = false;

                    {
                        //  ToShtrih.GetPrinterStatus();
                        //Check Ch = AlohaTSClass.GetCheckById(CheckId);

                        Utils.ToLog("Безналичная оплата. Читаю параметры чека № " + CheckId + " Попытка 1", 2);
                        Check Ch = AlohaTSClass.GetCheckById(CheckId);
                        if (Ch == null)
                        {
                            Thread.Sleep(500);
                            Utils.ToLog("Безналичная оплата. Читаю параметры чека № " + CheckId + " Попытка 2", 2);
                            AlohaTSClass.InitAlohaCom();
                            Ch = AlohaTSClass.GetCheckById(CheckId);
                            if (Ch == null)
                            {
                                Thread.Sleep(500);
                                Utils.ToLog("Безналичная оплата. Читаю параметры чека № " + CheckId + " Попытка 3", 2);
                                AlohaTSClass.InitAlohaCom();
                                Ch = AlohaTSClass.GetCheckById(CheckId);
                                if (Ch == null)
                                {
                                    Thread.Sleep(500);
                                    Utils.ToLog("Безналичная оплата. Читаю параметры чека № " + CheckId + " Попытка 4", 2);
                                    AlohaTSClass.InitAlohaCom();
                                    Ch = AlohaTSClass.GetCheckById(CheckId);
                                }
                            }
                        }
                        if (Ch == null)
                        {
                            AlohaTSClass.ShowMessage("Не удалось прочитать параметры чека ");
                            Utils.ToLog("Безналичная оплата. Не удалось прочитать параметры чека № " + CheckId, 2);
                            MainClass.PlasticTransactionInProcess = false;
                            return;
                        }

                        if (Ch.ChecksOnTable.Count > 1)
                        {
                            FTwoChecks FT = new FTwoChecks();
                            FT.Init(Ch.ChecksOnTable);
                            FT.ShowDialog();
                            if (FT.Cancel)
                            {
                                FT.Dispose();
                                MainClass.PlasticTransactionInProcess = false;
                                return;
                            }

                            if (FT.Result == 1)
                            {
                                AllChecksOnTable = true;
                            }
                            FT.Dispose();
                        }


                        int LastTr = fi.CardTransID;


                        try
                        {
                            if (iniFile.ArcusEnabled)
                            {
                                Utils.ToCardLog("Arcus. Инициалазирую оплату ");
                                ArcusAlohaIntegrator.RunOper(Ch, LastTr, AllChecksOnTable, fi, PaymentId);
                            }
                            else
                            {
                                Utils.ToCardLog("TrPosX. Инициалазирую оплату ");
                                TrPosXAlohaIntegrator.RunOper(Ch, LastTr, AllChecksOnTable, fi, PaymentId);
                            }
                        }
                        catch (Exception e)
                        {
                            Utils.ToCardLog("[Error]. Инициалазации оплаты " + e.Message);
                        }
                    }
                }
            }
        }
Example #6
0
        internal static void EOD()
        {
            try
            {
                Utils.ToLog("Закрытие дня");

                //RunExport();

                try
                {
                    if ((iniFile.FRSEnabled) && (iniFile.FRSMaster))
                    {
                        FRSClientApp.FRSClient.ZReport(AlohainiFile.BDate);
                    }

                    if (iniFile.TRPOSXEnables)
                    {
                        if (!TrPosXAlohaIntegrator.Sverka())
                        {
                            FiskInfo fi = PDiscountCard.CloseCheck.ReadFiskInfo();
                            fi.NeedSverka = true;
                            PDiscountCard.CloseCheck.WriteFiskInfo(fi);
                        }
                        else
                        {
                            PDiscountCard.CloseCheck.ZeroPlastNum();
                            FiskInfo fi = PDiscountCard.CloseCheck.ReadFiskInfo();
                            fi.NeedSverka = false;
                            PDiscountCard.CloseCheck.WriteFiskInfo(fi);
                        }
                    }
                    if (iniFile.ArcusEnabled)
                    {
                        if (!ArcusAlohaIntegrator.Sverka())
                        {
                            FiskInfo fi = PDiscountCard.CloseCheck.ReadFiskInfo();
                            fi.NeedSverka = true;
                            PDiscountCard.CloseCheck.WriteFiskInfo(fi);
                        }
                        else
                        {
                            PDiscountCard.CloseCheck.ZeroPlastNum();
                            FiskInfo fi = PDiscountCard.CloseCheck.ReadFiskInfo();
                            fi.NeedSverka = false;
                            PDiscountCard.CloseCheck.WriteFiskInfo(fi);
                        }
                    }

                    /*
                     * if (iniFile.InPasEnabled)
                     * {
                     *  DualConnector.DualConnectorMain.Sverka();
                     * }
                     * */
                    if (CreditCardAlohaIntegration.CreditCardConnectorEnabled)
                    {
                        CreditCardAlohaIntegration.RunSverka();
                    }
                }
                catch (Exception ee)
                {
                    Utils.ToLog(ee.Message);
                }



                do
                {
                    Thread.CurrentThread.Join(3000);
                }while (MainClass.FiskalPrinterIsPrinting);

                string Status = "";

                if (!iniFile.FRSEnabled)
                {
                    Utils.ToLog("!iniFile.FRSEnabled");
                    if (iniFile.FiskalDriverNonShtrih)
                    {
                        Utils.ToLog("iniFile.FiskalDriverNonShtrih");
                        FiskalDrivers.FiskalDriver.PrintZReport();
                        Hamster.HamsterWorker.MoveHamster();
                    }
                    else
                    {
                        if (!Shtrih2.ClosedSmenaInternal(out Status))
                        {
                            //Shtrih2.ZReport();
                            ZReport();
                        }
                        else
                        {
                            Utils.ToLog("Принтер с закрытой сменой. Status :" + Status);
                        }
                    }

                    /*
                     * if (iniFile.FiskalDriverNonShtrihAlohaReport)
                     * {
                     *
                     * }
                     * */
                }

                /*
                 * else
                 * {
                 * if (!Shtrih2.ClosedSmenaInternal(out Status))
                 * {
                 *
                 *  RunFiskalChanger();
                 * }
                 * else
                 * {
                 *  Utils.ToLog("Принтер с закрытой сменой. Status :" + Status);
                 * }
                 * }
                 */
                Shtrih2.ExitFiskalThread();
            }
            catch (Exception e)
            {
                Utils.ToLog(e.Message);
            }
        }
Example #7
0
 internal void EnterrNumber(int Num)
 {
     string s = TrPosXAlohaIntegrator.GetJRNCheck(Num);
 }
        public void Custom(string Name)
        {
            try
            {
                Utils.ToLog("Custom " + Name);
                if (Name == "DeleteItemsAndCloseCheck")
                {
                    Utils.ToCardLog("DeleteItemsAndCloseCheck");
                    AlohaEventVoids.DeleteItemsAndCloseCheck();
                }
                if (Name == "PrintCheck")
                //  else if (Name == "PlasticCopySlip")
                {
                    if (iniFile.PrintPrecheckOnFR)
                    {
                        AlohaEventVoids.PrintCurentPrecheckOnFR();
                    }
                    else
                    {
                        AlohaTSClass.PrintCurentPredcheck();
                    }
                    return;
                    //AlohaEventVoids.CloseCheck();
                }
                if (Name == "CloseCheck")
                {
                    AlohaEventVoids.CloseCheck();
                }
                if (Name == "XReport")
                {
                    Utils.ToCardLog("Custom XReport");
                    AlohaEventVoids.XReport();
                }
                if (Name == "XReportHamster")
                {
                    AlohaEventVoids.XReportHamster();
                }
                if (Name == "ZReport")
                {
                    AlohaEventVoids.ZReport();
                }
                if (Name == "OrderItems")
                {
                    AlohaEventVoids.OrderItems();
                }
                if (Name == "ApplyPayment5000")
                {
                    AlohaEventVoids.ApplyPayment(5000);
                }
                if (Name == "ShowReportSale")
                {
                    AlohaEventVoids.ShowReportSale();
                }
                if (Name == "ShowTotalSumm")
                {
                    AlohaEventVoids.ShowTotalSumm();
                    //AlohaTSClass.GetSelectedItems();
                    //OrderDivider.OrderItems();
                    //OrderDivider.HideWindow();
                }
                if (Name == "OrderItemsWithDivide")
                {
                    OrderDivider.OrderItems(false);
                }
                if (Name == "OrderAllItemsWithDivide")
                {
                    OrderDivider.OrderItems(true);
                }


                if (Name == "AddWaiterToCheck")
                {
                    AlohaEventVoids.AddWaiterToCheck();
                }

                if (Name == "Plastik")
                {
                    if (iniFile.ArcusEnabled)
                    {
                        ArcusAlohaIntegrator.XReport();
                    }
                    else if (iniFile.TRPOSXEnables)
                    {
                        TrPosXAlohaIntegrator.FoolReport();
                    }
                }
                if (Name == "PlastikXReport")
                {
                    if (iniFile.ArcusEnabled)
                    {
                        ArcusAlohaIntegrator.PrintShortReport();
                        //AlohaEventVoids.TestPrintWithPause();
                    }
                    else if (iniFile.TRPOSXEnables)
                    {
                        TrPosXAlohaIntegrator.XReport();
                    }
                    else
                    {
                        AlohaTSClass.ShowMessage("Нет подключенных безналичных терминалов. TRPOSXEnables=0 и ArcusEnabled=0");
                    }
                }
                else if (Name == "PlasticSverka")
                {
                    if (iniFile.ArcusEnabled)
                    {
                        ArcusAlohaIntegrator.SverkaWithQ();
                    }
                    else
                    {
                        TrPosXAlohaIntegrator.SverkaWithQ();
                    }
                }
                else if (Name == "PlasticCopySlip")
                {
                    if (iniFile.ArcusEnabled)
                    {
                        ArcusAlohaIntegrator.GetSipCopy();
                    }
                    else if (iniFile.TRPOSXEnables)
                    {
                        TrPosXAlohaIntegrator.GetSlipCopy();
                    }
                    else
                    {
                        AlohaTSClass.ShowMessage("Нет подключенных безналичных терминалов. TRPOSXEnables=0 и ArcusEnabled=0 ");
                    }
                }

                else if (Name == "ShowStopList")
                {
                    //  AlohaEventVoids.ShowStopListReason();
                    AlohaEventVoids.ShowStopList();
                }
                else if (Name == "ShowStopListReason")
                {
                    AlohaEventVoids.ShowStopListReason();
                }
                else if (Name == "Degustations")
                {
                    AlohaEventVoids.Degustations();
                }
                if (Name == "Payment")
                {
                    DisplayBoardClass.ApplyPaymentEvent();
                }
                if (Name == "ShowfrmCard")
                {
                    AlohaEventVoids.ShowfrmCard();
                }
                if (Name == "ShowfrmModifItem")
                {
                    AlohaEventVoids.ShowfrmModifItem();
                }
                if (Name.Length > 5)
                {
                    if (Name.Substring(0, 5) == "Scale")
                    {
                        AlohaEventVoids.AddScaleDish2(Name);
                    }
                }
                if (Name == "VIP")
                {
                    AlohaEventVoids.SetVip();
                }
                if (Name == "FCCShowAdmin")
                {
                    FCC.ShowAdmin();
                }
                if (Name == "FCCSetBill")
                {
                    FCC.SetBill();
                }
                if (Name == "FCCSetBillWithHands")
                {
                    //FCC.SetBillWithHands();
                }
                if (Name == "FCCShowCassir")
                {
                    FCC.ShowCassirFrm();
                }
                if (Name == "FCCInspectSmallChange")
                {
                    FCC.InpectSmallChange(true);
                }


                if (Name == "ShowCashIncome")
                {
                    AlohaEventVoids.ShowFrmCashIn();
                }
                if (Name == "FCCShowRazmen")
                {
                    FCC.ShowRazmen();
                    // DualConnector.DualConnectorMain.InFuncsfrm();
                }

                if (Name == "CloseByWaiter")
                {
                    AlohaEventVoids.CloseByWaiter();
                }
                if (Name == "CloseByWaiterCard")
                {
                    AlohaEventVoids.CloseByWaiter(2);
                }
                if (Name == "CloseByWaiterGlory")
                {
                    if (!AlohaTSClass.IsAlohaTS() && !iniFile.FCCEnable)
                    {
                        Utils.ToLog("CloseByWaiterGlory && (!AlohaTSClass.IsAlohaTS() && !iniFile.FCCEnable)");
                        AlohaEventVoids.CloseCheck();
                    }
                    else
                    {
                        AlohaEventVoids.CloseByWaiter(1);
                    }
                }

                /*
                 *
                 * if (Name == "InPasShortReport")
                 * {
                 *  DualConnector.DualConnectorMain.ShortReport();
                 * }
                 * if (Name == "InPasFullReport")
                 * {
                 *  DualConnector.DualConnectorMain.LongReport();
                 * }
                 * if (Name == "InPasSverka")
                 * {
                 *  DualConnector.DualConnectorMain.Sverka();
                 * }
                 *
                 * if (Name == "InPasLastChk")
                 * {
                 *  DualConnector.DualConnectorMain.GetCopyLastSlip();
                 * }
                 *
                 * if (Name == "InPasAnyChk")
                 * {
                 *  DualConnector.DualConnectorMain.GetCopySlip();
                 * }
                 * */
                if ((Name == "InPasFuncsfrm") || ((Name == "PlasticFuncsfrm")))
                {
                    /*
                     * if (iniFile.InPasEnabled)
                     * {
                     *  DualConnector.DualConnectorMain.InPasFuncsfrm();
                     * }
                     * else
                     * */
                    {
                        CreditCardAlohaIntegration.ShowFuncsfrm();
                    }
                }

                if (Name == "WestReport0")
                {
                    West.WestMain.ShowSaleReport(0);
                }
                if (Name == "WestReport1")
                {
                    West.WestMain.ShowSaleReport(1);
                }
                if (Name == "WestPager")
                {
                    West.WestMain.mShowPagerDialog();
                }
                if (Name == "BonusCardReport")
                {
                    Loyalty.LoyaltyBasik.PrintLongSlipReport();
                }

                if (Name == "EGAISScan")
                {
                    EGAIS.EGAISCodeReader.Read();
                }
                if (Name == "ReprintCheck")
                {
                    FRSClientApp.FRSClient.PrintFCheckShowWnd();
                }
                if (Name == "FayRetailCard")
                {
                    FayRetail.FayRetailMain.ShowWndApplyCardWithCurentCheck();
                }
                if (Name == "PBFirstRequest")
                {
                    MB.PB.SendCurentChk();
                }
            }
            catch (Exception e)
            {
                Utils.ToCardLog("[Error] Custom " + Name + ", Mess: " + e.Message);
            }

            /*
             * else if (Name == "PlastikVozvrat")
             * {
             * TrPosXClass.Void(100) ;
             * }
             * */
        }