public static List <Staff> GetStaffByIdStr(string ids) { List <Staff> staffs = new List <Staff>(); if (!string.IsNullOrEmpty(ids)) { StaffLogic sl = StaffLogic.GetInstance(); string[] Ids = ids.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); foreach (string id in Ids) { int ID; if (int.TryParse(id, out ID)) { Staff staff = sl.GetStaff(ID); if (staff != null) { staffs.Add(staff); } } } } return(staffs); }