Пример #1
0
        public async Task <ActionResult> DeleteTripAsync(EditTripViewModel model, string submit)
        {
            if (submit == "discard")
            {
                // remove session var
                Session["ImmediateTrip"] = null;

                // update the status to DELETED
                var _blError = await TripManager.DeleteUserTripAsync(model.ActiveTrip.DlTripView);

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

                return(RedirectToAction("Index", "Home"));
            }

            return(RedirectToAction("ViewTrip", new { @tripId = model.ActiveTrip.DlTripView.Id }));
        }