Exemplo n.º 1
0
        public static DataTable GetPublicDataTable(string sql, SqlTextType type)
        {
            switch (type)
            {
            case SqlTextType.Text:
                return(GetPublicText(sql));

            default:
                return(GetPublicProcedure(sql));
            }
        }
Exemplo n.º 2
0
 public SqlBuilder(Type tableType, ProviderType type, SqlTextType sqlType = SqlTextType.Query)
 {
     _type      = type;
     _sqlType   = sqlType;
     _sql       = GetAdapter();
     _tableType = tableType;
     _tables.Add(new SqlTableMappingEntity(tableType));
     sortType   = SqlOrderByType.ASC;
     partType   = SqlPartType.Where;
     pageNumber = 1;
     pageSize   = 10;
 }
Exemplo n.º 3
0
 private void SetBuilder <T>(SqlTextType type, SqlPartType partType = SqlPartType.None)
 {
     this.resolveType = typeof(T);
     if (type != SqlTextType.None)
     {
         builder.SqlType = type;
     }
     if (partType != SqlPartType.None)
     {
         builder.PartType = partType;
     }
 }
Exemplo n.º 4
0
        public static ArrayList GetComboBoxItems(ParamCaches pcs, string sql, SqlTextType type, string colname)
        {
            string pt = ConfigurationManager.AppSettings[PublicConsts.PC_ParamType];

            if (!String.IsNullOrEmpty(pt) && (pt.ToLower() == "mem"))
            {
                if (pcs == null)
                {
                    return(new ArrayList());
                }

                return(pcs[sql].Items);
            }
            else
            {
                return(CtrlHelper.DataTableToItems(GetPublicDataTable(sql, type), colname));
            }
        }
Exemplo n.º 5
0
        public void Clear()
        {
            _sqlType         = SqlTextType.Query;
            sortType         = SqlOrderByType.ASC;
            partType         = SqlPartType.Where;
            functionType     = SqlFunctionType.NONE;
            pageNumber       = 1;
            pageSize         = 10;
            distinct         = false;
            topString        = string.Empty;
            _useKey          = false;
            _insertWithQuery = false;
            _tables.Clear();
            _tables.Add(new SqlTableMappingEntity(_tableType));

            _joins.Clear();
            _conditions.Clear();
            _selections.Clear();
            _sorts.Clear();
            _groupings.Clear();
            _havings.Clear();
            _parameters.Clear();
            parameters.Clear();
        }
Exemplo n.º 6
0
 public static ArrayList GetComboBoxItems(string sql, SqlTextType type, string colname)
 {
     return(CtrlHelper.DataTableToItems(GetPublicDataTable(sql, type), colname));
 }