コード例 #1
0
ファイル: SQLToolController.cs プロジェクト: gulelat/pxhotel
 public ActionResult Index()
 {
     var executor = new SQLExecutor();
     var model = new SQLResult
     {
         ConnectionString = _sqlCommandServices.GetConnectionString(),
         Histories = _sqlCommandServices.GetHistories(),
         ReadOnly = true,
         Tables = executor.GetTableNames()
     };
     return View(model);
 }
コード例 #2
0
ファイル: SQLToolController.cs プロジェクト: gulelat/pxhotel
 public ActionResult Index(SQLRequest request, bool exportToFile = false)
 {
     var executor = new SQLExecutor();
     var result = executor.Execute(request);
     if (exportToFile)
     {
         return new FileContentResult(Encoding.UTF8.GetBytes(result.ToString()), "text/plain")
         {
             FileDownloadName = "QueryResult.txt"
         };
     }
     return View(result);
 }
コード例 #3
0
ファイル: SQLToolController.cs プロジェクト: gulelat/pxhotel
 public JsonResult GenerateUpdateStatement(string tablename)
 {
     var executor = new SQLExecutor();
     return Json(executor.GenerateUpdateCommand(tablename));
 }