Example #1
0
        public PaymentDetailsBDO GetPaymentDetails(int ORNo)
        {
            PaymentDetail paymentDetail = null;
            PaymentDetailsBDO paymentDetailsBDO = new PaymentDetailsBDO();
            try { 
            using (var DCEnt = new DCFIEntities())
            {
                paymentDetail = (from pd in DCEnt.PaymentDetails
                                 where pd.ORNo == ORNo
                                 select pd).FirstOrDefault();
            }

        
            ConvertPaymentDetailsToPaymentDetailsBDO(paymentDetail, paymentDetailsBDO);
            }
            catch (DbEntityValidationException dbEx)
            {
                foreach (var validationErrors in dbEx.EntityValidationErrors)
                {
                    foreach (var validationError in validationErrors.ValidationErrors)
                    {
                        Trace.TraceInformation("Property: {0} Error: {1}",
                                                validationError.PropertyName,
                                                validationError.ErrorMessage);
                    }
                }
            }
            return paymentDetailsBDO;
        }
Example #2
0
 public void TranslatePaymentDetailsDTOToPaymentDetailsBDO(PaymentDetail pd, PaymentDetailsBDO pdbdo)
 {
     pdbdo.Amout = pd.Amout;
     pdbdo.DetailNumber = pd.DetailNumber;
     pdbdo.FeeID = pd.FeeID;
     pdbdo.ORNo = pd.ORNo;
 }
Example #3
0
        public List<PaymentDetailsBDO> GetAllPaymentDetails()
        {
            List<PaymentDetail> paymentDetailsList = new List<PaymentDetail>();
            List<PaymentDetailsBDO> paymentDetailsBDOList = new List<PaymentDetailsBDO>();
            try { 
            using (var DCEnt = new DCFIEntities())
            {
                var allPaymentDetails = (DCEnt.PaymentDetails);
                paymentDetailsList = allPaymentDetails.ToList<PaymentDetail>();
            }

         
            foreach (PaymentDetail pd in paymentDetailsList)
            {
                PaymentDetailsBDO paymentDetailsBDO = new PaymentDetailsBDO();
                ConvertPaymentDetailsToPaymentDetailsBDO(pd, paymentDetailsBDO);
                paymentDetailsBDOList.Add(paymentDetailsBDO);
            }
            }
            catch (DbEntityValidationException dbEx)
            {
                foreach (var validationErrors in dbEx.EntityValidationErrors)
                {
                    foreach (var validationError in validationErrors.ValidationErrors)
                    {
                        Trace.TraceInformation("Property: {0} Error: {1}",
                                                validationError.PropertyName,
                                                validationError.ErrorMessage);
                    }
                }
            }
            return paymentDetailsBDOList;
        }
Example #4
0
        public Boolean CreatePaymentDetail(ref PaymentDetailsBDO paymentDetailsBDO, ref string message)
        {
            message = "Payment Detail Added Successfully";
            bool ret = true;

            PaymentDetail paymentDetail = new PaymentDetail();
            try
            {
                ConvertPaymentDetailsBDOToPaymentDetails(paymentDetailsBDO, paymentDetail);
                using (var DCEnt = new DCFIEntities())
                {
                    DCEnt.PaymentDetails.Attach(paymentDetail);
                    DCEnt.Entry(paymentDetail).State = System.Data.Entity.EntityState.Added;
                    int num = DCEnt.SaveChanges();

                    if (num != 1)
                    {
                        ret = false;
                        message = "Adding of Payment Details failed";
                    }
                }
            }
            catch (DbEntityValidationException dbEx)
            {
                foreach (var validationErrors in dbEx.EntityValidationErrors)
                {
                    foreach (var validationError in validationErrors.ValidationErrors)
                    {
                        Trace.TraceInformation("Property: {0} Error: {1}",
                                                validationError.PropertyName,
                                                validationError.ErrorMessage);
                    }
                }
            }
            return ret;
            }
Example #5
0
 public bool CreatePaymentDetail(ref PaymentDetail pd, ref string message)
 {
     PaymentDetailsBDO pdbdo = new PaymentDetailsBDO();
     TranslatePaymentDetailsDTOToPaymentDetailsBDO(pd, pdbdo);
     return pdLogic.CreatePaymentDetail(ref pdbdo, ref message);
 }
Example #6
0
 public void TranslatePaymentDetailsToPaymentDetailsBDO(PaymentDetail payment, PaymentDetailsBDO pdbdo)
 {
     pdbdo.Amout = payment.Amout;
     pdbdo.DetailNumber = payment.DetailNumber;
     pdbdo.FeeID = payment.FeeID;
     pdbdo.ORNo = payment.ORNo;
 }
Example #7
0
 public List<PaymentDetailsBDO> ToPaymentDetailsBDOList(List<PaymentDetail> pdList)
 {
     List<PaymentDetailsBDO> pdbdoList = new List<PaymentDetailsBDO>();
     foreach (PaymentDetail pd in pdList)
     {
         PaymentDetailsBDO pdbdo = new PaymentDetailsBDO();
         TranslatePaymentDetailsToPaymentDetailsBDO(pd, pdbdo);
         pdbdoList.Add(pdbdo);
     }
     return pdbdoList;
 }
Example #8
0
 public Boolean CreatePaymentDetail(ref PaymentDetailsBDO paymentDetailsBDO, ref string message)
 {
     Boolean ret = false;
     ret = pdDAO.CreatePaymentDetail(ref paymentDetailsBDO, ref message);
     return ret;
 }
Example #9
0
 private void ConvertPaymentDetailsToPaymentDetailsBDO(PaymentDetail pd, PaymentDetailsBDO paymentDetailsBDO)
 {
     paymentDetailsBDO.Amout = (float) pd.Amount;
     paymentDetailsBDO.DetailNumber = pd.DetailNumber;
     paymentDetailsBDO.FeeID = pd.FeeID;
     paymentDetailsBDO.ORNo = (int) pd.ORNo;
 }
Example #10
0
 public List<PaymentDetailsBDO> GetAllPaymentDetailsForPayment(int ORNo)
  {
      List<PaymentDetail> paymentDetails = null;
      List<PaymentDetailsBDO> pbdoList = new List<PaymentDetailsBDO>();
      try { 
      using (var DCEnt = new DCFIEntities())
      {
          paymentDetails = (from pd in DCEnt.PaymentDetails
                            where pd.ORNo == ORNo
                            select pd).ToList<PaymentDetail>();
      }
      foreach (PaymentDetail pd in paymentDetails)
      {
          PaymentDetailsBDO paymentDetailsBDO = new PaymentDetailsBDO();
          ConvertPaymentDetailsToPaymentDetailsBDO(pd, paymentDetailsBDO);
          pbdoList.Add(paymentDetailsBDO);
      }
      }
      catch (DbEntityValidationException dbEx)
      {
          foreach (var validationErrors in dbEx.EntityValidationErrors)
          {
              foreach (var validationError in validationErrors.ValidationErrors)
              {
                  Trace.TraceInformation("Property: {0} Error: {1}",
                                          validationError.PropertyName,
                                          validationError.ErrorMessage);
              }
          }
      }
      return pbdoList;
  }
Example #11
0
 public void ConvertPaymentDetailsBDOToPaymentDetails(PaymentDetailsBDO paymentDetailsBDO, PaymentDetail pd)
 {
     pd.Amount = paymentDetailsBDO.Amout;
     pd.DetailNumber = paymentDetailsBDO.DetailNumber;
     pd.FeeID = paymentDetailsBDO.FeeID;
     pd.ORNo = paymentDetailsBDO.ORNo;
 }