Example #1
0
        public string parse_query(string key, string[,] flds)
        {
            Dictionary <string, object> dict = new Dictionary <string, object>();

            for (int i = 0; i < flds.GetLength(0); i++)
            {
                dict.Add(flds[i, 0], flds[i, 1]);
            }
            config.query q = _config.get_query(key);
            return(parse(q.text, dict, conds: q.conds));
        }
Example #2
0
        public bool check_exists(config.query qry, core cr, Dictionary <string, object> flds = null)
        {
            if (qry.queries.Count > 1)
            {
                for (int n = 0; n < qry.queries.Count - 1; n++)
                {
                    exec(qry.queries[n]);
                }
            }
            DataTable dt = dt_table(cr.parse(qry.queries[qry.queries.Count() - 1], flds));

            return(dt != null && dt.Rows.Count > 0);
        }
Example #3
0
        public string exec_qry(config.query qry, core cr, Dictionary <string, object> flds = null, bool getidentity = false)
        {
            string res = null;

            if (qry.tp == config.query.tp_query.do_while)
            {
                foreach (DataRow dr in dt_table(qry.text_do).Rows)
                {
                    res = exec(cr.parse(qry.text_while, flds, dr), getidentity);
                }
            }
            else
            {
                foreach (string txt in qry.queries)
                {
                    res = exec(cr.parse(txt, flds), getidentity);
                }
            }
            return(res);
        }
Example #4
0
 public DataTable dt_qry(config.query qry, core cr, Dictionary <string, object> flds = null)
 {
     return(dt_table(cr.parse(qry.text, flds)));
 }
Example #5
0
 public string parse_query(string key, Dictionary <string, object> flds)
 {
     config.query q = _config.get_query(key);
     return(parse(q.text, flds, conds: q.conds));
 }