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(); } }
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); } }
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(); } }
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())); } }
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); }