public void OrderItems(int EmployeeId, int QueueId, int TableId, int CheckId, int ModeId)
        {
            Utils.ToCardLog("[Event]OrderItems EmployeeId: " + EmployeeId + " QueueId: " + QueueId + " TableId: " + TableId + " CheckId: " + CheckId + " ModeId: " + ModeId);

            if (CheckId > 0)
            {
                AlohaEventVoids.WriteTimeOfSend(TableId, CheckId, QueueId, EmployeeId, ModeId);
                AlohaEventVoids.TryAddDiscount(ModeId, CheckId, EmployeeId);
            }

            //Thread.Sleep(1000);
            //throw new NotImplementedException();
        }
 public void EndOfDay(int IsMaster)
 {
     AlohaEventVoids.EOD();
     SendToVideo.EOD();
     try
     {
         AlohaTSClass.ShowMessageInternal("Засыпаю");
         Thread.Sleep(30000);
         AlohaTSClass.ShowMessageInternal("Просыпаюсь");
     }
     catch
     { }
 }
        public void AddItem(int EmployeeId, int QueueId, int TableId, int CheckId, int EntryId)
        {
            //throw new NotImplementedException();
            AlohaEventVoids.AddItem(EmployeeId, QueueId, TableId, CheckId, EntryId);



            /*
             * if (iniFile.FCCEnable)
             * {
             *  FCC.UpdateChk(AlohaTSClass.GetCheckById(CheckId));
             * }
             */
        }
        public void CloseCheck(int EmployeeId, int QueueId, int TableId, int CheckId)
        {
            if (QueueId == 5)
            {
                Utils.ToLog($"CheckId ={CheckId} Чек из очереди №5. Это иp хаба Закрываем без Джестори. В Джестори отправит хаб", 2);
                return;
            }

            if (iniFile.CustomerDisplayEnabled)
            {
                RemoteCommands.CustomerDisplayEventSender.AddSendCloseChkToCustDisp(CheckId);
            }

            EventSenderClass.SendAlohaAsincEvent(PDiscountCard.StopListService.AlohaEventType.CloseCheck, "", 0, EmployeeId, "", 0, TableId, CheckId);
            AlohaEventVoids.CloseCheck(EmployeeId, QueueId, TableId, CheckId);
            SendToVideo.CloseCheck(CheckId);

            //  AlohaTSClass.CloseTable(AlohaTSClass.GetTermNum(), TableId);
        }
 public void ApplyPayment(int ManagerId, int EmployeeId, int QueueId, int TableId, int CheckId, int TenderId, int PaymentId)
 {
     if (iniFile.CustomerDisplayEnabled)
     {
         RemoteCommands.CustomerDisplayEventSender.AddSendChkToCustDispToQueue(CheckId, true);
     }
     try
     {
         //DisplayBoardClass.ApplyPaymentEvent(CheckId);
         DisplayBoardClass.ApplyPaymentEvent();
         SendToVideo.ApplyPayment(CheckId, TenderId);
         AlohaEventVoids.ApplyCardPayment(ManagerId, EmployeeId, QueueId, TableId, CheckId, TenderId, PaymentId);
     }
     catch (Exception e)
     {
         string Mess = "Ошибка программы " + e.Message + Environment.NewLine + "Призведите оплату вручную";
         AlohaTSClass.ShowMessage(Mess);
         Utils.ToCardLog(Mess);
         MainClass.PlasticTransactionInProcess = false;
     }
 }
        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) ;
             * }
             * */
        }