//add param public static bool AddParam(DataSItem parent, DataParam newparam) { bool res = false; if (IsDocLoaded) { try { XmlNode procParent = _doc.SelectSingleNode(SettingsHelperManager.QueryOfSelectinProcedureByValue(parent.Value)); if (procParent != null) { procParent.AppendChild(newparam.ToXmlNode()); if (Save()) { res = true; ReadAllProcedures(); } } } catch { return(false); } } return(res); }
public static bool DeleteProcedure(string procedureValue) { bool res = false; if (IsDocLoaded) { try { XmlNode node = ConfigurationDocument.SelectSingleNode( SettingsHelperManager.QueryOfSelectinProcedureByValue(procedureValue)); if (node == null) { return(false); } node.ParentNode.RemoveChild(node); if (Save()) { res = true; ReadAllProcedures(); } } catch { } } return(res); }
public static bool UpdateProcedure(string oldProcedureVal, DataSItem newProc) { bool res = false; if (IsDocLoaded) { try { string test = SettingsHelperManager.QueryOfSelectinProcedureByValue(oldProcedureVal); XmlNode node = ConfigurationDocument.SelectSingleNode(test); if (node == null) { return(false); } node.Attributes["name"].Value = newProc.Name; node.Attributes["value"].Value = newProc.Value; node.Attributes["constr"].Value = newProc.ConnectionString; if (Save()) { res = true; ReadAllProcedures(); } } catch { return(false); } } return(res); }