Пример #1
0
 public ActionResult Index(string SqlScript)
 {
     if (IsLogined())
     {
         if (SqlScript.Trim() != string.Empty)
         {
             try
             {
                 Admins.ExecSql(SqlScript);
             }
             catch (Exception ex)
             {
                 ModelState.AddModelError("", string.Format("执行失败,{0}", ex.Message));
             }
         }
         else
         {
             ModelState.AddModelError("", "请输入内容!");
         }
     }
     else
     {
         ModelState.AddModelError("", "请登录!");
     }
     return(View());
 }