Esempio n. 1
0
        /// <summary>
        /// 获取用户关于表的权限
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="TableID"></param>
        /// <returns></returns>
        public static dyk.Format.Limits GetTableLimits(ClsPage pg, long TableID)
        {
            dyk.Format.Limits res = dyk.Format.Limits.NoLimits();

            #region [=====获取个人权限=====]

            using (dyk.DB.Base.SystemUserLimits.ExecutionExp sul = new dyk.DB.Base.SystemUserLimits.ExecutionExp(pg.BaseConnectString)) {
                sul.GetDatasByUserAndTable(pg.UserInfo.ID, TableID);
                for (int i = 0; i < sul.StructureCollection.Count; i++)
                {
                    dyk.DB.Base.SystemUserLimits.StructureExp st = sul.StructureCollection[i];
                    res.AddLimitsByString(st.Limits);
                }
            }

            #endregion

            #region [=====获取部门权限=====]

            using (dyk.DB.Kernel.SystemDepartmentLimits.ExecutionExp sul = new dyk.DB.Kernel.SystemDepartmentLimits.ExecutionExp(pg.BaseConnectString)) {
                sul.GetDatasByDepartmentAndTable(pg.UserInfo.Department, TableID);
                for (int i = 0; i < sul.StructureCollection.Count; i++)
                {
                    dyk.DB.Kernel.SystemDepartmentLimits.StructureExp st = sul.StructureCollection[i];
                    res.AddLimitsByString(st.Limits);
                }
            }

            #endregion

            #region [=====获取用户组权限=====]

            using (dyk.DB.Kernel.SystemGroupLimits.ExecutionExp sul = new dyk.DB.Kernel.SystemGroupLimits.ExecutionExp(pg.BaseConnectString)) {
                sul.GetDatasByUserAndTable(pg.UserInfo.ID, TableID);
                for (int i = 0; i < sul.StructureCollection.Count; i++)
                {
                    dyk.DB.Kernel.SystemGroupLimits.StructureExp st = sul.StructureCollection[i];
                    res.AddLimitsByString(st.Limits);
                }
            }

            #endregion

            return(res);
        }
Esempio n. 2
0
        /// <summary>
        /// 获取标签
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="cache"></param>
        /// <param name="lm"></param>
        /// <returns></returns>
        public static string GetLabel(dyk.Format.JsonObject obj, dyk.Format.Json cache, dyk.Format.Limits lm)
        {
            string res = "";

            string szID   = obj["ID"].Value;
            string szText = obj["Text"].Value;

            if (szID != "")
            {
                int nIDIndex = cache.GetIndex(szID);
                if (nIDIndex >= 0)
                {
                    szText = cache.Children[nIDIndex].Value;
                }
            }

            res = "<div style=\"position:absolute;";
            if (obj["Left"].Value != "")
            {
                res += "left:" + Ly.String.Source(obj["Left"].Value).toInteger + "px;";
            }
            if (obj["Top"].Value != "")
            {
                res += "top:" + Ly.String.Source(obj["Top"].Value).toInteger + "px;";
            }
            if (obj["Width"].Value != "")
            {
                res += "width:" + Ly.String.Source(obj["Width"].Value).toInteger + "px;";
            }
            if (obj["Height"].Value != "")
            {
                res += "height:" + Ly.String.Source(obj["Height"].Value).toInteger + "px;";
            }
            if (obj["Align"].Value != "")
            {
                res += "text-align:" + obj["Align"].Value + ";";
            }
            res += obj["Style"].Value;
            res += "\">" + szText + "</div>";

            return(res);
        }
Esempio n. 3
0
        /// <summary>
        /// 获取线条
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="cache"></param>
        /// <param name="lm"></param>
        /// <returns></returns>
        public static string GetLine(dyk.Format.JsonObject obj, dyk.Format.Json cache, dyk.Format.Limits lm)
        {
            string res = "";

            res = "<div style=\"position:absolute;";
            if (obj["Left"].Value != "")
            {
                res += "left:" + Ly.String.Source(obj["Left"].Value).toInteger + "px;";
            }
            if (obj["Top"].Value != "")
            {
                res += "top:" + Ly.String.Source(obj["Top"].Value).toInteger + "px;";
            }
            if (obj["Width"].Value != "")
            {
                res += "width:" + Ly.String.Source(obj["Width"].Value).toInteger + "px;";
            }
            if (obj["Height"].Value != "")
            {
                res += "height:" + Ly.String.Source(obj["Height"].Value).toInteger + "px;";
            }
            res += "background:" + obj["Color"].Value + ";";
            res += "\"></div>";

            return(res);
        }