private SearchStatementModel PrepareSearchStatement(GridCommand command, SMSRecSearchModel searchModel) { string whereStatement = string.Empty; IList<object> param = new List<object>(); HqlStatementHelper.AddLikeStatement("Issue", searchModel.Issue, HqlStatementHelper.LikeMatchMode.Start, "sms", ref whereStatement, param); HqlStatementHelper.AddLikeStatement("MsgID", searchModel.MsgID, HqlStatementHelper.LikeMatchMode.Start, "sms", ref whereStatement, param); HqlStatementHelper.AddLikeStatement("Content", searchModel.Content, HqlStatementHelper.LikeMatchMode.Start, "sms", ref whereStatement, param); HqlStatementHelper.AddLikeStatement("SrcID", searchModel.SrcID, HqlStatementHelper.LikeMatchMode.Start, "sms", ref whereStatement, param); if (searchModel.DateFrom != null & searchModel.DateTo != null) { HqlStatementHelper.AddBetweenStatement("CreateDate", searchModel.DateFrom, searchModel.DateTo, "sms", ref whereStatement, param); } else if (searchModel.DateFrom != null & searchModel.DateTo == null) { HqlStatementHelper.AddGeStatement("CreateDate", searchModel.DateFrom, "sms", ref whereStatement, param); } else if (searchModel.DateFrom == null & searchModel.DateTo != null) { HqlStatementHelper.AddLeStatement("CreateDate", searchModel.DateTo, "sms", ref whereStatement, param); } HqlStatementHelper.AddEqStatement("EventHandler", SMSStatus.SMSEventHeadler_MESSAGERECEIVEDINTERFACE, "sms", ref whereStatement, param); string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors); SearchStatementModel searchStatementModel = new SearchStatementModel(); searchStatementModel.SelectCountStatement = selectCountStatement; searchStatementModel.SelectStatement = selectStatement; searchStatementModel.WhereStatement = whereStatement; searchStatementModel.SortingStatement = sortingStatement; searchStatementModel.Parameters = param.ToArray<object>(); return searchStatementModel; }
public ActionResult _AjaxList(GridCommand command, SMSRecSearchModel searchModel) { SearchStatementModel searchStatementModel = PrepareSearchStatement(command, searchModel); return PartialView(GetAjaxPageData<SMSStatus>(searchStatementModel, command)); }
public ActionResult List(GridCommand command, SMSRecSearchModel searchModel) { TempData["SMSRecSearchModel"] = searchModel; ViewBag.PageSize = base.ProcessPageSize(command.PageSize); return View(); }