Ejemplo n.º 1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            // update address

            uadd = new BootBaronLib.AppSpec.DasKlub.BOL.UserAddress(Convert.ToInt32(hfUserAddressID.Value));

            uadd.AddressLine1 = txtAddressLine1.Text;
            uadd.AddressLine2 = txtAddressLine2.Text;
            uadd.AddressLine3 = txtAddressLine3.Text;
            uadd.City = txtCity.Text ;
            uadd.FirstName = txtFirstName.Text ;
            uadd.LastName = txtLastName.Text;
            uadd.PostalCode = txtPostalCode.Text;
            uadd.Region = txtRegion.Text;
            uadd.CountryISO = ddlCountry.SelectedValue ;
            uadd.UserAccountID  = Convert.ToInt32(txtUserID.Text);

            if (!string.IsNullOrEmpty(ddlAddressStatus.SelectedValue))
            {
                uadd.AddressStatus = Convert.ToChar(ddlAddressStatus.SelectedValue);
            }

            if (uadd.UserAddressID == 0)
            {
                if (uadd.Create() > 0)
                {
                    litStatus.Text = "created: " + uadd.UserAddressID.ToString();
                }
                else
                {
                    litStatus.Text = "NOTHING CREATED";
                }
            }
            else if (uadd.Update())
            {
                litStatus.Text = "UPDATED: " + uadd.UserAddressID.ToString();
            }
            else
            {
                litStatus.Text = "FAILED TO UPDATE: " + uadd.UserAddressID.ToString();
            }
        }
Ejemplo n.º 2
0
        protected void gvwUserAddresses_SelectedIndexChanged(object sender, EventArgs e)
        {
            // load address
            uadd = new BootBaronLib.AppSpec.DasKlub.BOL.UserAddress(Convert.ToInt32(gvwUserAddresses.SelectedDataKey.Value));

            LoadUserAddress(uadd.UserAccountID);
        }
Ejemplo n.º 3
0
        private void LoadUserAddress(int userAccountID)
        {
            ua = new UserAccount(userAccountID);

            if (uadd == null)
            {
                uadd = new BootBaronLib.AppSpec.DasKlub.BOL.UserAddress( );
                uadd.GetUserAddress(ua.UserAccountID);
            }

            txtUserID.Text = ua.UserAccountID.ToString();
            hfUserAddressID.Value = uadd.UserAddressID.ToString();
            litUserAddressID.Text = uadd.UserAddressID.ToString();
            litFullAddress.Text = uadd.FormattedAddress;

            hlkUserLink.Text = ua.UserName;
            hlkUserLink.NavigateUrl = "/" + ua.UserName;
            hlkUserLink.Target = "_blank";

            txtAddressLine1.Text = uadd.AddressLine1;
            txtAddressLine2.Text = uadd.AddressLine2;
            txtAddressLine3.Text = uadd.AddressLine3;
            txtCity.Text = uadd.City;
            txtFirstName.Text = uadd.FirstName;
            txtLastName.Text = uadd.LastName;
            txtPostalCode.Text = uadd.PostalCode;
            txtRegion.Text = uadd.Region;
            if (!string.IsNullOrEmpty(uadd.CountryISO.Trim()))
            {
                ddlCountry.SelectedValue = uadd.CountryISO;
            }

            litChoice1.Text = "blank";
            litChoice2.Text = "blank";

            litChoice1.Text = uadd.Choice1;
            litChoice2.Text = uadd.Choice2;

            if (uadd.AddressStatus != char.MinValue)
            {
                ddlAddressStatus.SelectedValue = Convert.ToString(uadd.AddressStatus);
            }
            else
            {
                ddlAddressStatus.SelectedIndex = -1;
            }
        }