示例#1
0
 private void LoadPaymentData()
 {
     try{
         var usecase = PaymentUsecase.CreateUsecase();
         PutsPaymentDataIntoControls(usecase.GetPaymentById(IdSelected));
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message, "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         IsSaved = false;
         Close();
     }
 }
示例#2
0
 private void LoadPayments(int filterType)
 {
     try{
         var usecase = PaymentUsecase.CreateUsecase();
         ListDataGridView.DataSource = null;
         ListDataGridView.DataSource = usecase.GetPaymentByEstatus(nodeIndex);
         ConfigurePaymentGrid();
     }
     catch (Exception ex) {
         ListDataGridView.DataSource = null;
         MessageBox.Show(ex.Message, "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
示例#3
0
 private void LoadProductsIntoPaymentData()
 {
     try{
         var usecase = PaymentUsecase.CreateUsecase();
         ProductDataGridView.DataSource = null;
         ProductDataGridView.DataSource = usecase.GetProducerIntoPayment(IdOrderSelected);
         ConfigureProductGrid();
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message, "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         IsSaved = false;
         Close();
     }
 }
示例#4
0
 public IHttpActionResult Post(Payment payment)
 {
     if (payment == null)
     {
         return(BadRequest("Parámetros de pago inválidos."));
     }
     try{
         usecase = PaymentUsecase.CreateUsecase();
         usecase.NewPayment(payment);
         return(Ok("Pago realizado correctamente."));
     }
     catch (Exception ex) {
         return(BadRequest(ex.Message.ToString()));
     }
 }
示例#5
0
        private bool NotifyToProducer()
        {
            var result = false;

            try{
                string message;
                var    usecase = PaymentUsecase.CreateUsecase();
                usecase.NotifyProducer(GetResultFromDataGrid());
                message = "Los productores han sido notificados de sus ventas.";
                MessageBox.Show(message, "Atención", MessageBoxButtons.OK, MessageBoxIcon.Information);
                result = true;
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message, "Atención", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                result = false;
            }
            return(result);
        }