public override int GetHashCode()
 {
     unchecked {
         var hashCode = TrackId;
         hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Artist != null ? Artist.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AlbumArtist != null ? AlbumArtist.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Composer != null ? Composer.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Album != null ? Album.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Genre != null ? Genre.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Kind != null ? Kind.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Size.GetHashCode();
         hashCode = (hashCode * 397) ^ (PlayingTime != null ? PlayingTime.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ TrackNumber.GetHashCode();
         hashCode = (hashCode * 397) ^ Year.GetHashCode();
         hashCode = (hashCode * 397) ^ DateModified.GetHashCode();
         hashCode = (hashCode * 397) ^ DateAdded.GetHashCode();
         hashCode = (hashCode * 397) ^ BitRate.GetHashCode();
         hashCode = (hashCode * 397) ^ SampleRate.GetHashCode();
         hashCode = (hashCode * 397) ^ PlayCount.GetHashCode();
         hashCode = (hashCode * 397) ^ PlayDate.GetHashCode();
         hashCode = (hashCode * 397) ^ PartOfCompilation.GetHashCode();
         return(hashCode);
     }
 }
Exemple #2
0
 public bool Equals(FlowPostTransient other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(other.Id == Id &&
            Equals(other.Urn, Urn) &&
            other.UserId.Equals(UserId) &&
            other.DateAdded.RoundToMs().Equals(DateAdded.RoundToMs()) &&
            other.DateModified.RoundToMs().Equals(DateModified.RoundToMs()) &&
            other.TargetUserId.Equals(TargetUserId) &&
            other.ForwardedPostId.Equals(ForwardedPostId) &&
            other.OriginUserId.Equals(OriginUserId) &&
            Equals(other.OriginUserName, OriginUserName) &&
            other.SourceUserId.Equals(SourceUserId) &&
            Equals(other.SourceUserName, SourceUserName) &&
            Equals(other.SubjectUrn, SubjectUrn) &&
            Equals(other.ContentUrn, ContentUrn) &&
            TrackUrns.EquivalentTo(other.TrackUrns) &&
            Equals(other.Caption, Caption) &&
            other.CaptionUserId.Equals(CaptionUserId) &&
            Equals(other.CaptionSourceName, CaptionSourceName) &&
            Equals(other.ForwardedPostUrn, ForwardedPostUrn) &&
            Equals(other.PostType, PostType) &&
            other.OnBehalfOfUserId.Equals(OnBehalfOfUserId));
 }
Exemple #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         int result = Id.GetHashCode();
         result = (result * 397) ^ (Urn != null ? Urn.GetHashCode() : 0);
         result = (result * 397) ^ UserId.GetHashCode();
         result = (result * 397) ^ DateAdded.GetHashCode();
         result = (result * 397) ^ DateModified.GetHashCode();
         result = (result * 397) ^ (TargetUserId.HasValue ? TargetUserId.Value.GetHashCode() : 0);
         result = (result * 397) ^ (ForwardedPostId.HasValue ? ForwardedPostId.Value.GetHashCode() : 0);
         result = (result * 397) ^ OriginUserId.GetHashCode();
         result = (result * 397) ^ (OriginUserName != null ? OriginUserName.GetHashCode() : 0);
         result = (result * 397) ^ SourceUserId.GetHashCode();
         result = (result * 397) ^ (SourceUserName != null ? SourceUserName.GetHashCode() : 0);
         result = (result * 397) ^ (SubjectUrn != null ? SubjectUrn.GetHashCode() : 0);
         result = (result * 397) ^ (ContentUrn != null ? ContentUrn.GetHashCode() : 0);
         result = (result * 397) ^ (TrackUrns != null ? TrackUrns.GetHashCode() : 0);
         result = (result * 397) ^ (Caption != null ? Caption.GetHashCode() : 0);
         result = (result * 397) ^ CaptionUserId.GetHashCode();
         result = (result * 397) ^ (CaptionSourceName != null ? CaptionSourceName.GetHashCode() : 0);
         result = (result * 397) ^ (ForwardedPostUrn != null ? ForwardedPostUrn.GetHashCode() : 0);
         result = (result * 397) ^ PostType.GetHashCode();
         result = (result * 397) ^ (OnBehalfOfUserId.HasValue ? OnBehalfOfUserId.Value.GetHashCode() : 0);
         return(result);
     }
 }
Exemple #4
0
        /// <summary>
        /// get the string for the opml-export
        /// </summary>
        /// <param name="level"></param>
        /// <returns></returns>
        public string GetOPMLString(int level)
        {
            //used for tabs
            string prefix = "";

            if (level > 0)
            {
                for (int i = 0; i < level; i++)
                {
                    prefix += "\t";
                }
            }

            StringBuilder HeadString = new StringBuilder();

            HeadString.Append(prefix + "<head>" + Environment.NewLine);
            HeadString.Append(prefix + "\t<title>" + Title + "</title>" + Environment.NewLine);
            HeadString.Append(prefix + "\t<dateCreated>" + DateCreated.ToString("R") + "</dateCreated>" + Environment.NewLine);
            HeadString.Append(prefix + "\t<dateModified>" + DateModified.ToString("R") + "</dateModified>" + Environment.NewLine);
            HeadString.Append(prefix + "\t<ownerName>" + OwnerName + "</ownerName>" + Environment.NewLine);
            HeadString.Append(prefix + "\t<ownerEmail>" + OwnerEmail + "</ownerEmail>" + Environment.NewLine);
            HeadString.Append(prefix + "\t<docs>" + Docs + "</docs>" + Environment.NewLine);
            HeadString.Append(prefix + "</head>" + Environment.NewLine);

            return(HeadString.ToString());
        }
