Example #1
0
 void Dispense(string TicketNo, string AssetNo, int Amount)
 {
     try
     {
         IBmcCashDispenser obj = BmcCashDispenserFactory.GetDispenser(_parent, _ctype);
         if (obj != null)
         {
             obj.Finished      += new BmcCashDispenserFinishedHandler(obj_Finished);
             obj.StatusChanged += new BmcCashDispenserStatusChangeHandler(obj_StatusChanged);
             obj.Dispense(TicketNo, AssetNo, Amount);
         }
         else
         {
             Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart) delegate
             {
                 Result res            = new Result();
                 res.IsSuccess         = false;
                 res.error             = new Error();
                 res.error.Message     = Application.Current.FindResource("MessageID444") as string;
                 res.error.MessageType = "Error";
                 this.Result           = res;
                 this.Close();
             });
         }
     }
     catch (Exception ex)
     {
         Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart) delegate
         {
             this.Close();
         });
     }
 }
Example #2
0
 void obj_Finished(IBmcCashDispenser sender, IBmcCashDispenseresult result)
 {
     Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart) delegate
     {
         this.Result = result.Result;
         this.Close();
     });
 }
Example #3
0
 void obj_StatusChanged(IBmcCashDispenser sender, string Status)
 {
     Dispatcher.BeginInvoke(DispatcherPriority.Background, (SendOrPostCallback) delegate { lblStatus.SetValue(System.Windows.Controls.Label.ContentProperty, Status); }, null);
 }
 void obj_Finished(IBmcCashDispenser sender, IBmcCashDispenseresult result)
 {
     Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
     {
         this.Result = result.Result;
         this.Close();
     });
 }
 void obj_StatusChanged(IBmcCashDispenser sender, string Status)
 {
     Dispatcher.BeginInvoke(DispatcherPriority.Background, (SendOrPostCallback)delegate { lblStatus.SetValue(System.Windows.Controls.Label.ContentProperty, Status); }, null);
 }