Example #1
0
    public override string ToString()
    {
        var sb = new StringBuilder("Playlist(");

        sb.Append(", IdPlaylist: ");
        sb.Append(IdPlaylist);
        if (Name != null && __isset.name)
        {
            sb.Append(", Name: ");
            sb.Append(Name);
        }
        if (Description != null && __isset.description)
        {
            sb.Append(", Description: ");
            sb.Append(Description);
        }
        if (CreationDate != null && __isset.creationDate)
        {
            sb.Append(", CreationDate: ");
            sb.Append(CreationDate == null ? "<null>" : CreationDate.ToString());
        }
        if (CoverPath != null && __isset.coverPath)
        {
            sb.Append(", CoverPath: ");
            sb.Append(CoverPath);
        }
        sb.Append(")");
        return(sb.ToString());
    }
Example #2
0
        /// <summary>
        /// Gets a JSON representation for this error suitable for cross-domain
        /// </summary>
        /// <returns></returns>
        public string ToDetailedJson()
        {
            var serializer = new JavaScriptSerializer();

            return(serializer.Serialize(new
            {
                GUID,
                ApplicationName,
                CreationDate = CreationDate.ToEpochTime(),
                CustomData,
                DeletionDate = DeletionDate.ToEpochTime(),
                Detail,
                DuplicateCount,
                ErrorHash,
                HTTPMethod,
                Host,
                IPAddress,
                IsProtected,
                MachineName,
                Message,
                SQL,
                Source,
                StatusCode,
                Type,
                Url,
                QueryString = ServerVariables != null ? ServerVariables["QUERY_STRING"] : null,
                ServerVariables = ServerVariablesSerialzable.ToJsonDictionary(),
                CookieVariables = CookiesSerialzable.ToJsonDictionary(),
                QueryStringVariables = QueryStringSerialzable.ToJsonDictionary(),
                FormVariables = FormSerialzable.ToJsonDictionary()
            }));
        }
Example #3
0
 public void CheckDays()
 {
     if (CreationDate.AddDays(Convert.ToInt32(new PaidToPromotePack(PackId).Ends.Value)) <= AppSettings.ServerTime)
     {
         Finish();
     }
 }
Example #4
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((CreationDate.GetHashCode() * 397) ^ Id);
     }
 }
Example #5
0
 public override string ToString()
 {
     return(Title + " : " +
            Description + " [ " +
            CreationDate.ToShortDateString() + " ] " +
            Copleted.ToString());
 }
Example #6
0
        public Dictionary <string, string> ToDictionary()
        {
            var result = new Dictionary <string, string>();

            if (Name != null)
            {
                result.Add("Name", Name);
            }
            if (AuthorName != null)
            {
                result.Add("AuthorName", AuthorName);
            }
            if (AuthorEmail != null)
            {
                result.Add("AuthorEmail", AuthorEmail);
            }
            if (CreationDate != null)
            {
                result.Add("CreationDate", CreationDate.ToString());
            }
            if (Difficulty != null)
            {
                result.Add("Difficulty", Difficulty.ToString());
            }
            return(result);
        }
Example #7
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            hashcode = (hashcode * 397) + IdPlaylist.GetHashCode();
            if (__isset.name)
            {
                hashcode = (hashcode * 397) + Name.GetHashCode();
            }
            if (__isset.description)
            {
                hashcode = (hashcode * 397) + Description.GetHashCode();
            }
            if (__isset.creationDate)
            {
                hashcode = (hashcode * 397) + CreationDate.GetHashCode();
            }
            if (__isset.coverPath)
            {
                hashcode = (hashcode * 397) + CoverPath.GetHashCode();
            }
        }
        return(hashcode);
    }
