public XDocument buildRule() { //XDocument ruleXml = new XDocument(new XDeclaration("1.0", "UTF-8", "yes")); //create xml doc //XElement ruleNode = new XElement("rule"); XDocument ruleXml = base.buildRootNode(); XAttribute xaType = new XAttribute("type", "equal"); XElement definitionNode = new XElement("definition", xaType); using (RuleHelper ruleHelper = new RuleHelper()) { // carrier condition XElement conditionCarrier = ruleHelper.CreateCondition("CarrierID", ddlCarrier.SelectedValue); // expense condition XElement conditionExpense = ruleHelper.CreateCondition("ExpenseTypeID", ddlExpenseType.SelectedValue); // add conditions to rule definition definitionNode.Add(conditionCarrier); definitionNode.Add(conditionExpense); } //ruleXml.Add(ruleNode); //ruleNode.Add(definitionNode); ruleXml.Element("rule").Add(definitionNode); return(ruleXml); }
public XDocument buildRule() { XDocument ruleXml = base.buildRootNode(); XAttribute xaType = new XAttribute("type", "equal"); XElement definitionNode = new XElement("definition", xaType); using (RuleHelper ruleHelper = new RuleHelper()) { // hours/days unit XElement conditionLapseTime = ruleHelper.CreateCondition("LapseTime", txtDayHours.Text); // hour/day selection XElement conditionLapseTimeType = ruleHelper.CreateCondition("LapseTimeType", this.ddlhourday.SelectedValue); // add conditions to rule definition definitionNode.Add(conditionLapseTime); definitionNode.Add(conditionLapseTimeType); //ruleXml.Add(ruleNode); ruleXml.Element("rule").Add(definitionNode); } return(ruleXml); }
public XDocument buildRule() { XDocument ruleXml = base.buildRootNode(); XAttribute xaType = new XAttribute("type", "equal"); XElement definitionNode = new XElement("definition", xaType); using (RuleHelper ruleHelper = new RuleHelper()) { // hours/days unit XElement conditionLapseTime = ruleHelper.CreateCondition("LapseTime", txtDayHours.Text); // hour/day selection XElement conditionLapseTimeType = ruleHelper.CreateCondition("LapseTimeType", this.ddlhourday.SelectedValue); // add conditions to rule definition definitionNode.Add(conditionLapseTime); definitionNode.Add(conditionLapseTimeType); //ruleXml.Add(ruleNode); ruleXml.Element("rule").Add(definitionNode); } return ruleXml; }