sync
This commit is contained in:
@ -121,6 +121,9 @@ namespace IronIntel.Contractor.Site.MapView
|
||||
case "GetNowFormatDate":
|
||||
result = GetNowFormatDate();
|
||||
break;
|
||||
case "GetAssetLocationDataSources":
|
||||
result = GetAssetLocationDataSources();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -340,8 +343,13 @@ namespace IronIntel.Contractor.Site.MapView
|
||||
string datasource = "";
|
||||
if (ps.Length > 5)
|
||||
datasource = ps[5];
|
||||
string subsource = "";
|
||||
if (ps.Length > 6)
|
||||
{
|
||||
subsource = ps[6];
|
||||
}
|
||||
|
||||
item = AssetMapViewManagement.GetMachineLocationHistory(LoginSession.SessionID, ps[0], dtFrom, dtTo, companyid, notShow00loc, datasource);
|
||||
item = AssetMapViewManagement.GetMachineLocationHistory(LoginSession.SessionID, ps[0], dtFrom, dtTo, companyid, notShow00loc, datasource, subsource);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -390,6 +398,25 @@ namespace IronIntel.Contractor.Site.MapView
|
||||
}
|
||||
}
|
||||
|
||||
private DataSourceInfo[] GetAssetLocationDataSources()
|
||||
{
|
||||
if (LoginSession != null)
|
||||
{
|
||||
string p = Context.Request.Params["ClientData"];
|
||||
string[] ps = p.Split(';');
|
||||
string companyid = ps.Length > 1 ? ps[1].Trim() : null;//companyid
|
||||
if (string.IsNullOrEmpty(companyid))
|
||||
companyid = SystemParams.CompanyID;
|
||||
|
||||
var client = FleetServiceClientHelper.CreateClient<AssetLocationQueryClient>(companyid, LoginSession.SessionID);
|
||||
return client.GetAssetLocationDataSources(companyid, long.Parse(ps[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
return Array.Empty<DataSourceInfo>();
|
||||
}
|
||||
}
|
||||
|
||||
private Tuple<string, string> GetLocationPrimaryDataSource()
|
||||
{
|
||||
if (LoginSession != null)
|
||||
@ -515,7 +542,7 @@ namespace IronIntel.Contractor.Site.MapView
|
||||
string data = Context.Request.Params["ClientData"];
|
||||
|
||||
MapViewSearchItem item = JsonConvert.DeserializeObject<MapViewSearchItem>(data);
|
||||
return UserParams.SaveMapViewSearch(LoginSession.SessionID, LoginSession.User.UID, item);
|
||||
return UserParams.SaveMapViewSearch(LoginSession.SessionID, LoginSession.User.UID, item, GetLanguageCookie());
|
||||
}
|
||||
|
||||
return new MapViewSearchItem[0];
|
||||
@ -528,7 +555,7 @@ namespace IronIntel.Contractor.Site.MapView
|
||||
string p = Context.Request.Params["ClientData"];
|
||||
p = HttpUtility.HtmlDecode(p);
|
||||
|
||||
return UserParams.DeleteMapViewSearch(LoginSession.SessionID, LoginSession.User.UID, p);
|
||||
return UserParams.DeleteMapViewSearch(LoginSession.SessionID, LoginSession.User.UID, p, GetLanguageCookie());
|
||||
}
|
||||
return new MapViewSearchItem[0];
|
||||
}
|
||||
@ -596,7 +623,7 @@ namespace IronIntel.Contractor.Site.MapView
|
||||
UserInfo[] users;
|
||||
if (LoginSession != null)
|
||||
{
|
||||
users = UserManagement.GetUsers().Where(u => u.Active).ToArray();
|
||||
users = UserManagement.GetUsers(string.Empty, string.Empty, GetLanguageCookie()).Where(u => u.Active).ToArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -615,7 +642,8 @@ namespace IronIntel.Contractor.Site.MapView
|
||||
string contractorid = p.Substring(0, index);
|
||||
string assetid = p.Substring(index + 1);
|
||||
|
||||
items = UserManagement.GetUsersByAssetID(LoginSession.SessionID, Convert.ToInt64(assetid), contractorid);
|
||||
var lang = GetLanguageCookie();
|
||||
items = UserManagement.GetUsersByAssetID(LoginSession.SessionID, Convert.ToInt64(assetid), contractorid, lang);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -634,7 +662,7 @@ namespace IronIntel.Contractor.Site.MapView
|
||||
string contractorid = p.Substring(0, index);
|
||||
string jsid = p.Substring(index + 1);
|
||||
|
||||
items = UserManagement.GetUsersByJobsiteID(LoginSession.SessionID, Convert.ToInt64(jsid), contractorid);
|
||||
items = UserManagement.GetUsersByJobsiteID(LoginSession.SessionID, GetLanguageCookie(), Convert.ToInt64(jsid), contractorid);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -969,7 +997,9 @@ namespace IronIntel.Contractor.Site.MapView
|
||||
|
||||
public static string GetUserLanguage(Foresight.Standard.StringKeyValue[] alllangs, string uid)
|
||||
{
|
||||
var lang = "en-us";
|
||||
var lang = SystemParams.CustomerDetail.LanguageId;
|
||||
if (string.IsNullOrEmpty(lang))
|
||||
lang = "en-us";
|
||||
if (alllangs != null)
|
||||
{
|
||||
var item = alllangs.FirstOrDefault(m => m.Key == uid);
|
||||
@ -1254,7 +1284,7 @@ namespace IronIntel.Contractor.Site.MapView
|
||||
public class AssetTripItem : AssetTripInfo
|
||||
{
|
||||
public TripColor Color { get; set; }
|
||||
public string TripTimeStr { get { return TripTime == null ? "" : TripTime.Value.ToString(); } }
|
||||
public string TripTimeStr { get { return TripTime == null ? "" : TripTime.Value.ToString("hh\\:mm\\:ss"); } }
|
||||
public string TripOnLocalAsofTimeStr { get { return TripOn == null ? "" : TripOn.LocalAsofTime.ToString("MM/dd/yyyy hh:mm:ss tt"); } }
|
||||
public string TripOffLocalAsofTimeStr { get { return TripOff == null ? "" : TripOff.LocalAsofTime.ToString("MM/dd/yyyy hh:mm:ss tt"); } }
|
||||
public string TripOnAddress
|
||||
|
Reference in New Issue
Block a user