Beispiel #1
0
        //public Array stringChange(string str)
        //{
        //    string temp = str.Split(',');

        //}
        public static bool isWrite(string UserID, string PageName)
        {
            bool    Write = false;
            string  sql   = "select count(*) from t_R_User_IsWrite where userid = " + UserID + " and (isWrite = 1) and menuid in (select id from t_R_Menu where RelativeFile = '" + PageName + "')";
            DataSet ds    = new MyDataOp(sql).CreateDataSet();

            if (ds.Tables[0].Rows[0][0].ToString() != "0")
            {
                Write = true;
            }
            return(Write);
        }
Beispiel #2
0
        /// <summary>
        /// 将查询的结果绑定到指定的DropDownList中,
        /// </summary>
        /// <param name="strText">DropDownList中前台列表中显示的文字所对应的字段</param>
        /// <param name="strValue">DropDownList中后台对应的值所对应的字段</param>
        /// <param name="strSqlPra">获得绑定内容的查询语句</param>
        /// <param name="drop_TobeBundled">待绑定的DropDownList控件</param>
        /// <returns>返回绑定结果,成功则为true</returns>
        public static bool BindList(string strText, string strValue, string strSqlPra, System.Web.UI.WebControls.CheckBoxList drop_TobeBundled)
        {
            try
            {
                string strSql = strSqlPra;

                MyDataOp mdo = new MyDataOp(strSql);
                DataSet  ds  = mdo.CreateDataSet();
                drop_TobeBundled.DataTextField  = strText;
                drop_TobeBundled.DataValueField = strValue;
                drop_TobeBundled.DataSource     = ds;
                drop_TobeBundled.DataBind();
                return(true);
            }
            catch
            {
                return(false);
            }
        }