Merge branch 'vnext' of github.com:pazof/yavsc into vnext
This commit is contained in:
commit
812d523068
27 changed files with 202 additions and 141 deletions
|
|
@ -251,8 +251,8 @@ namespace BookAStar.Droid
|
||||||
{
|
{
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
App.ShowBookQuery(
|
var query = DataManager.Instance.BookQueries.LocalGet(queryId);
|
||||||
await DataManager.Instance.BookQueries.Get(queryId));
|
App.ShowBookQuery(query);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,9 @@ namespace BookAStar.Droid.Services
|
||||||
using Model.Social;
|
using Model.Social;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Model;
|
using Model;
|
||||||
|
using Model.Social;
|
||||||
|
using Data;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace ClientApp
|
namespace ClientApp
|
||||||
{
|
{
|
||||||
|
|
@ -52,13 +55,20 @@ namespace BookAStar.Droid.Services
|
||||||
var cid = long.Parse(data.GetString("Id"));
|
var cid = long.Parse(data.GetString("Id"));
|
||||||
var clientJson = data.GetString("Client");
|
var clientJson = data.GetString("Client");
|
||||||
var client = JsonConvert.DeserializeObject<ClientProviderInfo>(clientJson);
|
var client = JsonConvert.DeserializeObject<ClientProviderInfo>(clientJson);
|
||||||
var bq = new BookQueryData
|
var bq = new BookQuery
|
||||||
{
|
{
|
||||||
Id = cid,
|
Id = cid,
|
||||||
Location = location,
|
Location = location,
|
||||||
Client = client,
|
Client = client,
|
||||||
Reason = data.GetString("Reason")
|
Reason = data.GetString("Reason")
|
||||||
};
|
};
|
||||||
|
var dateString = data.GetString("EventDate");
|
||||||
|
DateTime evDate;
|
||||||
|
if (DateTime.TryParse(dateString, out evDate))
|
||||||
|
{
|
||||||
|
bq.EventDate = evDate;
|
||||||
|
}
|
||||||
|
|
||||||
SendBookQueryNotification(bq);
|
SendBookQueryNotification(bq);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -84,9 +94,12 @@ namespace BookAStar.Droid.Services
|
||||||
notificationManager.Notify(0, notificationBuilder.Build());
|
notificationManager.Notify(0, notificationBuilder.Build());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendBookQueryNotification(BookQueryData bquery)
|
void SendBookQueryNotification(BookQuery bquery)
|
||||||
{
|
{
|
||||||
var bookquerynotifications = MainSettings.AddBookQueryNotification(bquery);
|
DataManager.Instance.BookQueries.Merge(bquery);
|
||||||
|
var bookquerynotifications = DataManager.Instance.BookQueries.Where(
|
||||||
|
q=> ! q.Read && q.EventDate > DateTime.Now
|
||||||
|
).ToArray();
|
||||||
var count = bookquerynotifications.Length;
|
var count = bookquerynotifications.Length;
|
||||||
var multiple = count > 1;
|
var multiple = count > 1;
|
||||||
var title =
|
var title =
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ using Android.Widget;
|
||||||
|
|
||||||
namespace BookAStar.Droid
|
namespace BookAStar.Droid
|
||||||
{
|
{
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
public class MyGcmIntentService : IntentService
|
public class MyGcmIntentService : IntentService
|
||||||
{
|
{
|
||||||
|
|
@ -31,6 +30,7 @@ namespace BookAStar.Droid
|
||||||
intent.SetClass(context, typeof(MyGcmIntentService));
|
intent.SetClass(context, typeof(MyGcmIntentService));
|
||||||
context.StartService(intent);
|
context.StartService(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
static object locker = new object();
|
static object locker = new object();
|
||||||
|
|
||||||
protected override void OnHandleIntent(Intent intent)
|
protected override void OnHandleIntent(Intent intent)
|
||||||
|
|
@ -74,16 +74,28 @@ namespace BookAStar.Droid
|
||||||
|
|
||||||
void SendNotification (string message)
|
void SendNotification (string message)
|
||||||
{
|
{
|
||||||
var intent = new Intent (this, typeof(MainActivity));
|
/* Bundle valuesForActivity = new Bundle();
|
||||||
|
valuesForActivity.PutInt("count", count); */
|
||||||
|
|
||||||
|
var intent = new Intent (this, typeof(MainActivity));
|
||||||
intent.AddFlags (ActivityFlags.ClearTop);
|
intent.AddFlags (ActivityFlags.ClearTop);
|
||||||
var pendingIntent = PendingIntent.GetActivity (this, 0, intent, PendingIntentFlags.OneShot);
|
var pendingIntent = PendingIntent.GetActivity (this, 0, intent, PendingIntentFlags.OneShot);
|
||||||
|
// Construct a back stack for cross-task navigation:
|
||||||
|
TaskStackBuilder stackBuilder = TaskStackBuilder.Create(this);
|
||||||
|
stackBuilder.AddParentStack(Java.Lang.Class.FromType(typeof(MainActivity)));
|
||||||
|
stackBuilder.AddNextIntent(intent);
|
||||||
|
|
||||||
var notificationBuilder = new Notification.Builder(this)
|
// Create the PendingIntent with the back stack:
|
||||||
|
PendingIntent resultPendingIntent =
|
||||||
|
stackBuilder.GetPendingIntent(0, PendingIntentFlags.UpdateCurrent);
|
||||||
|
|
||||||
|
var notificationBuilder = new Notification.Builder(this)
|
||||||
|
.SetAutoCancel(true)
|
||||||
.SetSmallIcon (Resource.Drawable.icon)
|
.SetSmallIcon (Resource.Drawable.icon)
|
||||||
.SetContentTitle ("GCM Message")
|
.SetContentTitle ("GCM Message")
|
||||||
.SetContentText (message)
|
.SetContentText (message)
|
||||||
.SetAutoCancel (true)
|
.SetContentIntent(resultPendingIntent) // Start 2nd activity when the intent is clicked.
|
||||||
.SetContentIntent (pendingIntent);
|
;
|
||||||
|
|
||||||
var notificationManager = (NotificationManager) GetSystemService(Context.NotificationService);
|
var notificationManager = (NotificationManager) GetSystemService(Context.NotificationService);
|
||||||
notificationManager.Notify (0, notificationBuilder.Build());
|
notificationManager.Notify (0, notificationBuilder.Build());
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ namespace BookAStar
|
||||||
using ViewModels;
|
using ViewModels;
|
||||||
using Pages.Chat;
|
using Pages.Chat;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Model.Social;
|
||||||
|
|
||||||
public partial class App : Application // superclass new in 1.3
|
public partial class App : Application // superclass new in 1.3
|
||||||
{
|
{
|
||||||
|
|
@ -196,9 +197,8 @@ namespace BookAStar
|
||||||
|
|
||||||
ChatPage chatPage;
|
ChatPage chatPage;
|
||||||
|
|
||||||
private void ShowPage(Page page)
|
public static void ShowPage(Page page)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (Navigation.NavigationStack.Contains(page))
|
if (Navigation.NavigationStack.Contains(page))
|
||||||
{
|
{
|
||||||
if (Navigation.NavigationStack.Last() == page) return;
|
if (Navigation.NavigationStack.Last() == page) return;
|
||||||
|
|
@ -443,11 +443,11 @@ namespace BookAStar
|
||||||
PlatformSpecificInstance.InvokeApi("gcm/register", info);
|
PlatformSpecificInstance.InvokeApi("gcm/register", info);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ShowBookQuery (BookQueryData query)
|
public static void ShowBookQuery (BookQuery query)
|
||||||
{
|
{
|
||||||
var page = ViewFactory.CreatePage<BookQueryViewModel
|
var page = new BookQueryPage
|
||||||
, BookQueryPage>((b, p) => p.BindingContext = new BookQueryViewModel(query));
|
{ BindingContext = new BookQueryViewModel(query) };
|
||||||
App.Current.MainPage.Navigation.PushAsync(page as Page);
|
ShowPage(page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,14 +42,14 @@
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Attributes\CurrencyAttribute.cs" />
|
<Compile Include="Attributes\CurrencyAttribute.cs" />
|
||||||
<Compile Include="Attributes\DisplayAttribute.cs" />
|
<Compile Include="Attributes\DisplayAttribute.cs" />
|
||||||
<Compile Include="Behaviors\EmailValidatorBehavior.cs" />
|
<Compile Include="Converters\Behaviors\EmailValidatorBehavior.cs" />
|
||||||
<Compile Include="Behaviors\IntegerEntryBehavior.cs" />
|
<Compile Include="Converters\Behaviors\IntegerEntryBehavior.cs" />
|
||||||
<Compile Include="Behaviors\EditorMaxLengthValidator.cs" />
|
<Compile Include="Converters\Behaviors\EditorMaxLengthValidator.cs" />
|
||||||
<Compile Include="Behaviors\DecimalValidatorBehavior.cs" />
|
<Compile Include="Converters\Behaviors\DecimalValidatorBehavior.cs" />
|
||||||
<Compile Include="Behaviors\MarkdownViewLengthValidator.cs" />
|
<Compile Include="Converters\Behaviors\MarkdownViewLengthValidator.cs" />
|
||||||
<Compile Include="Behaviors\PickerBehavior.cs" />
|
<Compile Include="Converters\Behaviors\PickerBehavior.cs" />
|
||||||
<Compile Include="Behaviors\RegexValidatorBehavior.cs" />
|
<Compile Include="Converters\Behaviors\RegexValidatorBehavior.cs" />
|
||||||
<Compile Include="Behaviors\StarBehavior.cs" />
|
<Compile Include="Converters\Behaviors\StarBehavior.cs" />
|
||||||
<Compile Include="Constants.cs" />
|
<Compile Include="Constants.cs" />
|
||||||
<Compile Include="Converters\NotValueConverter.cs" />
|
<Compile Include="Converters\NotValueConverter.cs" />
|
||||||
<Compile Include="Converters\SignalRConnectionStateToObject.cs" />
|
<Compile Include="Converters\SignalRConnectionStateToObject.cs" />
|
||||||
|
|
@ -57,11 +57,14 @@
|
||||||
<Compile Include="Data\EstimateEntity.cs" />
|
<Compile Include="Data\EstimateEntity.cs" />
|
||||||
<Compile Include="Data\NonCrUD\RemoteFiles.cs" />
|
<Compile Include="Data\NonCrUD\RemoteFiles.cs" />
|
||||||
<Compile Include="Model\Access\BlackListed.cs" />
|
<Compile Include="Model\Access\BlackListed.cs" />
|
||||||
|
<Compile Include="Model\Booking\MusicalPreference.cs" />
|
||||||
|
<Compile Include="Model\Booking\MusicalTendency.cs" />
|
||||||
<Compile Include="Model\FileSystem\UserDirectoryInfo.cs" />
|
<Compile Include="Model\FileSystem\UserDirectoryInfo.cs" />
|
||||||
<Compile Include="Model\FileSystem\UserFileInfo.cs" />
|
<Compile Include="Model\FileSystem\UserFileInfo.cs" />
|
||||||
<Compile Include="Model\Settings\SignatureSettings.cs" />
|
<Compile Include="Model\Settings\SignatureSettings.cs" />
|
||||||
<Compile Include="Model\Social\Chat\ChatStatus.cs" />
|
<Compile Include="Model\Social\Chat\ChatStatus.cs" />
|
||||||
<Compile Include="Model\Social\Chat\ChatMessage.cs" />
|
<Compile Include="Model\Social\Chat\ChatMessage.cs" />
|
||||||
|
<Compile Include="Model\Social\LocationType.cs" />
|
||||||
<Compile Include="Pages\ClientPages\SearchPage.xaml.cs">
|
<Compile Include="Pages\ClientPages\SearchPage.xaml.cs">
|
||||||
<DependentUpon>SearchPage.xaml</DependentUpon>
|
<DependentUpon>SearchPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
@ -161,7 +164,7 @@
|
||||||
<Compile Include="Interfaces\IPlatform.cs" />
|
<Compile Include="Interfaces\IPlatform.cs" />
|
||||||
<Compile Include="Model\Blog\Blog.cs" />
|
<Compile Include="Model\Blog\Blog.cs" />
|
||||||
<Compile Include="Model\Blog\BlogTag.cs" />
|
<Compile Include="Model\Blog\BlogTag.cs" />
|
||||||
<Compile Include="Model\BookQueryData.cs" />
|
<Compile Include="Model\Booking\BookQuery.cs" />
|
||||||
<Compile Include="Model\Market\BaseProduct.cs" />
|
<Compile Include="Model\Market\BaseProduct.cs" />
|
||||||
<Compile Include="Model\Workflow\BillingLine.cs" />
|
<Compile Include="Model\Workflow\BillingLine.cs" />
|
||||||
<Compile Include="Model\Manager.cs" />
|
<Compile Include="Model\Manager.cs" />
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,12 @@
|
||||||
using ViewModels;
|
using ViewModels;
|
||||||
using Model.Access;
|
using Model.Access;
|
||||||
using ViewModels.Messaging;
|
using ViewModels.Messaging;
|
||||||
|
using Model.Social;
|
||||||
|
|
||||||
public class DataManager
|
public class DataManager
|
||||||
{
|
{
|
||||||
// TODO estimatetemplate rating service product tag
|
// TODO estimatetemplate rating service product tag
|
||||||
public RemoteEntityRO<BookQueryData, long> BookQueries { get; set; }
|
public RemoteEntityRO<BookQuery, long> BookQueries { get; set; }
|
||||||
public ChatUserCollection ChatUsers { get; set; }
|
public ChatUserCollection ChatUsers { get; set; }
|
||||||
public EstimateEntity Estimates { get; set; }
|
public EstimateEntity Estimates { get; set; }
|
||||||
public RemoteEntity<Blog, long> Blogspot { get; set; }
|
public RemoteEntity<Blog, long> Blogspot { get; set; }
|
||||||
|
|
@ -41,7 +42,7 @@
|
||||||
|
|
||||||
public DataManager()
|
public DataManager()
|
||||||
{
|
{
|
||||||
BookQueries = new RemoteEntityRO<BookQueryData, long>("bookquery", q => q.Id);
|
BookQueries = new RemoteEntityRO<BookQuery, long>("bookquery", q => q.Id);
|
||||||
Estimates = new EstimateEntity();
|
Estimates = new EstimateEntity();
|
||||||
Blogspot = new RemoteEntity<Blog, long>("blog", x=>x.Id);
|
Blogspot = new RemoteEntity<Blog, long>("blog", x=>x.Id);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
using BookAStar.Interfaces;
|
|
||||||
using BookAStar.Model.Social;
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace BookAStar.Model
|
namespace BookAStar.Model.Social
|
||||||
{
|
{
|
||||||
public class BookQueryData
|
public class BookQuery
|
||||||
{
|
{
|
||||||
public ClientProviderInfo Client { get; set; }
|
public ClientProviderInfo Client { get; set; }
|
||||||
public Location Location { get; set; }
|
public Location Location { get; set; }
|
||||||
|
|
@ -12,5 +11,6 @@ namespace BookAStar.Model
|
||||||
public DateTime EventDate { get; set; }
|
public DateTime EventDate { get; set; }
|
||||||
public decimal? Previsionnal { get; set; }
|
public decimal? Previsionnal { get; set; }
|
||||||
public string Reason { get; set; }
|
public string Reason { get; set; }
|
||||||
|
public bool Read { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
12
BookAStar/BookAStar/Model/Booking/MusicalPreference.cs
Normal file
12
BookAStar/BookAStar/Model/Booking/MusicalPreference.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
namespace BookAStar.Model.Social
|
||||||
|
{
|
||||||
|
|
||||||
|
public class MusicalPreference : MusicalTendency {
|
||||||
|
|
||||||
|
public long OwnerId { get; set; }
|
||||||
|
public int Rate { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
13
BookAStar/BookAStar/Model/Booking/MusicalTendency.cs
Normal file
13
BookAStar/BookAStar/Model/Booking/MusicalTendency.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
|
||||||
|
namespace BookAStar.Model.Social
|
||||||
|
{
|
||||||
|
|
||||||
|
public class MusicalTendency {
|
||||||
|
|
||||||
|
public long Id {get; set; }
|
||||||
|
|
||||||
|
public string Name { get ; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
10
BookAStar/BookAStar/Model/Social/LocationType.cs
Normal file
10
BookAStar/BookAStar/Model/Social/LocationType.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
namespace BookAStar.Model.Social
|
||||||
|
{
|
||||||
|
public class LocationType
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,6 @@ namespace BookAStar.Model.Workflow.Messaging
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Query, for a date, with a given perfomer, at this given place.
|
/// Query, for a date, with a given perfomer, at this given place.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
||||||
public class BookQuery {
|
public class BookQuery {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The command identifier
|
/// The command identifier
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using BookAStar.Data;
|
|
||||||
using BookAStar.Helpers;
|
|
||||||
using BookAStar.Model.Interfaces;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
@ -8,6 +6,10 @@ using System.Linq;
|
||||||
|
|
||||||
namespace BookAStar.Model.Workflow
|
namespace BookAStar.Model.Workflow
|
||||||
{
|
{
|
||||||
|
using Data;
|
||||||
|
using Interfaces;
|
||||||
|
using Social;
|
||||||
|
|
||||||
public partial class Estimate : IEstimate
|
public partial class Estimate : IEstimate
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
|
|
@ -62,7 +64,7 @@ namespace BookAStar.Model.Workflow
|
||||||
}
|
}
|
||||||
public string ClientId { get; set; }
|
public string ClientId { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public BookQueryData Query
|
public BookQuery Query
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@ namespace BookAStar.Pages
|
||||||
{
|
{
|
||||||
using Data;
|
using Data;
|
||||||
using EstimatePages;
|
using EstimatePages;
|
||||||
using Model;
|
using Model.Social;
|
||||||
using Model.Workflow;
|
using Model.Workflow;
|
||||||
using ViewModels.EstimateAndBilling;
|
using ViewModels.EstimateAndBilling;
|
||||||
|
|
||||||
public partial class BookQueryPage : ContentPage
|
public partial class BookQueryPage : ContentPage
|
||||||
{
|
{
|
||||||
|
|
||||||
public BookQueryData BookQuery
|
public BookQuery BookQuery
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
|
@ -32,14 +32,14 @@ namespace BookAStar.Pages
|
||||||
var pin = new Pin
|
var pin = new Pin
|
||||||
{
|
{
|
||||||
Type = PinType.SavedPin,
|
Type = PinType.SavedPin,
|
||||||
Position = new Position(
|
Position = new Xamarin.Forms.Maps.Position
|
||||||
lat, lon),
|
(lat, lon),
|
||||||
Label = BookQuery.Client.UserName,
|
Label = BookQuery.Client.UserName,
|
||||||
Address = BookQuery.Location.Address
|
Address = BookQuery.Location.Address
|
||||||
};
|
};
|
||||||
map.Pins.Add(pin);
|
map.Pins.Add(pin);
|
||||||
map.MoveToRegion(MapSpan.FromCenterAndRadius(
|
map.MoveToRegion(MapSpan.FromCenterAndRadius(
|
||||||
new Position(lat, lon), Distance.FromMeters(100)));
|
new Xamarin.Forms.Maps.Position(lat, lon), Distance.FromMeters(100)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
x:Class="BookAStar.Pages.HomePage"
|
xmlns:local="clr-namespace:BookAStar;assembly=BookAStar"
|
||||||
Style="{StaticResource PageStyle}"
|
x:Class="BookAStar.Pages.HomePage"
|
||||||
Title="Accueil">
|
Style="{StaticResource PageStyle}"
|
||||||
|
Title="Accueil">
|
||||||
<ContentPage.Resources>
|
<ContentPage.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<Style TargetType="Label">
|
<Style TargetType="Label">
|
||||||
|
|
@ -19,28 +20,29 @@
|
||||||
<TabbedPage.Children>
|
<TabbedPage.Children>
|
||||||
<TabbedPage Title="{x:Static local:Strings.SearchForAPro}" >
|
<TabbedPage Title="{x:Static local:Strings.SearchForAPro}" >
|
||||||
<TabbedPage.Children>
|
<TabbedPage.Children>
|
||||||
<ContentPage Title="Les stars">
|
<ContentPage Title="Les stars, musiciens, chanteurs DJ">
|
||||||
<StackLayout Orientation="Horizontal">
|
<StackLayout Orientation="Horizontal">
|
||||||
<Editor HorizontalOptions="FillAndExpand"/>
|
<Editor HorizontalOptions="FillAndExpand"/>
|
||||||
<Button HorizontalOptions="End" />
|
<Button HorizontalOptions="End" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
<StackLayout Orientation="Horizontal">
|
<StackLayout Orientation="Horizontal" VerticalOptions="Start">
|
||||||
<Label Text="{x:Static local:Strings.GeographicalyNear}" />
|
<Label Text="{x:Static local:Strings.GeographicalyNear}" />
|
||||||
<Switch HorizontalOptions="End" IsToggled="{Binding ByLocation, Mode=TwoWay}" />
|
<Switch HorizontalOptions="End" VerticalOptions="Start"
|
||||||
|
IsToggled="{Binding ByLocation, Mode=TwoWay}" />
|
||||||
|
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
<ContentPage Title="">
|
<ContentPage Title="Les formations musicales">
|
||||||
<StackLayout Orientation="Horizontal">
|
<StackLayout Orientation="Horizontal">
|
||||||
<Editor HorizontalOptions="FillAndExpand"/>
|
<Editor HorizontalOptions="FillAndExpand"/>
|
||||||
<Button HorizontalOptions="End" />
|
<Button HorizontalOptions="End" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
</TabbedPage.Children>
|
</TabbedPage.Children>
|
||||||
</TabbedPage>
|
</TabbedPage>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
les derniers sons/videos/articles postés
|
les derniers sons/videos/articles postés
|
||||||
<TabbedPage.Children>
|
<TabbedPage.Children>
|
||||||
<ContentPage Title="Blogspot">
|
<ContentPage Title="Blogspot">
|
||||||
|
|
@ -52,61 +54,64 @@
|
||||||
</TabbedPage.Children>
|
</TabbedPage.Children>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Les demandes devis en attente de réponse (pro)
|
Les demandes devis en attente de réponse (pro)
|
||||||
-->
|
-->
|
||||||
<ContentPage Title="Demandes de devis" BindingContext="{Binding BookQueries}"
|
<ContentPage Title="Demandes de devis"
|
||||||
IsVisible="{BindingContext UserProfile.IsAPerformer}">
|
IsVisible="{Binding UserProfile.IsAPerformer}">
|
||||||
<ListView x:Name="querylist"
|
<StackLayout BindingContext="{Binding BookQueries}">
|
||||||
RefreshCommand="{Binding RefreshQueries}"
|
|
||||||
IsPullToRefreshEnabled="True"
|
<ListView x:Name="querylist"
|
||||||
ItemsSource="{Binding Queries}"
|
RefreshCommand="{Binding RefreshQueries}"
|
||||||
ItemTapped="OnViewBookQueryDetail"
|
IsPullToRefreshEnabled="True"
|
||||||
HasUnevenRows="true"
|
ItemsSource="{Binding Queries}"
|
||||||
SeparatorVisibility="Default"
|
ItemTapped="OnViewBookQueryDetail"
|
||||||
SeparatorColor="Black">
|
HasUnevenRows="true"
|
||||||
<ListView.ItemTemplate VerticalOptions="StartAndExpand" >
|
SeparatorVisibility="Default"
|
||||||
<DataTemplate>
|
SeparatorColor="Black">
|
||||||
<ViewCell>
|
<ListView.ItemTemplate VerticalOptions="StartAndExpand" >
|
||||||
<ViewCell.View>
|
<DataTemplate>
|
||||||
<Grid>
|
<ViewCell>
|
||||||
<Grid.RowDefinitions>
|
<ViewCell.View>
|
||||||
<RowDefinition Height="*" />
|
<Grid>
|
||||||
<RowDefinition Height="*" />
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
<RowDefinition Height="*" />
|
||||||
<Grid.ColumnDefinitions>
|
<RowDefinition Height="*" />
|
||||||
<ColumnDefinition Width="*" />
|
</Grid.RowDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<Grid.ColumnDefinitions>
|
||||||
</Grid.ColumnDefinitions>
|
<ColumnDefinition Width="*" />
|
||||||
<Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="4" Source="{Binding Avatar}" />
|
<ColumnDefinition Width="*" />
|
||||||
<Label Grid.Row="0" Grid.Column="1" Text="{Binding Client.UserName}" Style="{StaticResource LabelStyle}"></Label>
|
</Grid.ColumnDefinitions>
|
||||||
<Label Grid.Row="1" Grid.Column="1" Text="{Binding Data.Reason}"></Label>
|
<Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="4" Source="{Binding Avatar}" />
|
||||||
<Label Grid.Row="2" Grid.Column="1" LineBreakMode="WordWrap" Text="{Binding EventDate, StringFormat='{0:dddd d MMMM à HH:mm}'}" FontFamily="Italic"/>
|
<Label Grid.Row="0" Grid.Column="1" Text="{Binding Client.UserName}" Style="{StaticResource LabelStyle}"></Label>
|
||||||
<Label Grid.Row="3" Grid.Column="1" LineBreakMode="WordWrap" Text="{Binding Location.Address}" />
|
<Label Grid.Row="1" Grid.Column="1" Text="{Binding Data.Reason}"></Label>
|
||||||
</Grid>
|
<Label Grid.Row="2" Grid.Column="1" LineBreakMode="WordWrap" Text="{Binding EventDate, StringFormat='{0:dddd d MMMM à HH:mm}'}" FontFamily="Italic"/>
|
||||||
</ViewCell.View>
|
<Label Grid.Row="3" Grid.Column="1" LineBreakMode="WordWrap" Text="{Binding Location.Address}" />
|
||||||
</ViewCell>
|
</Grid>
|
||||||
</DataTemplate>
|
</ViewCell.View>
|
||||||
</ListView.ItemTemplate>
|
</ViewCell>
|
||||||
</ListView>
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
</ListView>
|
||||||
|
</StackLayout>
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
|
|
||||||
|
|
||||||
<!-- Les signatures de contrat en souffreances (pro) -->
|
<!-- Les signatures de contrat en souffreances (pro) -->
|
||||||
<ContentPage Title="Contrats à signer" IsVisible="{BindingContext UserProfile.IsAPerformer}">
|
<ContentPage Title="Contrats à signer" IsVisible="{Binding UserProfile.IsAPerformer}">
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
|
|
||||||
<!-- Les annonces pro (pro) -->
|
<!-- Les annonces pro (pro) -->
|
||||||
<ContentPage Title="Annonces pro" IsVisible="{BindingContext UserProfile.IsAPerformer}">
|
<ContentPage Title="Annonces pro" IsVisible="{Binding UserProfile.IsAPerformer}">
|
||||||
<StackLayout Orientation="Horizontal" >
|
<StackLayout Orientation="Horizontal" >
|
||||||
<Editor x:Name="search_pub_pro_phrase" HorizontalOptions="FillAndExpand"/>
|
<Editor x:Name="search_pub_pro_phrase" HorizontalOptions="FillAndExpand"/>
|
||||||
<Button x:Name="btn_pro_pub" HorizontalOptions="End" />
|
<Button x:Name="btn_pro_pub" HorizontalOptions="End" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
|
|
||||||
<!-- les petites annonces des clients (pro) -->
|
<!-- les petites annonces des clients (pro) -->
|
||||||
<ContentPage Title="Annonces client" Icon="" IsVisible="{BindingContext UserProfile.IsAPerformer}">
|
<ContentPage Title="Annonces client" Icon="" IsVisible="{Binding UserProfile.IsAPerformer}">
|
||||||
<StackLayout Orientation="Horizontal" >
|
<StackLayout Orientation="Horizontal" >
|
||||||
<Editor x:Name="search_pub_cli_phrase" HorizontalOptions="FillAndExpand"/>
|
<Editor x:Name="search_pub_cli_phrase" HorizontalOptions="FillAndExpand"/>
|
||||||
<Button x:Name="btn_cli_pub" HorizontalOptions="End" />
|
<Button x:Name="btn_cli_pub" HorizontalOptions="End" />
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,11 @@ namespace BookAStar.Pages
|
||||||
|
|
||||||
protected override void OnBindingContextChanged()
|
protected override void OnBindingContextChanged()
|
||||||
{
|
{
|
||||||
base.OnBindingContextChanged();
|
// this technique make this view model
|
||||||
|
// non-sharable between view or pages
|
||||||
if (Model != null)
|
if (Model != null)
|
||||||
{
|
{
|
||||||
|
// set the refresh command before using it
|
||||||
Model.BookQueries.RefreshQueries =
|
Model.BookQueries.RefreshQueries =
|
||||||
new Command(() =>
|
new Command(() =>
|
||||||
{
|
{
|
||||||
|
|
@ -39,6 +41,9 @@ namespace BookAStar.Pages
|
||||||
this.querylist.EndRefresh();
|
this.querylist.EndRefresh();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// Use the new refresh command
|
||||||
|
base.OnBindingContextChanged();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnViewBookQueryDetail(object sender, ItemTappedEventArgs e)
|
private void OnViewBookQueryDetail(object sender, ItemTappedEventArgs e)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
// Helpers/Settings.cs
|
// Helpers/Settings.cs
|
||||||
using BookAStar.Model;
|
|
||||||
using BookAStar.Model.Auth.Account;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Plugin.Settings;
|
using Plugin.Settings;
|
||||||
using Plugin.Settings.Abstractions;
|
using Plugin.Settings.Abstractions;
|
||||||
|
|
@ -8,11 +6,12 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Xamarin.Forms;
|
|
||||||
|
|
||||||
namespace BookAStar
|
namespace BookAStar
|
||||||
{
|
{
|
||||||
|
using Model.Social;
|
||||||
|
using Model.Auth.Account;
|
||||||
|
using Data;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is the Settings static class that can be used in your Core solution or in any
|
/// This is the Settings static class that can be used in your Core solution or in any
|
||||||
|
|
@ -75,23 +74,13 @@ namespace BookAStar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public const string bookQueryNotificationsKey = "BookQueryNotifications";
|
public const string bookQueryNotificationsKey = "BookQueryNotifications";
|
||||||
public static BookQueryData[] GetBookQueryNotifications()
|
public static BookQuery[] GetBookQueryNotifications()
|
||||||
{
|
{
|
||||||
// Do not return any null List
|
// Do not return any null List
|
||||||
var json = AppSettings.GetValueOrDefault<string>(bookQueryNotificationsKey);
|
var json = AppSettings.GetValueOrDefault<string>(bookQueryNotificationsKey);
|
||||||
if (!string.IsNullOrWhiteSpace(json))
|
if (!string.IsNullOrWhiteSpace(json))
|
||||||
return JsonConvert.DeserializeObject<BookQueryData[]>(json);
|
return JsonConvert.DeserializeObject<BookQuery[]>(json);
|
||||||
return new BookQueryData[] { };
|
return new BookQuery[] { };
|
||||||
}
|
|
||||||
|
|
||||||
public static BookQueryData[] AddBookQueryNotification(BookQueryData query)
|
|
||||||
{
|
|
||||||
var existing = new List<BookQueryData>(GetBookQueryNotifications());
|
|
||||||
existing.Add(query);
|
|
||||||
var result = existing.ToArray();
|
|
||||||
AppSettings.AddOrUpdateValue(bookQueryNotificationsKey,
|
|
||||||
JsonConvert.SerializeObject(result));
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GoogleRegId
|
public static string GoogleRegId
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace BookAStar.ViewModels.EstimateAndBilling
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
public BookQueryViewModel(BookQueryData data)
|
public BookQueryViewModel(BookQuery data)
|
||||||
{
|
{
|
||||||
Debug.Assert(data != null);
|
Debug.Assert(data != null);
|
||||||
Client=data.Client;
|
Client=data.Client;
|
||||||
|
|
@ -35,8 +35,8 @@ namespace BookAStar.ViewModels.EstimateAndBilling
|
||||||
));
|
));
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
private BookQueryData data;
|
private BookQuery data;
|
||||||
public BookQueryData Data {
|
public BookQuery Data {
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return data;
|
return data;
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using BookAStar.Model.Workflow;
|
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using BookAStar.Model;
|
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using BookAStar.Data;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using BookAStar.ViewModels.Validation;
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
|
||||||
namespace BookAStar.ViewModels.EstimateAndBilling
|
namespace BookAStar.ViewModels.EstimateAndBilling
|
||||||
{
|
{
|
||||||
|
using Model;
|
||||||
|
using Model.Workflow;
|
||||||
|
using Model.Social;
|
||||||
|
using Validation;
|
||||||
public class EditEstimateViewModel : EditingViewModel<Estimate>
|
public class EditEstimateViewModel : EditingViewModel<Estimate>
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -129,7 +129,7 @@ namespace BookAStar.ViewModels.EstimateAndBilling
|
||||||
public ClientProviderInfo Client { get { return Data.Client; } }
|
public ClientProviderInfo Client { get { return Data.Client; } }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public BookQueryData Query { get { return Data.Query; } }
|
public BookQuery Query { get { return Data.Query; } }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public FormattedString FormattedTotal
|
public FormattedString FormattedTotal
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,10 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using XLabs.Forms.Mvvm;
|
using XLabs.Forms.Mvvm;
|
||||||
|
|
||||||
namespace BookAStar.ViewModels.Searching
|
namespace BookAStar.ViewModels.Searching
|
||||||
{
|
{
|
||||||
class SearchingAnArtistViewModel: ViewModel
|
class SearchingAnArtistViewModel: ViewModel
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue