Beispiel #1
1
        public GridPagerTests()
        {
            grid = Substitute.For<IGrid<GridModel>>();
            grid.Query = new NameValueCollection();
            grid.Name = "Grid";

            pager = new GridPager<GridModel>(grid);
        }
Beispiel #2
0
        public GridPagerTests()
        {
            grid = Substitute.For<IGrid<GridModel>>();
            grid.Query = TestHelper.ParseQuery("");
            grid.Name = "Grid";

            pager = new GridPager<GridModel>(grid);
        }
Beispiel #3
0
 protected void BindRoles(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.Pager)
         {
             _replyPager = (GridPager)e.Row.FindControl("pager");
             _replyPager.PageCount = Common.CalculateNumberOfPages(RowCount, Config.TopicPageSize);
             _replyPager.CurrentIndex = CurrentPage;
         }
 }
Beispiel #4
0
        public GridPager<Webuser> GetPagerList(GridPagerParam param,List<int> searchIds)
        {
            var r = new GridPager<Webuser>(false);

            r.Data = webuserDal.GetPagerList(param, searchIds);
            r.ActionResult = (r.Data != null) ? true : false;

            return r;
        }
Beispiel #5
0
 public GridPager<WebuserContact> GetPagerList(string searchName, DateTime? startTime, DateTime? endTime, GridPagerParam param, long operationBy, bool isUnion = false)
 {
     ArgumentHelper.AssertInRange("operationBy", (int)operationBy, 1, int.MaxValue);
     startTime = startTime.HasValue ? startTime.Value : DateTime.Now.AddDays(-1.0);
     endTime = endTime.HasValue ? endTime.Value : DateTime.Now.AddDays(1.0);
     var r = new GridPager<WebuserContact>(false);
     int total = 0;
     if (isUnion)
     {
         r.Data = webusercontactDal.GetUnion(searchName, startTime.Value, endTime.Value, param, operationBy, out total);
         r.ActionResult = (r.Data != null) ? true : false;
     }
     else
     {
         r.Data = webusercontactDal.GetJoin(searchName, startTime.Value, endTime.Value, param, operationBy, out total);
         r.ActionResult = (r.Data != null) ? true : false;
     } return r;
 }
Beispiel #6
0
 public virtual List <SysSampleModel> GetListByDepId(ref GridPager pager, string depId, string queryStr)
 {
     return(new List <SysSampleModel>());
 }
 public virtual List <MIS_WebIM_MessageModel> GetListByDepId(ref GridPager pager, string depId, string queryStr)
 {
     return(new List <MIS_WebIM_MessageModel>());
 }
        public virtual List <Apps.Models.SCV.INTERFACE.INTERFACE_FAILURE_MODEL> GetList(ref GridPager pager, string queryStr, Expression <Func <Apps.Models.INTERFACE_FAILURE, bool> > where = null)
        {
            IQueryable <Apps.Models.INTERFACE_FAILURE> queryData;

            if (!string.IsNullOrWhiteSpace(queryStr))
            {
                queryData = m_Rep.GetList(where

                                          , a => a.INTERFACE_TYPE.Contains(queryStr) ||
                                          a.DIRECTION.Contains(queryStr) ||
                                          a.INTERFACE_RECORD_ID.Contains(queryStr) ||
                                          a.WAREHOUSE.Contains(queryStr) ||
                                          a.REFERENCE_ID.Contains(queryStr)

                                          || a.MESSAGE.Contains(queryStr)



                                          || a.PROCESS_STAMP.Contains(queryStr)
                                          );
            }
            else
            {
                queryData = m_Rep.GetList(where);
            }


            pager.totalRows = queryData.Count();
            //排序
            queryData = LinqHelper.SortingAndPaging(queryData, pager.sort, pager.order, pager.page, pager.rows);
            return(CreateModelList(ref queryData));
        }
Beispiel #9
0
        public virtual List <Apps.Models.SCV.Sys.LOCATION_MODEL> GetList(ref GridPager pager, string queryStr, Expression <Func <Apps.Models.LOCATION, bool> > where = null)
        {
            IQueryable <Apps.Models.LOCATION> queryData;

            if (!string.IsNullOrWhiteSpace(queryStr))
            {
                queryData = m_Rep.GetList(where

                                          , a => a.LOCATION1.Contains(queryStr) ||
                                          a.WAREHOUSE.Contains(queryStr) ||
                                          a.ZONE.Contains(queryStr) ||
                                          a.LOCATION_CLASS.Contains(queryStr) ||
                                          a.LOCATION_TYPE.Contains(queryStr) ||
                                          a.MULTI_ITEM.Contains(queryStr) ||
                                          a.TRACK_LPN.Contains(queryStr) ||
                                          a.LOCATION_STS.Contains(queryStr)

                                          || a.ACTIVE.Contains(queryStr) ||
                                          a.USER_STAMP.Contains(queryStr)

                                          || a.TEMPLATE_FIELD1.Contains(queryStr) ||
                                          a.TEMPLATE_FIELD2.Contains(queryStr) ||
                                          a.TEMPLATE_FIELD3.Contains(queryStr) ||
                                          a.TEMPLATE_FIELD4.Contains(queryStr) ||
                                          a.TEMPLATE_FIELD5.Contains(queryStr) ||
                                          a.MIN_QTY_UM.Contains(queryStr)

                                          || a.USER_DEF1.Contains(queryStr) ||
                                          a.USER_DEF2.Contains(queryStr) ||
                                          a.USER_DEF3.Contains(queryStr) ||
                                          a.USER_DEF4.Contains(queryStr) ||
                                          a.USER_DEF5.Contains(queryStr) ||
                                          a.USER_DEF6.Contains(queryStr) ||
                                          a.USER_DEF7.Contains(queryStr) ||
                                          a.USER_DEF8.Contains(queryStr) ||
                                          a.CHECK_DIGIT.Contains(queryStr)

                                          || a.LOCATION_SUB_CLASS.Contains(queryStr) ||
                                          a.LOCATION_CATEGORY01.Contains(queryStr) ||
                                          a.LOCATION_CATEGORY02.Contains(queryStr) ||
                                          a.LOCATION_CATEGORY03.Contains(queryStr) ||
                                          a.LOCATION_CATEGORY04.Contains(queryStr) ||
                                          a.LOCATION_CATEGORY05.Contains(queryStr) ||
                                          a.LOCATION_CATEGORY06.Contains(queryStr) ||
                                          a.LOCATION_CATEGORY07.Contains(queryStr) ||
                                          a.LOCATION_CATEGORY08.Contains(queryStr)



                                          || a.LOCATING_ZONE.Contains(queryStr) ||
                                          a.ALLOCATION_ZONE.Contains(queryStr) ||
                                          a.WORK_ZONE.Contains(queryStr) ||
                                          a.MAX_LPNS.Contains(queryStr)

                                          || a.EDITABLE_INVENTORY_STATUS.Contains(queryStr)
                                          );
            }
            else
            {
                queryData = m_Rep.GetList(where);
            }


            pager.totalRows = queryData.Count();
            //排序
            queryData = LinqHelper.SortingAndPaging(queryData, pager.sort, pager.order, pager.page, pager.rows);
            return(CreateModelList(ref queryData));
        }
