Beispiel #1
0
        public ExpenseCategoryList()
        {
            InitializeComponent();
            var wsPayment = new ServiceReference4.ExpenseCategorySoapClient();

            wsPayment.GetDetailsAsync();
            wsPayment.GetDetailsCompleted += wsPaymentCompleted;
        }
        public ExpenseCategoryEdit(int idSelected)
        {
            InitializeComponent();
            id.Text = idSelected.ToString();

            var wsPayment = new ServiceReference4.ExpenseCategorySoapClient();

            wsPayment.GetDetailsByIdAsync(idSelected);
            wsPayment.GetDetailsByIdCompleted += wsPaymentCompleted;
        }
        async void OnDelete(object sender, EventArgs args)
        {
            try {
                ServiceReference4.ExpenseCategoryModel payment = new ServiceReference4.ExpenseCategoryModel();

                payment.id = Int32.Parse(id.Text);
                var wsPayment = new ServiceReference4.ExpenseCategorySoapClient();
                wsPayment.DeleteAsync(payment.id);
                wsPayment.DeleteCompleted += wsPaymentDeleteCompleted;
            } catch (Exception ex) {
                throw ex;
            }
        }
        async void OnSubmitData(object sender, EventArgs args)
        {
            try {
                ServiceReference4.ExpenseCategoryModel payment = new ServiceReference4.ExpenseCategoryModel();

                payment.detail = detail.Text;

                var wsPayment = new ServiceReference4.ExpenseCategorySoapClient();
                wsPayment.AddAsync(payment);
                wsPayment.AddCompleted += wsPaymentAddCompleted;
            } catch (Exception ex) {
                throw ex;
            }
        }