public void saveThanhLySach(TLSach tl) { XDocument doc = XDocument.Load(nameFile); XElement school = doc.Element(TITTLE_THANHLYSACHS); school.Add(new XElement(TITTLE_THANHLYSACH, new XElement(MaSach, tl.MaSach), new XElement(TenSach, tl.TenSach), new XElement(LyDoThanhLy, tl.LyDoThanhLy))); doc.Save(nameFile); }
private void btnThanhLy_Click(object sender, EventArgs e) { string masach = cbdsms.Text; TLSach tls = new TLSach(); tls.MaSach = cbdsms.Text; tls.TenSach = txtTenSach.Text; tls.LyDoThanhLy = cbLyDo.Text; tl.saveThanhLySach(tls); sm.removeSach(masach); ReLoadForm(); }