Example #1
0
 public V_PermissionUpdateState GetLatestTimeOfPermission(string employeeid)
 {
     using (SysPermissionBLL bll = new SysPermissionBLL())
     {
         try
         {
             V_PermissionUpdateState perUpdate = new V_PermissionUpdateState();
             perUpdate.Timer = bll.GetLatestTimeOfPermission(employeeid);
             perUpdate.Counter = bll.GetPermissionCounts(employeeid);
             return perUpdate;
         }
         catch(Exception ex)
         {
             Tracer.Debug("PermissionService-GetLatestTimeOfPermission获取时间出错:" + ex.ToString());
             return null;
         }
     }
 }
Example #2
0
 public List<T_SYS_USER> GetManagers(List<string> companyIDs)
 {
     using (SysPermissionBLL bll = new SysPermissionBLL())
     {
         List<T_SYS_USER> listUsers = new List<T_SYS_USER>();
         try
         {
             listUsers = bll.GetManagers(companyIDs);
         }
         catch (Exception ex)
         {
             Tracer.Debug("PermissionService-GetFlowManagers获取管理员集合出错:" + ex.ToString());
         }
         return listUsers;
     }
 }
Example #3
0
        public List<T_SYS_PERMISSION> FindSysPermissionByStr(string sName)
        {
            using (SysPermissionBLL bll = new SysPermissionBLL())
            {
                #region 
                List<T_SYS_PERMISSION> perList;
                string keyString = "FindSysPermissionByStr" + sName;
                if (WCFCache.Current[keyString] == null)
                {
                    IQueryable<T_SYS_PERMISSION> IQList = bll.FindSysPermissionByStr(sName);
                    perList = IQList == null ? null : IQList.ToList();
                    WCFCache.Current.Insert(keyString, perList, DateTime.Now.AddMinutes(15));

                }
                else
                {
                    perList = (List<T_SYS_PERMISSION>)WCFCache.Current[keyString];
                }
                #endregion
                return perList.Count() > 0 ? perList : null;
            }
        }
