protected override XElement Validate(XElement item) { // Validate with XSD XElement xsdErrors = this.ValidateXSD(item, HttpContext.Current.Server.MapPath(@"~\Xslt\Senior\Senior.xsd")); if (xsdErrors != null && xsdErrors.Elements("Error").Count() > 0) { return xsdErrors; } // Validate with Stored Proc string result = string.Empty; using (Persistence oDB = new Persistence()) { Persistence.ParameterCollection parameters = new Persistence.ParameterCollection(); parameters.Add("InputXml"); parameters[0].Value = item.ToString(); oDB.Execute("Masters_ConnectionString", "ValidateSeniorData", parameters, out result); } if (!string.IsNullOrEmpty(result)) { XElement spErrors = XElement.Parse(result); spErrors.Elements("Error").Where(e => string.IsNullOrEmpty(e.Value)).Remove(); if (spErrors.Elements("Error").Count() > 0) { return spErrors; } } // SUCCESS! return null; }
protected override void Commit(XElement item) { // Save it using (Persistence oDB = new Persistence()) { Persistence.ParameterCollection parameters = new Persistence.ParameterCollection(); parameters.Add("InputXml"); parameters[0].Value = item.ToString(); oDB.Execute("Masters_ConnectionString", "SaveSeniorData", parameters); } }
private string ExecStoredProc(string storedProc, string filterXml) { string procResult = string.Empty; using (Persistence oDB = new Persistence()) { Persistence.ParameterCollection parameters = new Persistence.ParameterCollection(); parameters.Add("filterXml"); parameters[0].Value = filterXml; oDB.Execute("Masters_ConnectionString", storedProc, parameters, out procResult); } return procResult; }