
@model MVCOne.Models.Customer

@{
    ViewBag.Title = "About";
}

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
   
   <tr class="form-horizontal">        
         
        <td >
            @Html.LabelFor(model => model.UserName)
            @Html.EditorFor(model => model.UserName)
            @Html.ValidationMessageFor(model => model.UserName)
        </td>
        <td>
            @Html.LabelFor(model => model.DisplayName)
            @Html.EditorFor(model => model.DisplayName)
            @Html.ValidationMessageFor(model => model.DisplayName)
        </td>
       <td>
           <input type="button" onclick="Search();" value="查询" />
       </td>
    </tr>        
}
<div id="viewerContainer" style="height: 700px"></div>
@section scripts{
<script src="~/Scripts/jquery-1.10.2.js"></script>
<script src="~/Scripts/bootstrap-3.0.0.js"></script>
<script src="~/Scripts/knockout-2.3.0.js"></script>
<script src="~/Scripts/GrapeCity.ActiveReports.Viewer.Html.js"></script>
<script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
<script type="text/javascript">    
    function Search() {
          $.post("@Url.Action("Index")", { UserName: $("#UserName").val(), DisplayName: $("#DisplayName").val(), Password: $("#Password").val(), ConfirmPassword: $("#ConfirmPassword").val()},function(data){

                                              if(data.flag){
                                                window.location.href=data.msg;
                                              }
                                              else{
                                                alert(data.msg);
            }
        });      
        var viewer = GrapeCity.ActiveReports.Viewer({
            element: '#viewerContainer',
            report: {
                id: "Reports/SalesDetail.rdlx"
            },
            reportService:
            {
                url: '/WebService1.asmx'
            },
            uiType: 'desktop',
            documentLoaded: function reportLoader() {
                Console.log(viewer.pageCount);
            },
            reportLoaded: function (reportInfo) {
                console.log(reportInfo.paremeters);
            }
        });
    };



</script>
}