public ActionResult CreateAlayan(int?date) { if (!WebSettings.IsApplicationOpen()) { TempData["errorMsg"] = "Sorry we are not yet accepting applications"; return(RedirectToAction("DisplayAnnouncements", "WebContent")); } int dateId = WebSettings.getCurrentDate(); List <int> datIdAlayan = ent.Alayans.Where(m => m.DSetIdApplied == dateId).Select(m => m.ADatId).ToList(); TempData["availableDates"] = ent.AlayanDates.Where(m => !datIdAlayan.Contains(m.ADatId) /* m.alayantype ==regular*/).ToList(); //available dates that are not taken yet TempData["alayanTypes"] = ent.AlayanTypes.ToList(); //ids 1 - 3 are tuklos, sabog and pangako, 4, 5, and 6 are names that should not be seen by the user if (date == null) { return(View()); } else { return(View(new CreateAlayanViewModel() { AlayDate = (int)date })); } return(View()); }
public ActionResult CreateApplication() { if (!WebSettings.IsApplicationOpen()) { TempData["errorMsg"] = "Sorry we are not yet accepting applications"; return(RedirectToAction("DisplayAnnouncements", "WebContent")); } TempData["application_type"] = ent.ApplicationTypes.ToList(); return(View()); }