Ejemplo n.º 1
0
        public ActionResult Pilates(Pilates_Filter filter, Rest.Core.Paging Page)
        {
            var PermissionCheck = CheckPermission("預約及查詢管理");

            if (PermissionCheck != null)
            {
                return(PermissionCheck);
            }

            if (!string.IsNullOrEmpty(filter.RegSubject) && filter.RegSubject.StartsWith("請輸入"))
            {
                filter.RegSubject = null;
            }
            ViewData["Filter"] = filter;
            Rest.Core.Paging page = new Rest.Core.Paging()
            {
            };
            if (Page.CurrentPage > 0)
            {
                page.CurrentPage = Page.CurrentPage;
            }
            List <Pilates_Info> data = PilatesMan.GetByParameter(filter, page, null, "PilatesId, PublishDate desc");

            ViewData["Model"] = data;
            ViewData["Page"]  = page;
            return(View());
        }
Ejemplo n.º 2
0
        public List <Pilates_Info> GetByParam(Pilates_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 <Pilates_Info>(Page.CurrentPage, Page.ItemsPerPage, SQLStr);
                Page.Convert <Pilates_Info>(result);

                return(result.Items);
            }
        }
Ejemplo n.º 3
0
 public List <Pilates_Info> GetByParameter(Pilates_Filter Filter, string[] fieldNames, string _orderby, Rest.Core.Paging Page)
 {
     return(new Pilates_Repo().GetByParam(Filter, fieldNames, _orderby, Page));
 }
Ejemplo n.º 4
0
 public List <Pilates_Info> GetByParameter(Pilates_Filter Filter, string _orderby)
 {
     return(new Pilates_Repo().GetByParam(Filter, _orderby));
 }
Ejemplo n.º 5
0
 public List <Pilates_Info> GetByParameter(Pilates_Filter Filter, Rest.Core.Paging Page)
 {
     return(new Pilates_Repo().GetByParam(Filter, Page));
 }
Ejemplo n.º 6
0
 public List <Pilates_Info> GetByParameter(Pilates_Filter Filter)
 {
     return(new Pilates_Repo().GetByParam(Filter));
 }
Ejemplo n.º 7
0
 public List <Pilates_Info> GetByParam(Pilates_Filter Filter, string[] fieldNames, string _orderby, Paging Page)
 {
     return(GetByParam(Filter, Page, fieldNames, _orderby));
 }
Ejemplo n.º 8
0
 public List <Pilates_Info> GetByParam(Pilates_Filter Filter, string _orderby, Paging Page)
 {
     return(GetByParam(Filter, Page, null, _orderby));
 }
Ejemplo n.º 9
0
 public List <Pilates_Info> GetByParam(Pilates_Filter Filter, Paging Page)
 {
     return(GetByParam(Filter, Page, null, ""));
 }
Ejemplo n.º 10
0
 public List <Pilates_Info> GetByParam(Pilates_Filter Filter)
 {
     return(GetByParam(Filter, null, null, ""));
 }
Ejemplo n.º 11
0
        private Rest.Core.PetaPoco.Sql ConstructSQL(Pilates_Filter filter, string[] fieldNames, string _orderby)
        {
            var SQLStr = Rest.Core.PetaPoco.Sql.Builder
                         .Append("SELECT " + FieldNameArrayToFieldNameString(fieldNames) + " FROM db_Pilates")
                         .Append("WHERE 1=1 ");

            if (filter != null)
            {
                if (filter.PilatesId.HasValue)
                {
                    SQLStr.Append(" AND PilatesId=@0", filter.PilatesId.Value);
                }
                if (!string.IsNullOrEmpty(filter.RegID))
                {
                    SQLStr.Append(" AND RegID=@0", filter.RegID);
                }
                if (!string.IsNullOrEmpty(filter.RegName))
                {
                    SQLStr.Append(" AND RegName=@0", filter.RegName);
                }
                if (!string.IsNullOrEmpty(filter.RegSubject))
                {
                    SQLStr.Append(" AND RegSubject like @0", "%" + filter.RegSubject + "%");
                }
                if (filter.PublishDate.HasValue)
                {
                    SQLStr.Append(" AND PublishDate=@0", filter.PublishDate.Value);
                }
                if (!string.IsNullOrEmpty(filter.TimeStart))
                {
                    SQLStr.Append(" AND TimeStart=@0", filter.TimeStart);
                }
                if (!string.IsNullOrEmpty(filter.TimeEnd))
                {
                    SQLStr.Append(" AND TimeEnd=@0", filter.TimeEnd);
                }
                if (!string.IsNullOrEmpty(filter.Memo))
                {
                    SQLStr.Append(" AND Memo=@0", filter.Memo);
                }
                if (!string.IsNullOrEmpty(filter.ContentBody))
                {
                    SQLStr.Append(" AND ContentBody=@0", filter.ContentBody);
                }
                if (filter.IsActive.HasValue)
                {
                    SQLStr.Append(" AND IsActive=@0", filter.IsActive.Value);
                }
                if (filter.HasTail.HasValue)
                {
                    SQLStr.Append(" AND HasTail=@0", filter.HasTail.Value);
                }
                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 (filter.VerifiedDate.HasValue)
                {
                    SQLStr.Append(" AND VerifiedDate=@0", filter.VerifiedDate.Value);
                }
                if (_orderby != "")
                {
                    SQLStr.OrderBy(_orderby);
                }
            }
            return(SQLStr);
        }
Ejemplo n.º 12
0
 private Rest.Core.PetaPoco.Sql ConstructSQL(Pilates_Filter filter)
 {
     return(ConstructSQL(filter, new string[] { "*" }, ""));
 }