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 List<BE.Client> GetAllClientWithUndefined() { DA.ClientGateway gateway = new DA.ClientGateway(); List<BE.Client> result = new List<BE.Client>(); result = gateway.GetAllWithUndefined().ToBusinessEntitiesList(); return result; }
public void DeleteClient(BE.Client entity) { // Delete the main record. DA.ClientGateway gateway = new DA.ClientGateway(); gateway.Delete(entity.ClientGuid); //@@NEW // Create the audit record. ClientAuditLogic auditLogic = new ClientAuditLogic(); auditLogic.InsertClientAudit(entity); }
public BE.Client GetClientByClientGuid(Guid clientGuid) { try { DA.ClientGateway gateway = new DA.ClientGateway(); BE.Client result = new BE.Client(); result = gateway.GetByPK(clientGuid).ToBusinessEntity(); return result; } catch (DataAccess.DataAccessException) { return null; } }
public BE.Client GetClientByEmail(string email) { DA.ClientGateway gateway = new DA.ClientGateway(); //BE.Client result = new BE.Client(); try { return gateway.GetByEmail(email).ToBusinessEntity(); } catch (NullReferenceException) { 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 List<BE.Client> GetClientsForPaymentInfoByPaymentInfoGuid(Guid paymentInfoGuid) { DA.ClientGateway gateway = new DA.ClientGateway(); List<BE.Client> result = new List<BE.Client>(); result = gateway.GetForPaymentInfoByPaymentInfoGuid(paymentInfoGuid).ToBusinessEntitiesList(); return result; }
public List<BE.Client> GetClientsForCityStateZipByCityStateZipGuid(Guid cityStateZipGuid) { DA.ClientGateway gateway = new DA.ClientGateway(); List<BE.Client> result = new List<BE.Client>(); result = gateway.GetForCityStateZipByCityStateZipGuid(cityStateZipGuid).ToBusinessEntitiesList(); return result; }
public void UpdateClient(BE.Client entity) { StripPhoneNumber(entity); // Update the main record. DA.ClientGateway gateway = new DA.ClientGateway(); gateway.Update(entity.ToDataEntity()); //@@NEW // Create the audit record. ClientAuditLogic auditLogic = new ClientAuditLogic(); auditLogic.InsertClientAudit(entity); }
public BE.Client InsertClient(BE.Client entity) { StripPhoneNumber(entity); //@@NEW - removed try/catch. insert returns DA entity (with new data). this method now returns an entity. DA.ClientGateway gateway = new DA.ClientGateway(); DA.Client result = gateway.Insert(entity.ToDataEntity()); //@@NEW // Create the audit record. ClientAuditLogic auditLogic = new ClientAuditLogic(); auditLogic.InsertClientAudit(result.ToBusinessEntity()); return result.ToBusinessEntity(); }