public RefundRequest Get(long id) { var entity = new RefundRequestEntity(id); using (var adapter = PersistenceLayer.GetDataAccessAdapter()) { if (!adapter.FetchEntity(entity)) { throw new ObjectNotFoundInPersistenceException <RefundRequest>(); } } var pair = GetEventIdCustomerIdPairforOrder(entity.OrderId); var request = Mapper.Map <RefundRequestEntity, RefundRequest>(entity); if (request.RefundRequestResult == null && !string.IsNullOrWhiteSpace(entity.ProcessorNotes)) { request.RefundRequestResult = new RefundRequestResult(); request.RefundRequestResult.Notes = entity.ProcessorNotes; } if (pair != null) { request.EventId = pair.FirstValue; request.CustomerId = pair.SecondValue; } return(request); }
/// <summary> setups the sync logic for member _refundRequest</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncRefundRequest(IEntity2 relatedEntity) { if (_refundRequest != relatedEntity) { DesetupSyncRefundRequest(true, true); _refundRequest = (RefundRequestEntity)relatedEntity; base.PerformSetupSyncRelatedEntity(_refundRequest, new PropertyChangedEventHandler(OnRefundRequestPropertyChanged), "RefundRequest", RefundRequestGiftCertificateEntity.Relations.RefundRequestEntityUsingRefundRequestId, true, new string[] { }); } }
/// <summary> Initializes the class members</summary> protected virtual void InitClassMembers() { _giftCertificate = null; _refundRequest = null; PerformDependencyInjection(); // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers // __LLBLGENPRO_USER_CODE_REGION_END OnInitClassMembersComplete(); }
public void SaveProcessorNotes(long id, string notes) { using (var adapter = PersistenceLayer.GetDataAccessAdapter()) { var entity = new RefundRequestEntity() { ProcessorNotes = notes }; adapter.UpdateEntitiesDirectly(entity, new RelationPredicateBucket(RefundRequestFields.RefundRequestId == id)); } }
public void Delete(RefundRequest domainObject) { if (domainObject != null && domainObject.Id > 0) { RefundRequest refundRequest = Get(domainObject.Id); if (refundRequest.RequestStatus == (long)RequestStatus.Pending) { using (var adapter = PersistenceLayer.GetDataAccessAdapter()) { var entity = new RefundRequestEntity() { IsActive = false }; adapter.UpdateEntitiesDirectly(entity, new RelationPredicateBucket(RefundRequestFields.RefundRequestId == domainObject.Id)); } } } }
protected RefundRequestGiftCertificateEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _giftCertificate = (GiftCertificateEntity)info.GetValue("_giftCertificate", typeof(GiftCertificateEntity)); if (_giftCertificate != null) { _giftCertificate.AfterSave += new EventHandler(OnEntityAfterSave); } _refundRequest = (RefundRequestEntity)info.GetValue("_refundRequest", typeof(RefundRequestEntity)); if (_refundRequest != null) { _refundRequest.AfterSave += new EventHandler(OnEntityAfterSave); } base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary> Removes the sync logic for member _refundRequest</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncRefundRequest(bool signalRelatedEntity, bool resetFKFields) { base.PerformDesetupSyncRelatedEntity(_refundRequest, new PropertyChangedEventHandler(OnRefundRequestPropertyChanged), "RefundRequest", RefundRequestGiftCertificateEntity.Relations.RefundRequestEntityUsingRefundRequestId, true, signalRelatedEntity, "RefundRequestGiftCertificate", resetFKFields, new int[] { (int)RefundRequestGiftCertificateFieldIndex.RefundRequestId }); _refundRequest = null; }