コード例 #1
0
 internal static bool Init(out string Ex)
 {
     Ex = "";
     try
     {
         string OutStr = "";
         int    res    = TrPosXClass.TrPosXInit(SetupPath + "setup.txt", out OutStr);
         if (res == 0)
         {
             /*
              * TrPosXClass.ShowScreenEvent += new TrPosXClass.ShowScreenDelegate(TrPosXClass_ShowScreenEvent);
              * TrPosXClass.RunOperationAsincComplited += new TrPosXClass.RunOperationAsincDelegate(TrPosXClass_RunOperationAsincComplited);
              * */
             return(true);
         }
         else
         {
             Ex = OutStr;
             return(false);
         }
     }
     catch (Exception e)
     {
         Ex = e.Message;
         return(false);
     }
 }
コード例 #2
0
        static void StartVOI(int chNum)
        {
            string inStr = "MessageID=VOI" + Environment.NewLine +
                           "ECRReceiptNumber=" + chNum + Environment.NewLine +
                           "ECRNumber=" + KKmNum + Environment.NewLine;

            TrPosXClass.RunOperationAsinc(inStr);
        }
コード例 #3
0
 static public bool XReport()
 {
     //    TrPosXClass.ShowScreenEvent += new TrPosXClass.ShowScreenDelegate(TrPosXClass_ShowScreenEvent);
     TrPosXMessageForm = new FTrposxRunComplited();
     TrPosXMessageForm.button1.Visible = false;
     TrPosXMessageForm.button2.Visible = false;
     TrPosXMessageForm.button3.Visible = false;
     TrPosXMessageForm.Init("Печать отчета с терминала пластиковых карт.", "");
     TrPosXMessageForm.button1.Click += new EventHandler(button1_Click);
     TrPosXMessageForm.button2.Click += new EventHandler(button2_Click);
     TrPosXMessageForm.TopMost        = true;
     TrPosXMessageForm.Show();
     TrPosXClass.RunXReportAsinc();
     return(true);
 }
コード例 #4
0
        internal static string GetJRNCheck(int num, bool CheckToVoid)
        {
            IsGetJRNCheckToVoid = CheckToVoid;

            string inStr = "MessageID=JRN" + Environment.NewLine +
                           "ECRReceiptNumber=" + num.ToString().PadLeft(10, "0"[0]) + Environment.NewLine +
                           //  "ECRNumber=" + MainClass.IsWiFi + Environment.NewLine +
                           "ECRNumber=1" + Environment.NewLine +
                           "Flags=802020" + Environment.NewLine;
            int outLen = 0;
            int rcpLen = 0;

            try
            {
                /*
                 * int res = mTRPOSXLib.Process(inStr, out outLen, out rcpLen);
                 * string Response = mTRPOSXLib.GetResponse(0, outLen);
                 * string Rcp = mTRPOSXLib.GetReceipt(0, rcpLen);
                 */
                TrPosXMessageForm = new FTrposxRunComplited();
                Button1State      = 0;
                TrPosXMessageForm.button2.Text    = "Свернуть";
                TrPosXMessageForm.button1.Visible = false;
                TrPosXMessageForm.button2.Visible = true;
                TrPosXMessageForm.button3.Visible = false;
                TrPosXMessageForm.Init("Поиск чека № " + num.ToString() + ".", "");
                TrPosXMessageForm.button1.Click += new EventHandler(button1_Click);
                TrPosXMessageForm.button2.Click += new EventHandler(button2_Click);

                IsGetJRNCheck = true;

                TrPosXClass.RunOperationAsinc(inStr);
                TrPosXMessageForm.TopMost = true;
                TrPosXMessageForm.Show();
            }
            catch
            {
            }

            return("");
        }
