public ActionResult _AjaxList(GridCommand command, ItemDiscontinueSearchModel searchModel)
        {
                SearchStatementModel searchStatementModel = this.PrepareSearchStatement(command, searchModel);
                 return PartialView(GetAjaxPageData<ItemDiscontinue>(searchStatementModel, command));

            
        }
        /// <summary>
        /// Search Statement
        /// </summary>
        /// <param name="command">Telerik GridCommand</param>
        /// <param name="searchModel">ItemDiscontinueSearchModel Search Model</param>
        /// <returns>return Search Statement</returns>
        private SearchStatementModel PrepareSearchStatement(GridCommand command, ItemDiscontinueSearchModel searchModel)
        {
            string whereStatement = string.Empty;

            IList<object> param = new List<object>();
            
            HqlStatementHelper.AddLikeStatement("Item", searchModel.Item, HqlStatementHelper.LikeMatchMode.End, "i", ref whereStatement, param);
            HqlStatementHelper.AddLikeStatement("DiscontinueItem", searchModel.DiscontinueItem, HqlStatementHelper.LikeMatchMode.End, "i", ref whereStatement, param);
            if (searchModel.StartDate != null )
            {
                HqlStatementHelper.AddGeStatement("StartDate", searchModel.StartDate, "i", ref whereStatement, param);
            }
             if (searchModel.EndDate != null )
            {
                HqlStatementHelper.AddLeStatement("EndDate", searchModel.EndDate, "i", ref whereStatement, param);
            }
            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);

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

            return searchStatementModel;
        }
 public ActionResult List(GridCommand command, ItemDiscontinueSearchModel 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();
 }
 public ActionResult List(GridCommand command, ItemDiscontinueSearchModel searchModel)
 {
     SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel);
     ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
     return View();
 }