public ActionResult Show(List <int> optionResult) { var Departments = GetSession.QueryOver <Department>().Take(optionResult.Count).List(); for (int i = 0; i < optionResult.Count; i++) { GetSession.CreateSQLQuery( string.Format("Update {0}Department set Option{1}Count=Option{1}Count+1 where Id={2}", MvcApplication.Config("table.Prefix"), optionResult[i], Departments[i].Id ) ).ExecuteUpdate(); Session["optionResult" + DateTime.Now.Date.ToShortDateString()] = "done"; } return(RedirectToAction("DepartmentResult")); }