Ejemplo n.º 1
0
        public GoAheadNewDeptSetRes SetGoAheadNewDepartures(GoAheadNewDeptSetReq objGoAheadNewDeptSetReq, string token)
        {
            GoAheadNewDeptSetRes model = new GoAheadNewDeptSetRes();

            model = handoverProviders.SetGoAheadNewDepartures(objGoAheadNewDeptSetReq, token).Result;
            return(model);
        }
Ejemplo n.º 2
0
        public async Task <GoAheadNewDeptSetRes> SetGoAheadNewDepartures(GoAheadNewDeptSetReq goAheadNewDeptSetReq, string ticket)
        {
            GoAheadNewDeptSetRes objGoAheadNewDeptSetRes = new GoAheadNewDeptSetRes();

            objGoAheadNewDeptSetRes = await serviceProxy.PostData(_configuration.GetValue <string>("Handover:SetGoAheadNewDepartures"), goAheadNewDeptSetReq, typeof(GoAheadNewDeptSetRes), ticket);

            return(objGoAheadNewDeptSetRes);
        }
Ejemplo n.º 3
0
        public IActionResult SetGoAheadNewDepartures(GoAheadNewDeptGetRes objGoAheadNewDeptGetRes)
        {
            GoAheadNewDeptSetRes model = new GoAheadNewDeptSetRes();
            string msg    = "";
            string status = "";

            model = handoverMapping.SetGoAheadNewDepartures(new GoAheadNewDeptSetReq()
            {
                ExisitingDepatures = new ExisitingDepatures()
                {
                    DepatureId = Convert.ToInt64(objGoAheadNewDeptGetRes.ExistDepartureId)
                },
                GoAheadId    = objGoAheadNewDeptGetRes.GoAheadId,
                QRFID        = objGoAheadNewDeptGetRes.QRFID,
                NewDepatures = objGoAheadNewDeptGetRes.NewDepatures,
                UserEmail    = ckUserEmailId
            }, token);

            if (!string.IsNullOrEmpty(model?.ResponseStatus?.Status))
            {
                status = model.ResponseStatus.Status;
                msg    = model.ResponseStatus.ErrorMessage;
                if (status.ToLower() == "error")
                {
                    TempData["error"] = msg;
                }
                else
                {
                    TempData["success"] = msg;
                }
            }
            else
            {
                status            = "Error";
                msg               = "New Departure dates not added.";
                TempData["error"] = msg;
            }

            return(Json(new
            {
                message = msg,
                msgstatus = status
            }));
        }
Ejemplo n.º 4
0
        public async Task <GoAheadNewDeptSetRes> SetGoAheadNewDepartures([FromBody] GoAheadNewDeptSetReq request)
        {
            var response = new GoAheadNewDeptSetRes();

            try
            {
                if (!string.IsNullOrEmpty(request?.QRFID))
                {
                    response = await _handoverRepository.SetGoAheadNewDepartures(request);
                }
                else
                {
                    response.ResponseStatus.Status       = "Failure";
                    response.ResponseStatus.ErrorMessage = "QRF ID can not be Null/Zero.";
                }
            }
            catch (Exception ex)
            {
                response.ResponseStatus.Status       = "Failure";
                response.ResponseStatus.ErrorMessage = "An Error Occurs :- " + ex.Message;
            }

            return(response);
        }