public void AddNewDocument(Document d) { model.AddDocument(d); this.updateViewDetailValues(d); this.view.CanModifyID = true; LoadView(); }
public Mediatheque(Document[] d) { foreach (Document doc in d) { AllDocuments.Add(doc); } }
public void TestConstructor() { FakeAuthor fAuthor = new FakeAuthor(); Document doc = new Document("42","TitleTest",fAuthor,false); Assert.AreEqual("42", doc.ID, "Creation document : id incorrect."); Assert.AreEqual("TitleTest", doc.Title, "Creation document : titre incorrect."); Assert.AreEqual("false", doc.Copyright, "Creation document : copyright incorrect."); }
private void updateViewDetailValues(Document doc) { //Vue de detail a realisé view.ID = doc.ID; view.Title = doc.Title; view.Type = doc.GetType().Name; view.Author = doc.Author; view.Copyright = doc.Copyright; }
private void updateDocumentWithViewValues(Document doc) { doc.ID = view.ID; doc.Title = view.Title; doc.Author = view.Author; doc.Copyright = view.Copyright; }
public void UpdateAllInfos(Document d) { model.ReplaceDocument(d); updateViewDetailValues(d); this.view.UpdateGridWithChangedDocument(d); }
public void SelectedDocumentChanged(string selectedDocId) { foreach (Document doc in Model.AllDocuments) { if (doc.ID == selectedDocId) { selectedDoc = doc; updateViewDetailValues(doc); view.SetSelectedDocumentInGrid(doc); this.view.CanModifyID = false; break; } } }
public void ReplaceDocument(Document doc) { Document row=(from d in AllDocuments where d.ID == doc.ID select d).First(); DeleteDocument((Document)row); AddDocument(doc); }
public void DeleteDocument(Document d) { if (AllDocuments.Contains(d)) AllDocuments.Remove(d); }
public void AddDocument(Document d) { AllDocuments.Add(d); }