Files
Groupware/SubProject/FCOMMON/Auth.cs
chikyun.kim 6b374123fd 181210 chi NR구매등록시 이미지 표시 및 추가 기능
NR구매목록에서 권한 없는 사람이 더블클릭으로 편집할 수 있는 버그 수정
2018-12-10 12:29:18 +09:00

47 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
namespace FCOMMON
{
public static partial class DBM
{
public enum eAutoType
{
purchase,
holyday
}
public static int getAuth(eAutoType type, string uid)
{
return getAuth(type.ToString(), uid);
}
public static int getAuth(eAutoType type)
{
return getAuth(type.ToString(), info.Login.no);
}
private static int getAuth(string field,string uid)
{
var cn = getCn();
cn.Open();
int retval = 0;
string sql = string.Format("select isnull([{0}],0) from Auth where [user]= '{1}'",field,uid);
var cmd = new SqlCommand(sql, cn);
var rdr = cmd.ExecuteScalar();
if(rdr != null )
retval = int.Parse(rdr.ToString());
cn.Close();
cn.Dispose();
return retval;
}
}
}