public void Test35() { Test34(); Librarian lb3 = new Librarian("lb3"); DocClass d1 = new DocClass("d1"); DocClass d2 = new DocClass("d2"); DocClass d3 = new DocClass("d3"); Student p1 = new Student("p1"); Student p2 = new Student("p2"); Student p3 = new Student("p3"); Student s = new Student("s"); Student v = new Student("v"); lb3.ModifyAV(d1.ID, d1.Title, d1.Autors, d1.Price, d1.Quantity - 1, d1.Tags); Debug.Assert(SDM.LMS.GetUser(p1.PersonID) != null); Debug.Assert(SDM.LMS.GetUser(p2.PersonID) != null); Debug.Assert(SDM.LMS.GetUser(p3.PersonID) != null); Debug.Assert(SDM.LMS.GetUser(s.PersonID) != null); Debug.Assert(SDM.LMS.GetUser(v.PersonID) != null); Debug.Assert(SDM.LMS.GetDoc(d1.ID) != null); Debug.Assert(SDM.LMS.GetDoc(d2.ID) != null); Debug.Assert(SDM.LMS.GetDoc(d3.ID) != null); Debug.Assert(SDM.LMS.GetDoc(d1.ID).Quantity == 2); Debug.Assert(SDM.LMS.GetDoc(d2.ID).Quantity == 3); Debug.Assert(SDM.LMS.GetDoc(d3.ID).Quantity == 3); }
public void Test12() { Test11(); Librarian lb = new Librarian("lb"); Student p2 = new Student("Nadia Teixeira"); admin.ModifyLibrarian(lb.PersonID, "lb", "lb", "lb", 2); DocClass b1 = new DocClass("Introduction to Algorithms"); DocClass b3 = new DocClass("The Mythical Man-month"); lb.ModifyAV(b1.ID, b1.Title, b1.Autors, b1.Price, b1.Quantity - 2, ""); lb.ModifyAV(b3.ID, b3.Title, b3.Autors, b3.Price, b3.Quantity - 1, ""); lb.DeleteUser(p2.PersonID); Debug.Assert(SDM.LMS.GetUser(p2.PersonID) == null); Debug.Assert(b1.Quantity == 1); Debug.Assert(b3.Quantity == 0); }
private void OnModifyAVClick(object sender, RoutedEventArgs e) { try { Librarian lib = (Librarian)SDM.CurrentUser; int price = Convert.ToInt32(PriceTB.Text); int quantity = Convert.ToInt32(CopiesTB.Text); lib.ModifyAV ( _docID, TitleTB.Text, AutorsTB.Text, price, quantity, TagsTB.Text ); } catch { MessageBox.Show("The row is empty", "Error"); } prevPage.UpdateTable(); Close(); }