Esempio n. 1
0
        public List <TeamIntroduce_Info> GetByParam(TeamIntroduce_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 <TeamIntroduce_Info>(Page.CurrentPage, Page.ItemsPerPage, SQLStr);
                Page.Convert <TeamIntroduce_Info>(result);

                return(result.Items);
            }
        }
Esempio n. 2
0
        public ActionResult TeamIntroduce(TeamIntroduce_Filter filter, Rest.Core.Paging Page)
        {
            var PermissionCheck = CheckPermission("團隊介紹管理");

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

            if (!string.IsNullOrEmpty(filter.ContentBody) && filter.ContentBody.StartsWith("請輸入"))
            {
                filter.ContentBody = null;
            }
            if (filter != null && !string.IsNullOrEmpty(filter.CostName) && filter.CostName.StartsWith("請選擇"))
            {
                filter.CostName = null;
            }
            if (filter != null && !string.IsNullOrEmpty(filter.DeptName) && filter.DeptName.StartsWith("請選擇"))
            {
                filter.DeptName = null;
            }
            if (!string.IsNullOrEmpty(filter.DeptName))
            {
                filter.DeptName = EnumHelper.GetEnumDescription <WS_Dept_type>(EnumHelper.GetEnumByName <WS_Dept_type>(filter.DeptName));
            }

            ViewData["Filter"] = filter;

            Rest.Core.Paging page = new Rest.Core.Paging()
            {
            };
            if (Page.CurrentPage > 0)
            {
                page.CurrentPage = Page.CurrentPage;
            }
            List <TeamIntroduce_Info> data = TeamMan.GetByParameter(filter, page, null, "TeamIntroduceId desc");

            ViewData["Model"] = data;
            ViewData["Page"]  = page;
            return(View());
        }
Esempio n. 3
0
 public List <TeamIntroduce_Info> GetByParameter(TeamIntroduce_Filter Filter, string[] fieldNames, string _orderby, Rest.Core.Paging Page)
 {
     return(new TeamIntroduce_Repo().GetByParam(Filter, fieldNames, _orderby, Page));
 }
Esempio n. 4
0
 public List <TeamIntroduce_Info> GetByParameter(TeamIntroduce_Filter Filter, string _orderby)
 {
     return(new TeamIntroduce_Repo().GetByParam(Filter, _orderby));
 }
Esempio n. 5
0
 public List <TeamIntroduce_Info> GetByParameter(TeamIntroduce_Filter Filter, Rest.Core.Paging Page)
 {
     return(new TeamIntroduce_Repo().GetByParam(Filter, Page));
 }
Esempio n. 6
0
 public List <TeamIntroduce_Info> GetByParameter(TeamIntroduce_Filter Filter)
 {
     return(new TeamIntroduce_Repo().GetByParam(Filter));
 }
Esempio n. 7
0
 public List <TeamIntroduce_Info> GetByParam(TeamIntroduce_Filter Filter, string[] fieldNames, string _orderby, Paging Page)
 {
     return(GetByParam(Filter, Page, fieldNames, _orderby));
 }
Esempio n. 8
0
 public List <TeamIntroduce_Info> GetByParam(TeamIntroduce_Filter Filter, string _orderby)
 {
     return(GetByParam(Filter, null, null, _orderby));
 }
Esempio n. 9
0
 public List <TeamIntroduce_Info> GetByParam(TeamIntroduce_Filter Filter, Paging Page)
 {
     return(GetByParam(Filter, Page, null, ""));
 }
Esempio n. 10
0
        private Rest.Core.PetaPoco.Sql ConstructSQL(TeamIntroduce_Filter filter, string[] fieldNames, string _orderby)
        {
            var SQLStr = Rest.Core.PetaPoco.Sql.Builder
                         .Append("SELECT " + FieldNameArrayToFieldNameString(fieldNames) + " FROM db_TeamIntroduce")
                         .Append("WHERE 1=1 ");

            if (filter != null)
            {
                if (filter.TeamIntroduceId.HasValue)
                {
                    SQLStr.Append(" AND TeamIntroduceId=@0", filter.TeamIntroduceId.Value);
                }
                if (!string.IsNullOrEmpty(filter.Dept))
                {
                    SQLStr.Append(" AND Dept=@0", filter.Dept);
                }
                if (!string.IsNullOrEmpty(filter.DeptName))
                {
                    SQLStr.Append(" AND DeptName=@0", filter.DeptName);
                }
                if (!string.IsNullOrEmpty(filter.CostName))
                {
                    SQLStr.Append(" AND CostName=@0", filter.CostName);
                }
                if (!string.IsNullOrEmpty(filter.CostId))
                {
                    SQLStr.Append(" AND CostId=@0", filter.CostId);
                }
                if (!string.IsNullOrEmpty(filter.WebMenuCode))
                {
                    SQLStr.Append(" AND WebMenuCode=@0", filter.WebMenuCode);
                }
                if (!string.IsNullOrEmpty(filter.WebMenuName))
                {
                    SQLStr.Append(" AND WebMenuName=@0", filter.WebMenuName);
                }
                if (!string.IsNullOrEmpty(filter.Description))
                {
                    SQLStr.Append(" AND Description=@0", filter.Description);
                }
                if (!string.IsNullOrEmpty(filter.ContentBody))
                {
                    SQLStr.Append(" AND ContentBody like @0", "%" + filter.ContentBody + "%");
                }
                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 (!string.IsNullOrEmpty(filter.Image4))
                {
                    SQLStr.Append(" AND Image4=@0", filter.Image4);
                }
                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);
        }
Esempio n. 11
0
 private Rest.Core.PetaPoco.Sql ConstructSQL(TeamIntroduce_Filter filter)
 {
     return(ConstructSQL(filter, new string[] { "*" }, ""));
 }