.
This commit is contained in:
@ -83,7 +83,7 @@ namespace IronIntel.Contractor.Machines
|
||||
{
|
||||
get
|
||||
{
|
||||
return AsofTime.ToString("M/d/yyyy h:m tt");
|
||||
return AsofTime.ToString("M/d/yyyy h:mm tt");
|
||||
}
|
||||
}
|
||||
public DateTime AsofTimeLocal { get; set; }
|
||||
@ -91,7 +91,7 @@ namespace IronIntel.Contractor.Machines
|
||||
{
|
||||
get
|
||||
{
|
||||
return AsofTimeLocal.ToString("M/d/yyyy h:m tt");
|
||||
return AsofTimeLocal.ToString("M/d/yyyy h:mm tt");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -109,7 +109,7 @@ namespace IronIntel.Contractor.Machines
|
||||
{
|
||||
get
|
||||
{
|
||||
return AsofTime.ToString("M/d/yyyy h:m tt");
|
||||
return AsofTime.ToString("M/d/yyyy h:mm tt");
|
||||
}
|
||||
}
|
||||
public DateTime AsofTimeLocal { get; set; }
|
||||
@ -117,7 +117,7 @@ namespace IronIntel.Contractor.Machines
|
||||
{
|
||||
get
|
||||
{
|
||||
return AsofTimeLocal.ToString("M/d/yyyy h:m tt");
|
||||
return AsofTimeLocal.ToString("M/d/yyyy h:mm tt");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -133,7 +133,7 @@ namespace IronIntel.Contractor.Machines
|
||||
{
|
||||
get
|
||||
{
|
||||
return AsofTime.ToString("M/d/yyyy h:m tt");
|
||||
return AsofTime.ToString("M/d/yyyy h:mm tt");
|
||||
}
|
||||
}
|
||||
public DateTime AsofTimeLocal { get; set; }
|
||||
@ -141,7 +141,7 @@ namespace IronIntel.Contractor.Machines
|
||||
{
|
||||
get
|
||||
{
|
||||
return AsofTimeLocal.ToString("M/d/yyyy h:m tt");
|
||||
return AsofTimeLocal.ToString("M/d/yyyy h:mm tt");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -153,13 +153,13 @@ namespace IronIntel.Contractor.Machines
|
||||
public string DisplayName { get; set; }//Asset Name
|
||||
public string VIN { get; set; }
|
||||
public DateTime AdjustmentTime { get; set; }
|
||||
public string AdjustmentTimeText { get { return AdjustmentTime.ToString("M/d/yyyy h:m tt"); } }
|
||||
public string AdjustmentTimeText { get { return AdjustmentTime.ToString("M/d/yyyy h:mm tt"); } }
|
||||
public DateTime EngineHoursTime { get; set; }
|
||||
public string EngineHoursTimeText { get { return EngineHoursTime.ToString("M/d/yyyy h:m tt"); } }
|
||||
public string EngineHoursTimeText { get { return EngineHoursTime.ToString("M/d/yyyy h:mm tt"); } }
|
||||
public DateTime AdjustmentLocalTime { get; set; }
|
||||
public string AdjustmentLocalTimeText { get { return AdjustmentLocalTime.ToString("M/d/yyyy h:m tt"); } }
|
||||
public string AdjustmentLocalTimeText { get { return AdjustmentLocalTime.ToString("M/d/yyyy h:mm tt"); } }
|
||||
public DateTime EngineHoursLocalTime { get; set; }
|
||||
public string EngineHoursLocalTimeText { get { return EngineHoursLocalTime.ToString("M/d/yyyy h:m tt"); } }
|
||||
public string EngineHoursLocalTimeText { get { return EngineHoursLocalTime.ToString("M/d/yyyy h:mm tt"); } }
|
||||
|
||||
private double _EngineHours;
|
||||
public double EngineHours
|
||||
|
@ -167,15 +167,15 @@ namespace IronIntel.Contractor.Machines
|
||||
|
||||
public string AddedOnStr
|
||||
{
|
||||
get { return AddedLocalTime == null ? "" : AddedLocalTime.Value.ToString("MM/dd/yyyy"); }
|
||||
get { return AddedLocalTime == null ? "" : AddedLocalTime.Value.ToString("M/d/yyyy"); }
|
||||
}
|
||||
public string EngineHoursDateTimeStr
|
||||
{
|
||||
get { return EngineHoursLocalTime == null ? "" : EngineHoursLocalTime.Value.ToString("MM/dd/yyyy"); }
|
||||
get { return EngineHoursLocalTime == null ? "" : EngineHoursLocalTime.Value.ToString("M/d/yyyy"); }
|
||||
}
|
||||
public string OdometerDateTimeStr
|
||||
{
|
||||
get { return OdometerLocalTime == null ? "" : OdometerLocalTime.Value.ToString("MM/dd/yyyy"); }
|
||||
get { return OdometerLocalTime == null ? "" : OdometerLocalTime.Value.ToString("M/d/yyyy"); }
|
||||
}
|
||||
}
|
||||
|
||||
@ -316,10 +316,10 @@ namespace IronIntel.Contractor.Machines
|
||||
public bool Utilization { get; set; }
|
||||
public string SalesOrderNumber { get; set; }
|
||||
public string AddDateStr { get { return AddLocalDate == null ? "" : AddLocalDate.Value.ToShortDateString(); } }
|
||||
public string AddDateStr1 { get { return AddLocalDate == null ? "" : AddLocalDate.Value.ToString("yyyy-MM-dd"); } }
|
||||
public string AddDateStr1 { get { return AddLocalDate == null ? "" : AddLocalDate.Value.ToString("M/D/yyyy"); } }
|
||||
public string InvoiceDateStr { get { return InvoiceDate == null ? "" : InvoiceDate.Value.ToShortDateString(); } }
|
||||
public string ServiceStartDateStr { get { return ServiceStartDate == null ? "" : ServiceStartDate.Value.ToShortDateString(); } }
|
||||
public string ServiceStartDateStr1 { get { return ServiceStartDate == null ? "" : ServiceStartDate.Value.ToString("yyyy-MM-dd"); } }
|
||||
public string ServiceStartDateStr1 { get { return ServiceStartDate == null ? "" : ServiceStartDate.Value.ToString("M/D/yyyy"); } }
|
||||
}
|
||||
|
||||
public class PairedAssetItem
|
||||
@ -339,7 +339,7 @@ namespace IronIntel.Contractor.Machines
|
||||
|
||||
public class CommentItem : Foresight.Fleet.Services.CommentInfo
|
||||
{
|
||||
public string SubmitDateStr { get { return SubmitLocalDate == DateTime.MinValue ? "" : SubmitLocalDate.ToString("M/d/yyyy h:m tt"); } }
|
||||
public string SubmitDateStr { get { return SubmitLocalDate == DateTime.MinValue ? "" : SubmitLocalDate.ToString("M/d/yyyy h:mm tt"); } }
|
||||
|
||||
public void FormatFollowUp()
|
||||
{
|
||||
@ -357,7 +357,7 @@ namespace IronIntel.Contractor.Machines
|
||||
}
|
||||
public class InstallNotesItemC : Foresight.Fleet.Services.Device.InstallNotesItem
|
||||
{
|
||||
public string InstallTimeLocalStr { get { return InstallTimeLocal == DateTime.MinValue ? "" : InstallTimeLocal.ToString("M/d/yyyy h:m:s tt"); } }
|
||||
public string InstallTimeLocalStr { get { return InstallTimeLocal == DateTime.MinValue ? "" : InstallTimeLocal.ToString("M/d/yyyy h:mm:ss tt"); } }
|
||||
}
|
||||
|
||||
public class MachineGroup
|
||||
|
@ -277,73 +277,6 @@ namespace IronIntel.Contractor.Machines
|
||||
}
|
||||
}
|
||||
|
||||
public static MachineItem[] GetMachines(string sessionid, string useriid, string searchtxt, string companyid = null)
|
||||
{
|
||||
string SQL = "select " + string.Format(MachineFields, "") + " from MACHINES order by MACHINENAME";
|
||||
|
||||
FIDbAccess db = null;
|
||||
if (string.IsNullOrEmpty(companyid))
|
||||
{
|
||||
companyid = SystemParams.CompanyID;
|
||||
db = SystemParams.GetDbInstance();
|
||||
}
|
||||
else
|
||||
{
|
||||
string connetionstring = SystemParams.GetDbStringByCompany(companyid);
|
||||
db = new FISqlConnection(connetionstring);
|
||||
}
|
||||
|
||||
DataTable tb = db.GetDataTableBySQL(SQL);
|
||||
if (tb.Rows.Count == 0)
|
||||
{
|
||||
return new MachineItem[0];
|
||||
}
|
||||
long[] availableAssetsids = null;
|
||||
IronIntel.Contractor.Users.UserInfo user = null;
|
||||
if (!string.IsNullOrWhiteSpace(useriid))
|
||||
{
|
||||
user = Users.UserManagement.GetUserByIID(useriid);
|
||||
if (user.UserType < Users.UserTypes.Admin)
|
||||
availableAssetsids = FleetServiceClientHelper.CreateClient<AssetQueryClient>(companyid, sessionid).GetAvailableAssetsForUsers(companyid, useriid);
|
||||
}
|
||||
|
||||
RefreshBaseData();
|
||||
AssetMake[] makes = GetMachineMakes();
|
||||
AssetModel[] models = GetMachineModels();
|
||||
AssetType[] types = GetMachineTypes();
|
||||
|
||||
List<MachineItem> ls = new List<MachineItem>();
|
||||
if (tb.Rows.Count > 0)
|
||||
{
|
||||
foreach (DataRow dr in tb.Rows)
|
||||
{
|
||||
long mid = FIDbAccess.GetFieldInt64(dr["MACHINEID"], 0);
|
||||
if (!string.IsNullOrWhiteSpace(useriid) && user.UserType < Users.UserTypes.Admin && !availableAssetsids.Contains(mid))
|
||||
continue;
|
||||
|
||||
MachineItem mi = ConvertToMachineItem(dr, makes, models, types);
|
||||
if (!string.IsNullOrWhiteSpace(searchtxt))
|
||||
{
|
||||
if (Helper.Contains(mi.VIN, searchtxt)
|
||||
|| Helper.Contains(mi.MachineID.ToString(), searchtxt)
|
||||
|| Helper.Contains(mi.Name, searchtxt)
|
||||
|| Helper.Contains(mi.Name2, searchtxt)
|
||||
|| Helper.Contains(mi.Make, searchtxt)
|
||||
|| Helper.Contains(mi.MachineType, searchtxt)
|
||||
|| Helper.Contains(mi.Model, searchtxt))
|
||||
{
|
||||
ls.Add(mi);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ls.Add(mi);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ls.ToArray();
|
||||
}
|
||||
|
||||
|
||||
public static MachineItem[] GetSelectMachinesByRental(string sessionid, string useriid, string searchtxt, string companyid = null)
|
||||
{
|
||||
|
@ -96,7 +96,7 @@ namespace IronIntel.Contractor.Machines
|
||||
{
|
||||
get
|
||||
{
|
||||
return AsofTime.ToString("M/d/yyyy h:m tt");
|
||||
return AsofTime.ToString("M/d/yyyy h:mm tt");
|
||||
}
|
||||
}
|
||||
public DateTime AsofTimeLocal { get; set; }
|
||||
@ -104,7 +104,7 @@ namespace IronIntel.Contractor.Machines
|
||||
{
|
||||
get
|
||||
{
|
||||
return AsofTimeLocal.ToString("M/d/yyyy h:m tt");
|
||||
return AsofTimeLocal.ToString("M/d/yyyy h:mm tt");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -124,7 +124,7 @@ namespace IronIntel.Contractor.Machines
|
||||
{
|
||||
get
|
||||
{
|
||||
return AsofTime.ToString("M/d/yyyy h:m tt");
|
||||
return AsofTime.ToString("M/d/yyyy h:mm tt");
|
||||
}
|
||||
}
|
||||
public DateTime AsofTimeLocal { get; set; }
|
||||
@ -132,7 +132,7 @@ namespace IronIntel.Contractor.Machines
|
||||
{
|
||||
get
|
||||
{
|
||||
return AsofTimeLocal.ToString("M/d/yyyy h:m tt");
|
||||
return AsofTimeLocal.ToString("M/d/yyyy h:mm tt");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -150,7 +150,7 @@ namespace IronIntel.Contractor.Machines
|
||||
{
|
||||
get
|
||||
{
|
||||
return AsofTime.ToString("M/d/yyyy h:m tt");
|
||||
return AsofTime.ToString("M/d/yyyy h:mm tt");
|
||||
}
|
||||
}
|
||||
public DateTime AsofTimeLocal { get; set; }
|
||||
@ -158,7 +158,7 @@ namespace IronIntel.Contractor.Machines
|
||||
{
|
||||
get
|
||||
{
|
||||
return AsofTimeLocal.ToString("M/d/yyyy h:m tt");
|
||||
return AsofTimeLocal.ToString("M/d/yyyy h:mm tt");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -180,13 +180,13 @@ namespace IronIntel.Contractor.Machines
|
||||
public string DisplayName { get; set; }//Asset Name
|
||||
public string VIN { get; set; }
|
||||
public DateTime AdjustmentTime { get; set; }
|
||||
public string AdjustmentTimeText { get { return AdjustmentTime.ToString("M/d/yyyy h:m tt"); } }
|
||||
public string AdjustmentTimeText { get { return AdjustmentTime.ToString("M/d/yyyy h:mm tt"); } }
|
||||
public DateTime OdometerTime { get; set; }
|
||||
public string OdometerTimeText { get { return OdometerTime.ToString("M/d/yyyy h:m tt"); } }
|
||||
public string OdometerTimeText { get { return OdometerTime.ToString("M/d/yyyy h:mm tt"); } }
|
||||
public DateTime AdjustmentLocalTime { get; set; }
|
||||
public string AdjustmentLocalTimeText { get { return AdjustmentLocalTime.ToString("M/d/yyyy h:m tt"); } }
|
||||
public string AdjustmentLocalTimeText { get { return AdjustmentLocalTime.ToString("M/d/yyyy h:mm tt"); } }
|
||||
public DateTime OdometerLocalTime { get; set; }
|
||||
public string OdometerLocalTimeText { get { return OdometerLocalTime.ToString("M/d/yyyy h:m tt"); } }
|
||||
public string OdometerLocalTimeText { get { return OdometerLocalTime.ToString("M/d/yyyy h:mm tt"); } }
|
||||
|
||||
private double _Odometer;
|
||||
public double Odometer
|
||||
|
Reference in New Issue
Block a user