WIP estimate
This commit is contained in:
parent
4d2a5b46ba
commit
867e2d502d
6 changed files with 80 additions and 46 deletions
|
|
@ -39,7 +39,11 @@
|
|||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DataManager.cs" />
|
||||
<Compile Include="Helpers\RemoteEntityRO.cs" />
|
||||
<Compile Include="Pages\BlogPage.cs" />
|
||||
<Compile Include="Pages\BookQueriesPage.xaml.cs">
|
||||
<DependentUpon>BookQueriesPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Pages\BookQueryPage.xaml.cs">
|
||||
<DependentUpon>BookQueryPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
|
@ -212,6 +216,12 @@
|
|||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Pages\BookQueriesPage.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
||||
<Import Project="..\..\packages\Xamarin.Forms.2.3.0.107\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.0.107\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
|
|
|
|||
|
|
@ -3,14 +3,18 @@ using System;
|
|||
|
||||
namespace BookAStar.Model
|
||||
{
|
||||
public class ClientProviderInfo
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
public string UserId { get; set; }
|
||||
public int Rate { get; set; }
|
||||
}
|
||||
public class BookQueryData
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public string Description { set; get; }
|
||||
public string Comment { get; set; }
|
||||
public long CommandId { get; set; }
|
||||
public DateTime StartDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
public Location Address { get; set; }
|
||||
public ClientProviderInfo Client { get; set; }
|
||||
public Location Location { get; set; }
|
||||
public long Id { get; set; }
|
||||
public DateTime EventDate { get; set; }
|
||||
public decimal? Previsionnal { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="BookAStar.BookQueryPage">
|
||||
xmlns:maps="clr-namespace:Xamarin.Forms.Maps;assembly=Xamarin.Forms.Maps.dll"
|
||||
x:Class="BookAStar.Pages.BookQueryPage">
|
||||
<StackLayout x:Name="bookQueryLayout">
|
||||
|
||||
|
||||
<Label Text="{Binding Title}" VerticalOptions="Start" HorizontalOptions="Center" />
|
||||
<Label Text="{Binding Description}" VerticalOptions="FillAndExpand" HorizontalOptions="Center" />
|
||||
<Label Text="{Binding CommandId}" VerticalOptions="Center" HorizontalOptions="Center" />
|
||||
<Label Text="{Binding Comment}" VerticalOptions="Center" HorizontalOptions="Center" />
|
||||
<Label Text="{Binding StartDate}" VerticalOptions="Center" HorizontalOptions="Center" />
|
||||
<Label Text="{Binding EndDate}" VerticalOptions="Center" HorizontalOptions="Center" />
|
||||
<Label Text="{Binding Address}" VerticalOptions="Center" HorizontalOptions="Center" />
|
||||
<Label Text="{Binding Location}" VerticalOptions="Center" HorizontalOptions="Center" />
|
||||
<maps:Map x:Name="map"></maps:Map>
|
||||
<Button Text="Faire un devis" Clicked="MakeAnEstimate" VerticalOptions="Center" HorizontalOptions="End"/>
|
||||
</StackLayout>
|
||||
</ContentPage>
|
||||
|
|
@ -4,53 +4,61 @@ using System;
|
|||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Maps;
|
||||
|
||||
namespace BookAStar
|
||||
namespace BookAStar.Pages
|
||||
{
|
||||
using Model;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public partial class BookQueryPage : ContentPage
|
||||
{
|
||||
private Map map;
|
||||
public BookQueryPage(long bookQueryId)
|
||||
|
||||
public BookQueryData BookQuery
|
||||
{
|
||||
get
|
||||
{
|
||||
return BindingContext as BookQueryData;
|
||||
}
|
||||
set
|
||||
{
|
||||
BindingContext = value;
|
||||
}
|
||||
}
|
||||
protected override void OnBindingContextChanged()
|
||||
{
|
||||
base.OnBindingContextChanged();
|
||||
map.Pins.Clear();
|
||||
if (BookQuery != null)
|
||||
{
|
||||
var lat = BookQuery.Location.Latitude;
|
||||
var lon = BookQuery.Location.Longitude;
|
||||
var pin = new Pin
|
||||
{
|
||||
Type = PinType.SavedPin,
|
||||
Position = new Position(
|
||||
lat, lon),
|
||||
Label = BookQuery.Client.UserName,
|
||||
Address = BookQuery.Location.Address
|
||||
};
|
||||
map.Pins.Add(pin);
|
||||
map.MoveToRegion(MapSpan.FromCenterAndRadius(
|
||||
new Position(lat, lon), Distance.FromMeters(100)));
|
||||
}
|
||||
}
|
||||
public BookQueryPage(BookQueryData bookQuery)
|
||||
{
|
||||
|
||||
InitializeComponent();
|
||||
if (bookQueryId == 0)
|
||||
throw new InvalidOperationException("No id");
|
||||
BookQueryData bquery = null;
|
||||
Task.Run( async () => { bquery = await App.CurrentApp.DataManager.BookQueries.Get(bookQueryId); });
|
||||
|
||||
BindingContext = bquery;
|
||||
if (bquery==null)
|
||||
throw new InvalidOperationException("No data");
|
||||
|
||||
var lat = bquery.Address.Latitude;
|
||||
var lon = bquery.Address.Longitude;
|
||||
var pin = new Pin
|
||||
{
|
||||
Type = PinType.SearchResult,
|
||||
Position = new Position(
|
||||
lat , lon ),
|
||||
Label = bquery.Title,
|
||||
Address = bquery.Address.Address
|
||||
};
|
||||
pin.BindingContext = bquery;
|
||||
map.Pins.Add(pin);
|
||||
map.MoveToRegion(MapSpan.FromCenterAndRadius(
|
||||
new Position(lat, lon), Distance.FromMeters(100)));
|
||||
bookQueryLayout.Children.Add(map);
|
||||
// Task.Run( async () => { bookQuery = await App.CurrentApp.DataManager.BookQueries.Get(bookQueryId); });
|
||||
|
||||
BookQuery = bookQuery;
|
||||
|
||||
}
|
||||
|
||||
private void MakeAnEstimate(object sender, EventArgs e)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected override void OnBindingContextChanged()
|
||||
{
|
||||
base.OnBindingContextChanged();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,5 +5,6 @@
|
|||
xmlns:local="clr-namespace:BookAStar.Views;assembly=BookAStar"
|
||||
>
|
||||
|
||||
<local:MarkdownView x:Name="mdview" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" ></local:MarkdownView>
|
||||
<local:MarkdownView x:Name="mdview" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
|
||||
Markdown="hello estimate"></local:MarkdownView>
|
||||
</ContentPage>
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using BookAStar.Views;
|
||||
using BookAStar.Model.Workflow;
|
||||
using BookAStar.Views;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
|
@ -11,11 +12,17 @@ namespace BookAStar.Pages
|
|||
{
|
||||
public partial class MakeAnEstimatePage : ContentPage
|
||||
{
|
||||
public MakeAnEstimatePage()
|
||||
public Estimate Estimate { get { return BindingContext as Estimate; } set {
|
||||
BindingContext = value;
|
||||
} }
|
||||
|
||||
public static readonly BindableProperty MarkdownProperty =
|
||||
BindableProperty.Create("Description", typeof(string), typeof(Estimate),
|
||||
null, BindingMode.TwoWay);
|
||||
|
||||
public MakeAnEstimatePage(string clientId,long bookQueryId)
|
||||
{
|
||||
var m = new MarkdownView();
|
||||
InitializeComponent();
|
||||
var md = this.mdview.Markdown;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue