本文整理汇总了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;
}
示例2: ReadPacket
public IPacket ReadPacket(IMinecraftDataReader reader)
{
EntityID = reader.ReadInt();
Status = (EntityStatus) reader.ReadSByte();
return this;
}
示例3: MasterEntity
public MasterEntity(Guid id, DateTime dateCreated, DateTime dateLastUpdated, EntityStatus status)
: this(id)
{
_DateCreated = dateCreated;
_DateLastUpdated = dateLastUpdated;
_Status = status;
}
示例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;
}
示例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);
}
示例6: Delete
public void Delete()
{
if ( this.EntityStatus == EntityStatus.New )
throw new InvalidOperationException();
this.entityStatus = EntityStatus.Deleted;
Client.Current.DeleteEntity( this );
this.OnPropertyChanged( "EntityStatus" );
}
示例7: GetDomains
public Domain[] GetDomains(string[] domainNames, EntityStatus? status)
{
try
{
return Store.Domains.Get(domainNames, status);
}
catch (Exception ex)
{
throw CreateFault("GetDomains", ex);
}
}
示例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
};
}
示例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)
}
};
}
示例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);
}
示例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;
}
示例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;
}
示例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];
}
示例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;
}
示例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();
}
}