private void bindDepartListToDropDownList() { List <string> departs = new List <string>(); string exception = ""; if (CommonCtrl.GetDeparts(ref departs, ref exception)) { foreach (string depart in departs) { DropDownList_Depart.Items.Add(depart, depart); } } }
/// <summary> /// 绑定部门到下拉列表 /// </summary> private void bindDepartsToDropDownList() { string exception = ""; List <string> departs = new List <string>(); if (CommonCtrl.GetDeparts(ref departs, ref exception)) { foreach (string item in departs) { DropDownList1.Items.Add(item, item); } } //else //{ // Alert.ShowInTop("获取部门信息失败!\n原因:" + exception, MessageBoxIcon.Error); //} }