public ActionResult Downloads() { ObjectResult <DOWNLOAD_USERS_GET_Result> downloads = null; UpDownSearchModel model = null; ViewBag.Search_Division = new SelectList(db.SET_DIVISION, "DIVISION_NO", "DIVISION_NAME"); ViewBag.Search_User = new SelectList(db.SEC_USERS_GET_RPT_ZONAL(decimal.Parse(Session["sess_USER_NO"].ToString()), null, null, null).ToList(), "USER_NO", "USER_FULL_NAME"); if (Request.QueryString.HasKeys()) { model = new UpDownSearchModel(); if (!string.IsNullOrEmpty(Request.QueryString["Search_Division"]) && decimal.Parse(Request.QueryString["Search_Division"]) != 0) { model.Search_Division = decimal.Parse(Request.QueryString["Search_Division"]); } if (!string.IsNullOrEmpty(Request.QueryString["Search_Zilla"]) && decimal.Parse(Request.QueryString["Search_Zilla"]) != 0) { model.Search_Zilla = decimal.Parse(Request.QueryString["Search_Zilla"]); } if (!string.IsNullOrEmpty(Request.QueryString["Search_Thana"]) && decimal.Parse(Request.QueryString["Search_Thana"]) != 0) { model.Search_Thana = decimal.Parse(Request.QueryString["Search_Thana"]); } if (!string.IsNullOrEmpty(Request.QueryString["Search_User"]) && decimal.Parse(Request.QueryString["Search_User"]) != 0) { model.Search_User = decimal.Parse(Request.QueryString["Search_User"]); } if (!string.IsNullOrEmpty(Request.QueryString["Search_From"])) { model.Search_From = DateTime.Parse(Request.QueryString["Search_From"]); } if (!string.IsNullOrEmpty(Request.QueryString["Search_To"])) { model.Search_To = DateTime.Parse(Request.QueryString["Search_To"]); } downloads = db.DOWNLOAD_USERS_GET(model.Search_Division, model.Search_Zilla, model.Search_Thana, model.Search_User, model.Search_From, model.Search_To); } ViewBag.Search_Model = model; return(View(downloads)); }