public void TheTargetObjectReadWritePropsMustEqualToSourceObjectAfterCopyValue()
        {
            var sourceObject = new EPerson(1, 11, "111");
            var targetObject = new EPerson(2, 22, "222");

            sourceObject.CopyValuesTo(ref targetObject);

            Assert.Equal(sourceObject.Name, targetObject.Name);
            Assert.Equal(sourceObject.Age, targetObject.Age);
            Assert.NotEqual(sourceObject.Id, targetObject.Id);
        }
 public static void Get(EPerson SearchBy, dynamic Value)
 {
     var Sql = "select from dbo.bobo where " + SearchBy.ToString() + "='" + Value + "'";
 }
예제 #3
0
 public Registered(String nickName, String password, String firstName, String lastName, EPerson personTyp) : base(nickName, password, personTyp)
 {
     this.FirstName = firstName;
     this.LastName  = lastName;
 }
 public void SetPersonTyp(EPerson personTyp)
 {
     this.PersonTyp = personTyp;
 }
 public Person(String nickName, String password, EPerson personTyp)
 {
     this.NickName = nickName;
     this.Password = password;
     SetPersonTyp(personTyp);
 }
        /// <summary>
        /// 处理 Span嵌套Span
        /// </summary>
        /// <param name="node"></param>
        /// <param name="bi"></param>
        private void AnalyInfo_SpanChild(HtmlNode node)
        {
            EBookInfo bi     = _bookDetailData.DouBanBookInfo;
            EPerson   author = _bookDetailData.Author;
            string    name   = node.InnerText.Trim();
            HtmlNode  ci     = node.NextSibling.NextSibling;;
            string    url    = ci.Attributes["href"].Value;

            if (!url.StartsWith(DouBanBookPrefix))
            {
                url = DouBanBookPrefix + url;
            }

            switch (name)
            {
            case "作者:":
            case "作者":
                var authorName = ci.InnerText.Trim();
                if (authorName.StartsWith("["))
                {
                    var ep = authorName.IndexOf("]");
                    author.Country = authorName.Substring(1, ep - 1);
                    author.Name    = authorName.Substring(ep + 1);
                }
                if (authorName.StartsWith("<"))
                {
                    var ep = authorName.IndexOf(">");
                    author.Country = authorName.Substring(1, ep - 1);
                    author.Name    = authorName.Substring(ep + 1);
                }
                else if (authorName.StartsWith("("))
                {
                    var ep = authorName.IndexOf(")");
                    author.Country = authorName.Substring(1, ep - 1);
                    author.Name    = authorName.Substring(ep + 1);
                }
                else if (authorName.StartsWith("【"))
                {
                    var ep = authorName.IndexOf("】");
                    author.Country = authorName.Substring(1, ep - 1);
                    author.Name    = authorName.Substring(ep + 1);
                }
                else
                {
                    author.Name    = authorName;
                    author.Country = "中国";
                }
                author.Code      = GenCodeHelper.Person_Code(author.Name.Trim());
                bi.AuthorCode    = author.Code;
                author.SourceUrl = url;

                break;

            case "译者:":
            case "译者":
                bi.Translater    = ci.InnerText;
                bi.TranslaterUrl = url;
                break;

            case "丛书":
            case "丛书:":
                bi.Series    = ci.InnerText;
                bi.SeriesUrl = url;
                break;

            case "出品方":
            case "出品方:":
                bi.Producer    = ci.InnerText;
                bi.ProducerUrl = url;
                break;
            }
        }