public ActionResult _AjaxSpecialTimeList(GridCommand command, SpecialTimeSearchModel searchModel)
        {

            string replaceFrom = "_AjaxSpecialTimeList";
            string replaceTo = "SpecialTimeList/";
            this.GetCommand(ref command, searchModel, replaceFrom, replaceTo);

            SearchStatementModel searchStatementModel = this.SpecialTimePrepareSearchStatement(command, searchModel);
            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 = string.Empty;

            IList<object> param = new List<object>();

            if (searchModel.Region == null)
            {
                // whereStatement = " where Region is null";
                HqlStatementHelper.AddLikeStatement("Region", string.Empty, HqlStatementHelper.LikeMatchMode.Start, "s", ref whereStatement, param);
            }
            else
            {
                HqlStatementHelper.AddEqStatement("Region", searchModel.Region, "s", ref whereStatement, param);
            }
            HqlStatementHelper.AddEqStatement("Flow", searchModel.Flow, "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 = "Order by StartTime desc";
            searchStatementModel.Parameters = param.ToArray<object>();

            return searchStatementModel;
        }
 public ActionResult SpecialTimeList(GridCommand command, SpecialTimeSearchModel searchModel)
 {
     //TempData["SpecialTimeSearchModel"] = searchModel;
     SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel);
     if (searchCacheModel.isBack == true)
     {
         ViewBag.Page = searchCacheModel.Command.Page==0 ? 1 : searchCacheModel.Command.Page;
     }
     ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
     return PartialView();
 }