Exemple #1
0
        private StringBuilder UpdateDonorList(string id, string field, string value, string donorEventListId)
        {
            var sbReturn = new StringBuilder();

            try
            {
                var donorList = new DonorList(id);

                switch (field)
                {
                case "AccountName":
                    donorList.AccountName = value;
                    break;

                case "AddressLine1":
                    donorList.AddressLine1 = value;
                    break;

                case "City":
                    donorList.City = value;
                    break;

                case "State":
                    donorList.State = value;
                    break;

                case "PostCode":
                    donorList.PostCode = value;
                    break;

                case "PhoneNumber":
                    donorList.PhoneNumber = value;
                    break;

                case "Email":
                    donorList.EmailAddress = value;
                    break;
                }

                //                donorList.Update();
                donorList.Save();

                var donorEventList = new DonorEventList(User.Identity.Name, int.Parse(donorEventListId))
                {
                    UpdatedInfo         = true,
                    UpdatedInfoDateTime = DateTime.Now,
                    UpdatedInfo_User    = User.Identity.Name
                };
                donorEventList.Update();

                sbReturn.Append("True");
            }
            catch
            {
                sbReturn.Append("Error");
            }

            return(sbReturn);
        }
Exemple #2
0
        private bool UpdateDonorList(DonorList donorList)
        {
            var blReturn = false;

            if (!donorList.AccountName.Equals(txtName.Text))
            {
                donorList.AccountName = txtName.Text;
                blReturn = true;
            }

            if (!donorList.AddressLine1.Equals(txtMailingAddress.Text))
            {
                donorList.AddressLine1 = txtMailingAddress.Text;
                blReturn = true;
            }

            if (!donorList.City.Equals(txtCity.Text))
            {
                donorList.City = txtCity.Text;
                blReturn       = true;
            }

            if (!donorList.State.Equals(ddlState.SelectedValue))
            {
                donorList.State = ddlState.SelectedValue;
                blReturn        = true;
            }

            if (!donorList.PostCode.Equals(txtZipCode.Text))
            {
                donorList.PostCode = txtZipCode.Text;
                blReturn           = true;
            }

            if (!donorList.PhoneNumber.Equals(txtPhoneNumber.Text))
            {
                donorList.PhoneNumber = txtPhoneNumber.Text;
                blReturn = true;
            }

            if (!donorList.EmailAddress.Equals(txtEmail.Text))
            {
                donorList.EmailAddress = txtEmail.Text;
                blReturn = true;
            }

            if (blReturn)
            {
                //                donorList.Update();

                donorList.Save();
            }
            return(blReturn);
        }
Exemple #3
0
        private bool UpdateDonorList(DonorList donorList)
        {
            var result = false;

            if (!donorList.AccountName.Equals(txtName.Text))
            {
                donorList.AccountName = txtName.Text;
                result = true;
            }

            if (!donorList.AddressLine1.Equals(txtAddress.Text))
            {
                donorList.AddressLine1 = txtAddress.Text;
                result = true;
            }

            if (!donorList.AddressLine2.Equals(txtAddress2.Text))
            {
                donorList.AddressLine2 = txtAddress2.Text;
                result = true;
            }

            if (!donorList.AddressLine3.Equals(txtAddress3.Text))
            {
                donorList.AddressLine3 = txtAddress3.Text;
                result = true;
            }


            if (!donorList.City.Equals(txtCity.Text))
            {
                donorList.City = txtCity.Text;
                result         = true;
            }

            if (!donorList.State.Equals(ddlState.SelectedValue))
            {
                donorList.State = ddlState.SelectedValue;
                result          = true;
            }

            if (!donorList.PostCode.Equals(txtZipCode.Text))
            {
                donorList.PostCode = txtZipCode.Text;
                result             = true;
            }

            if (!donorList.PhoneNumber.Equals(txtPhone.Text))
            {
                donorList.PhoneNumber = txtPhone.Text;
                result = true;
            }

            if (!donorList.EmailAddress.Equals(txtEmail.Text))
            {
                donorList.EmailAddress = txtEmail.Text;
                result = true;
            }

            if (result)
            {
                donorList.Save();
            }
            //                donorList.Update();

            return(result);
        }