Example #8
0
        public Coupon()
        {
            CreationDate = DateTime.Now;
            const int expirationDays = 14;

            ExpirationDate = CreationDate.AddDays(expirationDays);
        }
        public override ExecutionResult Run(IStepExecutionContext context)
        {
            var correctiveAction = new CorrectiveActionWorkflowData();

            correctiveAction.WorkflowId                = context.Workflow.Id;
            correctiveAction.CreationDate              = CreationDate;
            correctiveAction.Description               = Description;
            correctiveAction.FindingID                 = FindingID;
            correctiveAction.EmitterUserID             = EmitterUserID;
            correctiveAction.PlantLocationID           = PlantLocationID;
            correctiveAction.SectorLocationID          = SectorLocationID;
            correctiveAction.PlantTreatmentID          = PlantTreatmentID;
            correctiveAction.SectorTreatmentID         = SectorTreatmentID;
            correctiveAction.ResponsibleUserID         = ResponsibleUserID;
            correctiveAction.ReviewerUserID            = ReviewerUserID;
            correctiveAction.DeadlineDatePlanification = CreationDate.AddDays(_parametrizationCorrectiveActionRepository.GetByCode(STATE_PARAMETRIZATION_CORRECTIVEACTION_CODE_PLANIFICATION));

            correctiveAction.CorrectiveActionStateID = _correctiveActionStateRepository.GetByCode(STATE_OPEN_CODE);
            CorrectiveActionWorkflowData correctiveActionWorkFlowData = _correctiveActionRepository.Add(correctiveAction);

            _correctiveActionStateHistoryRepository.Add(correctiveActionWorkFlowData.CorrectiveActionID, correctiveActionWorkFlowData.CorrectiveActionStateID, EmitterUserID);

            EmailAddresses.AddRange(_userWorkflowRepository.GetUsersEmailResponsibleSGC());
            EmailAddresses.Add(_userWorkflowRepository.GetUserEmailByID(ResponsibleUserID));
            EmailAddresses.Add(_userWorkflowRepository.GetUserEmailByID(ReviewerUserID));
            EmailAddresses.AddRange(_sectorPlantRepository.GetSectorPlantReferredEmail(Convert.ToInt32(correctiveAction.PlantTreatmentID), Convert.ToInt32(correctiveAction.SectorTreatmentID)));

            correctiveAction = _correctiveActionRepository.GetOneByWorkflowId(correctiveAction.WorkflowId);
            var emailType = "new";

            this.EmailSubject = EmailStrings.GetSubjectCorrectiveAction(emailType);
            this.EmailMessage = EmailStrings.GetMessageCorrectiveAction(correctiveAction, _emailSettings.Url, emailType);

            return(ExecutionResult.Next());
        }
Example #10
0
        /// <summary>
        /// Return a JSON representation of this object.
        /// </summary>
        /// <param name="Embedded">Whether this data is embedded into another data structure.</param>
        /// <param name="IncludeCryptoHash">Include the crypto hash value of this object.</param>
        public JObject ToJSON(Boolean Embedded          = false,
                              InfoStatus ExpandTags     = InfoStatus.ShowIdOnly,
                              Boolean IncludeCryptoHash = false)

        => JSONObject.Create(

            new JProperty("@id", Id.ToString()),

            !Embedded
                       ? new JProperty("@context", JSONLDContext.ToString())
                       : null,

            Name.IsNeitherNullNorEmpty()
                       ? new JProperty("name", Name.ToJSON())
                       : null,

            Description.IsNeitherNullNorEmpty()
                       ? new JProperty("description", Description.ToJSON())
                       : null,

            new JProperty("creationDate", CreationDate.ToIso8601()),

            Tags.Any()
                       ? new JProperty("tags", Tags.SafeSelect(tag => tag.ToJSON(ExpandTags)))
                       : null,

            new JProperty("isDisabled", IsDisabled)

            );
