public ActionResult AppVersion() { ViewBag.app_version = new SelectList(db.GEN_APP_VERSION .OrderByDescending(a => a.IS_CURR_VER), "APP_VERSION", "APP_VERSION"); AppVersionSearchModel model = null; ObjectResult <SEC_USERS_APP_VERSION_GET_Result> app_versions = null; if (Request.QueryString.HasKeys()) { model = new AppVersionSearchModel(); if (!string.IsNullOrEmpty(Request.QueryString["app_version"])) { model.app_version = Request.QueryString["app_version"]; ViewBag.app_version = new SelectList(db.GEN_APP_VERSION .OrderByDescending(a => a.IS_CURR_VER), "APP_VERSION", "APP_VERSION", model.app_version); } if (!string.IsNullOrEmpty(Request.QueryString["is_current"])) { model.is_current = bool.Parse(Request.QueryString["is_current"]); } decimal is_current = !model.is_current ? 1 : 0; app_versions = db.SEC_USERS_APP_VERSION_GET(model.app_version, is_current); } ViewBag.Search_Model = model; return(View(app_versions)); }