Esempio n. 1
0
        private void btnTest_Click(object sender, RoutedEventArgs e)
        {
            //persons.Add(new Person(++index));
            //Person p = (Person)this.listView1.SelectedItems[0];
            //MessageBox.Show(p.Sex.ToString());
            StringBuilder sb = new StringBuilder(33);

            sb.Append("123456");
            int   st    = 0;
            Int32 value = 100;

            st = CardRef.CoolerPutCard(sb);
            st = CardRef.CoolerReadCard(sb, ref value);
            st = CardRef.CoolerRechargeCard(sb, 100);
            st = CardRef.CoolerConsumeCard(sb, 100);
            MessageBox.Show(CardRef.GetStr(st));
        }
Esempio n. 2
0
        public bool ReadCard(out string cardNo, out decimal cardBalance)
        {
            StringBuilder sb    = new StringBuilder(33);
            int           value = 0;

            cardNo      = "";
            cardBalance = 0;
            int st = CardRef.CoolerReadCard(sb, ref value);

            if (st != 0)
            {
                MessageBox.Show(CardRef.GetStr(st));
                return(false);
            }
            cardBalance = Convert.ToDecimal(value) / 100;
            cardNo      = sb.ToString();
            return(true);
        }