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

37 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FPJ0000
{
public static class DatabaseManager
{
private static System.Data.SqlClient.SqlConnection getCn()
{
string cs = Properties.Settings.Default.gwcs;
System.Data.SqlClient.SqlConnection cn = new System.Data.SqlClient.SqlConnection();
cn.ConnectionString = cs;
return cn;
}
public static List<String> getEQGroupLiist(string GroupColumn,string table)
{
List<string> retval = new List<string>();
var cn = getCn();
cn.Open();
var sql = "select {0} from {1} where isnull({0},'') != '' group by {0} order by {0}";
sql = string.Format(sql, "[" + GroupColumn +"]",table);
var cmd = new System.Data.SqlClient.SqlCommand(sql,cn);
var rdr = cmd.ExecuteReader();
while(rdr.Read())
{
retval.Add(rdr[0].ToString());
}
cmd.Dispose();
cn.Close();
cn.Dispose();
return retval;
}
}
}