Example #11
0
        public byte[] ToBinary()
        {
            using (var mem = new MemoryStream())
                using (var bin = new BinaryWriter(mem))
                {
                    bin.Write(Signature);
                    bin.Write(Id);
                    bin.Write(PostTypeId);
                    bin.Write(CreationDate.ToBinary());
                    bin.Write(ViewCount);
                    bin.Write(Body ?? "");
                    bin.Write(OwnerUserId);
                    bin.Write(LastEditDate.ToBinary());
                    bin.Write(Title ?? "");
                    bin.Write(AnswerCount);
                    bin.Write(CommentCount);
                    bin.Write(FavoriteCount);
                    bin.Write(Tags == null ? 0 : Tags.Length);
                    if (Tags != null)
                    {
                        foreach (var tag in Tags)
                        {
                            bin.Write(tag);
                        }
                    }

                    return(mem.ToArray());
                }
        }
Example #12
0
        public PdfMetadata(
            string title,
            string author,
            string subject,
            string keywords,
            string creator,
            DateTime creationDate,
            DateTime modDate)
        {
            Title        = title;
            Author       = author;
            Subject      = subject;
            Keywords     = keywords;
            Creator      = creator;
            CreationDate = CreationDate;
            ModDate      = ModDate;

            var version = "1.0.0"; // TODO: read version from csproj or something

            Producer = $"EnumPdf Version:{version}";

            Dictionary.Add(nameof(Title), $"({Title})");
            Dictionary.Add(nameof(Author), $"({Author})");
            Dictionary.Add(nameof(Subject), $"({Subject})");
            Dictionary.Add(nameof(Keywords), $"({Keywords})");
            Dictionary.Add(nameof(Creator), $"({Creator})");
            Dictionary.Add(nameof(Producer), $"({Producer})");
            Dictionary.Add(nameof(CreationDate), $"({CreationDate.ToAsnDate()})");
            Dictionary.Add(nameof(ModDate), $"({ModDate.ToAsnDate()})");
        }
Example #13
0
 public Survey(string surveyTitle, DateTime?closingDate = null)
 {
     CreationDate = DateTime.Now;
     SurveyTitle  = surveyTitle;
     ClosingDate  = (closingDate == null) ? CreationDate.AddDays(7) : (DateTime)closingDate;
     SurveyGuid   = Guid.NewGuid().ToString();
 }