Beispiel #10
0
 public virtual List <SysStructModel> GetListByUserId(ref GridPager pager, string userId, string queryStr)
 {
     return(new List <SysStructModel>());
 }
Beispiel #11
0
        public virtual async Task <Tuple <GridPager, List <SysStructModel> > > GetListAsync(GridPager pager, string queryStr)
        {
            IQueryable <SysStruct> queryData = null;

            if (!string.IsNullOrWhiteSpace(queryStr))
            {
                queryData = m_Rep.GetList(
                    a => a.Id.Contains(queryStr) ||
                    a.Name.Contains(queryStr) ||
                    a.ParentId.Contains(queryStr)

                    || a.Higher.Contains(queryStr)

                    || a.Remark.Contains(queryStr)

                    );
            }
            else
            {
                queryData = m_Rep.GetList();
            }

            pager.totalRows = queryData.Count();
            //排序
            queryData = LinqHelper.SortingAndPaging(queryData, pager.sort, pager.order, pager.page, pager.rows);
            List <SysStructModel> list = await CreateModelListAsync(queryData);

            return(new Tuple <GridPager, List <SysStructModel> >(pager, list));
        }
Beispiel #12
0
        public void GridPager_SetsGrid()
        {
            IGrid actual = new GridPager<GridModel>(grid).Grid;
            IGrid expected = grid;

            Assert.Same(expected, actual);
        }
        public virtual async Task <Tuple <GridPager, List <MIS_WebIM_MessageModel> > > GetListAsync(GridPager pager, string queryStr)
        {
            IQueryable <MIS_WebIM_Message> queryData = null;

            if (!string.IsNullOrWhiteSpace(queryStr))
            {
                queryData = m_Rep.GetList(
                    a => a.Id.Contains(queryStr) ||
                    a.Message.Contains(queryStr) ||
                    a.Sender.Contains(queryStr) ||
                    a.receiver.Contains(queryStr)


                    || a.receiverTitle.Contains(queryStr)
                    );
            }
            else
            {
                queryData = m_Rep.GetList();
            }

            pager.totalRows = queryData.Count();
            //排序
            queryData = LinqHelper.SortingAndPaging(queryData, pager.sort, pager.order, pager.page, pager.rows);
            List <MIS_WebIM_MessageModel> list = await CreateModelListAsync(queryData);

            return(new Tuple <GridPager, List <MIS_WebIM_MessageModel> >(pager, list));
        }
 public virtual List <Flow_FormContentModel> GetListByUserId(ref GridPager pager, string userId, string queryStr)
 {
     return(new List <Flow_FormContentModel>());
 }
 public virtual List <Flow_FormContentModel> GetListByParentId(ref GridPager pager, string queryStr, object parentId)
 {
     return(new List <Flow_FormContentModel>());
 }
        public virtual List <Apps.Models.SCV.AR.AR_UPLOAD_RECEIPT_HEADER_MODEL> GetList(ref GridPager pager, string queryStr, Expression <Func <Apps.Models.AR_UPLOAD_RECEIPT_HEADER, bool> > where = null)
        {
            IQueryable <Apps.Models.AR_UPLOAD_RECEIPT_HEADER> queryData;

            if (!string.IsNullOrWhiteSpace(queryStr))
            {
                queryData = m_Rep.GetList(where
                                          , a => a.INTERFACE_RECORD_ID.Contains(queryStr) ||
                                          a.INTERFACE_ACTION_CODE.Contains(queryStr) ||
                                          a.INTERFACE_CONDITION.Contains(queryStr) ||
                                          a.PROCESS_STAMP.Contains(queryStr) ||
                                          a.WAREHOUSE.Contains(queryStr) ||
                                          a.COMPANY.Contains(queryStr) ||
                                          a.RECEIPT_ID.Contains(queryStr) ||
                                          a.RECEIPT_TYPE.Contains(queryStr)



                                          || a.ERP_ORDER_ID.Contains(queryStr) ||
                                          a.SHIP_FROM.Contains(queryStr) ||
                                          a.SHIP_FROM_ADDRESS1.Contains(queryStr) ||
                                          a.SHIP_FROM_ADDRESS2.Contains(queryStr) ||
                                          a.SHIP_FROM_CITY.Contains(queryStr) ||
                                          a.SHIP_FROM_STATE.Contains(queryStr) ||
                                          a.SHIP_FROM_COUNTRY.Contains(queryStr) ||
                                          a.SHIP_FROM_POSTAL_CODE.Contains(queryStr) ||
                                          a.SHIP_FROM_NAME.Contains(queryStr) ||
                                          a.SHIP_FROM_ATTENTION_TO.Contains(queryStr) ||
                                          a.SHIP_FROM_EMAIL_ADDRESS.Contains(queryStr) ||
                                          a.SHIP_FROM_PHONE_NUM.Contains(queryStr) ||
                                          a.SHIP_FROM_FAX_NUM.Contains(queryStr)


                                          || a.USER_STAMP.Contains(queryStr)

                                          || a.RECV_DOCK.Contains(queryStr)



                                          || a.USER_DEF1.Contains(queryStr) ||
                                          a.USER_DEF2.Contains(queryStr) ||
                                          a.USER_DEF3.Contains(queryStr) ||
                                          a.USER_DEF4.Contains(queryStr) ||
                                          a.USER_DEF5.Contains(queryStr) ||
                                          a.USER_DEF6.Contains(queryStr) ||
                                          a.USER_DEF7.Contains(queryStr) ||
                                          a.USER_DEF8.Contains(queryStr)


                                          );
            }
            else
            {
                queryData = m_Rep.GetList(where);
            }


            pager.totalRows = queryData.Count();
            //排序
            queryData = LinqHelper.SortingAndPaging(queryData, pager.sort, pager.order, pager.page, pager.rows);
            return(CreateModelList(ref queryData));
        }
        public virtual List <Apps.Models.SCV.LOCATING.LOCATING_RULE_DETAIL_MODEL> GetList(ref GridPager pager, string queryStr, Expression <Func <Apps.Models.LOCATING_RULE_DETAIL, bool> > where = null)
        {
            IQueryable <Apps.Models.LOCATING_RULE_DETAIL> queryData;

            if (!string.IsNullOrWhiteSpace(queryStr))
            {
                queryData = m_Rep.GetList(where
                                          , a => a.LOCATING_RULE.Contains(queryStr) ||
                                          a.QUANTITY_UM.Contains(queryStr)

                                          || a.STRATEGY.Contains(queryStr)

                                          || a.LOC_SEL_NAME.Contains(queryStr) ||
                                          a.SPLIT_QTY.Contains(queryStr)

                                          );
            }
            else
            {
                queryData = m_Rep.GetList(where);
            }


            pager.totalRows = queryData.Count();
            //排序
            queryData = LinqHelper.SortingAndPaging(queryData, pager.sort, pager.order, pager.page, pager.rows);
            return(CreateModelList(ref queryData));
        }
