private void Btn_Demandar_Click(object sender, RoutedEventArgs e) { MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("¿Adquirir servicio? ", "Confirmar Adquisición", System.Windows.MessageBoxButton.YesNo); if (messageBoxResult == MessageBoxResult.Yes) { User u = UserManagement.GetInstance().CurrentUser; try { AdminMgm.NewPayment(u, ser, PaymentType.Direct); } catch (Exception ex) { MessageBox.Show("Compruebe su saldo en tokens o hable con un administrador de TimeBank\n \n Detalle: " + ex.Message, "Alerta: SERVICIO NO ADQUIRIDO", MessageBoxButton.OK, MessageBoxImage.Information);; } } }
public bool PayService(User user, Service service) { try { IEnumerable <PaymentType> payMethods = _adminMgm.GetPayMethods(); foreach (PaymentType t in payMethods) { Console.WriteLine(t.ToString()); } Console.WriteLine("CHOOSE PAY METHOD"); string p = Console.ReadLine(); _adminMgm.NewPayment(user, service, (PaymentType)int.Parse(p)); return(true); } catch (Exception e) { Console.WriteLine("PAYMENT PROCESS NOT FINISHED : " + e.Message); throw e; } }