コード例 #1
0
        public TeamViewModel(Team team, string loggedInUser = "")
        {
            Id                     = team.Id;
            TeamCode               = team.TeamCode;
            TeamName               = team.TeamName;
            Theme                  = team.Theme;
            ProblemStatement       = team.ProblemStatement;
            ITRequirements         = team.ITRequirements;
            OtherRequirements      = team.OtherRequirements;
            Participants           = SerializeParticipants(team.Participants);
            CreatedBy              = team.CreatedBy ?? "";
            CreatedOn              = team.CreatedOn;
            CreatedByFormatted     = $"{CreatedBy} [On {CreatedOn:MMM dd hh:mm tt}]";
            IsCreatedByCurrentUser = CreatedBy.Equals(loggedInUser);
            RepoUrl                = team.RepoUrl;
            Location               = team.Location;

            //Convert byte array as base64 encoded string
            if (team?.Avatar?.Length > 0)
            {
                string avatarDataUrl;
                string avatarBase64 = Convert.ToBase64String(team.Avatar);
                avatarDataUrl = $"data:image/png;base64,{avatarBase64}";
                AvatarDataUrl = avatarDataUrl;
            }
        }
コード例 #2
0
 partial void OnCreatedByChanged()
 {
     if (!string.IsNullOrEmpty(_CreatedBy))
     {
         _CreatedBy = CreatedBy.TextEncode();
     }
 }
コード例 #3
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (Name != null)
                {
                    hashCode = hashCode * 59 + Name.GetHashCode();
                }
                if (Description != null)
                {
                    hashCode = hashCode * 59 + Description.GetHashCode();
                }
                if (CreatedBy != null)
                {
                    hashCode = hashCode * 59 + CreatedBy.GetHashCode();
                }
                if (CreatedAt != null)
                {
                    hashCode = hashCode * 59 + CreatedAt.GetHashCode();
                }
                if (Id != null)
                {
                    hashCode = hashCode * 59 + Id.GetHashCode();
                }
                if (Secret != null)
                {
                    hashCode = hashCode * 59 + Secret.GetHashCode();
                }

                hashCode = hashCode * 59 + Enabled.GetHashCode();
                return(hashCode);
            }
        }
コード例 #4
0
        public void LogResource(
            DataStore ds,
            string resourceName,
            DeployedResourceType type,
            CreatedBy createdBy,
            string createdAt,
            string resourceId = null,
            string tier       = null)
        {
            string tenantId          = ds.GetValue("PowerBITenantId");
            string subscriptionId    = ds.GetJson("SelectedSubscription")?["SubscriptionId"]?.ToString();
            string subscriptionName  = ds.GetJson("SelectedSubscription")?["DisplayName"]?.ToString();
            string resourceGroupName = ds.GetValue("SelectedResourceGroup");

            Dictionary <string, string> resourceParams = new Dictionary <string, string>();

            resourceParams.Add("tenantId", tenantId);
            resourceParams.Add("subscriptionId", subscriptionId);
            resourceParams.Add("subscriptionName", subscriptionName);
            resourceParams.Add("resourceGroupName", resourceGroupName);

            resourceParams.Add("resourceName", resourceName);
            resourceParams.Add("resourceType", type.ToString());
            resourceParams.Add("createdBy", createdBy.ToString());
            resourceParams.Add("createdAt", createdAt);
            resourceParams.Add("resourceId", resourceId);
            resourceParams.Add("tier", tier);

            this.LogEvent("LogResource", resourceParams);
        }
コード例 #5
0
ファイル: StockIn.cs プロジェクト: thornfieldhe/CafErp
 protected override void AddDescriptions()
 {
     base.AddDescriptions();
     AddDescription("Code:" + Code.ToStr());
     AddDescription("CreatedBy:" + CreatedBy.ToStr());
     AddDescription("ModifyBy:" + ModifyBy.ToStr());
 }
コード例 #6
0
        public bool Equals(PhysicalObject other)
        {
            if (other == null)
            {
                return(false);
            }

            return(ModelIndex.Equals(other.ModelIndex) &&
                   Handle.Equals(other.Handle) &&
                   Position.Equals(other.Position) &&
                   UprootLimit.Equals(other.UprootLimit) &&
                   CreatedBy.Equals(other.CreatedBy) &&
                   IsPickup.Equals(other.IsPickup) &&
                   IsPickupInShop.Equals(other.IsPickupInShop) &&
                   IsPickupOutOfStock.Equals(other.IsPickupOutOfStock) &&
                   IsGlassCracked.Equals(other.IsGlassCracked) &&
                   IsGlassBroken.Equals(other.IsGlassBroken) &&
                   HasBeenDamaged.Equals(other.HasBeenDamaged) &&
                   UseCarColors.Equals(other.UseCarColors) &&
                   CostValue.Equals(other.CostValue) &&
                   BonusValue.Equals(other.BonusValue) &&
                   CollisionDamageMultiplier.Equals(other.CollisionDamageMultiplier) &&
                   CollisionDamageEffect.Equals(other.CollisionDamageEffect) &&
                   SpecialCollisionResponseCases.Equals(other.SpecialCollisionResponseCases) &&
                   EndOfLifeTime.Equals(other.EndOfLifeTime) &&
                   EntityType.Equals(other.EntityType) &&
                   EntityStatus.Equals(other.EntityStatus) &&
                   EntityFlags.Equals(other.EntityFlags));
        }
