Beispiel #1
0
        private void initDeviceLibrary()
        {
            try
            {
                deviceLibrary.Open();
                deviceLibrary.Enable();
                DeviceStatus status = deviceLibrary.Status;


                if (status == DeviceStatus.Disconnected)
                {
                    MessageBox.Show("El dispositivo NO está conectado.");
                    goBack();
                    return;
                }

                if (status == DeviceStatus.Disabled)
                {
                    MessageBox.Show("El dispositivo NO acepta monedas ni billetes en este momento.");
                    goBack();
                    return;
                }

                lblCargando.Visible = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #2
0
        public Payment()
        {
            dv.Open();
            VariablesGlobales.c_centavo = 0;
            VariablesGlobales.c_centavo = 0;
            VariablesGlobales.c_dos     = 0;
            VariablesGlobales.c_cinco   = 0;
            VariablesGlobales.c_diez    = 0;

            VariablesGlobales.c_veinte     = 0;
            VariablesGlobales.c_cincuenta  = 0;
            VariablesGlobales.c_doscientos = 0;
            VariablesGlobales.c_cien       = 0;
            VariablesGlobales.c_quinientos = 0;


            InitializeComponent();
            VariablesGlobales.ingreso = 0.0;

            var client  = new RestClient("http://linkxenter.com:3000/");
            var request = new RestRequest("account_balance", Method.GET);

            request.AddParameter("token", "dfb11a11722164a4e98c2fdb86c48343");
            request.AddParameter("account", VariablesGlobales.NumCuenta);
            var content = client.Execute(request).Content;

            var    jobj = (JObject)JsonConvert.DeserializeObject(content.ToString());
            string debt = jobj.SelectToken("debt").ToString();

            Deuda_blue.Content         = "$" + debt;
            VariablesGlobales.ingreso  = 0;
            Depositado_blue.Content    = "$" + VariablesGlobales.ingreso;
            VariablesGlobales.deuda    = Double.Parse(debt);
            VariablesGlobales.restante = VariablesGlobales.deuda - VariablesGlobales.ingreso;

            dv.AcceptedDocument += Dv_AcceptedDocument;
        }
Beispiel #3
0
        public Payment(string balance)
        {
            InitializeComponent();

            device = new DeviceLibrary.DeviceLibrary();

            device.AcceptedDocument += delegate(DeviceLibrary.Models.Document doc) {
                string mssg = doc.Type.ToString() + " " + doc.Value + " aceptado!";
                MessageBox.Show(mssg);
            };

            device.Open();

            GraphicsPath p = new GraphicsPath();

            p.AddEllipse(3, 3, 43, 43);
            Region region = new Region(p);

            btPaym_10.Region   = region;
            btPaym_5.Region    = region;
            btPaym_2.Region    = region;
            btPaym_1.Region    = region;
            btPaym_0_50.Region = region;

            if (Util.IsJsonObject(balance))
            {
                JObject obj = JObject.Parse(balance);
                account             = obj.GetValue("account").ToString();
                user                = obj.GetValue("user").ToString();
                tbPaymentDeuda.Text = obj.GetValue("debt").ToString();
                tbPaymentDepo.Text  = "0.00";
                tbPaymentRest.Text  = "0.00";

                deuda = float.Parse(tbPaymentDeuda.Text);
            }
        }