Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        public async Task <GuesstimateSetRes> UpdateGuesstimateVersion(GuesstimateVersionSetReq guesstimateSetReq, string ticket)
        {
            GuesstimateSetRes guesstimateSetRes = new GuesstimateSetRes();

            guesstimateSetRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceGuesstimate:UpdateGuesstimateVersion"), guesstimateSetReq, typeof(GuesstimateSetRes), ticket);

            return(guesstimateSetRes);
        }
Exemplo n.º 3
0
        public async Task <GuesstimateSetRes> SetGuesstimateChangeRule(GuesstimateChangeRuleSetReq guesstimateCRSetReq, string ticket)
        {
            GuesstimateSetRes guesstimateSetRes = new GuesstimateSetRes();

            guesstimateSetRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceGuesstimate:SetGuesstimateChangeRule"), guesstimateCRSetReq, typeof(GuesstimateSetRes), ticket);

            return(guesstimateSetRes);
        }
Exemplo n.º 4
0
        public JsonResult UpdateGuesstimateVersion(string QRFID, string GuesstimateId)
        {
            GuesstimateSetRes        response = new GuesstimateSetRes();
            GuesstimateVersionSetReq request  = new GuesstimateVersionSetReq();

            request.QRFID         = QRFID;
            request.GuesstimateId = GuesstimateId;
            request.EditUser      = ckUserEmailId;
            response = coProviders.UpdateGuesstimateVersion(request, token).Result;

            if (response != null)
            {
                return(Json(response.ResponseStatus));
            }
            return(Json("failure"));
        }
Exemplo n.º 5
0
        public JsonResult SetGuesstimateChangeRule(string GuesstimateId, string ChangeRule, double?ChangeRulePercent)
        {
            GuesstimateSetRes           response = new GuesstimateSetRes();
            GuesstimateChangeRuleSetReq request  = new GuesstimateChangeRuleSetReq();

            request.GuesstimateId     = GuesstimateId;
            request.ChangeRule        = ChangeRule;
            request.ChangeRulePercent = ChangeRulePercent;
            request.EditUser          = ckUserEmailId;
            response = coProviders.SetGuesstimateChangeRule(request, token).Result;

            if (response != null)
            {
                return(Json(response.ResponseStatus));
            }
            return(Json("failure"));
        }
Exemplo n.º 6
0
        public async Task <GuesstimateSetRes> SetGuesstimateChangeRule([FromBody] GuesstimateChangeRuleSetReq request)
        {
            var response = new GuesstimateSetRes();

            try
            {
                if (!string.IsNullOrEmpty(request.GuesstimateId))
                {
                    response = await _guesstimateRepository.SetGuesstimateChangeRule(request);
                }
                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);
        }
Exemplo n.º 7
0
        public JsonResult SetGuesstimatePrices(GuesstimateViewModel model)
        {
            model.Guesstimate.CreateUser = ckUserEmailId;
            model.Guesstimate.EditUser   = ckUserEmailId;
            model.Guesstimate.VersionId  = model.NextVersionId;

            GuesstimateSetRes response = new GuesstimateSetRes();
            GuesstimateSetReq request  = new GuesstimateSetReq();

            request.Guesstimate   = model.Guesstimate;
            request.IsNewVersion  = model.IsNewVersion;
            request.DepartureId   = Convert.ToInt64(model.DepartureDate);
            request.PaxSlabId     = Convert.ToInt64(model.PaxSlab);
            request.Qrfid         = model.Guesstimate.QRFID;
            request.VoyagerUserId = ckLoginUser_Id;
            response = coProviders.SetGuesstimate(request, token).Result;

            if (response != null)
            {
                return(Json(response.ResponseStatus));
            }
            return(Json("failure"));
        }