Пример #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();
            }
        }