コード例 #7
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Name == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Name");
     }
     if (Status == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Status");
     }
     if (CreatedBy == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "CreatedBy");
     }
     if (ModifiedBy == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ModifiedBy");
     }
     if (CreatedBy != null)
     {
         CreatedBy.Validate();
     }
     if (ModifiedBy != null)
     {
         ModifiedBy.Validate();
     }
 }
コード例 #8
0
 public ChatRoom(string image, string mastername, string video, string description, string id, string name, int number)
 {
     createdBy        = new CreatedBy(image, mastername, video);
     this.description = description;
     this.id          = id;
     this.name        = name;
     this.number      = number;
 }
コード例 #9
0
 public void ShouldBe(Order other)
 {
     Id.ShouldBe(other.Id);
     PersonId.ShouldBe(other.PersonId);
     PoNumber.ShouldBe(other.PoNumber);
     Status.ShouldBe(other.Status);
     CreatedOn.ShouldBe(other.CreatedOn);
     CreatedBy.ShouldBe(other.CreatedBy);
 }
コード例 #10
0
 public override void InputFormFields()
 {
     if (Data.Type != null)
     {
         Type.Wait(5).SelectByText(Data.Type);
     }
     if (Data.Subject != null)
     {
         Subject.Wait(5).SelectByText(Data.Subject);
     }
     if (Data.FromGrade != null)
     {
         FromGrade.Wait(5).SelectByText(Data.FromGrade);
     }
     if (Data.ToGrade != null)
     {
         ToGrade.Wait(5).SelectByText(Data.ToGrade);
     }
     if (Data.Title != null)
     {
         Title.SendKeys("" + Data.Title);
     }
     if (Data.Genre != null)
     {
         Genre.SendKeys("" + Data.Genre);
     }
     if (Data.Topic != null)
     {
         Topic.SendKeys("" + Data.Topic);
     }
     if (Data.Author != null)
     {
         Author.SendKeys("" + Data.Author);
     }
     if (Data.CreatedBy != null)
     {
         CreatedBy.Wait(5).SelectByText(Data.CreatedBy);
     }
     if (Data.QuestionLanguage != null)
     {
         QuestionLanguage.Wait(5).SelectByText(Data.QuestionLanguage);
     }
     if (Data.Publisher != null)
     {
         Publisher.SendKeys("" + Data.Publisher);
     }
     if (Data.NumberOfWordsFrom != null)
     {
         NumberOfWordsFrom.SendKeys("" + Data.NumberOfWordsFrom);
     }
     if (Data.NumberOfWordsTo != null)
     {
         NumberOfWordsTo.SendKeys("" + Data.NumberOfWordsTo);
     }
 }
コード例 #11
0
        public void IsSatisfiedBy_WhenCreatedByMatchesValue_ReturnsTrue()
        {
            var createdBy  = _fixture.Create <int>();
            var mockEntity = new Mock <ICreatedAudit>();

            mockEntity.Setup(a => a.CreatedBy).Returns(createdBy);
            var specification = new CreatedBy <ICreatedAudit>(createdBy);
            var satisified    = specification.IsSatisfiedBy(mockEntity.Object);

            Assert.IsTrue(satisified);
        }
コード例 #12
0
        public static CreatedBy CreatedBy(this Guid cADModelId)
        {
            CreatedBy createdBy = new CreatedBy();

            createdBy.CADModelId = cADModelId.ToString();
            createdBy.date       = DateTime.Now;
            createdBy.personId   = Environment.UserName;
            createdBy.programId  = "SAM_gbXML";

            return(createdBy);
        }
