示例#1
0
        public SearchParameterSet ParseParameter(QueryParmDef qryParmDef, String parmStr)
        {
            SearchParameterSet parmSet = new SearchParameterSet(qryParmDef);
            Match m = mS_ParmStrWithPat.Match(parmStr);

            if (!String.IsNullOrEmpty(parmStr))
            {
                if (m.Success)
                {
                    Group g = null;

                    g = (m.Groups[1].Success ? m.Groups[1] : m.Groups[3]);
                    if (g.Success)
                    {
                        parmSet.AddSearchParameter(ParseParameterValue(qryParmDef, g.Value));
                    }

                    g = (m.Groups[2].Success ? m.Groups[2] : m.Groups[4]);
                    if (g.Success)
                    {
                        foreach (Capture c in g.Captures)
                        {
                            parmSet.AddSearchParameter(ParseParameterValue(qryParmDef, c.Value));
                        }
                    }
                }
                else
                {
                    throw new Exception(String.Format("Cannot parse {0} for parameter {1}!", parmStr, qryParmDef.Name));
                }
            }

            return(parmSet);
        }
        public override BaseSearchParameter ParseParameterValue(QueryParmDef qryParmDef, String parmValStr)
        {
            Guid guidValue = Guid.Empty;
            BaseSearchParameter searchParm = null;

            guidValue  = new Guid(parmValStr);
            searchParm = new EqualSearchParameter(qryParmDef);
            searchParm.ParameterValue = guidValue;

            return(searchParm);
        }
        public override BaseSearchParameter ParseParameterValue(QueryParmDef qryParmDef, String parmValStr)
        {
            Int32 intValue = 0;
            BaseSearchParameter searchParm = null;

            intValue   = Int32.Parse(parmValStr);
            searchParm = new EqualSearchParameter(qryParmDef);
            searchParm.ParameterValue = intValue;

            return(searchParm);
        }
        public override BaseSearchParameter ParseParameterValue(QueryParmDef qryParmDef, String parmValStr)
        {
            DateTime            dtValue    = DateTime.MinValue;
            BaseSearchParameter searchParm = null;

            dtValue    = DateTime.Parse(parmValStr);
            searchParm = new EqualSearchParameter(qryParmDef);
            searchParm.ParameterValue = dtValue;

            return(searchParm);
        }
示例#5
0
        public override BaseSearchParameter ParseParameterValue(QueryParmDef qryParmDef, String parmValStr)
        {
            BaseSearchParameter searchParm = null;

            System.Diagnostics.Debug.Assert(this.ParameterType == qryParmDef.ParameterType);

            if (parmValStr.Contains('%'))
            {
                searchParm = new LikeSearchParameter(qryParmDef);
            }
            else
            {
                searchParm = new EqualSearchParameter(qryParmDef);
            }
            searchParm.ParameterValue = parmValStr;

            return(searchParm);
        }
示例#6
0
 public static BaseQueryParameter GetQueryParameter(QueryParmDef qryParmDef)
 {
     return(mS_QryParmDic[qryParmDef.ParameterType]);
 }
示例#7
0
 public abstract BaseSearchParameter ParseParameterValue(QueryParmDef qryParmDef, String parmValStr);