아웃룩 오픈 긴능 추가
This commit is contained in:
@@ -46,7 +46,66 @@ namespace FCOMMON
|
||||
cn.Dispose();
|
||||
return retval;
|
||||
}
|
||||
public static Dictionary<string,string> getUserList(int baseLevel = 1)
|
||||
{
|
||||
string where = "isnull(level,0) >= " + baseLevel.ToString();
|
||||
return getTwoColumnList("Users", "id", "name", where, "name");
|
||||
|
||||
}
|
||||
public static System.Data.DataTable getUserTable(int baseLevel = 1)
|
||||
{
|
||||
var list = getUserList(baseLevel);
|
||||
return MakeDataTable(list);
|
||||
}
|
||||
private static System.Data.DataTable MakeDataTable(Dictionary<string,string> list)
|
||||
{
|
||||
System.Data.DataTable dt = new System.Data.DataTable();
|
||||
dt.Columns.Add("Key");
|
||||
dt.Columns.Add("Value");
|
||||
dt.Columns.Add("KeyValue");
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
dt.Rows.Add(new string[] { item.Key, item.Value, string.Format("[{0}] {1}", item.Key, item.Value) });
|
||||
}
|
||||
dt.AcceptChanges();
|
||||
return dt;
|
||||
}
|
||||
|
||||
|
||||
public static Dictionary<string,string> getCodeList(string GroupCode="99")
|
||||
{
|
||||
string where = "Grp = '{0}'";
|
||||
where = string.Format(where, GroupCode);
|
||||
return getTwoColumnList("Common", "code", "memo", where, "code");
|
||||
}
|
||||
public static System.Data.DataTable getCodeTable(string GroupCode = "99")
|
||||
{
|
||||
var list = getCodeList(GroupCode);
|
||||
return MakeDataTable(list);
|
||||
}
|
||||
private static Dictionary<string, string> getTwoColumnList(string table,string col1,string col2,string where="",string order="")
|
||||
{
|
||||
Dictionary<string, string> retval = new Dictionary<string, string>();
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
var sql = "select isnull({1},''),isnull({2},'')" +
|
||||
" from {0}";
|
||||
if (where != "") sql += " where " + where;
|
||||
if (order != "") sql += " order by " + order;
|
||||
sql = string.Format(sql,table, col1, col2);
|
||||
var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
|
||||
var rdr = cmd.ExecuteReader();
|
||||
while (rdr.Read())
|
||||
{
|
||||
retval.Add(rdr[0].ToString(), rdr[1].ToString());
|
||||
}
|
||||
cmd.Dispose();
|
||||
cn.Close();
|
||||
cn.Dispose();
|
||||
return retval;
|
||||
|
||||
}
|
||||
public static List<String> getGroupList(string GroupColumn, string table, string where = "",Boolean desc=false)
|
||||
{
|
||||
List<string> retval = new List<string>();
|
||||
|
||||
Reference in New Issue
Block a user