Beispiel #1
0
        /// <summary>
        /// 判断某个科目是否属于当前账户
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static bool IsGrantSubject(String str)
        {
            DataTable dt = MyUtil.GetMySubject().Tables[0];

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (str.Trim() == dt.Rows[i]["subjectname"].ToString().Trim())
                {
                    return(true);
                }
            }
            return(false);
        }
Beispiel #2
0
        /// <summary>
        /// 获取某个用户的科目ID字符串
        /// </summary>
        /// <returns></returns>
        public static String GetMySubjectString()
        {
            DataTable     dt = MyUtil.GetMySubject().Tables[0];
            StringBuilder sb = new StringBuilder();

            sb.Append(" (");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                sb.Append(dt.Rows[i]["id"].ToString());
                sb.Append(",");
            }
            String str = sb.ToString();

            if (str.EndsWith(","))
            {
                str = str.TrimEnd(',');
            }
            str = str + ")";
            return(str);
        }