public List<BE.PaymentInfo> GetAllPaymentInfoWithUndefined() { DA.PaymentInfoGateway gateway = new DA.PaymentInfoGateway(); List<BE.PaymentInfo> result = new List<BE.PaymentInfo>(); result = gateway.GetAllWithUndefined().ToBusinessEntitiesList(); return result; }
public BE.AccountViewModel GetByEmail(string email) { DA.ClientGateway clientGateway = new DA.ClientGateway(); DA.Client client = clientGateway.GetByEmail(email); // Validation of client. if (null == client) return null; if (Guid.Empty == client.CityStateZipGuid) return null; if (Guid.Empty == client.PaymentInfoGuid) return null; DA.CityStateZipGateway cityGateway = new DA.CityStateZipGateway(); DA.CityStateZip cityStateZip = cityGateway.GetByPK(client.CityStateZipGuid); // Validation of city state zip. if (null == cityStateZip) return null; DA.PaymentInfoGateway paymentGateway = new DA.PaymentInfoGateway(); DA.PaymentInfo paymentInfo = paymentGateway.GetByPK(client.PaymentInfoGuid); // Validation of paymentInfo. if (null == paymentInfo) return null; BE.AccountViewModel account = EntityConversion.BuildAccountViewModel(client, cityStateZip, paymentInfo); return account; }
public void DeletePaymentInfo(BE.PaymentInfo entity) { //@@NEW // Delete the main record. DA.PaymentInfoGateway gateway = new DA.PaymentInfoGateway(); gateway.Delete(entity.PaymentInfoGuid); // Create the audit record. PaymentInfoAuditLogic auditLogic = new PaymentInfoAuditLogic(); auditLogic.InsertPaymentInfoAudit(entity); }
public BE.PaymentInfo InsertPaymentInfo(BE.PaymentInfo entity) { //@@NEW - removed try/catch. insert returns DA entity (with new data). this method now returns an entity. DA.PaymentInfoGateway gateway = new DA.PaymentInfoGateway(); DA.PaymentInfo result = gateway.Insert(entity.ToDataEntity()); // Create the audit record. PaymentInfoAuditLogic auditLogic = new PaymentInfoAuditLogic(); auditLogic.InsertPaymentInfoAudit(result.ToBusinessEntity()); return result.ToBusinessEntity(); }
public BE.PaymentInfo GetPaymentInfoByPaymentInfoGuid(Guid paymentInfoGuid) { DA.PaymentInfoGateway gateway = new DA.PaymentInfoGateway(); BE.PaymentInfo result = new BE.PaymentInfo(); try { result = gateway.GetByPK(paymentInfoGuid).ToBusinessEntity(); } catch (DataAccess.DataAccessException) { return null; } return result; }
public IQueryable<BE.AccountViewModel> GetAll() { DA.ClientGateway clientGateway = new DA.ClientGateway(); List<DA.Client> clients = clientGateway.GetClientList(); List<BE.AccountViewModel> accountList = new List<BE.AccountViewModel>(); foreach (var client in clients) { //Validation of client. if (null == client) return null; if (Guid.Empty == client.CityStateZipGuid) return null; if (Guid.Empty == client.PaymentInfoGuid) return null; DA.CityStateZipGateway cityGateway = new DA.CityStateZipGateway(); DA.CityStateZip cityStateZip = cityGateway.GetByPK(client.CityStateZipGuid); // Validation of city state zip. if (null == cityStateZip) return null; DA.PaymentInfoGateway paymentGateway = new DA.PaymentInfoGateway(); DA.PaymentInfo paymentInfo = paymentGateway.GetByPK(client.PaymentInfoGuid); // Validation of paymentInfo. if (null == paymentInfo) return null; //Full Account of Client BE.AccountViewModel account = EntityConversion.BuildAccountViewModel(client, cityStateZip, paymentInfo); accountList.Add(account); } return accountList.AsQueryable(); }
public void UpdatePaymentInfo(BE.PaymentInfo entity) { //@@NEW // Update the main record. DA.PaymentInfoGateway gateway = new DA.PaymentInfoGateway(); gateway.Update(entity.ToDataEntity()); // Create the audit record. PaymentInfoAuditLogic auditLogic = new PaymentInfoAuditLogic(); auditLogic.InsertPaymentInfoAudit(entity); }