示例#1
0
        public RoyaltyConfig GetConfig(RoyaltyType type, Guid acceptID, Guid expendID)
        {
            var entity = this.Context.RoyaltyConfigs.GetSingle(p => p.RoyaltyType == (int)type && p.AcceptID == acceptID && p.ExpendID == expendID);

            if (entity == null)
            {
                this.Context.RoyaltyConfigs.Insert(entity = new RoyaltyConfig
                {
                    ID          = Guid.NewGuid(),
                    AcceptID    = acceptID,
                    ExpendID    = expendID,
                    Percent     = 0,
                    CreateDate  = DateTime.Now,
                    ModifyDate  = DateTime.Now,
                    RoyaltyType = (int)type,
                    State       = (int)DataState.Normal
                });
            }
            return(entity);
        }
示例#2
0
 public RoyaltyConfigModel this[RoyaltyType type, Models.WorkGroupManagerCategoryModel catetory]
 {
     get { return(data.FirstOrDefault(p => p.RoyaltyType == type && p.AcceptID == catetory.ID)); }
 }
示例#3
0
 public RoyaltyConfigModel this[RoyaltyType type, LevelModel accpt, LevelModel expend]
 {
     get { return(data.FirstOrDefault(p => p.RoyaltyType == type && p.AcceptID == accpt.ID && p.ExpendID == expend.ID)); }
 }
 public override int GetHashCode()
 {
     return($"RoyaltyDefinition:{RoyaltyType.GetHashCode()}:{Account?.GetHashCode()}:{Token?.GetHashCode()}:{FixedAmount?.GetHashCode()}:{Numerator?.GetHashCode()}:{Denominator?.GetHashCode()}:{FallbackAmount?.GetHashCode()}:{FallbackToken?.GetHashCode()}:{Minimum?.GetHashCode()}:{Maximum?.GetHashCode()}:{AssessAsSurcharge.GetHashCode()}".GetHashCode());
 }