Skip to content

Commit

Permalink
Merge pull request #32 from dinfcll/mg_CorrectionsProblemeMaster
Browse files Browse the repository at this point in the history
Mg corrections probleme master
  • Loading branch information
xxxnemesis4xxx committed Dec 12, 2014
2 parents 9bc4882 + 824d554 commit 65af10a
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 10 deletions.
1 change: 1 addition & 0 deletions InTime/App_Data/dbo.Taches.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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])
);
Expand Down
1 change: 1 addition & 0 deletions InTime/App_Data/dbo.UserProfile.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);
Expand Down
3 changes: 2 additions & 1 deletion InTime/Controllers/CalendrierController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
}

Expand Down
12 changes: 9 additions & 3 deletions InTime/Controllers/ConsulterTacheController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,"
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -410,6 +408,14 @@ private List<Tache> TraitementChoixHistorique(int Choix, string FinAnn, string D
List<Tache> 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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion InTime/Filters/InitializeSimpleMembershipAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion InTime/Models/RequeteSql.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
5 changes: 3 additions & 2 deletions InTime/Models/TraitementDate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion InTime/RealConnexion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion InTime/Views/ConsulterTache/Modification.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
@Html.TextArea("Description", tache.Description, new { style = "width:95%;", id = "Description" })
<br />
Priorité:
<input id="PrioriteCouleur" type="color" name="Priorité" size="4" height="30" value=@tache.PriorityColor/>
<input id="PriorityColor" type="color" name="PriorityColor" size="4" height="30" value=@tache.PriorityColor />
@Html.TextBoxFor(model => model.IdTache, new { id = "IdTache", Value = tache.IdTache, @type = "Hidden" })
@Html.TextBox("Existe", "false", new { @type = "Hidden" })
<input id="modif" name="modif" type="text" value="False" style="display:none" />
Expand Down

0 comments on commit 65af10a

Please sign in to comment.