Example #14
0
        /// <summary>
        /// Object Hash code
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = CVList != null?CVList.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (AnalysisSoftwareList != null ? AnalysisSoftwareList.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Provider != null ? Provider.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (AuditCollection != null ? AuditCollection.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^
                           (AnalysisSampleCollection != null ? AnalysisSampleCollection.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (SequenceCollection != null ? SequenceCollection.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (AnalysisCollection != null ? AnalysisCollection.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^
                           (AnalysisProtocolCollection != null ? AnalysisProtocolCollection.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (DataCollection != null ? DataCollection.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^
                           (BibliographicReferences != null ? BibliographicReferences.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ CreationDate.GetHashCode();
                hashCode = (hashCode * 397) ^ (Version != null ? Version.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Id != null ? Id.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
                return(hashCode);
            }
        }
Example #15
0
        public Coupon(IDateTimeProvider dateTimeProvider)
        {
            this.dateTimeProvider = dateTimeProvider;
            CreationDate          = dateTimeProvider.Now;
            const int expirationDays = 14;

            ExpirationDate = CreationDate.AddDays(expirationDays);
        }
Example #16
0
 public RelationshipData GetRelationshipDetail()
 {
     return(new RelationshipData
     {
         Label = Label,
         CreationDate = CreationDate.ToTimestamp()
     });
 }
Example #17
0
        /// <summary>
        /// Override of the get hash code method.
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            //Get hash code for the nullable fields.
            int hashKey = Key == null ? 0 : Key.GetHashCode();

            //Calculate the hash code for the GPOPolicy.
            return(_id.GetHashCode() ^ CreationDate.GetHashCode() ^ UserId.GetHashCode() ^ hashKey);
        }
Example #18
0
 public bool Equals(TicketResponse other)
 {
     return(other.CreationDate.ToShortDateString() == CreationDate.ToShortDateString() &&
            other.Creator == Creator &&
            other.MinsSpent == MinsSpent &&
            other.Response == Response &&
            other.TicketId == TicketId);
 }
Example #19
0
        public override int GetHashCode()
        {
            int hashCode = 1212440406;

            hashCode = hashCode * HashConstants.MULTIPLIER + CreationDate.TruncateToSecond().GetHashCode();
            hashCode = hashCode * HashConstants.MULTIPLIER + (ModifiedDate?.TruncateToSecond().GetHashCode() ?? 0);
            return(hashCode);
        }
Example #20
0
 internal void ToXml(XmlWriter writer, string element)
 {
     writer.WriteStartElement(element);
     writer.WriteAttributeString("date", CreationDate.ToString("s"));
     writer.WriteAttributeString("name", Name);
     writer.WriteAttributeString("owner", OwnerName);
     writer.WriteEndElement();
 }
Example #21
0
 public virtual void updateDefaultDataToPersists()
 {
     if (CreationDate.IsInvalid())
     {
         CreationDate = DateTime.UtcNow;
     }
     LastUpdateDate = DateTime.UtcNow;
 }
Example #22
0
        public override string ToString()
        {
            var creationDate = CreationDate.ToString("hh:mm:ss.f");
            var deliveryDate = DeliveryDate.ToString("hh:mm:ss.f");
            var spendingTime = Math.Round((DeliveryDate - CreationDate).TotalSeconds, 3).ToString("F3");

            return($"Cake '{Id}' tooks '{spendingTime}' seconds [created '{creationDate}' delivered '{deliveryDate}']");
        }
Example #23
0
        // This implementation of ToString() is only for the purposes of the sample console application.
        // You can override ToString() in your own model class if you want, but you don't need to in order
        // to use the Azure Search .NET SDK.
        public override string ToString()
        {
            var builder = new StringBuilder();

            builder.AppendFormat("Article {0}: {1}", ID, Title).AppendLine();
            builder.AppendFormat("Author: {0}", Author).AppendLine();
            builder.AppendFormat("CreationDate: {0}", CreationDate.ToString()).AppendLine();
            return(builder.ToString());
        }
Example #24
0
        public bool Equals(Application input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     ApplicationId == input.ApplicationId ||
                     (ApplicationId.Equals(input.ApplicationId))
                     ) &&
                 (
                     Name == input.Name ||
                     (Name != null && Name.Equals(input.Name))
                 ) &&
                 (
                     RedirectUrl == input.RedirectUrl ||
                     (RedirectUrl != null && RedirectUrl.Equals(input.RedirectUrl))
                 ) &&
                 (
                     Link == input.Link ||
                     (Link != null && Link.Equals(input.Link))
                 ) &&
                 (
                     Scope == input.Scope ||
                     (Scope.Equals(input.Scope))
                 ) &&
                 (
                     Origin == input.Origin ||
                     (Origin != null && Origin.Equals(input.Origin))
                 ) &&
                 (
                     Status == input.Status ||
                     (Status != null && Status.Equals(input.Status))
                 ) &&
                 (
                     CreationDate == input.CreationDate ||
                     (CreationDate != null && CreationDate.Equals(input.CreationDate))
                 ) &&
                 (
                     StatusChanged == input.StatusChanged ||
                     (StatusChanged != null && StatusChanged.Equals(input.StatusChanged))
                 ) &&
                 (
                     FirstPublished == input.FirstPublished ||
                     (FirstPublished != null && FirstPublished.Equals(input.FirstPublished))
                 ) &&
                 (
                     Team == input.Team ||
                     (Team != null && Team.SequenceEqual(input.Team))
                 ) &&
                 (
                     OverrideAuthorizeViewName == input.OverrideAuthorizeViewName ||
                     (OverrideAuthorizeViewName != null && OverrideAuthorizeViewName.Equals(input.OverrideAuthorizeViewName))
                 ));
        }
Example #25
0
 public Loan(int numberOfInstallments, double interest, double amount, Guid personId)
 {
     CreationDate           = DateTime.UtcNow;
     NumberOfInstallments   = numberOfInstallments;
     Interest               = interest;
     EstimatedRepaymentDate = CreationDate.AddMonths(numberOfInstallments);
     Amount   = amount;
     PersonId = personId;
 }
Example #26
0
        public string GetSaveEntry()
        {
            List <string> dataToSave = new List <string>()
            {
                NAME_ID, Id.ToString(), Header, Content, CreationDate.ToString(Constants.DATE_FORMAT), RemindDate.ToString(Constants.DATE_FORMAT)
            };

            return(dataToSave.Aggregate((i, j) => i + FileLoader.SEPARATOR + j));
        }
Example #27
0
        public IEnumerable <ModelValidationResult> Validate()
        {
            var dateResult = CreationDate.ValidateDateTime(nameof(CreationDate));

            if (dateResult != null)
            {
                yield return(dateResult);
            }
        }
Example #28
0
        public override void Save(BinaryWriter writer)
        {
            writer.Write(Index);
            writer.Write(Name);
            writer.Write(Level);
            writer.Write((byte)Class);
            writer.Write((byte)Gender);
            writer.Write(Hair);

            writer.Write(CreationDate.ToBinary());

            writer.Write(Deleted);
            writer.Write(DeleteDate.ToBinary());

            writer.Write(HP);
            writer.Write(MP);
            writer.Write(Experience);

            writer.Write(Inventory.Length);
            for (int i = 0; i < Inventory.Length; i++)
            {
                writer.Write(Inventory[i] != null);
                if (Inventory[i] == null)
                {
                    continue;
                }

                Inventory[i].Save(writer);
            }

            writer.Write(Equipment.Length);
            for (int i = 0; i < Equipment.Length; i++)
            {
                writer.Write(Equipment[i] != null);
                if (Equipment[i] == null)
                {
                    continue;
                }

                Equipment[i].Save(writer);
            }

            writer.Write(Magics.Count);
            for (int i = 0; i < Magics.Count; i++)
            {
                Magics[i].Save(writer);
            }

            writer.Write(AutoPot);
            writer.Write(Grade);
            writer.Write(HPItemIndex);
            writer.Write(MPItemIndex);
            writer.Write(AutoHPPercent);
            writer.Write(AutoMPPercent);
            writer.Write(SealCount);
        }
Example #29
0
 void DrawCreationDate()
 {
     tk.FillColor   = textColor;
     tk.StrokeColor = textColor;
     tk.DrawSurface(calendarArea.Start, calendarArea.Width, calendarArea.Height,
                    calendarIcon, ScaleMode.AspectFit, true);
     tk.FontSize   = EXTRA_INFO_FONT_SIZE;
     tk.FontWeight = FontWeight.Light;
     tk.DrawText(dateArea.Start, dateArea.Width, dateArea.Height, CreationDate.ToString("dd/MM/yyyy"));
 }
Example #30
0
        public override bool InRangeOfTime(DateTime phraseTime)
        {
            var alarmMinDate = CreationDate.AddDays(-Int32.Parse(this.Time));

            DateTime timeWithoutSeconds      = new DateTime(phraseTime.Year, phraseTime.Month, phraseTime.Day);
            DateTime minDateWithoutSeconds   = new DateTime(alarmMinDate.Year, alarmMinDate.Month, alarmMinDate.Day);
            DateTime alarmDateWithoutSeconds = new DateTime(CreationDate.Year, CreationDate.Month, CreationDate.Day);

            return(timeWithoutSeconds >= minDateWithoutSeconds && minDateWithoutSeconds <= alarmDateWithoutSeconds);
        }