<div class="current-location">
    <ul>
        <li class="left"><i class="glyphicon glyphicon-home"></i><a href="javascript:void(0)" onclick="location.href=location.href">运行Sql语句</a></li>
        <li class="right"><a href="javascript:void(0)" onclick="LoadData()" title="刷新"><span class="glyphicon glyphicon-refresh"></span></a></li>
    </ul>
</div>
<div class="main">
    <form class="form-horizontal form ui-validForm" action="@Url.Action()" method="post">
        <div class="control-group">
            <label class="control-label">变量1值</label>
            <div class="controls form-inline form-group-sm">
                <textarea name="var1" type="text" maxlength="50" value="/e/backup/" class="form-control" id="var1" style="height:80px;"></textarea>
                <span class="help-block"></span>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">变量2值</label>
            <div class="controls form-inline form-group-sm">
                <textarea name="var2" type="text" maxlength="50" value="/e/backup/" class="form-control" id="var2" style="height:80px;"></textarea>
                <span class="help-block"></span>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label">变量3值</label>
            <div class="controls form-inline">
                <textarea name="var3" type="text" maxlength="50" value="/e/backup/" class="form-control" id="var3" style="height:80px;"></textarea>
                <span class="help-block"></span>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">运行sql语句</label>
            <div class="controls form-inline">
                <textarea name="sqltext" type="text"  value="/e/backup/" class="form-control"  data-validate="dataType:'*',nullMsg:'请填写sql语句!'" id="sqltext" style="height:250px;"></textarea>
                <span class="help-block">每行一句Sql，变量1，变量2，变量3的值可用{var1},{var2},{var3}代替</span>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label"></label>
            <div class="controls form-inline">
                <button type="button" class="btn btn-primary btn-sm ui-pagePost" data-custom-params="url:'@Url.Action("RunSql")',callBack:'SuccessBack',failCallBack:'failCallBackFun',successMsg:'执行成功！'">运行</button>
                <span class="help-block" id="description"></span>

            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    function SuccessBack()
    {
        $("#description").html("执行成功！");
    }
    function failCallBackFun(data)
    {
        $("#description").html(data.Description);
    }
</script>