예제 #1
0
 public Contracts.GetRequestReason.GetRequestReasonResponse GetRequestReason(GetRequestReasonRequest requestData)
 {
     var business = new GetRequestReasonBL();
     var response = this.ExecuteBusiness(business, requestData);
     return response;
 }
        private void SelectedItemCommandMethod(RequestType requestType_)
        {
            var requestType = SelectedRequest as RequestType;
            if (requestType != null)
            {
                var navParams = new Dictionary<string, object>();
                navParams.Add("product", _codigoProduto);
                navParams.Add("products", _clientProducts);
                navParams.Add("requestTypeId", requestType.IntegrationRequestCode);
                navParams.Add("demandId", requestType.Id);
                navParams.Add("meiIndicator", _meiIndicator);
                navParams.Add("branchOfActivityCode", _branchOfActivityCode);

                //Consulta Lista de Motivos passando o rquestType.Id
                GetRequestReasonModel getRequestReasonModel = new GetRequestReasonModel();
                GetRequestReasonRequest reasonRequest = new GetRequestReasonRequest();

                reasonRequest.DemandId = requestType.Id;

                //configura model para executar serviço utilizando o reasonrequest
                getRequestReasonModel.Request = reasonRequest;
                var executionState = getRequestReasonModel.Execute();

                if (executionState == ExecutionStatus.Success || executionState == ExecutionStatus.Warning)
                {
                    var reasonList = new List<GetRequestReasonDTO>();
                    if (getRequestReasonModel.Response != null
                        && getRequestReasonModel.Response.Reasons != null)
                    {
                        reasonList = getRequestReasonModel.Response.Reasons;
                    }

                    //Incluir lista nos parametros de navegacao - ver nome do parametro
                    navParams.Add("ListaMotivos", reasonList);

                    switch (requestType.IntegrationRequestCode)
                    {
                        case 0003:
                            navParams.Add("rates", _enabledProductRates);
                            if (_tipoProduto == Constants.TIPOGRUPOPRODUTO_CREDITO)
                            {
                                Navegate("RateChangeCreditoAVista", "RequestsRegion", "", navParams);
                            }
                            else
                            {
                                Navegate("RateChange", "RequestsRegion", "", navParams);
                            }
                            break;
                        case Constants.TIPO_DEMANDA_PRD_HABILITAR_VENDA_DIGITADA:

                            Navegate("EnabledTypedSale", "RequestsRegion", "", navParams);

                            break;
                        case Constants.TIPO_DEMANDA_PRD_DESABILITAR_VENDA_DIGITADA:
                            Navegate("DisabledTypedSale", "RequestsRegion", "", navParams);
                            break;
                        case Constants.TIPO_DEMANDA_PRD_SOLICITAR_NEGOCIACAO_DE_TAXA:
                            Navegate("RateNegotiationRequest", "RequestsRegion", "", navParams);
                            break;
                        case Constants.TIPO_DEMANDA_PRD_DESABILITARPRODUTO:
                            Navegate("DisableProduct", "RequestsRegion", "", navParams);
                            break;
                        case Constants.TIPO_DEMANDA_PRD_ALTERAR_PRODUTO:
                            switch (_tipoProduto)
                            {
                                case Constants.TIPOGRUPOPRODUTO_CREDITO:
                                    Navegate("ChangeProductOneLump", "RequestsRegion", "", navParams);
                                    break;
                                case Constants.TIPOGRUPOPRODUTO_PARCELADO:
                                    Navegate("ChangeProductInstallmentCredit", "RequestsRegion", "", navParams);
                                    break;
                                case Constants.TIPOGRUPOPRODUTO_SEGMENTADO:
                                    Navegate("ChangeProductInstallmentSegmentedCredit", "RequestsRegion", "", navParams);
                                    break;
                            }
                            break;
                        default:
                            break;
                    }
                }
                else if (getRequestReasonModel.Response != null)
                {
                    ViewState = ViewStates.ActionError;
                    ErrorId = getRequestReasonModel.Response.CorrelationId.ToString();
                    ErrorMessage = getRequestReasonModel.Response.ErrorMessage;
                    _logger.LogError(ErrorMessage);
                }
                else
                {
                    ViewState = ViewStates.ActionError;
                    ErrorId = Trace.CorrelationManager.ActivityId.ToString("D", CultureInfo.InvariantCulture);
                    ErrorMessage = "TechnicalError occurred while executing: 'GetRequestReasonModel'";
                    _logger.LogError(ErrorMessage);
                }
            }
        }
        private void SelectedItemCommandMethod(RequestType requestType_)
        {
            var requestType = SelectedRequest as RequestType;
            if (requestType != null)
            {
                var navParams = new Dictionary<string, object>();
                navParams.Add("serviceId", _codigoServico);
                navParams.Add("requestTypeId", requestType.IntegrationRequestCode);
                navParams.Add("demandId", requestType.Id);

                //Consulta Lista de Motivos passando o rquestType.Id
                GetRequestReasonModel getRequestReasonModel = new GetRequestReasonModel();
                GetRequestReasonRequest reasonRequest = new GetRequestReasonRequest();

                reasonRequest.DemandId = requestType.Id;

                //configura model para executar serviço utilizando o reasonrequest
                getRequestReasonModel.Request = reasonRequest;
                var executionState = getRequestReasonModel.Execute();

                if (executionState == ExecutionStatus.Success || executionState == ExecutionStatus.Warning)
                {
                    var reasonList = new List<GetRequestReasonDTO>();

                    if (getRequestReasonModel.Response != null
                        && getRequestReasonModel.Response.Reasons != null)
                    {
                        reasonList = getRequestReasonModel.Response.Reasons;
                    }

                    //Incluir lista nos parametros de navegacao - ver nome do parametro
                    navParams.Add("ListaMotivos", reasonList);

                    switch (requestType.IntegrationRequestCode)
                    {
                        case Constants.TIPO_DEMANDA_SVC_DESABILITAR_SERVICO:
                            Navegate("DisableService", "RequestsRegion", "", navParams);
                            break;
                        default:
                            break;
                    }
                }
                else
                {
                    ErrorMessage = getRequestReasonModel.ErrorMessage;
                    ErrorId = Trace.CorrelationManager.ActivityId.ToString("D", CultureInfo.InvariantCulture);
                    ViewState = ViewStates.ActionError;
                    _logger.LogError(ErrorMessage);
                }
            }
        }
        private void SelectedItemCommandMethod(RequestType requestType_)
        {
            var requestType = SelectedRequest as RequestType;
            if (requestType != null)
            {

                var navParams = new Dictionary<string, object>();
                navParams.Add("product", _codigoProduto);
                navParams.Add("products", _clientProducts);
                navParams.Add("requestTypeId", requestType.IntegrationRequestCode);
                navParams.Add("demandId", requestType.Id);

                //Consulta Lista de Motivos passando o requestType.Id
                GetRequestReasonModel getRequestReasonModel = new GetRequestReasonModel();
                GetRequestReasonRequest reasonRequest = new GetRequestReasonRequest();

                reasonRequest.DemandId = requestType.Id;

                //configura model para executar serviço utilizando o reasonrequest
                getRequestReasonModel.Request = reasonRequest;
                var executionState = getRequestReasonModel.Execute();

                if (executionState == ExecutionStatus.Success || executionState == ExecutionStatus.Warning)
                {
                    var reasonList = new List<GetRequestReasonDTO>();
                    if (getRequestReasonModel.Response != null
                        && getRequestReasonModel.Response.Reasons != null)
                    {
                        reasonList = getRequestReasonModel.Response.Reasons;
                    }

                    //Incluir lista nos parametros de navegacao - ver nome do parametro
                    navParams.Add("ListaMotivos", reasonList);

                    switch (requestType.IntegrationRequestCode)
                    {
                        case 0003:
                            navParams.Add("rates", _nonEnabledProductRates);
                            if (_tipoProduto == Constants.TIPOGRUPOPRODUTO_CREDITO)
                            {
                                Navegate("RateChangeCreditoAVista", "RequestsRegion", "", navParams);
                            }
                            else
                            {
                                Navegate("RateChange", "RequestsRegion", "", navParams);
                            }
                            break;
                        default:
                            break;
                    }
                }
                else if (getRequestReasonModel.Response != null)
                {
                    ViewState = ViewStates.ActionError;
                    ErrorId = getRequestReasonModel.Response.CorrelationId.ToString();
                    ErrorMessage = getRequestReasonModel.Response.ErrorMessage;
                    _logger.LogError(ErrorMessage);
                }
                else
                {
                    ViewState = ViewStates.ActionError;
                    ErrorId = Trace.CorrelationManager.ActivityId.ToString("D", CultureInfo.InvariantCulture);
                    ErrorMessage = "TechnicalError occurred while executing: 'GetRequestReasonRequest'";
                    _logger.LogError(ErrorMessage);
                }
            }
        }