Пример #1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            cfa.AppSettings.Settings["CASHENABLE"].Value = "T";
            cfa.Save();


            dTimer.IsEnabled = false;
            Payout.Reset(LOGS);
            Payout.SSPComms.CloseComPort();

            this.Close();
        }
Пример #2
0
        public CashPay1(int Price, string CarNumber, string recordsId, string inTime)
        {
            InitializeComponent();

            this.ParkPrice = Price / 100;
            this.CarNum    = CarNumber;
            this.recordId  = recordsId; //付款使用的id
            this.InTime    = inTime;

            //ParkPrice = 3;  //强制测试使用

            //set background
            ImageBrush imageBrush = new ImageBrush();

            imageBrush.ImageSource = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + "img/background.png"));
            this.Background        = imageBrush;


            string CashEnable = ConfigurationManager.AppSettings["CASHENABLE"];

            if (CashEnable == "F")
            {
                IsCashEnable = false;
            }


            label.Content = "车牌:" + CarNumber;
            labe2.Content = "应付金额:               元";
            labe3.Content = ((double)ParkPrice).ToString("0.00");

            prompt.Text = ConfigurationManager.AppSettings["warn"];

            IsInitSuccesed = CashPayInit();
            if (IsInitSuccesed)
            {
                dTimer.IsEnabled = true;
            }
            else
            {
                dTimer.IsEnabled = false;
                Payout.Reset(textBox1);
                prompt.Text = "设备初始化错误,请返回主页重新操作";
            }
        }