Exemplo n.º 1
0
        /// <summary>
        /// Deletes the payment out.
        /// </summary>
        /// <param name="paymentOut">The payment out.</param>
        /// <returns>The <see cref="Task"/> containing the API response.</returns>
        public virtual Task <ApiResponse> DeleteAsync(PaymentOut paymentOut)
        {
            if (paymentOut == null)
            {
                throw new ArgumentNullException(nameof(paymentOut));
            }

            var requestContext = PrepareRequestContext(method: Method.DELETE, path: $"{Path}/{paymentOut.Id}");

            return(CallAsync(requestContext));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Updates the payment out.
        /// </summary>
        /// <param name="paymentOut">The payment out.</param>
        /// <returns>The <see cref="Task"/> containing the API response with <see cref="PaymentOut"/>.</returns>
        public virtual Task <ApiResponse <PaymentOut> > UpdateAsync(PaymentOut paymentOut)
        {
            if (paymentOut == null)
            {
                throw new ArgumentNullException(nameof(paymentOut));
            }

            var requestContext = PrepareRequestContext(method: Method.PUT, path: $"{Path}/{paymentOut.Id}")
                                 .WithBody(Serialize(paymentOut));

            return(CallAsync <PaymentOut>(requestContext));
        }
        private void Save_btn_Click(object sender, EventArgs e)
        {
            PaymentOut payment = new PaymentOut();

            payment.Vendor_ID = (int)Vender_txt.SelectedValue;
            payment.Reason    = Reason_txt.Text;
            payment.Amount    = Convert.ToDecimal(Amount_txt.Text);
            payment.Date      = Date_txt.Value;
            payment.Method    = Method_txt.Text;

            payment.Cheque_No   = Cheque_txt.Text;
            payment.Cheque_Date = ChequeDate_txt.Value;


            dbContext.PaymentOuts.Add(payment);
            dbContext.SaveChanges();
            Refresh();
            ClearTextBox();
        }