From 7a37ff3f2d28fe31fc16105fce4dbfeb9078f624 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 9 Mar 2017 15:11:10 +0100 Subject: [PATCH 01/23] to see the activity picture, at first launch --- ZicMoove/ZicMoove.Droid/MainActivity.cs | 6 +++--- ZicMoove/ZicMoove/Model/Workflow/Activity.cs | 12 +++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ZicMoove/ZicMoove.Droid/MainActivity.cs b/ZicMoove/ZicMoove.Droid/MainActivity.cs index c5e81e86..e14e5f85 100644 --- a/ZicMoove/ZicMoove.Droid/MainActivity.cs +++ b/ZicMoove/ZicMoove.Droid/MainActivity.cs @@ -541,11 +541,11 @@ namespace ZicMoove.Droid } } } - + var acode = photo[1]; + var act = DataManager.Instance.Activities.LocalGet(acode); + act.LocalPhoto = Path.Combine(images, $"{acode}.svg"); } } - foreach (var act in DataManager.Instance.Activities) - { act.LocalPhoto = Path.Combine(images, $"{act.Code}.svg"); } DataManager.Instance.Activities.SaveEntity(); } } diff --git a/ZicMoove/ZicMoove/Model/Workflow/Activity.cs b/ZicMoove/ZicMoove/Model/Workflow/Activity.cs index 39149d20..d509c6f6 100644 --- a/ZicMoove/ZicMoove/Model/Workflow/Activity.cs +++ b/ZicMoove/ZicMoove/Model/Workflow/Activity.cs @@ -1,10 +1,11 @@ using Newtonsoft.Json; using System; -using YavscLib; +using XLabs.Forms.Mvvm; namespace ZicMoove.Model.Workflow { - public class Activity : IActivity + using YavscLib; + public class Activity : ViewModel, IActivity { public string Code { @@ -74,6 +75,11 @@ namespace ZicMoove.Model.Workflow get; set; } - public string LocalPhoto { get; set; } + private string photo; + + public string LocalPhoto { + get { return photo; } + set { SetProperty(ref photo, value); + } } } } From 60a529133dc424d11690cbdae2e62277a3fb0490 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 9 Mar 2017 15:15:45 +0100 Subject: [PATCH 02/23] building under Win$ --- YavscLib/YavscLib.csproj | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/YavscLib/YavscLib.csproj b/YavscLib/YavscLib.csproj index e1d6d593..68fc7847 100644 --- a/YavscLib/YavscLib.csproj +++ b/YavscLib/YavscLib.csproj @@ -73,20 +73,29 @@ MinimumRecommendedRules.ruleset - - - + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -97,8 +106,6 @@ - - From 9b0f867950d60f6ae14ec2dec5e03d283307003a Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 9 Mar 2017 15:16:37 +0100 Subject: [PATCH 03/23] gives a command type to the estimate --- .../ZicMoove.Droid/Services/GCMHandlers/EstimateGCMHandler.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ZicMoove/ZicMoove.Droid/Services/GCMHandlers/EstimateGCMHandler.cs b/ZicMoove/ZicMoove.Droid/Services/GCMHandlers/EstimateGCMHandler.cs index dc3826fd..3beef9f4 100644 --- a/ZicMoove/ZicMoove.Droid/Services/GCMHandlers/EstimateGCMHandler.cs +++ b/ZicMoove/ZicMoove.Droid/Services/GCMHandlers/EstimateGCMHandler.cs @@ -37,7 +37,8 @@ namespace ZicMoove.Droid.Services.GCMHandlers var client = JsonConvert.DeserializeObject(clientJson); var estimate = new Estimate { - Id = eid + Id = eid, + CommandType = data.GetString("CommandType") }; var dateString = data.GetString("ProviderValidationDate"); DateTime evDate; From 58f61cf8e33ef83d4c51889e64ed621a655cd57c Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 9 Mar 2017 15:18:07 +0100 Subject: [PATCH 04/23] fixes error handling --- ZicMoove/ZicMoove/Data/RemoteEntity.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ZicMoove/ZicMoove/Data/RemoteEntity.cs b/ZicMoove/ZicMoove/Data/RemoteEntity.cs index 2230eaec..f67de444 100644 --- a/ZicMoove/ZicMoove/Data/RemoteEntity.cs +++ b/ZicMoove/ZicMoove/Data/RemoteEntity.cs @@ -142,9 +142,10 @@ namespace ZicMoove.Data created = response.IsSuccessStatusCode; if (!created) { + // TODO throw custom exception, and catch to inform user var errcontent = await response.Content.ReadAsStringAsync(); - Debug.WriteLine(string.Format(Strings.CreationFailed)); + Debug.WriteLine(string.Format(Strings.CreationFailed,stringContent,ControllerUri.AbsoluteUri)); Debug.WriteLine(errcontent); } else From 287538b615fb057787effc84db6a7a104a9a6073 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 9 Mar 2017 15:20:05 +0100 Subject: [PATCH 05/23] ces interfaces appartiennent au serveur --- ZicMoove/ZicMoove/Interfaces/IBillingLine.cs | 12 ------------ ZicMoove/ZicMoove/Interfaces/IEstimate.cs | 19 ------------------- 2 files changed, 31 deletions(-) delete mode 100644 ZicMoove/ZicMoove/Interfaces/IBillingLine.cs delete mode 100644 ZicMoove/ZicMoove/Interfaces/IEstimate.cs diff --git a/ZicMoove/ZicMoove/Interfaces/IBillingLine.cs b/ZicMoove/ZicMoove/Interfaces/IBillingLine.cs deleted file mode 100644 index 3eb4b7e2..00000000 --- a/ZicMoove/ZicMoove/Interfaces/IBillingLine.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace ZicMoove.Interfaces -{ - public interface IBillingLine - { - int Count { get; set; } - string Description { get; set; } - TimeSpan Duration { get; set; } - decimal UnitaryCost { get; set; } - } -} \ No newline at end of file diff --git a/ZicMoove/ZicMoove/Interfaces/IEstimate.cs b/ZicMoove/ZicMoove/Interfaces/IEstimate.cs deleted file mode 100644 index d8c370eb..00000000 --- a/ZicMoove/ZicMoove/Interfaces/IEstimate.cs +++ /dev/null @@ -1,19 +0,0 @@ -using ZicMoove.Model.Workflow; -using System.Collections.Generic; - -namespace ZicMoove.Model.Interfaces -{ - public interface IEstimate - { - List AttachedFiles { get; set; } - List AttachedGraphics { get; } - List Bill { get; set; } - string ClientId { get; set; } - long? CommandId { get; set; } - string CommandType { get; set; } - string Description { get; set; } - long Id { get; set; } - string OwnerId { get; set; } - string Title { get; set; } - } -} \ No newline at end of file From b445237637dd7fed55bba9f08658ec43fdff1777 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 9 Mar 2017 15:20:43 +0100 Subject: [PATCH 06/23] du a la modif serveur --- ZicMoove/ZicMoove/Model/Workflow/CommandForm.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZicMoove/ZicMoove/Model/Workflow/CommandForm.cs b/ZicMoove/ZicMoove/Model/Workflow/CommandForm.cs index cdc87566..c686a15b 100644 --- a/ZicMoove/ZicMoove/Model/Workflow/CommandForm.cs +++ b/ZicMoove/ZicMoove/Model/Workflow/CommandForm.cs @@ -9,7 +9,7 @@ namespace ZicMoove.Model.Workflow { public class CommandForm : ICommandForm { - public string Action + public string ActionName { get; set; } From 907fcdfb6ce8d9c980be9d28c34856e87cafad52 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 9 Mar 2017 15:21:41 +0100 Subject: [PATCH 07/23] format du code --- ZicMoove/ZicMoove/Model/Workflow/Estimate.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ZicMoove/ZicMoove/Model/Workflow/Estimate.cs b/ZicMoove/ZicMoove/Model/Workflow/Estimate.cs index aa055fcb..d998cac2 100644 --- a/ZicMoove/ZicMoove/Model/Workflow/Estimate.cs +++ b/ZicMoove/ZicMoove/Model/Workflow/Estimate.cs @@ -7,9 +7,9 @@ using System.Linq; namespace ZicMoove.Model.Workflow { using Data; - using Interfaces; using Musical; - using Social; + using YavscLib.Workflow; + public partial class Estimate : IEstimate { public long Id { get; set; } From a0b9a47f1a63262280817745cf3941a4fe575df8 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 9 Mar 2017 15:23:23 +0100 Subject: [PATCH 08/23] =?UTF-8?q?impl=C3=A9mente=20l'interface=20serveur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ZicMoove/Pages/EstimatePages/BillingLine.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ZicMoove/ZicMoove/Pages/EstimatePages/BillingLine.cs b/ZicMoove/ZicMoove/Pages/EstimatePages/BillingLine.cs index 4cdd632a..be15cc3a 100644 --- a/ZicMoove/ZicMoove/Pages/EstimatePages/BillingLine.cs +++ b/ZicMoove/ZicMoove/Pages/EstimatePages/BillingLine.cs @@ -1,15 +1,20 @@ - -using ZicMoove.Interfaces; -using System; +using System; namespace ZicMoove.Model.Workflow { - public class BillingLine : IBillingLine + using YavscLib.Billing; + public class BillingLine : ICommandLine { public long Id { get; set; } + public string Description { get; set; } + public TimeSpan Duration { get; set; } + public int Count { get; set; } = 1; + public decimal UnitaryCost { get; set; } + + public long EstimateId { get; set; } } } From 88c8480c80148b2496b3393b32714fefe8e85724 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 9 Mar 2017 15:24:18 +0100 Subject: [PATCH 09/23] =?UTF-8?q?donne=20un=20type=20de=20commande=20?= =?UTF-8?q?=C3=A0=20l'estimation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZicMoove/ZicMoove/Pages/EstimatePages/BookQueryPage.xaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ZicMoove/ZicMoove/Pages/EstimatePages/BookQueryPage.xaml.cs b/ZicMoove/ZicMoove/Pages/EstimatePages/BookQueryPage.xaml.cs index 184ff4ca..8243136d 100644 --- a/ZicMoove/ZicMoove/Pages/EstimatePages/BookQueryPage.xaml.cs +++ b/ZicMoove/ZicMoove/Pages/EstimatePages/BookQueryPage.xaml.cs @@ -79,6 +79,7 @@ namespace ZicMoove.Pages ClientId = BookQuery.Client.UserId, CommandId = BookQuery.Id, OwnerId = MainSettings.CurrentUser.Id, + CommandType = "RdvQuery", Id = 0 }); DataManager.Instance.EstimationCache.Add(editEstimateViewModel); From 30a3f67c323b10150ed5fe224b5f8c9fb60058a2 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 9 Mar 2017 15:24:39 +0100 Subject: [PATCH 10/23] =?UTF-8?q?code=20simplifi=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/EstimatePages/EditBillingLinePage.xaml.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ZicMoove/ZicMoove/Pages/EstimatePages/EditBillingLinePage.xaml.cs b/ZicMoove/ZicMoove/Pages/EstimatePages/EditBillingLinePage.xaml.cs index 0e77d7ff..c4c29a81 100644 --- a/ZicMoove/ZicMoove/Pages/EstimatePages/EditBillingLinePage.xaml.cs +++ b/ZicMoove/ZicMoove/Pages/EstimatePages/EditBillingLinePage.xaml.cs @@ -15,12 +15,6 @@ namespace ZicMoove.Pages InitializeComponent(); foreach (string du in Enum.GetNames(typeof(BillingLineViewModel.DurationUnits))) picker.Items.Add(du); - BindingContext = new BillingLineViewModel(new BillingLine()); - } - - public EditBillingLinePage() - { - Initialize(); } public EditBillingLinePage(BillingLineViewModel model) From 8c98046d52714d3c57432e629e6fa1c981dff4a9 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 9 Mar 2017 15:25:47 +0100 Subject: [PATCH 11/23] =?UTF-8?q?fixe=20l'id=20estimation=20=C3=A0=20la=20?= =?UTF-8?q?cr=C3=A9ation=20d'une=20ligne=20de=20commande?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ZicMoove/Pages/EstimatePages/EditEstimatePage.xaml.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ZicMoove/ZicMoove/Pages/EstimatePages/EditEstimatePage.xaml.cs b/ZicMoove/ZicMoove/Pages/EstimatePages/EditEstimatePage.xaml.cs index 286cb981..940d6209 100644 --- a/ZicMoove/ZicMoove/Pages/EstimatePages/EditEstimatePage.xaml.cs +++ b/ZicMoove/ZicMoove/Pages/EstimatePages/EditEstimatePage.xaml.cs @@ -54,8 +54,9 @@ namespace ZicMoove.Pages protected void OnNewCommanLine(object sender, EventArgs e) { - var com = new BillingLine() { Count = 1, UnitaryCost = 0.01m }; - var bill = ((EditEstimateViewModel)BindingContext).Bill; + var model = (EditEstimateViewModel)BindingContext; + var com = new BillingLine() { Count = 1, UnitaryCost = 0.01m, EstimateId = model.Data.Id }; + var bill = model.Bill; var lineView = new BillingLineViewModel(com) { ValidateCommand = new Command(() => { bill.Add(new BillingLineViewModel(com)); From 1afdcbfbd112450fa13022fc4526a3483d840a43 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 9 Mar 2017 15:27:16 +0100 Subject: [PATCH 12/23] =?UTF-8?q?fixe=20le=20message=20de=20debug=20=C3=A0?= =?UTF-8?q?=20l'echec=20=C3=A0=20la=20creation=20estimation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZicMoove/ZicMoove/Strings.Designer.cs | 2 +- ZicMoove/ZicMoove/Strings.resx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ZicMoove/ZicMoove/Strings.Designer.cs b/ZicMoove/ZicMoove/Strings.Designer.cs index ba17da42..f8393c8c 100644 --- a/ZicMoove/ZicMoove/Strings.Designer.cs +++ b/ZicMoove/ZicMoove/Strings.Designer.cs @@ -125,7 +125,7 @@ namespace ZicMoove { } /// - /// Recherche une chaîne localisée semblable à La création a échoué, contenu envoyé: {stringContent} @ Uri: {ControllerUri.AbsoluteUri}: Erreur : {errcontent}. + /// Recherche une chaîne localisée semblable à La création a échoué, contenu envoyé: {0} @ Uri: {1}. /// public static string CreationFailed { get { diff --git a/ZicMoove/ZicMoove/Strings.resx b/ZicMoove/ZicMoove/Strings.resx index 764e7615..3722e32f 100644 --- a/ZicMoove/ZicMoove/Strings.resx +++ b/ZicMoove/ZicMoove/Strings.resx @@ -124,7 +124,7 @@ Annuler la validation - La création a échoué, contenu envoyé: {stringContent} @ Uri: {ControllerUri.AbsoluteUri}: Erreur : {errcontent} + La création a échoué, contenu envoyé: {0} @ Uri: {1} Faire un devis From 0e99756577f03d2e6463638be77cc071fe217d94 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 9 Mar 2017 15:28:05 +0100 Subject: [PATCH 13/23] implemente un id commande de la vue sur ligne de commande --- .../BillingLineViewModel.cs | 39 ++++++++++++++++--- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/ZicMoove/ZicMoove/ViewModels/EstimateAndBilling/BillingLineViewModel.cs b/ZicMoove/ZicMoove/ViewModels/EstimateAndBilling/BillingLineViewModel.cs index 8e284105..0c511a9f 100644 --- a/ZicMoove/ZicMoove/ViewModels/EstimateAndBilling/BillingLineViewModel.cs +++ b/ZicMoove/ZicMoove/ViewModels/EstimateAndBilling/BillingLineViewModel.cs @@ -1,15 +1,16 @@ -using ZicMoove.Attributes; -using ZicMoove.Interfaces; -using ZicMoove.Model.Workflow; -using ZicMoove.ViewModels.Validation; + using System; using System.Globalization; using System.Windows.Input; using System.ComponentModel; +using YavscLib.Billing; namespace ZicMoove.ViewModels.EstimateAndBilling { - public class BillingLineViewModel : EditingViewModel, IBillingLine + using Attributes; + using Model.Workflow; + using Validation; + public class BillingLineViewModel : EditingViewModel, ICommandLine { public ICommand RemoveCommand { get; set; } public ICommand ValidateCommand { set; get; } @@ -67,6 +68,34 @@ namespace ZicMoove.ViewModels.EstimateAndBilling Data.Count = count; } } + private long estimateId; + public long EstimateId + { + get + { + return estimateId; + } + set + { + SetProperty(ref estimateId, value); + Data.EstimateId = estimateId; + } + } + + private long id; + public long Id + { + get + { + return id; + } + set + { + SetProperty(ref id, value); + Data.Id = id; + } + } + private string description; public string Description { From 800ed3602387fe987ce5ee15b7d7a091a6686886 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 9 Mar 2017 15:28:45 +0100 Subject: [PATCH 14/23] =?UTF-8?q?supprime=20deux=20references=20=C3=A0=20d?= =?UTF-8?q?eux=20interfaces=20obsoletes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZicMoove/ZicMoove/ZicMoove.csproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/ZicMoove/ZicMoove/ZicMoove.csproj b/ZicMoove/ZicMoove/ZicMoove.csproj index 68fdc862..d4b228d4 100644 --- a/ZicMoove/ZicMoove/ZicMoove.csproj +++ b/ZicMoove/ZicMoove/ZicMoove.csproj @@ -185,8 +185,6 @@ - - BookQueriesPage.xaml From 11a64f5bf012df86be7ea2035423bb1c56d42b2b Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 9 Mar 2017 15:29:03 +0100 Subject: [PATCH 15/23] Nom de l'action: ActionName --- ZicMoove/ZicMoove/Pages/ClientPages/ActivityPage.xaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ZicMoove/ZicMoove/Pages/ClientPages/ActivityPage.xaml b/ZicMoove/ZicMoove/Pages/ClientPages/ActivityPage.xaml index cfb658e5..bac0aa7b 100644 --- a/ZicMoove/ZicMoove/Pages/ClientPages/ActivityPage.xaml +++ b/ZicMoove/ZicMoove/Pages/ClientPages/ActivityPage.xaml @@ -3,8 +3,13 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="ZicMoove.Pages.ClientPages.ActivityPage" xmlns:local="clr-namespace:ZicMoove;assembly=ZicMoove" - xmlns:views="clr-namespace:ZicMoove.Views;assembly=ZicMoove" + xmlns:views="clr-namespace:ZicMoove.Views;assembly=ZicMoove" + xmlns:converters="clr-namespace:ZicMoove.Converters;assembly=ZicMoove" > + + + + @@ -30,7 +35,7 @@ -