コード例 #1
0
 public ActionResult Index(FormCollection fc)
 {
     if (ModelState.IsValid)
     {
         Stopwatch sw = new Stopwatch();
         sw.Start();
         try
         {
             TryUpdateModel(viewModel);
             Session["ReportsViewModel"] = viewModel;
             viewModel.ClearSelectedServiceLine();
             viewModel.SetSelectedServiceLine(fc["SelectedServiceLine"]);
             Session["ReportsViewModel"] = viewModel;//update the session var to save off the selected service line.
             SystemDataProvider systemDataProvider = Session["SystemDataProvider"] as SystemDataProvider;
             var sqlHelper = new SqlHelper(systemDataProvider);
             sqlHelper.GetServiceLineDataByOrganization(viewModel);
         }
         finally
         {
             sw.Stop();
             LoggerHelper.RecordTiming(System.Reflection.MethodBase.GetCurrentMethod().Name, sw, log);
             var json = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(viewModel.ServiceLineExplorerResultsByFacility);
             log.DebugFormat("JSON = {0}", json);
         }
         return View(viewModel);
     }
     return View();
 }