Beispiel #1
0
        static private void AddResponseToTextBox(AddResponseParams Params)
        {
            // TrPosXMessageForm.ShowDialog();
            AddResponseParams Arp = (AddResponseParams)Params;

            TrPosXMessageForm.UpdateMess(Arp.resStr + Environment.NewLine);
            if (Arp.Receipt != "")
            {
                Button1State = 1;

                TrPosXMessageForm.button1.Text    = "Распечатать слип";
                TrPosXMessageForm.button1.Visible = true;
            }
            else
            {
                Button1State = 2;
                TrPosXMessageForm.AddMess("Нет данных для печати" + Environment.NewLine);
                TrPosXMessageForm.button1.Text    = "Закрыть";
                TrPosXMessageForm.button1.Visible = true;
            }
        }
Beispiel #2
0
        static void ArcusClass_RunOperationAsincComplited(string res, string resStr, string Response, string Receipt)
        {
            if (TrPosXMessageForm != null)
            {
                //AddResponseParams Arp = new AddResponseParams();
                if (res == "999")
                {
                    resStr += Environment.NewLine + "Нет связи с терминалом пластиковых карт.";
                    resStr += Environment.NewLine + "Проверьте соединение.";
                }


                Arp.Receipt  = Receipt;
                Arp.res      = res;
                Arp.Response = Response;
                Arp.resStr   = resStr;



                object[] Params = new object[1];
                Params[0] = Arp;



                TrPosXMessageForm.BeginInvoke(new AddResponseToTextBoxDelegate(AddResponseToTextBox), Params);

                /*
                 *  if (GetParam("MessageID", Arp.Response) == "PUR")
                 *  {
                 *      if (GetParam("Approve", Arp.Response) == "Y")
                 *      {
                 *          CloseCheck.InkreasePlastNum();
                 *      }
                 *  }
                 *
                 */
            }
        }
Beispiel #3
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);
        }