Exemple #1
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);
        }
        public async Task <GoAheadSetRes> SetGoAhead(GoAheadSetReq goAheadSetReq, string ticket)
        {
            GoAheadSetRes goAheadSetRes = new GoAheadSetRes();

            goAheadSetRes = await serviceProxy.PostData(_configuration.GetValue <string>("Handover:SetGoAhead"), goAheadSetReq, typeof(GoAheadSetRes), ticket);

            return(goAheadSetRes);
        }
Exemple #3
0
        public GoAheadSetRes SetGoAhead(AttachToMasterViewModel model, string userEmail, string token, string voyagerUserId)
        {
            GoAheadSetRes objGoAheadSetRes = new GoAheadSetRes();
            GoAheadSetReq objGoAheadSetReq = new GoAheadSetReq {
                mGoAhead = model.GoAheadGetRes.mGoAhead, DepatureId = model.DepartureId
            };

            try
            {
                objGoAheadSetReq.mGoAhead.OperationUserID   = model.UserID;
                objGoAheadSetReq.mGoAhead.OperationUserName = model.UserName;
                objGoAheadSetReq.mGoAhead.QRFID             = model.MenuViewModel.QRFID;

                if (!string.IsNullOrEmpty(model.ConfirmationDT))
                {
                    var dt = model.ConfirmationDT.Split("/");
                    if (dt?.Count() >= 3)
                    {
                        DateTime fromDT = new DateTime(Convert.ToInt32(dt[2]), Convert.ToInt32(dt[1]), Convert.ToInt32(dt[0]));
                        objGoAheadSetReq.mGoAhead.ConfirmationDeadline = fromDT;
                    }
                    else
                    {
                        objGoAheadSetReq.mGoAhead.ConfirmationDeadline = null;
                    }
                }
                objGoAheadSetReq.mGoAhead.QRFPriceId = model.QRFPriceId;
                objGoAheadSetReq.mGoAhead.VersionId  = model.VersionId;
                objGoAheadSetReq.UserEmail           = userEmail;
                objGoAheadSetReq.VoyagerUserId       = voyagerUserId;

                objGoAheadSetRes = handoverProviders.SetGoAhead(objGoAheadSetReq, token).Result;
                objGoAheadSetRes = objGoAheadSetRes != null ? objGoAheadSetRes : new GoAheadSetRes();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            return(objGoAheadSetRes);
        }