Пример #1
0
        private static int ComparisonUsage(Data_AppUserFile x, Data_AppUserFile y)
        {
            //StringBuilder sb = new StringBuilder();
            //sb.Append($"{x.AccountStatus.ToString()} vs {y.AccountStatus.ToString()}");
            int ret = 0;

            // 1) Test account types
            if (ret == 0)
            {
                ret = 0 - CompareAccountStatus(x, y);
            }
            if (ret == 0)
            {
                int ix = x.GetCheckerBase(true).AccountImportance1();
                int iy = y.GetCheckerBase(true).AccountImportance1();
                ret = iy - ix;
            }
            if (ret == 0)
            {
                int ix = x.GetCheckerBase(true).AccountImportance2();
                int iy = y.GetCheckerBase(true).AccountImportance2();
                ret = iy - ix;
            }
            if (ret == 0)
            {
                ret = y.UsedInPercent() - x.UsedInPercent();
            }
            //System.Diagnostics.Debug.WriteLine($"{ret} on {sb.ToString()}");
            return(ret);
        }
Пример #2
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>");
    }