private String DecomposeRequete(ParametreRequete p) { String re = ""; if (p.Attribut != null) { re += ConcateneParam(p); } if (p.OtherExpression.Count > 0) { p.OtherExpression[p.OtherExpression.Count - 1].LastParam = true; if (p.Attribut != null) { re += " " + p.Predicat + " ("; } else { re += "("; } foreach (ParametreRequete p1 in p.OtherExpression) { re += DecomposeRequete(p1) + "" + ((p1.LastParam) ? "" : " " + p1.Predicat) + " "; } re += ")"; } return(re); }
/**/ private String ConcateneParam(ParametreRequete p) { String re = ""; if (p.Operation.Trim().Equals("BETWEEN")) { re += "(" + p.Attribut + " " + p.Operation + " :" + p.ParamNome + " AND :" + p.ParamNome + "" + 1 + ")"; } else { re += "" + p.Attribut + " " + p.Operation + ((p.Operation.Trim().Equals("IS NOT NULL") || p.Operation.Trim().Equals("IS NULL")) ? "" : " :" + p.ParamNome); } return(re); }
public void AddParam(ParametreRequete prq) { if (prq != null) { int idx = param.FindIndex(x => x.ParamNome == prq.ParamNome); if (idx > -1) { param.RemoveAt(idx); } if (prq.Objet != null) { param.Add(prq); } } }
private List <ParametreRequete> AjouteParam(ParametreRequete p, List <ParametreRequete> lp) { if (p.Attribut != null && !(p.Operation.Trim().Equals("IS NOT NULL") || p.Operation.Trim().Equals("IS NULL"))) { if (!p.Operation.Trim().Equals("BETWEEN")) { lp.Add(p); } else { lp.Add(p); p = new ParametreRequete(p.Attribut, p.ParamNome + "1", p.OtherObjet); lp.Add(p); } } if (p.OtherExpression.Count > 0) { foreach (ParametreRequete pp in p.OtherExpression) { lp.AddRange(AjouteParam(pp, lp)); } } return(lp); }
public void AddParamToFind(ParametreRequete prq) { offset = 0; AddParam(prq); }