Exemple #5
0
        /// <summary>Creates well formatted XML - includes all properties of Syslog</summary>
        public string ToXml()
        {
            StringBuilder sbReturn = null;

            sbReturn = new StringBuilder();
            sbReturn.Append("<Syslog>\n");
            sbReturn.Append("<" + TAG_ID + ">" + SyslogID + "</" + TAG_ID + ">\n");
            sbReturn.Append("<" + TAG_INTERACTION_ID + ">" + InteractionID + "</" + TAG_INTERACTION_ID + ">\n");
            if (!dtNull.Equals(DateCreated))
            {
                sbReturn.Append("<" + TAG_DATE_CREATED + ">" + DateCreated.ToString() + "</" + TAG_DATE_CREATED + ">\n");
            }
            else
            {
                sbReturn.Append("<" + TAG_DATE_CREATED + "></" + TAG_DATE_CREATED + ">\n");
            }
            if (!dtNull.Equals(DateModified))
            {
                sbReturn.Append("<" + TAG_DATE_MODIFIED + ">" + DateModified.ToString() + "</" + TAG_DATE_MODIFIED + ">\n");
            }
            else
            {
                sbReturn.Append("<" + TAG_DATE_MODIFIED + "></" + TAG_DATE_MODIFIED + ">\n");
            }
            sbReturn.Append("<" + TAG_MSGSOURCE + ">" + Msgsource + "</" + TAG_MSGSOURCE + ">\n");
            sbReturn.Append("<" + TAG_MSGACTION + ">" + Msgaction + "</" + TAG_MSGACTION + ">\n");
            sbReturn.Append("<" + TAG_MSGTXT + ">" + Msgtxt + "</" + TAG_MSGTXT + ">\n");
            sbReturn.Append("</Syslog>" + "\n");

            return(sbReturn.ToString());
        }
        public int CompareTo(DetailsListSampleFileItem other, string columnSortingKey)
        {
            if (other == null)
            {
                throw new ArgumentException(nameof(other));
            }

            if (columnSortingKey.Equals(nameof(FileIcon)))
            {
                return(FileIcon.CompareTo(other.FileIcon));
            }

            if (columnSortingKey.Equals(nameof(FileName)))
            {
                return(string.Compare(FileName, other.FileName, StringComparison.Ordinal));
            }

            if (columnSortingKey.Equals(nameof(DateModified)))
            {
                return(DateModified.CompareTo(other.DateModified));
            }

            if (columnSortingKey.Equals(nameof(ModifiedBy)))
            {
                return(string.Compare(FileName, other.FileName, StringComparison.Ordinal));
            }

            if (columnSortingKey.Equals(nameof(FileSize)))
            {
                return(FileSize.CompareTo(other.FileSize));
            }

            throw new InvalidOperationException($"Can not match {columnSortingKey} to current list item");
        }
 protected bool Equals(Track other)
 {
     return(TrackId == other.TrackId && string.Equals(Name, other.Name) && string.Equals(Artist, other.Artist) &&
            string.Equals(AlbumArtist, other.AlbumArtist) && string.Equals(Composer, other.Composer) &&
            string.Equals(Album, other.Album) && string.Equals(Genre, other.Genre) &&
            string.Equals(Kind, other.Kind) && Size == other.Size && string.Equals(PlayingTime, other.PlayingTime) &&
            TrackNumber == other.TrackNumber && Year == other.Year && DateModified.Equals(other.DateModified) &&
            DateAdded.Equals(other.DateAdded) && BitRate == other.BitRate && SampleRate == other.SampleRate &&
            PlayCount == other.PlayCount && PlayDate.Equals(other.PlayDate) && PartOfCompilation == other.PartOfCompilation);
 }
        public IEnumerable <IComponent> Render(IList <IDetailsListColumn> columns, Func <IDetailsListColumn, Func <IComponent>, IComponent> createGridCellExpression)
        {
            yield return(createGridCellExpression(columns[0], () => Icon(FileIcon)));

            yield return(createGridCellExpression(columns[1], () => TextBlock(FileName)));

            yield return(createGridCellExpression(columns[2], () => TextBlock(DateModified.ToShortDateString())));

            yield return(createGridCellExpression(columns[3], () => TextBlock(ModifiedBy)));

            yield return(createGridCellExpression(columns[4], () => TextBlock(FileSize.ToString())));
        }
Exemple #9
0
 public bool Equals(ImageBase other)
 {
     if (other is null)
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(string.Equals(Path, other.Path) && Size == other.Size && DateModified.Equals(other.DateModified) &&
            Height == other.Height && Width == other.Width && DateTaken.Equals(other.DateTaken) &&
            Latitude.Equals(other.Latitude) && Longitude.Equals(other.Longitude));
 }
Exemple #10
0
        /// <summary>
        /// Converts the head to a string
        /// </summary>
        /// <returns>The head as a string</returns>
        public override string ToString()
        {
            StringBuilder HeadString = new StringBuilder();

            HeadString.Append("<head>");
            HeadString.Append("<title>" + Title + "</title>\r\n");
            HeadString.Append("<dateCreated>" + DateCreated.ToString("R") + "</dateCreated>\r\n");
            HeadString.Append("<dateModified>" + DateModified.ToString("R") + "</dateModified>\r\n");
            HeadString.Append("<ownerName>" + OwnerName + "</ownerName>\r\n");
            HeadString.Append("<ownerEmail>" + OwnerEmail + "</ownerEmail>\r\n");
            HeadString.Append("<docs>" + Docs + "</docs>\r\n");
            HeadString.Append("</head>\r\n");
            return(HeadString.ToString());
        }
Exemple #11
0
 public Order(int bread, int pastries, string notes)
 {
     Bread    = bread;
     Pastries = pastries;
     Notes    = notes;
     _instances.Add(this);
     Position = _instances.Count;
     RunningCount++;
     Id           = RunningCount;
     DateOrdered  = DateTime.Now;
     DateModified = DateOrdered;
     DateDue      = DateModified.AddDays(2);
     Title        = $"Order No. {Id}, {DateModified.ToString()}";
     Description  = $"Bread: {Bread}, Pastries: {Pastries}";
 }
Exemple #12
0
        public SurveyResponseSummary(SPListItem lsi, string pstrTemplateList)
        {
            ID       = lsi.UniqueId;
            Name     = lsi.Title;
            Template = ""; // FTKHandler.GetTemplate(pstrTemplateList, new Guid(lsi["TemplateID"].ToString())).Title;
            SPFieldUserValue userValue = new SPFieldUserValue(lsi.Web, lsi[SPBuiltInFieldId.Author].ToString());
            SPUser           user      = userValue.User;
            string           email     = user.Email;

            User         = user.Name;
            DateCreated  = (DateTime)lsi[SPBuiltInFieldId.Created];
            DateModified = (DateTime)lsi[SPBuiltInFieldId.Modified];

            DisplayDate = DateModified.ToString("dd/MM/yyyy");

            PopulateScoreDisplay(Int32.Parse(lsi["Score"].ToString()));
        }
Exemple #13
0
        public override int GetHashCode()
        {
            // ReSharper disable NonReadonlyMemberInGetHashCode
            unchecked
            {
                var hashCode = Path != null?Path.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ Size.GetHashCode();
                hashCode = (hashCode * 397) ^ DateModified.GetHashCode();
                hashCode = (hashCode * 397) ^ (int)Height;
                hashCode = (hashCode * 397) ^ (int)Width;
                hashCode = (hashCode * 397) ^ DateTaken.GetHashCode();
                hashCode = (hashCode * 397) ^ Latitude.GetHashCode();
                hashCode = (hashCode * 397) ^ Longitude.GetHashCode();
                return(hashCode);
            }
        }
