perparing the client signature from the same page

main
Paul Schneider 9 years ago
parent d58a05fff3
commit b7f54078dd
8 changed files with 42 additions and 22 deletions

@ -63,7 +63,7 @@
<Setter Property="HorizontalOptions" Value="FillAndExpand" /> <Setter Property="HorizontalOptions" Value="FillAndExpand" />
</Style> </Style>
<Style x:Key="BigLabel" BasedOn="{StaticResource LabelStyle}" TargetType="Label"> <Style x:Key="BigLabelStyle" BasedOn="{StaticResource LabelStyle}" TargetType="Label">
<Setter Property="FontSize" Value="Large" /> <Setter Property="FontSize" Value="Large" />
</Style> </Style>
<Style x:Key="ContentLabelStyle" BasedOn="{StaticResource LabelStyle}" TargetType="Label"> <Style x:Key="ContentLabelStyle" BasedOn="{StaticResource LabelStyle}" TargetType="Label">

@ -29,6 +29,8 @@
internal LocalEntity<BillingLine, string> EstimateLinesTemplates { get; set; } internal LocalEntity<BillingLine, string> EstimateLinesTemplates { get; set; }
internal LocalEntity<ChatMessage, int> PrivateMessages { get; set; } internal LocalEntity<ChatMessage, int> PrivateMessages { get; set; }
internal LocalEntity<PageState, int> AppState { get; set; } internal LocalEntity<PageState, int> AppState { get; set; }
internal LocalEntity<string,string> ClientSignatures { get; set; }
internal LocalEntity<string, string> ProviderSignatures { get; set; }
protected static DataManager instance = new DataManager(); protected static DataManager instance = new DataManager();

@ -9,7 +9,6 @@ namespace BookAStar.Model.Workflow
using Data; using Data;
using Interfaces; using Interfaces;
using Social; using Social;
public partial class Estimate : IEstimate public partial class Estimate : IEstimate
{ {
public long Id { get; set; } public long Id { get; set; }
@ -28,6 +27,7 @@ namespace BookAStar.Model.Workflow
/// <returns></returns> /// <returns></returns>
public List<string> AttachedGraphics { get; set; } public List<string> AttachedGraphics { get; set; }
[JsonIgnore] [JsonIgnore]
// form in db
public string AttachedGraphicsString public string AttachedGraphicsString
{ {
get { return AttachedGraphics==null?null:string.Join(":", AttachedGraphics); } get { return AttachedGraphics==null?null:string.Join(":", AttachedGraphics); }
@ -41,6 +41,7 @@ namespace BookAStar.Model.Workflow
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public List<string> AttachedFiles { get; set; } public List<string> AttachedFiles { get; set; }
// form in db
[JsonIgnore] [JsonIgnore]
public string AttachedFilesString public string AttachedFilesString
{ {
@ -92,12 +93,12 @@ namespace BookAStar.Model.Workflow
} }
} }
/// <summary> /// <summary>
/// This validation comes from the provider. /// This validation comes first from the provider.
/// As long as it's an estimate, no client validation
/// is formaly needed
/// </summary> /// </summary>
public DateTime ProviderValidationDate { get; set; } public DateTime ProviderValidationDate { get; set; }
/// <summary>
/// Date for the agreement from the client
/// </summary>
public DateTime ClientApprouvalDate { get; set; } public DateTime ClientApprouvalDate { get; set; }
} }

