internal static PaymentType Load(int paymentTypeId) { DAL.CustomersDataContext dc = new DAL.CustomersDataContext(); DAL.PaymentType dalPaymentType = findRecord(dc, paymentTypeId); PaymentType bo = new PaymentType(); map(dalPaymentType, bo); return bo; }
private static PaymentType createRandomPaymentType() { PaymentType pt = new PaymentType(); pt.CardType = rnd.Next().ToString(); pt.Glacctno = rnd.Next().ToString(); return pt; }
private static void map(DAL.CustomersDataContext dc, PaymentType paymentType, DAL.PaymentType dalPaymentType) { bool isNew = paymentType.Id == 0; bool isModified = false; if (dalPaymentType.CardType != paymentType.CardType) { dalPaymentType.CardType = paymentType.CardType; isModified = true; } if (dalPaymentType.Glacctno != paymentType.Glacctno) { dalPaymentType.Glacctno = paymentType.Glacctno; isModified = true; } if (isNew) { dalPaymentType.CreatedBy = paymentType.LastChangedBy; dalPaymentType.CreatedDate = DateTime.Now; } if (isModified) { dalPaymentType.LastChangedBy = paymentType.LastChangedBy; dalPaymentType.LastChangedDate = DateTime.Now; } }
internal static void Delete(CustomerManagement.DAL.CustomersDataContext dc, PaymentType paymentType) { DAL.PaymentType dalPaymentType = findRecord(dc, paymentType.Id); dalPaymentType.Deleted = true; dc.SubmitChanges(); }
private static void map(DAL.PaymentType dalPaymentType, PaymentType bo) { bo.Id = dalPaymentType.Id; bo.CardType = dalPaymentType.CardType; bo.Glacctno = dalPaymentType.Glacctno; }