コード例 #13
0
ファイル: User.cs プロジェクト: ninjanomnom/tgstation-server
 /// <summary>
 /// See <see cref="ToApi(bool)"/>
 /// </summary>
 /// <param name="recursive">If we should recurse on <see cref="CreatedBy"/></param>
 /// <param name="showDetails">If rights and system identifier should be shown</param>
 /// <returns>A new <see cref="Api.Models.User"/></returns>
 Api.Models.User ToApi(bool recursive, bool showDetails) => new Api.Models.User
 {
     AdministrationRights = showDetails ? AdministrationRights : null,
     CreatedAt            = CreatedAt,
     CreatedBy            = recursive ? CreatedBy?.ToApi(false, false) : null,
     Enabled = Enabled,
     Id      = Id,
     InstanceManagerRights = showDetails ? InstanceManagerRights : null,
     Name             = Name,
     SystemIdentifier = showDetails ? SystemIdentifier : null
 };
コード例 #14
0
ファイル: GroupBan.cs プロジェクト: EndGameGl/.NetBungieAPI
 public bool DeepEquals(GroupBan?other)
 {
     return(other is not null &&
            GroupId == other.GroupId &&
            (LastModifiedBy is not null ? LastModifiedBy.DeepEquals(other.LastModifiedBy) : other.LastModifiedBy is null) &&
            (CreatedBy is not null ? CreatedBy.DeepEquals(other.CreatedBy) : other.CreatedBy is null) &&
            DateBanned == other.DateBanned &&
            DateExpires == other.DateExpires &&
            Comment == other.Comment &&
            (BungieNetUserInfo is not null ? BungieNetUserInfo.DeepEquals(other.BungieNetUserInfo) : other.BungieNetUserInfo is null) &&
            (DestinyUserInfo is not null ? DestinyUserInfo.DeepEquals(other.DestinyUserInfo) : other.DestinyUserInfo is null));
 }
コード例 #15
0
        public virtual bool IsOf(string userName)
        {
            bool _isCreatedBy = CreatedBy.ToLower() == userName.ToLower();
            bool _isUpdatedBy = (!LastUpdatedBy.IsNullOrEmptyOrWhiteSpace()) &&
                                (LastUpdatedBy.ToLower() == userName.ToLower());

            if (_isCreatedBy || _isUpdatedBy)
            {
                return(true);
            }
            return(false);
        }
コード例 #16
0
 public AdminNote Clone()
 {
     return(new AdminNote()
     {
         CreatedBy = CreatedBy.Clone(),
         CreationDate = CreationDate,
         Id = Id,
         LastUpdatedBy = LastUpdatedBy,
         LastUpdatedDate = LastUpdatedDate,
         Note = Note
     });
 }
コード例 #17
0
ファイル: Database.Tables.cs プロジェクト: Affixx/affixx
 public override int GetHashCode()
 {
     unchecked {
         const int randomPrime = 397;
         int       hashCode    = Id.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ DocumentId.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ Rating.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ CreatedBy.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ CreatedAt.GetHashCode();
         return(hashCode);
     }
 }
コード例 #18
0
ファイル: Shelf.cs プロジェクト: olcay/om
        public Star Star(string userId)
        {
            if (this.CreatedById != userId)
            {
                var notification = Notification.ShelfStarred(this);
                CreatedBy.Notify(notification);
            }

            return(new Star()
            {
                Shelf = this, UserId = userId
            });
        }
