public ActionResult List(GridCommand command, SpecialTimeSearchModel searchModel)
 {
     SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel);
     ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
     return View();
 }
 public ActionResult _AjaxList(GridCommand command, SpecialTimeSearchModel searchModel)
 {
     string whereStatement = " where s.Type=" + (int)com.Sconit.CodeMaster.WorkingCalendarType.Rest + " ";
     SearchStatementModel searchStatementModel = this.SpecialTimePrepareSearchStatement(command, searchModel, whereStatement);
     return PartialView(GetAjaxPageData<SpecialTime>(searchStatementModel, command));
 }
        /// <summary>
        /// Search Statement
        /// </summary>
        /// <param name="command">Telerik GridCommand</param>
        /// <param name="searchModel">SpecialTime Search Model</param>
        /// <returns>Search Statement</returns>
        private SearchStatementModel SpecialTimePrepareSearchStatement(GridCommand command, SpecialTimeSearchModel searchModel, string whereStatement)
        {
            IList<object> param = new List<object>();
            HqlStatementHelper.AddEqStatement("Category", (int)WorkingCalendarCategory.ProdLine, "s", ref whereStatement, param);
            if (searchModel.Region == null)
            {
                HqlStatementHelper.AddLikeStatement("ProdLine", string.Empty, HqlStatementHelper.LikeMatchMode.Start, "s", ref whereStatement, param);
            }
            else
            {
                HqlStatementHelper.AddEqStatement("ProdLine", searchModel.Region, "s", ref whereStatement, param);
            }

            if (searchModel.StartTime != null)
            {
                HqlStatementHelper.AddGeStatement("StartTime", searchModel.StartTime, "s", ref whereStatement, param);
            }
            if (searchModel.EndTime != null)
            {
                HqlStatementHelper.AddLeStatement("EndTime", searchModel.EndTime, "s", ref whereStatement, param);
            }

            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);

            SearchStatementModel searchStatementModel = new SearchStatementModel();
            searchStatementModel.SelectCountStatement = specialTimeSelectCountStatement;
            searchStatementModel.SelectStatement = specialTimeSelectStatement;
            searchStatementModel.WhereStatement = whereStatement;
            searchStatementModel.SortingStatement = sortingStatement;
            searchStatementModel.Parameters = param.ToArray<object>();

            return searchStatementModel;
        }