当前位置: 首页>>代码示例>>C#>>正文


C# EntityStatus类代码示例

本文整理汇总了C#中EntityStatus的典型用法代码示例。如果您正苦于以下问题:C# EntityStatus类的具体用法?C# EntityStatus怎么用?C# EntityStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EntityStatus类属于命名空间,在下文中一共展示了EntityStatus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckCommoditySupplierIsUsed

        public bool CheckCommoditySupplierIsUsed(CommoditySupplier commoditySupplier, EntityStatus intendedStatus)
        {
            if (intendedStatus == EntityStatus.Inactive)
            {
                if ( _ctx.tblCommodityOwner.Any(n => n.CostCentreId == commoditySupplier.Id && n.IM_Status == (int) EntityStatus.Active))
                    return true;
                if (_ctx.tblCommodityProducer.Any(n => n.CostCentreId == commoditySupplier.Id && n.IM_Status == (int)EntityStatus.Active))
                    return true;
            }
            if (intendedStatus == EntityStatus.Deleted)
            {
                if (_ctx.tblCommodityOwner.Any(n => n.CostCentreId == commoditySupplier.Id &&
                                                    (n.IM_Status == (int) EntityStatus.Active ||
                                                     n.IM_Status == (int) EntityStatus.Inactive)
                    ))
                    return true;
                if (_ctx.tblCommodityProducer.Any(n => n.CostCentreId == commoditySupplier.Id &&
                                                       (n.IM_Status == (int) EntityStatus.Active ||
                                                        n.IM_Status == (int) EntityStatus.Inactive)
                    )) return true;
            }
            if (_ctx.tblSourcingDocument.Any(n => n.DocumentOnBehalfOfCostCentreId == commoditySupplier.Id))
                return true;

            return false;
        }
开发者ID:asanyaga,项目名称:BuildTest,代码行数:26,代码来源:MasterDataUsage.cs

示例2: ReadPacket

        public IPacket ReadPacket(IMinecraftDataReader reader)
        {
            EntityID = reader.ReadInt();
            Status = (EntityStatus) reader.ReadSByte();

            return this;
        }
开发者ID:beppe9000,项目名称:MineLib.Network,代码行数:7,代码来源:EntityStatusPacket.cs

示例3: MasterEntity

 public MasterEntity(Guid id, DateTime dateCreated, DateTime dateLastUpdated, EntityStatus status)
     : this(id)
 {
     _DateCreated = dateCreated;
     _DateLastUpdated = dateLastUpdated;
     _Status = status;
 }
开发者ID:asanyaga,项目名称:BuildTest,代码行数:7,代码来源:MasterEntity.cs

示例4: ChangeStatusForm

 public ChangeStatusForm(string entityName, string entityType, EntityStatus status)
 {
     InitializeComponent();
     lblMessage.Text = string.Format(status == EntityStatus.Active ? DisableFormat : EnableFormat,
                                     entityType ?? Unknown,
                                     entityName ?? Unknown);
     Width = lblMessage.Width + 72;
 }
开发者ID:sscctech,项目名称:ServiceBusExplorer,代码行数:8,代码来源:ChangeStatusForm.cs

示例5: GetAddressesOrDomain

        public static Address GetAddressesOrDomain(this IAddressManager client, MailAddress address, EntityStatus? status)
        {
            if (address == null)
            {
                throw new ArgumentNullException("address");
            }

            return client.GetAddressesOrDomain(address.Address, status);
        }
开发者ID:DM-TOR,项目名称:nhin-d,代码行数:9,代码来源:AddressManagerExtensions.cs

示例6: Delete

        public void Delete()
        {
            if ( this.EntityStatus == EntityStatus.New )
                throw new InvalidOperationException();

            this.entityStatus = EntityStatus.Deleted;
            Client.Current.DeleteEntity( this );

            this.OnPropertyChanged( "EntityStatus" );
        }
开发者ID:jogibear9988,项目名称:ormbattle,代码行数:10,代码来源:Entity.cs

示例7: GetDomains

 public Domain[] GetDomains(string[] domainNames, EntityStatus? status)
 {
     try
     {
         return Store.Domains.Get(domainNames, status);
     }
     catch (Exception ex)
     {
         throw CreateFault("GetDomains", ex);
     }
 }
开发者ID:JoshuaJeong,项目名称:nhin-d.net35,代码行数:11,代码来源:DomainManagerService.svc.cs

示例8: MakeItem

 public static CertainValueCertainProductDiscount.CertainValueCertainProductDiscountItem MakeItem(decimal value = 100, int effectiveDateOffset = -1,
     int endDateOffset = 1, EntityStatus status = EntityStatus.Active)
 {
     return new CertainValueCertainProductDiscount.CertainValueCertainProductDiscountItem(Guid.NewGuid())
     {
         EffectiveDate = DateTime.Now.AddDays(effectiveDateOffset),
         EndDate = DateTime.Now.AddDays(endDateOffset),
         CertainValue = value,
         IsActive = status,
         _Status = status
     };
 }
