Exemple #1
0
 public static void ToMoneyCountLog(MoneyChangeCommands Command, int InsetSumm, int Change, int ChangeHand, int ItogSumm, int CheckNumber)
 {
     try
     {
         string Mess = String.Format("{0} | {1} | {2} | {3}  | {4} | {5} | {6} ", DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"), Command.ToString(), InsetSumm, Change, ChangeHand, ItogSumm, CheckNumber);
         MainClass2.RaiseOnSendMoneyLog(Mess);
         using (StreamWriter SW = new StreamWriter(MoneyCountLogPath, true, Encoding.GetEncoding(866)))
         {
             SW.WriteLine(Mess);
         }
     }
     catch
     { }
 }
        private void CorrectErrorChangeOperationCompleted()
        {
            Utils.ToLogFCCApiLog("CorrectErrorChangeOperationCompleted");
            int OldSumm = LastSumm;

            UpdateInventory();
            if (LastSumm + LastChangeSumm <= OldSumm)
            {
                Utils.ToLogFCCApiLog("CorrectErrorChangeOperationCompleted Summ ok");
                MainClass2.RaiseOnEndChange(0, LastChangeSumm, LastChangeSumm);
            }
            else
            {
                Utils.ToLogFCCApiLog("CorrectErrorChangeOperationCompleted Not enought money");
                MainClass2.RaiseOnCancelChange(LastSumm - OldSumm, LastSumm - OldSumm, 0);
            }
        }
        void clsBrueBoxService_ChangeOperationCompleted(object sender, FCCSrv2.ChangeOperationCompletedEventArgs arg)
        {
            Utils.ToLogFCCApiLog("ChangeOperationCompleted");

            if (arg.Error == null)
            {
                Utils.ToLogFCCApiLog("ChangeOperationCompleted", true, int.Parse(arg.Result.result), TransactionResultStr(int.Parse(arg.Result.result)), "");
                long   insertedAmount  = 0;
                long   dispensedAmount = 0;
                string insertedDenom   = getDetailDenom(arg.Result.Cash[0].Denomination, ref insertedAmount, arg.Result.ManualDeposit);
                string dispensedDenom  = getDetailDenom(arg.Result.Cash[1].Denomination, ref dispensedAmount, "0");
                long   changeAmount    = insertedAmount - int.Parse(arg.Result.Amount) - dispensedAmount;

                if (int.Parse(arg.Result.result) == FCC_SUCCESS)
                {
                    MainClass2.RaiseOnEndChange(0, (int)insertedAmount, (int)dispensedAmount);
                }
                else if ((int.Parse(arg.Result.result) == 10) || (int.Parse(arg.Result.result) == 12) || (int.Parse(arg.Result.result) == 100))
                {
                    MainClass2.RaiseOnEndChange((int)changeAmount, (int)insertedAmount, (int)dispensedAmount);
                }
                else if ((int.Parse(arg.Result.result) == 1) || (int.Parse(arg.Result.result) == 9))
                {
                    MainClass2.RaiseOnCancelChange((int)insertedAmount - (int)dispensedAmount, (int)insertedAmount, (int)dispensedAmount);
                }
                else if ((int.Parse(arg.Result.result) == 11) || (int.Parse(arg.Result.result) == 100)) //Error
                {
                    MainClass2.RaiseOnCancelChange((int)insertedAmount, (int)dispensedAmount, "Код ошибки " + arg.Result.result);
                }
            }
            else
            {
                Utils.ToLogFCCApiLog("ChangeOperationCompleted", true, 0, "", arg.Error.Message);
                Utils.ToLog("ChangeOperationCompleted Error  " + arg.Error.Message);
                CorrectErrorChangeOperationCompleted();
            }
        }
 static void mEventHandleClass_OnSetDeposit(object sender, int summ)
 {
     MainClass2.UpdateDeposit(summ);
 }