Compare commits

..

5 Commits

2 changed files with 23 additions and 13 deletions

View File

@ -452,34 +452,36 @@ namespace SafeMobileLib
BatchHistoryData batchHistObj = null; BatchHistoryData batchHistObj = null;
try try
{ {
lat = Convert.ToDouble(dr["lat"]); lat = Convert.ToDouble(dr["lat"]);
lng = Convert.ToDouble(dr["lng"]); lng = Convert.ToDouble(dr["lng"]);
timegmt = Convert.ToInt32(dr["timegmt"]); timegmt = Convert.ToInt32(dr["timegmt"]);
batchHistObj = new BatchHistoryData batchHistObj = new BatchHistoryData
{ {
Department = dr["department"].ToString(), Department = dr["department"].ToString(),
Unit = dr["unit"].ToString(), Unit = dr["unit"].ToString(),
Location = ((getAddress && dr["address"] != DBNull.Value) ? dr["address"].ToString() : "LAT:" + Math.Round(lat, 5).ToString() + " , LNG:" + Math.Round(lat, 5).ToString()),
Speed = (isInMile) ? ((int)(Convert.ToInt32(dr["speed"]) * 0.621371192)).ToString() : Convert.ToInt32(dr["speed"]).ToString(), Speed = (isInMile) ? ((int)(Convert.ToInt32(dr["speed"]) * 0.621371192)).ToString() : Convert.ToInt32(dr["speed"]).ToString(),
Lat = lat, Lat = lat,
Lng = lng, Lng = lng,
Address = dr["address"].ToString(), Address = string.Empty,
Time = timegmt.TimeOfDayHHMMSSLocal(!is24hours), Time = timegmt.TimeOfDayHHMMSSLocal(!is24hours),
Date = timegmt.GetDTLocalFromSeconds().Date.ToShortDateString() Date = timegmt.GetDTLocalFromSeconds().Date.ToShortDateString()
}; };
if (getAddress)
{
batchHistObj.Location = dr["address"].ToString();
batchHistObj.Address = dr["address"].ToString();
}
else
batchHistObj.Location = "LAT:" + Math.Round(lat, 5).ToString() + " , LNG:" + Math.Round(lat, 5).ToString();
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -112,7 +112,9 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
<None Include="prebuild.sh" /> <None Include="prebuild.sh" />
<None Include="RunMessagesPartitioning.bat" /> <None Include="RunMessagesPartitioning.bat">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5"> <BootstrapperPackage Include=".NETFramework,Version=v4.5">
@ -144,7 +146,9 @@
<Content Include="7toLatest7.sql"> <Content Include="7toLatest7.sql">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="call_messages_partitioning.sql" /> <Content Include="call_messages_partitioning.sql">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="CreateMissingForeignKeys.sql"> <Content Include="CreateMissingForeignKeys.sql">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
@ -154,8 +158,12 @@
<Content Include="CreateMissingPrimaryKeys.sql"> <Content Include="CreateMissingPrimaryKeys.sql">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="generate_partitioning_of_an_existing_table_by_date_unix_time.sql" /> <Content Include="generate_partitioning_of_an_existing_table_by_date_unix_time.sql">
<Content Include="get_query_partitioning_of_an_existing_table_by_date_unix_time.sql" /> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="get_query_partitioning_of_an_existing_table_by_date_unix_time.sql">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="NewFields.sql"> <Content Include="NewFields.sql">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>