Ejemplo n.º 1
0
 public void MergeFrom(BlogDto other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Id.Length != 0)
     {
         Id = other.Id;
     }
     if (other.Name.Length != 0)
     {
         Name = other.Name;
     }
     if (other.createAt_ != null)
     {
         if (createAt_ == null)
         {
             CreateAt = new global::Google.Protobuf.WellKnownTypes.Timestamp();
         }
         CreateAt.MergeFrom(other.CreateAt);
     }
     posts_.Add(other.posts_);
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Ejemplo n.º 2
0
        /// <summary> 发送邮件 </summary>
        protected override void SendEmail()
        {
            var mail = ExceptionEmailConfigs.ConfigEntity;
            var smtp = new SmtpMail(mail.LoginName, mail.LoginPwd, mail.SendMail, "Farseer.Net SQL异常记录", mail.SmtpServer, 0, mail.SmtpPort);
            var body = new StringBuilder();

            body.AppendFormat("<b>发现时间:</b> {0}<br />", CreateAt.ToString("yyyy年MM月dd日 HH:mm:ss"));
            body.AppendFormat("<b>程序文件:</b> <u>{0}</u> <b>第{1}行</b> <font color=red>{2}()</font><br />", FileName, LineNo, MethodName);

            switch (CmdType)
            {
            case CommandType.StoredProcedure:
                body.AppendFormat("<b>存储过程:</b> {0}<br />", Name);
                break;

            case CommandType.Text:
                body.AppendFormat("<b>表视图名:</b> {0}<br />", Name);
                body.AppendFormat("<b>Sql语句:</b> {0}<br />", Sql);
                break;
            }

            body.AppendFormat("<b>Sql参数:</b><br />");
            SqlParamList.ForEach(o => body.AppendFormat("{0} = {1}<br />", o.Name, o.Value));
            body.AppendFormat("<b>错误消息:</b><font color=red>{0}</font><br />", Message);
            smtp.Send(mail.EmailAddress, $"{DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss")}:警告!数据库异常:{Message}", body.ToString());
        }
        public void MouseDown(Vector2 position)
        {
            MouseDownPosition = position;
            MouseClickDown();

            if (IsPressed("d"))
            {
                DeleteAt?.Invoke(this, position);
                KeyPressed = null;
            }
            else if (IsPressed("c"))
            {
                CreateAt?.Invoke(this, position);
            }
            else if (IsPressed("p"))
            {
                AddPoint?.Invoke(this, position);
            }
            else
            {
                SelectAt?.Invoke(this, position);
            }

            LastMousePosition = position;
        }
        private void SendEmail()
        {
            var mail = ExceptionEmailConfigs.ConfigEntity;
            var smtp = new SmtpMail(mail.LoginName, mail.LoginPwd, mail.SendMail, "Farseer.Net 运行异常记录", mail.SmtpServer, 0, mail.SmtpPort);
            var body = new StringBuilder();

            body.AppendFormat("<b>发现时间:</b> {0}<br />", CreateAt.ToString("yyyy年MM月dd日 HH:mm:ss"));
            body.AppendFormat("<b>程序文件:</b> <u>{0}</u> <b>第{1}行</b> <font color=red>{2}()</font><br />", FileName, LineNo, MethodName);
            body.AppendFormat("<b>错误消息:</b><font color=red>{0}</font><br />", Message);
            smtp.Send(mail.EmailAddress, string.Format("{0}:警告!数据库异常:{1}", DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss"), Message), body.ToString());
        }
Ejemplo n.º 5
0
        protected virtual void SendEmail()
        {
            var mail = ExceptionEmailConfigs.ConfigEntity;
            var smtp = new SmtpMail(mail.LoginName, mail.LoginPwd, mail.SendMail, $"Farseer.Net {EnumNameCacheManger.Cache(logType)}记录", mail.SmtpServer, 0, mail.SmtpPort);
            var body = new StringBuilder();

            body.AppendFormat("<b>发现时间:</b> {0}<br />", CreateAt.ToString("yyyy年MM月dd日 HH:mm:ss"));
            body.AppendFormat("<b>程序文件:</b> <u>{0}</u> <b>第{1}行</b> <font color=red>{2}()</font><br />", FileName, LineNo, MethodName);
            body.AppendFormat("<b>日志消息:</b><font color=red>{0}</font><br />", Message);
            smtp.Send(mail.EmailAddress, $"{DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss")}:{EnumNameCacheManger.Cache(logType)}消息:{Message}", body.ToString());
        }
Ejemplo n.º 6
0
        public override byte[] GetData()
        {
            var data = new byte[16 + 20 + 8];

            Buffer.BlockCopy(Id.ToOrderByteArray(), 0, data, 0, 16);
            Buffer.BlockCopy(Encoding.UTF8.GetBytes(Name.PadRight(20)), 0, data, 16, 20);

            var time = BitConverter.GetBytes(CreateAt.ToUnixTimeMilliseconds());

            Array.Reverse(time);
            Buffer.BlockCopy(time, 0, data, 36, 8);

            return(data);
        }
Ejemplo n.º 7
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (createAt_ != null)
            {
                hash ^= CreateAt.GetHashCode();
            }
            hash ^= tags_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 8
0
 public override string ToString()
 {
     return($"{Name} - {IsComplete}\n{CreateAt.ToString("d")}");
 }
Ejemplo n.º 9
0
 public override string ToString()
 {
     return($"{Body} - {CreateAt.ToString("d")}\nLikes - {Likes}");
 }
Ejemplo n.º 10
0
 public bool IsExpire()
 {
     return(CreateAt.AddSeconds(30) <= DateTime.Now);
 }
Ejemplo n.º 11
0
 public override string ToString()
 {
     return($"{Title}\n{Body}\nWas created - {CreateAt.ToString("d")}\nLikes-{Likes}");
 }