Exemple #14
0
        public string GetProperty(string strPropertyName, string strFormat, CultureInfo formatProvider, UserInfo AccessingUser, Scope AccessLevel, ref bool PropertyNotFound)
        {
            PropertyNotFound = false;
            FAQsController faqController;

            switch (strPropertyName.ToLower())
            {
            case "question":
                return(PropertyAccess.FormatString(Question, strFormat));

            case "answer":
                return(PropertyAccess.FormatString(Answer, strFormat));

            case "user":
                UserInfo user = UserController.GetUserById(PortalSettings.Current.PortalId, Convert.ToInt32(CreatedByUser));
                return(PropertyAccess.FormatString(user.DisplayName, strFormat));

            case "viewcount":
                return(ViewCount.ToString(String.IsNullOrEmpty(strFormat) ? "g" : strFormat, formatProvider));

            case "vieworder":
                return(ViewOrder.ToString(String.IsNullOrEmpty(strFormat) ? "g" : strFormat, formatProvider));

            case "categoryname":
                faqController = new FAQsController();
                return(PropertyAccess.FormatString(faqController.GetCategory(CategoryId).FaqCategoryName, strFormat));

            case "categorydesc":
                faqController = new FAQsController();
                return(PropertyAccess.FormatString(faqController.GetCategory(CategoryId).FaqCategoryDescription, strFormat));

            case "datecreated":
                return(CreatedDate.ToString(String.IsNullOrEmpty(strFormat) ? "d" : strFormat, formatProvider));

            case "datemodified":
                return(DateModified.ToString(String.IsNullOrEmpty(strFormat) ? "d" : strFormat, formatProvider));

            case "index":
                return(Index.ToString(String.IsNullOrEmpty(strFormat) ? "g" : strFormat, formatProvider));

            default:
                PropertyNotFound = true;
                return(String.Empty);
            }
        }
Exemple #15
0
        /// <summary>Creates well formatted XML - includes all properties of User</summary>
        public string ToXml()
        {
            StringBuilder sbReturn = null;

            sbReturn = new StringBuilder();
            sbReturn.Append("<User>\n");
            sbReturn.Append("<" + TAG_ID + ">" + UserID + "</" + TAG_ID + ">\n");
            sbReturn.Append("<" + TAG_USER_ROLE_ID + ">" + UserRoleID + "</" + TAG_USER_ROLE_ID + ">\n");
            if (!dtNull.Equals(DateCreated))
            {
                sbReturn.Append("<" + TAG_DATE_CREATED + ">" + DateCreated.ToString() + "</" + TAG_DATE_CREATED + ">\n");
            }
            else
            {
                sbReturn.Append("<" + TAG_DATE_CREATED + "></" + TAG_DATE_CREATED + ">\n");
            }
            if (!dtNull.Equals(DateModified))
            {
                sbReturn.Append("<" + TAG_DATE_MODIFIED + ">" + DateModified.ToString() + "</" + TAG_DATE_MODIFIED + ">\n");
            }
            else
            {
                sbReturn.Append("<" + TAG_DATE_MODIFIED + "></" + TAG_DATE_MODIFIED + ">\n");
            }
            sbReturn.Append("<" + TAG_FIRSTNAME + ">" + Firstname + "</" + TAG_FIRSTNAME + ">\n");
            sbReturn.Append("<" + TAG_MIDDLENAME + ">" + Middlename + "</" + TAG_MIDDLENAME + ">\n");
            sbReturn.Append("<" + TAG_LASTNAME + ">" + Lastname + "</" + TAG_LASTNAME + ">\n");
            sbReturn.Append("<" + TAG_USERNAME + ">" + Username + "</" + TAG_USERNAME + ">\n");
            sbReturn.Append("<" + TAG_PASSWD + ">" + Passwd + "</" + TAG_PASSWD + ">\n");
            sbReturn.Append("<" + TAG_PICTURE_URL + ">" + PictureUrl + "</" + TAG_PICTURE_URL + ">\n");
            sbReturn.Append("<" + TAG_PICTURE + ">" + Picture + "</" + TAG_PICTURE + ">\n");
            sbReturn.Append("<" + TAG_IS_DISABLED + ">" + IsDisabled + "</" + TAG_IS_DISABLED + ">\n");
            if (!dtNull.Equals(LastLoginDate))
            {
                sbReturn.Append("<" + TAG_LAST_LOGIN_DATE + ">" + LastLoginDate.ToString() + "</" + TAG_LAST_LOGIN_DATE + ">\n");
            }
            else
            {
                sbReturn.Append("<" + TAG_LAST_LOGIN_DATE + "></" + TAG_LAST_LOGIN_DATE + ">\n");
            }
            sbReturn.Append("</User>" + "\n");

            return(sbReturn.ToString());
        }
Exemple #16
0
 public bool Equals(Track other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(TrackId == other.TrackId && string.Equals(Name, other.Name) &&
            string.Equals(Artist, other.Artist) && string.Equals(AlbumArtist, other.AlbumArtist) &&
            string.Equals(Composer, other.Composer) && string.Equals(Album, other.Album) &&
            string.Equals(Genre, other.Genre) && string.Equals(Kind, other.Kind) && Size == other.Size &&
            string.Equals(PlayingTime, other.PlayingTime) && TrackNumber == other.TrackNumber &&
            Year == other.Year && DateModified.Equals(other.DateModified) && DateAdded.Equals(other.DateAdded) &&
            BitRate == other.BitRate && SampleRate == other.SampleRate && PlayCount == other.PlayCount &&
            PlayDate.Equals(other.PlayDate) && PartOfCompilation == other.PartOfCompilation && Location == other.Location);
 }
Exemple #17
0
        public void Save(string fileName)
        {
            opmlDoc = new XmlDocument {
                XmlResolver = null
            };
            XmlElement opml = opmlDoc.CreateElement("opml");

            opml.SetAttribute("version", "2.0");
            opmlDoc.AppendChild(opml);

            // create head
            XmlElement head = opmlDoc.CreateElement("head");

            opml.AppendChild(head);

            // set Title
            XmlElement title = opmlDoc.CreateElement("title");

            title.InnerText = Title;
            head.AppendChild(title);

            // set date created
            XmlElement dateCreated = opmlDoc.CreateElement("dateCreated");

            dateCreated.InnerText = DateCreated != DateTime.MinValue ? DateCreated.ToString("r", null) : DateTime.Now.ToString("r", null);
            head.AppendChild(dateCreated);

            // set date modified
            XmlElement dateModified = opmlDoc.CreateElement("dateModified");

            dateCreated.InnerText = DateModified != DateTime.MinValue ? DateModified.ToString("r", null) : DateTime.Now.ToString("r", null);
            head.AppendChild(dateModified);

            // set owner email
            XmlElement ownerEmail = opmlDoc.CreateElement("ownerEmail");

            ownerEmail.InnerText = OwnerEmail;
            head.AppendChild(ownerEmail);

            // set owner name
            XmlElement ownerName = opmlDoc.CreateElement("ownerName");

            ownerName.InnerText = OwnerName;
            head.AppendChild(ownerName);

            // set owner id
            XmlElement ownerId = opmlDoc.CreateElement("ownerId");

            ownerId.InnerText = OwnerId;
            head.AppendChild(ownerId);

            // set docs
            XmlElement docs = opmlDoc.CreateElement("docs");

            docs.InnerText = Docs;
            head.AppendChild(docs);

            // set expansionState
            XmlElement expansionState = opmlDoc.CreateElement("expansionState");

            expansionState.InnerText = ExpansionState;
            head.AppendChild(expansionState);

            // set vertScrollState
            XmlElement vertScrollState = opmlDoc.CreateElement("vertScrollState");

            vertScrollState.InnerText = VertScrollState;
            head.AppendChild(vertScrollState);

            // set windowTop
            XmlElement windowTop = opmlDoc.CreateElement("windowTop");

            windowTop.InnerText = WindowTop;
            head.AppendChild(windowTop);

            // set windowLeft
            XmlElement windowLeft = opmlDoc.CreateElement("windowLeft");

            windowLeft.InnerText = WindowLeft;
            head.AppendChild(windowLeft);

            // set windowBottom
            XmlElement windowBottom = opmlDoc.CreateElement("windowBottom");

            windowBottom.InnerText = WindowBottom;
            head.AppendChild(windowBottom);

            // set windowRight
            XmlElement windowRight = opmlDoc.CreateElement("windowRight");

            windowRight.InnerText = WindowRight;
            head.AppendChild(windowRight);

            // create body
            XmlElement opmlBody = opmlDoc.CreateElement("body");

            opml.AppendChild(opmlBody);

            foreach (OpmlOutline outline in _outlines)
            {
                opmlBody.AppendChild(outline.ToXml);
            }

            opmlDoc.Save(fileName);
        }
