Beispiel #1
0
        private Rest.Core.PetaPoco.Sql ConstructSQL(Footer_Filter filter, string[] fieldNames, string _orderby)
        {
            var SQLStr = Rest.Core.PetaPoco.Sql.Builder
                         .Append("SELECT " + FieldNameArrayToFieldNameString(fieldNames) + " FROM db_Footer")
                         .Append("WHERE 1=1 ");

            if (filter != null)
            {
                if (filter.FooterId.HasValue)
                {
                    SQLStr.Append(" AND FooterId=@0", filter.FooterId.Value);
                }
                if (!string.IsNullOrEmpty(filter.FooterText))
                {
                    SQLStr.Append(" AND FooterText=@0", filter.FooterText);
                }
                if (!string.IsNullOrEmpty(filter.FooterTextMail))
                {
                    SQLStr.Append(" AND FooterTextMail=@0", filter.FooterTextMail);
                }
                if (filter.LastUpdate.HasValue)
                {
                    SQLStr.Append(" AND LastUpdate=@0", filter.LastUpdate.Value);
                }
                if (!string.IsNullOrEmpty(filter.LastUpdator))
                {
                    SQLStr.Append(" AND LastUpdator=@0", filter.LastUpdator);
                }
                if (_orderby != "")
                {
                    SQLStr.OrderBy(_orderby);
                }
            }
            return(SQLStr);
        }
Beispiel #2
0
        public List <Footer_Info> GetByParam(Footer_Filter Filter, Paging Page, string[] fieldNames, string _orderby)
        {
            if (fieldNames == null)
            {
                fieldNames = new string[] { "*" };
            }
            if (Page == null)
            {
                Page = new Paging();
            }
            using (var db = new DBExecutor().GetDatabase())
            {
                var SQLStr = ConstructSQL(Filter, fieldNames, _orderby);

                var result = db.Page <Footer_Info>(Page.CurrentPage, Page.ItemsPerPage, SQLStr);
                Page.Convert <Footer_Info>(result);

                return(result.Items);
            }
        }
Beispiel #3
0
 public List <Footer_Info> GetByParam(Footer_Filter Filter, string[] fieldNames, string _orderby, Paging Page)
 {
     return(GetByParam(Filter, Page, fieldNames, _orderby));
 }
Beispiel #4
0
 public List <Footer_Info> GetByParam(Footer_Filter Filter, string _orderby, Paging Page)
 {
     return(GetByParam(Filter, Page, null, _orderby));
 }
Beispiel #5
0
 public List <Footer_Info> GetByParam(Footer_Filter Filter, Paging Page)
 {
     return(GetByParam(Filter, Page, null, ""));
 }
Beispiel #6
0
 public List <Footer_Info> GetByParam(Footer_Filter Filter)
 {
     return(GetByParam(Filter, null, null, ""));
 }
Beispiel #7
0
 private Rest.Core.PetaPoco.Sql ConstructSQL(Footer_Filter filter)
 {
     return(ConstructSQL(filter, new string[] { "*" }, ""));
 }
Beispiel #8
0
 public List <Footer_Info> GetByParameter(Footer_Filter Filter, string[] fieldNames, string _orderby, Rest.Core.Paging Page)
 {
     return(new Footer_Repo().GetByParam(Filter, fieldNames, _orderby, Page));
 }
Beispiel #9
0
 public List <Footer_Info> GetByParameter(Footer_Filter Filter, string _orderby)
 {
     return(new Footer_Repo().GetByParam(Filter, _orderby));
 }
Beispiel #10
0
 public List <Footer_Info> GetByParameter(Footer_Filter Filter, Rest.Core.Paging Page)
 {
     return(new Footer_Repo().GetByParam(Filter, Page));
 }
Beispiel #11
0
 public List <Footer_Info> GetByParameter(Footer_Filter Filter)
 {
     return(new Footer_Repo().GetByParam(Filter));
 }