コード例 #1
0
        public static void PrintLongSlipReport()
        {
            ZRSrv.Service1           S1   = new ZRSrv.Service1();
            List <ZRSrv.PaymentCard> Tmp  = S1.GetPaymentCardInfoReport(Utils.GetUnTermNum(), AlohainiFile.BDate).ToList();
            List <string>            Slip = new List <string>();

            //  Slip.Add("  ");
            //  Slip.Add(AlohainiFile.UNITNAME);
            //  Slip.Add(AlohainiFile.ADDRESS1);
            //  Slip.Add(AlohainiFile.ADDRESS2);
            //  Slip.Add("  ");
            Slip.Add("Касса: " + Utils.GetUnTermNum());
            String CardName = "";

            Slip.Add("Дата: " + DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"));
            Slip.Add("  ");

            foreach (ZRSrv.PaymentCard PC in Tmp)
            {
                Slip.Add(PrintLine);
                Slip.Add("  ");
                Slip.Add("Карта " + PC.CardPrefix + PC.CardNumber.ToString().PadLeft(9, '0'));
                Slip.Add("Сумма: " + PC.Summ.Value.ToString("0.00"));
                Slip.Add("Дата: " + PC.SystemDate.Value.ToString("dd/MM/yyyy HH:mm:ss"));
                Slip.Add("  ");
            }
            Slip.Add(PrintLine);
            Slip.Add("  ");
            Slip.Add("Итого карт: " + Tmp.Count);
            Slip.Add("Сумма: " + Tmp.Sum(a => a.Summ));
            ToShtrih.PrintCardCheck(Slip, "Отчет по оплате под. картами");
        }
コード例 #2
0
        private string PrintSlip(AlohaTender AT, DateTime dt, int CheckNum)
        {
            List <string> Slip = new List <string>();

            //  Slip.Add("  ");
            //  Slip.Add(AlohainiFile.UNITNAME);
            //  Slip.Add(AlohainiFile.ADDRESS1);
            //  Slip.Add(AlohainiFile.ADDRESS2);
            Slip.Add("  ");
            Slip.Add("Касса: &&" + Utils.GetUnTermNum());
            Slip.Add("Чек: &&" + CheckNum.ToString());
            String CardName = "";

            PaymentCardDescr.TryGetValue(Convert.ToInt32(AT.CardPrefix), out CardName);
            Slip.Add("Оплата &&" + CardName);
            Slip.Add("  ");
            Slip.Add("Карта &&" + AT.CardPrefix + AT.CardNumber.ToString().PadLeft(9, '0'));
            Slip.Add("Сумма: &&" + AT.Summ.ToString("0.00"));
            Slip.Add("Дата: &&" + dt.ToString("dd/MM/yyyy HH:mm:ss"));
            Slip.Add("  ");
            Slip.Add("  ");
            Slip.Add("Подпись клиента: ");
            Slip.Add("  ");
            Slip.Add("  ");
            Slip.Add("__________________________________");
            Slip.Add("  ");
            ToShtrih.PrintCardCheck(Slip, "Оплата подарочной картой");

            String OutSlip = "";

            foreach (string s in Slip)
            {
                OutSlip += s + Environment.NewLine;
            }
            return(OutSlip);
        }
コード例 #3
0
        static void RC_DataRecive(object Fi)
        {
            try
            {
                DataReciver.PDiscountCommand InCommand = (DataReciver.PDiscountCommand)Fi;
                Utils.ToCardLog("RC_DataRecive тип " + InCommand.CommandType);
                if (InCommand.Ansver)
                {
                }
                else
                {
                    switch (InCommand.CommandType)
                    {
                    case DataReciver.PDiscountCommandType.CloseCheck:
                    {
                        // if (!iniFile.RemoteCloseCheckEnabled)
                        {
                            //   InCommand.Result = AlohaTSClass.OrderItems(InCommand.EntIds, InCommand.CheckId, InCommand.TableId, out InCommand.ExeptionMessage);
                            InCommand.Result = true;
                            RemoteCloseCheck.AddRemoteChkToQuereLocal(InCommand.CheckId, InCommand.PaymentId, InCommand.EmployeeId, InCommand.PaymentSumm);
                        }
                        break;
                    }

                    case DataReciver.PDiscountCommandType.OrderItems:
                    {
                        InCommand.Result = AlohaTSClass.OrderItems(InCommand.EntIds, InCommand.CheckId, InCommand.TableId, out InCommand.ExeptionMessage);
                        break;
                    }

                    case DataReciver.PDiscountCommandType.OrderAllItems:
                    {
                        InCommand.Result = AlohaTSClass.OrderAllItems(InCommand.CheckId, InCommand.TableId, out InCommand.ExeptionMessage);
                        break;
                    }

                    case DataReciver.PDiscountCommandType.GetStopList:
                    {
                        //InCommand.Result = AlohaTSClass.OrderAllItems(InCommand.CheckId, InCommand.TableId, out InCommand.ExeptionMessage);
                        InCommand.EntIds = AlohaTSClass.GetStopList2();
                        InCommand.Result = true;

                        break;
                    }

                    case DataReciver.PDiscountCommandType.DeleteOrder:
                    {
                        //RemoteCloseCheck.RemoteDeleteCheck(InCommand.CheckId);
                        AlohaTSClass.LogIn(iniFile.RemoteOrderTerminalNumber, iniFile.RemoteOrderWaterNumber);
                        AlohaTSClass.DeleteAllItemsOnCurentCheckandClose2(iniFile.RemoteOrderTerminalNumber,
                                                                          iniFile.RemoteOrderWaterNumber, InCommand.CheckId);
                        break;
                    }

                    case DataReciver.PDiscountCommandType.PrintSlip:
                    {
                        if (iniFile.CreditCardSlipPrintPreCheck)
                        {
                            try
                            {
                                // string[] stringSeparators = new string[] { "\n\r", "\n\n", Environment.NewLine};

                                string[] stringSeparators = new string[] { "\n" };

                                string sres = InCommand.Slip.Replace("\r", "");

                                //if (iniFile.pri)
                                AlohaTSClass.PrintCardSlip(sres.Split(stringSeparators, StringSplitOptions.None).ToList());
                            }
                            catch (Exception e)
                            {
                                Utils.ToCardLog("Ошибка печати слипа " + e.Message);
                            }
                        }
                        else
                        {
                            // Slip += Convert.ToChar(31);
                            ToShtrih.PrintCardCheck(InCommand.Slip);
                        }
                        ToShtrih.PrintCardCheck(InCommand.Slip);
                        break;
                    }

                    case DataReciver.PDiscountCommandType.AddRemoteOrder:
                    {
                        RemoteOrderSrv.OrderInfoForAloha OI = new RemoteOrderSrv.OrderInfoForAloha();

                        List <RemoteOrderSrv.Item> Tmpit = new List <RemoteOrderSrv.Item>();

                        OI.OrderID = "0";

                        foreach (DataReciver.Item it in InCommand.OrderBody)
                        {
                            RemoteOrderSrv.Item IT = new RemoteOrderSrv.Item
                            {
                                ItemID             = it.Barcode,
                                ItemSpecialMessage = ""
                            };

                            Tmpit.Add(IT);
                            List <RemoteOrderSrv.Modifier> TmpMods = new List <RemoteOrderSrv.Modifier>();

                            foreach (DataReciver.Item mod in it.Mods)
                            {
                                RemoteOrderSrv.Modifier md = new RemoteOrderSrv.Modifier {
                                    ItemModifierID = mod.Barcode
                                };
                                TmpMods.Add(md);
                            }

                            IT.Modifiers = TmpMods.ToArray();
                        }
                        OI.Items = Tmpit.ToArray();



                        InCommand.ResultId = MainClass.CTG.AddRemoteOrderFromTCPCommand(OI, out InCommand.ExeptionMessage, out InCommand.CheckId);
                        break;
                    }

                    default:
                    {
                        break;
                    }
                    }
                    InCommand.Ansver = true;

                    //   Utils.ToLog("RC.SendData port: " + iniFile.RemoteSenderPort + " CompName: " + InCommand.Sender);
                    //   RC.SendData(InCommand.Sender, iniFile.RemoteSenderPort   , InCommand);
                    if (InCommand.SenderPort == 0)
                    {
                        InCommand.SenderPort = iniFile.RemoteSenderPort;
                    }
                    Utils.ToLog("RC.SendData port: " + InCommand.SenderPort + " CompName: " + InCommand.Sender);

                    RC.SendData(InCommand.Sender, InCommand.SenderPort, InCommand);
                }
            }
            catch (Exception e)
            {
                Utils.ToLog(e.Message);
            }
        }