Exemple #18
0
        public bool Equals(FireteamSummary input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     FireteamId == input.FireteamId ||
                     (FireteamId.Equals(input.FireteamId))
                     ) &&
                 (
                     GroupId == input.GroupId ||
                     (GroupId.Equals(input.GroupId))
                 ) &&
                 (
                     Platform == input.Platform ||
                     (Platform != null && Platform.Equals(input.Platform))
                 ) &&
                 (
                     ActivityType == input.ActivityType ||
                     (ActivityType.Equals(input.ActivityType))
                 ) &&
                 (
                     IsImmediate == input.IsImmediate ||
                     (IsImmediate != null && IsImmediate.Equals(input.IsImmediate))
                 ) &&
                 (
                     ScheduledTime == input.ScheduledTime ||
                     (ScheduledTime != null && ScheduledTime.Equals(input.ScheduledTime))
                 ) &&
                 (
                     OwnerMembershipId == input.OwnerMembershipId ||
                     (OwnerMembershipId.Equals(input.OwnerMembershipId))
                 ) &&
                 (
                     PlayerSlotCount == input.PlayerSlotCount ||
                     (PlayerSlotCount.Equals(input.PlayerSlotCount))
                 ) &&
                 (
                     AlternateSlotCount == input.AlternateSlotCount ||
                     (AlternateSlotCount.Equals(input.AlternateSlotCount))
                 ) &&
                 (
                     AvailablePlayerSlotCount == input.AvailablePlayerSlotCount ||
                     (AvailablePlayerSlotCount.Equals(input.AvailablePlayerSlotCount))
                 ) &&
                 (
                     AvailableAlternateSlotCount == input.AvailableAlternateSlotCount ||
                     (AvailableAlternateSlotCount.Equals(input.AvailableAlternateSlotCount))
                 ) &&
                 (
                     Title == input.Title ||
                     (Title != null && Title.Equals(input.Title))
                 ) &&
                 (
                     DateCreated == input.DateCreated ||
                     (DateCreated != null && DateCreated.Equals(input.DateCreated))
                 ) &&
                 (
                     DateModified == input.DateModified ||
                     (DateModified != null && DateModified.Equals(input.DateModified))
                 ) &&
                 (
                     IsPublic == input.IsPublic ||
                     (IsPublic != null && IsPublic.Equals(input.IsPublic))
                 ) &&
                 (
                     Locale == input.Locale ||
                     (Locale != null && Locale.Equals(input.Locale))
                 ) &&
                 (
                     IsValid == input.IsValid ||
                     (IsValid != null && IsValid.Equals(input.IsValid))
                 ) &&
                 (
                     DatePlayerModified == input.DatePlayerModified ||
                     (DatePlayerModified != null && DatePlayerModified.Equals(input.DatePlayerModified))
                 ) &&
                 (
                     TitleBeforeModeration == input.TitleBeforeModeration ||
                     (TitleBeforeModeration != null && TitleBeforeModeration.Equals(input.TitleBeforeModeration))
                 ));
        }
