public ActionResult Travel(string starsid = "") { ViewBag.homeid = "home"; FlightInfoModel model = new FlightInfoModel(); FlightInfoBL _flightBl = new FlightInfoBL(); RegistrationBL _regBl = new RegistrationBL(); if (Session["StarsIdProfile"] != null) { var _id = Session["StarsIdProfile"].ToString(); if (_regBl.CheckRegistrationBy(_id) == true) { decimal?eventid = _flightBl.GetEventIdByStarsId(_id); model = _flightBl.GetFlightInfoByStarsId(_id, eventid); // model.EVENT_ID = _flightBl.GetEventIdByStarsId(_id); // eventid; // Run a Query against Registration table to get only event id by Stars ID if (model == null) { return(View(model)); } return(View(model)); } else { return(RedirectToAction("Index", "Registration")); } } else { return(RedirectToAction("Welcome", "LBC")); } }
public ActionResult Travel(FlightInfoModel model) { FlightInfoBL _flightBl = new FlightInfoBL(); if (_flightBl.CheckFlightInfoBy(model.STARS_ID, model.EVENT_ID)) { model.UPDATE_DATE = DateTime.Now; model.UPDATED_BY = System.Web.HttpContext.Current.Session["w_user"].ToString(); _flightBl.UpdateFlightInfo(model); } else { model.CREATED_DATE = DateTime.Now; model.CREATED_BY = System.Web.HttpContext.Current.Session["w_user"].ToString(); _flightBl.SaveFlightInfo(model); } return(RedirectToAction("Welcome", "LBC")); }