private void AnnulerTache(object sender) { Taches.Remove(TacheSelectionnée); TacheSelectionnée = Taches.LastOrDefault(); ModeEdit = ModesEdition.Consultation; }
private void SupprimerTache(object obj) { var tache = (Tache)CollectionViewSource.GetDefaultView(Taches).CurrentItem; Taches.Remove(tache); AccesDonnees.EnregistrerTaches(Taches.ToList()); }
private void EnregistrerTache(object sender) { if (Taches.Last().Description != null) { AccèsDonnées.EnregistrerTaches(Taches); ModeEdit = ModesEdition.Consultation; } }
private void SupprimerTache(object sender) { if (TacheSelectionnée != null) { Taches.Remove(TacheSelectionnée); TacheSelectionnée = Taches.LastOrDefault(); AccèsDonnées.EnregistrerTaches(Taches); } }
private void AjouterTache(object obj) { TacheCourante = new Tache(); TacheCourante.Id = Taches.Any() ? Taches.Max(t => t.Id) + 1 : 1; TacheCourante.Creation = DateTime.Today; TacheCourante.Term = DateTime.Today; TacheCourante.Prio = 1; Taches.Add(TacheCourante); ModeEdition = !ModeEdition; }
public IActionResult CreateTasks([FromBody] Taches task) { IActionResult response = BadRequest(new { error = "Server not responding correctly" }); this.context.Add(task); this.context.SaveChanges(); response = Ok(new { success = "Data saves" }); return(response); }
public int Modifier(Taches tache) { return(new AccesTaches(ChaineConnexion).Modifier( tache.Id, tache.Nom, tache.DatteFin, tache.Active, tache.LocataireCourant, tache.Cycle )); }
public IActionResult getTask(int idTache, int page) { IActionResult response = BadRequest(); var tache = Taches.GetTask(idTache: idTache, page: page); if (tache.Count != 0) { response = Ok(new { tache }); } return(response); }
private void AjouterTache(Object o) { ModeEdit = ModesEdition.Edition; var p = Taches.Max(x => x.Id); Tache t = new Tache(); t.Id = p + 1; t.Creation = DateTime.Now; t.Prio = 1; t.Term = DateTime.Now; Taches.Add(t); _tachesAjoutees.Add(t); }
private void AjouterTache(object tache) { ModeEdit = ModesEdition.Edition; NouvelTache = new Tache(); NouvelTache.Creation = DateTime.Today; NouvelTache.Term = DateTime.Today; NouvelTache.Id = Taches.Select(a => a.Id).DefaultIfEmpty(1).Max() + 1; NouvelTache.Prio = 1; NouvelTache.Fait = false; Taches.Add(NouvelTache); ICollectionView view = CollectionViewSource.GetDefaultView(Taches); view.MoveCurrentToLast(); }
private void AjouterTache(object sender) { Tache task = new Tache() { Id = Taches.Any() ? Taches.Max(t => t.Id) + 1 : 1, Creation = DateTime.Today, Term = DateTime.Today, Prio = 1 }; Taches.Add(task); TacheSelectionnée = task; ModeEdit = ModesEdition.Edition; }
// permet lors du démarage du programme de recharger les taches précédament rentrer en mémoire. public void lecture_taches(ref String path) { using (StreamReader sr = File.OpenText(path)) { string s; while ((s = sr.ReadLine()) != null) { string[] words = s.Split(','); int ident = int.Parse(words[0]); DateTime date1 = DateTime.Parse(words[3]); Taches test = new Taches(ident, words[1], words[2], date1, words[4]); this.list_task.Add(test); } } }
public int Ajouter(Taches tache) { string activeBdd; if (tache.Active) { activeBdd = "1"; } else { activeBdd = "0"; } return(new AccesTaches(ChaineConnexion).Ajouter( tache.Nom, tache.DatteFin, activeBdd, tache.LocataireCourant, tache.Cycle )); }
private void Annuler(object obj) { Taches.Remove(TacheCourante); ModeEdition = !ModeEdition; }
public AccesTaches(string sChaineConnexion) : base(sChaineConnexion) { Table = "Taches"; _classesBase = new Taches(); }
// utilisation de la m"htode Add de l'objet LIST public void ajouter_taches(int ident, string nom, string descriptif, DateTime deadline, string types) { Taches test = new Taches(ident, nom, descriptif, deadline, types); this.list_task.Add(test); }
private void AnnulerTache(object o) { ModeEdit = ModesEdition.Consultation; Taches.Remove(Taches.Last()); }
private void EnregistrerTache(object obj) { AccesDonnees.EnregistrerTaches(Taches.ToList()); ModeEdition = !ModeEdition; }