Exemple #19
0
        public void RenderSeo()
        {
            DateModified = DateTime.MinValue != DateModified ? DateModified : DatePublished;

            AddMeta(new LiteralControl(StringMetaTag));
            AddMeta(new LiteralControl(GoogleAnaltics));
            HtmlLink hlinkCanonical = new HtmlLink();

            hlinkCanonical.Attributes.Add("rel", "canonical");
            hlinkCanonical.Href = Canonical;
            AddMeta(hlinkCanonical);
            AddMeta(new LiteralControl("<link rel=\"shortcut icon\" href=\"" + Favicon + "\" type=\"image/x-icon\" />"));
            if (!string.IsNullOrWhiteSpace(ThumbnailUrl))
            {
                AddMeta(
                    new LiteralControl("<link rel=\"thumbnail\" type=\"image/jpeg\" href=\"" + ThumbnailUrl + "\" />"));
            }
            if (!string.IsNullOrWhiteSpace(Image))
            {
                AddMeta(new LiteralControl("<link rel=\"image_src\" type=\"image/jpeg\" href=\"" + Image + "\" />"));
            }
            if (!string.IsNullOrWhiteSpace(AlternateLink))
            {
                AddMeta(
                    new LiteralControl("<link rel=\"alternate\" media='only screen and (max-width: 640px) ' href=\"" +
                                       AlternateLink + "\" />"));
            }

            AddProperty("twitter:image", Image);
            AddProperty("twitter:description", Helper.ClearString(Description));
            AddProperty("twitter:title", Helper.ClearString(Title));
            AddProperty("twitter:url", Canonical);
            AddMeta("twitter:site", TwitterSite);
            AddMeta("twitter:card", "summary");



            AddProperty("og:video", VideoURL);
            AddProperty("og:video:height", VideoHeight);
            AddProperty("og:video:width", VideoWidth);
            AddProperty("og:video:type", VideoType);
            AddProperty("fb:app_id", FBAppID);
            AddProperty("og:article:section", Section);
            if (DatePublished != DateTime.MinValue)
            {
                AddProperty("og:article:published_time", DatePublished.Ext_ToISO8601DateTimeString());
            }
            AddProperty("og:article:author", Publisher);
            AddProperty("og:image", Image);
            AddProperty("og:locale", "tr");
            AddProperty("og:url", Canonical);
            AddProperty("og:site_name", CRE);
            AddProperty("og:type", PT);
            AddProperty("og:description", Helper.ClearString(Description));
            AddProperty("og:title",
                        string.IsNullOrWhiteSpace(OGTitle) ? Helper.ClearString(Title) : Helper.ClearString(OGTitle));
            AddProperty("article:modified", DateModified.Ext_ToISO8601DateTimeString());
            AddProperty("article:tag", ArticleTag);

            AddMeta(new LiteralControl("\n\t"));

            AddItemProp("articleSection", Section);
            if (DatePublished != DateTime.MinValue)
            {
                AddItemProp("datePublished", DatePublished.Ext_ToISO8601DateTimeString());
            }
            if (DateModified != DateTime.MinValue)
            {
                AddItemProp("dateModified", DateModified.Ext_ToISO8601DateTimeString());
            }
            AddItemProp("copyrightYear", CopyrightYear);
            AddItemProp("inLanguage", ContentLanguage);
            AddItemProp("author", Publisher);
            AddItemProp("sourceOrganization", Publisher);
            AddItemProp("creator", Publisher);
            AddItemProp("copyrightHolder", Publisher);
            AddItemProp("discussionUrl", DiscussionURL);
            AddItemProp("provider", Publisher);
            AddItemProp("publisher", Publisher);
            AddItemProp("genre", Genre);
            AddItemProp("url", Canonical);
            AddItemProp("thumbnailUrl", ThumbnailUrl);
            AddItemProp("image", Image);
            AddItemProp("description", Helper.ClearString(Description));
            AddItemProp("name", Helper.ClearString(Title));
            AddItemProp("keywords", string.IsNullOrWhiteSpace(NewsKeywords) ? Keywords : NewsKeywords);
            AddItemProp("alternativeHeadline", Helper.ClearString(Title));
            AddMeta(new LiteralControl("\n\t"));

            if (DateModified != DateTime.MinValue)
            {
                AddhHttpEquiv("last-modified", DateModified.Ext_ToISO8601DateTimeString());
            }
            AddhHttpEquiv("charset", Charset);
            AddhHttpEquiv("pragma", Pragma);
            AddhHttpEquiv("expires", Expires);
            AddhHttpEquiv("cache-control", CacheControl);
            AddhHttpEquiv("content-type", ContentType);
            AddhHttpEquiv("content-language", ContentLanguage);
            AddhHttpEquiv("refresh", Refresh);

            AddMeta("msapplication-starturl", StartURL);
            AddMeta("thumbnail_height", ThumbnailHeight);
            AddMeta("thumbnail_width", ThumbnailWeight);
            AddMeta("google-site-verification", GoogleSiteVerification);
            AddMeta("Rating", Rating);
            AddMeta("lp", Helper.ClearString(Description));
            if (DatePublished != DateTime.MinValue)
            {
                AddMeta("dat", DatePublished.ToString("dd MMMM yyyy dddd", CultureInfo.CurrentCulture));
            }
            if (DatePublished != DateTime.MinValue)
            {
                AddMeta("DISPLAYDATE", DatePublished.ToString("dd MMMM yyyy dddd", CultureInfo.CurrentCulture));
            }
            if (DatePublished != DateTime.MinValue)
            {
                AddMeta("ptime", DatePublished.ToString("yyyyMMddhhmmss"));
            }
            if (DateModified != DateTime.MinValue)
            {
                AddMeta("utime", DateModified.ToString("yyyyMMddhhmmss"));
            }
            if (DatePublished != DateTime.MinValue)
            {
                AddMeta("pdate", DatePublished.ToString("yyyyMMdd"));
            }
            if (DatePublished != DateTime.MinValue)
            {
                AddMeta("DC.date.issued", DatePublished.Ext_ToISO8601DateTimeString());
            }
            AddMeta("cre", CRE);
            AddMeta("PT", PT);
            AddMeta("PST", PST);
            AddMeta("hdl", Helper.ClearString(Title));
            AddMeta("robots", Robots);
            AddMeta("medium", Medium);
            AddMeta(new LiteralControl("<meta charset=\"UTF-8\"/>"));
            AddMeta("apple-mobile-web-app-capable", AppleMobileWebAppCapable);
            AddMeta("viewport", Viewport);
            AddMeta("news_keywords", NewsKeywords);
            AddMeta("keywords", Keywords);
            AddMeta("description", Helper.ClearString(Description));
            AddMeta(new LiteralControl("<title>" + Helper.ClearString(Title) + "</title>"));
        }
