public ActionResult Categoary(AboutCategory_Filter filter, Rest.Core.Paging Page) { var PermissionCheck = CheckPermission("關於萬芳管理"); if (PermissionCheck != null) { return(PermissionCheck); } if (filter.Category == "請輸入系列名稱搜尋") { filter.Category = null; } ViewData["Filter"] = filter; Rest.Core.Paging page = new Rest.Core.Paging() { }; if (Page.CurrentPage > 0) { page.CurrentPage = Page.CurrentPage; } List <AboutCategory_Info> data = AboutCateMan.GetByParameter(filter, page, null, "SortNum"); List <About_Info> About = AboutMan.GetAll().OrderBy(x => x.SortNum).ToList(); ViewData["Model"] = data; ViewData["About"] = About; ViewData["Page"] = page; return(View()); }
private Rest.Core.PetaPoco.Sql ConstructSQL(AboutCategory_Filter filter, string[] fieldNames, string _orderby) { var SQLStr = Rest.Core.PetaPoco.Sql.Builder .Append("SELECT " + FieldNameArrayToFieldNameString(fieldNames) + " FROM db_AboutCategory") .Append("WHERE 1=1 "); if (filter != null) { if (filter.AboutCategoryId.HasValue) { SQLStr.Append(" AND AboutCategoryId=@0", filter.AboutCategoryId.Value); } if (filter.AboutId.HasValue) { SQLStr.Append(" AND AboutId=@0", filter.AboutId.Value); } if (filter.SortNum.HasValue) { SQLStr.Append(" AND SortNum=@0", filter.SortNum.Value); } if (!string.IsNullOrEmpty(filter.Category)) { SQLStr.Append(" AND Category like @0", "%" + filter.Category + "%"); } 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 (_orderby != "") { SQLStr.OrderBy(_orderby); } } return(SQLStr); }
public List <AboutCategory_Info> GetByParam(AboutCategory_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 <AboutCategory_Info>(Page.CurrentPage, Page.ItemsPerPage, SQLStr); Page.Convert <AboutCategory_Info>(result); return(result.Items); } }
public List <AboutCategory_Info> GetByParameter(AboutCategory_Filter Filter, string[] fieldNames, string _orderby, Rest.Core.Paging Page) { return(new AboutCategory_Repo().GetByParam(Filter, fieldNames, _orderby, Page)); }
public List <AboutCategory_Info> GetByParameter(AboutCategory_Filter Filter, string _orderby) { return(new AboutCategory_Repo().GetByParam(Filter, _orderby)); }
public List <AboutCategory_Info> GetByParameter(AboutCategory_Filter Filter, Rest.Core.Paging Page) { return(new AboutCategory_Repo().GetByParam(Filter, Page)); }
public List <AboutCategory_Info> GetByParameter(AboutCategory_Filter Filter) { return(new AboutCategory_Repo().GetByParam(Filter)); }
public List <AboutCategory_Info> GetByParam(AboutCategory_Filter Filter, string[] fieldNames, string _orderby, Paging Page) { return(GetByParam(Filter, Page, fieldNames, _orderby)); }
public List <AboutCategory_Info> GetByParam(AboutCategory_Filter Filter, string _orderby) { return(GetByParam(Filter, null, null, _orderby)); }
public List <AboutCategory_Info> GetByParam(AboutCategory_Filter Filter, Paging Page) { return(GetByParam(Filter, Page, null, "")); }
private Rest.Core.PetaPoco.Sql ConstructSQL(AboutCategory_Filter filter) { return(ConstructSQL(filter, new string[] { "*" }, "")); }