public PaymentInfoAudit GetByPK(Guid paymentInfoAuditGuid) { if (Guid.Empty == paymentInfoAuditGuid) { return new PaymentInfoAudit(); } try { PaymentInfoAudit daPaymentInfoAudit = new PaymentInfoAudit(); using (PSS2012DataContext context = this.DataContext) { daPaymentInfoAudit = ( from items in context.PaymentInfoAudits where items.PaymentInfoAuditGuid == paymentInfoAuditGuid select items).SingleOrDefault(); } if (null == daPaymentInfoAudit) { throw new DataAccessException("PaymentInfoAudit no longer exists."); } return daPaymentInfoAudit; } catch (System.Data.SqlClient.SqlException ex) { throw this.HandleSqlException(ex); } }
public List<PaymentInfoAudit> GetAllWithUndefined() { PaymentInfoAudit undefinedPaymentInfoAudit = new PaymentInfoAudit() { PaymentInfoAuditGuid = Guid.Empty, PaymentInfoGuid = Guid.Empty, PaymentInfoID = 0, AmazonToken = "Undefined", DateModified = default(DateTime), }; List<PaymentInfoAudit> response = this.GetAll().ToList(); response.Add(undefinedPaymentInfoAudit); return response; }
/// <summary> /// Inserts paymentInfoAudit business entity into the data store. /// </summary> /// <param name="entity">The paymentInfoAudit business entity to insert.</param> /// <returns>The paymentInfoAudit identifier.</returns> public PaymentInfoAudit Insert(PaymentInfoAudit entity) { //@@NEW - changed return type to entity type. try { using (PSS2012DataContext context = DataContext) { entity.PaymentInfoAuditGuid = Guid.NewGuid(); //@@NEW - atuo assign values. entity.DateModified = DateTime.Now; context.PaymentInfoAudits.InsertOnSubmit(entity); context.SubmitChanges(); } //@@NEW - returning full entity. return entity; } catch (System.Data.SqlClient.SqlException ex) { throw this.HandleSqlException(ex); } }
public static DA.PaymentInfoAudit ToDataEntity(this BE.PaymentInfoAudit bePaymentInfoAudit) { DA.PaymentInfoAudit paymentInfoAuditResult = new DA.PaymentInfoAudit() { PaymentInfoAuditGuid = bePaymentInfoAudit.PaymentInfoAuditGuid, PaymentInfoGuid = bePaymentInfoAudit.PaymentInfoGuid, PaymentInfoID = bePaymentInfoAudit.PaymentInfoID, AmazonToken = bePaymentInfoAudit.AmazonToken, DateModified = bePaymentInfoAudit.DateModified, }; return paymentInfoAuditResult; }