protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            RegistrationFeeTextBoxRFValidator.Enabled = false;
            FeeRegularExpressionValidator.Enabled     = false;
            // Get the common web service instance.
            ServiceAccess serviceLoader = ServiceAccess.GetInstance();
            CommonService.CommonService commonService = serviceLoader.GetCommon();


            // Get the Membership fee
            CommonService.PropertyInfo property = commonService.GetProperty("Membership Fee");

            if (property != null)
            {
                if (property.Value.ToString() != "" && property.Value.ToString() != null)
                {
                    RegistrationFeeLabel.Visible = true;
                    RegistrationFeeLabel.Text    = property.Value.ToString();
                    EditFeeButton.Visible        = true;
                    SaveFeeButton.Visible        = false;
                }
            }
            else
            {
                AddRegistrationFeeButton.Visible = true;
            }
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CancelButton.Attributes.Add("onClick", "return cancelRegistration()");
        if (!Page.IsPostBack)
        {
            // Get the common web service instance.
            ServiceAccess serviceLoader = ServiceAccess.GetInstance();
            CommonService.CommonService commonService = serviceLoader.GetCommon();


            // Get the Membership fee
            CommonService.PropertyInfo property = commonService.GetProperty("Membership Fee");
            MembershipFeeLabel.Text = property.Value.ToString();

            if (Session["registrationInfo"] != null)
            {
                RegistrationService.RegistrationInfo registration = (RegistrationService.RegistrationInfo)Session["registrationInfo"];

                UserNameLabel.Text    = registration.UserName;
                Emailabel.Text        = registration.Email;
                FirstNameLabel.Text   = registration.FirstName;
                MiddleNameLabel.Text  = registration.MiddleName;
                LastNameLabel.Text    = registration.LastName;
                CompanyNameLabel.Text = registration.CompanyName;
                Address1Label.Text    = registration.Address.Address1;
                Address2Label.Text    = registration.Address.Address2;
                CityLabel.Text        = registration.Address.City;
                StateLabel.Text       = registration.Address.State.Name;
                CountryLabel.Text     = registration.Address.Country.Name;
                ZipLabel.Text         = registration.Address.Zip;

                CardTypeLabel.Text   = registration.CreditCard.Type.Name;
                CardNumberLabel.Text = registration.CreditCard.Number.Substring(registration.CreditCard.Number.Length - 4).PadLeft(registration.CreditCard.Number.Length, '*');
                ExpiryDateLabel.Text = registration.CreditCard.ExpirationMonth + " " + registration.CreditCard.ExpirationYear;
                DateTime expiryDate = DateTime.Parse(ExpiryDateLabel.Text);
                ExpiryDateLabel.Text      = expiryDate.ToString("y");
                CardHolderNameLabel.Text  = registration.CreditCard.HolderName;
                BillingAddress1Label.Text = registration.CreditCard.Address.Address1;
                BillingAddress2Label.Text = registration.CreditCard.Address.Address2;
                BillingCityLabel.Text     = registration.CreditCard.Address.City;
                BillingCountryLabel.Text  = registration.CreditCard.Address.Country.Name;
                BillingStateLabel.Text    = registration.CreditCard.Address.State.Name;
                BillingZipLabel.Text      = registration.CreditCard.Address.Zip;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        DontAcceptButton.Attributes.Add("onClick", "return cancelRegistration()");
        if (!Page.IsPostBack)
        {
            // Get the common web service instance.
            ServiceAccess serviceLoader = ServiceAccess.GetInstance();
            CommonService.CommonService commonService = serviceLoader.GetCommon();


            // Get the Membership fee
            CommonService.PropertyInfo property = commonService.GetProperty("Membership Fee");
            MembershipFeeLiteral.Text = property.Value.ToString();

            if (Session["registrationInfo"] != null)
            {
                InitializeValuesFromSession();
            }
        }
    }
Exemplo n.º 4
0
    protected void FinishButton_Click(object sender, EventArgs e)
    {
        ErrorLiteral.Text = "";
        RegistrationService.RegistrationInfo registration = (RegistrationService.RegistrationInfo)Session["registrationInfo"];
        int    userId     = 0;
        string folderPath = Request.PhysicalPath.Replace("AgentRegistrationConf.aspx", "Members\\UserData\\");
        String username   = registration.UserName;

        registration.UserName = username + ";" + folderPath;
        OrderService.OrderInfo orderInfo = new OrderService.OrderInfo();
        int membershipFee;

        try
        {
            // Get the service loader
            ServiceAccess serviceLoader = ServiceAccess.GetInstance();

            CommonService.CommonService commonService = serviceLoader.GetCommon();
            // Get the Membership fee
            CommonService.PropertyInfo property = commonService.GetProperty("Membership Fee");
            membershipFee = Convert.ToInt32(property.Value);


            // Insert the registration details


            RegistrationService.RegistrationService registrationService = serviceLoader.GetRegistration();
            userId = registrationService.Insert(registration);
            registration.UserName = username;


            // Insert the membership details

            if (registration.Role == Irmac.MailingCycle.BLLServiceLoader.Registration.UserRole.Agent)
            {
                try
                {
                    OrderService.CreditCardInfo creditCard = new OrderService.CreditCardInfo();

                    OrderService.StateInfo billingState = new OrderService.StateInfo();
                    billingState.StateId = registration.Address.State.StateId;
                    billingState.Name    = registration.Address.State.Name;

                    OrderService.CountryInfo billingCountry = new OrderService.CountryInfo();
                    billingCountry.CountryId = registration.Address.Country.CountryId;
                    billingCountry.Name      = registration.Address.Country.Name;

                    OrderService.AddressInfo billingAddress = new OrderService.AddressInfo();
                    billingAddress.Address1 = registration.Address.Address1;
                    billingAddress.Address2 = registration.Address.Address2;
                    billingAddress.City     = registration.Address.City;
                    billingAddress.State    = billingState;
                    billingAddress.Zip      = registration.Address.Zip;
                    billingAddress.Country  = billingCountry;

                    OrderService.LookupInfo creditCardType = new OrderService.LookupInfo();
                    creditCardType.LookupId = registration.CreditCard.Type.LookupId;
                    creditCardType.Name     = registration.CreditCard.Type.Name;

                    creditCard.Type            = creditCardType;
                    creditCard.Number          = registration.CreditCard.Number;
                    creditCard.CvvNumber       = registration.CreditCard.CvvNumber;
                    creditCard.HolderName      = registration.CreditCard.HolderName;
                    creditCard.ExpirationMonth = registration.CreditCard.ExpirationMonth;
                    creditCard.ExpirationYear  = registration.CreditCard.ExpirationYear;
                    creditCard.Address         = billingAddress;

                    orderInfo.Number             = 100;
                    orderInfo.Type               = Irmac.MailingCycle.BLLServiceLoader.Order.OrderType.MembershipFee;
                    orderInfo.Date               = DateTime.Now;
                    orderInfo.Amount             = membershipFee;
                    orderInfo.CreditCard         = creditCard;
                    orderInfo.TransactionCode    = -1;
                    orderInfo.TransactionMessage = "Dummy Transaction";
                    orderInfo.Items              = null;

                    OrderService.OrderService orderService = serviceLoader.GetOrder();
                    orderService.Insert(userId, orderInfo, userId);
                }
                catch (Exception ex)
                {
                    log.Error("Transaction is not sucessful", ex);
                    ErrorLiteral.Text = "credit card transaction failed";
                }
            }
        }
        catch (Exception ex)
        {
            log.Error("User Registration is not sucessful", ex);
            ErrorLiteral.Text = "User registration failed" + " | " + ex.Message + " | " + ex.StackTrace.ToString();
        }

        if (ErrorLiteral.Text == "")
        {
            RegistrationService.LoginInfo loginInfo = new RegistrationService.LoginInfo();
            loginInfo.UserId    = userId;
            loginInfo.UserName  = registration.UserName;
            loginInfo.FirstName = registration.FirstName;
            loginInfo.LastName  = registration.LastName;
            loginInfo.Role      = registration.Role;
            loginInfo.Status    = registration.Status;

            SendRegistrationEmail(registration);
            Session["registrationInfo"] = null;
            Session["loginInfo"]        = loginInfo;
            Response.Redirect("AgentRegistrationThanks.aspx");
        }
    }