From 281cca4069ce21951d4a0a42aa26301f15decc53 Mon Sep 17 00:00:00 2001 From: xxxnemesis4xxx Date: Fri, 12 Dec 2014 08:54:16 -0500 Subject: [PATCH 1/5] Sauvegarde Categorie lors de l'inscription --- InTime/RealConnexion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InTime/RealConnexion.cs b/InTime/RealConnexion.cs index 7da7ac0..3476882 100644 --- a/InTime/RealConnexion.cs +++ b/InTime/RealConnexion.cs @@ -10,7 +10,7 @@ public class RealConnexion : ConnexionUtilisateur { public void CreerUsager(RegisterModel model) { - WebMatrix.WebData.WebSecurity.CreateUserAndAccount(model.UserName, model.Password, new { model.Nom, model.Prenom, model.Email }); + WebMatrix.WebData.WebSecurity.CreateUserAndAccount(model.UserName, model.Password, new { model.Nom, model.Prenom, model.Email, model.Categorie }); } public void LoginUsager(RegisterModel model) From ea3c6d21e35d064cc5cd8253707cea1ca687dfea Mon Sep 17 00:00:00 2001 From: xxxnemesis4xxx Date: Fri, 12 Dec 2014 09:51:35 -0500 Subject: [PATCH 2/5] Correction Affichage Tache Non Recurrente! --- InTime/App_Data/dbo.Taches.sql | 1 + InTime/App_Data/dbo.UserProfile.sql | 1 + InTime/Controllers/CalendrierController.cs | 3 ++- InTime/Models/TraitementDate.cs | 5 +++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/InTime/App_Data/dbo.Taches.sql b/InTime/App_Data/dbo.Taches.sql index 83b1a20..dfb71c4 100644 --- a/InTime/App_Data/dbo.Taches.sql +++ b/InTime/App_Data/dbo.Taches.sql @@ -9,6 +9,7 @@ [HRappel] VARCHAR (2) NULL, [mRappel] VARCHAR (2) NULL, [Recurrence] NUMERIC (2,0) NULL, + [PriorityColor] VARCHAR(8) NULL, PRIMARY KEY CLUSTERED ([IdTache] ASC), CONSTRAINT [FK_UserProfile_Taches] FOREIGN KEY ([UserId]) REFERENCES [dbo].[UserProfile] ([UserId]) ); diff --git a/InTime/App_Data/dbo.UserProfile.sql b/InTime/App_Data/dbo.UserProfile.sql index dfebc00..9b5fc11 100644 --- a/InTime/App_Data/dbo.UserProfile.sql +++ b/InTime/App_Data/dbo.UserProfile.sql @@ -4,6 +4,7 @@ [Nom] VARCHAR(50) NOT NULL, [Prenom] VARCHAR(50) NOT NULL, [Email] VARCHAR(50) NOT NULL, + [Categorie] VARCHAR(50) NOT NULL, PRIMARY KEY CLUSTERED ([UserId] ASC), UNIQUE NONCLUSTERED ([Email],[UserName] ASC) ); diff --git a/InTime/Controllers/CalendrierController.cs b/InTime/Controllers/CalendrierController.cs index 9bcf548..f8bfd8a 100644 --- a/InTime/Controllers/CalendrierController.cs +++ b/InTime/Controllers/CalendrierController.cs @@ -80,7 +80,8 @@ public JsonResult Taches(double start, double end) else { string url = UrlH.Action("Index", "ConsulterTache", new { @id = tache.IdTache }); - rows.Add(new { title = tache.NomTache, start = tache.unixDebut, end = tache.unixFin, url = url, backgroundColor = tache.PriorityColor }); + rows.Add(new { title = tache.NomTache, start = TraitementDate.DateFormatCalendrier(tache.unixDebut), + end = TraitementDate.DateFormatCalendrier(tache.unixFin), url = url, backgroundColor = tache.PriorityColor }); } } diff --git a/InTime/Models/TraitementDate.cs b/InTime/Models/TraitementDate.cs index 7c2aa99..1932a12 100644 --- a/InTime/Models/TraitementDate.cs +++ b/InTime/Models/TraitementDate.cs @@ -46,14 +46,14 @@ public static double DateTimeToUnixTimestamp() public static DateTime UnixTimeStampToDateTime(double unixTimeStamp) { - System.DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Local); + System.DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc); return dtDateTime.AddSeconds(unixTimeStamp); } public static string UnixTimeStampToString(double unixTimeStamp) { - System.DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Local); + System.DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc); return dtDateTime.AddSeconds(unixTimeStamp).ToString("yyyy-MM-dd HH:mm"); } @@ -85,6 +85,7 @@ public static string DateFormatCalendrier(int Annee, int Mois, int Jour, int Heu try { DateTime date = new DateTime(Annee, Mois, Jour, Heure, Minute, 0); + return date.ToString("yyyy-MM-ddTHH:mm:sszzz"); } catch (Exception ex) From 70ed38b2c1c626662f43c863c9bf643f9990319b Mon Sep 17 00:00:00 2001 From: xxxnemesis4xxx Date: Fri, 12 Dec 2014 09:58:49 -0500 Subject: [PATCH 3/5] Correction Modification Couleur --- InTime/Controllers/ConsulterTacheController.cs | 4 +--- InTime/Views/ConsulterTache/Modification.cshtml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/InTime/Controllers/ConsulterTacheController.cs b/InTime/Controllers/ConsulterTacheController.cs index ba7c046..aa6f828 100644 --- a/InTime/Controllers/ConsulterTacheController.cs +++ b/InTime/Controllers/ConsulterTacheController.cs @@ -156,8 +156,6 @@ public ActionResult Modification(Tache Model, string modif, bool Existe) int UserId = Int32.Parse(InTime.Models.Cookie.ObtenirCookie(User.Identity.Name)); double unixDebut = TraitementDate.DateTimeToUnixTimestamp(TraitementDate.DateDebut(Model)); double unixFin = TraitementDate.DateTimeToUnixTimestamp(TraitementDate.DateFin(Model)); - string couleur = (Request.Form.GetValues(16).GetValue(0)).ToString(); - Model.PriorityColor = couleur; if (modif == "False") { SqlCommande = "UPDATE Taches set NomTache=@NomTache,Lieu=@Lieu,Description=@Description," @@ -198,7 +196,7 @@ public ActionResult Modification(Tache Model, string modif, bool Existe) DateTime date = TraitementDate.UnixTimeStampToDateTime(unixDebut); - return RedirectToAction("Index", "Calendrier", new { @annee = date.Year, @mois = (date.Month - 1), @jour = date.Day }); + return RedirectToAction("Taches", "ConsulterTache"); } catch (Exception ex) { diff --git a/InTime/Views/ConsulterTache/Modification.cshtml b/InTime/Views/ConsulterTache/Modification.cshtml index dd243b9..b13f3fc 100644 --- a/InTime/Views/ConsulterTache/Modification.cshtml +++ b/InTime/Views/ConsulterTache/Modification.cshtml @@ -149,7 +149,7 @@ @Html.TextArea("Description", tache.Description, new { style = "width:95%;", id = "Description" })
Priorité: - + @Html.TextBoxFor(model => model.IdTache, new { id = "IdTache", Value = tache.IdTache, @type = "Hidden" }) @Html.TextBox("Existe", "false", new { @type = "Hidden" }) From 57b370bd35b96f43e87e90dda12cd01d080699d7 Mon Sep 17 00:00:00 2001 From: xxxnemesis4xxx Date: Fri, 12 Dec 2014 10:11:36 -0500 Subject: [PATCH 4/5] Affichage Desc Tache Recurrente si modif --- InTime/Controllers/ConsulterTacheController.cs | 8 ++++++++ InTime/Filters/InitializeSimpleMembershipAttribute.cs | 2 +- InTime/Models/RequeteSql.cs | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/InTime/Controllers/ConsulterTacheController.cs b/InTime/Controllers/ConsulterTacheController.cs index aa6f828..3a23240 100644 --- a/InTime/Controllers/ConsulterTacheController.cs +++ b/InTime/Controllers/ConsulterTacheController.cs @@ -408,6 +408,14 @@ private List TraitementChoixHistorique(int Choix, string FinAnn, string D List result = TraitementDate.TraitementRecurrenceTache(tache, TacheRecDebut, TacheRecFin); if (result != null) { + foreach(Tache tacheRec in result) + { + string resultat = RechercheDescriptionTache(tacheRec.IdTache, tacheRec.unixDebut); + if (!String.IsNullOrEmpty(resultat)) + { + tache.Description = resultat; + } + } lstTache.AddRange(result); } } diff --git a/InTime/Filters/InitializeSimpleMembershipAttribute.cs b/InTime/Filters/InitializeSimpleMembershipAttribute.cs index 9704a9f..adbc427 100644 --- a/InTime/Filters/InitializeSimpleMembershipAttribute.cs +++ b/InTime/Filters/InitializeSimpleMembershipAttribute.cs @@ -37,7 +37,7 @@ public SimpleMembershipInitializer() ((IObjectContextAdapter)context).ObjectContext.CreateDatabase(); } } - WebSecurity.InitializeDatabaseConnection("ConnString2", "UserProfile", "UserId", "UserName", autoCreateTables: true); + WebSecurity.InitializeDatabaseConnection("ConnString", "UserProfile", "UserId", "UserName", autoCreateTables: true); } catch (Exception ex) { diff --git a/InTime/Models/RequeteSql.cs b/InTime/Models/RequeteSql.cs index 8771f50..a99ee58 100644 --- a/InTime/Models/RequeteSql.cs +++ b/InTime/Models/RequeteSql.cs @@ -14,7 +14,7 @@ public static class RequeteSql { public enum Message { Reussi, Echec, Modif }; - public const string connectionString = @"Data Source=.\SQLEXPRESS;Initial Catalog=EQUIPE-02;Integrated Security=True"; + public const string connectionString = @"Data Source=EQUIPE-02\SQLEXPRESS;Initial Catalog=InTime;Integrated Security=True"; public static SqlConnection ConnexionBD(SqlConnection con) { From 824d554fd7670e3f01030421c41f77b742e54bdb Mon Sep 17 00:00:00 2001 From: xxxnemesis4xxx Date: Fri, 12 Dec 2014 10:14:01 -0500 Subject: [PATCH 5/5] Correction Affichage Fichier --- InTime/App_Data/dbo.Taches.sql | 2 +- InTime/App_Data/dbo.UserProfile.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/InTime/App_Data/dbo.Taches.sql b/InTime/App_Data/dbo.Taches.sql index dfb71c4..ea5d85a 100644 --- a/InTime/App_Data/dbo.Taches.sql +++ b/InTime/App_Data/dbo.Taches.sql @@ -9,7 +9,7 @@ [HRappel] VARCHAR (2) NULL, [mRappel] VARCHAR (2) NULL, [Recurrence] NUMERIC (2,0) NULL, - [PriorityColor] VARCHAR(8) NULL, + [PriorityColor] VARCHAR(8) NULL, PRIMARY KEY CLUSTERED ([IdTache] ASC), CONSTRAINT [FK_UserProfile_Taches] FOREIGN KEY ([UserId]) REFERENCES [dbo].[UserProfile] ([UserId]) ); diff --git a/InTime/App_Data/dbo.UserProfile.sql b/InTime/App_Data/dbo.UserProfile.sql index 9b5fc11..5d3acff 100644 --- a/InTime/App_Data/dbo.UserProfile.sql +++ b/InTime/App_Data/dbo.UserProfile.sql @@ -4,7 +4,7 @@ [Nom] VARCHAR(50) NOT NULL, [Prenom] VARCHAR(50) NOT NULL, [Email] VARCHAR(50) NOT NULL, - [Categorie] VARCHAR(50) NOT NULL, + [Categorie] VARCHAR(50) NOT NULL, PRIMARY KEY CLUSTERED ([UserId] ASC), UNIQUE NONCLUSTERED ([Email],[UserName] ASC) );