示例#1
0
        /// <summary>
        /// Checks whether the user has permission to export an inventory item to an IAR.
        /// </summary>
        /// <param name="UserID">The user</param>
        /// <param name="InvItem">The inventory item</param>
        /// <returns>Whether the user is allowed to export the object to an IAR</returns>
        private bool CanUserArchiveObject(UUID UserID, InventoryItemBase InvItem)
        {
            if (FilterContent == null)
            {
                return(true);// Default To Allow Export
            }
            bool permitted = true;

            bool canCopy     = (InvItem.CurrentPermissions & (uint)PermissionMask.Copy) != 0;
            bool canTransfer = (InvItem.CurrentPermissions & (uint)PermissionMask.Transfer) != 0;
            bool canMod      = (InvItem.CurrentPermissions & (uint)PermissionMask.Modify) != 0;

            if (FilterContent.Contains("C") && !canCopy)
            {
                permitted = false;
            }

            if (FilterContent.Contains("T") && !canTransfer)
            {
                permitted = false;
            }

            if (FilterContent.Contains("M") && !canMod)
            {
                permitted = false;
            }

            return(permitted);
        }
        private LoadOperation <ProductManager.Web.Model.project> LoadProjectEntities()
        {
            EntityQuery <ProductManager.Web.Model.project> lQuery;

            if (IsFilter && SelectList == "项目负责人")
            {
                lQuery = this.ProductDomainContext.GetProjectByRespPersonNameQuery(FilterContent);
            }
            else
            {
                lQuery = this.ProductDomainContext.GetProjectByRespPersonNameQuery("");
            }

            if (IsFilter)
            {
                if (SelectList == "生产令号")
                {
                    lQuery = lQuery.Where(c => c.manufacture_number.ToLower().Contains(FilterContent.ToLower()));
                }

                if (SelectList == "项目名称")
                {
                    lQuery = lQuery.Where(c => c.project_name.ToLower().Contains(FilterContent.ToLower()));
                }
            }


            if (IsNotOutput)
            {
                lQuery = lQuery.Where(c => !c.delivery_time.HasValue);
            }
            return(this.ProductDomainContext.Load(lQuery.SortAndPageBy(this.projectView)));
        }
            public void AddsToCriteriaFilter(string value)
            {
                var field    = ContentProperty.Path;
                var criteria = new ContentCriteria();
                var sut      = new FilterContent(criteria, field);

                sut.Contains(value);

                Assert.AreEqual(1, criteria.FilterGroups.Count);
                Assert.AreEqual(field, criteria.FilterGroups[0].Filters[0].Field);
                Assert.AreEqual(value, criteria.FilterGroups[0].Filters[0].Value);
            }
示例#4
0
 public ADFilter()
 {
     Filter = new FilterContent();
 }
示例#5
0
 public ADFilter()
 {
     Filter = new FilterContent();
 }
        private LoadOperation <ProductManager.Web.Model.project_responsible> LoadProjectResponsibleEntities()
        {
            EntityQuery <ProductManager.Web.Model.project_responsible> lQuery = this.ProductDomainContext.GetProject_responsibleQuery();

            if (IsFilter && SelectList == "项目负责人")
            {
                lQuery = lQuery.Where(c => c.responsible_persionName.ToLower().Contains(FilterContent.ToLower()));
            }
            return(this.ProductDomainContext.Load(lQuery.SortAndPageBy(this.projectResponsibleView)));
        }