public static string CheckCancel(string auto_id)
{
string mes = string.Empty;
这里我想添加一个条件 这个条件也是要通过sql查询出来的,如果 IF_check = 1 则执行下面的update
string sql = " update check_hg_gj set IF_CANCEL = 1 where auto_id='" + auto_id + "'";
try
{
ECI.PL.Query.ProcessSql(sql);
}
catch
{
mes = "操作失败!";
return mes;
}
如果 IF_check = 0 则执行
{
mes = "已经锁定不允许update!";
return mes;
}
return mes;
}
{
string mes = string.Empty;
这里我想添加一个条件 这个条件也是要通过sql查询出来的,如果 IF_check = 1 则执行下面的update
string sql = " update check_hg_gj set IF_CANCEL = 1 where auto_id='" + auto_id + "'";
try
{
ECI.PL.Query.ProcessSql(sql);
}
catch
{
mes = "操作失败!";
return mes;
}
如果 IF_check = 0 则执行
{
mes = "已经锁定不允许update!";
return mes;
}
return mes;
}
public static string CheckCancel(string auto_id)
{
string mes = string.Empty;
_check = 从数据库查询出来地;
if( _check == 1)
{
string sql = " update check_hg_gj set IF_CANCEL = 1 where auto_id='" + auto_id + "'";
try
{
ECI.PL.Query.ProcessSql(sql);
}
catch
{
mes = "操作失败!";
}
}
else
{
mes = "已经锁定不允许update!";
}
return mes;
}
{
string mes = string.Empty;
string _check=check();//你写个查询方法,查询_check的值
if(_check==1)
string sql = " update check_hg_gj set IF_CANCEL = 1 where auto_id='" + auto_id + "'";
try
{
ECI.PL.Query.ProcessSql(sql);
}
catch
{
mes = "操作失败!";
return mes;
}
if(_check == 0)
{
mes = "已经锁定不允许update!";
return mes;
}
return mes;
}
//查询方法如下
public string check()
{
string sql="select _check from 表名";
return "查询出来的值";
}
思路就是这样。