Beispiel #18
0
 public void Init()
 {
     HttpContext.Current = new HttpContext(new HttpRequest("", "http://tempuri.org", ""), new HttpResponse(new StringWriter()));
     _pager = new GridPager();
 }
Beispiel #19
0
    protected void ActiveTableRowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.Header)
            {

                var markRead = new ImageButton
                                   {
                    SkinID = "MarkRead",
                    ToolTip = webResources.lblMarkAllRead
                };
                markRead.ApplyStyleSheetSkin(Page);
                markRead.Click += MarkReadClick;
                e.Row.Cells[0].Controls.Add(markRead);
                if (_currentUser == "")
                {
                    e.Row.Cells.RemoveAt(5);
                }

            }
            else if (e.Row.RowType == DataControlRowType.Pager)
            {
                _replyPager = (GridPager)e.Row.FindControl("pager");
                _replyPager.PageCount = Common.CalculateNumberOfPages(RowCount, Config.TopicPageSize);
                _replyPager.CurrentIndex = CurrentPage;
            }
            else if (e.Row.RowType == DataControlRowType.DataRow)
            {
                var topic = (TopicInfo)e.Row.DataItem;
                var lockIcon = e.Row.Cells[3].FindControl("TopicLock") as ImageButton;
                var unlockIcon = e.Row.Cells[3].FindControl("TopicUnLock") as ImageButton;
                var delIcon = e.Row.Cells[3].FindControl("TopicDelete") as ImageButton;
                var subscribe = e.Row.Cells[3].FindControl("TopicSub") as ImageButton;
                var unsubscribe = e.Row.Cells[3].FindControl("TopicUnSub") as ImageButton;
                var approve = e.Row.Cells[3].FindControl("TopicApprove") as ImageButton;
                var editIcon = e.Row.Cells[3].FindControl("hypEditTopic") as HyperLink;
                var replyIcon = e.Row.Cells[3].FindControl("hypReplyTopic") as HyperLink;
                var newIcon = e.Row.Cells[3].FindControl("hypNewTopic") as HyperLink;
                var popuplink = e.Row.Cells[1].FindControl("popuplink") as Literal;
                var lastpost = e.Row.Cells[1].FindControl("lpLnk") as HyperLink;
                var postdate = e.Row.Cells[1].FindControl("postdate") as Literal;

                if (popuplink != null)
                {
                    string title = String.Format(webResources.lblViewProfile, "$1");
                    popuplink.Text = topic.LastPostAuthorId != null ? Regex.Replace(topic.LastPostAuthorPopup, @"\[!(.*)!]", title) : "";
                }
                if (postdate != null)
                {
                    postdate.Text = SnitzTime.TimeAgoTag(((TopicInfo)e.Row.DataItem).Date, IsAuthenticated, Member);

                }
                if (lastpost != null)
                {
                    lastpost.Text = SnitzTime.TimeAgoTag(((TopicInfo)e.Row.DataItem).LastPostDate, IsAuthenticated, Member, webResources.lblLastPostJump);
                }
                int replyCount = topic.ReplyCount;
                int topicId = topic.Id;
                int forumId = topic.ForumId;
                int catId = topic.CatId;
                string authorName = topic.AuthorName;
                bool inModeratedList = Moderators.IsUserForumModerator(_currentUser, forumId);

                if (lockIcon != null)
                {
                    lockIcon.Visible = (IsAdministrator || inModeratedList);
                    lockIcon.OnClientClick =
                        "confirmPostBack('Do you want to lock the Topic?','LockTopic'," + topicId + ");return false;";
                }
                if (delIcon != null)
                {
                    delIcon.Visible = false;
                    delIcon.OnClientClick =
                        "confirmPostBack('Do you want to delete the Topic?','DeleteTopic'," + topicId + ");return false;";
                }
                if (editIcon != null) editIcon.Visible = false;
                if (approve != null)
                {
                    approve.Visible = false;
                    if (topic.Status == (int)Enumerators.PostStatus.UnModerated || topic.Status == (int)Enumerators.PostStatus.OnHold)
                        approve.Visible = (inModeratedList || IsAdministrator);
                    approve.OnClientClick = string.Format("mainScreen.LoadServerControlHtml('Moderation',{{'pageID':7,'data':'{0},{1}'}}, 'methodHandlers.BeginRecieve');return false;",
                        true, topic.Id);
                }
                if (subscribe != null)
                {
                    subscribe.Visible = IsAuthenticated;
                    if (IsAuthenticated)
                    {
                        topic.Forum = Forums.GetForum(topic.ForumId);
                    }
                    subscribe.Visible = subscribe.Visible && topic.AllowSubscriptions;
                    subscribe.OnClientClick =
                        "confirmTopicSubscribe('Do you want to be notified when someone posts a reply?'," + topicId + ",false);return false;";
                }
                if (unsubscribe != null)
                {
                    unsubscribe.Visible = false;
                    if (subscribe != null && subscribe.Visible)
                    {
                        if (Members.IsSubscribedToTopic(topic.Id, Member == null ? 0 : Member.Id))
                        {
                            subscribe.Visible = false;
                            unsubscribe.Visible = true;
                        }
                    }
                    unsubscribe.OnClientClick =
                        "confirmTopicSubscribe('Do you want to remove notifications from topic?'," + topicId + ",true);return false;";
                }
                if(Config.TopicAvatar)
                    e.Row.Cells[0].Controls.Add(GetTopicAuthorIcon(topic.AuthorId));

                e.Row.Cells[0].Controls.Add(GetRecentTopicIcon(topic, replyCount));

                if (newIcon != null) newIcon.Visible = false;
                if (lockIcon != null)
                {
                    lockIcon.Visible = ((IsAdministrator || inModeratedList) && (topic.Status != (int)Enumerators.PostStatus.Closed));
                }
                if (unlockIcon != null)
                {
                    unlockIcon.Visible = ((IsAdministrator || inModeratedList) && (topic.Status == (int)Enumerators.PostStatus.Closed));
                    unlockIcon.OnClientClick =
                        "confirmPostBack('Do you want to unlock the Topic?','UnLockTopic'," + topicId + ");return false;";
                }

                if (replyIcon != null)
                    replyIcon.NavigateUrl = string.Format("/Content/Forums/post.aspx?method=reply&TOPIC={0}&FORUM={1}&CAT={2}", topicId, forumId, catId);
                if (topic.Status == (int)Enumerators.PostStatus.Closed || !IsAuthenticated)
                    if (replyIcon != null) replyIcon.Visible = false;
                if (IsAdministrator || inModeratedList)
                    if (replyIcon != null) replyIcon.Visible = true;
                if (IsAdministrator || inModeratedList)
                {
                    if (delIcon != null) delIcon.Visible = true;
                    if (editIcon != null) editIcon.Visible = true;
                }
                else if (_currentUser.ToLower() == authorName.ToLower())
                {
                    if (replyCount == 0)
                        if (delIcon != null) delIcon.Visible = true;
                    if (editIcon != null) editIcon.Visible = true;
                }
                if (editIcon != null)
                    editIcon.NavigateUrl = string.Format("/Content/Forums/post.aspx?method=edit&type=TOPICS&id={0}&FORUM={1}&CAT={2}", topicId, forumId, catId);

                if (_currentUser == "")
                {
                    if (e.Row.Cells.Count > 2)
                    {
                        e.Row.Cells.RemoveAt(5);
                        //e.Row.Cells[5].ColumnSpan +=1;
                    }

                }
            }
    }
