Ejemplo n.º 1
0
    private void showUsers_tableEntry(Data_AppUserFile u1, string emailFile)
    {
        Response.Write("<tr>");
        Response.Write("<td>" + HttpUtility.HtmlEncode(u1.Email) + "</td>");

        Response.Write("<td>" + HttpUtility.HtmlEncode(CountryListLoader.Lookup(u1.MainTelNo())) + "</td>");
        Response.Write("<td>" + u1.MobileNumbersCount().ToString() + "</td>");
        Response.Write("<td>" + new DateTime(u1.CreationDate).ToString("dd/MM/yyyy") + "</td>");
        Response.Write("<td>" + u1.UsedInPercent().ToString() + "</td>");
        if (u1.QueuedCount() > 0)
        {
            Response.Write("<td>" + u1.QueuedCount().ToString() + "</td>");
        }
        else
        {
            Response.Write("<td></td>");
        }

        if (
            (u1.AccountStatus == Data_AppUserFile.eUserStatus.free_account) ||
            (u1.AccountStatus == Data_AppUserFile.eUserStatus.commercial_monthly) ||
            (u1.AccountStatus == Data_AppUserFile.eUserStatus.commercial_payassent) ||
            (u1.AccountStatus == Data_AppUserFile.eUserStatus.commercial_monthlyDifPrice) ||
            (u1.AccountStatus == Data_AppUserFile.eUserStatus.commercial_systemDuplication))
        {
            // commercial or acive free
            Response.Write("<td><a href=\"Test?Id=ShowSentMessages&u=" + emailFile + "\" target=\"_blank\">" + u1.AccountStatus.ToString() + "</a></td>");
        }
        else
        {
            // not active yet
            Response.Write("<td>" + HttpUtility.HtmlEncode(u1.AccountStatus.ToString()) + "</td>");
        }

        if (
            (u1.AccountStatus == Data_AppUserFile.eUserStatus.commercial_monthly) ||
            (u1.AccountStatus == Data_AppUserFile.eUserStatus.commercial_payassent) ||
            (u1.AccountStatus == Data_AppUserFile.eUserStatus.commercial_monthlyDifPrice) ||
            (u1.AccountStatus == Data_AppUserFile.eUserStatus.commercial_systemDuplication))
        {
            string edit = "edit " + u1.GetCheckerBase(true).Info(u1);
            Response.Write("<td><a href=\"DataAll?user="******"\" target=\"_blank\">" + edit + "</a></td>");
        }
        else
        {
            Response.Write("<td><a href=\"DataAll?user="******"\" target=\"_blank\">" + "edit" + "</a></td>");
        }

        Response.Write("<td></td>");
        //Response.Write("<td><a href=\"Test?Id=SendWelcomeSMS&u=" + emailFile + "\" target=\"_blank\">" + "WA_Wel" + "</a></td>");
        //Response.Write("<td><a href=\"Test?Id=SendJustActivated&u=" + emailFile + "\" target=\"_blank\">" + "E_OnNow" + "</a></td>");
        Response.Write("</tr>");
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // This comes from a logged in user
        try
        {
            NiceASP.SessionData.LoggedOnOrRedirectToLogin(Session, Response, Request);

            if (!IsPostBack)
            {
                SessionData sd = ConstantStrings.GetSessionData(Session);
                // refresh from file
                IMyLog log = MyLog.GetLogger("Details");

                Data_AppUserFile user = DSSwitch.appUser().RetrieveOne(sd.LoggedOnUserEmail, log);

                UserName.Text  = user.UserName;
                UserEmail.Text = user.Email;
                if (user.MobileNumbersCount() > 5)
                {
                    Tel1.Text = Tel2.Text = Tel3.Text = Tel4.Text = Tel5.Text = "Many";
                }
                else
                {
                    Tel1.Text = user.MobileNumberX(0);
                    Tel2.Text = user.MobileNumberX(1);
                    Tel3.Text = user.MobileNumberX(2);
                    Tel4.Text = user.MobileNumberX(3);
                    Tel5.Text = user.MobileNumberX(4);
                }
                ApiGuId.Text = user.ApiGuId;
                Status.Text  = Data_AppUserFile.GetNiceStatusText(user.AccountStatus);
            }
        }
        catch (DataUnavailableException)
        {
            DSSwitch.OnDataUnavailableException(this);
        }
    }