Ejemplo n.º 1
0
        public bool DeletePayment(Payment payment)
        {
            try
            {
                PaymentTable.DeleteOnSubmit(payment);
                PaymentTable.Context.SubmitChanges();

                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }
Ejemplo n.º 2
0
        public bool SavePayment(Payment payment)
        {
            try
            {
                if (payment.PaymentId == 0)
                {
                    PaymentTable.InsertOnSubmit(payment);
                }
                else
                {
                    PaymentTable.Context.Refresh(RefreshMode.KeepCurrentValues, payment);
                }

                PaymentTable.Context.SubmitChanges();

                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }
Ejemplo n.º 3
0
 public List<Payment> GetPaymentsByType(Payment.PaymentTypeList paymentType)
 {
     return PaymentTable.Where(x => x.PaymentTypeId == (int)paymentType).ToList();
 }
Ejemplo n.º 4
0
 public List<Payment> GetPaymentsByStatus(Payment.PaymentStatusList paymentStatus)
 {
     return PaymentTable.Where(x => x.PaymentStatusId == (int)paymentStatus).ToList();
 }