locked
error commen userTO RRS feed

  • Question

  • User-657652887 posted

    i put user.cs and userTO.cs in common/data/ ... but it is not working

    get this error


    'UserTO' has not been declared. There may not be accessible due. The specified level of protection.


    'Common' is not declared. There may not be accessible due. The specified level of protection.

    -----------------------------------------------------------------------------------------------------------------------

    header.aspx

    <!DOCTYPE html>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server"></head>
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
    <title>Bingo Spil, Spilleautomater og Poker på internettet</title>
    <META NAME="description" CONTENT="Mormorsbingo - Venha jogar Bingo na Internet em um divertido e amigável ambiente seguro, batendo papo através do chat e conhecendo pessoas de todo o mundo, além de muitas chances de ganhar prêmios fantásticos!">
    <META NAME="keywords" CONTENT="bingo 75, video bingo, bingo online, bingo game, play bingo, site bingo, caça niquel, slots, cartas, baralho, roleta, blackjack, vídeo poker, bacará, keno, roulette, free, gratis, prêmios, prize, apostas, bet, jogos, games, dinheiro, money, internet, downloads, las vegas, loterias, cassino, casino, sorte, lucky, Gambling, halloween, nineballs, pachinko, show ball, texas holden, turbo 90, turbo mania, buraco, canastra, cacheta, pif paf, truco, pontinho, roba monte, sinuca, dominó">
    <META NAME="DC.title" content="Mormorsbingo.dk - Bingo Spil, Spilleautomater, Casino og Poker på internettet">
    <META NAME="expires" CONTENT="never">
    <META NAME="language" CONTENT="Dansk">
    <META NAME="charset" CONTENT="UTF-8">
    <META NAME="distribution" CONTENT="Global">
    <META NAME="robots" content="index,follow,all">
    <META NAME="Classification" content="general">
    <META NAME="revisit-after" content="7 days">
    <META NAME="publisher" CONTENT="www.Mormorsbingo.dk">
    <META NAME="copyright" CONTENT="2017, Mormorsbingo.dk">
    <link rel="STYLESHEET" href='css.css' />
    <link rel="shortcut icon" href="favicon.ico" />
    </head>
    <body>

    <%
    common.Data.UserTO userTO = (common.Data.UserTO)Session["user"];
    if (userTO != null)
    {
    userTO = common.Data.User.GetUserById(userTO.id);
    Session["user"] = userTO;

    if (userTO.access_level == common.Data.Access_Level.Admin)
    {
    users_on.Text = "<table border='0' width='120'><tr><td align='right'>Online:</td><td>" + Application["UsersOn"] + "</td></tr>";
    users_on.Text += "<tr><td align='right'>logget ind:</td><td>" + Global.GetRegisteredCount().ToString() + "</td></tr>";
    users_on.Text += "<tr><td align='right'>Bingo:</td><td>" + Global.GetBingoCount().ToString() + "</td></tr></table>";
    users_on.Text += "</table>";
    users_on.Text += "<br/><p align='right'>[ <a href='luckadmin.aspx'>ADMINPANEL</a> ]</p>";
    }

    if (userTO.access_level != common.Data.Access_Level.Admin)
    {
    users_on.Text += "<table border='0' width='138'><tr><td align='right'><b>Spillere på Bingo:</b></td><td><b>" + Global.GetBingoCount().ToString() + "</b></td></tr></table>";
    }

    System.Collections.Generic.List<Common.Data.MessageTO> messages = common.Data.Message.GetMessagesToUserId(userTO.id, true);
    if (messages.Count > 0)
    {
    imghasmail.ImageUrl = "img/hasmail.gif";
    }
    else
    {
    imghasmail.ImageUrl = "img/avatars/30x30/unknown.png";
    mail.InnerHtml = "";
    }
    }
    else
    {
    mail.InnerHtml = "";
    }
    %>

    <center>
    <!-- --------------------------------------------------------------------------------- -->
    <div style="width:800px;">
    <div style="float:left; width:260px; height:128px; background-image:url('img/header_01.jpg');"></div>
    <div style="float:left; width:270px; height:128px; background-image:url('img/header_02.jpg');">
    </div>
    <div style="padding-left:16px; padding-top:4px; text-align:left; float:left; width:254px; height:124px; background-image:url('img/header_03.jpg');">
    <%
    if (Session["validated"] == null || !(bool)(Session["validated"]))
    {
    %>
    <br />
    <form id="login" method="post" action="Login.aspx" defaultfocus="user">
    <div style="float:left; margin:3px; text-align:right; width:50px;">Bruger:</div><input style="margin:1px;" type="text" maxlength="25" size="16" name="user" /> <br />
    <div style="float:left; margin:3px; text-align:right; width:50px;">Kode:</div><input style="margin:1px;" type="password" maxlength="16" size="16" name="pass" /><br />
    <a href="Register.aspx">registrer</a> og vinde mange præmier!<br />
    <div style="float:left; width:155px; margin-top:8px;"><a href="RecoverPassword.aspx">Jeg har glemt mit kodeord!</a></div>
    <div style="float:left; width:45px; text-align:right; margin-top:8px;"><input type="submit" value="Log ind" /></div>
    </form>
    <%
    }
    else
    {
    %>
    <h3>
    <span class="label">Bruger:</span> <% Response.Write(userTO.nick); %>
    <br />
    <span class="label">balance:</span> <% Response.Write(common.Util.Misc.FormatReal(userTO.credits)); %>
    <br />
    <span class="label">bonus:</span> <% Response.Write(common.Util.Misc.FormatReal(userTO.bonus)); %>
    <br />
    <span class="label">Gevinst:</span> <% Response.Write(common.Util.Misc.FormatReal(userTO.prize)); %>
    </h3>
    <br />
    <a href="Logout.aspx">Log ud</a>
    <div style="; left:-220px; top:-100px; width:150px;">
    <asp:Label ID="users_on" runat="server"></asp:Label>
    </div>
    <div id="mail" style="; left:-175px; top:-80px" runat="server">
    <a href="MyMessages.aspx"><asp:Image id="imghasmail" width="40" Height="30" BorderStyle="None" ToolTip="Du har nye beskeder!" runat="server"></asp:Image></a>
    </div>
    <%
    }
    %>
    </div>
    </div>
    <br />

    <%
    if (Session["validated"] != null && (bool)Session["validated"] == true)
    {
    %>
    <!-- #include file="menu_logged.aspx" -->
    <%
    }
    else
    {
    %>
    <!-- #include file="menu.aspx" -->
    <%
    }
    %>

    ------------------------------------------------------------------

    default.aspx

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
    <!-- #include file="header.aspx" -->

    <div style="width:800px">

    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css">
    <script>
    $(function() {
    $( "#dialog" ).dialog();
    });
    </script>
    </head>
    <body>

    <div id="dialog" title="INFO INFO">
    <p><font size="4">PGA af fejl i vores mail system bilver der ikke sendt bekræftelse mail ud til jer: jeg skal aktiver jer manuelt og gør det løbende hele dagen ellers skriv til postmaster@mormorsbingo.dk<br><br><br></font>
    <font size="3">flere har haft problemer med at oprette sig PGA af de skriver fødseldag forkert, det skal skrives på denne måde EKS: 08/10/2010</font></p>
    </div>

    <div style="float:left; width:503px; height:258px; background-image:url('img/middle_01.jpg');"></div>
    <div style="float:left; width:297px; height:258px; background-image:url('img/middle_02.jpg');"></div>

    <!-- parte inferior esquerda -->
    <form id="winners" runat="server">
    <asp:ToolkitScriptManager id="toolheader" runat="server">
    <Services>
    <asp:ServiceReference Path="~/bin/DataServices.asmx.cs" />
    </Services>
    </asp:ToolkitScriptManager>
    <div style="float:left; width:250px; height:170px; background-image:url('img/middle_03.jpg');">
    <div style="; top:45px;">
    <b>Nylige vindere</b><br />
    <div style="; top:4px;">
    <asp:GridView id="grid" name="grid" runat="server" CssClass="gridStyle">
    <PagerStyle CssClass="gridPager" />
    </asp:GridView>
    </div>
    </div>
    </div>
    </form>

    <!-- parte inferior central -->
    <a href="Bingo.aspx" target="bingo" id="open_bingo" runat="server">
    <div style="float:left; width:300px; height:170px; background-image:url('img/middle_04.jpg');">
    <div style="; top:140px;">
    <asp:Label id="accum" style="font-size:18px" runat="server"></asp:Label>
    </div>
    </div>
    </a>

    <!-- parte inferior direita -->
    <div style="float:left; width:250px; height:170px; background-image:url('img/middle_05.jpg');">
    <div style="; top:45px;">
    <b>Suporte On-Line</b><br /><br />
    <!--Start of Tawk.to Script-->
    <script type="text/javascript">
    var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
    (function(){
    var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
    s1.async=true;
    s1.src='https://embed.tawk.to/58eca82430ab263079b5f4d0/default';
    s1.charset='UTF-8';
    s1.setAttribute('crossorigin','*');
    s0.parentNode.insertBefore(s1,s0);
    })();
    </script>
    <!--End of Tawk.to Script-->
    </div>
    </div>

    </div>

    <!-- #include file="footer.aspx" -->

    -----------------------------------------------------------------------

    userTO.cs

    using System;
    using System.Collections.Generic;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    namespace Common.Data
    {
    using System;

    public class UserTO
    {
    public Access_Level access_level;
    public bool active;
    public string avatar_url;
    public DateTime birthday;
    public float bonus;
    public float credits;
    public string email;
    public string gender;
    public byte how_found;
    public int id;
    public float indication_user_bonus;
    public int indication_user_id;
    public DateTime? last_login;
    public string name;
    public bool newsletters;
    public string nick;
    public string password;
    public float prize;
    public DateTime registered;
    public bool validated;
    }
    }

    Thursday, April 13, 2017 9:36 AM

All replies

  • User-2057865890 posted

    Hi hyggelig75,

    i put user.cs and userTO.cs in common/data/ ... but it is not working

    get this error


    'UserTO' has not been declared. There may not be accessible due. The specified level of protection.


    'Common' is not declared. There may not be accessible due. The specified level of protection.

    To correct this error

    1. Check the spelling of the name in the referring statement.
    2. Check that you have the member access operator (.) between an object and its member.
    3. If the spelling is correct and the syntax of any object member access is correct, verify that the element has been declared.
    4. If the programming element has been declared, check that it is in scope.

    common.Data.UserTO userTO = (common.Data.UserTO)Session["user"];

    Try

    Common.Data.UserTO userTO = (Common.Data.UserTO)Session["user"];

    Best Regards,

    Chris

    Monday, April 17, 2017 2:23 AM