IList<KeyValue> _Cn = m_Crb.GetInfo_Status();
ddlStatus.DataSource = _Cn;
ddlStatus.DataTextField = "Key";
ddlStatus.DataValueField = "Value";
ddlStatus.DataBind();
ddlStatus.Items.Insert(0, new ListItem("全部", "0"));
string[] m_Status = { "", "正常", "迟到", "早退", "请假" };
public IList<KeyValue> GetInfo_Status()
{
KeyValue _Key = new KeyValue();
IList<KeyValue> _List = new List<KeyValue>();
try
{
for (int i = 1; i < m_Status.Length; i++)
{
_Key = new KeyValue();
_Key.Key =m_Status[i].ToString();
_Key.Value = i.ToString();
_List.Add(_Key);
}
return _List;
}
catch (Exception ex)
{
m_ExceptionToXml.InsertToXML("127.0.0.1", "", System.DateTime.Now, ex.ToString());
return null;
}
}