Files
Unimarc/unimarc/unimarc/DB_Utils.cs

35 lines
1007 B
C#

using AR;
namespace UniMarc
{
public static class DB_Utils
{
public static bool ExistISBN(string value)
{
if (value.isEmpty())
{
UTIL.MsgE("중복검사할 ISBN값이 입력되지 않았습니다");
return false;
}
// ISBN 중복체크
string checkSql = string.Format("SELECT COUNT(*) FROM Marc WHERE isbn = '{0}' AND compidx = '{1}'", value, PUB.user.CompanyIdx);
var ret = Helper_DB.ExcuteScalar(checkSql);
if (ret.value == null)
{
UTIL.MsgE($"Database error [ExistISBN]\n{ret.errorMessage}");
return false;
}
if (int.TryParse(ret.value.ToString(), out int cnt) == false)
return false;
else
{
if (cnt > 0)
{
return true;
}
return false;
}
}
}
}