コード例 #1
0
ファイル: PaymentDetailsDAO.cs プロジェクト: RazenRyne/eSAR
        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;
        }
コード例 #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;
 }
コード例 #3
0
ファイル: PaymentDetailsDAO.cs プロジェクト: RazenRyne/eSAR
        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;
        }
コード例 #4
0
ファイル: PaymentDetailsDAO.cs プロジェクト: RazenRyne/eSAR
        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;
            }
コード例 #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);
 }
コード例 #6
0
ファイル: PaymentService.cs プロジェクト: dansalan/DCFIv5
 public void TranslatePaymentDetailsToPaymentDetailsBDO(PaymentDetail payment, PaymentDetailsBDO pdbdo)
 {
     pdbdo.Amout = payment.Amout;
     pdbdo.DetailNumber = payment.DetailNumber;
     pdbdo.FeeID = payment.FeeID;
     pdbdo.ORNo = payment.ORNo;
 }
コード例 #7
0
ファイル: PaymentService.cs プロジェクト: dansalan/DCFIv5
 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;
 }
コード例 #8
0
ファイル: PaymentDetailsLogic.cs プロジェクト: RazenRyne/eSAR
 public Boolean CreatePaymentDetail(ref PaymentDetailsBDO paymentDetailsBDO, ref string message)
 {
     Boolean ret = false;
     ret = pdDAO.CreatePaymentDetail(ref paymentDetailsBDO, ref message);
     return ret;
 }
コード例 #9
0
ファイル: PaymentDAO.cs プロジェクト: RazenRyne/eSAR
 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;
 }
コード例 #10
0
ファイル: PaymentDAO.cs プロジェクト: RazenRyne/eSAR
 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;
  }
コード例 #11
0
ファイル: PaymentDetailsDAO.cs プロジェクト: RazenRyne/eSAR
 public void ConvertPaymentDetailsBDOToPaymentDetails(PaymentDetailsBDO paymentDetailsBDO, PaymentDetail pd)
 {
     pd.Amount = paymentDetailsBDO.Amout;
     pd.DetailNumber = paymentDetailsBDO.DetailNumber;
     pd.FeeID = paymentDetailsBDO.FeeID;
     pd.ORNo = paymentDetailsBDO.ORNo;
 }