initial version with inspection edition

This commit is contained in:
2020-04-29 14:08:00 +08:00
commit 6a5629fc3b
186 changed files with 33984 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
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<string, string>[] GetContractors(string useriid)
{
Users.UserInfo userinfo = UserManagement.GetUserByIID(useriid);
CustomerInfo[] cps = SystemParams.GetContractors();
List<KeyValuePair<string, string>> ls = new List<KeyValuePair<string, string>>();
if (userinfo.UserType == UserTypes.Admin || userinfo.UserType == UserTypes.SupperAdmin)
{
foreach (CustomerInfo cp in cps)
{
ls.Add(new KeyValuePair<string, string>(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<string, string>(cp.ID, cp.Name));
break;
}
}
}
}
return ls.ToArray();
}
}
}