【发布时间】:2019-10-08 06:52:25
【问题描述】:
我有如下表格许可证
table Licence
[ LID(pk) int,
ProID(FK) int,
SK string,
QTY int,
LIS int,
LIU int
]
我有“chklin”作为检索 LIU 的存储过程。
procedure [dbo].[chklin]
(@LID int)
as
begin
select LIU from license where LID=@LID
end
现在在我的许可证控制器中,我有以下操作
public ActionResult Chk(int L)
{
SLMEntitiesDB dbContext = new SLMEntitiesDB();
dbContext.chklin(L) // this should check the LIU value, how to pass it
to below IF statement
if (A == 0)
{
ViewBag.Message = "No more license available";
}
else
{
return RedirectToAction("create", "users");
}
【问题讨论】:
-
欢迎您,您能澄清一下您到底在问什么吗?谢谢
-
你可以使用函数来检查
-
dbContext.chklin(L) // 这里返回一个int值,如何传递给if语句?
标签: c# sql asp.net-mvc stored-procedures