public ActionResult _AjaxList(GridCommand command, WorkingCalendarSearchModel searchModel)
 {
     string replaceFrom = "_AjaxList";
     string replaceTo = "List/";
     this.GetCommand(ref command, searchModel, replaceFrom, replaceTo);
     SearchStatementModel searchStatementModel = this.PrepareSearchStatement(command, searchModel);
     return PartialView(GetAjaxPageData<WorkingCalendar>(searchStatementModel, command));
 }
 public ActionResult List(GridCommand command, WorkingCalendarSearchModel searchModel)
 {
     //TempData["WorkingCalendarSearchModel"] = 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();
 }
        /// <summary>
        /// Search Statement
        /// </summary>
        /// <param name="command">Telerik GridCommand</param>
        /// <param name="searchModel">WorkingCalendar Search Model</param>
        /// <returns>Search Statement</returns>
        private SearchStatementModel ViewPrepareSearchStatement(GridCommand command, WorkingCalendarSearchModel searchModel)
        {
            string whereStatement = string.Empty;

            IList<object> param = new List<object>();
            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);

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

            return searchStatementModel;
        }
 public ActionResult _Search(GridCommand command, WorkingCalendarSearchModel searchModel)
 {
     TempData["WorkingCalendarSearchModel"] = searchModel;
     return PartialView();
 }
        /// <summary>
        /// Search Statement
        /// </summary>
        /// <param name="command">Telerik GridCommand</param>
        /// <param name="searchModel">WorkingCalendar Search Model</param>
        /// <returns>Search Statement</returns>
        private SearchStatementModel PrepareSearchStatement(GridCommand command, WorkingCalendarSearchModel 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, "w", ref whereStatement, param);
            }
            else
            {
                HqlStatementHelper.AddEqStatement("Region", searchModel.Region, "w", ref whereStatement, param);
            }
            HqlStatementHelper.AddEqStatement("Flow", searchModel.Flow, "w", ref whereStatement, param);
            ////HqlStatementHelper.AddLikeStatement("DayOfWeek", searchModel.DayOfWeek, HqlStatementHelper.LikeMatchMode.Anywhere, "w", ref whereStatement, param);
            ////HqlStatementHelper.AddEqStatement("Type", searchModel.Type, "w", 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;
        }