Exemple #1
0
 /// <summary>
 /// 后台管理员审核
 /// </summary>
 /// <param name="content"></param>
 /// <param name="user"></param>
 public void VerifyByUser(string content, User user, VerifyType verifyType)
 {
     if (CanVerifyByUser)
     {
         if (user == null)
         {
             throw new ArgumentNullException("user");
         }
         this.VerifyStatus = (AccountVerifyStatus)Enum.Parse(typeof(AccountVerifyStatus), verifyType.ToString());
         this.AccountVerifies.Add(new AccountVerify()
         {
             AccountId       = this.ID,
             Content         = content,
             CreateTime      = DateTime.Now,
             IsAdmin         = true,
             Status          = this.VerifyStatus,
             VerifyAccountId = user.ID,
             VerifyAccount   = user.UserName,
         });
         if (verifyType == VerifyType.Verified)
         {
             this.Status = AccountStatus.Initiation;
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// ��̨����Ա���
 /// </summary>
 /// <param name="content"></param>
 /// <param name="user"></param>
 public void VerifyByUser(int userId, string content, VerifyType verifyType)
 {
     if (CanVerifyByUser())
     {
         this.VerifyStatus = (AccountVerifyStatus)Enum.Parse(typeof(AccountVerifyStatus), verifyType.ToString());
         this.AccountVerifies.Add(new AccountVerify()
         {
             AccountId = this.ID,
             Content = content,
             CreateTime = DateTime.Now,
             Status = this.VerifyStatus,
             UserId = userId,
         });
         DomainEvents.Publish(new VerifyByUserEvent() { Account = this });
     }
     else
     {
         throw new VerifyApplyException("��ǰ���������");
     }
 }
Exemple #3
0
 /// <summary>
 /// 后台管理员审核
 /// </summary>
 /// <param name="content"></param>
 /// <param name="user"></param>
 public void VerifyByUser(int userId, string content, VerifyType verifyType)
 {
     if (CanVerifyByUser())
     {
         this.VerifyStatus = (AccountVerifyStatus)Enum.Parse(typeof(AccountVerifyStatus), verifyType.ToString());
         this.AccountVerifies.Add(new AccountVerify()
         {
             AccountId  = this.ID,
             Content    = content,
             CreateTime = DateTime.Now,
             Status     = this.VerifyStatus,
             UserId     = userId,
         });
         DomainEvents.Publish(new VerifyByUserEvent()
         {
             Account = this
         });
     }
     else
     {
         throw new VerifyApplyException("当前不允许审核");
     }
 }
Exemple #4
0
 /// <summary>
 /// ��̨����Ա���
 /// </summary>
 /// <param name="content"></param>
 /// <param name="user"></param>
 public void VerifyByUser(string content, User user, VerifyType verifyType)
 {
     if (CanVerifyByUser)
     {
         if (user == null) throw new ArgumentNullException("user");
         this.VerifyStatus = (AccountVerifyStatus)Enum.Parse(typeof(AccountVerifyStatus), verifyType.ToString());
         this.AccountVerifies.Add(new AccountVerify()
         {
             AccountId = this.ID,
             Content = content,
             CreateTime = DateTime.Now,
             IsAdmin = true,
             Status = this.VerifyStatus,
             VerifyAccountId = user.ID,
             VerifyAccount = user.UserName,
         });
         if (verifyType == VerifyType.Verified)
         {
             this.Status = AccountStatus.Initiation;
         }
     }
 }
Exemple #5
0
        /// <summary>
        /// 功能描述:生成一个日期时间范围控件
        /// </summary>
        /// <param name="htmlHelper">HtmlHelper</param>
        /// <param name="strName">绑定名称</param>
        /// <param name="verifyType">验证规则</param>
        /// <param name="strPlaceholder">水印文字</param>
        /// <param name="strFormat">日期时间格式</param>
        /// <param name="blnReadOnly">是否只读</param>
        /// <returns>返回值</returns>
        public static MvcHtmlString DateTimeRangeBox(
            this HtmlHelper htmlHelper,
            string strName,
            VerifyType verifyType,
            string strPlaceholder = "",
            string strFormat      = "yyyy-MM-dd HH:mm:ss",
            bool blnReadOnly      = true)
        {
            StringBuilder strHtml = new StringBuilder();

            strHtml.AppendLine(string.Format(" <input type=\"text\" name=\"{0}\" id=\"{0}\" lay-verify=\"{1}\" autocomplete=\"off\" class=\"layui-input\" {2} {3}/>",
                                             strName, (verifyType == VerifyType.none ? "" : verifyType.ToString()), (!strPlaceholder.IsEmpty() ? "placeholder=\"" + strPlaceholder + "\"" : ""),
                                             blnReadOnly ? "readonly=\"\"" : ""));
            strHtml.AppendLine("<script>");
            strHtml.AppendLine("$(document).ready(function () {");
            strHtml.AppendLine("    tool.Date.setDateTimeRangeBox('" + strName + "','" + strFormat + "');");
            strHtml.AppendLine("});");
            strHtml.AppendLine("</script>");
            return(new MvcHtmlString(strHtml.ToString()));
        }