private void tabControl_Biens_SelectedIndexChanged(object sender, EventArgs e) { if (tabControl_Biens.SelectedTab == tabPage1_Biens) { Nouvelle uc = new Nouvelle(); uc.newBiens += (s1, e1) => { reverse = true; run = splitContainer1.Width; init(); obj_biens = (Immo_Rale.Management.Biens)s1; annonce(); }; changeTab(tabPage1_Biens, uc); } else if (tabControl_Biens.SelectedTab == tabPage2_Biens) { Liste_bien uc = new Liste_bien(); uc.BiensSelected += (s2, e1) => { tabControl_Biens.SelectedTab = tabPage1_Biens; changeTab(tabPage1_Biens, new Nouvelle((Immo_Rale.Management.Biens)s2)); }; changeTab(tabPage2_Biens, uc); } }
public VueNouvelle() { WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; Console.WriteLine("VueNouvelle"); InitializeComponent(); this.nouvelle = new Nouvelle(); }
private void une_alerte() { //TODO : Mettre l'application en mode Mocks et aller chercher un joueur dans le Mock var mockRepo = new MockNouvellesRepository(); _nouvelle = mockRepo.GetById(1).Result; }
public async Task <IActionResult> Edit(int id, [Bind("Titre,Texte,Lien,Status,Id")] Nouvelle nouvelle) { if (id != nouvelle.Id) { return(NotFound()); } if (ModelState.IsValid) { try { await _repository.Update(nouvelle); } catch (DbUpdateConcurrencyException) { if (!NouvelleExists(nouvelle.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(nouvelle)); }
private async void Une_nouvelle() { var mockRepo = new MockNouvellesRepository(); var nouvelle = await mockRepo.GetAll(); _nouvelle = nouvelle.First(); }
public NouvelleIndex(Nouvelle e) { this.actif = e.actif; this.description = e.description; this.titre = e.titre; this.id = e.id; UtilisateurServiceAPI usa = new UtilisateurServiceAPI(); this.createur = usa.Donner(e.idCreateur).nomAffichage(); this.dateCreation = e.dateCreation; }
public void montrerNouvelles(List <Nouvelle> listeNouvelles) { // il faut partir au 7em element car les 6 premier ne sont pas des nouvelles Nouvelle new1 = listeNouvelles[7]; this.news.Text = this.news.Text + new1.name; Console.WriteLine("Nouvelle ajouter dans la TextBox"); }
public ActionResult Details(int id) { NouvelleServiceAPI rsa = new NouvelleServiceAPI(); Nouvelle r = rsa.Donner(id); NouvelleDetails rd = new NouvelleDetails(r); return(View(rd)); }
public static cl.Nouvelle VersClient(this Nouvelle e) { if (e == null) { return(null); } return(new cl.Nouvelle { actif = e.actif, description = e.description, id = e.id, titre = e.titre, dateCreation = e.dateCreation, idCreateur = e.idCreateur }); }
public static gl.Nouvelle VersGlobal(this Nouvelle e) { if (e == null) { return(null); } return(new gl.Nouvelle { id = e.id, description = e.description, titre = e.titre, actif = e.actif ? 1 : 0, idcreateur = e.idCreateur, datecreation = e.dateCreation }); }
public async Task <IActionResult> Create([Bind("Titre,Texte,Lien,Status,Id")] Nouvelle nouvelle) { if (ModelState.IsValid) { await _repository.Add(nouvelle); return(RedirectToAction(nameof(Index))); } return(View(nouvelle)); }
private bool NouvelleExists(int id) { Nouvelle nouvelle = _repository.GetById(id).Result; if (nouvelle == null) { return(false); } else { return(true); } }
public async void Test_Create_ShouldAddNewProjectTorepo() { //Arrange var nouvelle = new Nouvelle() { Title = "Any_title", Text_Desc = "Any_desc" }; //Act await _nouvelleController.Create(nouvelle); //Assert Assert.Equal(nouvelle, _mockRepo._nouvelles.LastOrDefault()); }
public int Creer(Nouvelle e) { string contenuJson = JsonConvert.SerializeObject(e, Formatting.Indented); StringContent contenu = new StringContent(contenuJson, Encoding.UTF8, "application/json"); HttpResponseMessage reponse = _client.PostAsync($"Nouvelle/Creer/", contenu).Result; if (!reponse.IsSuccessStatusCode) { throw new Exception("Echec de la réception de données."); } return(Convert.ToInt32((reponse.Content.ReadAsStringAsync().Result))); throw new NotImplementedException(); }
public async Task <IActionResult> Edit(int id, [Bind("Title,Text_Desc,Link_Media,Status,Id")] Nouvelle nouvelle) { if (id != nouvelle.Id) { return(NotFound()); } if (ModelState.IsValid) { await _nouvelleRepository.Update(nouvelle); return(RedirectToAction(nameof(Index))); } return(View(nouvelle)); }
public async void Test_Edit_WhenNouvelleIsEditted_ShouldChangeNouvelle() { //Arrange var nouvelle = new Nouvelle() { Id = 0, Title = "Any_title", Text_Desc = "Any_desc" }; var firstNouvelle = _mockRepo._nouvelles.First(); //Act await _nouvelleController.Edit(firstNouvelle.Id, nouvelle); //Assert Assert.Equal(nouvelle.Title, firstNouvelle.Title); Assert.Equal(nouvelle.Text_Desc, firstNouvelle.Text_Desc); }
public bool Modifier(int id, Nouvelle e) { string contenuJson = JsonConvert.SerializeObject(e, Formatting.Indented); StringContent contenu = new StringContent(contenuJson, Encoding.UTF8, "application/json"); HttpResponseMessage reponse = _client.PutAsync($"Nouvelle/Modifier/{id}", contenu).Result; if (!reponse.IsSuccessStatusCode) { throw new Exception("Echec de la réception de données."); } var x = reponse.Content.ReadAsStringAsync().Result; return(bool.Parse(x)); throw new NotImplementedException(); }
public async void Test_Create_NewNouvelle_ShouldAddToRepoLength() { //Arrange var nouvelle = new Nouvelle() { Title = "Any_title", Text_Desc = "Any_desc" }; var firstLength = _mockRepo._nouvelles.Count(); //Act await _nouvelleController.Create(nouvelle); //Assert var secondLength = _mockRepo._nouvelles.Count(); Assert.NotEqual(firstLength, secondLength); }
public void montrerNouvelle(List <Nouvelle> listeNouvelles) { // il faut partir au 7em element car les 6 premier ne sont pas des nouvelles Nouvelle new1 = listeNouvelles[7]; this.nouvelle1.Text = new1.name; Nouvelle new2 = listeNouvelles[8]; this.nouvelle2.Text = new2.name; Nouvelle new3 = listeNouvelles[9]; this.nouvelle3.Text = new3.name; Nouvelle new4 = listeNouvelles[10]; this.nouvelle4.Text = new4.name; Nouvelle new5 = listeNouvelles[11]; this.nouvelle5.Text = new5.name; Nouvelle new6 = listeNouvelles[12]; this.nouvelle6.Text = new6.name; Nouvelle new7 = listeNouvelles[13]; this.nouvelle7.Text = new7.name; Nouvelle new8 = listeNouvelles[14]; this.nouvelle8.Text = new8.name; Nouvelle new9 = listeNouvelles[15]; this.nouvelle9.Text = new9.name; Nouvelle new10 = listeNouvelles[16]; this.nouvelle10.Text = new10.name; Console.WriteLine("Nouvelles ajouter dans les TextBox"); }
private void bt_Biens_Click(object sender, EventArgs e) { Nouvelle uc = new Nouvelle(); uc.newBiens += (s1, e1) => { reverse = true; run = splitContainer1.Width; init(); obj_biens = (Immo_Rale.Management.Biens)s1; annonce(); }; changeTab(tabPage1_Biens, uc); tabControl_Biens.SelectedIndex = 0; tabControl_Biens.Visible = true; tabControl_Acheteur.Visible = false; tabControl_Agent.Visible = false; }
public Nouvelle newsToNouvelle(News news) { Nouvelle nouvelle = new Nouvelle(); nouvelle.id = news.id; nouvelle.cric = news.cric; nouvelle.dt = news.dt; nouvelle.titre = news.title; nouvelle.texte = news.text; nouvelle.url_texte = news.url_text; nouvelle.photo = news.photo; nouvelle.categorie = news.category; nouvelle.tag1 = news.tag1; nouvelle.tag2 = news.tag2; nouvelle.nom_club = news.club_name; nouvelle.visible = news.visible; nouvelle.PhotoString64 = news.PhotoString64; nouvelle.urlNouvelle = news.urlNews; nouvelle.type_club = news.club_type; return(nouvelle); }
public int Creer(Nouvelle e) { NouvelleService us = new NouvelleService(); return(us.Creer(e.VersClient())); }
public bool Modifier(int id, Nouvelle e) { NouvelleService us = new NouvelleService(); return(us.Modifier(id, e.VersClient())); }
public NouvelleDetails(Nouvelle e) { this.description = e.description; this.titre = e.titre; this.id = e.id; }
public NouvelleCreation(Nouvelle e) { this.description = e.description; this.titre = e.titre; this.dateCreation = e.dateCreation; this.idCreateur = e.idCreateur; }