这是我的模型:
public class Pitchermodels
{
InsideEdEntities ieEntity = new InsideEdEntities();
PitcherProfileEntities ppEntity = new PitcherProfileEntities();
Pitcher5model p5Mod = new Pitcher5model();
Pitcher6model p6Mod = new Pitcher6model();
public Pitcher5model pitcher5(long? _pid)
{
if (p5Mod.exist(_pid) == true)
{
p5Mod.playerinfo = ieEntity.ppsproc_playerinfo(_pid).FirstOrDefault();
p5Mod.ListP5T1 = ppEntity.ppsproc_newP5_T1(_pid).ToList();
p5Mod.ListP5T2 = ppEntity.ppsproc_P5_T2(_pid).ToList();
return p5Mod;
}
else
{
return null;
}
}
public Pitcher6model pitcher6(long? _pid)
{
if (p6Mod.exist(_pid) == true)
{
p6Mod.playerinfo = ieEntity.ppsproc_playerinfo(_pid).FirstOrDefault();
p6Mod.ListP6T1 = ppEntity.ppsproc_P6(_pid).ToList();
return p6Mod;
}
else
{
return null;
}
}
}
这是我的控制器:
public ActionResult AllPitchers(long? _pid)
{
Pitchermodels pMods = new Pitchermodels();
return View(pMods);
}
这是我的观点:
@model MVCdodgersplayerinfohub.Models.Pitchermodels
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>All Pitcher Reports</title>
<link href="~/LA.ico" rel="shortcut icon" type="image/x-icon" />
</head>
<body>
<div>
@Html.Partial("Pitcher5",Model.pitcher5(Convert.ToInt32(Request.QueryString["_pid"])))
</div>
<p style="page-break-before:always;"></p>
<div>
@Html.Partial("Pitcher6",Model.pitcher6(Convert.ToInt32(Request.QueryString["_pid"])))
</div>
</body>
</html>
不太好的一件事是加载可能需要 2 分钟以上,并且在用户看来它甚至可能无法加载(鼠标只是旋转)。是否可以放入进度条?我认为大多数用户都喜欢进度条,因为至少他们知道它正在工作,以及需要多长时间。