public ActionResult List(GridCommand command, MaintainPlanSearchModel 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 View();
 }
        private SearchStatementModel FacilityMaintainPlanPrepareSearchStatement(GridCommand command, MaintainPlanSearchModel maintainPlanSearchModel, string fcId)
        {
            string whereStatement = " where f.FCID='" + fcId + "'";

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

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

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

            return searchStatementModel;
        }
 public ActionResult _AjaxFacilityMaintainPlanList(GridCommand command, MaintainPlanSearchModel maintainPlanSearchModel, string fcId)
 {
     SearchStatementModel searchStatementModel = this.FacilityMaintainPlanPrepareSearchStatement(command, maintainPlanSearchModel, fcId);
     return PartialView(GetAjaxPageData<FacilityMaintainPlan>(searchStatementModel, command));
 }
        public ActionResult _FacilityMaintainPlanList(GridCommand command, MaintainPlanSearchModel searchModel, string FCID)
        {
            ViewBag.FCID = FCID;

            SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel);
            ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
            return PartialView();
        }
 public ActionResult _AjaxList(GridCommand command, MaintainPlanSearchModel searchModel)
 {
     this.GetCommand(ref command, searchModel);
     SearchStatementModel searchStatementModel = this.PrepareSearchStatement(command, searchModel);
     return PartialView(GetAjaxPageData<MaintainPlan>(searchStatementModel, command));
 }
        /// <summary>
        /// Search Statement
        /// </summary>
        /// <param name="command">Telerik GridCommand</param>
        /// <param name="searchModel">MaintainPlan Search Model</param>
        /// <returns>return maintainPlan search model</returns>
        private SearchStatementModel PrepareSearchStatement(GridCommand command, MaintainPlanSearchModel searchModel)
        {            
            string whereStatement = string.Empty;

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

            HqlStatementHelper.AddLikeStatement("Code", searchModel.Code, HqlStatementHelper.LikeMatchMode.Start, "m", ref whereStatement, param);
            HqlStatementHelper.AddLikeStatement("Description", searchModel.Description, HqlStatementHelper.LikeMatchMode.Anywhere, "m", 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;
        }