Exemple #20
0
    public void PopulateForm()
    {
        // Salutation
        ddlSalutation.Items.Clear();
        ddlSalutation.Items.Add(new ListItem("Select", ""));
        ddlSalutation.Items.Add("Dr.");
        ddlSalutation.Items.Add("Mr.");
        ddlSalutation.Items.Add("Ms.");
        ddlSalutation.Items.Add("Mrs.");

        // Country - to add APAC countries before the rest
        ddlCountry.Items.Clear();
        ddlCountry.Items.Add(new ListItem("Select", ""));
        ddlCountry.Items.Add(new ListItem("Australia", "Australia"));
        ddlCountry.Items.Add(new ListItem("Bangladesh", "Bangladesh"));
        ddlCountry.Items.Add(new ListItem("Bhutan", "Bhutan"));
        ddlCountry.Items.Add(new ListItem("Cambodia", "Cambodia"));
        ddlCountry.Items.Add(new ListItem("China", "China"));
        ddlCountry.Items.Add(new ListItem("Cook Islands", "Cook Islands"));
        ddlCountry.Items.Add(new ListItem("Fiji", "Fiji"));
        ddlCountry.Items.Add(new ListItem("French Polynesia", "French Polynesia"));
        ddlCountry.Items.Add(new ListItem("Hong Kong", "Hong Kong"));
        ddlCountry.Items.Add(new ListItem("India", "India"));
        ddlCountry.Items.Add(new ListItem("Indonesia", "Indonesia"));
        ddlCountry.Items.Add(new ListItem("Japan", "Japan"));
        ddlCountry.Items.Add(new ListItem("Kazakhstan", "Kazakhstan"));
        ddlCountry.Items.Add(new ListItem("Kiribati", "Kiribati"));
        ddlCountry.Items.Add(new ListItem("Korea", "Korea"));
        ddlCountry.Items.Add(new ListItem("Laos", "Laos"));
        ddlCountry.Items.Add(new ListItem("Malaysia", "Malaysia"));
        ddlCountry.Items.Add(new ListItem("Maldives", "Maldives"));
        ddlCountry.Items.Add(new ListItem("Marshall Islands", "Marshall Islands"));
        ddlCountry.Items.Add(new ListItem("Micronesia", "Micronesia"));
        ddlCountry.Items.Add(new ListItem("Mongolia", "Mongolia"));
        ddlCountry.Items.Add(new ListItem("Myanmar", "Myanmar"));
        ddlCountry.Items.Add(new ListItem("Nauru", "Nauru"));
        ddlCountry.Items.Add(new ListItem("Nepal", "Nepal"));
        ddlCountry.Items.Add(new ListItem("New Caledonia", "New Caledonia"));
        ddlCountry.Items.Add(new ListItem("New Zealand", "New Zealand"));
        ddlCountry.Items.Add(new ListItem("Niue", "Niue"));
        ddlCountry.Items.Add(new ListItem("Pakistan", "Pakistan"));
        ddlCountry.Items.Add(new ListItem("Palau", "Palau"));
        ddlCountry.Items.Add(new ListItem("Philippines", "Philippines"));
        ddlCountry.Items.Add(new ListItem("Samoa", "Samoa"));
        ddlCountry.Items.Add(new ListItem("Singapore", "Singapore"));
        ddlCountry.Items.Add(new ListItem("Solomon Islands", "Solomon Islands"));
        ddlCountry.Items.Add(new ListItem("Sri Lanka", "Sri Lanka"));
        ddlCountry.Items.Add(new ListItem("Taiwan", "Taiwan"));
        ddlCountry.Items.Add(new ListItem("Thailand", "Thailand"));
        ddlCountry.Items.Add(new ListItem("Timor-Leste", "Timor-Leste"));
        ddlCountry.Items.Add(new ListItem("Tonga", "Tonga"));
        ddlCountry.Items.Add(new ListItem("Tuvalu", "Tuvalu"));
        ddlCountry.Items.Add(new ListItem("Uzbekistan", "Uzbekistan"));
        ddlCountry.Items.Add(new ListItem("Vanautu", "Vanautu"));
        ddlCountry.Items.Add(new ListItem("Vietnam", "Vietnam"));



        ddlCountry.Items.Add(new ListItem("-------Rest of the Standard Countries---------", ""));
        GeneralFunction.LoadDropDownListCountry(ddlCountry);


        // Client Company Network
        ddlClientCompanyNetwork.Items.Clear();
        ddlClientCompanyNetwork.Items.Add(new ListItem("Select", ""));
        ddlClientCompanyNetwork.Items.Add("360buy");
        ddlClientCompanyNetwork.Items.Add("361°");
        ddlClientCompanyNetwork.Items.Add("7-Eleven, Inc.");
        ddlClientCompanyNetwork.Items.Add("A.F. Watsons Group");
        ddlClientCompanyNetwork.Items.Add("AB InBev");
        ddlClientCompanyNetwork.Items.Add("Adidas");
        ddlClientCompanyNetwork.Items.Add("Aditya Birla Group");
        ddlClientCompanyNetwork.Items.Add("Alibaba");
        ddlClientCompanyNetwork.Items.Add("Alipay");
        ddlClientCompanyNetwork.Items.Add("Amnesty International");
        ddlClientCompanyNetwork.Items.Add("Amway");
        ddlClientCompanyNetwork.Items.Add("Apaiporn Srisook");
        ddlClientCompanyNetwork.Items.Add("Audi");
        ddlClientCompanyNetwork.Items.Add("AVON");
        ddlClientCompanyNetwork.Items.Add("AXA");
        ddlClientCompanyNetwork.Items.Add("Baidu");
        ddlClientCompanyNetwork.Items.Add("Bank of New Zealand");
        ddlClientCompanyNetwork.Items.Add("Bayer");
        ddlClientCompanyNetwork.Items.Add("Bear Electric");
        ddlClientCompanyNetwork.Items.Add("BenQ");
        ddlClientCompanyNetwork.Items.Add("BMW");
        ddlClientCompanyNetwork.Items.Add("Boundary Road Brewery");
        ddlClientCompanyNetwork.Items.Add("BP");
        ddlClientCompanyNetwork.Items.Add("Brother");
        ddlClientCompanyNetwork.Items.Add("Cadbury");
        ddlClientCompanyNetwork.Items.Add("Campbell Moore");
        ddlClientCompanyNetwork.Items.Add("Canon");
        ddlClientCompanyNetwork.Items.Add("Carlsberg");
        ddlClientCompanyNetwork.Items.Add("Centre for Enabled Living");
        ddlClientCompanyNetwork.Items.Add("Cerebos");
        ddlClientCompanyNetwork.Items.Add("China Telecom");
        ddlClientCompanyNetwork.Items.Add("CHIVAS");
        ddlClientCompanyNetwork.Items.Add("Christchurch & Canterbury Tourism");
        ddlClientCompanyNetwork.Items.Add("Chrysler");
        ddlClientCompanyNetwork.Items.Add("Citibank");
        ddlClientCompanyNetwork.Items.Add("Clarks");
        ddlClientCompanyNetwork.Items.Add("Coach");
        ddlClientCompanyNetwork.Items.Add("Coca-Cola");
        ddlClientCompanyNetwork.Items.Add("Columbia Sportswear");
        ddlClientCompanyNetwork.Items.Add("CSL Limited");
        ddlClientCompanyNetwork.Items.Add("Daimler AG");
        ddlClientCompanyNetwork.Items.Add("Danone");
        ddlClientCompanyNetwork.Items.Add("Danzi");
        ddlClientCompanyNetwork.Items.Add("DBS");
        ddlClientCompanyNetwork.Items.Add("Dell");
        ddlClientCompanyNetwork.Items.Add("Diageo");
        ddlClientCompanyNetwork.Items.Add("Dior");
        ddlClientCompanyNetwork.Items.Add("Disney");
        ddlClientCompanyNetwork.Items.Add("Dongsuh Food");
        ddlClientCompanyNetwork.Items.Add("eLong");
        ddlClientCompanyNetwork.Items.Add("Estee Lauder Companies");
        ddlClientCompanyNetwork.Items.Add("FAW Hainan Motor");
        ddlClientCompanyNetwork.Items.Add("Ferrero");
        ddlClientCompanyNetwork.Items.Add("Fiat");
        ddlClientCompanyNetwork.Items.Add("Fiat Chrysler");
        ddlClientCompanyNetwork.Items.Add("Fonterra Co-operative Group");
        ddlClientCompanyNetwork.Items.Add("Ford Motor Company");
        ddlClientCompanyNetwork.Items.Add("Foton");
        ddlClientCompanyNetwork.Items.Add("Garnier");
        ddlClientCompanyNetwork.Items.Add("Gatorade");
        ddlClientCompanyNetwork.Items.Add("General Electric Company");
        ddlClientCompanyNetwork.Items.Add("General Motors");
        ddlClientCompanyNetwork.Items.Add("GlaxoSmithKline");
        ddlClientCompanyNetwork.Items.Add("Google");
        ddlClientCompanyNetwork.Items.Add("Greenpeace");
        ddlClientCompanyNetwork.Items.Add("Haier");
        ddlClientCompanyNetwork.Items.Add("Health Promotion Agency");
        ddlClientCompanyNetwork.Items.Add("Health Promotion Board");
        ddlClientCompanyNetwork.Items.Add("Heart & Sole");
        ddlClientCompanyNetwork.Items.Add("Heineken");
        ddlClientCompanyNetwork.Items.Add("Hell Pizza");
        ddlClientCompanyNetwork.Items.Add("Hewlett-Packard Company");
        ddlClientCompanyNetwork.Items.Add("Hungry Jack's");
        ddlClientCompanyNetwork.Items.Add("Hyundai Group");
        ddlClientCompanyNetwork.Items.Add("Hyundai Motor Company");
        ddlClientCompanyNetwork.Items.Add("IBM");
        ddlClientCompanyNetwork.Items.Add("ICICI Bank");
        ddlClientCompanyNetwork.Items.Add("IKEA");
        ddlClientCompanyNetwork.Items.Add("Insurance Australia Group");
        ddlClientCompanyNetwork.Items.Add("Intel");
        ddlClientCompanyNetwork.Items.Add("Johnson & Johnson");
        ddlClientCompanyNetwork.Items.Add("Kewal Kiran Clothing Limited");
        ddlClientCompanyNetwork.Items.Add("Kia Motors");
        ddlClientCompanyNetwork.Items.Add("Kimberly-Clark");
        ddlClientCompanyNetwork.Items.Add("Kirin Company, Limited");
        ddlClientCompanyNetwork.Items.Add("Kmart");
        ddlClientCompanyNetwork.Items.Add("Kraft");
        ddlClientCompanyNetwork.Items.Add("Land Rover");
        ddlClientCompanyNetwork.Items.Add("Leaf");
        ddlClientCompanyNetwork.Items.Add("Lego Group");
        ddlClientCompanyNetwork.Items.Add("Lenovo");
        ddlClientCompanyNetwork.Items.Add("Levi Strauss & Co.");
        ddlClientCompanyNetwork.Items.Add("LG Electronics");
        ddlClientCompanyNetwork.Items.Add("Lipton");
        ddlClientCompanyNetwork.Items.Add("L'Oréal");
        ddlClientCompanyNetwork.Items.Add("Luxottica");
        ddlClientCompanyNetwork.Items.Add("LVMH");
        ddlClientCompanyNetwork.Items.Add("Mars");
        ddlClientCompanyNetwork.Items.Add("McDonald's");
        ddlClientCompanyNetwork.Items.Add("MENGNIU");
        ddlClientCompanyNetwork.Items.Add("Mercedes-Benz");
        ddlClientCompanyNetwork.Items.Add("Metersbonwe Group");
        ddlClientCompanyNetwork.Items.Add("Microsoft");
        ddlClientCompanyNetwork.Items.Add("Mitre 10 (NZ) Limited");
        ddlClientCompanyNetwork.Items.Add("Mizuno");
        ddlClientCompanyNetwork.Items.Add("Mondelez International");
        ddlClientCompanyNetwork.Items.Add("Motorola");
        ddlClientCompanyNetwork.Items.Add("MTM");
        ddlClientCompanyNetwork.Items.Add("Nestlé");
        ddlClientCompanyNetwork.Items.Add("NetEase");
        ddlClientCompanyNetwork.Items.Add("Neutrogena");
        ddlClientCompanyNetwork.Items.Add("New Balance");
        ddlClientCompanyNetwork.Items.Add("Nike");
        ddlClientCompanyNetwork.Items.Add("Nikon Corporation");
        ddlClientCompanyNetwork.Items.Add("Nissan");
        ddlClientCompanyNetwork.Items.Add("Nissin");
        ddlClientCompanyNetwork.Items.Add("Nivea");
        ddlClientCompanyNetwork.Items.Add("Nokia");
        ddlClientCompanyNetwork.Items.Add("NSW Rural Fire Service");
        ddlClientCompanyNetwork.Items.Add("ORBIS");
        ddlClientCompanyNetwork.Items.Add("Parmalat");
        ddlClientCompanyNetwork.Items.Add("PepsiCo");
        ddlClientCompanyNetwork.Items.Add("Pernod Ricard");
        ddlClientCompanyNetwork.Items.Add("Peugeot");
        ddlClientCompanyNetwork.Items.Add("Philippine Department of Tourism");
        ddlClientCompanyNetwork.Items.Add("Philips");
        ddlClientCompanyNetwork.Items.Add("Pizza Hut");
        ddlClientCompanyNetwork.Items.Add("Procter & Gamble");
        ddlClientCompanyNetwork.Items.Add("Protoleaf");
        ddlClientCompanyNetwork.Items.Add("Puma");
        ddlClientCompanyNetwork.Items.Add("Reckitt Benckiser");
        ddlClientCompanyNetwork.Items.Add("Red Bull");
        ddlClientCompanyNetwork.Items.Add("Samsung");
        ddlClientCompanyNetwork.Items.Add("sanofi-aventis");
        ddlClientCompanyNetwork.Items.Add("SAP");
        ddlClientCompanyNetwork.Items.Add("Save Our Sons");
        ddlClientCompanyNetwork.Items.Add("Shabondama Soap Co., Ltd.");
        ddlClientCompanyNetwork.Items.Add("Shanghai General Motors");
        ddlClientCompanyNetwork.Items.Add("Shiseido");
        ddlClientCompanyNetwork.Items.Add("Siemens");
        ddlClientCompanyNetwork.Items.Add("Singapore University of Technology and Design");
        ddlClientCompanyNetwork.Items.Add("Sony");
        ddlClientCompanyNetwork.Items.Add("Subaru");
        ddlClientCompanyNetwork.Items.Add("Subway");
        ddlClientCompanyNetwork.Items.Add("Suntory Group");
        ddlClientCompanyNetwork.Items.Add("Taiwan Beer");
        ddlClientCompanyNetwork.Items.Add("Taiwan High Speed Rail");
        ddlClientCompanyNetwork.Items.Add("TESCO");
        ddlClientCompanyNetwork.Items.Add("Thai Health Promotion Foundation");
        ddlClientCompanyNetwork.Items.Add("The Campbell Soup Company");
        ddlClientCompanyNetwork.Items.Add("Toyota");
        ddlClientCompanyNetwork.Items.Add("Unilever");
        ddlClientCompanyNetwork.Items.Add("UNITED ARROWS LTD.");
        ddlClientCompanyNetwork.Items.Add("UPS");
        ddlClientCompanyNetwork.Items.Add("V8 Supercars");
        ddlClientCompanyNetwork.Items.Add("Virgin Mobile Group");
        ddlClientCompanyNetwork.Items.Add("Volkswagen AG");
        ddlClientCompanyNetwork.Items.Add("Wrigley Confectionery (China) Limited");
        ddlClientCompanyNetwork.Items.Add("Wyeth Consumer Healthcare");
        ddlClientCompanyNetwork.Items.Add("Xian Janssen Pharmaceutical");
        ddlClientCompanyNetwork.Items.Add("Yadea");
        ddlClientCompanyNetwork.Items.Add("Yili");
        ddlClientCompanyNetwork.Items.Add("Yuen Foong Yu Group");
        ddlClientCompanyNetwork.Items.Add("Yum! Brands");
        ddlClientCompanyNetwork.Items.Add("Zespri");
        ddlClientCompanyNetwork.Items.Add(new ListItem("Others, pls specify", "Others"));

        // Network
        GeneralFunction.LoadddlNetwork(ddlNetwork, true, true);

        // Holding COmpany
        GeneralFunction.LoadddlHoldingCompany(ddlHoldingCompany, true, true);

        // pop type
        // check if there is already 2 Leads, then dont pop the lead anymomre
        ddlContactType.Items.Clear();
        ddlContactType.Items.Add(new ListItem("Select", ""));
        if (GeneralFunction.NumberOfClientInListCache() < 2 || ContactType == "Client")
        {
            ddlContactType.Items.Add(new ListItem("Client", "Client"));
        }
        if (GeneralFunction.NumberOfLeadInListCache() < 2 || ContactType == "Lead Agency")
        {
            ddlContactType.Items.Add(new ListItem("Lead Agency", "Lead Agency"));
        }
        if (GeneralFunction.NumberOfContributingCompanyInListCache() < 4 || ContactType == "Contributing Agency")
        {
            ddlContactType.Items.Add(new ListItem("Contributing Agency", "Contributing Agency"));
        }



        lbType.Text                 = ContactType;
        txtCompany.Text             = Company;
        txtAddress1.Text            = Address1;
        txtAddress2.Text            = Address2;
        txtCity.Text                = City;
        txtPostal.Text              = Postal;
        ddlCountry.SelectedValue    = Country;
        ddlSalutation.SelectedValue = Salutation;
        txtFullname.Text            = Fullname;
        txtJob.Text                 = Job;
        txtContactCountry.Text      = GeneralFunction.GetCountryCodeFromContactNumber(Contact);
        txtContactArea.Text         = GeneralFunction.GetAreaCodeFromContactNumber(Contact);
        txtContactNumber.Text       = GeneralFunction.GetNumberFromContactNumber(Contact);
        txtEmail.Text               = Email;

        ddlCompanyType.SelectedValue          = CompanyType;
        txtCompanyTypeOther.Text              = CompanyTypeOther;
        ddlClientCompanyNetwork.SelectedValue = ClientCompanyNetwork;
        txtClientCompanyNetworkOthers.Text    = ClientCompanyNetworkOthers;
        txtNetworkOther.Text = NetworkOther;

        try { ddlNetwork.SelectedValue = Network; }
        catch { ddlNetwork.SelectedValue = ""; }

        try { ddlHoldingCompany.SelectedValue = HoldingCompany; }
        catch { ddlHoldingCompany.SelectedValue = ""; }

        txtHoldingCompanyOther.Text = HoldingCompanyOther;

        hldRecordId.Value     = RecordId.ToString();
        hldIsNew.Value        = IsNew.ToString();
        hldEntryId.Value      = EntryId.ToString();
        hldNo.Value           = No.ToString();
        hldDateCreated.Value  = DateCreated.ToString();
        hldDateModified.Value = DateModified.ToString();

        // hide the others textboxes by defasult
        phClientCompanyNetworkOther.Visible = false;
        phNetworkOther.Visible        = false;
        phHoldingCompanyOther.Visible = false;
        if (txtClientCompanyNetworkOthers.Text.Trim() != "")
        {
            phClientCompanyNetworkOther.Visible = true;
        }
        if (txtNetworkOther.Text.Trim() != "")
        {
            phNetworkOther.Visible = true;
        }
        if (txtHoldingCompanyOther.Text.Trim() != "")
        {
            phHoldingCompanyOther.Visible = true;
        }

        // show up the ddl or label for type
        ddlContactType.Visible = false;
        lbType.Visible         = false;

        //if (ContactType == "")
        //    ddlContactType.Visible = true;
        //else
        //    lbType.Visible = true;

        // only editable for type for 3rd CC onwards
        ShowCompanyType(No, ContactType);


        // scrolls up to the cc table after postback
        btnSubmit.OnClientClick = "location.hash = 'CCTABLE'; return true;";
        btnCancel.OnClientClick = "location.hash = 'CCTABLE'; return true;";
    }
 public override string ToString()
 {
     return("\t" + ProductName + "\t \v \t" + ProductType + "\t \v \t" + Brand + "\t \v \t" + NewOrUsed + "\t \v \t" +
            Quantity + "\t \v \t" + Price + "\t \v \t" + DateModified.ToShortDateString());
 }
