Esempio n. 1
0
        /// <summary>
        /// To get ClientPayerViewModel from ClientPayer DTO
        /// </summary>
        /// <param name="clientPayersDTO"></param>
        /// <returns></returns>
        public static List <ClientPayerViewModel> ConstructViewModelFromClientPayerDTO(List <BusinessModel.BusinessModels.ClientPayer> clientPayersDTO)
        {
            List <ClientPayerViewModel> clientPayers = new List <ClientPayerViewModel>();
            ClientPayerViewModel        clientPayer;

            foreach (ClientPayer clientpayerDTO in clientPayersDTO)
            {
                clientPayer               = new ClientPayerViewModel();
                clientPayer.PayerCode     = clientpayerDTO.Payer.PayerCode;
                clientPayer.PayerName     = clientpayerDTO.Payer.PayerName;
                clientPayer.IsM3FeeExempt = clientpayerDTO.IsM3feeExempt;
                clientPayer.RecordStatus  = clientpayerDTO.RecordStatus;
                clientPayer.ID            = clientpayerDTO.ID;
                clientPayer.IsEditable    = clientpayerDTO.IsEditable;
                clientPayer.CanDelete     = clientpayerDTO.CanDelete;
                clientPayers.Add(clientPayer);
            }
            return(clientPayers);
        }
Esempio n. 2
0
        /// <summary>
        /// To activate or inactivate Client payer
        /// </summary>
        /// <param name="clientPayer"></param>
        public ValidationViewModel ActivateOrDeactivateClientPayer(ClientPayerViewModel clientPayer)
        {
            ValidationViewModel validationViewModel = new ValidationViewModel();

            try
            {
                ClientPayer clientPayerDTO = new ClientPayer()
                {
                    ID           = clientPayer.ID,
                    RecordStatus = clientPayer.RecordStatus
                };
                _payerRepository.ActivateOrDeactivateClientPayer(clientPayerDTO);
                validationViewModel.Success = true;
            }
            catch (Exception ex)
            {
                _logger.Log(ex, LogLevel.Error, ex.Message);
                validationViewModel.Success            = false;
                validationViewModel.IsExceptionOccured = true;
                validationViewModel.ErrorMessages.Add(BusinessConstants.ERROR_SAVE_DETAILS);
            }
            return(validationViewModel);
        }
Esempio n. 3
0
 public ValidationViewModel ActivateOrDeactivateClientPayer([FromBody] ClientPayerViewModel clientPayer)
 {
     return(_payerBusiness.ActivateOrDeactivateClientPayer(clientPayer));
 }