Beispiel #20
0
        public void GridPager_SetsDefaultPartialViewName()
        {
            String actual = new GridPager<GridModel>(grid).PartialViewName;
            String expected = "MvcGrid/_Pager";

            Assert.Equal(expected, actual);
        }
Beispiel #21
0
        public virtual List <Apps.Models.SCV.SHIPPING.SHIPPING_CONTAINER_MODEL> GetList(ref GridPager pager, string queryStr, Expression <Func <Apps.Models.SHIPPING_CONTAINER, bool> > where = null)
        {
            IQueryable <Apps.Models.SHIPPING_CONTAINER> queryData;

            if (!string.IsNullOrWhiteSpace(queryStr))
            {
                queryData = m_Rep.GetList(where

                                          , a => a.CONTAINER_ID.Contains(queryStr) ||
                                          a.WAREHOUSE.Contains(queryStr) ||
                                          a.CONTAINER_TYPE.Contains(queryStr) ||
                                          a.CONTAINER_CLASS.Contains(queryStr)



                                          || a.WEIGHT_UM.Contains(queryStr)



                                          || a.DIMENSION_UM.Contains(queryStr) ||
                                          a.VOLUME_UM.Contains(queryStr)



                                          || a.COMPANY.Contains(queryStr) ||
                                          a.ITEM.Contains(queryStr)

                                          || a.QUANTITY_UM.Contains(queryStr) ||
                                          a.TRACKING_NUMBER.Contains(queryStr) ||
                                          a.USER_DEF1.Contains(queryStr) ||
                                          a.USER_DEF2.Contains(queryStr) ||
                                          a.USER_DEF3.Contains(queryStr) ||
                                          a.USER_DEF4.Contains(queryStr) ||
                                          a.USER_DEF5.Contains(queryStr) ||
                                          a.USER_DEF6.Contains(queryStr)


                                          || a.USER_STAMP.Contains(queryStr)



                                          || a.PARENT_CONTAINER_ID.Contains(queryStr)

                                          || a.TASK_CREATED.Contains(queryStr)

                                          || a.ORIGINAL_PICK_LOC.Contains(queryStr) ||
                                          a.ATTRIBUTE1.Contains(queryStr) ||
                                          a.ATTRIBUTE2.Contains(queryStr) ||
                                          a.ATTRIBUTE3.Contains(queryStr) ||
                                          a.ATTRIBUTE4.Contains(queryStr) ||
                                          a.ATTRIBUTE5.Contains(queryStr) ||
                                          a.ATTRIBUTE6.Contains(queryStr) ||
                                          a.ATTRIBUTE7.Contains(queryStr) ||
                                          a.ATTRIBUTE8.Contains(queryStr) ||
                                          a.PROCESS_STAMP.Contains(queryStr) ||
                                          a.PACKING_CLASS.Contains(queryStr) ||
                                          a.SHIPMENT_ID.Contains(queryStr) ||
                                          a.TRANS_CONT_ID.Contains(queryStr) ||
                                          a.OQC_BENCH.Contains(queryStr) ||
                                          a.OQCED.Contains(queryStr) ||
                                          a.OQC_USER.Contains(queryStr)


                                          || a.SYSTEM_CREATED.Contains(queryStr)

                                          );
            }
            else
            {
                queryData = m_Rep.GetList(where);
            }


            pager.totalRows = queryData.Count();
            //排序
            queryData = LinqHelper.SortingAndPaging(queryData, pager.sort, pager.order, pager.page, pager.rows);
            return(CreateModelList(ref queryData));
        }
 public virtual List <MIS_WebIM_MessageModel> GetListByParentId(ref GridPager pager, string queryStr, object parentId)
 {
     return(new List <MIS_WebIM_MessageModel>());
 }
Beispiel #23
0
        public void GridPager_SetsRowsPerPage()
        {
            Int32 actual = new GridPager<GridModel>(grid).RowsPerPage;
            Int32 expected = 20;

            Assert.Equal(expected, actual);
        }
        public virtual List <Apps.Models.SCV.REPLENISHMENT.REPLENISHMENT_MASTER_MODEL> GetList(ref GridPager pager, string queryStr, Expression <Func <Apps.Models.REPLENISHMENT_MASTER, bool> > where = null)
        {
            IQueryable <Apps.Models.REPLENISHMENT_MASTER> queryData;

            if (!string.IsNullOrWhiteSpace(queryStr))
            {
                queryData = m_Rep.GetList(where

                                          , a => a.MASTER_NAME.Contains(queryStr) ||
                                          a.DESCRIPTION.Contains(queryStr) ||
                                          a.ITEM_SEL.Contains(queryStr) ||
                                          a.LOCATION_SEL.Contains(queryStr) ||
                                          a.ALLOCATION_RULE.Contains(queryStr) ||
                                          a.LOCATING_RULE.Contains(queryStr) ||
                                          a.REPLENISH_MODE.Contains(queryStr) ||
                                          a.REPLENISH_UM.Contains(queryStr) ||
                                          a.STRATEGY.Contains(queryStr) ||
                                          a.IN_PROCESS.Contains(queryStr)



                                          || a.ACTIVE.Contains(queryStr) ||
                                          a.USER_STAMP.Contains(queryStr)

                                          || a.USER_DEF1.Contains(queryStr) ||
                                          a.USER_DEF2.Contains(queryStr) ||
                                          a.USER_DEF3.Contains(queryStr) ||
                                          a.USER_DEF4.Contains(queryStr) ||
                                          a.USER_DEF5.Contains(queryStr) ||
                                          a.USER_DEF6.Contains(queryStr) ||
                                          a.USER_DEF7.Contains(queryStr) ||
                                          a.USER_DEF8.Contains(queryStr)
                                          );
            }
            else
            {
                queryData = m_Rep.GetList(where);
            }


            pager.totalRows = queryData.Count();
            //排序
            queryData = LinqHelper.SortingAndPaging(queryData, pager.sort, pager.order, pager.page, pager.rows);
            return(CreateModelList(ref queryData));
        }
