Esempio n. 1
0
        /*************************************
        *  Created by:   Tuan Tran
        *  Created on:   Mar 6, 2017
        *  Function:     GetAllAcctCollection
        *  Purpose:      GetAllAcctCollection
        *  Inputs:       collectionTaskDTO class
        *  Returns:      GetAllAcctCollectionResponse
        *************************************/
        public async Task <GetAllAcctCollectionResponse> GetAllAcctCollection(CollectionTaskListViewModel collectionTaskModel)
        {
            Logger.Info("Invoking GetAllAcctCollection function");
            var response = new GetAllAcctCollectionResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var collectionTaskDAO = scope.Resolve <ICollectionOpDAO>();
                    var collectionTask    = Mapper.Map <CollectionTaskListViewModel, CollectionTaskDTO>(collectionTaskModel);
                    var results           = await collectionTaskDAO.GetAllAcctCollection(collectionTask);

                    if (results.Count() > 0)
                    {
                        response.collectionTasks = Mapper.Map <IList <CollectionTaskDTO>, IList <CollectionTaskListViewModel> >(results);
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetAllAcctCollection: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
Esempio n. 2
0
        /*************************************
        *  Created by:   dandy boy
        *  Created on:   april 28, 2017
        *  Function:     GetCollectionHistory
        *  Purpose:      GetCollectionHistory
        *  Inputs:       acctNo,collectionCaseSts
        *  Returns:      GetAllAcctCollectionResponse
        *************************************/
        public async Task <GetAllAcctCollectionResponse> GetCollectionHistory(string acctNo, string collectionCaseSts)
        {
            Logger.Info("Invoking GetCollectionHistory function");
            var response = new GetAllAcctCollectionResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var collectionTaskDAO = scope.Resolve <ICollectionOpDAO>();
                    var results           = await collectionTaskDAO.GetCollHistory(acctNo, collectionCaseSts);

                    if (results.Count() > 0)
                    {
                        response.collectionHistories = Mapper.Map <List <CollectionHistoryDTO>, List <CollectionHistoryViewModel> >(results);
                    }
                }
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetCollectionHistory: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
Esempio n. 3
0
        /*************************************
        *  Created by:   Tuan Tran
        *  Created on:   May 11, 2017
        *  Function:     GetCollectionFinancialInfo
        *  Purpose:      GetCollectionFinancialInfo
        *  Inputs:       acctNo
        *  Returns:      GetAllAcctCollectionResponse
        *************************************/
        public async Task <GetAllAcctCollectionResponse> GetCollectionFinancialInfo(string acctNo)
        {
            Logger.Info("Invoking GetCollectionFinancialInfo function");
            var response = new GetAllAcctCollectionResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var collectionTaskDAO = scope.Resolve <ICollectionOpDAO>();
                    var result            = await collectionTaskDAO.GetCollFinancialInfo(acctNo);

                    if (result != null)
                    {
                        response.collInfoViewModel = Mapper.Map <DelinquentAcctFinancialInfoDTO, CollInfoViewModel>(result);
                    }
                }
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetCollectionFinancialInfo: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
Esempio n. 4
0
        /*************************************
        *  Created by:   dandy boy
        *  Created on:    april 25, 2017
        *  Function:     GetThresholdLimitCollection
        *  Purpose:      GetThresholdLimitCollection
        *  Inputs:       offSet,noOfRecs,tOtalNoOfRecs,sSearch
        *  Returns:      GetAllAcctCollectionResponse
        *************************************/
        public async Task <GetAllAcctCollectionResponse> GetThresholdLimitCollection(int offSet, Int64 noOfRecs, Int64 tOtalNoOfRecs, string sSearch)
        {
            Logger.Info("Invoking GetThresholdLimitCollection function");
            var response = new GetAllAcctCollectionResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var collectionTaskDAO = scope.Resolve <ICollectionOpDAO>();
                    var result            = await collectionTaskDAO.GetThresholdLmtCollection(offSet, noOfRecs, tOtalNoOfRecs, sSearch);

                    if (result != null)
                    {
                        response.collectionTasks = Mapper.Map <IList <DelinquentAcctsTresholdLimitDTO>, IList <CollectionTaskListViewModel> >(result.delinquentAcctsTresholdLimits);
                        response.tOtalNoOfRecs   = result.tOtalNoOfRecs;
                    }
                }
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetThresholdLimitCollection: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }