zoukankan      html  css  js  c++  java
  • 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))]

  • 相关阅读:
    go基础_定时器
    作业3:写一个测试程序,消耗固定内存
    Hdu3397Sequence operation线段树
    Hdu3308LCIS线段树
    Poj3667Hotel线段树
    Poj1436Horizontally Visible Segments线段树
    Poj3225Help with Intervals区间线段树
    Poj2528Mayor's posters线段树
    poj3468A Simple Problem with Integers区间和线段树
    Hdu1698Just a Hook线段树区间更新
  • 原文地址:https://www.cnblogs.com/xsj1989/p/5553333.html
Copyright © 2011-2022 走看看