using System; using System.Collections.Generic; using System.Linq; using System.Text; using IronIntel.Services; using IronIntel.Contractor.Users; using IronIntel.Services.MapView; using IronIntel.Services.Customers; namespace IronIntel.Contractor.MapView { public static class MapViewer { public static KeyValuePair[] GetContractors(string useriid) { Users.UserInfo userinfo = UserManagement.GetUserByIID(useriid); CustomerInfo[] cps = SystemParams.GetContractors(); List> ls = new List>(); if (userinfo.UserType == UserTypes.Admin || userinfo.UserType == UserTypes.SupperAdmin) { foreach (CustomerInfo cp in cps) { ls.Add(new KeyValuePair(cp.ID, cp.Name)); } } else { string[] str = Acl.GetUserAvailableContractors(useriid); foreach (CustomerInfo cp in cps) { foreach (string s in str) { if (string.Compare(cp.ID, s, true) == 0) { ls.Add(new KeyValuePair(cp.ID, cp.Name)); break; } } } } return ls.ToArray(); } } }