• RemoteExt 远程验证


    public class RemoteExtAttribute : RemoteAttribute
        {
            private string _resourceKey;
    
            public RemoteExtAttribute(string action, string controller, string areaName)
                : base(action, controller, areaName)
            {
                base.RouteData["area"] = areaName;
            }
    
            public RemoteExtAttribute(string action, string controller)
                : this(action, controller, "")
            {
                
            }
    
            public RemoteExtAttribute(string action, string controller, string areaName,string resourceKey, string errMsgResourceKey)
                : this(action, controller, areaName)
            {
                string displayName = EP.GlobalResources.EPLocalization.ResourceManager.GetString(resourceKey);
                displayName = string.IsNullOrEmpty(displayName) ? resourceKey : displayName;
                string errMsg = EP.GlobalResources.EPLocalization.ResourceManager.GetString(errMsgResourceKey);
                errMsg = string.IsNullOrEmpty(errMsg) ? errMsgResourceKey : errMsg;
                this.ErrorMessage = string.Format(" [{0}] {1}", displayName, errMsg);
            }
    
        }
    

      

    /// <summary>
        /// 账号唯一性
        /// </summary>
        public partial class RVMdEmployeeController : MutilLangController
        {
            [HttpGet]
            [OutputCache(Location = OutputCacheLocation.None, NoStore = true)]
            public JsonResult IsValidAcc(string Account)
            {
                Account = Account.CleanCode(30);
                bool v = MdEmployee.Count(TblMdEmployee._.Account == Account) >= 1;
                return Json(!v, JsonRequestBehavior.AllowGet);
            }
        }
    

      

    [RemoteExt("IsValidUId", "RVMdEmployee", "", AdditionalFields = "__DS", ErrorMessageResourceName = "G_DuplicatedKey", ErrorMessageResourceType = typeof(EP.GlobalResources.EPLocalization))]

  • 相关阅读:
    WebRequest 超时不起作用
    nutch导入ide nutch1.3
    nutch 设置抓取间隔策略
    c#: Error: Crossthread operation not valid
    mysql命令行基本操作
    Boost String Algorithms Library 函数详解三 (find)
    boost::timer 的替代方案
    windows驱动程序开发初探
    深入浅出Win32多线程程序设计之线程通信
    深入浅出Win32多线程设计之MFC的多线程(1)
  • 原文地址:https://www.cnblogs.com/xsj1989/p/5553333.html
Copyright © 2020-2023  润新知