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 @@ - - diff --git a/YavscLib/project.lock.json b/YavscLib/project.lock.json index 79695a3d..2621d394 100644 --- a/YavscLib/project.lock.json +++ b/YavscLib/project.lock.json @@ -3,22 +3,20 @@ "version": 2, "targets": { ".NETFramework,Version=v4.5.1": {}, - ".NETPortable,Version=v4.5,Profile=Profile111": {}, - ".NETFramework,Version=v4.5.1/debian.8-x86": {}, - ".NETFramework,Version=v4.5.1/debian.8-x64": {}, - ".NETPortable,Version=v4.5,Profile=Profile111/debian.8-x86": {}, - ".NETPortable,Version=v4.5,Profile=Profile111/debian.8-x64": {} + ".NETPortable,Version=v4.5,Profile=Profile111": {} }, "libraries": {}, "projectFileDependencyGroups": { "": [], ".NETFramework,Version=v4.5.1": [], ".NETPortable,Version=v4.5,Profile=Profile111": [ - "fx/System.Runtime >= 4.0.0", - "fx/System.Globalization >= 4.0.0", - "fx/System.Resources.ResourceManager >= 4.0.0", - "fx/System.Collections >= 4.0.0", - "fx/System.Collections.Generic >= 4.0.0" + "System.Collections >= 4.0.0", + "System.Collections.Generic >= 4.0.0", + "System.Globalization >= 4.0.0", + "System.Resources.ResourceManager >= 4.0.0", + "System.Runtime >= 4.0.0" ] - } + }, + "tools": {}, + "projectFileToolGroups": {} } \ No newline at end of file diff --git a/ZicMoove/ZicMoove.Droid/Helpers/YavscHelpers.cs b/ZicMoove/ZicMoove.Droid/Helpers/YavscHelpers.cs index ed435de6..b6ac009a 100644 --- a/ZicMoove/ZicMoove.Droid/Helpers/YavscHelpers.cs +++ b/ZicMoove/ZicMoove.Droid/Helpers/YavscHelpers.cs @@ -6,6 +6,7 @@ using System.Net; using System.Runtime.Serialization.Json; using System.Text; using ZicMoove.Model.Auth.Account; +using System.IO; namespace ZicMoove.Droid { @@ -13,13 +14,23 @@ namespace ZicMoove.Droid public static class YavscHelpers { - public static void SetRegId(this User user, string regId) + public static string GetSpecialFolder(this string specialPath) { - if (user.YavscTokens == null) + if (specialPath == null) throw new InvalidOperationException(); - + var appData = + System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData); + string imagesFolder = System.IO.Path.Combine(appData, specialPath); + DirectoryInfo di = new DirectoryInfo(imagesFolder); + // FIXME Create this folder at app startup + if (!di.Exists) di.Create(); + return imagesFolder; + } + + public static string GetTmpDir () + { + return GetSpecialFolder("tmp"); } - } } diff --git a/ZicMoove/ZicMoove.Droid/MainActivity.cs b/ZicMoove/ZicMoove.Droid/MainActivity.cs index c5e81e86..cc4cc127 100644 --- a/ZicMoove/ZicMoove.Droid/MainActivity.cs +++ b/ZicMoove/ZicMoove.Droid/MainActivity.cs @@ -505,11 +505,7 @@ namespace ZicMoove.Droid get { if (imagesFolder != null) return imagesFolder; - var appData = - System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData); - imagesFolder = System.IO.Path.Combine(appData, Constants.ImagePath); - DirectoryInfo di = new DirectoryInfo(imagesFolder); - if (!di.Exists) di.Create(); + imagesFolder = Constants.ImagePath.GetSpecialFolder(); return imagesFolder; } } @@ -541,11 +537,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.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; diff --git a/ZicMoove/ZicMoove/App.xaml.cs b/ZicMoove/ZicMoove/App.xaml.cs index eafcafc0..8fb19cc4 100644 --- a/ZicMoove/ZicMoove/App.xaml.cs +++ b/ZicMoove/ZicMoove/App.xaml.cs @@ -195,27 +195,32 @@ namespace ZicMoove } - BookQueriesPage bQueriesPage; - AccountChooserPage accChooserPage; - ActivityPage homePage; + static BookQueriesPage bQueriesPage; + static AccountChooserPage accChooserPage; + static ActivityPage homePage; private static UserProfilePage userProfilePage; public static UserProfilePage UserProfilePage { get { return userProfilePage; } } - ChatPage chatPage; - PinPage pinPage; + static ChatPage chatPage; + static PinPage pinPage; - public static void ShowPage(Page page) + public static async void ShowPage(Page page) { + if (page == homePage) + { + await Navigation.PopToRootAsync(); + return; + } if (Navigation.NavigationStack.Contains(page)) { if (Navigation.NavigationStack.Last() == page) return; Navigation.RemovePage(page); page.Parent = null; } - Navigation.PushAsync(page); + await Navigation.PushAsync(page); } private void BuildMainPage() @@ -263,7 +268,7 @@ namespace ZicMoove BindingContext = new ChatViewModel() }; - pinPage = new PinPage(); + pinPage = new PinPage { Title = Strings.Carte }; // var mainPage = new NavigationPage(bQueriesPage); @@ -322,6 +327,7 @@ namespace ZicMoove masterDetail.ToolbarItems.Add(tiHome); masterDetail.ToolbarItems.Add(tiSetts); masterDetail.ToolbarItems.Add(tiPubChat); + masterDetail.ToolbarItems.Add(tiPinPage); this.MainPage = masterDetail; NavigationService = new NavigationService(Navigation); 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 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 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); + } } } } 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; } 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; } 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 @@ -