开发者ID:asanyaga,项目名称:BuildTest,代码行数:12,代码来源:CertainValueCertainProductDiscountRepositoryTest.cs

示例9: MakeDiscount

 public static CertainValueCertainProductDiscount MakeDiscount(decimal value = 100, int effectiveDateOffset = -1,
     int endDateOffset = 1, EntityStatus status = EntityStatus.Active)
 {
     return new CertainValueCertainProductDiscount(Guid.NewGuid())
     {
         CertainValueCertainProductDiscountItems =
             new List<CertainValueCertainProductDiscount.CertainValueCertainProductDiscountItem>
             {
                 MakeItem(value, effectiveDateOffset, endDateOffset, status)
             }
     };
 }
开发者ID:asanyaga,项目名称:BuildTest,代码行数:12,代码来源:CertainValueCertainProductDiscountRepositoryTest.cs

示例10: GetPostPage

        public IEntityPage<IPost> GetPostPage(int? tagId, int? seriesId, EntityStatus status, int skipCount, int takeCount)
        {
            //Get total count
            var postCount = AppCache.PostCounts.GetOrAddCount(() => GetPostCounts(tagId, seriesId, status)
                , tagId, seriesId, status);

            //Get posts for the requested page
            var sql = GetPostsPageSql(false, tagId, seriesId, status, skipCount, takeCount);
            var posts = this.dbContext.Query<Post, Series>(sql).Select(p => SetupPostAfterLoad(p, false));

            return new EntityPage<IPost>(skipCount, takeCount, postCount, posts);
        }
开发者ID:sytelus,项目名称:CCBlog,代码行数:12,代码来源:Repository.cs

示例11: Get

 public static IEnumerable<Domain> Get(this Table<Domain> table, string[] domains, EntityStatus status)
 {
     if (domains.IsNullOrEmpty())
     {
         throw new ArgumentException("value was null or empty", "domains");
     }
     //
     // We cannot precompile this (throws at runtime) because domains.Length can change at runtime
     //
     return from domain in table.GetDB().Domains
            where domains.Contains(domain.Name) && domain.Status == status
            select domain;
 }
开发者ID:DM-TOR,项目名称:nhin-d,代码行数:13,代码来源:DomainQueries.cs

示例12: Get

 public static IEnumerable<Address> Get(this Table<Address> table, string[] emailAddresses, EntityStatus? status)
 {
     if (emailAddresses.IsNullOrEmpty())
     {
         throw new ArgumentException("value was null or empty", "emailAddresses");
     }
     //
     // We cannot precompile this (throws at runtime) because emailAddresses.Length can change at runtime
     //
     return from address in table.GetDB().Addresses
            where emailAddresses.Contains(address.EmailAddress) && address.Status == status
            select address;
 }
开发者ID:DM-TOR,项目名称:nhin-d,代码行数:13,代码来源:AddressQueries.cs

示例13: GetDomain

        public static Domain GetDomain(this DomainManagerClient client, string domainName, EntityStatus? status)
        {
            if (string.IsNullOrEmpty(domainName))
            {
                throw new ArgumentException("value was null or empty", "domainName");
            }

            Domain[] domains = client.GetDomains(new string[] { domainName }, status);
            if (domains.IsNullOrEmpty())
            {
                return null;
            }

            return domains[0];
        }
开发者ID:DM-TOR,项目名称:nhin-d,代码行数:15,代码来源:DomainManagerExtensions.cs

示例14: CheckCommodityOwnerTypeIsUsed

 public bool CheckCommodityOwnerTypeIsUsed(CommodityOwnerType commodityOwnerType, EntityStatus intendedStatus)
 {
     if (intendedStatus == EntityStatus.Inactive)
     {
         if (_ctx.tblCommodityOwner.Any(n => n.CommodityOwnerTypeId == commodityOwnerType.Id && n.IM_Status == (int)EntityStatus.Active))
             return true;
     }
     else if (intendedStatus == EntityStatus.Deleted)
     {
         if (_ctx.tblCommodityOwner.Any(n => n.CommodityOwnerTypeId == commodityOwnerType.Id &&
             (n.IM_Status == (int)EntityStatus.Inactive || n.IM_Status == (int)EntityStatus.Active)))
             return true;
     }
     return false;
 }
开发者ID:asanyaga,项目名称:BuildTest,代码行数:15,代码来源:MasterDataUsage.cs

示例15: Save

        public void Save()
        {
            switch ( this.EntityStatus )
            {
                case EntityStatus.Dirty:
                    Client.Current.UpdateEntity( this );
                    this.entityStatus = EntityStatus.Clean;
                    break;

                case EntityStatus.New:
                    Client.Current.CreateEntity( this );
                    this.entityStatus = EntityStatus.Clean;
                    break;

                case EntityStatus.Deleted:
                case EntityStatus.Conflict:
                    throw new InvalidOperationException();
            }
        }
开发者ID:jogibear9988,项目名称:ormbattle,代码行数:19,代码来源:Entity.cs


注:本文中的EntityStatus类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。