Exemple #1
0
        async void OnDelete(object sender, EventArgs args)
        {
            try {
                ServiceReference2.PaymentRecordModel payment = new ServiceReference2.PaymentRecordModel();

                payment.id = Int32.Parse(id.Text);
                var wsPayment = new ServiceReference2.PaymentRecordSoapClient();
                wsPayment.DeleteAsync(payment.id);
                wsPayment.DeleteCompleted += wsPaymentDeleteCompleted;
            } catch (Exception ex) {
                throw ex;
            }
        }
Exemple #2
0
        async void OnSubmitData(object sender, EventArgs args)
        {
            try {
                ServiceReference2.PaymentRecordModel payment = new ServiceReference2.PaymentRecordModel();

                payment.id                = Int32.Parse(id.Text);
                payment.detail            = detail.Text;
                payment.amount            = Double.Parse(amount.Text);
                payment.recurrence        = Boolean.Parse(recurrence.Text);
                payment.recurrenciaTypeId = Int32.Parse(recurrenciaTypeId.Text);
                payment.providerId        = Int32.Parse(providerId.Text);
                payment.expenseCategoryId = Int32.Parse(expenseCategoryId.Text);

                bool     send = true;
                DateTime temp;
                if (DateTime.TryParse(paymentDate.Text, out temp))
                {
                    payment.paymentDate = DateTime.Parse(paymentDate.Text);
                }
                else
                {
                    send = false;
                    Device.BeginInvokeOnMainThread(() => {
                        DisplayAlert("Error", "Error de fecha", "Ok");
                    });
                }

                if (send)
                {
                    var wsPayment = new ServiceReference2.PaymentRecordSoapClient();
                    wsPayment.UpdateDetailsAsync(payment);
                    wsPayment.UpdateDetailsCompleted += wsPaymentUpdateCompleted;
                }
            } catch (Exception ex) {
                throw ex;
            }
        }