// Fetch row data from xml using xml dataset protected void XmlFetchRowData() { string xmlFile = BaseSys.GetXmlFilePath("About.xml"); if (File.Exists(xmlFile)) { // Get data from xml file about.ReadXml(xmlFile); row = (Company.AboutRow)about.Rows[0]; lbWhoAreWe.Text = row.WhoAreWe; lbManager.Text = string.Format("{0}: {1}", Properties.Resources.Manager, row.Manager); lbProfile.Text = row.Profile; } }
// Fetch row data from xml using xml dataset protected void XmlFetchRowData() { if (File.Exists(this.xmlFile)) { // Get data from xml file about.ReadXml(this.xmlFile); row = (Company.AboutRow)about.Rows[0]; txtWhoAreWe.Text = row.WhoAreWe; txtProfile.Text = row.Profile; txtManager.Text = row.Manager; } else { BaseSys.ShowMsg(msgPanel, lbMsg, Properties.Resources.XmlFileNotFound, "error"); } }
// Save new data to xml file using xml dataset techniques protected bool XmlSaveData() { about.ReadXml(this.xmlFile); row = (Company.AboutRow)about.Rows[0]; row.WhoAreWe = txtWhoAreWe.Text; row.Profile = txtProfile.Text; row.Manager = txtManager.Text; try { about.AcceptChanges(); about.WriteXml(this.xmlFile); return true; } catch { return false; } }