Exemple #22
0
        /// <summary>
        /// Returns the sub item item text corresponding to the specified column type.
        /// </summary>
        /// <param name="type">The type of information to return.</param>
        /// <returns>Formatted text for the given column type.</returns>
        public string GetSubItemText(ColumnType type)
        {
            switch (type)
            {
            case ColumnType.DateAccessed:
                if (DateAccessed == DateTime.MinValue)
                {
                    return("");
                }
                else
                {
                    return(DateAccessed.ToString("g"));
                }

            case ColumnType.DateCreated:
                if (DateCreated == DateTime.MinValue)
                {
                    return("");
                }
                else
                {
                    return(DateCreated.ToString("g"));
                }

            case ColumnType.DateModified:
                if (DateModified == DateTime.MinValue)
                {
                    return("");
                }
                else
                {
                    return(DateModified.ToString("g"));
                }

            case ColumnType.FileName:
                return(FileName);

            case ColumnType.Name:
                return(Text);

            case ColumnType.FilePath:
                return(FilePath);

            case ColumnType.FileSize:
                if (FileSize == 0)
                {
                    return("");
                }
                else
                {
                    return(Utility.FormatSize(FileSize));
                }

            case ColumnType.FileType:
                return(FileType);

            case ColumnType.Dimensions:
                if (Dimensions == Size.Empty)
                {
                    return("");
                }
                else
                {
                    return(string.Format("{0} x {1}", Dimensions.Width, Dimensions.Height));
                }

            case ColumnType.Resolution:
                if (Resolution == SizeF.Empty)
                {
                    return("");
                }
                else
                {
                    return(string.Format("{0} x {1}", Resolution.Width, Resolution.Height));
                }

            case ColumnType.ImageDescription:
                return(ImageDescription);

            case ColumnType.EquipmentModel:
                return(EquipmentModel);

            case ColumnType.DateTaken:
                if (DateTaken == DateTime.MinValue)
                {
                    return("");
                }
                else
                {
                    return(DateTaken.ToString("g"));
                }

            case ColumnType.Artist:
                return(Artist);

            case ColumnType.Copyright:
                return(Copyright);

            case ColumnType.ExposureTime:
                return(ExposureTime);

            case ColumnType.FNumber:
                if (FNumber == 0.0f)
                {
                    return("");
                }
                else
                {
                    return(FNumber.ToString("f2"));
                }

            case ColumnType.ISOSpeed:
                if (ISOSpeed == 0)
                {
                    return("");
                }
                else
                {
                    return(ISOSpeed.ToString());
                }

            case ColumnType.ShutterSpeed:
                return(ShutterSpeed);

            case ColumnType.Aperture:
                return(Aperture);

            case ColumnType.UserComment:
                return(UserComment);

            default:
                throw new ArgumentException("Unknown column type", "type");
            }
        }
        /// <summary>
        /// Converts the object to a string
        /// </summary>
        /// <returns>The object as a string</returns>
        public override string ToString()
        {
            StringBuilder Builder = new StringBuilder();

            Builder.AppendFormat("<post id=\"{0}\" date-created=\"{1}\" date-modified=\"{2}\" approved=\"true\" post-url=\"{3}\" type=\"normal\" hasexcerpt=\"true\" views=\"0\" is-published=\"True\">\n", ID, DateCreated.ToString("yyyy-MM-ddThh:mm:ss"), DateModified.ToString("yyyy-MM-ddThh:mm:ss"), PostURL);
            Builder.AppendFormat("<title type=\"text\"><![CDATA[{0}]]></title>\n", Title);
            Builder.AppendFormat("<content type=\"text\"><![CDATA[{0}]]></content>\n", Content);
            Builder.AppendFormat("<post-name type=\"text\"><![CDATA[{0}]]></post-name>\n", PostName);
            Builder.AppendFormat("<excerpt type=\"text\"><![CDATA[{0}]]></excerpt>\n", Excerpt);
            Builder.AppendLine(Authors.ToString());
            Builder.AppendLine(Categories.ToString());
            Builder.AppendLine(Tags.ToString());
            Builder.AppendLine(Comments.ToString());
            Builder.AppendLine("<trackbacks />");
            Builder.AppendLine("</post>");
            return(Builder.ToString());
        }