sync
This commit is contained in:
parent
246c726a10
commit
156d145a48
@ -73,7 +73,7 @@ namespace IronIntel.Contractor
|
|||||||
{
|
{
|
||||||
var dr = dt.NewRow();
|
var dr = dt.NewRow();
|
||||||
dr[0] = r.VIN;
|
dr[0] = r.VIN;
|
||||||
dr[1] = r.ShowName;
|
dr[1] = r.DisplayName;
|
||||||
dr[2] = r.Outside;
|
dr[2] = r.Outside;
|
||||||
dr[3] = r.Vendor;
|
dr[3] = r.Vendor;
|
||||||
dr[4] = r.RentalRate;
|
dr[4] = r.RentalRate;
|
||||||
@ -161,7 +161,7 @@ namespace IronIntel.Contractor
|
|||||||
dr[2] = r.LastUpdateDateStr;
|
dr[2] = r.LastUpdateDateStr;
|
||||||
//dr[3] = r.OperateType;
|
//dr[3] = r.OperateType;
|
||||||
dr[3] = r.VIN;
|
dr[3] = r.VIN;
|
||||||
dr[4] = r.ShowName;
|
dr[4] = r.DisplayName;
|
||||||
dr[5] = r.Outside;
|
dr[5] = r.Outside;
|
||||||
dr[6] = r.Vendor;
|
dr[6] = r.Vendor;
|
||||||
dr[7] = r.RentalRate;
|
dr[7] = r.RentalRate;
|
||||||
|
@ -247,7 +247,7 @@ namespace IronIntel.Contractor.Machines
|
|||||||
public string AddedOnStr { get { return AddedOn == DateTime.MinValue ? "" : AddedOn.ToShortDateString(); } }
|
public string AddedOnStr { get { return AddedOn == DateTime.MinValue ? "" : AddedOn.ToShortDateString(); } }
|
||||||
public string AddedBy { get; set; }
|
public string AddedBy { get; set; }
|
||||||
public string AddedByName { get; set; }
|
public string AddedByName { get; set; }
|
||||||
public string ShowName
|
public string DisplayName
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -294,6 +294,8 @@ namespace IronIntel.Contractor.Machines
|
|||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public bool Active { get; }
|
public bool Active { get; }
|
||||||
public long DeviceID { get; set; }
|
public long DeviceID { get; set; }
|
||||||
|
public bool FIInstalltion { get; set; }
|
||||||
|
public string Installer { get; set; }
|
||||||
public string AddDateStr { get { return AddLocalDate == null ? "" : AddLocalDate.Value.ToShortDateString(); } }
|
public string AddDateStr { get { return AddLocalDate == null ? "" : AddLocalDate.Value.ToShortDateString(); } }
|
||||||
public string InvoiceDateStr { get { return InvoiceDate == null ? "" : InvoiceDate.Value.ToShortDateString(); } }
|
public string InvoiceDateStr { get { return InvoiceDate == null ? "" : InvoiceDate.Value.ToShortDateString(); } }
|
||||||
public string ServiceStartDateStr { get { return ServiceStartDate == null ? "" : ServiceStartDate.Value.ToShortDateString(); } }
|
public string ServiceStartDateStr { get { return ServiceStartDate == null ? "" : ServiceStartDate.Value.ToShortDateString(); } }
|
||||||
|
@ -37,7 +37,7 @@ namespace IronIntel.Contractor.Machines
|
|||||||
|
|
||||||
public bool Selected { get; set; }
|
public bool Selected { get; set; }
|
||||||
|
|
||||||
public string ShowName
|
public string DisplayName
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -104,7 +104,7 @@ namespace IronIntel.Contractor.Maintenance
|
|||||||
public bool HasAttachment { get; set; }
|
public bool HasAttachment { get; set; }
|
||||||
|
|
||||||
public string[] AttachmentIDs { get; set; }//用于保存
|
public string[] AttachmentIDs { get; set; }//用于保存
|
||||||
public string ShowName
|
public string DisplayName
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -158,7 +158,7 @@ namespace IronIntel.Contractor.Maintenance
|
|||||||
return StartDate.ToShortDateString();
|
return StartDate.ToShortDateString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string ShowName
|
public string DisplayName
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@ namespace IronIntel.Contractor.MapView
|
|||||||
/// 根据Contractorid获取机器列表
|
/// 根据Contractorid获取机器列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static AssetViewItem[] GetAssets(string sessionid, string companyid, string useriid, string filtertext, int onroad, MachineAlertViewQueryParameter param, bool IncludeNoLocation)
|
public static AssetMapViewPinItem[] GetAssets(string sessionid, string companyid, string useriid, string filtertext, int onroad, MachineAlertViewQueryParameter param, bool IncludeNoLocation)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(companyid))
|
if (string.IsNullOrEmpty(companyid))
|
||||||
companyid = SystemParams.CompanyID;
|
companyid = SystemParams.CompanyID;
|
||||||
@ -39,14 +39,15 @@ namespace IronIntel.Contractor.MapView
|
|||||||
|
|
||||||
var client = FleetServiceClientHelper.CreateClient<MapViewQueryClient>(companyid, sessionid);
|
var client = FleetServiceClientHelper.CreateClient<MapViewQueryClient>(companyid, sessionid);
|
||||||
AssetMapViewPinItem[] assets = client.GetAssets(companyid, useriid, qp);
|
AssetMapViewPinItem[] assets = client.GetAssets(companyid, useriid, qp);
|
||||||
List<AssetViewItem> result = new List<AssetViewItem>();
|
return assets;
|
||||||
foreach (var a in assets)
|
//List<AssetViewItem> result = new List<AssetViewItem>();
|
||||||
{
|
//foreach (var a in assets)
|
||||||
AssetViewItem avi = new AssetViewItem();
|
//{
|
||||||
Helper.CloneProperty(avi, a);
|
// AssetViewItem avi = new AssetViewItem();
|
||||||
result.Add(avi);
|
// Helper.CloneProperty(avi, a);
|
||||||
}
|
// result.Add(avi);
|
||||||
return result.ToArray();
|
//}
|
||||||
|
//return result.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AssetDetailViewItem GetAssetDetailItem(string sessionid, string companyid, long machineid, string datasource = null)
|
public static AssetDetailViewItem GetAssetDetailItem(string sessionid, string companyid, long machineid, string datasource = null)
|
||||||
@ -65,6 +66,7 @@ namespace IronIntel.Contractor.MapView
|
|||||||
mi.GroupNames = asset.GroupNames;
|
mi.GroupNames = asset.GroupNames;
|
||||||
mi.IconUrl = asset.MapViewIconUrl;
|
mi.IconUrl = asset.MapViewIconUrl;
|
||||||
mi.AssetIconUrl = asset.AssetIconUrl;
|
mi.AssetIconUrl = asset.AssetIconUrl;
|
||||||
|
mi.Description = asset.Description;
|
||||||
|
|
||||||
if (asset.CurrentHours != null)
|
if (asset.CurrentHours != null)
|
||||||
{
|
{
|
||||||
@ -226,8 +228,8 @@ namespace IronIntel.Contractor.MapView
|
|||||||
|
|
||||||
var client = FleetServiceClientHelper.CreateClient<AssetQueryClient>(companyid, sessionid);
|
var client = FleetServiceClientHelper.CreateClient<AssetQueryClient>(companyid, sessionid);
|
||||||
AssetBasicInfo asset = client.GetAssetBasicInfoByID(companyid, Convert.ToInt64(machineid));
|
AssetBasicInfo asset = client.GetAssetBasicInfoByID(companyid, Convert.ToInt64(machineid));
|
||||||
AssetViewItem ai = new AssetViewItem();
|
//AssetViewItem ai = new AssetViewItem();
|
||||||
Helper.CloneProperty(ai, asset);
|
//Helper.CloneProperty(ai, asset);
|
||||||
|
|
||||||
double timeOffset = SystemParams.GetHoursOffset();
|
double timeOffset = SystemParams.GetHoursOffset();
|
||||||
startTime = startTime.AddHours(-timeOffset);
|
startTime = startTime.AddHours(-timeOffset);
|
||||||
@ -257,7 +259,7 @@ namespace IronIntel.Contractor.MapView
|
|||||||
ls.Add(li);
|
ls.Add(li);
|
||||||
}
|
}
|
||||||
AssetLocationHistoryViewItem al = new AssetLocationHistoryViewItem();
|
AssetLocationHistoryViewItem al = new AssetLocationHistoryViewItem();
|
||||||
al.Machine = ai;
|
al.Machine = asset;
|
||||||
al.Locations = ls.ToArray();
|
al.Locations = ls.ToArray();
|
||||||
return al;
|
return al;
|
||||||
}
|
}
|
||||||
|
@ -9,39 +9,6 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace IronIntel.Contractor.MapView
|
namespace IronIntel.Contractor.MapView
|
||||||
{
|
{
|
||||||
public class AssetViewItem
|
|
||||||
{
|
|
||||||
public long ID { get; set; }
|
|
||||||
public string VIN { get; set; }
|
|
||||||
public string Name { get; set; }
|
|
||||||
public string Name2 { get; set; }
|
|
||||||
public string Make { get; set; }
|
|
||||||
public string Model { get; set; }
|
|
||||||
public int Priority { get; set; }
|
|
||||||
public string AssetType { get; set; }
|
|
||||||
public double Latitude { get; set; }
|
|
||||||
public double Longitude { get; set; }
|
|
||||||
public string IconUrl { get; set; }
|
|
||||||
public string AlertTips { get; set; }
|
|
||||||
public List<string> AssetGroups { get; set; }
|
|
||||||
public List<long> JobSites { get; set; }
|
|
||||||
public string ShowName
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
//Name取值顺序为Name2,Name,VIN,ID用于前端显示
|
|
||||||
string name = Name2;
|
|
||||||
if (string.IsNullOrWhiteSpace(name))
|
|
||||||
name = Name;
|
|
||||||
if (string.IsNullOrWhiteSpace(name))
|
|
||||||
name = VIN;
|
|
||||||
if (string.IsNullOrWhiteSpace(name))
|
|
||||||
name = ID.ToString();
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
}//由于地图显示及排序的名称
|
|
||||||
|
|
||||||
}
|
|
||||||
public class AssetDetailViewItem
|
public class AssetDetailViewItem
|
||||||
{
|
{
|
||||||
private double _EngineHours;
|
private double _EngineHours;
|
||||||
@ -84,6 +51,7 @@ namespace IronIntel.Contractor.MapView
|
|||||||
public long ID { get; set; }
|
public long ID { get; set; }
|
||||||
public string IconUrl { get; set; }
|
public string IconUrl { get; set; }
|
||||||
public string AssetIconUrl { get; set; }
|
public string AssetIconUrl { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
public LocationViewItem Location { get; set; }
|
public LocationViewItem Location { get; set; }
|
||||||
public string EngineHoursDateText
|
public string EngineHoursDateText
|
||||||
{
|
{
|
||||||
@ -100,7 +68,7 @@ namespace IronIntel.Contractor.MapView
|
|||||||
|
|
||||||
public class AssetLocationHistoryViewItem
|
public class AssetLocationHistoryViewItem
|
||||||
{
|
{
|
||||||
public AssetViewItem Machine { get; set; }
|
public AssetBasicInfo Machine { get; set; }
|
||||||
public LocationViewItem[] Locations { get; set; }
|
public LocationViewItem[] Locations { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ namespace IronIntel.Contractor.MapView
|
|||||||
public int MapAlertLayerPriority { get; set; }
|
public int MapAlertLayerPriority { get; set; }
|
||||||
public Int64 GpsDeviceID { get; set; } //空 -1
|
public Int64 GpsDeviceID { get; set; } //空 -1
|
||||||
public string AssetGroupNames { get; set; }
|
public string AssetGroupNames { get; set; }
|
||||||
public string ShowName
|
public string DisplayName
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -40,7 +40,7 @@ namespace IronIntel.Contractor.OTRConfig
|
|||||||
|
|
||||||
public HarshDrivingEvents HarshDringEvent { get; set; }
|
public HarshDrivingEvents HarshDringEvent { get; set; }
|
||||||
public SpeedingBehaviors SpeedingBehavior { get; set; }
|
public SpeedingBehaviors SpeedingBehavior { get; set; }
|
||||||
public string ShowName
|
public string DisplayName
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
|
|||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
[assembly: AssemblyFileVersion("2.20.526")]
|
[assembly: AssemblyFileVersion("2.20.609")]
|
||||||
|
@ -5,6 +5,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using Foresight.Data;
|
using Foresight.Data;
|
||||||
|
using Foresight.Fleet.Services.User;
|
||||||
|
|
||||||
namespace IronIntel.Contractor.Users
|
namespace IronIntel.Contractor.Users
|
||||||
{
|
{
|
||||||
@ -20,6 +21,245 @@ namespace IronIntel.Contractor.Users
|
|||||||
public string ForeColor { get; set; }
|
public string ForeColor { get; set; }
|
||||||
public bool OpenInNewWindow { get; set; }
|
public bool OpenInNewWindow { get; set; }
|
||||||
public AppModuleType ModuleType { get; set; }
|
public AppModuleType ModuleType { get; set; }
|
||||||
|
public List<NavigateItem> SubItems { get; set; }
|
||||||
|
|
||||||
|
public List<NavigateItem> GetMaintenanceNavigateItems(Tuple<Feature, Permissions>[] pmss)
|
||||||
|
{
|
||||||
|
List<NavigateItem> list = new List<NavigateItem>();
|
||||||
|
|
||||||
|
NavigateItem item = new NavigateItem();
|
||||||
|
item.ID = "nav_alertsmanagement";
|
||||||
|
item.FeatureID = Feature.ALERTS_MANAGEMENT;
|
||||||
|
item.Title = "Alerts Management **New**";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "AlertsManagement.aspx";
|
||||||
|
item.IconPath = "img/alert.png";
|
||||||
|
if (pmss.FirstOrDefault(m => m.Item1.Id == Feature.ALERTS_MANAGEMENT) != null)
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_workorder";
|
||||||
|
item.FeatureID = Feature.WORK_ORDER;
|
||||||
|
item.Title = "Work Order **New**";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "WorkOrderMaintenance.aspx";
|
||||||
|
item.IconPath = "img/workorder.png";
|
||||||
|
if (pmss.FirstOrDefault(m => m.Item1.Id == Feature.WORK_ORDER) != null)
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_preventative";
|
||||||
|
item.FeatureID = Feature.PREVENTATIVE_MAINTENANCE;
|
||||||
|
item.Title = "Absolute Hours Maintenance";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "PreventativeMaintenance.aspx";
|
||||||
|
item.IconPath = "img/preventative.png";
|
||||||
|
if (pmss.FirstOrDefault(m => m.Item1.Id == Feature.PREVENTATIVE_MAINTENANCE) != null)
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_timebased";
|
||||||
|
item.FeatureID = Feature.PREVENTATIVE_MAINTENANCE;
|
||||||
|
item.Title = "Relative Time Maintenance";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "TimeBasedMaintenance.aspx";
|
||||||
|
item.IconPath = "img/timebased.png";
|
||||||
|
if (pmss.FirstOrDefault(m => m.Item1.Id == Feature.PREVENTATIVE_MAINTENANCE) != null)
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_hours";
|
||||||
|
item.FeatureID = Feature.PREVENTATIVE_MAINTENANCE;
|
||||||
|
item.Title = "Relative Hours Maintenance";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "HoursMaintenance.aspx";
|
||||||
|
item.IconPath = "img/hours.png";
|
||||||
|
if (pmss.FirstOrDefault(m => m.Item1.Id == Feature.PREVENTATIVE_MAINTENANCE) != null)
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_absolutedistance";
|
||||||
|
item.FeatureID = Feature.PREVENTATIVE_MAINTENANCE;
|
||||||
|
item.Title = "Absolute Distance Maintenance";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "AbsoluteDistanceMaintenance.aspx";
|
||||||
|
item.IconPath = "img/preventative.png";
|
||||||
|
if (pmss.FirstOrDefault(m => m.Item1.Id == Feature.PREVENTATIVE_MAINTENANCE) != null)
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.FeatureID = Feature.PREVENTATIVE_MAINTENANCE;
|
||||||
|
item.ID = "nav_relativedistance";
|
||||||
|
item.Title = "Relative Distance Maintenance";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "RelativeDistanceMaintenance.aspx";
|
||||||
|
item.IconPath = "img/hours.png";
|
||||||
|
if (pmss.FirstOrDefault(m => m.Item1.Id == Feature.PREVENTATIVE_MAINTENANCE) != null)
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_record";
|
||||||
|
item.FeatureID = Feature.PREVENTATIVE_MAINTENANCE;
|
||||||
|
item.Title = "Maintenance Record **Legacy**";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "MaintanceRecordsManagement.aspx";
|
||||||
|
item.IconPath = "img/record.png";
|
||||||
|
if (pmss.FirstOrDefault(m => m.Item1.Id == Feature.PREVENTATIVE_MAINTENANCE) != null)
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_fuelrecord";
|
||||||
|
item.FeatureID = Feature.FUEL_RECORDS;
|
||||||
|
item.Title = "Fuel Records";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "FuelRecordManagement.aspx";
|
||||||
|
item.IconPath = "img/fuelrecord.png";
|
||||||
|
if (pmss.FirstOrDefault(m => m.Item1.Id == Feature.FUEL_RECORDS) != null)
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<NavigateItem> GetSecurityNavigateItems(Tuple<Feature, Permissions>[] pmss, UserInfo user)
|
||||||
|
{
|
||||||
|
if (pmss.FirstOrDefault(m => m.Item1.Id == Feature.USERS) == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
List<NavigateItem> list = new List<NavigateItem>();
|
||||||
|
NavigateItem item = new NavigateItem();
|
||||||
|
item.ID = "nav_users";
|
||||||
|
item.FeatureID = Feature.USERS;
|
||||||
|
item.Title = "Users";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "UserManage.aspx";
|
||||||
|
item.IconPath = "img/users.png";
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_user_group";
|
||||||
|
item.Title = "User Group";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "UserGroup.aspx";
|
||||||
|
item.IconPath = "img/usergroup.png";
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_dts";
|
||||||
|
item.Title = "DataTable Permission";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "../fic/fic/Management/DataTablePermission.aspx";
|
||||||
|
//item.IconPath = "img/permission.png";
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_filters";
|
||||||
|
item.Title = "Dashboard Filters";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "../fic/fic/Management/FiltersManagement.aspx";
|
||||||
|
item.IconPath = "img/filters.png";
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
if (IronIntel.Contractor.SystemParams.IsDealer)
|
||||||
|
{
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_usertocontractor";
|
||||||
|
item.Title = "User To Contractor";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "UserToContractorPage.aspx";
|
||||||
|
item.IconPath = "img/contractor.png";
|
||||||
|
list.Add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_curfew";
|
||||||
|
item.FeatureID = Feature.CURFEW_CONFIG;
|
||||||
|
item.Title = "Curfew Configuration";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "CurfewManage.aspx";
|
||||||
|
item.IconPath = "img/curfew.png";
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
if (user.UserType == UserTypes.SupperAdmin)
|
||||||
|
{
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_curfewmt";
|
||||||
|
item.FeatureID = Feature.CURFEW_CONFIG;
|
||||||
|
item.Title = "Curfew Movement Tolerance";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "CurfewMovementTolerance.aspx";
|
||||||
|
item.IconPath = "img/curfewmovementtolerance.png";
|
||||||
|
list.Add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<NavigateItem> GetAssetsNavigateItems(Tuple<Feature, Permissions>[] pmss, UserInfo user)
|
||||||
|
{
|
||||||
|
List<NavigateItem> list = new List<NavigateItem>();
|
||||||
|
|
||||||
|
NavigateItem item = new NavigateItem();
|
||||||
|
item.ID = "nav_managmachines";
|
||||||
|
item.FeatureID = Feature.MANAGE_ASSETS;
|
||||||
|
item.Title = "Manage Assets";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "ManageMachines.aspx";
|
||||||
|
item.IconPath = "img/machines.png";
|
||||||
|
if (pmss.FirstOrDefault(m => m.Item1.Id == Feature.MANAGE_ASSETS) != null)
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_managrentals";
|
||||||
|
item.FeatureID = Feature.MANAGE_ASSETS;
|
||||||
|
item.Title = "Manage Rentals";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "ManageRentals.aspx";
|
||||||
|
item.IconPath = "img/rental.png";
|
||||||
|
if (pmss.FirstOrDefault(m => m.Item1.Id == Feature.MANAGE_ASSETS) != null)
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_machinegroups";
|
||||||
|
item.FeatureID = Feature.ASSET_GROUP;
|
||||||
|
item.Title = "Asset Groups";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "MachineGroups.aspx";
|
||||||
|
item.IconPath = "img/machinegroups.png";
|
||||||
|
if (!IronIntel.Contractor.SystemParams.IsDealer && user.UserType >= UserTypes.Admin)
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_managegpsdevices";
|
||||||
|
item.FeatureID = Feature.MANAGE_DEVICES;
|
||||||
|
item.Title = "Manage Devices";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "ManageGPSDevices.aspx";
|
||||||
|
item.IconPath = "img/devices.png";
|
||||||
|
if (pmss.FirstOrDefault(m => m.Item1.Id == Feature.MANAGE_DEVICES) != null)
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
item = new NavigateItem();
|
||||||
|
item.ID = "nav_managmodels";
|
||||||
|
item.Title = "Manage Models";
|
||||||
|
item.Url = Url + "#" + item.ID;
|
||||||
|
item.PageUrl = "ManageModels.aspx";
|
||||||
|
item.IconPath = "img/model.png";
|
||||||
|
if (user.UserType >= UserTypes.Admin)
|
||||||
|
list.Add(item);
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class NavigateItem
|
||||||
|
{
|
||||||
|
public string ID { get; set; }
|
||||||
|
public int FeatureID { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string Url { get; set; }
|
||||||
|
public string PageUrl { get; set; }
|
||||||
|
public string IconPath { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SecurityNavigateItem
|
public class SecurityNavigateItem
|
||||||
|
@ -29,6 +29,8 @@ namespace IronIntel.Contractor.Users
|
|||||||
|
|
||||||
var pc = FleetServiceClientHelper.CreateClient<PermissionProvider>();
|
var pc = FleetServiceClientHelper.CreateClient<PermissionProvider>();
|
||||||
FeatureModule[] ms = pc.GetAvailableModules(SystemParams.CompanyID, user.IID);
|
FeatureModule[] ms = pc.GetAvailableModules(SystemParams.CompanyID, user.IID);
|
||||||
|
Tuple<Feature, Permissions>[] pmss = pc.GetUserPermissions(SystemParams.CompanyID, user.IID);
|
||||||
|
|
||||||
List<FeatureModule> moudles = new List<FeatureModule>();
|
List<FeatureModule> moudles = new List<FeatureModule>();
|
||||||
moudles.AddRange(ms);
|
moudles.AddRange(ms);
|
||||||
if (ms.FirstOrDefault(m => m.Id == FeatureModule.MODULE_MAPVIEW) == null)
|
if (ms.FirstOrDefault(m => m.Id == FeatureModule.MODULE_MAPVIEW) == null)
|
||||||
@ -47,6 +49,13 @@ namespace IronIntel.Contractor.Users
|
|||||||
ami.Visible = true;
|
ami.Visible = true;
|
||||||
ami.ModuleType = AppModuleType.System;
|
ami.ModuleType = AppModuleType.System;
|
||||||
|
|
||||||
|
if (m.Id == FeatureModule.MODULE_ASSETHEALTH)
|
||||||
|
ami.SubItems = ami.GetMaintenanceNavigateItems(pmss);
|
||||||
|
else if (m.Id == FeatureModule.MODULE_SECURITY)
|
||||||
|
ami.SubItems = ami.GetSecurityNavigateItems(pmss, user);
|
||||||
|
else if (m.Id == FeatureModule.MODULE_MANAGEASSETS)
|
||||||
|
ami.SubItems = ami.GetAssetsNavigateItems(pmss, user);
|
||||||
|
|
||||||
list.Add(ami);
|
list.Add(ami);
|
||||||
}
|
}
|
||||||
AppModuleInfo[] wsps = GetFICWorkspace(user);
|
AppModuleInfo[] wsps = GetFICWorkspace(user);
|
||||||
@ -89,7 +98,7 @@ namespace IronIntel.Contractor.Users
|
|||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static AppModuleInfo[] GetFICWorkspace(UserInfo user)
|
public static AppModuleInfo[] GetFICWorkspace(UserInfo user)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(SystemParams.FICDbConnectionString))
|
if (string.IsNullOrWhiteSpace(SystemParams.FICDbConnectionString))
|
||||||
{
|
{
|
||||||
|
@ -35,6 +35,7 @@ namespace IronIntel.Contractor.Users
|
|||||||
public bool AllowLoginIntoPC { get; set; }
|
public bool AllowLoginIntoPC { get; set; }
|
||||||
public bool AllowLoginIntoInspectMobile { get; set; }
|
public bool AllowLoginIntoInspectMobile { get; set; }
|
||||||
public bool AllowLoginIntoFleetMobile { get; set; }
|
public bool AllowLoginIntoFleetMobile { get; set; }
|
||||||
|
public string LandingPage { get; set; }
|
||||||
public string GroupNamesStr { get { return (GroupNames == null || GroupNames.Length == 0) ? "" : string.Join(",", GroupNames); } }
|
public string GroupNamesStr { get { return (GroupNames == null || GroupNames.Length == 0) ? "" : string.Join(",", GroupNames); } }
|
||||||
|
|
||||||
public string ContactTypeName
|
public string ContactTypeName
|
||||||
|
@ -29,6 +29,7 @@ namespace IronIntel.Contractor.Users
|
|||||||
private const string _ExcludeNoLocation = "ExcludeNoLocation";
|
private const string _ExcludeNoLocation = "ExcludeNoLocation";
|
||||||
|
|
||||||
private const string _MapViewSearches = "MapViewSearches";
|
private const string _MapViewSearches = "MapViewSearches";
|
||||||
|
private const string _LandingPage = "LandingPage";
|
||||||
|
|
||||||
public static UserParamInfo GetUserParams(string sessionid, string useriid)
|
public static UserParamInfo GetUserParams(string sessionid, string useriid)
|
||||||
{
|
{
|
||||||
@ -82,6 +83,9 @@ namespace IronIntel.Contractor.Users
|
|||||||
case _ExcludeNoLocation:
|
case _ExcludeNoLocation:
|
||||||
userParams.ExcludeNoLocation = int.Parse(value) == 1;
|
userParams.ExcludeNoLocation = int.Parse(value) == 1;
|
||||||
break;
|
break;
|
||||||
|
case _LandingPage:
|
||||||
|
userParams.LandingPage = value;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
userParams.MapViewSearches = GetMapViewSearches(sessionid, useriid);
|
userParams.MapViewSearches = GetMapViewSearches(sessionid, useriid);
|
||||||
@ -168,6 +172,11 @@ namespace IronIntel.Contractor.Users
|
|||||||
|
|
||||||
if (userParams.ExcludeNoLocation)
|
if (userParams.ExcludeNoLocation)
|
||||||
db.ExecSQL(SQL, useriid, _ExcludeNoLocation, userParams.ExcludeNoLocation ? 1 : 0);
|
db.ExecSQL(SQL, useriid, _ExcludeNoLocation, userParams.ExcludeNoLocation ? 1 : 0);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(userParams.LandingPage))
|
||||||
|
db.ExecSQL(SQL, useriid, _LandingPage, userParams.LandingPage);
|
||||||
|
else
|
||||||
|
db.ExecSQL(SQL_Delete, useriid, _LandingPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetStringParameter(string useriid, string paramname)
|
public static string GetStringParameter(string useriid, string paramname)
|
||||||
@ -311,6 +320,7 @@ namespace IronIntel.Contractor.Users
|
|||||||
public bool ExcludeNoLocation { get; set; } = true;
|
public bool ExcludeNoLocation { get; set; } = true;
|
||||||
|
|
||||||
public MapViewSearchItem[] MapViewSearches { get; set; }
|
public MapViewSearchItem[] MapViewSearches { get; set; }
|
||||||
|
public string LandingPage { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MapViewSearcheHelper
|
public class MapViewSearcheHelper
|
||||||
|
@ -97,6 +97,8 @@ namespace IronIntel.Contractor.Site
|
|||||||
|
|
||||||
protected virtual bool CanDirectAccess { get { return false; } }
|
protected virtual bool CanDirectAccess { get { return false; } }
|
||||||
|
|
||||||
|
protected virtual int FeatureID { get { return -1; } }
|
||||||
|
|
||||||
protected bool CheckUserToken()
|
protected bool CheckUserToken()
|
||||||
{
|
{
|
||||||
var session = GetCurrentLoginSession();
|
var session = GetCurrentLoginSession();
|
||||||
@ -150,7 +152,7 @@ namespace IronIntel.Contractor.Site
|
|||||||
RedirectToLoginPage();
|
RedirectToLoginPage();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!AllowCurrentLoginSessionEnter())
|
if (!AllowCurrentLoginSessionEnter() || !CheckRight(FeatureID))
|
||||||
{
|
{
|
||||||
if (ThrowIfNotAllowed)
|
if (ThrowIfNotAllowed)
|
||||||
{
|
{
|
||||||
@ -158,11 +160,7 @@ namespace IronIntel.Contractor.Site
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string entry = GetUserDefaultEntryPageUrl(session.User);
|
RedirectToEntryPage();
|
||||||
if (string.IsNullOrEmpty(entry))
|
|
||||||
Response.Redirect(entry, true);
|
|
||||||
else
|
|
||||||
Response.Redirect(LoginPageUrl, true);
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -176,6 +174,25 @@ namespace IronIntel.Contractor.Site
|
|||||||
Response.Redirect(LoginPageUrl + "?f=" + url);
|
Response.Redirect(LoginPageUrl + "?f=" + url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void RedirectToEntryPage()
|
||||||
|
{
|
||||||
|
var session = GetCurrentLoginSession();
|
||||||
|
string entry = GetUserDefaultEntryPageUrl(session.User);
|
||||||
|
//if (!user.IsForesightUser)
|
||||||
|
//{
|
||||||
|
// string pageurl = UserParams.GetStringParameter(user.UID, "LandingPage");//如果LandingPage没有权限会现成跳转死循环
|
||||||
|
// if (!string.IsNullOrEmpty(pageurl))
|
||||||
|
// {
|
||||||
|
// string url = entry.Substring(0, entry.LastIndexOf('/') + 1);
|
||||||
|
// entry = url + pageurl;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
if (!string.IsNullOrEmpty(entry))
|
||||||
|
Response.Redirect(entry, true);
|
||||||
|
else
|
||||||
|
Response.Redirect(LoginPageUrl, true);
|
||||||
|
}
|
||||||
|
|
||||||
protected void DoLogout()
|
protected void DoLogout()
|
||||||
{
|
{
|
||||||
string sid = null;
|
string sid = null;
|
||||||
@ -268,6 +285,12 @@ namespace IronIntel.Contractor.Site
|
|||||||
var session = GetCurrentLoginSession();
|
var session = GetCurrentLoginSession();
|
||||||
return FleetServiceClientHelper.CreateClient<T>(companyid, session == null ? "" : session.SessionID);
|
return FleetServiceClientHelper.CreateClient<T>(companyid, session == null ? "" : session.SessionID);
|
||||||
}
|
}
|
||||||
|
protected bool CheckRight(int featureid)
|
||||||
|
{
|
||||||
|
if (featureid < 0)
|
||||||
|
return true;
|
||||||
|
return CheckRight(SystemParams.CompanyID, featureid);
|
||||||
|
}
|
||||||
|
|
||||||
protected bool CheckRight(string custid, int featureid)
|
protected bool CheckRight(string custid, int featureid)
|
||||||
{
|
{
|
||||||
|
@ -67,8 +67,6 @@ namespace IronIntel.Contractor.Site
|
|||||||
return ui != null && ui.UserType >= UserTypes.Admin;
|
return ui != null && ui.UserType >= UserTypes.Admin;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool ThrowIfNotAllowed { get { return true; } }
|
|
||||||
|
|
||||||
private void GetCredentials()
|
private void GetCredentials()
|
||||||
{
|
{
|
||||||
string type = Request.Form["ClientData"];
|
string type = Request.Form["ClientData"];
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using Foresight.Fleet.Services.JobSite;
|
using Foresight.Fleet.Services.JobSite;
|
||||||
|
using Foresight.Fleet.Services.MapView;
|
||||||
using Foresight.Standard;
|
using Foresight.Standard;
|
||||||
using IronIntel.Contractor.FilterQ;
|
using IronIntel.Contractor.FilterQ;
|
||||||
using IronIntel.Contractor.JobSites;
|
using IronIntel.Contractor.JobSites;
|
||||||
@ -248,15 +249,15 @@ namespace IronIntel.Contractor.Site
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private AssetViewItem[] GetMachines()
|
private AssetMapViewPinItem[] GetMachines()
|
||||||
{
|
{
|
||||||
var session = GetCurrentLoginSession();
|
var session = GetCurrentLoginSession();
|
||||||
if (session != null)
|
if (session != null)
|
||||||
{
|
{
|
||||||
AssetViewItem[] items = AssetMapViewManagement.GetAssets(session.SessionID, SystemParams.CompanyID, session.User.UID, "", -1, null, false);
|
AssetMapViewPinItem[] items = AssetMapViewManagement.GetAssets(session.SessionID, SystemParams.CompanyID, session.User.UID, "", -1, null, false);
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
return new AssetViewItem[0];
|
return new AssetMapViewPinItem[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
private object[] GetSelectedAssets()
|
private object[] GetSelectedAssets()
|
||||||
@ -398,7 +399,7 @@ namespace IronIntel.Contractor.Site
|
|||||||
MachineViewItem[] items = JobSitesManagement.GetBindingMachines(session.SessionID, session.User.UID);
|
MachineViewItem[] items = JobSitesManagement.GetBindingMachines(session.SessionID, session.User.UID);
|
||||||
if (items != null)
|
if (items != null)
|
||||||
{
|
{
|
||||||
items = items.OrderBy((m) => m.ShowName).ToArray();
|
items = items.OrderBy((m) => m.DisplayName).ToArray();
|
||||||
}
|
}
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
@ -523,7 +523,7 @@ namespace IronIntel.Contractor.Site
|
|||||||
if (machines == null)
|
if (machines == null)
|
||||||
return new MachineItem[0];
|
return new MachineItem[0];
|
||||||
|
|
||||||
return machines.Where(m => m.Hide == false).OrderBy(m => m.ShowName).ToArray();
|
return machines.Where(m => m.Hide == false).OrderBy(m => m.DisplayName).ToArray();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return new MachineItem[0];
|
return new MachineItem[0];
|
||||||
@ -554,7 +554,7 @@ namespace IronIntel.Contractor.Site
|
|||||||
if (machines == null)
|
if (machines == null)
|
||||||
return new MachineItem[0];
|
return new MachineItem[0];
|
||||||
|
|
||||||
return machines.Where(m => m.Hide == false).OrderBy(m => m.ShowName).ToArray();
|
return machines.Where(m => m.Hide == false).OrderBy(m => m.DisplayName).ToArray();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return new MachineItem[0];
|
return new MachineItem[0];
|
||||||
@ -630,6 +630,9 @@ namespace IronIntel.Contractor.Site
|
|||||||
contractorid = SystemParams.CompanyID;
|
contractorid = SystemParams.CompanyID;
|
||||||
string searchtxt = HttpUtility.HtmlDecode(ps[1]);
|
string searchtxt = HttpUtility.HtmlDecode(ps[1]);
|
||||||
FFSDevice.DeviceInfo[] devs = CreateClient<DeviceProvider>(contractorid).GetDevices(contractorid, searchtxt);
|
FFSDevice.DeviceInfo[] devs = CreateClient<DeviceProvider>(contractorid).GetDevices(contractorid, searchtxt);
|
||||||
|
|
||||||
|
if (devs == null)
|
||||||
|
return new DeviceItem[0];
|
||||||
List<DeviceItem> list = new List<DeviceItem>();
|
List<DeviceItem> list = new List<DeviceItem>();
|
||||||
foreach (var dev in devs)
|
foreach (var dev in devs)
|
||||||
{
|
{
|
||||||
|
@ -104,7 +104,8 @@ namespace IronIntel.Contractor.Site.Maintenance
|
|||||||
{
|
{
|
||||||
FuelRecordInfo fi = new FuelRecordInfo();
|
FuelRecordInfo fi = new FuelRecordInfo();
|
||||||
Helper.CloneProperty(fi, fuel);
|
Helper.CloneProperty(fi, fuel);
|
||||||
fi.TransactionDate = fi.TransactionDate.ToLocalTime();
|
//fi.TransactionDate = fi.TransactionDate.ToLocalTime();
|
||||||
|
fi.TransactionDate = SystemParams.CustomerDetail.UtcToCustomerTime(fi.TransactionDate);
|
||||||
list.Add(fi);
|
list.Add(fi);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,7 +139,8 @@ namespace IronIntel.Contractor.Site.Maintenance
|
|||||||
{
|
{
|
||||||
FuelRecordAuditItem fi = new FuelRecordAuditItem();
|
FuelRecordAuditItem fi = new FuelRecordAuditItem();
|
||||||
Helper.CloneProperty(fi, fuel);
|
Helper.CloneProperty(fi, fuel);
|
||||||
fi.TransactionDate = fi.TransactionDate.ToLocalTime();
|
//fi.TransactionDate = fi.TransactionDate.ToLocalTime();
|
||||||
|
fi.TransactionDate=SystemParams.CustomerDetail.UtcToCustomerTime(fi.TransactionDate);
|
||||||
fi.AddedOn = fi.AddedOn.ToLocalTime();
|
fi.AddedOn = fi.AddedOn.ToLocalTime();
|
||||||
fi.LastUpdatedOn = fi.LastUpdatedOn.ToLocalTime();
|
fi.LastUpdatedOn = fi.LastUpdatedOn.ToLocalTime();
|
||||||
list.Add(fi);
|
list.Add(fi);
|
||||||
@ -169,7 +171,8 @@ namespace IronIntel.Contractor.Site.Maintenance
|
|||||||
|
|
||||||
FuelRecord record = new FuelRecord();
|
FuelRecord record = new FuelRecord();
|
||||||
Helper.CloneProperty(record, fuelrecord);
|
Helper.CloneProperty(record, fuelrecord);
|
||||||
record.TransactionDate = record.TransactionDate.ToUniversalTime();
|
//record.TransactionDate = record.TransactionDate.ToUniversalTime();
|
||||||
|
record.TransactionDate = SystemParams.CustomerDetail.CustomerTimeToUtc(record.TransactionDate);
|
||||||
long fuleid = record.FuelID;
|
long fuleid = record.FuelID;
|
||||||
if (record.FuelID == -1)
|
if (record.FuelID == -1)
|
||||||
{
|
{
|
||||||
|
@ -369,7 +369,7 @@ namespace IronIntel.Contractor.Site.Maintenance
|
|||||||
{
|
{
|
||||||
machines = new MachineItem[0];
|
machines = new MachineItem[0];
|
||||||
}
|
}
|
||||||
return machines.Where(m => m.Hide == false).OrderBy(m => m.ShowName).ToArray();
|
return machines.Where(m => m.Hide == false).OrderBy(m => m.DisplayName).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,9 +116,9 @@ namespace IronIntel.Contractor.Site.MapView
|
|||||||
string serverVersion = SystemParams.GetVersion();
|
string serverVersion = SystemParams.GetVersion();
|
||||||
return serverVersion;
|
return serverVersion;
|
||||||
}
|
}
|
||||||
private AssetViewItem[] GetAssets()
|
private object GetAssets()
|
||||||
{
|
{
|
||||||
AssetViewItem[] assets = null;
|
AssetMapViewPinItem[] assets = null;
|
||||||
if (LoginSession != null)
|
if (LoginSession != null)
|
||||||
{
|
{
|
||||||
var clientdata = Context.Request.Params["ClientData"];
|
var clientdata = Context.Request.Params["ClientData"];
|
||||||
@ -136,9 +136,23 @@ namespace IronIntel.Contractor.Site.MapView
|
|||||||
SystemParams.WriteRefreshLog(LoginSession.User.UID, UserHostAddress, "Assets", p.IsAutoRefresh ? "Auto" : "Manual");
|
SystemParams.WriteRefreshLog(LoginSession.User.UID, UserHostAddress, "Assets", p.IsAutoRefresh ? "Auto" : "Manual");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
assets = new AssetViewItem[0];
|
assets = new AssetMapViewPinItem[0];
|
||||||
|
|
||||||
return assets;
|
List<string> results = new List<string>();
|
||||||
|
foreach (var r in assets)
|
||||||
|
{
|
||||||
|
//if (sb.Length > 0)
|
||||||
|
//{
|
||||||
|
// sb.Append((char)171);
|
||||||
|
//}
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
r.ToFormatedString(sb, (char)170);
|
||||||
|
results.Add(sb.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return results.ToArray();
|
||||||
|
|
||||||
|
//return assets;
|
||||||
}
|
}
|
||||||
|
|
||||||
private AssetGroupViewItem[] GetAssetGroups()
|
private AssetGroupViewItem[] GetAssetGroups()
|
||||||
|
@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
|
|||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
[assembly: AssemblyFileVersion("2.20.526")]
|
[assembly: AssemblyFileVersion("2.20.609")]
|
||||||
|
@ -96,6 +96,9 @@ namespace IronIntel.Contractor.Site
|
|||||||
case "GETFEATURESDEFINEDONUSER":
|
case "GETFEATURESDEFINEDONUSER":
|
||||||
result = GetFeaturesDefinedOnUser();
|
result = GetFeaturesDefinedOnUser();
|
||||||
break;
|
break;
|
||||||
|
case "GETFEATURESMOUDULES":
|
||||||
|
result = GetFeaturesMoudules();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -197,6 +200,7 @@ namespace IronIntel.Contractor.Site
|
|||||||
{
|
{
|
||||||
var uid = Request.Form["ClientData"];
|
var uid = Request.Form["ClientData"];
|
||||||
var user = UserManagement.GetUserByIID(uid);
|
var user = UserManagement.GetUserByIID(uid);
|
||||||
|
user.LandingPage = UserParams.GetStringParameter(uid, "LandingPage");
|
||||||
if (user == null)
|
if (user == null)
|
||||||
user = new UserInfo();
|
user = new UserInfo();
|
||||||
return user;
|
return user;
|
||||||
@ -227,6 +231,25 @@ namespace IronIntel.Contractor.Site
|
|||||||
}
|
}
|
||||||
item.Active = true;
|
item.Active = true;
|
||||||
item.IID = UserManagement.AddUser(item, item.TransPass, session.User.UID, session.SessionID, Request.UserHostName);
|
item.IID = UserManagement.AddUser(item, item.TransPass, session.User.UID, session.SessionID, Request.UserHostName);
|
||||||
|
if (item.UserType == UserTypes.Common)
|
||||||
|
{
|
||||||
|
List<KeyValuePair<int, Foresight.Fleet.Services.User.Permissions[]>> features = new List<KeyValuePair<int, Foresight.Fleet.Services.User.Permissions[]>>();
|
||||||
|
KeyValuePair<int, Foresight.Fleet.Services.User.Permissions[]> feature = new KeyValuePair<int, Foresight.Fleet.Services.User.Permissions[]>(100, new Foresight.Fleet.Services.User.Permissions[] { Foresight.Fleet.Services.User.Permissions.FullControl });
|
||||||
|
features.Add(feature);
|
||||||
|
feature = new KeyValuePair<int, Foresight.Fleet.Services.User.Permissions[]>(200, new Foresight.Fleet.Services.User.Permissions[] { Foresight.Fleet.Services.User.Permissions.FullControl });
|
||||||
|
features.Add(feature);
|
||||||
|
feature = new KeyValuePair<int, Foresight.Fleet.Services.User.Permissions[]>(210, new Foresight.Fleet.Services.User.Permissions[] { Foresight.Fleet.Services.User.Permissions.FullControl });
|
||||||
|
features.Add(feature);
|
||||||
|
feature = new KeyValuePair<int, Foresight.Fleet.Services.User.Permissions[]>(220, new Foresight.Fleet.Services.User.Permissions[] { Foresight.Fleet.Services.User.Permissions.FullControl });
|
||||||
|
features.Add(feature);
|
||||||
|
feature = new KeyValuePair<int, Foresight.Fleet.Services.User.Permissions[]>(230, new Foresight.Fleet.Services.User.Permissions[] { Foresight.Fleet.Services.User.Permissions.FullControl });
|
||||||
|
features.Add(feature);
|
||||||
|
feature = new KeyValuePair<int, Foresight.Fleet.Services.User.Permissions[]>(600, new Foresight.Fleet.Services.User.Permissions[] { Foresight.Fleet.Services.User.Permissions.FullControl });
|
||||||
|
features.Add(feature);
|
||||||
|
|
||||||
|
var client = CreateClient<Foresight.Fleet.Services.User.PermissionProvider>();
|
||||||
|
client.UpdateFeaturesForUser(SystemParams.CompanyID, item.IID, features.ToArray(), session.User.UID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -250,6 +273,7 @@ namespace IronIntel.Contractor.Site
|
|||||||
FI.FIC.Models.Schedule.ScheduleManager.SaveEmailScheduleItems(item.IID, user.Schedule, "en-us");
|
FI.FIC.Models.Schedule.ScheduleManager.SaveEmailScheduleItems(item.IID, user.Schedule, "en-us");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
UserParams.SetStringParameter(item.IID, "LandingPage", item.LandingPage);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -565,12 +589,33 @@ namespace IronIntel.Contractor.Site
|
|||||||
var p = JsonConvert.DeserializeObject<StringKeyValue>(s);
|
var p = JsonConvert.DeserializeObject<StringKeyValue>(s);
|
||||||
|
|
||||||
var machines = MaintenanceManagement.GetMaintenanceMachines(session.SessionID, int.Parse(p.Key), p.Value, session.User.UID)
|
var machines = MaintenanceManagement.GetMaintenanceMachines(session.SessionID, int.Parse(p.Key), p.Value, session.User.UID)
|
||||||
.OrderBy(m => m.ShowName)
|
.OrderBy(m => m.DisplayName)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
return machines;
|
return machines;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private object GetFeaturesMoudules()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var session = GetCurrentLoginSession();
|
||||||
|
if (session != null)
|
||||||
|
{
|
||||||
|
List<AppModuleInfo> list = Acl.GetAvailableAppModuleInfos(session.User.UID).ToList();
|
||||||
|
return list.ToArray();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return new AppModuleInfo[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return ex.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private class UserMachineGroupInfoItem
|
private class UserMachineGroupInfoItem
|
||||||
{
|
{
|
||||||
public MachineGroup[] AllMachineGroups { get; set; }
|
public MachineGroup[] AllMachineGroups { get; set; }
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
2
Site
2
Site
@ -1 +1 @@
|
|||||||
Subproject commit 140d1ffce0271bde011b93bce204fff9f8bf90b4
|
Subproject commit 52722c5b42974a2019a4602a5975c4d1c2a10392
|
Loading…
x
Reference in New Issue
Block a user