コード例 #1
0
        public async Task <ActionResult> RemoveDestinationFromTripAsync(RemoveDestinationFromTripViewModel model, string submit)
        {
            if (submit == "remove")
            {
                var _blError = await TripManager.DeleteUserTripstepAsync(model.DlTripStep.Id);

                if (_blError.ErrorCode != 0)
                {
                    throw new ApplicationException(_blError.ErrorMessage);
                }
            }

            return(RedirectToAction("EditTrip", new { @tripId = model.DlTripStep.TripId }));
        }
コード例 #2
0
        public ActionResult RemoveDestinationFromTrip(int tripStepId, int tripId)
        {
            var        _model  = new RemoveDestinationFromTripViewModel();
            BlViewTrip tripObj = null;
            var        blError = TripManager.GetTripstepDetailsById(tripStepId, out tripObj);

            if (blError.ErrorCode != 0)
            {
                throw new ApplicationException(blError.ErrorMessage);
            }

            _model.DlTripStep               = tripObj.DlTripStepsView[0];
            _model.DlTrip                   = tripObj.DlTripView;
            _model.DlBookingsView           = tripObj.DlBookingsView;
            _model.DlTransportsBookingsView = tripObj.DlTransportsBookingsView;

            return(View(_model));
        }