public void xoanxb(ClassTT nxb) { doc.Load(tep); XmlNode goc = doc.DocumentElement; XmlNode cu = goc.SelectSingleNode("/danhmucnxb/nxb[@manxb='" + nxb.Manxb + "']"); goc.RemoveChild(cu); doc.Save(tep); }
private void btnxoa_Click(object sender, EventArgs e) { ClassTT sach = new ClassTT(); sach.Manxb = txtmanxb.Text; sach.Tennxb = txttennxb.Text; sach.Diachi = txtdiachi.Text; xl.xoanxb(sach); Form1_Load(sender, e); }
public void themnxb(ClassTT nxb) { doc.Load(tep); XmlElement goc = doc.DocumentElement; XmlElement nhaxb = doc.CreateElement("nxb"); XmlAttribute manxb = doc.CreateAttribute("manxb"); XmlElement tennxb = doc.CreateElement("tennxb"); XmlElement diachi = doc.CreateElement("diachi"); manxb.InnerText = nxb.Manxb; tennxb.InnerText = nxb.Tennxb; diachi.InnerText = nxb.Diachi; nhaxb.Attributes.Append(manxb); nhaxb.AppendChild(tennxb); nhaxb.AppendChild(diachi); goc.AppendChild(nhaxb); doc.Save(tep); }
public void suanxb(ClassTT nxb) { doc.Load(tep); XmlElement goc = doc.DocumentElement; XmlNode cu=goc.SelectSingleNode("/danhmucnxb/nxb[@manxb='"+nxb.Manxb+"']"); XmlElement moi = doc.CreateElement("nxb"); XmlAttribute manxb = doc.CreateAttribute("manxb"); XmlElement tennxb = doc.CreateElement("tennxb"); XmlElement diachi = doc.CreateElement("diachi"); manxb.InnerText = nxb.Manxb; tennxb.InnerText = nxb.Tennxb; diachi.InnerText = nxb.Diachi; moi.Attributes.Append(manxb); moi.AppendChild(tennxb); moi.AppendChild(diachi); goc.ReplaceChild(moi, cu); doc.Save(tep); }
public void suanxb(ClassTT nxb) { doc.Load(tep); XmlElement goc = doc.DocumentElement; XmlNode cu = goc.SelectSingleNode("/danhmucnxb/nxb[@manxb='" + nxb.Manxb + "']"); XmlElement moi = doc.CreateElement("nxb"); XmlAttribute manxb = doc.CreateAttribute("manxb"); XmlElement tennxb = doc.CreateElement("tennxb"); XmlElement diachi = doc.CreateElement("diachi"); manxb.InnerText = nxb.Manxb; tennxb.InnerText = nxb.Tennxb; diachi.InnerText = nxb.Diachi; moi.Attributes.Append(manxb); moi.AppendChild(tennxb); moi.AppendChild(diachi); goc.ReplaceChild(moi, cu); doc.Save(tep); }