@ -102,7 +102,7 @@
<behaviors:DecimalValidatorBehavior x:Name="unitCostValidator" /> <behaviors:DecimalValidatorBehavior x:Name="unitCostValidator" />
</Entry.Behaviors> </Entry.Behaviors>
</Entry> </Entry>
<Label Text="€" Style="{StaticResource BigLabel}" /> <Label Text="€" Style="{StaticResource BigLabelStyle}" />
<Image x:Name="unitaryCostSuccessErrorImage" <Image x:Name="unitaryCostSuccessErrorImage"
Style="{Binding Source={x:Reference unitCostValidator}, Style="{Binding Source={x:Reference unitCostValidator},
Path=IsValid, Path=IsValid,

@ -5,7 +5,16 @@
xmlns:views="clr-namespace:BookAStar.Views;assembly=BookAStar" xmlns:views="clr-namespace:BookAStar.Views;assembly=BookAStar"
x:Class="BookAStar.Pages.EstimatePages.EstimateSigningPage"> x:Class="BookAStar.Pages.EstimatePages.EstimateSigningPage">
<ContentPage.Resources>
<ResourceDictionary>
<Style TargetType="Label">
<Setter Property="Style" Value="{StaticResource ContentLabelStyle}" />
</Style>
<Style TargetType="Button">
<Setter Property="Style" Value="{StaticResource ButtonStyle}" />
</Style>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content> <ContentPage.Content>
<StackLayout Padding="10,10,10,10" x:Name="mainLayout"> <StackLayout Padding="10,10,10,10" x:Name="mainLayout">
<ScrollView> <ScrollView>
@ -24,7 +33,7 @@
<Label Grid.Row="0" Grid.Column="2" Text="{Binding Query.EventDate, StringFormat='{0:dddd d MMMM yyyy à hh:mm}'}" ></Label> <Label Grid.Row="0" Grid.Column="2" Text="{Binding Query.EventDate, StringFormat='{0:dddd d MMMM yyyy à hh:mm}'}" ></Label>
</Grid> </Grid>
<Label Text="{Binding Title}" /> <Label Text="{Binding Title}" Style="{StaticResource BigLabelStyle}" />
<views:MarkdownView x:Name="mdview" <views:MarkdownView x:Name="mdview"
HorizontalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"
@ -63,13 +72,17 @@
</ListView.ItemTemplate> </ListView.ItemTemplate>
</ListView> </ListView>
<Label FormattedText="{Binding FormattedTotal}"/> <Label FormattedText="{Binding FormattedTotal}"/>
<StackLayout Orientation="Horizontal">
<Image Source="{Binding ProSignImage}" HorizontalOptions="Start"></Image>
<Image Source="{Binding CliSignImage}" HorizontalOptions="End"></Image>
</StackLayout>
</StackLayout> </StackLayout>
</ScrollView> </ScrollView>
<signature:SignaturePadView x:Name="padView" <signature:SignaturePadView x:Name="padView"
VerticalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"
BackgroundColor="White" BackgroundColor="White"
CaptionText="Caption This" CaptionTextColor="Black" CaptionText="{Binding Data.Owner.UserName}" CaptionTextColor="Black"
ClearText="Effacer!" ClearTextColor="Red" ClearText="Effacer!" ClearTextColor="Red"
PromptText="Prompt Here" PromptTextColor="Red" PromptText="Prompt Here" PromptTextColor="Red"
SignatureLineColor="Aqua" StrokeColor="Black" StrokeWidth="2" /> SignatureLineColor="Aqua" StrokeColor="Black" StrokeWidth="2" />

@ -41,17 +41,7 @@ namespace BookAStar.Pages.EstimatePages
ParentValidationCommand.Execute(true); ParentValidationCommand.Execute(true);
} }
private async void OnGetStats(object sender, EventArgs e)
{
var points = padView.Points.ToArray();
using (var image = await padView.GetImageStreamAsync(SignatureImageFormat.Png))
{
var pointCount = points.Count();
var imageSize = image.Length / 1000;
var linesCount = points.Count(p => p == Point.Zero) + (points.Length > 0 ? 1 : 0);
await DisplayAlert("Stats", $"The signature has {linesCount} lines or {pointCount} points, and is {imageSize:#,###.0}KB (in memory) when saved as a PNG.", "Cool");
}
}
private async void OnChangeTheme(object sender, EventArgs e) private async void OnChangeTheme(object sender, EventArgs e)
{ {
var action = await DisplayActionSheet("Change Theme", "Cancel", null, "White", "Black", "Aqua"); var action = await DisplayActionSheet("Change Theme", "Cancel", null, "White", "Black", "Aqua");

@ -50,6 +50,7 @@ namespace BookAStar.ViewModels.EstimateAndBilling
NotifyPropertyChanged("Query"); NotifyPropertyChanged("Query");
NotifyPropertyChanged("CLient"); NotifyPropertyChanged("CLient");
NotifyPropertyChanged("ModelState"); NotifyPropertyChanged("ModelState");
} }
protected override void OnPropertyChanged(PropertyChangedEventArgs e) protected override void OnPropertyChanged(PropertyChangedEventArgs e)

@ -10,5 +10,18 @@ namespace BookAStar.ViewModels.Signing
{ {
} }
public Command<bool> ValidationCommand { get; set; } public Command<bool> ValidationCommand { get; set; }
public ImageSource ProSignImage {
get
{
return new FileImageSource();
}
}
public ImageSource CliSignImage
{
get
{
return new FileImageSource();
}
}
} }
} }

Loading…