Beispiel #25
0
        public void Pageable_Builder_DoesNotChangePager()
        {
            IGridPager<GridModel> pager = new GridPager<GridModel>(htmlGrid.Grid);
            htmlGrid.Grid.Pager = pager;

            htmlGrid.Pageable(gridPager => { });

            IGridPager actual = htmlGrid.Grid.Pager;
            IGridPager expected = pager;

            Assert.Same(expected, actual);
        }
        public virtual List <Apps.Models.SCV.AR.AR_TASK_DETAIL_MODEL> GetList(ref GridPager pager, string queryStr, Expression <Func <Apps.Models.AR_TASK_DETAIL, bool> > where = null)
        {
            IQueryable <Apps.Models.AR_TASK_DETAIL> queryData;

            if (!string.IsNullOrWhiteSpace(queryStr))
            {
                queryData = m_Rep.GetList(where


                                          , a => a.TASK_ID.Contains(queryStr) ||
                                          a.TASK_TYPE.Contains(queryStr) ||
                                          a.WAREHOUSE.Contains(queryStr) ||
                                          a.COMPANY.Contains(queryStr) ||
                                          a.ITEM.Contains(queryStr) ||
                                          a.ITEM_DESC.Contains(queryStr)



                                          || a.QUANTITY_UM.Contains(queryStr) ||
                                          a.FROM_LOC.Contains(queryStr) ||
                                          a.TO_LOC.Contains(queryStr) ||
                                          a.FROM_LPN.Contains(queryStr) ||
                                          a.TO_LPN.Contains(queryStr)

                                          || a.CONDITION.Contains(queryStr) ||
                                          a.REFERENCE_ID.Contains(queryStr)

                                          || a.REFERENCE_NUM_TYPE.Contains(queryStr)


                                          || a.ASSIGNED_USER.Contains(queryStr) ||
                                          a.INTERNAL_TASK_TYPE.Contains(queryStr) ||
                                          a.ATTRIBUTE1.Contains(queryStr) ||
                                          a.ATTRIBUTE2.Contains(queryStr) ||
                                          a.ATTRIBUTE3.Contains(queryStr) ||
                                          a.ATTRIBUTE4.Contains(queryStr) ||
                                          a.ATTRIBUTE5.Contains(queryStr) ||
                                          a.ATTRIBUTE6.Contains(queryStr) ||
                                          a.ATTRIBUTE7.Contains(queryStr) ||
                                          a.ATTRIBUTE8.Contains(queryStr) ||
                                          a.USER_STAMP.Contains(queryStr)

                                          || a.CURRENT_LOC.Contains(queryStr) ||
                                          a.CURRENT_LPN.Contains(queryStr) ||
                                          a.INVENTORY_STS.Contains(queryStr)


                                          || a.CONFIRM_USER.Contains(queryStr) ||
                                          a.PICKING_CART_ID.Contains(queryStr) ||
                                          a.TRANS_CONT_ID.Contains(queryStr) ||
                                          a.FROM_ZONE.Contains(queryStr) ||
                                          a.TO_ZONE.Contains(queryStr) ||
                                          a.USER_DEF1.Contains(queryStr) ||
                                          a.USER_DEF2.Contains(queryStr) ||
                                          a.USER_DEF3.Contains(queryStr) ||
                                          a.USER_DEF4.Contains(queryStr) ||
                                          a.USER_DEF5.Contains(queryStr) ||
                                          a.USER_DEF6.Contains(queryStr) ||
                                          a.USER_DEF7.Contains(queryStr) ||
                                          a.USER_DEF8.Contains(queryStr)
                                          );
            }
            else
            {
                queryData = m_Rep.GetList(where);
            }


            pager.totalRows = queryData.Count();
            //排序
            queryData = LinqHelper.SortingAndPaging(queryData, pager.sort, pager.order, pager.page, pager.rows);
            return(CreateModelList(ref queryData));
        }
Beispiel #27
0
 public virtual List <SysStructModel> GetListByParentId(ref GridPager pager, string queryStr, object parentId)
 {
     return(new List <SysStructModel>());
 }
 public virtual List <Spl_ContactCompanyCategoryModel> GetListByUserId(ref GridPager pager, string userId, string queryStr)
 {
     return(new List <Spl_ContactCompanyCategoryModel>());
 }
