protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            modelo = CrossDeviceInfo.Current.Model;

            context     = ApplicationContext;
            printer     = new GertecPrinter(context);
            configPrint = new ConfigPrint();
            printer.setConfigImpressao(configPrint);
            satFunctions = new SatFunctions(context);

            tef = new Tef();

            // ZXing Inicialização
            global::ZXing.Net.Mobile.Forms.Android.Platform.Init();

            //LoadApplication is a Xamarin.Forms method
            LoadApplication(new App());

            currentDateTimeString  = Convert.ToString(DateTime.Now.ToString("dd/MM/yyyy"));
            currentDateTimeStringT = Convert.ToString((data.Hours) + Convert.ToString(data.Minutes) + Convert.ToString(data.Seconds));

            mContext = this;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.Impressao);
            // Create your application here

            modelo = CrossDeviceInfo.Current.Model;

            // Ini Textview
            IniTextview();

            // Ini EditText
            IniEditText();

            // Ini Radio Button
            IniRadioButton();

            // Ini ToggleButton
            IniToggleButton();

            // Ini Spinner
            IniSpinner();

            // Ini Buttons
            IniButtons();

            // Ini funções bottuns
            iniFuncoesButtons();

            // Carrega todos os Spinner
            iniLoadSpinner();

            // Mostra modelo
            //iniLoadModelo();

            // Ini context
            context = ApplicationContext;
            // #if __G700__
            printer = new GertecPrinter(mainActivity);
            // #elif __G800__
            //     sdfjksdjfklsdjflks
            // #endif

            configPrint = new ConfigPrint();
            printer.setConfigImpressao(configPrint);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            printer     = new GertecPrinter(mainActivity);
            configPrint = new ConfigPrint();
            printer.setConfigImpressao(configPrint);
            satFunctions = new SatFunctions(context);

            modelo = CrossDeviceInfo.Current.Model;

            // ZXing Inicialização
            global::ZXing.Net.Mobile.Forms.Android.Platform.Init();

            //LoadApplication is a Xamarin.Forms method
            LoadApplication(new App());

            mContext = this;
        }
Example #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Tef);

            InitEditText();
            InitRadioButtons();
            InitButtons();

            valPag.Text                = "10,00";
            rbMsitef.Checked           = true;
            rbParcAdm.Checked          = true;
            btnValidaImpressao.Checked = false;
            btnValidaImpressao.Enabled = false;
            rbCredito.Checked          = true;

            currentDateTimeString = DateTime.Now.ToString("dd/MM/yyyy");

            currentDateTimeStringT = DateTime.Now.ToString("HHmmss");

            valPag.TextChanged += HandleTextChanged;

            void HandleTextChanged(object sender, Android.Text.TextChangedEventArgs e)
            {
                Value = valPag.Text;
                if (Value != current)
                {
                    valPag.TextChanged -= HandleTextChanged;
                    string cleanString = Regex.Replace(Value, "[^0-9a-zA-Z]+", "");
                    double parsed      = System.Double.Parse(cleanString);
                    Locale teste       = new Locale("pt", "BR");
                    var    formatted   = Java.Text.NumberFormat.GetCurrencyInstance(teste).Format((parsed / 100)).Remove(0, 2);
                    current             = formatted;
                    valPag.Text         = formatted;
                    valPag.TextChanged += HandleTextChanged;
                    valPag.SetSelection(formatted.Length);
                }
            }

            context     = ApplicationContext;
            printer     = new GertecPrinter(context);
            configPrint = new ConfigPrint();
            printer.setConfigImpressao(configPrint);

            rbDebito.CheckedChange += (s, e) =>
            {
                if (rbTodos.Checked || rbDebito.Checked)
                {
                    qtdeParcelas.Text    = ("1");
                    qtdeParcelas.Enabled = (false);
                }
                else
                {
                    qtdeParcelas.Enabled = (true);
                }
            };

            rbTodos.CheckedChange += (s, e) =>
            {
                if (rbTodos.Checked || rbDebito.Checked)
                {
                    qtdeParcelas.Text    = ("1");
                    qtdeParcelas.Enabled = (false);
                }
                else
                {
                    qtdeParcelas.Enabled = (true);
                }
            };

            rbMsitef.CheckedChange += (s, e) =>
            {
                if (rbMsitef.Checked == true)
                {
                    ipEdit.Enabled             = true;
                    btnValidaImpressao.Checked = false;
                    btnValidaImpressao.Enabled = false;
                }
                else
                {
                    ipEdit.Enabled             = false;
                    btnValidaImpressao.Enabled = true;
                    btnValidaImpressao.Checked = true;
                }
            };
        }