标签:style blog io color ar 使用 sp strong 数据
/// <summary>
/// 判断是否存在添加的流程名
/// 没有则,添加个人配置的流程名
/// </summary>
/// <param name="uid">用户id</param>
/// <param name="processName">流程名</param>
public int AddPrivateProcessName(int uid,string processName)
{
string strSql = @"
if EXISTS(SELECT * FROM dbo.WfProcessConfigPrivate WHERE empId=@empId AND PROCESSNAME=@PROCESSNAME)
BEGIN
SELECT 0
END
ELSE BEGIN
INSERT INTO dbo.WfProcessConfigPrivate( empId, PROCESSNAME ) OUTPUT INSERTED.ID VALUES ( @empId,@PROCESSNAME)
END
";
SqlParameter[] sqlPara=new SqlParameter[]{
new SqlParameter("@empId",SqlDbType.Int),
new SqlParameter("@PROCESSNAME",SqlDbType.NVarChar)
};
sqlPara[0].Value=uid;
sqlPara[1].Value=processName;
return Convert.ToInt32(DbHelper.ExecuteScalar(strSql, sqlPara));
}
标签:style blog io color ar 使用 sp strong 数据
原文地址:http://www.cnblogs.com/dhui69/p/4081238.html