Exemplo n.º 1
0
 public static Boolean IsQx(string sMenuID)
 {
     if (Program.sOperID.Trim() == "admin")
     {
         return(true);
     }
     try
     {
         DataView dv = dtQx.DefaultView;
         dv.RowFilter = " MenuID='" + sMenuID + "'";
         if (CommonInfo.CBoolean(dv.ToTable().Rows[0]["IsQx"].ToString()))
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch { return(false); }
 }
Exemplo n.º 2
0
        private void grdLeft_FocusedViewChanged(object sender, DevExpress.XtraGrid.ViewFocusEventArgs e)
        {
            string    sError = " ";
            string    strSql = "SELECT cast(0 AS bit)  AS IsQx,* FROM TQx_Menu WHERE State='使用' order by MenuID  ";
            DataTable dt     = SqlHelper.RunQuery(CommandType.Text, strSql, null, out sError);

            string sRoleID = gridViewLeft.GetDataRow(gridViewLeft.FocusedRowHandle)["RoleID"].ToString();

            strSql = "SELECT * FROM TQx_RoleQx WHERE RoleID='" + sRoleID + "' ";
            DataTable dtQx = SqlHelper.RunQuery(CommandType.Text, strSql, null, out sError);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                try
                {
                    DataView dv = dtQx.DefaultView;
                    dv.RowFilter       = " MenuID='" + dt.Rows[i]["MenuID"].ToString() + "'";
                    dt.Rows[i]["IsQx"] = CommonInfo.CBoolean(dv.ToTable().Rows[0]["IsQx"].ToString());
                }
                catch { }
            }
            grdQx.DataSource = dt;
        }