コード例 #5
0
        static public bool  Sverka()
        {
            string inStr = "MessageID=STL" + Environment.NewLine +
                           "ECRNumber=1" + Environment.NewLine;
            //TrPosXClass.ShowScreenEvent += new TrPosXClass.ShowScreenDelegate(TrPosXClass_ShowScreenEvent);


            int    ress;
            string ResStr;
            string Resp;
            string Receipt;

            TrPosXClass.RunOperation(inStr, out ress, out ResStr, out Resp, out Receipt);

            /*
             * TrPosXMessageForm = new FTrposxRunComplited();
             * TrPosXMessageForm.button1.Visible = false;
             * TrPosXMessageForm.button2.Visible = false;
             * TrPosXMessageForm.button3.Visible = false;
             * TrPosXMessageForm.Init("Сверка на терминале пластиковых карт.", "");
             * TrPosXMessageForm.button1.Click += new EventHandler(button1_Click);
             * TrPosXMessageForm.button2.Click += new EventHandler(button2_Click);
             * TrPosXMessageForm.TopMost = true;
             * AddResponseToTextBox(new AddResponseParams {
             *  Receipt = Receipt,
             *  res =ress,
             *  Response = Resp,
             *  resStr = ResStr
             * });
             */
            if (Receipt != "")
            {
                PrintSlip(Receipt);
            }

            return(GetParam("Approve", Resp) == "Y");
        }
コード例 #6
0
        internal static bool RunOper(Check Ch, int LastTr, bool AllChecks, FiskInfo mfi, int PaymentId)
        {
            if (TrPosXClass.OperInProcess)
            {
                return(false);
            }

            _PaymentId = PaymentId;
            KKmNum     = MainClass.IsWiFi;
            //ToShtrih.Disconnect();
            string  inStr = "";
            decimal Sum   = 0;

            if (AllChecks)
            {
                foreach (Check Ch2 in Ch.ChecksOnTable)
                {
                    if (Ch2.AlohaCheckNum != Ch.AlohaCheckNum)
                    {
                        AlohaTSClass.ApplyCardPayment(Ch2.AlohaCheckNum, Ch2.Summ);
                        AlohaTSClass.SetPaymentAttr(Ch2.AlohaCheckNum, LastTr);
                    }
                    Sum += Ch2.Summ;
                }
            }
            else
            {
                Sum = Ch.Summ;
            }


            if (!Ch.Vozvr)
            {
                string TrNumStr = LastTr.ToString().PadLeft(10, "0"[0]);
                inStr = "MessageID=PUR" + Environment.NewLine +
                        //   inStr = "MessageID=SRV" + Environment.NewLine +
                        "ECRReceiptNumber=" + TrNumStr + Environment.NewLine +
                        "ECRNumber=" + KKmNum + Environment.NewLine +
                        "TransactionAmount=" + (Sum * 100).ToString("0") + Environment.NewLine;
            }
            else
            {
                VF = new VoidFrm(Sum);
                VF.ShowDialog();
                if (VF.Cancel)
                {
                    return(false);
                }
                string chNum = VF.ChNum.ToString().PadLeft(10, "0"[0]);

                inStr = "MessageID=VOI" + Environment.NewLine +
                        "ECRReceiptNumber=" + chNum + Environment.NewLine +
                        "ECRNumber=" + KKmNum + Environment.NewLine;
            }



            Utils.ToCardLog("Транзакция старт " + inStr);



            // TrPosXClass.RunOperationAsincComplited += new TrPosXClass.RunOperationAsincDelegate(TrPosXClass_RunOperationAsincComplited);
            if (TrPosXMessageForm != null)
            {
                TrPosXMessageForm.Close();
            }
            TrPosXMessageForm = new FTrposxRunComplited();
            Button1State      = 0;
            TrPosXMessageForm.button2.Text    = "Свернуть";
            TrPosXMessageForm.button1.Visible = false;
            TrPosXMessageForm.button2.Visible = true;
            TrPosXMessageForm.button3.Visible = false;
            TrPosXMessageForm.Init("Операция на терминале пластиковых карт.", "");
            TrPosXMessageForm.button1.Click += new EventHandler(button1_Click);
            TrPosXMessageForm.button2.Click += new EventHandler(button2_Click);

            TrPosXClass.RunOperationAsinc(inStr);
            TrPosXMessageForm.TopMost = true;
            TrPosXMessageForm.Show();

            return(true);
        }