Beispiel #29
0
        public virtual List <Apps.Models.SCV.AR.AR_RECEIPT_DETAIL_MODEL> GetList(ref GridPager pager, string queryStr, Expression <Func <Apps.Models.AR_RECEIPT_DETAIL, bool> > where = null)
        {
            IQueryable <Apps.Models.AR_RECEIPT_DETAIL> queryData;

            if (!string.IsNullOrWhiteSpace(queryStr))
            {
                queryData = m_Rep.GetList(where


                                          , a => a.RECEIPT_ID.Contains(queryStr) ||
                                          a.WAREHOUSE.Contains(queryStr) ||
                                          a.COMPANY.Contains(queryStr) ||
                                          a.ITEM.Contains(queryStr) ||
                                          a.ITEM_DESC.Contains(queryStr) ||
                                          a.ITEM_CLASS.Contains(queryStr) ||
                                          a.ATTRIBUTE_TRACK.Contains(queryStr)

                                          || a.ATTRIBUTE1.Contains(queryStr) ||
                                          a.ATTRIBUTE2.Contains(queryStr) ||
                                          a.ATTRIBUTE3.Contains(queryStr) ||
                                          a.ATTRIBUTE4.Contains(queryStr) ||
                                          a.ATTRIBUTE5.Contains(queryStr) ||
                                          a.ATTRIBUTE6.Contains(queryStr) ||
                                          a.ATTRIBUTE7.Contains(queryStr) ||
                                          a.ATTRIBUTE8.Contains(queryStr)


                                          || a.QUANTITY_UM.Contains(queryStr) ||
                                          a.ERP_ORDER_ID.Contains(queryStr) ||
                                          a.ERP_ORDER_LINE_NUM.Contains(queryStr) ||
                                          a.LOCATING_RULE.Contains(queryStr) ||
                                          a.USER_STAMP.Contains(queryStr)

                                          || a.INVENTORY_STS.Contains(queryStr) ||
                                          a.USER_DEF1.Contains(queryStr) ||
                                          a.USER_DEF2.Contains(queryStr) ||
                                          a.USER_DEF3.Contains(queryStr) ||
                                          a.USER_DEF4.Contains(queryStr) ||
                                          a.USER_DEF5.Contains(queryStr) ||
                                          a.USER_DEF6.Contains(queryStr) ||
                                          a.USER_DEF7.Contains(queryStr) ||
                                          a.USER_DEF8.Contains(queryStr)


                                          || a.ITEM_CATEGORY01.Contains(queryStr) ||
                                          a.ITEM_CATEGORY02.Contains(queryStr) ||
                                          a.ITEM_CATEGORY03.Contains(queryStr) ||
                                          a.ITEM_CATEGORY04.Contains(queryStr) ||
                                          a.ITEM_CATEGORY05.Contains(queryStr) ||
                                          a.ITEM_CATEGORY06.Contains(queryStr) ||
                                          a.ITEM_CATEGORY07.Contains(queryStr) ||
                                          a.ITEM_CATEGORY08.Contains(queryStr)
                                          );
            }
            else
            {
                queryData = m_Rep.GetList(where);
            }


            pager.totalRows = queryData.Count();
            //排序
            queryData = LinqHelper.SortingAndPaging(queryData, pager.sort, pager.order, pager.page, pager.rows);
            return(CreateModelList(ref queryData));
        }
 public virtual List <Spl_ContactCompanyCategoryModel> GetListByParentId(ref GridPager pager, string queryStr, object parentId)
 {
     return(new List <Spl_ContactCompanyCategoryModel>());
 }
        public JsonResult LoadData(string keyword, string sn, int?countryId, int?status, GridPager pager)
        {
            List <MerchantProfile> profileList;
            List <MerchantProfileAccountViewModel> merchantPos;
            string countryName;


            if (string.IsNullOrEmpty(sn))
            {
                if (!countryId.HasValue)
                {
                    return(Json(new List <MerchantProfile>().ToGridJson(pager)));
                }

                profileList = new MerchantProfileBLL().GetMerchantProfilePageListL2(keyword, countryId.Value, status, ref pager);
                if (profileList == null || profileList.Count <= 0)
                {
                    return(Json(new List <MerchantProfile>().ToGridJson(pager)));
                }

                var merchantIds = profileList.Select(t => t.MerchantId).ToArray();
                countryName = FoundationDB.CountryDb.GetById(countryId)?.Name;
                merchantPos = FiiiPayDB.DB.Queryable <MerchantAccounts, POSs>((u, v) => new object[] { JoinType.Left, u.POSId == v.Id })
                              .Where((u, v) => SqlFunc.ContainsArray <Guid>(merchantIds, u.Id))
                              .Select((u, v) => new MerchantProfileAccountViewModel {
                    MerchantId = u.Id, Cellphone = u.Cellphone, MerchantName = u.MerchantName, SN = v.Sn, Username = u.Username
                }).ToList();
            }
            else
            {
                var pos = FiiiPayDB.POSDb.GetSingle(t => t.Sn == sn);
                if (pos == null)
                {
                    return(Json(new List <MerchantProfile>().ToGridJson(pager)));
                }
                var merchantAccount = FiiiPayDB.MerchantAccountDb.GetSingle(t => t.POSId == pos.Id);
                if (merchantAccount == null)
                {
                    return(Json(new List <MerchantProfile>().ToGridJson(pager)));
                }
                var profile = new MerchantProfileBLL().GetMerchantProfile(merchantAccount.Id);
                if (profile == null)
                {
                    return(Json(new List <MerchantProfile>().ToGridJson(pager)));
                }

                profileList = new List <MerchantProfile> {
                    profile
                };

                profileList = profileList.Where(t =>
                                                (keyword == null ? true : t.Cellphone.Contains(keyword)) &&
                                                (countryId.HasValue ? t.Country == countryId.Value : true) &&
                                                (status.HasValue ? (byte)t.L1VerifyStatus == status.Value : true)
                                                ).ToList();

                countryName = FoundationDB.CountryDb.GetById(merchantAccount.CountryId)?.Name;

                merchantPos = new List <MerchantProfileAccountViewModel>
                {
                    new MerchantProfileAccountViewModel
                    {
                        MerchantId   = merchantAccount.Id,
                        MerchantName = merchantAccount.MerchantName,
                        Cellphone    = merchantAccount.Cellphone,
                        Username     = merchantAccount.Username,
                        SN           = pos.Sn
                    }
                };
            }

            var data = profileList.ToGridJson(pager, r =>
                                              new
            {
                id   = r.MerchantId,
                cell = new
                {
                    MerchantId     = r.MerchantId,
                    Cellphone      = r.Cellphone,
                    Username       = merchantPos.Where(t => t.MerchantId == r.MerchantId).Select(t => t.Username).FirstOrDefault(),
                    SN             = merchantPos.Where(t => t.MerchantId == r.MerchantId).Select(t => t.SN).FirstOrDefault(),
                    MerchantName   = merchantPos.Where(t => t.MerchantId == r.MerchantId).Select(t => t.MerchantName).FirstOrDefault(),
                    CountryName    = countryName,
                    VerifyStatus   = r.L2VerifyStatus.ToString(),
                    SubmissionDate = r.L2SubmissionDate.HasValue ? r.L2SubmissionDate.Value.ToLocalTime().ToString("yyyy-MM-dd HH:mm") : "",
                    Remark         = r.L2Remark,
                    Options        = (int)r.L2VerifyStatus
                }
            });

            return(Json(data));
        }
Beispiel #32
0
        public JsonResult GetList(GridPager pager, StaffSearch staffSearch)
        {
            List <Staff> list            = new List <Staff>();
            DateTime     defaultDateTime = new DateTime(1, 1, 1, 0, 0, 0);

            //staffSearch.name = "";

            /*
             * 初始化页面:只有pager接收到浏览器传来的参数,staffSearch中的属性均为默认值。
             */
            if (staffSearch.name == null && staffSearch.date_from.Value == defaultDateTime && staffSearch.date_to == defaultDateTime)
            {
                pager.totalRows = StaffService.GetModels(c => true).ToList().Count();
                //初始化页面根据Id排序
                list = StaffService.GetModelsByPage(pager.rows, pager.page, pager.isAsc, c => c.Id, c => true).ToList();
            }

            /*
             * 查询页面:staffSearch接收到浏览器传来的值,staffSearch中的属性均变为自定义的默认值。
             */
            else
            {
                //先想一想SQL怎么写,再写Lambda表达式
                Expression <Func <Staff, bool> > whereLambda = u =>
                                                               (u.CreateTime >= staffSearch.date_from && u.CreateTime <= staffSearch.date_to) &&
                                                               u.Name.Contains(staffSearch.name);
                //查询页面根据时间增序排列
                Expression <Func <Staff, DateTime?> > orderByLambda = c => c.CreateTime;

                pager.totalRows = StaffService.GetModels(whereLambda).ToList().Count();
                list            = StaffService.GetModelsByPage(pager.rows, pager.page, pager.isAsc, orderByLambda, whereLambda).ToList();
            }

            var json = new
            {
                total = pager.totalRows,

                /*
                 * rows = (from r in list
                 *      select new Staff()
                 *      {
                 *          Id = r.Id,
                 *          Name = r.Name,
                 *          Age = r.Age,
                 *          Sex = r.Sex,
                 *          CreateTime = r.CreateTime,
                 *      }).ToArray()
                 */

                rows = list.Select(staff => new
                {
                    Id         = staff.Id,
                    Name       = staff.Name,
                    Age        = staff.Age,
                    Sex        = staff.Sex,
                    CreateTime = staff.CreateTime
                }).ToArray()
            };

            return(Json(json, JsonRequestBehavior.AllowGet));
        }
 public GridPagerTests()
 {
     pager = new GridPager <GridModel>(new Grid <GridModel>(new GridModel[0]));
 }
Beispiel #34
0
        public void Pageable_DoesNotChangeExistingPager()
        {
            IGridPager<GridModel> pager = new GridPager<GridModel>(htmlGrid.Grid);
            htmlGrid.Grid.Pager = pager;

            htmlGrid.Pageable();

            IGridPager actual = htmlGrid.Grid.Pager;
            IGridPager expected = pager;

            Assert.Same(expected, actual);
        }
        public List <WC_OfficalAccounts> GetList(ref GridPager pager, string queryStr)
        {
            IQueryable <WC_OfficalAccounts> queryData = m_Rep.FindPageList(ref pager, queryStr);

            return(queryData.ToList());
        }
