private QiuZhiViewModel GetQiuZhis() { Paging page = InitPage(20); QiuZhiViewModel model = QiuZhiBLL.Instance.FindAll(page); return(model); }
public ActionResult Select(string search_jobTrade, string search_job, string search_WorkYear, string search_workPlace, string search_money, string search_study, string search_worktype) { ResultInfo ri = new ResultInfo(); Paging page = InitPage(20); QiuZhiViewModel model = QiuZhiBLL.Instance.SelectByCondition(page, search_jobTrade, search_job, search_WorkYear, search_workPlace, search_money, search_study, search_worktype); return(PartialView("_Search", model)); }
public QiuZhiViewModel FindAll(Paging page, string key = null) { QiuZhiViewModel model = new QiuZhiViewModel(); var ds = dal.SearchByRows(page.StartIndex, page.EndIndex, key); int count = Convert.ToInt32(ds.Tables[0].Rows[0][0]); page.RecordCount = count; model.QiuZhiList = ModelConvertHelper <_QiuZhi> .ConvertToList(ds.Tables[1]); model.QiuZhiPage = page; return(model); }
public ActionResult Search(string key) { ResultInfo ri = new ResultInfo(); if (key.IsNotNullOrEmpty()) { Paging page = InitPage(20); QiuZhiViewModel model = QiuZhiBLL.Instance.FindAll(page, key); return(PartialView("_Search", model)); } else { ri.Msg = "请输入关键词"; } return(Result(ri)); }
public QiuZhiViewModel SelectByCondition(Paging page, string search_jobTrade, string search_job, string search_WorkYear, string search_workPlace, string search_money, string search_study, string search_worktype) { StringBuilder sb = new StringBuilder(); if (IsSafe(search_jobTrade)) { sb.Append(@" and a.BelongJobTrade='{0}' ".FormatWith(search_jobTrade)); } if (IsSafe(search_job)) { sb.Append(" and a.BelongJob = '{0}' ".FormatWith(search_job)); } if (IsSafe(search_WorkYear)) { sb.Append(" and a.WorkYear = {0}' ".FormatWith(search_WorkYear)); } if (IsSafe(search_workPlace)) { search_workPlace = search_workPlace.IndexOf("市") > -1 ? search_workPlace.Replace("市", string.Empty) : search_workPlace; sb.Append(" and a.WorkPlace like '%{0}%'".FormatWith(search_workPlace)); } if (IsSafe(search_money) && MatchHelper.IsNum.IsMatch(search_money)) { sb.Append(" and a.[Money]={0}".FormatWith(search_money)); } if (IsSafe(search_study) && MatchHelper.IsNum.IsMatch(search_study)) { sb.Append(" and a.Study={0}".FormatWith(search_study)); } if (IsSafe(search_worktype) && MatchHelper.IsNum.IsMatch(search_worktype)) { sb.Append(" and a.WorkType={0}".FormatWith(search_worktype)); } var model = new QiuZhiViewModel(); var ds = dal.SelectByCondition(page.StartIndex, page.EndIndex, sb.ToString()); int count = Convert.ToInt32(ds.Tables[0].Rows[0][0]); page.RecordCount = count; model.QiuZhiList = ModelConvertHelper <_QiuZhi> .ConvertToList(ds.Tables[1]); model.QiuZhiPage = page; return(model); }