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; }
public void TranslatePaymentDetailsDTOToPaymentDetailsBDO(PaymentDetail pd, PaymentDetailsBDO pdbdo) { pdbdo.Amout = pd.Amout; pdbdo.DetailNumber = pd.DetailNumber; pdbdo.FeeID = pd.FeeID; pdbdo.ORNo = pd.ORNo; }
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; }
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; }
public bool CreatePaymentDetail(ref PaymentDetail pd, ref string message) { PaymentDetailsBDO pdbdo = new PaymentDetailsBDO(); TranslatePaymentDetailsDTOToPaymentDetailsBDO(pd, pdbdo); return pdLogic.CreatePaymentDetail(ref pdbdo, ref message); }
public void TranslatePaymentDetailsToPaymentDetailsBDO(PaymentDetail payment, PaymentDetailsBDO pdbdo) { pdbdo.Amout = payment.Amout; pdbdo.DetailNumber = payment.DetailNumber; pdbdo.FeeID = payment.FeeID; pdbdo.ORNo = payment.ORNo; }
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; }
public Boolean CreatePaymentDetail(ref PaymentDetailsBDO paymentDetailsBDO, ref string message) { Boolean ret = false; ret = pdDAO.CreatePaymentDetail(ref paymentDetailsBDO, ref message); return ret; }
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; }
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; }
public void ConvertPaymentDetailsBDOToPaymentDetails(PaymentDetailsBDO paymentDetailsBDO, PaymentDetail pd) { pd.Amount = paymentDetailsBDO.Amout; pd.DetailNumber = paymentDetailsBDO.DetailNumber; pd.FeeID = paymentDetailsBDO.FeeID; pd.ORNo = paymentDetailsBDO.ORNo; }