//delete param public static bool DeleteParam(DataSItem parent, DataParam delParam) { bool res = false; if (IsDocLoaded) { try { XmlNode node = ConfigurationDocument.SelectSingleNode( SettingsHelperManager.QueryOfSelectingParametrOfTheProcedureByPval(parent.Value, delParam.Name)); if (node == null) { return(false); } node.ParentNode.RemoveChild(node); if (Save()) { res = true; ReadAllProcedures(); } } catch { } } return(res); }
//<param name="" type="0" IsOutput="0"/> public static bool UpDateProcedureParametr(string procedureVal, string ParamName, DataParam newparam) { bool res = false; if (IsDocLoaded) { try { XmlNode node = ConfigurationDocument.SelectSingleNode( SettingsHelperManager.QueryOfSelectingParametrOfTheProcedureByPval(procedureVal, ParamName)); if (node == null) { return(false); } node.Attributes["name"].Value = newparam.Name; node.Attributes["type"].Value = ((int)newparam.Type).ToString(); node.Attributes["direction"].Value = newparam.Direction.ToString(); if (Save()) { res = true; ReadAllProcedures(); } } catch { return(false); } } return(res); }
//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 ReadAllProcedures() { bool res = false; if (_isDocLoaded) { try { XmlNodeList nodelist = _doc.SelectNodes(SettingsHelperManager.QueryOfListingAllProcedures()); if (nodelist != null) { _factory.Procedures.Clear(); int asd = 0; foreach (XmlNode node in nodelist) { asd++; DataSItem item = new DataSItem(node); _factory.Procedures.Add(item.Value, item); } res = true; } } catch { return(false); } } return(res); }
//update param public static bool UpdateParam(DataSItem parent, string oldParamname, DataParam unewparam) { bool res = false; if (IsDocLoaded) { try { string test = SettingsHelperManager.QueryOfSelectingParametrOfTheProcedureByPval(parent.Value, oldParamname); XmlNode node = ConfigurationDocument.SelectSingleNode(test); if (node == null) { return(false); } //<param name="@action_name" type="4" IsOutput="True" default="asdasd" /> node.Attributes["name"].Value = unewparam.Name; node.Attributes["type"].Value = ((int)unewparam.Type).ToString(); node.Attributes["direction"].Value = ((int)unewparam.Direction).ToString(); node.Attributes["default"].Value = unewparam.Default; if (Save()) { res = true; ReadAllProcedures(); } } catch { return(false); } } 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); }