예제 #1
0
        public ActionResult AboutService(AboutService_Filter filter, Rest.Core.Paging Page)
        {
            var PermissionCheck = CheckPermission("關於萬芳管理");

            if (PermissionCheck != null)
            {
                return(PermissionCheck);
            }
            if (!string.IsNullOrEmpty(filter.UnitName) && filter.UnitName.StartsWith("請輸入"))
            {
                filter.UnitName = null;
            }
            ViewData["Filter"] = filter;

            Rest.Core.Paging page = new Rest.Core.Paging()
            {
            };
            if (Page.CurrentPage > 0)
            {
                page.CurrentPage = Page.CurrentPage;
            }
            List <AboutService_Info> data = AboutSrv.GetByParameter(filter, page, null, "SortNum");

            ViewData["Model"] = data;
            ViewData["Page"]  = page;
            return(View());
        }
예제 #2
0
        public List <AboutService_Info> GetByParam(AboutService_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 <AboutService_Info>(Page.CurrentPage, Page.ItemsPerPage, SQLStr);
                Page.Convert <AboutService_Info>(result);

                return(result.Items);
            }
        }
예제 #3
0
 public List <AboutService_Info> GetByParam(AboutService_Filter Filter, string[] fieldNames, string _orderby, Paging Page)
 {
     return(GetByParam(Filter, Page, fieldNames, _orderby));
 }
예제 #4
0
 public List <AboutService_Info> GetByParam(AboutService_Filter Filter, string _orderby)
 {
     return(GetByParam(Filter, null, null, _orderby));
 }
예제 #5
0
 public List <AboutService_Info> GetByParam(AboutService_Filter Filter, Paging Page)
 {
     return(GetByParam(Filter, Page, null, ""));
 }
예제 #6
0
        private Rest.Core.PetaPoco.Sql ConstructSQL(AboutService_Filter filter, string[] fieldNames, string _orderby)
        {
            var SQLStr = Rest.Core.PetaPoco.Sql.Builder
                         .Append("SELECT " + FieldNameArrayToFieldNameString(fieldNames) + " FROM db_AboutService")
                         .Append("WHERE 1=1 ");

            if (filter != null)
            {
                if (filter.AboutServiceId.HasValue)
                {
                    SQLStr.Append(" AND AboutServiceId=@0", filter.AboutServiceId.Value);
                }
                if (filter.SortNum.HasValue)
                {
                    SQLStr.Append(" AND SortNum=@0", filter.SortNum.Value);
                }
                if (!string.IsNullOrEmpty(filter.UnitName))
                {
                    SQLStr.Append(" AND UnitName=@0", filter.UnitName);
                }
                if (!string.IsNullOrEmpty(filter.Description))
                {
                    SQLStr.Append(" AND Description=@0", filter.Description);
                }
                if (filter.OpenType.HasValue)
                {
                    SQLStr.Append(" AND OpenType=@0", filter.OpenType.Value);
                }
                if (filter.DisplayType.HasValue)
                {
                    SQLStr.Append(" AND DisplayType=@0", filter.DisplayType.Value);
                }
                if (!string.IsNullOrEmpty(filter.Link))
                {
                    SQLStr.Append(" AND Link=@0", filter.Link);
                }
                if (!string.IsNullOrEmpty(filter.ContentBody1))
                {
                    SQLStr.Append(" AND ContentBody1=@0", filter.ContentBody1);
                }
                if (!string.IsNullOrEmpty(filter.ContentBody2))
                {
                    SQLStr.Append(" AND ContentBody2=@0", filter.ContentBody2);
                }
                if (!string.IsNullOrEmpty(filter.ContentBody3))
                {
                    SQLStr.Append(" AND ContentBody3=@0", filter.ContentBody3);
                }
                if (!string.IsNullOrEmpty(filter.Image1))
                {
                    SQLStr.Append(" AND Image1=@0", filter.Image1);
                }
                if (!string.IsNullOrEmpty(filter.Image2))
                {
                    SQLStr.Append(" AND Image2=@0", filter.Image2);
                }
                if (!string.IsNullOrEmpty(filter.Image3))
                {
                    SQLStr.Append(" AND Image3=@0", filter.Image3);
                }
                if (filter.Position1.HasValue)
                {
                    SQLStr.Append(" AND Position1=@0", filter.Position1.Value);
                }
                if (filter.Position2.HasValue)
                {
                    SQLStr.Append(" AND Position2=@0", filter.Position2.Value);
                }
                if (filter.Position3.HasValue)
                {
                    SQLStr.Append(" AND Position3=@0", filter.Position3.Value);
                }
                if (filter.IsActive.HasValue)
                {
                    SQLStr.Append(" AND IsActive=@0", filter.IsActive.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);
        }
예제 #7
0
 private Rest.Core.PetaPoco.Sql ConstructSQL(AboutService_Filter filter)
 {
     return(ConstructSQL(filter, new string[] { "*" }, ""));
 }
예제 #8
0
 public List <AboutService_Info> GetByParameter(AboutService_Filter Filter, string[] fieldNames, string _orderby, Rest.Core.Paging Page)
 {
     return(new AboutService_Repo().GetByParam(Filter, fieldNames, _orderby, Page));
 }
예제 #9
0
 public List <AboutService_Info> GetByParameter(AboutService_Filter Filter, string _orderby)
 {
     return(new AboutService_Repo().GetByParam(Filter, _orderby));
 }
예제 #10
0
 public List <AboutService_Info> GetByParameter(AboutService_Filter Filter, Rest.Core.Paging Page)
 {
     return(new AboutService_Repo().GetByParam(Filter, Page));
 }
예제 #11
0
 public List <AboutService_Info> GetByParameter(AboutService_Filter Filter)
 {
     return(new AboutService_Repo().GetByParam(Filter));
 }