public LeaveReMsgDTO RToDTO(LeaveReMsgEntity msg)
        {
            LeaveReMsgDTO LeaveReMsg = new LeaveReMsgDTO();

            LeaveReMsg.ID        = msg.ID;
            LeaveReMsg.ReContent = msg.ReContent;
            LeaveReMsg.ReTime    = msg.ReTime;
            LeaveReMsg.UserCode  = msg.UserCode;

            return(LeaveReMsg);
        }
        /// <summary>
        /// 前台回复留言记录
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="Title"></param>
        /// <param name="Content"></param>

        /// <returns></returns>
        public long LeaveReMsgAdd(long Id, long userid, string UserCode, string Context)
        {
            using (MyDbContext dbcontext = new MyDbContext())
            {
                LeaveReMsgEntity leaveReMsgModel = new LeaveReMsgEntity();

                leaveReMsgModel.LeaveID   = Id;
                leaveReMsgModel.UserType  = 2;
                leaveReMsgModel.UserID    = userid;
                leaveReMsgModel.UserCode  = UserCode;
                leaveReMsgModel.ReContent = Context;
                leaveReMsgModel.ReTime    = DateTime.Now;
                dbcontext.LeaveReMsg.Add(leaveReMsgModel);
                dbcontext.SaveChanges();
                return(leaveReMsgModel.ID);
            }
        }
        /// <summary>
        /// 后台回复留言记录
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="Title"></param>
        /// <param name="Content"></param>

        /// <returns></returns>
        public long ContentAdd(long Id, string Context)
        {
            using (MyDbContext dbcontext = new MyDbContext())
            {
                LeaveReMsgEntity leaveReMsgModel = new LeaveReMsgEntity();
                AdminEntity      admin           = new AdminEntity();
                leaveReMsgModel.LeaveID   = Id;
                leaveReMsgModel.UserType  = 2;
                leaveReMsgModel.UserID    = admin.ID;
                leaveReMsgModel.UserCode  = admin.UserName;
                leaveReMsgModel.ReContent = Context;
                leaveReMsgModel.ReTime    = DateTime.Now;
                dbcontext.LeaveReMsg.Add(leaveReMsgModel);
                dbcontext.SaveChanges();
                return(leaveReMsgModel.ID);
            }
        }