Exemple #1
0
        //public bool ChkUserAccount(string userCode, string serviceName, string methodName)
        //{
        //    SysServicePermConfig wsp = DBContext.Find<SysServicePermConfig>(SysServicePermConfig.Meta.ServiceName == serviceName & SysServicePermConfig.Meta.MethodName == methodName);
        //    if (wsp != null && wsp.PermName.ToUpper() == "ALL")
        //    {
        //        return true;
        //    }

        //    return false;
        //}

        public bool ChkFunc(string userCode, string menuCode)
        {
            object o = SpCaller.GetCaller(DBContext).CallChkMenuPrivilege(menuCode, userCode).ExecuteOutParameters()["P_RET"];

            if (o != null && Convert.ToInt32(o) == 0)
            {
                return(false);
            }

            return(true);
        }
Exemple #2
0
        //public IList<BasBuInfo> ListBU()
        //{
        //    return DBContext.FindArray<BasBuInfo>(BasBuInfo.Meta.STATUS == BLLConstants.COM_STATUS_ACTIVED);
        //}

        //public IList<BasBuInfo> GetSiteBU(string siteCode)
        //{
        //    IList<BasSiteBu> bus = DBContext.FindArray<BasSiteBu>(BasSiteBu.Meta.SITE == siteCode);
        //    IList<BasBuInfo> rets = new List<BasBuInfo>();
        //    IList<BasBuInfo> buis = DBContext.FindArray<BasBuInfo>(BasBuInfo.Meta.STATUS == BLLConstants.COM_STATUS_ACTIVED);

        //    foreach (BasSiteBu siteBU in bus)
        //    {
        //        if (buis.Count(c => c.CODE == siteBU.BuCode) > 0)
        //        {
        //            rets.Add(buis.Single(c => c.CODE == siteBU.BuCode));
        //        }
        //    }
        //    return rets;
        //}

        //public IList<BasSiteInfo> ListSite()
        //{
        //    return DBContext.FindArray<BasSiteInfo>(BasSiteInfo.Meta.STATUS == BLLConstants.COM_STATUS_ACTIVED);
        //}

        //public IList<TextValueInfo> ListSiteBU()
        //{
        //    IList<BasSiteBu> bus = DBContext.LoadArray<BasSiteBu>();
        //    IList<TextValueInfo> rets = new List<TextValueInfo>();
        //    foreach (BasSiteBu sb in bus)
        //    {
        //        BasSiteInfo site = DBContext.Find<BasSiteInfo>(BasSiteInfo.Meta.CODE == sb.SITE);
        //        rets.Add(new TextValueInfo() { Text = site.SiteName + "-" + sb.BuName, Value = site.CODE + "^" + sb.BuCode });
        //    }
        //    return rets;
        //}
        /// <summary>
        /// 通過功能代碼取得菜單項目信息
        /// </summary>
        /// <param name="functionCode"></param>
        /// <returns></returns>
        //public VMenuInfo FindMenuByID(string menuCode, UserInfo user)
        //{
        //    return DBContext.Find<VMenuInfo>(VMenuInfo.Meta.CODE == menuCode & VMenuInfo.Meta.BU == user.BUCode
        //        & VMenuInfo.Meta.SITE == user.SiteCode);
        //}


        public IList <SysRole> GetUserRoles(string userCode)
        {
            return(SpCaller.GetCaller(DBContext).CallGetUserRoles(userCode).ToBusiObjects <SysRole>());
        }