public ActionResult Nhi_p(Nhi_p_Filter filter, Rest.Core.Paging Page) { var PermissionCheck = CheckPermission("健保專區管理"); if (PermissionCheck != null) { return(PermissionCheck); } if (!string.IsNullOrEmpty(filter.nhi_cname) && filter.nhi_cname.StartsWith("請輸入")) { filter.nhi_cname = null; } if (filter != null && !string.IsNullOrEmpty(filter.nhi_code) && filter.nhi_code.StartsWith("請選擇")) { filter.nhi_code = null; } ViewData["Filter"] = filter; Rest.Core.Paging page = new Rest.Core.Paging() { }; if (Page.CurrentPage > 0) { page.CurrentPage = Page.CurrentPage; } List <Nhi_p_Info> data = Nhi_pMan.GetByParameter(filter, page, null, "nhi_date desc"); data.ForEach(x => { x.nhi_cname = System.Web.HttpUtility.HtmlEncode(x.nhi_cname); }); ViewData["Model"] = data; ViewData["Page"] = page; return(View()); }
public List <Nhi_p_Info> GetByParam(Nhi_p_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 <Nhi_p_Info>(Page.CurrentPage, Page.ItemsPerPage, SQLStr); Page.Convert <Nhi_p_Info>(result); return(result.Items); } }
public List <Nhi_p_Info> GetByParam(Nhi_p_Filter Filter, string[] fieldNames, string _orderby, Paging Page) { return(GetByParam(Filter, Page, fieldNames, _orderby)); }
public List <Nhi_p_Info> GetByParam(Nhi_p_Filter Filter, string _orderby, Paging Page) { return(GetByParam(Filter, Page, null, _orderby)); }
public List <Nhi_p_Info> GetByParam(Nhi_p_Filter Filter, Paging Page) { return(GetByParam(Filter, Page, null, "")); }
public List <Nhi_p_Info> GetByParam(Nhi_p_Filter Filter) { return(GetByParam(Filter, null, null, "")); }
private Rest.Core.PetaPoco.Sql ConstructSQL(Nhi_p_Filter filter, string[] fieldNames, string _orderby) { var SQLStr = Rest.Core.PetaPoco.Sql.Builder .Append("SELECT " + FieldNameArrayToFieldNameString(fieldNames) + " FROM db_Nhi_p") .Append("WHERE 1=1 "); if (filter != null) { if (filter.nhi_pId.HasValue) { SQLStr.Append(" AND nhi_pId=@0", filter.nhi_pId.Value); } if (filter.nhi_date.HasValue) { SQLStr.Append(" AND nhi_date=@0", filter.nhi_date.Value); } if (!string.IsNullOrEmpty(filter.nhi_code)) { SQLStr.Append(" AND nhi_code=@0", filter.nhi_code); } if (!string.IsNullOrEmpty(filter.nhi_type)) { SQLStr.Append(" AND nhi_type=@0", filter.nhi_type); } if (!string.IsNullOrEmpty(filter.nhi_cname)) { SQLStr.Append(" AND nhi_cname like @0", "%" + filter.nhi_cname + "%"); } if (!string.IsNullOrEmpty(filter.nhi_ename)) { SQLStr.Append(" AND nhi_ename=@0", filter.nhi_ename); } if (!string.IsNullOrEmpty(filter.fee_code)) { SQLStr.Append(" AND fee_code=@0", filter.fee_code); } if (!string.IsNullOrEmpty(filter.HealthCode)) { SQLStr.Append(" AND HealthCode=@0", filter.HealthCode); } if (!string.IsNullOrEmpty(filter.mark_name)) { SQLStr.Append(" AND mark_name=@0", filter.mark_name); } if (!string.IsNullOrEmpty(filter.unit)) { SQLStr.Append(" AND unit=@0", filter.unit); } if (!string.IsNullOrEmpty(filter.nhi_cost)) { SQLStr.Append(" AND nhi_cost=@0", filter.nhi_cost); } if (!string.IsNullOrEmpty(filter.self_cost)) { SQLStr.Append(" AND self_cost=@0", filter.self_cost); } if (!string.IsNullOrEmpty(filter.price_dif)) { SQLStr.Append(" AND price_dif=@0", filter.price_dif); } if (filter.hit.HasValue) { SQLStr.Append(" AND hit=@0", filter.hit.Value); } if (!string.IsNullOrEmpty(filter.warnings)) { SQLStr.Append(" AND warnings=@0", filter.warnings); } if (!string.IsNullOrEmpty(filter.contrain)) { SQLStr.Append(" AND contrain=@0", filter.contrain); } if (!string.IsNullOrEmpty(filter.sideffect)) { SQLStr.Append(" AND sideffect=@0", filter.sideffect); } 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); }
private Rest.Core.PetaPoco.Sql ConstructSQL(Nhi_p_Filter filter) { return(ConstructSQL(filter, new string[] { "*" }, "")); }
public List <Nhi_p_Info> GetByParameter(Nhi_p_Filter Filter, string[] fieldNames, string _orderby, Rest.Core.Paging Page) { return(new Nhi_p_Repo().GetByParam(Filter, fieldNames, _orderby, Page)); }
public List <Nhi_p_Info> GetByParameter(Nhi_p_Filter Filter, string _orderby) { return(new Nhi_p_Repo().GetByParam(Filter, _orderby)); }
public List <Nhi_p_Info> GetByParameter(Nhi_p_Filter Filter, Rest.Core.Paging Page) { return(new Nhi_p_Repo().GetByParam(Filter, Page)); }
public List <Nhi_p_Info> GetByParameter(Nhi_p_Filter Filter) { return(new Nhi_p_Repo().GetByParam(Filter)); }