コード例 #1
0
ファイル: AccountLogic.cs プロジェクト: ankit-defacto/PSS
        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;
        }
コード例 #2
0
ファイル: ClientLogic.cs プロジェクト: ankit-defacto/PSS
 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;
 }
コード例 #3
0
ファイル: ClientLogic.cs プロジェクト: ankit-defacto/PSS
        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);
        }
コード例 #4
0
ファイル: ClientLogic.cs プロジェクト: ankit-defacto/PSS
 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;
     }
 }
コード例 #5
0
ファイル: ClientLogic.cs プロジェクト: ankit-defacto/PSS
        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;
        }
コード例 #6
0
ファイル: AccountLogic.cs プロジェクト: ankit-defacto/PSS
        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();
        }
コード例 #7
0
ファイル: ClientLogic.cs プロジェクト: ankit-defacto/PSS
 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;
 }
コード例 #8
0
ファイル: ClientLogic.cs プロジェクト: ankit-defacto/PSS
 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;
 }
コード例 #9
0
ファイル: ClientLogic.cs プロジェクト: ankit-defacto/PSS
        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);
        }
コード例 #10
0
ファイル: ClientLogic.cs プロジェクト: ankit-defacto/PSS
        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();
        }