コード例 #19
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Message?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalSupplierStock?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (OrderForecastQuantity?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Diff?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (SalesForecastDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (CreatedBy?.GetHashCode() ?? 0);
            return(hashCode);
        }
コード例 #20
0
ファイル: Database.Tables.cs プロジェクト: Affixx/affixx
 public override int GetHashCode()
 {
     unchecked {
         const int randomPrime = 397;
         int       hashCode    = Id.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ DocumentId.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ (Text != null ? Text.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ CreatedBy.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ CreatedAt.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ (DeletedAt != null ? DeletedAt.GetHashCode() : 0);
         return(hashCode);
     }
 }
コード例 #21
0
 public override int GetHashCode()
 {
     unchecked {
         int hashCode = (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CreatedBy != null ? CreatedBy.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Created.GetHashCode();
         hashCode = (hashCode * 397) ^ LastUpdated.GetHashCode();
         hashCode = (hashCode * 397) ^ (Id != null ? Id.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ VersionCounter.GetHashCode();
         hashCode = (hashCode * 397) ^ (Workspaces != null ? Workspaces.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0);
         return(hashCode);
     }
 }
コード例 #22
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (Id != null ? Id.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ VersionCounter.GetHashCode();
         hashCode = (hashCode * 397) ^ Created.GetHashCode();
         hashCode = (hashCode * 397) ^ LastUpdated.GetHashCode();
         hashCode = (hashCode * 397) ^ (CreatedBy != null ? CreatedBy.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (WorkspaceId != null ? WorkspaceId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (BranchName != null ? BranchName.GetHashCode() : 0);
         return(hashCode);
     }
 }
コード例 #23
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ImportId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Status?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (CreatedBy?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (CreatedOn?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (StartDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (EndDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (State?.GetHashCode() ?? 0);
            return(hashCode);
        }
コード例 #24
0
ファイル: Database.Tables.cs プロジェクト: Affixx/affixx
 public override int GetHashCode()
 {
     unchecked {
         const int randomPrime = 397;
         int       hashCode    = Id.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ UniversityId.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ (Group != null ? Group.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (Code != null ? Code.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ CreatedBy.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ CreatedAt.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ (DeletedAt != null ? DeletedAt.GetHashCode() : 0);
         return(hashCode);
     }
 }
コード例 #25
0
        /// <summary>
        /// Returns true if AppTemplateConfiguration instances are equal
        /// </summary>
        /// <param name="other">Instance of AppTemplateConfiguration to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(AppTemplateConfiguration other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                     ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     CreatedBy == other.CreatedBy ||
                     CreatedBy != null &&
                     CreatedBy.Equals(other.CreatedBy)
                 ) &&
                 (
                     CreatedAt == other.CreatedAt ||
                     CreatedAt != null &&
                     CreatedAt.Equals(other.CreatedAt)
                 ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     Secret == other.Secret ||
                     Secret != null &&
                     Secret.Equals(other.Secret)
                 ) &&
                 (
                     Enabled == other.Enabled ||

                     Enabled.Equals(other.Enabled)
                 ));
        }
コード例 #26
0
ファイル: User.cs プロジェクト: yeethawe/tgstation-server
 /// <summary>
 /// See <see cref="ToApi(bool)"/>
 /// </summary>
 /// <param name="recursive">If we should recurse on <see cref="CreatedBy"/></param>
 /// <param name="showDetails">If rights and system identifier should be shown</param>
 /// <returns>A new <see cref="Api.Models.User"/></returns>
 Api.Models.User ToApi(bool recursive, bool showDetails) => new Api.Models.User
 {
     CreatedAt = showDetails ? CreatedAt : null,
     CreatedBy = showDetails && recursive?CreatedBy?.ToApi(false, false) : null,
                     Enabled          = showDetails ? Enabled : null,
                     Id               = Id,
                     Name             = Name,
                     SystemIdentifier = showDetails ? SystemIdentifier : null,
                     OAuthConnections = showDetails
                         ? OAuthConnections
                                        ?.Select(x => x.ToApi())
                                        .ToList()
                         : null,
                     Group         = showDetails ? Group?.ToApi(false) : null,
                     PermissionSet = showDetails ? PermissionSet?.ToApi() : null,
 };
コード例 #27
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (Id != null ? Id.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ VersionCounter.GetHashCode();
         hashCode = (hashCode * 397) ^ Created.GetHashCode();
         hashCode = (hashCode * 397) ^ LastUpdated.GetHashCode();
         hashCode = (hashCode * 397) ^ (CreatedBy != null ? CreatedBy.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ContentType != null ? ContentType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Filename != null ? Filename.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Url != null ? Url.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Size.GetHashCode();
         return(hashCode);
     }
 }
コード例 #28
0
        public bool Equals(OwnerHistoryKey other)
        {
            // First two lines are just optimizations
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(CreatedBy.Equals(other.CreatedBy, StringComparison.OrdinalIgnoreCase) &&
                   ExtSystem.Equals(other.ExtSystem, StringComparison.OrdinalIgnoreCase) &&
                   CreatedOn.ToString().Equals(other.CreatedOn.ToString(), StringComparison.OrdinalIgnoreCase));
        }
コード例 #29
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Name == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Name");
     }
     if (CreatedBy == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "CreatedBy");
     }
     if (ModifiedBy == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ModifiedBy");
     }
     if (ModelStatus == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ModelStatus");
     }
     if (Documents != null)
     {
         foreach (var element in Documents)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (ModelRegionStatuses != null)
     {
         foreach (var element1 in ModelRegionStatuses)
         {
             if (element1 != null)
             {
                 element1.Validate();
             }
         }
     }
     if (CreatedBy != null)
     {
         CreatedBy.Validate();
     }
     if (ModifiedBy != null)
     {
         ModifiedBy.Validate();
     }
 }
コード例 #30
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Name == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Name");
     }
     if (LanguagePair == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "LanguagePair");
     }
     if (Category == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Category");
     }
     if (Status == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Status");
     }
     if (CreatedBy == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "CreatedBy");
     }
     if (ModifiedBy == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ModifiedBy");
     }
     if (ApiDomain == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ApiDomain");
     }
     if (LanguagePair != null)
     {
         LanguagePair.Validate();
     }
     if (Category != null)
     {
         Category.Validate();
     }
     if (CreatedBy != null)
     {
         CreatedBy.Validate();
     }
     if (ModifiedBy != null)
     {
         ModifiedBy.Validate();
     }
 }