public static void Sale() { AlohaTSClass.CheckWindow(); Check Chk = AlohaTSClass.GetCheckById((int)AlohaTSClass.AlohaCurentState.CheckId); bool AllCheck = false; if (Chk.ChecksOnTable.Count > 1) { MessageForm ManyChecksMsg = new MessageForm("Закрыть все чеки на столе?"); ManyChecksMsg.button1.Text = "Да"; ManyChecksMsg.button2.Text = "Только текущий"; // ManyChecksMsg.button2.Visible = false; ManyChecksMsg.ShowDialog(); if (ManyChecksMsg.Result == 1) { //Utils.ToLog("Отправляю на оплату все чеки на столе." + GetFCCCheckfromAloha(Chk, AllCheck).Ammount); AllCheck = true; } } InpasChk inpasChk = new InpasChk(Chk, AllCheck, AlohaTSClass.AlohaCurentState.EmployeeNumberCode); if (AllCheck) { Utils.ToLog("Отправляю на пластиковую оплату все чеки на столе." + inpasChk.Ammount); } AlohaTSClass.LogOut(AlohaTSClass.GetTermNum()); AlohaTSClass.RefreshCheckDisplay(); if (!inpasChk.isVoid) { Utils.ToCardLog("Старт пластиковой оплаты Чек " + inpasChk.Num); RunOper(1, 0, 0, TermNum, inpasChk, 0); } else { //RunOper(1, 0, 0, TermNum, AlohaTSClass.GetCheckById((int)AlohaTSClass.AlohaCurentState.CheckId), 0); frmInpasVoid fv = new frmInpasVoid(); fv.ShowDialog(); if (fv.Res == 1) { Utils.ToCardLog("Старт возврата пластиковой оплаты Чек " + Chk.AlohaCheckNum); DualConnector.DualConnectorMain.Void(inpasChk, fv.RRN); } else if (fv.Res == 2) { Utils.ToCardLog("Старт отмены пластиковой оплаты Чек " + Chk.AlohaCheckNum); DualConnector.DualConnectorMain.Cancel(inpasChk, fv.RRN); } } }
public static void TransactionComplited(int TransCode, int Status, InpasChk PayMentCheck, int Code, string CodeDescrstring, string Reciept) { if (Reciept != null) { if (Reciept != "") { //System.Windows.Forms.MessageBox.Show(Reciept); // AlohaTSClass.PrintCardSlip try { // string[] stringSeparators = new string[] { "\n\r", "\n\n", Environment.NewLine}; string[] stringSeparators = new string[] { "\n" }; string sres = Reciept.Replace("\r", ""); AlohaTSClass.PrintCardSlip(sres.Split(stringSeparators, StringSplitOptions.None).ToList()); } catch (Exception e) { Utils.ToCardLog("Ошибка печати слипа " + e.Message); } } } if (Code == 0) { if (Status == 1) { if (TransCode == 1) { if (PayMentCheck.AllInTable) { foreach (InpasChk Chk in PayMentCheck.AllChks) { RemoteCloseCheck.AddRemoteChkToQuere(Chk.AlohaId, 20, Chk.CurrentEmpl, 0); } } else { RemoteCloseCheck.AddRemoteChkToQuere(PayMentCheck.AlohaId, 20, PayMentCheck.CurrentEmpl, 0); } } } } }
public int RunOper(int OperId, int CommandMode, int CommandMode2, int Amount, InpasChk CurrentCheck, string RRN) { TransactionInProcess = true; if (CurrentCheck != null) { currentCheck = CurrentCheck; Amount = Math.Abs((int)(currentCheck.Ammount)); } string resStr = ""; int res = DApi.Exchange(OperId, CommandMode, CommandMode2, Amount, terminalId, RRN, ExchangeComplited, out resStr); if (res != 0) { TransactionInProcess = false; string Mess = "Ошибка старта операции" + OperId + " на терминале пластиковых карт." + Environment.NewLine + resStr; Mess += "Код ошибки: " + res; Mess += "Описание ошибки: " + resStr; Utils.ToCardLog(Mess); frmAllertMessage Mf = new frmAllertMessage(Mess); Mf.ShowDialog(); } return(res); }
private static int RunOper(int OperId, int CommandMode, int CommandMode2, string terminal, InpasChk Chk, int Summ, string RRN) { DualConnectorTransaction Dt = new DualConnectorTransaction("0"); if (Terminals.TryGetValue(terminal, out Dt)) { if (Dt.TransactionInProcess) { ShowMsg("На терминале выполняется транзакция"); return(-1); } else { //AlohaTSClass.CheckWindow(); Dt.RunOper(OperId, CommandMode, CommandMode2, Summ, Chk, RRN); } } else { ShowMsg("нет такого терминала"); return(-2); } return(0); }
private static int RunOper(int OperId, int CommandMode, int CommandMode2, string terminal, InpasChk Chk, int Summ) { return(RunOper(OperId, CommandMode, CommandMode2, terminal, Chk, Summ, "")); }
public static void Cancel(InpasChk Chk, string RRN) { RunOper(4, 0, 22, TermNum, Chk, 0, RRN); }
public static void Void(InpasChk Chk, string RRN) { RunOper(29, 0, 22, TermNum, Chk, 0, RRN); }