Example #4
0
        public void SetCutomterPermissionObj(string RoleID, List<CustomerPermission> objs, ref string strResult)
        {
            try
            {
                using (EntityMenuCustomPermBLL bll = new EntityMenuCustomPermBLL())
                {
                    if (string.IsNullOrWhiteSpace(RoleID))
                    {
                        return;
                    }

                    RoleEntityMenuBLL roleEmBll = new RoleEntityMenuBLL();
                    roleEmBll.UpdateRoleInfo(RoleID, strResult);//修改信息
                    strResult = string.Empty;
                    IQueryable<T_SYS_ENTITYMENUCUSTOMPERM> cuspers = bll.GetCustomPermByRoleID(RoleID);
                    //if (cuspers != null)
                    //{
                    //    if (cuspers.Count() > 0)
                    //    {
                    //        foreach (T_SYS_ENTITYMENUCUSTOMPERM item in cuspers)
                    //        {
                    //            string strId = item.ENTITYMENUCUSTOMPERMID;
                    //            EntityMenuCustomPermDelete(strId);
                    //        }
                    //    }
                    //}
                    SysPermissionBLL bllPer = new SysPermissionBLL();
                    T_SYS_ROLE entRole = GetSysRoleSingleInfoById(RoleID);//获取角色ID实体对象

                    foreach (var Menus in objs)
                    {
                        if (Menus.PermissionValue == null)
                        {
                            continue;
                        }

                        if (Menus.PermissionValue.Count() == 0)
                        {
                            continue;
                        }
                        T_SYS_ENTITYMENU entMenu = GetSysMenuByID(Menus.EntityMenuId);
                        foreach (var Perms in Menus.PermissionValue)
                        {
                            if (Perms.OrgObjects == null)
                            {
                                continue;
                            }

                            if (Perms.OrgObjects.Count() == 0)
                            {
                                continue;
                            }

                            T_SYS_PERMISSION entPer = bllPer.GetAttachSysPermissionByID(Perms.Permission);//获取权限实体对象
                            foreach (var OrgIns in Perms.OrgObjects)
                            {
                                T_SYS_ENTITYMENUCUSTOMPERM customerPer = new T_SYS_ENTITYMENUCUSTOMPERM();
                                customerPer.ENTITYMENUCUSTOMPERMID = Guid.NewGuid().ToString();

                                customerPer.T_SYS_ROLEReference.EntityKey = entRole.EntityKey;
                                customerPer.T_SYS_ROLE = entRole;
                                //customerPer.T_SYS_ENTITYMENU = entMenu;
                                customerPer.T_SYS_ENTITYMENUReference.EntityKey = entMenu.EntityKey;
                                customerPer.T_SYS_ENTITYMENU = entMenu;
                                //customerPer.T_SYS_PERMISSION = entPer;
                                customerPer.T_SYS_PERMISSIONReference.EntityKey = entPer.EntityKey;
                                customerPer.T_SYS_PERMISSION = entPer;

                                switch (OrgIns.OrgType)
                                {

                                    //公司
                                    case "0":
                                        customerPer.COMPANYID = OrgIns.OrgID;
                                        break;
                                    case "1"://部门
                                        customerPer.DEPARTMENTID = OrgIns.OrgID;
                                        break;
                                    case "2"://岗位
                                        customerPer.POSTID = OrgIns.OrgID;
                                        break;
                                }

                                customerPer.CREATEDATE = DateTime.Now;
                                customerPer.UPDATEDATE = DateTime.Now;

                                EntityMenuCustomPermAdd(customerPer);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                strResult = ex.Message;
            }
        }
Example #5
0
 public string SysPermissionUpdate(T_SYS_PERMISSION obj)
 {
     using (SysPermissionBLL bll = new SysPermissionBLL())
     {
         string keyString = "PermissionAllPagingCache";
         WCFCache.Current[keyString] = null;//清缓存
         string AddkeyString = "GetSysPermissionByID" + obj.PERMISSIONID;
         WCFCache.Current[AddkeyString] = null;
         return bll.SysPermissionUpdate(obj);
     }
 }
Example #6
0
 public string SysPermissionDelete(string perID)
 {
     using (SysPermissionBLL bll = new SysPermissionBLL())
     {
         string keyString = "PermissionAllPagingCache";
         WCFCache.Current[keyString] = null;//清缓存
         return bll.SysPermissionDelete(perID);
     }
 }
Example #7
0
 public string SysPermissionAdd(T_SYS_PERMISSION obj)
 {
     using (SysPermissionBLL bll = new SysPermissionBLL())
     {
         string keyString = "PermissionAllPagingCache" ;
         WCFCache.Current[keyString] = null;//清缓存
         return bll.AddPermission(obj);
     }
     //bll.Add(obj);
 }
Example #8
0
        public T_SYS_PERMISSION GetSysPermissionByID(string perID)
        {
            using (SysPermissionBLL bll = new SysPermissionBLL())
            {
                #region 
                T_SYS_PERMISSION perList;
                string keyString = "GetSysPermissionByID" + perID;
                if (WCFCache.Current[keyString] == null)
                {

                    perList = bll.GetSysPermissionByID(perID);
                    WCFCache.Current.Insert(keyString, perList, DateTime.Now.AddMinutes(15));

                }
                else
                {
                    perList = (T_SYS_PERMISSION)WCFCache.Current[keyString];
                }
                return perList;
                #endregion
            }
        }
Example #9
0
        //所有用户信息 2010-6-10
        public List<T_SYS_PERMISSION> GetSysPermissionAllPaging(int pageIndex, int pageSize, string sort, string filterString, object[] paras, ref int pageCount, LoginUserInfo loginUserInfo)
        {
            using (SysPermissionBLL bll = new SysPermissionBLL())
            {
                #region 
                List<T_SYS_PERMISSION> perList;
                string keyString = "PermissionAllPagingCache";
                if (WCFCache.Current[keyString] == null)
                {

                    perList = bll.GetSysPermissionAll().ToList();
                    WCFCache.Current.Insert(keyString, perList, DateTime.Now.AddMinutes(15));

                }
                else
                {
                    perList = (List<T_SYS_PERMISSION>)WCFCache.Current[keyString];
                }
                #endregion
                return perList != null ? perList : null;

            }


        }
Example #10
0
        public List<T_SYS_PERMISSION> GetSysPermissionByEntityID(string EntityID)
        {
            using (SysPermissionBLL bll = new SysPermissionBLL())
            {
                //SysPermissionBLL bll = new SysPermissionBLL();
                //IQueryable<T_SYS_PERMISSION> perList = bll.GetSysPermissionAll();
                #region 
                List<T_SYS_PERMISSION> perList;
                string keyString = "SysPermissionAll" + EntityID;


                if (WCFCache.Current[keyString] == null)
                {
                    IQueryable<T_SYS_PERMISSION> IQList = bll.GetPermissionByEntityID(EntityID);
                    perList = IQList == null ? null : IQList.ToList();
                    WCFCache.Current.Insert(keyString, perList, DateTime.Now.AddMinutes(15));

                }
                else
                {
                    perList = (List<T_SYS_PERMISSION>)WCFCache.Current[keyString];
                }

                #endregion
                return perList.Count() > 0 ? perList : null;
            }
        }
Example #11
0
        public List<T_SYS_PERMISSION> GetSysCommonPermissionAll()
        {
            using (SysPermissionBLL bll = new SysPermissionBLL())
            {
                #region 龙康才新增
                List<T_SYS_PERMISSION> perList;

                WCFCache.Current["SysCommonPermissionAll"] = null;
                string keyString = "SysCommonPermissionAll";
                if (WCFCache.Current[keyString] == null)
                {
                    IQueryable<T_SYS_PERMISSION> IQList = bll.GetSysCommonPermissionAll();
                    perList = IQList == null ? null : IQList.ToList();
                    WCFCache.Current.Insert(keyString, perList, DateTime.Now.AddMinutes(15));

                }
                else
                {
                    perList = (List<T_SYS_PERMISSION>)WCFCache.Current[keyString];
                }


                #endregion
                return perList.Count() > 0 ? perList : null;
            }

        }