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 GetData_Click(object sender, EventArgs e)
    {
        try
        {
            IMyLog           log  = MyLog.GetLogger("DataAll");
            Data_AppUserFile user = DSSwitch.appUser().RetrieveOne(I_UserEmail.Text, log);
            if (user == null)
            {
                I_UserEmail.Text = I_UserEmail.Text + " not found";
            }
            else
            {
                sectionEmailInput.Visible = false;

                L_FileVersion.Text             = user._FileVersion.ToString();
                L_UserName.Text                = user.UserName;
                L_UserEmail.Text               = user.Email;
                L_UserPassword.Text            = user.Password;
                L_AllTelNumbers.TextMode       = TextBoxMode.MultiLine;
                L_AllTelNumbers.Text           = user.MobileNumbers_AllConfirmed__.getVal.My_MobileNumbers_AddNewLine();
                L_AllTelNumbers.Rows           = 2 + user.MobileNumbers_AllConfirmed__.MobileNumbersCount;
                L_AllUnconfTelNumbers.TextMode = TextBoxMode.MultiLine;
                L_AllUnconfTelNumbers.Text     = user.MobileNumbers_AllUnConfirmed__.getVal.My_MobileNumbers_AddNewLine();
                L_AllUnconfTelNumbers.Rows     = 2 + user.MobileNumbers_AllUnConfirmed__.MobileNumbersCount;
                L_ApiGuId.Text                           = user.ApiGuId;
                L_CreationIp.Text                        = user.CreationIp;
                L_CountryName.Text                       = HttpUtility.HtmlEncode(CountryListLoader.Lookup(user.MainTelNo()));
                L_CreatedDate.Text                       = user.CreationDate.ToSwissTime(true);
                L_Status.Text                            = Data_AppUserFile.GetNiceStatusText(user.AccountStatus);
                L_StatusExplained.InnerHtml              = Data_AppUserFile.GetAccountStatusExplanationHtml();
                L_Comment.TextMode                       = TextBoxMode.MultiLine;
                L_Comment.Text                           = user.Comment;
                L_Comment.Rows                           = user.Comment.Split(null).Length + 2;
                L_DeleteOnFailed.Checked                 = user.DeleteOnFailed;
                L_AddNumberAllowedWithAPI.Checked        = user.AddNumber_AllowedWithAPI;
                L_AddNumberActivateOnSyncRequest.Checked = user.AddNumber_ActivateOnSyncRequest;

                Lf_LastMsgQueued.Text     = user.FreeAccount.free_LastMsgQueued.ToUkTime(true);
                Lf_MsgSent.Text           = user.FreeAccount.free_MsgSent.ToString();
                Lf_MsgLeft.Text           = user.FreeAccount.free_MsgLeft.ToString();
                Lf_MinDelayInSeconds.Text = user.FreeAccount.free_MinDelayInSeconds.ToString();
                Lf_SendFooter.Checked     = user.FreeAccount.free_SendFooter;
                Lf_WelcomeCounter.Text    = user.FreeAccount.free_WelcomeCounter.ToString();
                Lf_MsgQueued.Text         = user.FreeAccount.free_MsgQueued.ToString();

                Lm_LastMsgQueued.Text     = user.MonthlyAccount.monthly_LastMsgQueued.ToUkTime(true);
                Lm_MsgSent.Text           = user.MonthlyAccount.monthly_MsgSent.ToString();
                Lm_PaidUntil.Text         = user.MonthlyAccount.monthly_PaidUntil.ToUkTime(false);
                Lm_MinDelayInSeconds.Text = user.MonthlyAccount.monthly_MinDelayInSeconds.ToString();
                Lm_CostPerNumber.Text     = user.MonthlyAccount.monthly_CostPerNumber.ToString();
                Lm_CurrentCredit.Text     = user.MonthlyAccount.monthly_CurrentCredit.ToString();

                Lm2_LastMsgQueued.Text         = user.MonthlyDifPriceAccount.monthlyDifPrice_LastMsgQueued.ToUkTime(true);
                Lm2_TotalMsgSent.Text          = user.MonthlyDifPriceAccount.monthlyDifPrice_TotalMsgSent.ToString();
                Lm2_ThisMonthMsgSent.Text      = user.MonthlyDifPriceAccount.monthlyDifPrice_ThisMonthMsgSent.ToString();
                Lm2_PeriodeStart.Text          = user.MonthlyDifPriceAccount.monthlDifPricey_PeriodeStart.ToUkTime(true);
                Lm2_PeriodeDurationInDays.Text = user.MonthlyDifPriceAccount.monthlyDifPrice_PeriodeDurationInDays.ToString();
                Lm2_MinDelayInSeconds.Text     = user.MonthlyDifPriceAccount.monthlyDifPrice_MinDelayInSeconds.ToString();
                Lm2_CostPerNumber.Text         = user.MonthlyDifPriceAccount.monthlyDifPrice_CostPerNumber.ToString();
                Lm2_CurrentCredit.Text         = user.MonthlyDifPriceAccount.monthlyDifPrice_CurrentCredit.ToString();
                Lm2_LevelDefinitions.Text      = user.MonthlyDifPriceAccount.monthlyDifPrice_LevelDefinitions;
                Lm2_Level.Text = user.MonthlyDifPriceAccount.monthlyDifPrice_Level.ToString();
                Lm2_AutoInceremntLevel.Checked    = user.MonthlyDifPriceAccount.monthlyDifPrice_AutoInceremntLevel;
                Lm2_AutoRenewMonthPayment.Checked = user.MonthlyDifPriceAccount.monthlyDifPrice_AutoRenewMonthPayment;

                Lp_LastMsgQueued.Text     = user.PayAsSentAccount.payAsSent_LastMsgQueued.ToUkTime(true);
                Lp_MsgSent.Text           = user.PayAsSentAccount.payAsSent_MsgSent.ToString();
                Lp_MinDelayInSeconds.Text = user.PayAsSentAccount.payAsSent_MinDelayInSeconds.ToString();
                Lp_CostPerNumber.Text     = user.PayAsSentAccount.payAsSent_CostPerNumber.ToString();
                Lp_CostPerMessage.Text    = user.PayAsSentAccount.payAsSent_CostPerMessage.ToString();
                Lp_CurrentCredit.Text     = user.PayAsSentAccount.payAsSent_CurrentCredit.ToString();

                Ld_LastMsgQueued.Text = user.SystemDuplicationAccount.systemDuplication_LastMsgQueued.ToUkTime(true);
                Ld_MsgSent.Text       = user.SystemDuplicationAccount.systemDuplication_MsgSent.ToString();
                Ld_PaidUntil.Text     = user.SystemDuplicationAccount.systemDuplication_PaidUntil.ToUkTime(true);

                // set visibility
                switch (user.AccountStatus)
                {
                case Data_AppUserFile.eUserStatus.free_account:
                    sectinDetails.Visible            = true;
                    sectionFree.Visible              = true;
                    sectionMonthly.Visible           = false;
                    sectionMonthlyDifPrice.Visible   = false;
                    sectionPayAsSent.Visible         = false;
                    sectionSystemDuplication.Visible = false;
                    break;

                case Data_AppUserFile.eUserStatus.commercial_monthly:
                    sectinDetails.Visible            = true;
                    sectionFree.Visible              = false;
                    sectionMonthly.Visible           = true;
                    sectionMonthlyDifPrice.Visible   = false;
                    sectionPayAsSent.Visible         = false;
                    sectionSystemDuplication.Visible = false;
                    break;

                case Data_AppUserFile.eUserStatus.commercial_monthlyDifPrice:
                    sectinDetails.Visible            = true;
                    sectionFree.Visible              = false;
                    sectionMonthly.Visible           = false;
                    sectionMonthlyDifPrice.Visible   = true;
                    sectionPayAsSent.Visible         = false;
                    sectionSystemDuplication.Visible = false;
                    break;

                case Data_AppUserFile.eUserStatus.commercial_payassent:
                    sectinDetails.Visible            = true;
                    sectionFree.Visible              = false;
                    sectionMonthly.Visible           = false;
                    sectionMonthlyDifPrice.Visible   = false;
                    sectionPayAsSent.Visible         = true;
                    sectionSystemDuplication.Visible = false;
                    break;

                case Data_AppUserFile.eUserStatus.commercial_systemDuplication:
                    sectinDetails.Visible            = true;
                    sectionFree.Visible              = false;
                    sectionMonthly.Visible           = false;
                    sectionMonthlyDifPrice.Visible   = false;
                    sectionPayAsSent.Visible         = false;
                    sectionSystemDuplication.Visible = true;
                    break;

                default:
                    sectinDetails.Visible            = true;
                    sectionFree.Visible              = true;
                    sectionMonthly.Visible           = true;
                    sectionMonthlyDifPrice.Visible   = true;
                    sectionPayAsSent.Visible         = true;
                    sectionSystemDuplication.Visible = true;

                    break;
                }
            }
        }
        catch (DataUnavailableException)
        {
            DSSwitch.OnDataUnavailableException(this);
        }
    }