Beispiel #36
0
    private void BindMembers()
    {
        pager.Controls.Clear();
        RowCount = Members.GetMemberCount();
        _memberPager = (GridPager)LoadControl("~/UserControls/GridPager.ascx");
        _memberPager.ID = "memPager";
        _memberPager.PagerStyle = Enumerators.PagerType.Linkbutton;
        _memberPager.UserControlLinkClick += PagerLinkClick;
        _memberPager.PageCount = Common.CalculateNumberOfPages(RowCount, Config.MemberPageSize);
        _memberPager.CurrentIndex = CurrentPage;
        MGV.PageSize = Config.MemberPageSize;
        PopulateObject populate = PopulateData;
        _memberPager.UpdateIndex = populate;

        pager.Controls.Add(_memberPager);
    }
Beispiel #37
0
        public void Pageable_CreatesGridPager()
        {
            htmlGrid.Grid.Pager = null;

            htmlGrid.Pageable();

            IGridPager<GridModel> expected = new GridPager<GridModel>(htmlGrid.Grid);
            IGridPager<GridModel> actual = htmlGrid.Grid.Pager;

            Assert.Equal(expected.FirstDisplayPage, actual.FirstDisplayPage);
            Assert.Equal(expected.PartialViewName, actual.PartialViewName);
            Assert.Equal(expected.PagesToDisplay, actual.PagesToDisplay);
            Assert.Equal(expected.ProcessorType, actual.ProcessorType);
            Assert.Equal(expected.InitialPage, actual.InitialPage);
            Assert.Equal(expected.CurrentPage, actual.CurrentPage);
            Assert.Equal(expected.RowsPerPage, actual.RowsPerPage);
            Assert.Equal(expected.TotalPages, actual.TotalPages);
            Assert.Equal(expected.TotalRows, actual.TotalRows);
            Assert.Same(expected.Grid, actual.Grid);
        }
Beispiel #38
0
 public virtual List <MIS_Article_CommentModel> GetListByUserId(ref GridPager pager, string userId, string queryStr)
 {
     return(new List <MIS_Article_CommentModel>());
 }
Beispiel #39
0
 public mds.BaseModel.GridPager<mds.BaseModel.Webuser> GetSearchPager(mds.BaseModel.GridPagerParam param, string searchKey)
 {
     var r = new GridPager<Webuser>(false);
     List<int> searchIds = _searchInstance.SearchKey(searchKey);
     if ((searchIds != null) && (searchIds.Count > 0))
     {
         r.Data = webuserDal.GetPagerList(param, searchIds);
     }
     r.ActionResult = (r.Data != null) ? true : false;
     return r;
 }
Beispiel #40
0
 public virtual List <MIS_Article_CommentModel> GetListByParentId(ref GridPager pager, string queryStr, object parentId)
 {
     return(new List <MIS_Article_CommentModel>());
 }
Beispiel #41
0
        public void TotalPages_GetsTotalPages(Int32 totalRows, Int32 rowsPerPage, Int32 expected)
        {
            GridPager<GridModel> pager = new GridPager<GridModel>(grid);
            pager.RowsPerPage = rowsPerPage;
            pager.TotalRows = totalRows;

            Int32 actual = pager.TotalPages;

            Assert.Equal(expected, actual);
        }
Beispiel #42
0
        public virtual List <Apps.Models.SCV.AR.AR_UPLOAD_SHIPMENT_HEADER_MODEL> GetList(ref GridPager pager, string queryStr, Expression <Func <Apps.Models.AR_UPLOAD_SHIPMENT_HEADER, bool> > where = null)
        {
            IQueryable <Apps.Models.AR_UPLOAD_SHIPMENT_HEADER> queryData;

            if (!string.IsNullOrWhiteSpace(queryStr))
            {
                queryData = m_Rep.GetList(where
                                          , a => a.INTERFACE_RECORD_ID.Contains(queryStr) ||
                                          a.INTERFACE_ACTION_CODE.Contains(queryStr) ||
                                          a.INTERFACE_CONDITION.Contains(queryStr) ||
                                          a.PROCESS_STAMP.Contains(queryStr) ||
                                          a.WAREHOUSE.Contains(queryStr) ||
                                          a.COMPANY.Contains(queryStr)

                                          || a.SHIPMENT_ID.Contains(queryStr) ||
                                          a.ERP_ORDER.Contains(queryStr)


                                          || a.SHIPMENT_TYPE.Contains(queryStr) ||
                                          a.ROUTE.Contains(queryStr) ||
                                          a.SHIP_TO.Contains(queryStr) ||
                                          a.SHIP_TO_NAME.Contains(queryStr) ||
                                          a.SHIP_TO_ADDRESS1.Contains(queryStr) ||
                                          a.SHIP_TO_ADDRESS2.Contains(queryStr) ||
                                          a.SHIP_TO_DISTRICT.Contains(queryStr) ||
                                          a.SHIP_TO_CITY.Contains(queryStr) ||
                                          a.SHIP_TO_STATE.Contains(queryStr) ||
                                          a.SHIP_TO_COUNTRY.Contains(queryStr) ||
                                          a.SHIP_TO_POSTAL_CODE.Contains(queryStr) ||
                                          a.SHIP_TO_ATTENTION_TO.Contains(queryStr) ||
                                          a.SHIP_TO_PHONE_NUM.Contains(queryStr) ||
                                          a.SHIP_TO_MOBILE.Contains(queryStr) ||
                                          a.SHIP_TO_FAX_NUM.Contains(queryStr) ||
                                          a.SHIP_TO_EMAIL_ADDRESS.Contains(queryStr)

                                          || a.USER_STAMP.Contains(queryStr)


                                          || a.REQUESTED_DELIVERY_TYPE.Contains(queryStr)



                                          || a.DELIVERY_NOTE.Contains(queryStr) ||
                                          a.REJECTION_NOTE.Contains(queryStr)

                                          || a.SHIP_DOCK.Contains(queryStr) ||
                                          a.ALLOCATE_COMPLETE.Contains(queryStr)

                                          || a.WEIGHT_UM.Contains(queryStr)

                                          || a.VOLUME_UM.Contains(queryStr)


                                          || a.CARRIER.Contains(queryStr) ||
                                          a.CARRIER_SERVICE.Contains(queryStr) ||
                                          a.USER_DEF1.Contains(queryStr) ||
                                          a.USER_DEF2.Contains(queryStr) ||
                                          a.USER_DEF3.Contains(queryStr) ||
                                          a.USER_DEF4.Contains(queryStr) ||
                                          a.USER_DEF5.Contains(queryStr) ||
                                          a.USER_DEF6.Contains(queryStr) ||
                                          a.USER_DEF7.Contains(queryStr) ||
                                          a.USER_DEF8.Contains(queryStr)

                                          || a.PROCESS_TYPE.Contains(queryStr)



                                          || a.SIGN_VALUE.Contains(queryStr) ||
                                          a.SHIPMENT_SUB_TYPE.Contains(queryStr) ||
                                          a.SHIPMENT_CATEGORY1.Contains(queryStr) ||
                                          a.SHIPMENT_CATEGORY2.Contains(queryStr) ||
                                          a.SHIPMENT_CATEGORY3.Contains(queryStr) ||
                                          a.SHIPMENT_CATEGORY4.Contains(queryStr) ||
                                          a.SHIPMENT_CATEGORY5.Contains(queryStr) ||
                                          a.SHIPMENT_CATEGORY6.Contains(queryStr) ||
                                          a.SHIPMENT_CATEGORY7.Contains(queryStr) ||
                                          a.SHIPMENT_CATEGORY8.Contains(queryStr)
                                          );
            }
            else
            {
                queryData = m_Rep.GetList(where);
            }


            pager.totalRows = queryData.Count();
            //排序
            queryData = LinqHelper.SortingAndPaging(queryData, pager.sort, pager.order, pager.page, pager.rows);
            return(CreateModelList(ref queryData));
        }
