챔피언
This commit is contained in:
@@ -1341,7 +1341,42 @@ namespace FCOMMON
|
||||
cn.Dispose();
|
||||
return retval != 0;
|
||||
}
|
||||
public static List<String> getGroupListWithoutGcode(string GroupColumn, string table, string where = "", Boolean desc = false, Boolean useColumncover = true)
|
||||
{
|
||||
List<string> retval = new List<string>();
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
var sql = "select {0} " +
|
||||
" from {1} " +
|
||||
" where isnull({0},'') != '' ";
|
||||
|
||||
if (table.ToUpper() == "USERS")
|
||||
sql = "select {0} " +
|
||||
" from {1} " +
|
||||
" where isnull({0},'') != '' ";
|
||||
|
||||
|
||||
if (where != "") sql += " and " + where;
|
||||
|
||||
sql += " group by {0} " +
|
||||
" order by {0} ";
|
||||
if (desc) sql += " desc";
|
||||
|
||||
if (useColumncover)
|
||||
sql = string.Format(sql, "[" + GroupColumn + "]", table);
|
||||
else
|
||||
sql = string.Format(sql, GroupColumn, table);
|
||||
var cmd = new SqlCommand(sql, cn);
|
||||
var rdr = cmd.ExecuteReader();
|
||||
while (rdr.Read())
|
||||
{
|
||||
retval.Add(rdr[0].ToString());
|
||||
}
|
||||
cmd.Dispose();
|
||||
cn.Close();
|
||||
cn.Dispose();
|
||||
return retval;
|
||||
}
|
||||
public static List<String> getGroupList(string GroupColumn, string table, string where = "", Boolean desc = false, Boolean useColumncover = true)
|
||||
{
|
||||
List<string> retval = new List<string>();
|
||||
|
||||
Reference in New Issue
Block a user