Пример #1
0
        public IActionResult Flights(FlightsViewModel model)
        {
            model.VoyagerUserID = ckLoginUser_Id;
            PositionSetRes objPositionSetRes = positionMapping.SetFlightsDetals(model, ckUserEmailId, token);

            if (model.SaveType == "partial")
            {
                var objPosition = objPositionSetRes.mPosition.FirstOrDefault();
                return(Json(new { objPositionSetRes.ResponseStatus.Status, PositionId = objPosition.PositionId, RoomDetailsInfo = objPosition.RoomDetailsInfo }));
            }
            else
            {
                if (objPositionSetRes.ResponseStatus.Status.ToLower() == "success")
                {
                    TempData["success"] = "Flight " + objPositionSetRes.ResponseStatus.ErrorMessage;
                }
                else
                {
                    TempData["error"] = objPositionSetRes.ResponseStatus.ErrorMessage;
                }

                model.SaveType = "full";
                if (model.FlightDetails.Count == 1)
                {
                    return(RedirectToAction("Flights", new { QRFId = model.QRFID, model.SaveType, PositionId = model.FlightDetails[0].PositionId, IsClone = model.MenuViewModel.IsClone }));
                }
                else
                {
                    return(RedirectToAction("Flights", new { QRFId = model.QRFID, model.SaveType, IsClone = model.MenuViewModel.IsClone }));
                }
            }
        }