public static void CheckError(this IFiscalRegistratorProvider provider) { var resultCode = provider.GetResultCode(); if (resultCode >= 0) { return; } var resultDescription = provider.GetResultDescription(); if (resultDescription.Contains("Устройство не включено")) { resultDescription = BitMobile.ClientModel3.Translator.Translate("device_not_found"); } string badParameter = null; if (resultCode == -6) { badParameter = provider.GetBadParamDescription(); } if (badParameter != null) { throw new FPTRException(resultCode, badParameter); } throw new FPTRException(resultCode, resultDescription); }
private void InitFields() { _choosedPaymentType = 0; _paymentTypeTextView = (TextView)GetControl("7c46a01e25b34835b7ff98f6debfeac0", true); _rootDockLayout = (DockLayout)GetControl("07ec0239c319491eb406a40e1183d9b5", true); _changeHorizontalLayout = (HorizontalLayout)GetControl("c129ed940d97427fa7cd303171370fde", true); _enteredSumEditText = (EditText)GetControl("778f105408c745b48d4eab7bff782e72", true); _cashNotEnoughTextView = (TextView)GetControl("fde6ae3fe5e946b88a13eb305372e38d", true); _punchButtonLayout = (VerticalLayout)GetControl("2551f8ad1b2749d3847581fd124c841b", true); _printImage = (Image)GetControl("ecd5c17d8f904d368bb5ef92bae35447", true); _changeTextView = (TextView)GetControl("fa4aad30428344f7ac60ca62f721f67a", true); _paymentTypes = new Dictionary <object, string> { { "0", Translator.Translate("cash") }, { "1", Translator.Translate("cashless") }, { "2", Translator.Translate("bonuses") }, { "3", Translator.Translate("bottles") } }; _fptr = FptrInstance.Instance; _eventId = (string)Variables.GetValueOrDefault(Parameters.IdCurrentEventId, string.Empty); _readonly = (bool)Variables.GetValueOrDefault(Parameters.IdIsReadonly, false); _wasStarted = (bool)Variables.GetValueOrDefault(Parameters.IdWasEventStarted, true); _enteredSumEditText.Mask = @"^(\+|\-)?\d+([\.\,]\d{0,2})*$"; _enteredSumEditText.Required = true; }
public static void CloseCheck(this IFiscalRegistratorProvider fptr, int typeClose) { if (fptr.PutTypeClose(typeClose) < 0) { fptr.CheckError(); } if (fptr.CloseCheck() < 0) { fptr.CheckError(); } }
internal int Init() { _readonlyForIos = Application.TargetPlatform == TargetPlatform.iOS || Application.TargetPlatform == TargetPlatform.Other; if (_readonlyForIos) { return(-1); } _fptr = FptrInstance.Instance; return(0); }
public static void Payment(this IFiscalRegistratorProvider fptr, double sum, int type) { if (fptr.PutSumm(sum) < 0) { fptr.CheckError(); } if (fptr.PutTypeClose(type) < 0) { fptr.CheckError(); } if (fptr.Payment() < 0) { fptr.CheckError(); } }
public static void OpenCheck(this IFiscalRegistratorProvider fptr, int type) { if (fptr.PutMode(FiscalRegistratorConsts.ModeRegistration) < 0) { fptr.CheckError(); } if (fptr.SetMode() < 0) { fptr.CheckError(); } if (fptr.PutCheckType(type) < 0) { fptr.CheckError(); } if (fptr.OpenCheck() < 0) { fptr.CheckError(); } }
public static void PrintX(this IFiscalRegistratorProvider fptr) { if (fptr.PutMode(FiscalRegistratorConsts.ModeReportNoClear) < 0) { fptr.CheckError(); } if (fptr.SetMode() < 0) { fptr.CheckError(); } if (fptr.PutReportType(FiscalRegistratorConsts.ReportX) < 0) { fptr.CheckError(); } if (fptr.Report() < 0) { fptr.CheckError(); } }
public static void RegistrationFz54(this IFiscalRegistratorProvider fptr, string name, double price, double quantity, int discountType, double discount, int taxNumber) { Utils.TraceMessage($"Name: {name} Price: {price}{Environment.NewLine}" + $"Quantity: {quantity} {nameof(discountType)}: {discountType}" + $"{Environment.NewLine}{nameof(discount)}: {discount} {nameof(taxNumber)}: {taxNumber}"); if (fptr.PutDiscountType(discountType) < 0) { fptr.CheckError(); } if (fptr.PutSumm(discount) < 0) { fptr.CheckError(); } if (fptr.PutTaxNumber(taxNumber) < 0) { fptr.CheckError(); } if (fptr.PutQuantity(quantity) < 0) { fptr.CheckError(); } if (fptr.PutPrice(price) < 0) { fptr.CheckError(); } if (fptr.PutTextWrap(FiscalRegistratorConsts.WrapWord) < 0) { fptr.CheckError(); } if (fptr.PutName(name) < 0) { fptr.CheckError(); } if (fptr.Registration() < 0) { fptr.CheckError(); } }