Beispiel #43
0
 public GridPagerTests()
 {
     grid = new Grid<GridModel>(new GridModel[0]);
     pager = new GridPager<GridModel>(grid);
     grid.Query = new QueryCollection();
 }
 public virtual List <Spl_WarehouseWarrantModel> GetListByUserId(ref GridPager pager, string userId, string queryStr)
 {
     return(new List <Spl_WarehouseWarrantModel>());
 }
Beispiel #45
0
        public void GridPager_SetsCurrentPage()
        {
            Int32 actual = new GridPager<GridModel>(grid).CurrentPage;
            Int32 expected = 1;

            Assert.Equal(expected, actual);
        }
 public virtual List <Spl_WarehouseWarrantModel> GetListByParentId(ref GridPager pager, string queryStr, object parentId)
 {
     return(new List <Spl_WarehouseWarrantModel>());
 }
Beispiel #47
0
        public void GridPager_SetsPagesToDisplay()
        {
            Int32 actual = new GridPager<GridModel>(grid).PagesToDisplay;
            Int32 expected = 5;

            Assert.Equal(expected, actual);
        }
        public virtual List <Apps.Models.SCV.DOWNLOAD.DOWNLOAD_ITEM_MODEL> GetList(ref GridPager pager, string queryStr, Expression <Func <Apps.Models.DOWNLOAD_ITEM, bool> > where = null)
        {
            IQueryable <Apps.Models.DOWNLOAD_ITEM> queryData;

            if (!string.IsNullOrWhiteSpace(queryStr))
            {
                queryData = m_Rep.GetList(where
                                          , a => a.INTERFACE_RECORD_ID.Contains(queryStr) ||
                                          a.INTERFACE_ACTION_CODE.Contains(queryStr) ||
                                          a.INTERFACE_CONDITION.Contains(queryStr) ||
                                          a.PROCESS_STAMP.Contains(queryStr) ||
                                          a.ITEM.Contains(queryStr) ||
                                          a.COMPANY.Contains(queryStr) ||
                                          a.ITEM_DESC.Contains(queryStr) ||
                                          a.STORAGE_TEMPLATE.Contains(queryStr) ||
                                          a.ITEM_CLASS.Contains(queryStr) ||
                                          a.PACKING_CLASS.Contains(queryStr) ||
                                          a.ATTRIBUTE_TRACK.Contains(queryStr)

                                          || a.LOCATING_RULE.Contains(queryStr) ||
                                          a.ALLOCATION_RULE.Contains(queryStr) ||
                                          a.REPLENISHMENT_RULE.Contains(queryStr) ||
                                          a.EMPTY_LOC_RULE.Contains(queryStr) ||
                                          a.ITEM_CATEGORY1.Contains(queryStr) ||
                                          a.ITEM_CATEGORY2.Contains(queryStr) ||
                                          a.ITEM_CATEGORY3.Contains(queryStr) ||
                                          a.ITEM_CATEGORY4.Contains(queryStr) ||
                                          a.ITEM_CATEGORY5.Contains(queryStr) ||
                                          a.ITEM_CATEGORY6.Contains(queryStr) ||
                                          a.ITEM_CATEGORY7.Contains(queryStr) ||
                                          a.ITEM_CATEGORY8.Contains(queryStr) ||
                                          a.USER_STAMP.Contains(queryStr)

                                          || a.ACTIVE.Contains(queryStr) ||
                                          a.ATTRIBUTE_TEMPLATE_NAME.Contains(queryStr) ||
                                          a.USER_DEF1.Contains(queryStr) ||
                                          a.USER_DEF2.Contains(queryStr) ||
                                          a.USER_DEF3.Contains(queryStr) ||
                                          a.USER_DEF4.Contains(queryStr) ||
                                          a.USER_DEF5.Contains(queryStr) ||
                                          a.USER_DEF6.Contains(queryStr) ||
                                          a.USER_DEF7.Contains(queryStr) ||
                                          a.USER_DEF8.Contains(queryStr)

                                          || a.SERIAL_NUM_TEMPLATE_NAME.Contains(queryStr) ||
                                          a.BRAND.Contains(queryStr) ||
                                          a.DIVISION.Contains(queryStr) ||
                                          a.DEPARTMENT.Contains(queryStr)

                                          || a.ITEM_SIZE.Contains(queryStr) ||
                                          a.ITEM_COLOR.Contains(queryStr) ||
                                          a.ITEM_STYLE.Contains(queryStr)


                                          || a.PLACE_OF_ORIGIN.Contains(queryStr) ||
                                          a.ITEM_ATTRIBUTE1.Contains(queryStr) ||
                                          a.ITEM_ATTRIBUTE2.Contains(queryStr) ||
                                          a.ITEM_ATTRIBUTE3.Contains(queryStr) ||
                                          a.ITEM_ATTRIBUTE4.Contains(queryStr) ||
                                          a.ITEM_ATTRIBUTE5.Contains(queryStr) ||
                                          a.ITEM_ATTRIBUTE6.Contains(queryStr) ||
                                          a.ITEM_ATTRIBUTE7.Contains(queryStr) ||
                                          a.ITEM_ATTRIBUTE8.Contains(queryStr)
                                          );
            }
            else
            {
                queryData = m_Rep.GetList(where);
            }


            pager.totalRows = queryData.Count();
            //排序
            queryData = LinqHelper.SortingAndPaging(queryData, pager.sort, pager.order, pager.page, pager.rows);
            return(CreateModelList(ref queryData));
        }
Beispiel #49
0
        public void GridPager_SetsProcessorTypeAsPostProcessor()
        {
            GridProcessorType actual = new GridPager<GridModel>(grid).ProcessorType;
            GridProcessorType expected = GridProcessorType.Post;

            Assert.Equal(expected, actual);
        }
Beispiel #50
0
 public virtual List <SysModuleDataFilterModel> GetListByDepId(ref GridPager pager, string depId, string queryStr)
 {
     return(new List <SysModuleDataFilterModel>());
 }