Ejemplo n.º 1
0
        public string Exec(HtnDataInfo p_info)
        {
            string _result = "OK";

            if (p_info == null)
            {
                return(_result);
            }

            string _sql = string.Empty;

            //Hashtable _ht = new Hashtable();
            foreach (DataRow _dr in _dt.Rows)
            {
                if (p_info.IsUpdate) //可更新
                {
                    _sql = p_info.IsRowExist(_dr) ? p_info.Update : p_info.Insert;
                }
                else if (!p_info.IsExist(_dr))
                {
                    _sql = p_info.Insert;
                }

                if (string.IsNullOrEmpty(_sql))
                {
                    continue;
                }

                //_ht.Add(_sql, GetParams(p_info, _dr));
                int r = HtnData.ExecNonQuery(_sql, GetParams(p_info, _dr));
            }

            //HtnData.ExecuteSqlTran(_ht);
            return(_result);
        }