Exemplo n.º 1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="sysUserBll"></param>
 /// <param name="sysUserRoleBll"></param>
 /// <param name="sysUserLogBll"></param>
 /// <param name="areaBll"></param>
 public LoginAction(ISysUserBLL sysUserBll, ISysUserRoleBLL sysUserRoleBll, ISysUserLogBLL sysUserLogBll, IAreaBLL areaBll)
 {
     this._sysUserBll     = sysUserBll;
     this._sysUserRoleBll = sysUserRoleBll;
     this._sysUserLogBll  = sysUserLogBll;
     this._areaBll        = areaBll;
 }
Exemplo n.º 2
0
 public UserController(ISysUserBLL sysUserBLL, IMemoryCache cache, IOptionsSnapshot <CustomConfiguration> optionsSnapshot, UserAccount userAccount)
 {
     _sysUserBLL      = sysUserBLL;
     _cache           = cache;
     _optionsSnapshot = optionsSnapshot;
     _userAccount     = userAccount;
 }
Exemplo n.º 3
0
 /// <summary>
 /// 根据关键字段的值获取记录
 /// </summary>
 /// <param name="Id">关键字段的值</param>
 /// <returns>符合查询条件的记录</returns>
 public SysUser GetSysUserById(string Id)
 {
     using (ISysUserBLL SysUserBLL = BLLContainer.Resolve <ISysUserBLL>())
     {
         SysUser model = SysUserBLL.GetFirstOrDefault(Id);
         return(model);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="sysUserBll"></param>
 /// <param name="sysUserRoleBll"></param>
 /// <param name="areaBll"></param>
 /// <param name="shopBll"></param>
 /// <param name="sysUserLogBll"></param>
 public UserController(ISysUserBLL sysUserBll, ISysUserRoleBLL sysUserRoleBll, IAreaBLL areaBll, IShopBLL shopBll, ISysUserLogBLL sysUserLogBll)
 {
     this._sysUserBll     = sysUserBll;
     this._sysUserRoleBll = sysUserRoleBll;
     this._areaBll        = areaBll;
     this._shopBll        = shopBll;
     this._sysUserLogBll  = sysUserLogBll;
 }
Exemplo n.º 5
0
        /// <summary>
        /// 返回记录总数 配合分页查询用
        /// </summary>
        /// <param name="sWhere">查询条件;多条件是目前只支持 and;表达式 System.Linq.Dynamic的形式</param>
        /// <returns>符合查询条件的记录数</returns>
        public int GetSysUserCount(string sWhere)
        {
            Expression <Func <SysUser, bool> > whereLamda = SerializerHelper.ConvertParamWhereToLinq <SysUser>(sWhere);

            using (ISysUserBLL SysUserBLL = BLLContainer.Resolve <ISysUserBLL>())
            {
                return(SysUserBLL.GetCount(whereLamda));
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 根据查询条件获取记录
        /// </summary>
        /// <param name="sWhere">查询条件;多条件是目前只支持 and;表达式 System.Linq.Dynamic的形式</param>
        /// <returns>符合查询条件的List</returns>
        public List <SysUser> GetSysUsers(string sWhere)
        {
            Expression <Func <SysUser, bool> > whereLamda = SerializerHelper.ConvertParamWhereToLinq <SysUser>(sWhere);

            using (ISysUserBLL SysUserBLL = BLLContainer.Resolve <ISysUserBLL>())
            {
                List <SysUser> models = SysUserBLL.GetModels(whereLamda);
                return(models);
            }
        }
Exemplo n.º 7
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="mSysUser">模型</param>
 /// <returns>是否成功</returns>
 public bool UpdateSysUser(SysUser mSysUser)
 {
     if (mSysUser == null)
     {
         return(false);
     }
     using (ISysUserBLL SysUserBLL = BLLContainer.Resolve <ISysUserBLL>())
     {
         return(SysUserBLL.Update(mSysUser));
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// 按照关键字段删除
 /// </summary>
 /// <param name="Id">关键字段</param>
 /// <returns>是否成功</returns>
 public bool DelSysUser(string Id)
 {
     using (ISysUserBLL SysUserBLL = BLLContainer.Resolve <ISysUserBLL>())
     {
         try
         {
             SysUser item = SysUserBLL.GetFirstOrDefault(Id);
             return(SysUserBLL.Delete(item));
         }
         catch { return(false); }
     }
 }
Exemplo n.º 9
0
        public bool ValidatePermission(AccountModel account, string controller, string action, string filePath)
        {
            //question:ActionName代表了什么
            string actionName = string.IsNullOrEmpty(ActionName) ? action : ActionName;

            if (account != null)
            {
                List <PermModel> permList = null;
                if (!string.IsNullOrEmpty(Area))
                {
                    controller = Area + "/" + controller;
                }
                //获取权限
                permList = (List <PermModel>)HttpContext.Current.Session[filePath];
                if (permList == null)
                {
                    UnityContainer container = HttpContext.Current.Application["UnityContainer"] as UnityContainer;
                    userBLL  = container.Resolve <ISysUserBLL>();
                    permList = userBLL.GetPermission(account.Id, controller);
                    HttpContext.Current.Session[filePath] = permList;
                }
                //当用户访问index时,只要权限>0就可以访问
                if (actionName.ToLower() == "index")
                {
                    if (permList.Count() > 0)
                    {
                        return(true);
                    }
                }
                //查询当前Action 是否有操作权限,大于0表示有,否则没有
                int count = permList.Where(a => a.KeyCode.ToLower() == actionName.ToLower()).Count();
                if (count > 0)
                {
                    return(true);
                }
                else
                {
                    HttpContext.Current.Response.Write("你没有操作权限,请联系管理员!");
                    return(false);
                }
            }
            else
            {
                HttpContext.Current.Response.Write("你没有操作权限,请联系管理员!");
                return(false);
            }
        }
Exemplo n.º 10
0
 /// <summary>
 /// 按照关键字段删除
 /// </summary>
 /// <param name="Ids">关键字段数组</param>
 /// <returns>是否成功</returns>
 public bool DelSysUsers(string[] Ids)
 {
     using (ISysUserBLL SysUserBLL = BLLContainer.Resolve <ISysUserBLL>())
     {
         try
         {
             List <SysUser> entitys = new List <SysUser>();
             foreach (string id in Ids)
             {
                 SysUser item = SysUserBLL.GetFirstOrDefault(id);
                 entitys.Add(item);
             }
             return(SysUserBLL.Delete(entitys));
         }
         catch { return(false); }
     }
 }
Exemplo n.º 11
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="shopRetailRankBll"></param>
 /// <param name="shopRetailRankLimitBll"></param>
 /// <param name="sysUserBll"></param>
 /// <param name="sysUserRoleBll"></param>
 /// <param name="sysUserLogBll"></param>
 /// <param name="areaBll"></param>
 /// <param name="goodsBll"></param>
 /// <param name="openDataBll"></param>
 /// <param name="shopBll"></param>
 /// <param name="baseSupplierBll"></param>
 /// <param name="retailCustomerBll"></param>
 public OpenController(IShopRetailRankBLL shopRetailRankBll, IShopRetailRankLimitBLL shopRetailRankLimitBll,
                       ISysUserBLL sysUserBll, ISysUserRoleBLL sysUserRoleBll, ISysUserLogBLL sysUserLogBll,
                       IOpenDataBLL openDataBll, IGoodsBLL goodsBll, IAreaBLL areaBll, IShopBLL shopBll,
                       IBaseSupplierBLL baseSupplierBll, IRetailCustomerBLL retailCustomerBll)
 {
     this._shopRetailRankBll      = shopRetailRankBll;
     this._shopRetailRankLimitBll = shopRetailRankLimitBll;
     this._sysUserBll             = sysUserBll;
     this._sysUserRoleBll         = sysUserRoleBll;
     this._sysUserLogBll          = sysUserLogBll;
     this._openDataBll            = openDataBll;
     this._goodsBll          = goodsBll;
     this._areaBll           = areaBll;
     this._shopBll           = shopBll;
     this._baseSupplierBll   = baseSupplierBll;
     this._retailCustomerBll = retailCustomerBll;
 }
Exemplo n.º 12
0
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="pageSize">单页的记录数</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="isAsc">是否正序排序</param>
        /// <param name="orderField">排序字段 为空时默认为 CREATION_DATE </param>
        /// <param name="sWhere">查询条件;多条件是目前只支持 and;表达式 System.Linq.Dynamic的形式</param>
        /// <returns>符合查询条件的List结果</returns>
        public List <SysUser> GetSysUserByPage(int pageSize, int pageIndex, bool isAsc, string orderField, string sWhere)
        {
            string orderStr = "";

            if (string.IsNullOrEmpty(orderField))
            {
                orderStr = "CREATION_DATE";
            }
            else
            {
                orderStr = orderField;
            }
            Expression <Func <SysUser, bool> > whereLamda = SerializerHelper.ConvertParamWhereToLinq <SysUser>(sWhere);

            using (ISysUserBLL SysUserBLL = BLLContainer.Resolve <ISysUserBLL>())
            {
                List <SysUser> models = SysUserBLL.GetModelsByPage(pageSize, pageIndex, isAsc, orderStr, whereLamda);
                return(models);
            }
        }
Exemplo n.º 13
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="sysUserBll"></param>
 /// <param name="areaBll"></param>
 /// <param name="shopBll"></param>
 public GetUserDataLimitAction(ISysUserBLL sysUserBll, IAreaBLL areaBll, IShopBLL shopBll)
 {
     this._sysUserBll = sysUserBll;
     this._areaBll    = areaBll;
     this._shopBll    = shopBll;
 }
Exemplo n.º 14
0
 public SysUserController(ISysUserBLL sysUserBLL,ISysLogBLL sysLogBLL)
 {
     this.m_BLL = sysUserBLL;
     this.m_LogBLL = sysLogBLL;
 }
Exemplo n.º 15
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="sysUserBll"></param>
 public SaveUserDataLimitAction(ISysUserBLL sysUserBll)
 {
     this._sysUserBll = sysUserBll;
 }
Exemplo n.º 16
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="sysUserBll"></param>
 public ChangePasswordAction(ISysUserBLL sysUserBll)
 {
     this._sysUserBll = sysUserBll;
 }
Exemplo n.º 17
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="sysUserBll"></param>
 public ChangeStatusFlagAction(ISysUserBLL sysUserBll)
 {
     this._sysUserBll = sysUserBll;
 }
Exemplo n.º 18
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="sysUserBll"></param>
 public GetUserPageAction(ISysUserBLL sysUserBll, ISysUserRoleBLL sysUserRoleBLL)
 {
     this._sysUserBll     = sysUserBll;
     this._sysUserRoleBll = sysUserRoleBLL;
 }
Exemplo n.º 19
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="sysUserBll"></param>
 /// <param name="sysUserRoleBll"></param>
 public SaveUserAction(ISysUserBLL sysUserBll, ISysUserRoleBLL sysUserRoleBll)
 {
     this._sysUserBll     = sysUserBll;
     this._sysUserRoleBll = sysUserRoleBll;
 }
Exemplo n.º 20
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="sysUserBll"></param>
 public ResetPasswordAction(ISysUserBLL sysUserBll)
 {
     this._sysUserBll = sysUserBll;
 }
Exemplo n.º 21
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="sysUserBll"></param>
 /// <param name="sysUserRoleBll"></param>
 /// <param name="sysUserLogBll"></param>
 public GetAccessTokenAction(ISysUserBLL sysUserBll, ISysUserRoleBLL sysUserRoleBll, ISysUserLogBLL sysUserLogBll)
 {
     this._sysUserBll     = sysUserBll;
     this._sysUserRoleBll = sysUserRoleBll;
     this._sysUserLogBll  = sysUserLogBll;
 }
Exemplo n.º 22
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="sysUserBll"></param>
 public GetUserAction(ISysUserBLL sysUserBll)
 {
     this._sysUserBll = sysUserBll;
 }
Exemplo n.º 23
0
 public UserController(ISysUserGroupBLL sysUserGroupBLL, ISysUserBLL sysUserBLL, UserAccount userAccount)
 {
     _sysUserGroupBLL = sysUserGroupBLL;
     _sysUserBLL      = sysUserBLL;
     _userAccount     = userAccount;
 }
Exemplo n.º 24
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="sysUserRoleDal"></param>
 /// <param name="sysUserBll"></param>
 public SysUserRoleBLL(ISysUserRoleDAL sysUserRoleDal, ISysUserBLL sysUserBll)
 {
     this._sysUserRoleDal = sysUserRoleDal;
     this._sysUserBll     = sysUserBll;
 }