Ejemplo n.º 1
0
        public async Task <CommonResponse> SaveCommercials([FromBody] CommercialsSetReq request)
        {
            var response = new CommonResponse();

            try
            {
                if (!string.IsNullOrEmpty(request.QRFPriceId))
                {
                    response = await _commercialsRepository.SaveCommercials(request);
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "QRFId can not be blank.";
                }
                if (!string.IsNullOrEmpty(response.ResponseStatus.Status) && response.ResponseStatus.Status == "Success" && !string.IsNullOrEmpty(request.QrfId) && !string.IsNullOrEmpty(request.VoyagerUserId))
                {
                    Task.Run(() => _mSDynamicsRepository.CreateUpdateOpportnity(request.QrfId, request.VoyagerUserId).Result);
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An Error Occurs :- " + ex.Message;
            }
            return(response);
        }
Ejemplo n.º 2
0
        public async Task <PositionSetRes> SetPosition([FromBody] PositionSetReq request)
        {
            var response = new PositionSetRes();

            try
            {
                //response.QRFId = request.QRFID;
                if (request != null)
                {
                    response = await _positionRepository.SetPosition(request);

                    if (!string.IsNullOrEmpty(response.ResponseStatus.Status) && response.ResponseStatus.Status == "Success" && !string.IsNullOrEmpty(request.QRFID) && !string.IsNullOrEmpty(request.VoyagerUserID))
                    {
                        Task.Run(() => _mSDynamicsRepository.CreateUpdateOpportnity(request.QRFID, request.VoyagerUserID).Result);
                    }
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "Details can not be blank.";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An Error Occurs :- " + ex.Message;
            }

            return(response);
        }
Ejemplo n.º 3
0
        public async Task <GuesstimateSetRes> SetGuesstimate([FromBody] GuesstimateSetReq request)
        {
            var response = new GuesstimateSetRes();

            try
            {
                if (request.Guesstimate != null)
                {
                    response = await _guesstimateRepository.SetGuesstimate(request);
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "Details can not be blank.";
                }
                if (!string.IsNullOrEmpty(response.ResponseStatus.Status) && response.ResponseStatus.Status == "Success" && !string.IsNullOrEmpty(request.Qrfid) && !string.IsNullOrEmpty(request.VoyagerUserId))
                {
                    Task.Run(() => _mSDynamicsRepository.CreateUpdateOpportnity(request.Qrfid, request.VoyagerUserId).Result);
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An Error Occurs :- " + ex.Message;
            }
            return(response);
        }
Ejemplo n.º 4
0
        public async Task <GoAheadSetRes> SetGoAhead([FromBody] GoAheadSetReq request)
        {
            var response = new GoAheadSetRes();

            try
            {
                if (request != null)
                {
                    response = await _handoverRepository.SetGoAhead(request);

                    if (response != null && response.ResponseStatus != null && !string.IsNullOrEmpty(response.ResponseStatus.Status) && response.ResponseStatus.Status.ToLower() == "Success".ToLower() && !string.IsNullOrEmpty(request.mGoAhead.QRFID) && !string.IsNullOrEmpty(request.VoyagerUserId))
                    {
                        Task.Run(() => _mSDynamicsRepository.CreateUpdateOpportnity(request.mGoAhead.QRFID, request.VoyagerUserId).Result);
                    }
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "Details can not be blank.";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An Error Occurs :- " + ex.Message;
            }
            return(response);
        }
Ejemplo n.º 5
0
        public async Task <QuoteSetRes> SubmitQuote([FromBody] QuoteSetReq request)
        {
            var response = new QuoteSetRes();

            try
            {
                if (request != null)
                {
                    response = await _qrfSummarRepository.SubmitQuote(request);

                    if (response == null)
                    {
                        response = new QuoteSetRes()
                        {
                            ResponseStatus = new ResponseStatus()
                            {
                                Status = "Error", ErrorMessage = "Error while Submitting Quote"
                            }
                        }
                    }
                    ;
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "Details can not be blank.";
                }
                if (!string.IsNullOrEmpty(response.ResponseStatus.Status) && response.ResponseStatus.Status == "Success" && !string.IsNullOrEmpty(request.QRFID) && !string.IsNullOrEmpty(request.VoyagerUserID))
                {
                    Task.Run(() => _mSDynamicsRepository.CreateUpdateOpportnity(request.QRFID, request.VoyagerUserID).Result);
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An Error Occurs " + ex.Message;
            }
            return(response);
        }